@qonto/embed-sdk 0.64.3 → 0.66.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 (474) hide show
  1. package/dist/_virtual/Observable.js +1 -0
  2. package/dist/_virtual/index2.js +1 -1
  3. package/dist/_virtual/index3.js +1 -0
  4. package/dist/auth-links/auth-links.d.ts +7 -7
  5. package/dist/auth-links/auth-links.d.ts.map +1 -1
  6. package/dist/auth-links/client/auth-links.client.d.ts +5 -6
  7. package/dist/auth-links/client/auth-links.client.d.ts.map +1 -1
  8. package/dist/auth-links/index.d.ts +6 -4
  9. package/dist/auth-links/index.d.ts.map +1 -1
  10. package/dist/beneficiaries/beneficiaries.d.ts +10 -10
  11. package/dist/beneficiaries/beneficiaries.d.ts.map +1 -1
  12. package/dist/beneficiaries/client/beneficiaries.client.d.ts +11 -13
  13. package/dist/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
  14. package/dist/beneficiaries/index.d.ts +1 -1
  15. package/dist/cards/client/cards.client.d.ts +11 -11
  16. package/dist/cards/client/cards.client.d.ts.map +1 -1
  17. package/dist/cards/index.d.ts +6 -3
  18. package/dist/cards/index.d.ts.map +1 -1
  19. package/dist/index.umd.js +4 -4
  20. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -0
  21. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
  22. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -0
  23. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
  24. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -0
  25. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
  26. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
  27. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -0
  28. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
  29. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
  30. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js +1 -1
  31. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -1
  32. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
  33. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
  34. package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
  35. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/fetch.js +1 -0
  36. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -0
  37. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
  38. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
  39. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
  40. package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1 → node_modules/.pnpm/@amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -1
  41. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -0
  42. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -0
  43. package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
  44. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
  45. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +1 -0
  46. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js +1 -0
  47. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js +1 -0
  48. package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +1 -1
  49. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -0
  50. package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-action-click.js +1 -1
  51. package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -1
  52. package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -1
  53. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-exposure.js +1 -0
  54. package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -1
  55. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-scroll.js +1 -0
  56. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +1 -0
  57. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-viewport-content-updated.js +1 -0
  58. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -0
  59. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
  60. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +1 -0
  61. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -0
  62. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
  63. package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
  64. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/element-path.js +1 -0
  65. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
  66. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
  67. package/dist/node_modules/.pnpm/@amplitude_plugin-custom-enrichment-browser@0.1.1/node_modules/@amplitude/plugin-custom-enrichment-browser/lib/esm/custom-enrichment.js +1 -0
  68. package/dist/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +1 -0
  69. package/dist/{server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2 → node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/track-network-event.js +1 -1
  70. package/dist/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.7.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -0
  71. package/dist/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.9.3/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -0
  72. package/dist/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/web-vitals-plugin.js +1 -1
  73. package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js +1 -1
  74. package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js +1 -1
  75. package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js +1 -1
  76. package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js +1 -1
  77. package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/types.js +1 -1
  78. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/client.js +1 -1
  79. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/eventbuilder.js +1 -1
  80. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/helpers.js +1 -1
  81. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
  82. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
  83. package/dist/node_modules/.pnpm/@sentry_browser@10.45.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browsersession.js +1 -0
  84. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/culturecontext.js +1 -1
  85. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
  86. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/httpcontext.js +1 -1
  87. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/linkederrors.js +1 -1
  88. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/sdk.js +1 -1
  89. package/dist/node_modules/.pnpm/@sentry_browser@10.45.0/node_modules/@sentry/browser/build/npm/esm/prod/stack-parsers.js +1 -0
  90. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/transports/fetch.js +1 -1
  91. package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
  92. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/client.js +1 -0
  93. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/exports.js +1 -0
  94. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/integrations/eventFilters.js +1 -0
  95. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/baggage.js +1 -0
  96. package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/browser.js +1 -1
  97. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/envelope.js +1 -0
  98. package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/misc.js +1 -1
  99. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/object.js +1 -0
  100. package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/version.js +1 -0
  101. package/dist/node_modules/.pnpm/safe-json-stringify@1.2.0/node_modules/safe-json-stringify/index.js +1 -1
  102. package/dist/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/index.js +1 -0
  103. package/dist/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/lib/Observable.js +1 -0
  104. package/dist/organizations/client/organizations.client.d.ts +4 -24
  105. package/dist/organizations/client/organizations.client.d.ts.map +1 -1
  106. package/dist/organizations/index.d.ts +1 -7
  107. package/dist/organizations/index.d.ts.map +1 -1
  108. package/dist/organizations/index.server.d.ts +1 -1
  109. package/dist/organizations/index.server.d.ts.map +1 -1
  110. package/dist/payment-links/client/payment-links.client.d.ts +4 -40
  111. package/dist/payment-links/client/payment-links.client.d.ts.map +1 -1
  112. package/dist/payment-links/index.d.ts +1 -1
  113. package/dist/sca/sca.d.ts.map +1 -1
  114. package/dist/server/_virtual/Observable.js +1 -0
  115. package/dist/server/_virtual/index2.js +1 -1
  116. package/dist/server/_virtual/index3.js +1 -0
  117. package/dist/server/auth-links/auth-links.d.ts +7 -7
  118. package/dist/server/auth-links/auth-links.d.ts.map +1 -1
  119. package/dist/server/auth-links/client/auth-links.client.d.ts +5 -6
  120. package/dist/server/auth-links/client/auth-links.client.d.ts.map +1 -1
  121. package/dist/server/auth-links/index.d.ts +6 -4
  122. package/dist/server/auth-links/index.d.ts.map +1 -1
  123. package/dist/server/beneficiaries/beneficiaries.d.ts +10 -10
  124. package/dist/server/beneficiaries/beneficiaries.d.ts.map +1 -1
  125. package/dist/server/beneficiaries/client/beneficiaries.client.d.ts +11 -13
  126. package/dist/server/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
  127. package/dist/server/beneficiaries/index.d.ts +1 -1
  128. package/dist/server/cards/client/cards.client.d.ts +11 -11
  129. package/dist/server/cards/client/cards.client.d.ts.map +1 -1
  130. package/dist/server/cards/index.d.ts +6 -3
  131. package/dist/server/cards/index.d.ts.map +1 -1
  132. package/dist/server/index.server.umd.js +1 -1
  133. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -0
  134. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
  135. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -0
  136. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
  137. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -0
  138. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
  139. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
  140. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -0
  141. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
  142. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
  143. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js +1 -1
  144. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -1
  145. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
  146. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
  147. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
  148. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/fetch.js +1 -0
  149. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -0
  150. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
  151. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
  152. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
  153. package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.40.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -1
  154. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -0
  155. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -0
  156. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
  157. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
  158. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +1 -0
  159. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js +1 -0
  160. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js +1 -0
  161. package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +1 -1
  162. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -0
  163. package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-action-click.js +1 -1
  164. package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -1
  165. package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -1
  166. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-exposure.js +1 -0
  167. package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -1
  168. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-scroll.js +1 -0
  169. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +1 -0
  170. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-viewport-content-updated.js +1 -0
  171. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -0
  172. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
  173. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +1 -0
  174. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -0
  175. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
  176. package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
  177. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/element-path.js +1 -0
  178. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
  179. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
  180. package/dist/server/node_modules/.pnpm/@amplitude_plugin-custom-enrichment-browser@0.1.1/node_modules/@amplitude/plugin-custom-enrichment-browser/lib/esm/custom-enrichment.js +1 -0
  181. package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +1 -0
  182. package/dist/{node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2 → server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/track-network-event.js +1 -1
  183. package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.7.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -0
  184. package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.9.3/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -0
  185. package/dist/server/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/web-vitals-plugin.js +1 -1
  186. package/dist/server/node_modules/.pnpm/safe-json-stringify@1.2.0/node_modules/safe-json-stringify/index.js +1 -1
  187. package/dist/server/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/index.js +1 -0
  188. package/dist/server/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/lib/Observable.js +1 -0
  189. package/dist/server/organizations/client/organizations.client.d.ts +4 -24
  190. package/dist/server/organizations/client/organizations.client.d.ts.map +1 -1
  191. package/dist/server/organizations/index.d.ts +1 -7
  192. package/dist/server/organizations/index.d.ts.map +1 -1
  193. package/dist/server/organizations/index.server.d.ts +1 -1
  194. package/dist/server/organizations/index.server.d.ts.map +1 -1
  195. package/dist/server/payment-links/client/payment-links.client.d.ts +4 -40
  196. package/dist/server/payment-links/client/payment-links.client.d.ts.map +1 -1
  197. package/dist/server/payment-links/index.d.ts +1 -1
  198. package/dist/server/sca/sca.d.ts.map +1 -1
  199. package/dist/server/src/auth-links/auth-links.js +1 -1
  200. package/dist/server/src/beneficiaries/beneficiaries.js +1 -1
  201. package/dist/server/src/common/analytics/amplitude-manager.js +1 -1
  202. package/dist/server/transactions/client/transactions.client.d.ts +1 -2
  203. package/dist/server/transactions/client/transactions.client.d.ts.map +1 -1
  204. package/dist/src/auth-links/client/auth-links.client.js +1 -1
  205. package/dist/src/beneficiaries/beneficiaries.js +1 -1
  206. package/dist/src/beneficiaries/client/beneficiaries.client.js +1 -1
  207. package/dist/src/cards/client/cards.client.js +1 -1
  208. package/dist/src/common/analytics/amplitude-manager.js +1 -1
  209. package/dist/src/common/sentry/sentry-manager.js +1 -1
  210. package/dist/src/organizations/client/organizations.client.js +1 -1
  211. package/dist/src/payment-links/client/payment-links.client.js +1 -1
  212. package/dist/src/sca/sca.js +1 -1
  213. package/dist/src/transactions/client/transactions.client.js +1 -1
  214. package/dist/transactions/client/transactions.client.d.ts +1 -2
  215. package/dist/transactions/client/transactions.client.d.ts.map +1 -1
  216. package/package.json +5 -5
  217. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +0 -1
  218. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
  219. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +0 -1
  220. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
  221. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +0 -1
  222. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
  223. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +0 -1
  224. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
  225. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +0 -1
  226. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
  227. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
  228. package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
  229. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +0 -1
  230. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +0 -1
  231. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
  232. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -1
  233. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
  234. package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +0 -1
  235. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +0 -1
  236. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +0 -1
  237. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
  238. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +0 -1
  239. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +0 -1
  240. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
  241. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
  242. package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +0 -1
  243. package/dist/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +0 -1
  244. package/dist/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.6.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +0 -1
  245. package/dist/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.7.2/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +0 -1
  246. package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browsersession.js +0 -1
  247. package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/stack-parsers.js +0 -1
  248. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/client.js +0 -1
  249. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/exports.js +0 -1
  250. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/eventFilters.js +0 -1
  251. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/baggage.js +0 -1
  252. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/envelope.js +0 -1
  253. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/object.js +0 -1
  254. package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/version.js +0 -1
  255. package/dist/node_modules/.pnpm/zen-observable-ts@1.1.0/node_modules/zen-observable-ts/module.js +0 -1
  256. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +0 -1
  257. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
  258. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +0 -1
  259. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
  260. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +0 -1
  261. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
  262. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +0 -1
  263. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
  264. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +0 -1
  265. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
  266. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
  267. package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
  268. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +0 -1
  269. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +0 -1
  270. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
  271. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -1
  272. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
  273. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +0 -1
  274. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +0 -1
  275. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +0 -1
  276. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
  277. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +0 -1
  278. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +0 -1
  279. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
  280. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
  281. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +0 -1
  282. package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +0 -1
  283. package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.6.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +0 -1
  284. package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.7.2/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +0 -1
  285. package/dist/server/node_modules/.pnpm/zen-observable-ts@1.1.0/node_modules/zen-observable-ts/module.js +0 -1
  286. /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
  287. /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
  288. /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
  289. /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
  290. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
  291. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +0 -0
  292. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
  293. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
  294. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -0
  295. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +0 -0
  296. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +0 -0
  297. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -0
  298. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
  299. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +0 -0
  300. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
  301. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
  302. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +0 -0
  303. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +0 -0
  304. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +0 -0
  305. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +0 -0
  306. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +0 -0
  307. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +0 -0
  308. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +0 -0
  309. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +0 -0
  310. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
  311. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js +0 -0
  312. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
  313. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +0 -0
  314. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
  315. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +0 -0
  316. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -0
  317. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
  318. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
  319. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -0
  320. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
  321. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
  322. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
  323. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
  324. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
  325. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
  326. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +0 -0
  327. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +0 -0
  328. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +0 -0
  329. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
  330. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
  331. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +0 -0
  332. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
  333. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
  334. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
  335. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +0 -0
  336. /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +0 -0
  337. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-change.js +0 -0
  338. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-click.js +0 -0
  339. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -0
  340. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/actions.js +0 -0
  341. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
  342. /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +0 -0
  343. /package/dist/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.8.2 → @amplitude_plugin-network-capture-browser@1.9.10}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/constants.js +0 -0
  344. /package/dist/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.7.2 → @amplitude_plugin-page-view-tracking-browser@2.9.3}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js +0 -0
  345. /package/dist/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
  346. /package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js +0 -0
  347. /package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/debug-build.js +0 -0
  348. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/api.js +0 -0
  349. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/asyncContext/index.js +0 -0
  350. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js +0 -0
  351. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/breadcrumbs.js +0 -0
  352. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/carrier.js +0 -0
  353. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/constants.js +0 -0
  354. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/currentScopes.js +0 -0
  355. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/debug-build.js +0 -0
  356. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/defaultScopes.js +0 -0
  357. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/envelope.js +0 -0
  358. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/eventProcessors.js +0 -0
  359. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/console.js +0 -0
  360. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/fetch.js +0 -0
  361. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/globalError.js +0 -0
  362. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/globalUnhandledRejection.js +0 -0
  363. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/handlers.js +0 -0
  364. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integration.js +0 -0
  365. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/conversationId.js +0 -0
  366. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/dedupe.js +0 -0
  367. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/functiontostring.js +0 -0
  368. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/logs/envelope.js +0 -0
  369. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/logs/internal.js +0 -0
  370. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/metrics/envelope.js +0 -0
  371. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/metrics/internal.js +0 -0
  372. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/scope.js +0 -0
  373. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/sdk.js +0 -0
  374. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/semanticAttributes.js +0 -0
  375. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/session.js +0 -0
  376. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js +0 -0
  377. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/spanstatus.js +0 -0
  378. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/utils.js +0 -0
  379. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/transports/base.js +0 -0
  380. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/aggregate-errors.js +0 -0
  381. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/breadcrumb-log-level.js +0 -0
  382. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/clientreport.js +0 -0
  383. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/debug-ids.js +0 -0
  384. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/debug-logger.js +0 -0
  385. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/dsn.js +0 -0
  386. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/env.js +0 -0
  387. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/eventUtils.js +0 -0
  388. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/eventbuilder.js +0 -0
  389. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/hasSpansEnabled.js +0 -0
  390. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/ipAddress.js +0 -0
  391. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/is.js +0 -0
  392. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/merge.js +0 -0
  393. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/normalize.js +0 -0
  394. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/parseSampleRate.js +0 -0
  395. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +0 -0
  396. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/promisebuffer.js +0 -0
  397. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/propagationContext.js +0 -0
  398. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js +0 -0
  399. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/ratelimit.js +0 -0
  400. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/scopeData.js +0 -0
  401. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/sdkMetadata.js +0 -0
  402. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/severity.js +0 -0
  403. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/should-ignore-span.js +0 -0
  404. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/spanOnScope.js +0 -0
  405. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/spanUtils.js +0 -0
  406. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/stacktrace.js +0 -0
  407. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/string.js +0 -0
  408. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/supports.js +0 -0
  409. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/syncpromise.js +0 -0
  410. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/time.js +0 -0
  411. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/timer.js +0 -0
  412. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/transactionEvent.js +0 -0
  413. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/url.js +0 -0
  414. /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/worldwide.js +0 -0
  415. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
  416. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
  417. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
  418. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
  419. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
  420. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +0 -0
  421. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
  422. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
  423. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -0
  424. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +0 -0
  425. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +0 -0
  426. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -0
  427. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
  428. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +0 -0
  429. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
  430. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
  431. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +0 -0
  432. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +0 -0
  433. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +0 -0
  434. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +0 -0
  435. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +0 -0
  436. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +0 -0
  437. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +0 -0
  438. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +0 -0
  439. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
  440. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js +0 -0
  441. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
  442. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +0 -0
  443. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
  444. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +0 -0
  445. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -0
  446. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
  447. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
  448. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -0
  449. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
  450. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
  451. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
  452. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
  453. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
  454. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
  455. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +0 -0
  456. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +0 -0
  457. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +0 -0
  458. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
  459. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
  460. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +0 -0
  461. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
  462. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
  463. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
  464. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +0 -0
  465. /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +0 -0
  466. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-change.js +0 -0
  467. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-click.js +0 -0
  468. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -0
  469. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/actions.js +0 -0
  470. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
  471. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +0 -0
  472. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.8.2 → @amplitude_plugin-network-capture-browser@1.9.10}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/constants.js +0 -0
  473. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.7.2 → @amplitude_plugin-page-view-tracking-browser@2.9.3}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js +0 -0
  474. /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}class n{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return n.instance||(n.instance=new n),n.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const r=n.getInstance();class i extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class o extends i{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function s(){if(!r.hasAccessToken())throw new o;return r.getAccessToken()}function a(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}const c={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},u={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},l={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},d=3e4,f="REJECT",p={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},g="https://embed.qonto.com",h="https://embed-js{branch}.staging.qonto.co",v="https://embed.dev.qonto.co",m={[c.PRODUCTION]:{EMBED_BASE_URL:g,EMBED_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[c.STAGING]:{EMBED_BASE_URL:h,EMBED_URL:`${h}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[c.LOCAL]:{EMBED_BASE_URL:v,EMBED_URL:`${v}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class y{constructor(){let e,t;this.environment=c.PRODUCTION,this.branch=u.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(c).includes(e)?e:c.PRODUCTION,this.branch=Object.values(u).includes(t)?t:u.SANDBOX}static getInstance(){return y.instance||(y.instance=new y),y.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===c.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=c.PRODUCTION,this.branch=u.MASTER}getEnvironmentUrls(){if(this.environment===c.PRODUCTION)return m.production;{const e=m[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const b=y.getInstance();class T{constructor(){this.currentLocale="en"}static getInstance(){return T.instance||(T.instance=new T),T.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const w=T.getInstance();class k{constructor(){this.mfaPreference=l.PASSKEY,this.debugMode=!1}static getInstance(){return k.instance||(k.instance=new k),k.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=l.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const S=k.getInstance();class E extends i{constructor({message:e,data:t,code:n}){super(),this.code=500;const r=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${r}`,this.data=t||{},this.code=n||this.code}}function _({accessToken:e,stagingToken:t,idempotencyKey:n,mfaPreference:i,scaSessionToken:o}){const s=new Headers;s.append("Authorization",`Bearer ${e}`);const a=t||r.getStagingToken();a&&s.append("X-Qonto-Staging-Token",a),n&&s.append("X-Qonto-Idempotency-Key",n);const c=i||S.getMFAPreference();return c&&s.append("X-Qonto-2fa-Preference",c),o&&s.append("X-Qonto-SCA-Session-Token",o),s.append("Content-Type","application/json"),s.append("Accept-Language",w.getLocale()),s}async function I({path:e,options:t}){const n=`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,r=await fetch(n,{...t,headers:_(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===r.status)return;const i=await r.json();if(!r.ok)throw i.errors?new E({code:r.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new E({code:r.status,message:`${i.code}: ${i.detail}`,data:i});return i}function P(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},n=JSON.stringify(t);return r=n,a()?Buffer.from(r).toString("base64"):btoa(r);var r}function A(e){return JSON.parse((t=e,a()?Buffer.from(t,"base64").toString("utf-8"):atob(t)));var t}function O({accessToken:e,stagingToken:t,action:n,callbackUrl:r}){const i={post_authn_action:n};return r&&(i.callback_url=r),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}async function C(e){const t=O({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:n}=await I(t);return{url:n.url,post_authn_action:n.post_authn_action,callback_url:n.callback_url,expired_at:n.expired_at,used_at:n.used_at}}function x(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}class R extends i{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function D(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(n.length>0)throw new R(n.map((e=>`Missing required parameter: ${e}`)))}function L(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function N(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function U(e){if(!e||"object"!=typeof e)throw new R("requestSettings must be an object");const t=e,{action:n,callbackUrl:r}=e;D(t,[{name:"action"}]);const i=L(t),o=Object.values(p);if(o.includes(n)||i.push(`action must be one of ${o.join(", ")}`),i.length>0)throw new R(i);if(void 0!==r&&""===r.trim())throw new R("callbackUrl cannot be empty")}async function M({requestSettings:e,operationSettings:t}){U(e);const{accessToken:n,stagingToken:r}=t||{},i=n||s();return x(await C({accessToken:i,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}const j={request:M};function q(e){const t=new URLSearchParams;return e?.page&&t.append("page",e.page.toString()),e?.itemsPerPage&&t.append("per_page",e.itemsPerPage.toString()),t}function F(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}const B=[];for(let e=0;e<256;++e)B.push((e+256).toString(16).slice(1));let $;const H=new Uint8Array(16);var K={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function z(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!$){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$=crypto.getRandomValues.bind(crypto)}return $(H)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(B[e[t+0]]+B[e[t+1]]+B[e[t+2]]+B[e[t+3]]+"-"+B[e[t+4]]+B[e[t+5]]+"-"+B[e[t+6]]+B[e[t+7]]+"-"+B[e[t+8]]+B[e[t+9]]+"-"+B[e[t+10]]+B[e[t+11]]+B[e[t+12]]+B[e[t+13]]+B[e[t+14]]+B[e[t+15]]).toLowerCase()}(r)}function G(e,t,n){return K.randomUUID&&!e?K.randomUUID():z(e)}function J(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function V(e){return{name:e.name,...e.email&&{email:e.email},...e.activityTag&&{activity_tag:e.activityTag},iban:e.iban,...e.bic&&{bic:e.bic}}}const W="/v2/sepa/beneficiaries";async function Y({paginationSettings:e,accessToken:t,stagingToken:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${W}${o}`,options:r}}({paginationSettings:e,accessToken:t,stagingToken:n}),{beneficiaries:i,meta:o}=await I(r);return{beneficiaries:i,meta:o}}function Q({beneficiaryId:e,accessToken:t,stagingToken:n}){return{path:`${W}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}async function X({accessToken:e,stagingToken:t,beneficiaryId:n}){const r=Q({beneficiaryId:n,accessToken:e,stagingToken:t}),{beneficiary:i}=await I(r);return i}async function Z({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=G()}){const i=function({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=G()}){return{path:W,options:{method:"POST",headers:{accessToken:t,stagingToken:n,idempotencyKey:r},body:{beneficiary:V(e)}}}}({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r}),{beneficiary:o}=await I(i);return o}async function ee({beneficiaryIds:e,accessToken:t,stagingToken:n}){const r=function({beneficiaryIds:e,accessToken:t,stagingToken:n}){return{path:`${W}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:n},body:{ids:e}}}}({beneficiaryIds:e,accessToken:t,stagingToken:n}),{beneficiaries:i}=await I(r);return i}async function te({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const o=function({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const{name:o,email:s,activityTag:a}=e,c={method:"PATCH",headers:{accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i},body:{beneficiary:{name:o,email:s,activity_tag:a}}};return{path:`${W}/${e.id}`,options:c}}({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}),{beneficiary:s}=await I(o);return s}const ne=[{name:"name"},{name:"iban"}];function re(e){if(!e)throw new R("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("beneficiaryId must be a string");return e}const ie={getBeneficiaries:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Y({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.beneficiaries.map((e=>J(e))),c=F(o.meta);return{beneficiaries:a,...c?{meta:c}:{}}},getBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return J(await X({beneficiaryId:n,accessToken:o,stagingToken:i}))},addBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new R("beneficiary must be an object");D(e,ne);const t=L({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new R(t);return e}(e),{accessToken:r,stagingToken:i,idempotencyKey:o}=t||{},a=r||s();return J(await Z({beneficiary:n,accessToken:a,stagingToken:i,idempotencyKey:o}))},updateBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){const{id:t,name:n,email:r,activityTag:i}=e||{};if(!t)throw new R("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!n&&!r&&!i)throw new R("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const o=L({name:n,email:r,activityTag:i});if(o.length>0)throw new R(o);return{id:t,name:n,email:r,activityTag:i}}(e),{accessToken:r,stagingToken:i,idempotencyKey:o,mfaPreference:a}=t||{},c={beneficiaryParamsBeingEdited:n,accessToken:r||s(),stagingToken:i,idempotencyKey:o,mfaPreference:a};return J(await te(c))},untrustBeneficiaries:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new R("beneficiaryIds must be an array of strings");return e}(e?.beneficiaryIds),{accessToken:r,stagingToken:i}=t||{},o=r||s();return(await ee({beneficiaryIds:n,accessToken:o,stagingToken:i})).map(J)}},oe="SDK Initialized",se="Cards List";var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)};function ce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ue,le,de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de.apply(this,arguments)};function fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function pe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function ge(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function he(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ve(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function me(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ue||(ue={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(le||(le={}));var ye,be="AMP",Te="".concat(be,"_unsent"),we="$default_instance",ke="https://api2.amplitude.com/2/httpapi",Se="dclid",Ee="fbclid",_e="gbraid",Ie="gclid",Pe="ko_click_id",Ae="li_fat_id",Oe="msclkid",Ce="rdt_cid",xe="ttclid",Re="twclid",De="wbraid",Le={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ne=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Ue=["authorization","cookie","set-cookie"],Me=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!je(t,n))return!1}return!0},je=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Me(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return Me(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},qe=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return de({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(ye.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(ye.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(ye.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(ye.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(ye.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(ye.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(ye.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(ye.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(ye.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[ye.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[ye.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===ye.ADD?"number"==typeof n:e===ye.UNSET||e===ye.REMOVE||je(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ye||(ye={}));var Fe,Be=[ye.CLEAR_ALL,ye.UNSET,ye.SET,ye.SET_ONCE,ye.ADD,ye.APPEND,ye.PREPEND,ye.PREINSERT,ye.POSTINSERT,ye.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(Fe||(Fe={}));var $e,He=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Fe.Unknown),{event:e,code:t,message:n}},Ke=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},ze=me([],ve(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),Ge=function(e){var t,n=Ke();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ge)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,me([],ve(r.entries()),!1).map((function(e){var t=ve(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(ze[r]):ze[r]})).join("")},Je=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return pe(this,void 0,void 0,(function(){return ge(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=Ge(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var n;return pe(this,void 0,void 0,(function(){var r,i;return ge(this,(function(o){switch(o.label){case 0:return r=this.plugins.findIndex((function(t){return t.name===e})),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T;return ge(this,(function(w){switch(w.label){case 0:if(!e)return[2];t=ve(e,1),n=t[0],r=ve(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),o=this.plugins.filter((function(e){return"before"===e.type})),w.label=1;case 1:w.trys.push([1,6,7,8]),s=he(o),a=s.next(),w.label=2;case 2:return a.done?[3,5]:(f=a.value).execute?[4,f.execute(de({},n))]:[3,4];case 3:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return c=w.sent(),m={error:c},[3,8];case 7:try{a&&!a.done&&(y=s.return)&&y.call(s)}finally{if(m)throw m.error}return[7];case 8:u=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),w.label=9;case 9:w.trys.push([9,14,15,16]),l=he(u),d=l.next(),w.label=10;case 10:return d.done?[3,13]:(f=d.value).execute?[4,f.execute(de({},n))]:[3,12];case 11:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=12;case 12:return d=l.next(),[3,10];case 13:return[3,16];case 14:return g=w.sent(),b={error:g},[3,16];case 15:try{d&&!d.done&&(T=l.return)&&T.call(l)}finally{if(b)throw b.error}return[7];case 16:return h=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),v=h.map((function(e){var t=de({},n);return e.execute(t).catch((function(e){return He(t,0,String(e))}))})),Promise.all(v).then((function(e){var t=ve(e,1)[0]||He(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r=this;return ge(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return r.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),t=he(this._optOutListeners),n=t.next(),c.label=1;case 1:if(n.done)return[3,6];r=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,r(e)];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o=c.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}}))}))},e.prototype.onReset=function(){this.plugins.forEach((function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)}))},e}(),Ve=function(e,t){return de(de({},t),{event_type:le.IDENTIFY,user_properties:e.getUserProperties()})},We=function(e){return{promise:e||Promise.resolve()}},Ye=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Je(this),this.name=e}return e.prototype._init=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return ge(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),n=he(t),r=n.next(),u.label=2;case 2:return r.done?[3,7]:(i=r.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return de(de(de({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),We(this.dispatch(r))},e.prototype.identify=function(e,t){var n=Ve(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),We(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return de(de({},r),{event_type:le.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return We(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new qe;return i.set(e,t),de(de({},n),{event_type:le.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),We(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return de(de({},t),{event_type:le.REVENUE,event_properties:e.getEventProperties()})}(e,t);return We(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),We())},e.prototype._addPlugin=function(e){return We(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),We())},e.prototype._removePlugin=function(e){return We(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(He(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return pe(this,void 0,void 0,(function(){var t=this;return ge(this,(function(n){return this.isReady?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=de({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach((function(t){Object.values(ue).includes(t)||(i[t]=e[t])})),Be.forEach((function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case ue.CLEAR_ALL:Object.keys(r).forEach((function(e){delete r[e]}));break;case ue.UNSET:Object.keys(n).forEach((function(e){delete r[e]}));break;case ue.SET:Object.assign(r,n)}}})),Object.assign(r,i),r},e.prototype.process=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,He(e,0,"Event skipped due to optOut config")]:(e.event_type===le.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return t=i.sent(),n=String(t),this.config.loggerProvider.error(n),[2,r=He(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return We(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),Qe=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return Me(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?de({},this.properties):{};return e[$e.REVENUE_PRODUCT_ID]=this.productId,e[$e.REVENUE_QUANTITY]=this.quantity,e[$e.REVENUE_PRICE]=this.price,e[$e.REVENUE_TYPE]=this.revenueType,e[$e.REVENUE_CURRENCY]=this.currency,e[$e.REVENUE]=this.revenue,e[$e.RECEIPT]=this.receipt,e[$e.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}($e||($e={}));var Xe;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(Xe||(Xe={}));var Ze="Amplitude Logger ",et=function(){function e(){this.logLevel=Xe.None}return e.prototype.disable=function(){this.logLevel=Xe.None},e.prototype.enable=function(e){void 0===e&&(e=Xe.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Verbose||console.log("".concat(Ze,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Warn||console.warn("".concat(Ze,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Error||console.error("".concat(Ze,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Debug||console.log("".concat(Ze,"[Debug]: ").concat(e.join(" ")))},e}(),tt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:we,logLevel:Xe.Warn,loggerProvider:new et,offline:!1,optOut:!1,serverUrl:ke,serverZone:"US",useBatch:!1}},nt=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=tt();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=it(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),rt=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":ke},it=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=tt().serverZone),void 0===n&&(n=tt().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:tt().serverZone;return{serverZone:r,serverUrl:rt(r,n)}},ot=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function st(e){return e>=200&&e<300}var at=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},ct=function(e){return function(){var t=de({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ut=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=he(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},lt=function(e,t){return function(){var n,r,i={};try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ut(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},dt=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),c=a.logger,u=a.logLevel;if(u&&u<Xe.Debug||!u||!c)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:at(1),time:{start:(new Date).toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))})):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))),d}};function ft(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var pt=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return pe(this,void 0,void 0,(function(){var n,r=this;return ge(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(Te,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map((function(e){return r.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=Ge()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),s=t,a=this.config.flushQueueSize,c=Math.max(a,1),r=s.reduce((function(e,t,n){var r=Math.floor(n/c);return e[r]||(e[r]=[]),e[r].push(t),e}),[]),[4,r.reduce((function(t,n){return pe(i,void 0,void 0,(function(){return ge(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,a,c}))}))},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),pe(this,void 0,void 0,(function(){var r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,fe(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new ot,c.label=1;case 1:return c.trys.push([1,3,,4]),i=it(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:return null===(o=c.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(ft(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=c.sent(),a=(u=s)instanceof Error?u.message:String(u),this.config.loggerProvider.error(a),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:a,stack_trace:at()}),this.handleResponse({status:Fe.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var n;st(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:ft(e),stack_trace:at()});var r=e.status;switch(r){case Fe.Success:this.handleSuccessResponse(e,t);break;case Fe.Invalid:this.handleInvalidResponse(e,t);break;case Fe.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case Fe.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=me(me(me(me([],ve(Object.values(e.body.eventsWithInvalidFields)),!1),ve(Object.values(e.body.eventsWithMissingFields)),!1),ve(Object.values(e.body.eventsWithInvalidIdLengths)),!1),ve(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter((function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(ft(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(ft(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),c=new Set(o),u=t.filter((function(t,r){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return c.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(ft(e));var l=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;st(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map((function(e){return e.event.event_type})),code:t,message:n,stack_trace:at()})),this.removeEvents(e),e.forEach((function(e){return e.callback(He(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),gt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ht(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ht=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},vt=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),mt=function(){return mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)};function yt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var Tt=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=yt(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),c=Array.isArray(t);if(a!==c)return!1;if(!a||!c){var u=Object.keys(e).sort(),l=Object.keys(t).sort();if(!Tt(u,l))return!1;var d=!0;return Object.keys(e).forEach((function(n){Tt(e[n],t[n])||(d=!1)})),d}for(var f=0;f<e.length;f++)if(!Tt(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var wt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=mt({},this.identity.userProperties),n=mt(mt({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,c=n.userProperties||{};try{for(var u=yt(Object.entries(e)),l=u.next();!l.done;l=u.next()){var d=bt(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var g=(i=void 0,yt(Object.entries(p))),h=g.next();!h.done;h=g.next()){var v=bt(h.value,2),m=v[0],y=v[1];c[m]=y}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,yt(Object.keys(p))),T=b.next();!T.done;T=b.next()){delete c[m=T.value]}}catch(e){s={error:e}}finally{try{T&&!T.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":c={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return mt({},this.identity)},e.prototype.setIdentity=function(e){var t=mt({},this.identity);this.identity=mt({},e),Tt(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,St=function(){function e(){this.identityStore=new wt,this.eventBridge=new vt,this.applicationContextProvider=new gt}return e.getInstance=function(t){return kt.analyticsConnectorInstances||(kt.analyticsConnectorInstances={}),kt.analyticsConnectorInstances[t]||(kt.analyticsConnectorInstances[t]=new e),kt.analyticsConnectorInstances[t]},e}(),Et=function(e){return void 0===e&&(e=we),St.getInstance(e)},_t=function(){function e(){this.name="identity",this.type="before",this.identityStore=Et().identityStore}return e.prototype.execute=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return e.instanceName&&(this.identityStore=Et(e.instanceName).identityStore),[2]}))}))},e}(),It=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Pt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},At=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},Ot=function(){var e,t=Ke();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Ct(n[0]),i=Ct(n[1]);return i?(e[r]=i,e):e}),{}):{}},Ct=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},xt=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Rt=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},Dt=function(e,t){var n=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}(e.toString());return 31*Math.abs(n)%1e5/1e5<t},Lt=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),Nt=function(){function e(e,t){void 0===t&&(t={}),this.options=de({},e),this.config=t}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:if(!Ke())return[2,!1];t=String(Date.now()),n=de(de({},this.options),{expirationDays:.003}),r=new e(n),i="AMP_TEST_".concat(Ge().substring(0,8)),o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(i,t)];case 2:return o.sent(),[4,r.get(i)];case 3:return[2,o.sent()===t];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(i)];case 6:return o.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t,n;return ge(this,(function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];try{return void 0===(n=Ut(t))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]):[2,JSON.parse(n)]}catch(n){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,n,r,i;return pe(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,f,p,g,h,v,m=this;return ge(this,(function(y){switch(y.label){case 0:o=Ke(),s=o,y.label=1;case 1:return y.trys.push([1,4,,5]),(a=null==s?void 0:s.cookieStore)?[4,a.getAll(e)]:[3,3];case 2:if(c=y.sent()){c.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:c.map((function(e){return e.domain}))}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(u=he(c),l=u.next();!l.done;l=u.next())if(d=l.value,Mt(d.domain,this.options.domain))return[2,d.value]}catch(e){h={error:e}}finally{try{l&&!l.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}}}y.label=3;case 3:return[3,5];case 4:return y.sent(),[3,5];case 5:return f=(null!==(i=null===(r=null==o?void 0:o.document)||void 0===r?void 0:r.cookie.split("; "))&&void 0!==i?i:[]).filter((function(t){return 0===t.indexOf(e+"=")})),p=void 0,"function"==typeof(g=this.config.duplicateResolverFn)&&f.length>1&&(p=f.find((function(t){var n;try{var r=g(t.substring(e.length+1));return r||null===(n=m.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),r}catch(e){return!1}}))),p||(p=f[0]),p?[2,p.substring(e.length+1)]:[2,void 0]}}))}))},e.prototype.set=function(e,t){var n;return pe(this,void 0,void 0,(function(){var r,i,o,s,a,c,u;return ge(this,(function(l){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(c=Ke())&&(c.document.cookie=a)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]}))}))},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2]}))}))},e}(),Ut=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Mt=function(e,t){if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},jt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},qt=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return pe(this,void 0,void 0,(function(){return ge(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return pe(this,void 0,void 0,(function(){return ge(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Ft="tags",Bt="counters",$t="histograms",Ht="events",Kt="internal",zt="last_flush_timestamp",Gt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=Ke())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]}))}))},e.prototype.openDB=function(){var e=this;return new Promise((function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Ft)||e.createObjectStore(Ft,{keyPath:"key"}),e.objectStoreNames.contains(Bt)||e.createObjectStore(Bt,{keyPath:"key"}),e.objectStoreNames.contains($t)||e.createObjectStore($t,{keyPath:"key"}),e.objectStoreNames.contains(Ht))||e.createObjectStore(Ht,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Kt)||e.createObjectStore(Kt,{keyPath:"key"})},e.prototype.setTags=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Ft],"readwrite"),r=n.objectStore(Ft),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Bt],"readwrite"),r=n.objectStore(Bt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e=s.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([$t],"readwrite"),r=n.objectStore($t),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e,t=s.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Ht],"readwrite"),r=n.objectStore(Ht),[2,new Promise((function(t){n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach((function(e){r.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i,o;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),r=n.transaction([Kt],"readwrite"),i=r.objectStore(Kt),[2,new Promise((function(n,o){r.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return n()},s.onerror=function(){return o(new Error("Failed to set internal value"))}}))];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([Kt],"readonly"),r=n.objectStore(Kt),[2,new Promise((function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(zt)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}}))}))},e.prototype.setLastFlushTimestamp=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(zt,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}}))}))},e.prototype.clearTable=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent(),t=e.transaction([Ft,Bt,$t,Ht],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Ft),this.getAllFromStore(t,Bt),this.getAllFromStore(t,$t),this.getAllFromStore(t,Ht)])];case 2:return n=ve.apply(void 0,[c.sent(),4]),r=n[0],i=n[1],o=n[2],s=n[3],[4,Promise.all([this.clearTable(t,Bt),this.clearTable(t,$t),this.clearTable(t,Ht)])];case 3:return c.sent(),[2,{tags:r,counters:i,histogramStats:o,events:s}];case 4:return a=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}}))}))},e.prototype.getAllFromStore=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}}))},e}(),Jt=function(e){var t,n,r=function(){var e=Ke();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]}();if(0!==r.length)try{for(var i=he(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},Vt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Wt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},Yt=3e5,Qt=1e4,Xt=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=de({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Gt.isSupported()?this.storage=new Gt(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=Ke();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",de({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",(function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Jt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})}),!0),t.addEventListener("unhandledrejection",(function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Vt(i),s=Jt({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Wt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})}),!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Qt?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Qt?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Qt)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout((function(){e.saveAllDataToStorage().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)})).finally((function(){e.saveTimer=null}))}),1e3)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),Yt))},e.prototype.saveAllDataToStorage=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.storage?(e=de({},this.inMemoryTags),t=de({},this.inMemoryCounters),n=de({},this.inMemoryHistograms),r=me([],ve(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,u;return ge(this,(function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach((function(e){o[e.key]=e.value})),s={},n.forEach((function(e){s[e.key]=e.value})),a={},r.forEach((function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),c=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(s).length&&0===Object.keys(a).length&&0===c.length?[2]:(u={tags:o,histogram:a,counters:s,events:c},this.fetch(u),[2])}}))}))},e.prototype.fetch=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!Ke())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return pe(this,void 0,void 0,(function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(Yt),[2]):(n=e-t)>=Yt?(this._flush(),[2]):(this._setFlushTimer(Yt-n),[2])}}))}))},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout((function(){t._flush().catch((function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)})).finally((function(){t.flushTimer=null}))}),e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Zt=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k;if("object"!=typeof e)return null;var S=e.code||0,E=this.buildStatus(S);switch(E){case Fe.Success:return{status:E,statusCode:S,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case Fe.Invalid:return{status:E,statusCode:S,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case Fe.PayloadTooLarge:return{status:E,statusCode:S,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case Fe.RateLimit:return{status:E,statusCode:S,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(T=e.exceeded_daily_quota_devices)&&void 0!==T?T:{},exceededDailyQuotaUsers:null!==(w=e.exceeded_daily_quota_users)&&void 0!==w?w:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case Fe.Timeout:default:return{status:E,statusCode:S}}},e.prototype.buildStatus=function(e){return st(e)?Fe.Success:429===e?Fe.RateLimit:413===e?Fe.PayloadTooLarge:408===e?Fe.Timeout:e>=400&&e<500?Fe.Invalid:e>=500?Fe.Failed:Fe.Unknown},e}(),en=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i;return ge(this,(function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:de({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,n)];case 1:return[4,(r=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:r.status})]}return[2]}}))}))},t}(Zt),tn=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),nn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new tn(e,t)}return e.prototype.subscribe=function(e,t,n){var r=Ge(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex((function(t){return t.id===e}));return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return pe(this,void 0,void 0,(function(){var e,t=this;return ge(this,(function(n){switch(n.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(n){t.sendCallback(n,e,"remote")})),[2]}}))}))},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then((function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t})).finally((function(){e.fetchPromise=null}))),this.fetchPromise},e.prototype.subscribeAll=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then((function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)})),n=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return pe(this,void 0,void 0,(function(){var n,r;return ge(this,(function(i){switch(i.label){case 0:n=new Promise((function(e,n){setTimeout((function(){n("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce((function(e,t){return null===e?e:t in e?e[t]:null}),t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),pe(this,void 0,void 0,(function(){var n,r,i,o,s,a,c=this;return ge(this,(function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,u,l;return ge(this,(function(d){switch(d.label){case 0:i=new AbortController,s=setTimeout((function(){return i.abort()}),t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=d.sent()).ok?[3,4]:[4,a.text()];case 3:return u=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(u)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(l=d.sent())instanceof Error&&"AbortError"===l.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),l),[3,9];case 8:return clearTimeout(s),[7];case 9:return r<e-1?[4,new Promise((function(e){return setTimeout(e,c.getJitterDelay(n))}))]:[3,11];case 10:d.sent(),d.label=11;case 11:return[2]}}))},o=this,s=0,u.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];u.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),rn=Ke(),on=null==rn?void 0:rn.console,sn={},an={},cn=!1;var un,ln={addListener:function(e,t){var n,r=(n=e,!!on&&"function"==typeof on[n]&&(an[n]||(an[n]=on[n],on[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(sn[n]&&!cn){cn=!0;var r=sn[n];r&&r.forEach((function(t){try{t(n,e)}catch(e){}}))}}catch(e){}return cn=!1,an[n].apply(on,e)}),!0));if(!r)return new Error("Console override failed");sn[e]?sn[e].push(t):sn[e]=[t]},removeListener:function(e){var t,n;try{for(var r=he(Object.values(sn)),i=r.next();!i.done;i=r.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=he(Object.entries(an)),r=n.next();!r.done;r=n.next()){var i=ve(r.value,2),o=i[0],s=i[1];s&&(on[o]=s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}an={},sn={}}};!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(un||(un={}));var dn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],fn="data-amp-track-",pn=["div","span","h1","h2","h3","h4","h5","h6"],gn=me(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],ve(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),hn=gn,vn=gn,mn=["*"];function yn(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function bn(e,t,n){e&&Tn({json:e,allowlist:t.map(wn),excludelist:n.map(wn),ancestors:[]})}function Tn(e){var t,n,r=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,c=e.parentObject,u=e.targetKey;i||(i=r);var l=Object.keys(i);try{for(var d=he(l),f=d.next();!f.done;f=d.next()){var p=f.value,g=me(me([],ve(a),!1),[p],!1);yn(i[p])?Sn(g,o)&&!Sn(g,s)||delete i[p]:Tn({json:r,targetObject:i[p],allowlist:o,excludelist:s,ancestors:g,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&c&&u&&delete c[u]}function wn(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function kn(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&"**"===t[r];)r++;return r===t.length}var i=t[r];if("**"===i){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(kn(e,t,o,r+1))return!0;return!1}return("*"===i||i===e[n])&&kn(e,t,n+1,r+1)}function Sn(e,t){return t.some((function(t){return kn(e,t)}))}var En=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,i={};if(Array.isArray(r))r.forEach((function(e){var t=ve(e,2),n=t[0],r=t[1];i[n]=r}));else if(r instanceof Headers)r.forEach((function(e,t){i[t]=e}));else if("object"==typeof r&&null!==r)try{for(var o=he(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=ve(s.value,2),c=a[0],u=a[1];i[c]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Rn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=Ke();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=In(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,Cn(this.body,e,t)]}))}))},e}(),_n=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Rn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return In(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,Cn(this.body,e,t)]}))}))},e}();function In(e,t){var n,r,i,o=Ke(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var c=e,u=0,l=0;try{for(var d=he(c.entries()),f=d.next();!f.done;f=d.next()){var p=ve(f.value,2),g=p[0],h=p[1];if(u+=g.length,"string"==typeof h)u+=(new s).encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream)return void(a=e);return i}}var Pn,An=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,(function(e,t){r[t]=e})),Rn(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),500)})),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,Cn(n.sent(),e,t)]}}))}))},e}(),On=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},i=this.headersString.split("\r\n");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split(": "),2),c=a[0],u=a[1];c&&u&&(r[c]=u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Rn(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){var n;return ge(this,(function(r){return 0===e.length?[2,null]:(n=this.getJson())?(bn(n,e,t),[2,n]):[2,null]}))}))},e}();function Cn(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return bn(r,t,n),r}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(Pn||(Pn={}));var xn="[REDACTED]",Rn=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?Pn.REMOVE:s,c=me([],ve(Ue),!1),u={},l=function(t){var n=t.toLowerCase();c.find((function(e){return e.toLowerCase()===n}))?a===Pn.REDACT&&(u[t]=xn):o.find((function(e){return e.toLowerCase()===n}))?u[t]=e[t]:a===Pn.REDACT&&(u[t]=xn)};try{for(var d=he(Object.keys(e)),f=d.next();!f.done;f=d.next()){l(f.value)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return u},Dn=function(){function e(e,t,n,r,i,o,s,a,c,u,l){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=c,this.error=u,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(me([],ve(Ne),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers(me([],ve(Ne),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=ve(e,2);return t[0],void 0!==t[1]})))},e}();var Ln=function(e,t){void 0===t&&(t=Ge()),this.callback=e,this.id=t};function Nn(e){try{e()}catch(e){}}var Un=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=Ke();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=Ke();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,c,u,l,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,g=null===(l=null===(u=null===(c=this.globalScope)||void 0===c?void 0:c.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===l?void 0:l.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(n){try{n.callback(e)}catch(e){Nn((function(){var n;null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)}))}}))},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){var a;if(void 0!==o&&void 0!==s){var c,u,l,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?c=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(c=t.url,d=t.method),c)try{var f=new URL(c);c="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(u=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-s),g=Math.floor(o+p),h=new Dn(e,d,o,o,c,n,u,p,r,l,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return pe(t,void 0,void 0,(function(){var t,i,o,s,a=this;return ge(this,(function(c){switch(c.label){case 0:try{t=this.getTimestamps()}catch(e){Nn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)}))}c.label=1;case 1:return c.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=c.sent(),[3,4];case 3:return s=c.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new En(r):void 0,i?new An(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){Nn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)}))}if(i)return[2,i];throw o}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){return n instanceof Error&&"InvalidStateError"===n.name&&Nn((function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=ve(n,2),s=i[0],a=i[1];try{this.$$AmplitudeAnalyticsEvent=de({method:s,url:null===(e=null==a?void 0:a.toString)||void 0===e?void 0:e.call(a),headers:{}},o.getTimestamps())}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)}))}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],c=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",(function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new On(i.status,e,t?parseInt(t,10):void 0,s),r=i.$$AmplitudeAnalyticsEvent.headers,u=new _n(a,r);c.status=i.status,o.handleNetworkRequestEvent("xhr",{url:c.url,method:c.method},u,n,void 0,c.startTime,c.durationStart)}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)}))}})),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)}))}r.apply(this,[e,t])}}},e}(),Mn=new Un,jn=function(){function e(){}return e.prototype.parse=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,de(de(de(de({},Le),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Ot();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=Ot();return(e={})[Se]=t[Se],e[Ee]=t[Ee],e[_e]=t[_e],e[Ie]=t[Ie],e[Pe]=t[Pe],e[Ae]=t[Ae],e[Oe]=t[Oe],e[Ce]=t[Ce],e[xe]=t[xe],e[Re]=t[Re],e[De]=t[De],e},e}(),qn="data-amp-mask",Fn="*****",Bn=/\b(?:\d[ -]*?){13,16}\b/,$n=/(\d{3}-?\d{2}-?\d{4})/g,Hn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Kn=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Bn,Fn)).replace($n,Fn)).replace(Hn,Fn);try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Fn)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},zn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(qn)?Fn:e?e(document.title):document.title};function Gn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jn(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wn(e,t,n){return t&&Vn(e.prototype,t),n&&Vn(e,n),e}var Yn=function(){return"function"==typeof Symbol},Qn=function(e){return Yn()&&Boolean(Symbol[e])},Xn=function(e){return Qn(e)?Symbol[e]:"@@"+e};Yn()&&!Qn("observable")&&(Symbol.observable=Symbol("observable"));var Zn=Xn("iterator"),er=Xn("observable"),tr=Xn("species");function nr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function rr(e){var t=e.constructor;return void 0!==t&&null===(t=t[tr])&&(t=void 0),void 0!==t?t:pr}function ir(e){return e instanceof pr}function or(e){or.log?or.log(e):setTimeout((function(){throw e}))}function sr(e){Promise.resolve().then((function(){try{e()}catch(e){or(e)}}))}function ar(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=nr(t,"unsubscribe");n&&n.call(t)}}catch(e){or(e)}}function cr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function ur(e,t,n){e._state="running";var r=e._observer;try{var i=nr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(cr(e),!i)throw n;i.call(r,n);break;case"complete":cr(e),i&&i.call(r)}}catch(e){or(e)}"closed"===e._state?ar(e):"running"===e._state&&(e._state="ready")}function lr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void sr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(ur(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void ur(e,t,n);e._queue.push({type:t,value:n})}}var dr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new fr(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(cr(this),ar(this))},Wn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),fr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){lr(this._subscription,"next",e)},t.error=function(e){lr(this._subscription,"error",e)},t.complete=function(){lr(this._subscription,"complete")},Wn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),pr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new dr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(rr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(rr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=rr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=rr(this);return new i((function(t){var r,o=0;return function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=rr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[er]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=nr(t,er);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return ir(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Qn("iterator")&&(r=nr(t,Zn)))return new n((function(e){sr((function(){if(!e.closed){for(var n,i=Gn(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){sr((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){sr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},Wn(e,null,[{key:tr,get:function(){return this}}]),e}();function gr(e,t){return new pr((function(n){e.subscribe({next:function(e){t(e).then((function(e){return n.next(e)})).catch((function(e){return n.error(e)}))},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}function hr(e,t){return new pr((function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=he(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o}))}function vr(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new pr((function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){var n,i,o;try{for(var s=he(t),a=s.next();!a.done;a=s.next()){var c=a.value;null===(o=c.error)||void 0===o||o.call(c,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}}))}function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Yn()&&Object.defineProperty(pr,Symbol("extensions"),{value:{symbol:er,hostReportError:or},configurable:!0});var yr,br={exports:{}};var Tr,wr=function(){if(yr)return br.exports;yr=1;var e=Object.prototype.hasOwnProperty;function t(e){return"[Throws: "+(e?e.message:"?")+"]"}function n(n){var r=[];return function n(i){if(null===i||"object"!=typeof i)return i;if(-1!==r.indexOf(i))return"[Circular]";if(r.push(i),"function"==typeof i.toJSON)try{var o=n(i.toJSON());return r.pop(),o}catch(e){return t(e)}if(Array.isArray(i)){var s=i.map(n);return r.pop(),s}var a=Object.keys(i).reduce((function(r,o){return r[o]=n(function(n,r){if(e.call(n,r))try{return n[r]}catch(e){return t(e)}return n[r]}(i,o)),r}),{});return r.pop(),a}(n)}return br.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},br.exports.ensureProperties=n,br.exports}(),kr=mr(wr),Sr=kr||t({__proto__:null,default:kr},[wr]),Er="https://app.amplitude.com",_r={US:Er,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var Ir="__AMPLITUDE_MESSENGER_INSTANCE__",Pr="__AMPLITUDE_MESSENGER__",Ar=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?Er:t;this[Tr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise((function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){n({status:!1,message:"Failed to load the script ".concat(e)})})),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}}))}(e).then((function(){})),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}}))}))},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===Er&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,s;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var a=e.data,c=null==a?void 0:a.action;if(c)if("id"in a&&a.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a);else{if("ping"===c)return void r.notify({action:"pong"});var u=r.actionHandlers.get(c);if(u)u(a.data);else{var l=null!==(s=r.pendingMessages.get(c))&&void 0!==s?s:[];l.push(a.data),r.pendingMessages.set(c,l)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=Ke();(null==e?void 0:e[Pr])===this&&delete e[Pr]},e}();function Or(e){var t,n=Ke(),r=null==n?void 0:n[Pr];if("object"==typeof(t=r)&&null!==t&&Ir in t&&!0===t[Ir])return r;var i=new Ar(e);return n&&(n[Pr]=i),i}Tr=Ir;var Cr="__AMPLITUDE_BACKGROUND_CAPTURE__";var xr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},Rr=function(e){return xr(e,"attribution")},Dr=function(e){return xr(e,"formInteractions")},Lr=function(e){return xr(e,"pageViews")},Nr=function(e){return xr(e,"sessions")},Ur=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Mr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},jr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},qr=function(e){if(Mr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Fr=function(e){if(jr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},Br=function(e){var t;if(Ur(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),de(de({},n),{captureRules:null===(t=null==n?void 0:n.captureRules)||void 0===t?void 0:t.map((function(t){var n,r,i;if((null===(n=t.urls)||void 0===n?void 0:n.length)&&(null===(r=t.hosts)||void 0===r?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),de(de({},t),{hosts:void 0})}return t}))})}},$r=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return Lr(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},Hr=function(e){return Rr(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?de({},e.defaultTracking.attribution):{}},Kr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var c=a.apply(e,o);"function"==typeof s&&s(null==c?void 0:c.promise)}}return e},zr=function(e){return e&&void 0!==e._q},Gr="2.35.3",Jr="amplitude-ts",Vr=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Jr,"/").concat(Gr),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return pe(this,void 0,void 0,(function(){var r,i,o;return ge(this,(function(s){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,de(de(de(de(de(de(de(de({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:At()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:Ge(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Wr=1e3,Yr=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=Ke())||void 0===n?void 0:n.localStorage}catch(e){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return ce(t,e),t.prototype.set=function(t,n){var r;return pe(this,void 0,void 0,(function(){var i;return ge(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>Wr?(i=n.length-Wr,[4,e.prototype.set.call(this,t,n.slice(0,Wr))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Wr,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(qt),Qr=function(e){function t(){var t;return e.call(this,null===(t=Ke())||void 0===t?void 0:t.sessionStorage)||this}return ce(t,e),t}(qt),Xr=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n=this;return ge(this,(function(r){return[2,new Promise((function(r,i){var o,s;"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:a.status}))}}};var c=de({"Content-Type":"application/json",Accept:"*/*"},n.customHeaders);try{for(var u=he(Object.entries(c)),l=u.next();!l.done;l=u.next()){var d=ve(l.value,2),f=d[0],p=d[1];a.setRequestHeader(f,p)}}catch(e){o={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}a.send(JSON.stringify(t))}))]}))}))},t}(Zt),Zr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n=this;return ge(this,(function(r){return[2,new Promise((function(r,i){var o=Ke();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return r(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(Zt),ei=function(e,t,n){return void 0===n&&(n=!0),pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,d;return ge(this,(function(f){switch(f.label){case 0:return r=function(e){return"".concat(be.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=f.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return o=ve(i.split("."),6),s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],d=o[5],[2,{deviceId:s,userId:ni(a),sessionId:ti(u),lastEventId:ti(d),lastEventTime:ti(l),optOut:Boolean(c)}]}}))}))},ti=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},ni=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},ri="[Amplitude]",ii="".concat(ri," Form Started"),oi="".concat(ri," Form Submitted"),si="".concat(ri," File Downloaded"),ai="session_start",ci="session_end",ui="".concat(ri," File Extension"),li="".concat(ri," File Name"),di="".concat(ri," Link ID"),fi="".concat(ri," Link Text"),pi="".concat(ri," Link URL"),gi="".concat(ri," Form ID"),hi="".concat(ri," Form Name"),vi="".concat(ri," Form Destination"),mi="cookie",yi=function(e){function t(t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,C,x,R,D,L,N,U,M,j,q,F,B){void 0===r&&(r=new Lt),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===c&&(c=1e3),void 0===u&&(u=5),void 0===l&&(l=30),void 0===d&&(d=mi),void 0===v&&(v=new et),void 0===m&&(m=Xe.Warn),void 0===b&&(b=!1),void 0===T&&(T=!1),void 0===S&&(S=""),void 0===E&&(E="US"),void 0===P&&(P=18e5),void 0===A&&(A=new Yr({loggerProvider:v})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===C&&(C="fetch"),void 0===x&&(x=!1),void 0===R&&(R=!0),void 0===j&&(j=!0),void 0===q&&(q=0);var $,H=this;(H=e.call(this,{apiKey:t,storageProvider:A,transportProvider:wi(C)})||this).apiKey=t,H.appVersion=n,H.cookieOptions=i,H.defaultTracking=o,H.autocapture=s,H.flushIntervalMillis=c,H.flushMaxRetries=u,H.flushQueueSize=l,H.identityStorage=d,H.ingestionMetadata=f,H.instanceName=p,H.loggerProvider=v,H.logLevel=m,H.minIdLength=y,H.offline=b,H.partnerId=w,H.plan=k,H.serverUrl=S,H.serverZone=E,H.sessionTimeout=P,H.storageProvider=A,H.trackingOptions=O,H.transport=C,H.useBatch=x,H.fetchRemoteConfig=R,H.networkTrackingOptions=U,H.identify=M,H.enableDiagnostics=j,H.diagnosticsSampleRate=q,H.diagnosticsClient=F,H.remoteConfig=B,H.version=Gr,H._optOut=!1,H._cookieStorage=r,H.deviceId=a,H.lastEventId=g,H.lastEventTime=h,H.optOut=T,H.deferredSessionId=I,H.sessionId=_,H.pageCounter=L,H.userId=D,H.debugLogsEnabled=N,H.loggerProvider.enable(N?Xe.Debug:H.logLevel),H.networkTrackingOptions=U,H.identify=M,H.enableDiagnostics=j,H.diagnosticsSampleRate=q,H.diagnosticsClient=F;var K=null!==($=null==B?void 0:B.fetchRemoteConfig)&&void 0!==$?$:R;return H.remoteConfig=H.remoteConfig||{},H.remoteConfig.fetchRemoteConfig=K,H.fetchRemoteConfig=K,H}return ce(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof Nt&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Pt(this.apiKey),e)},t}(nt),bi=function(e,t,n,r,i){return void 0===t&&(t={}),pe(void 0,void 0,void 0,(function(){var o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,C,x,R,D,L,N,U,M,j,q,F,B,$,H,K,z,G,J,V,W,Y,Q,X,Z,ee,te;return ge(this,(function(ne){switch(ne.label){case 0:return o=t.identityStorage||mi,P={},o===mi?[3,1]:(a="",[3,5]);case 1:return null===(O=null===(A=t.cookieOptions)||void 0===A?void 0:A.domain)||void 0===O?[3,2]:(c=O,[3,4]);case 2:return[4,ki()];case 3:c=ne.sent(),ne.label=4;case 4:a=c,ne.label=5;case 5:return s=de.apply(void 0,[(P.domain=a,P.expiration=365,P.sameSite="Lax",P.secure=!1,P.upgrade=!0,P),t.cookieOptions]),u={duplicateResolverFn:function(e){var t=Ut(e);if(!t)return!1;var n=JSON.parse(t);return Mt(n.cookieDomain,s.domain)},diagnosticsClient:r},l=Ti(t.identityStorage,s,u),[4,ei(e,l,null===(x=null===(C=t.cookieOptions)||void 0===C?void 0:C.upgrade)||void 0===x||x)];case 6:return d=ne.sent(),[4,l.get(Pt(e))];case 7:return f=ne.sent(),p=Ot(),g=p.ampTimestamp?Number(p.ampTimestamp):void 0,h=!g||Date.now()<g,v=null!==(U=null!==(N=null!==(L=null!==(R=t.deviceId)&&void 0!==R?R:h?null!==(D=p.ampDeviceId)&&void 0!==D?D:p.deviceId:void 0)&&void 0!==L?L:null==f?void 0:f.deviceId)&&void 0!==N?N:d.deviceId)&&void 0!==U?U:Ge(),m=null!==(M=null==f?void 0:f.lastEventId)&&void 0!==M?M:d.lastEventId,y=null!==(j=null==f?void 0:f.lastEventTime)&&void 0!==j?j:d.lastEventTime,b=null!==(F=null!==(q=t.optOut)&&void 0!==q?q:null==f?void 0:f.optOut)&&void 0!==F?F:d.optOut,T=null!==(B=null==f?void 0:f.sessionId)&&void 0!==B?B:d.sessionId,w=null==f?void 0:f.deferredSessionId,k=null!==(H=null!==($=t.userId)&&void 0!==$?$:null==f?void 0:f.userId)&&void 0!==H?H:d.userId,n.previousSessionDeviceId=null!==(K=null==f?void 0:f.deviceId)&&void 0!==K?K:d.deviceId,n.previousSessionUserId=null!==(z=null==f?void 0:f.userId)&&void 0!==z?z:d.userId,S={ipAddress:null===(J=null===(G=t.trackingOptions)||void 0===G?void 0:G.ipAddress)||void 0===J||J,language:null===(W=null===(V=t.trackingOptions)||void 0===V?void 0:V.language)||void 0===W||W,platform:null===(Q=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.platform)||void 0===Q||Q},E=null==f?void 0:f.pageCounter,_=null==f?void 0:f.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(I=new yi(e,t.appVersion,l,s,t.defaultTracking,t.autocapture,v,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,m,y,null!==(X=null==i?void 0:i.loggerProvider)&&void 0!==X?X:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,b,t.partnerId,t.plan,t.serverUrl,null!==(Z=null==i?void 0:i.serverZone)&&void 0!==Z?Z:t.serverZone,T,w,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,k,E,_,t.networkTrackingOptions,t.identify,null!==(ee=null==i?void 0:i.enableDiagnostics)&&void 0!==ee?ee:t.enableDiagnostics,null!==(te=null==i?void 0:i.diagnosticsSampleRate)&&void 0!==te?te:n._diagnosticsSampleRate,r,t.remoteConfig)).storageProvider.isEnabled()];case 8:return ne.sent()||(I.loggerProvider.warn("Storage provider ".concat(I.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),I.storageProvider=new Lt),[2,I]}}))}))},Ti=function(e,t,n){switch(void 0===e&&(e=mi),void 0===t&&(t={}),e){case"localStorage":return new Yr;case"sessionStorage":return new Qr;case"none":return new Lt;default:return new Nt(de(de({},t),{expirationDays:t.expiration}),n)}},wi=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0;return"xhr"===t?new Xr(n):"beacon"===t?new Zr:new en(n)},ki=function(e){return pe(void 0,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return[4,(new Nt).isEnabled()];case 1:if(!c.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=location.hostname,t=e.split("."),n=[],r=Ge(),i="AMP_TLDTEST_".concat(r.substring(0,8)),o=t.length-2;o>=0;--o)n.push(t.slice(o).join("."));o=0,c.label=2;case 2:return o<n.length?(s=n[o],[4,(a=new Nt({domain:"."+s,expirationDays:.003})).set(i,1)]):[3,7];case 3:return c.sent(),[4,a.get(i)];case 4:return c.sent()?[4,a.remove(i)]:[3,6];case 5:return c.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},Si=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Ei=function(e){var t;void 0===e&&(e={});var n,r=Ke(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,c=e.eventType,u=void 0===c?"[Amplitude] Page Viewed":c,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return pe(void 0,void 0,void 0,(function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return e=l("undefined"!=typeof location&&location.href||""),n={event_type:u},t=[{}],[4,_i()];case 1:return[2,(n.event_properties=de.apply(void 0,[de.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&l(location.pathname)||"","[Amplitude] Page Title":zn(Kn),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}}))}))},f=function(){return void 0===s||"function"==typeof s&&s()},p="undefined"!=typeof location?location.href:null,g=function(){return pe(void 0,void 0,void 0,(function(){var e,n,r,o;return ge(this,(function(s){switch(s.label){case 0:return e=location.href,n=Pi(a,e,p||"")&&f(),p=e,n?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}}))}))},h=function(){g()},v={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return pe(void 0,void 0,void 0,(function(){var a,c;return ge(this,(function(u){switch(u.label){case 0:return t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",h),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&g()}})),f()?(i.log("Tracking page view event"),c=(a=t).track,[4,d()]):[3,2];case 1:c.apply(a,[u.sent()]),u.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t;return ge(this,(function(r){switch(r.label){case 0:return"attribution"===s&&Ii(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()]):[3,2];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=de(de({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===u&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=de(de({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return r&&(r.removeEventListener("popstate",h),o=!1),[2]}))}))}};return v},_i=function(){return pe(void 0,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return e=Si,[4,(new jn).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Ii=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[ue.SET]||{},r=t[ue.UNSET]||{},i=me(me([],ve(Object.keys(n)),!1),ve(Object.keys(r)),!1);return Object.keys(Le).every((function(e){return i.includes(e)}))}return!1},Pi=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},Ai=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return t=function(e){if(Dr(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(n),o=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",(function(){var t,n=Ci(e);s||i.track(ii,((t={})[gi]=Oi(e.id),t[hi]=Oi(e.name),t[vi]=n,t)),s=!0})),r(e,"submit",(function(r){var o,a,c=Ci(e);if(s||i.track(ii,((o={})[gi]=Oi(e.id),o[hi]=Oi(e.name),o[vi]=c,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(oi,((a={})[gi]=Oi(e.id),a[hi]=Oi(e.name),a[vi]=c,a)),s=!1}))}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=Ke())?s.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return null==e||e.disconnect(),n.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),n=[],[2]}))}))}}},Oi=function(e){if("string"==typeof e)return e},Ci=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},xi=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return pe(void 0,void 0,void 0,(function(){var i,o;return ge(this,(function(s){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(n.href),s=null==i?void 0:i[1];s&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;s&&r.track(si,((t={})[ui]=s,t[li]=n.pathname,t[di]=e.id,t[fi]=e.text,t[pi]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=Ke())?o.addEventListener("load",i):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},Ri=!1,Di=function(){var e=Ke(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),n("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)})),t=[],[2]}))}))}}};function Li(e){var t,n,r,i,o,s,a,c,u,l,d;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var f=Object.keys(e);try{for(var p=he(f),g=p.next();!g.done;g=p.next()){var h=g.value;try{var v=e[h];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(e[h]=!0)):e[h]=!1),Li(v)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{if(null===(u=null===(c=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===u?void 0:u.length)try{for(var m=he(e.autocapture.networkTracking.captureRules),y=m.next();!y.done;y=m.next()){var b=y.value;try{for(var T=(o=void 0,he(["responseHeaders","requestHeaders"])),w=T.next();!w.done;w=T.next()){var k=w.value,S=null!==(l=b[k])&&void 0!==l?l:{},E=S.captureSafeHeaders,_=S.allowlist;(E||_)&&(void 0===_||Array.isArray(_)?b[k]=me(me([],ve(E?Ne:[]),!1),ve(null!=_?_:[]),!1):delete b[k])}}catch(e){o={error:e}}finally{try{w&&!w.done&&(s=T.return)&&s.call(T)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}catch(e){}var I=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick))}}function Ni(e,t,n){var r,i,o=[];try{for(var s=he(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var c=a.value;try{o.push(new RegExp(c))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(c),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}function Ui(e,t){var n,r,i,o,s,a,c;if(e){Li(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if("boolean"==typeof u.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture&&null!==u.autocapture){var l=de({},u.autocapture);if(void 0===t.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture.elementInteractions&&null!==u.autocapture.elementInteractions&&(null===(i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){l.elementInteractions=de({},u.autocapture.elementInteractions);var d=l.elementInteractions,f=null!==(o=d.pageUrlAllowlist)&&void 0!==o?o:[],p=u.autocapture.elementInteractions.pageUrlAllowlistRegex;d.pageUrlAllowlist=Ni(f,p,t),delete d.pageUrlAllowlistRegex}if("object"==typeof u.autocapture.networkTracking&&null!==u.autocapture.networkTracking&&(null===(s=u.autocapture.networkTracking.captureRules)||void 0===s?void 0:s.length)){l.networkTracking=de({},u.autocapture.networkTracking);var g=null!==(a=l.networkTracking.captureRules)&&void 0!==a?a:[];try{for(var h=he(g),v=h.next();!v.done;v=h.next()){var m=v.value;m.urls=Ni(null!==(c=m.urls)&&void 0!==c?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=de({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=de(de({},t.autocapture),l))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var Mi,ji="1.22.2",qi="[Amplitude] Element Clicked",Fi="[Amplitude] Element Tag",Bi="[Amplitude] Element Text",$i="[Amplitude] Page URL",Hi="data-amp-mask-attributes",Ki=["input","select","textarea"],zi=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t},Gi=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&xt(window.location.href,n))&&!!xt(window.location.href,t)},Ji=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(a)return a(r,i);if(!Gi(e))return!1;var u=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var l=zi(i,r);if(n&&l)return!0;if(t){var d=t.some((function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}));if(!d)return!1}switch(c){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!l||"click"===r}}},Vi=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},Wi=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:Wi(null==e?void 0:e.parentElement,t):null},Yi=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Mi||(Mi={}));var Qi="__AMPLITUDE_VISUAL_TAGGING__";var Xi=Ke(),Zi=function(){return new pr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}}))},eo=function(e){return void 0===e&&(e="click"),new pr((function(t){var n=function(e){t.next(e)};return Xi.document.addEventListener(e,n,{capture:!0}),function(){Xi.document.removeEventListener(e,n,{capture:!0})}}))},to=function(){var e=hr(new pr((function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=de(de({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return Xi.addEventListener("error",t),function(){Xi.removeEventListener("error",t)}})),new pr((function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return Xi.addEventListener("unhandledrejection",t),function(){Xi.removeEventListener("unhandledrejection",t)}})));return hr(e,new pr((function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return ln.addListener("error",t),function(){ln.removeListener(t)}})))},no=function(e,t,n){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))},ro={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},io=function(e){var t,n,r,i,o=Object.values(ro).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{try{for(var u=(r=void 0,he(c.definition)),l=u.next();!l.done;l=u.next()){var d=l.value,f=ro[d.event_type];f&&o[f].add(c.id)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},oo=function(e){var t,n,r,i,o=new Map;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{for(var u=(r=void 0,he(c.conditions)),l=u.next();!l.done;l=u.next()){var d=l.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},so=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return ro[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},ao=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=function(e,t){var n,r,i,o,s=new Set;try{for(var a=he(e),c=a.next();!c.done;c=a.next()){var u=c.value,l=t.get(u.id);if(l)try{for(var d=(i=void 0,he(l)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)}(so(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return r.labeledEvents[e]}))),this.labeledEventToTriggerMap);try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=s.value;no(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),co=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Hi,qn]),uo=["type"],lo=["svg","path","g"],fo=["password","hidden"];function po(e,t){var n,r,i,o,s,a;if(null===e)return null;var c=String(e.tagName).toLowerCase(),u={tag:c},l=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var g={},h=Array.from(e.attributes).filter((function(e){return!co.has(e.name)})),v=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Ki.includes(i)&&!o}(e);if(!fo.includes(String(e.getAttribute("type")))&&!lo.includes(c))try{for(var m=he(h),y=m.next();!y.done;y=m.next()){var b=y.value;v&&!uo.includes(b.name)||(t.has(b.name)?g[b.name]=Fn:g[b.name]=String(b.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(g).length&&(u.attrs=g),u}var go,ho=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return Kn(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s,a=performance.now();if(!e)return[];for(var c,u=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=u.length-1;d>=0;d--){var f=u[d];if(f){var p=(c=f.getAttribute(Hi))?c.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],g=d===u.length-1?[]:null!==(r=l.get(u[d+1]))&&void 0!==r?r:new Set,h=new Set(me(me([],ve(g),!1),ve(p),!1));l.set(f,h)}}s=u.map((function(e){var t;return po(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)}));var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var n=ve(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))}))};try{for(var m=he(s),y=m.next();!y.done;y=m.next())v(y.value)}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,c,u,l=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),p=null===(a=f[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),h=(c=null!=p?p:{},u=n,Object.entries(c).reduce((function(e,t){var n=ve(t,2),r=n[0],i=n[1];if(r.startsWith(u)){var o=r.replace(u,"");o&&(e[o]=i||"")}return e}),{})),v=((r={})["[Amplitude] Element Hierarchy"]=f,r[Fi]=l,r[Bi]=o.getText(t),r["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),r["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),r["[Amplitude] Element Attributes"]=h,r["[Amplitude] Element Parent Label"]=g,r[$i]=Rt(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=zn(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);if(v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var m=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(m)}return Vi(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&zi(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=Wi(s.event.target,n);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?o.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(qn,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.nodeType!==Node.TEXT_NODE?u instanceof Element&&(u.hasAttribute(qn)||u.hasAttribute("contenteditable")?i+=Fn:i+=o.getTextWithMaskedDescendants(u)):i+=u.textContent||""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(qn,"]")))return Fn;var t="";return t=e.querySelector("[".concat(qn,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),s=((t={})[Fi]=i,t[Bi]=o.getText(e),t[$i]=window.location.href.split("?")[0],t);return Vi(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var c=he(s),u=c.next();!u.done;u=c.next()){var l=u.value;if(a.length>=25)break;if(l instanceof RegExp)a.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{a.push(new RegExp(l.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(go||(go={}));var vo=function(e,t){var n,r,i,o,s,a,c,u;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",ji);var l=e.dataAttributePrefix,d=void 0===l?fn:l,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0}:f;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:dn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:pn,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(o=e.pageUrlExcludelist)||void 0===o?void 0:o.reduce((function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e}),[]);var g="@amplitude/plugin-autocapture-browser",h=[],v=new ho(e,t),m=io(Object.values(null!==(a=null===(s=e.pageActions)||void 0===s?void 0:s.labeledEvents)&&void 0!==a?a:{})),y=oo(null!==(u=null===(c=e.pageActions)||void 0===c?void 0:c.triggers)&&void 0!==u?u:[]),b=function(e,t,n,r){return new ao(e,t,n,r)}(m,y,v,e);return{name:g,type:"enrichment",setup:function(t,n){return pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,f,T;return ge(this,(function(w){return"undefined"==typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var n,r;t&&(e.pageActions=de(de({},e.pageActions),t),m=io(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),y=oo(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),b.update(m,y,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=Ji(e,e.cssSelectorAllowlist),i=Ji(e,e.actionClickAllowlist),o=function(){var t,n,r=vr(eo().map((function(t){return v.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}))),i=vr(new pr((function(t){var n,r=function(n){var r=v.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,d);t.next(r)};return null===(n=Ke())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=Ke())||void 0===e?void 0:e.document.removeEventListener("change",r)}})));window.navigation&&(n=vr(new pr((function(t){var n=function(n){var r=v.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,d);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}))));var o=vr(Zi().map((function(t){return v.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)})));return(t={})[go.ChangeObservable]=i,t[go.ClickObservable]=r,t[go.MutationObservable]=o,t[go.NavigateObservable]=n,t}(),s=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(Yi).filter((function(e){return r("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(qi,e.targetElementProperties)}))}({allObservables:o,amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(s),a=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(Yi).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return o(e)})).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,me(me([],ve(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(a),c=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=n.clickObservable,c=n.mutationObservable,u=n.navigateObservable,l=a.filter((function(e){return!o("click",e.closestTrackedAncestor)})).map((function(e){var t=Wi(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(Yi).filter((function(e){return s("click",e.closestTrackedAncestor)})),d=u?hr(c,u):c,f=hr(l,d),p=null,g=null;return gr(f,(function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return g=e,p=setTimeout((function(){p=null,g=null}),500),Promise.resolve(null);if(g){var t=g;return g=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(qi,i("click",e.closestTrackedAncestor)))}))}({allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,me(me([],ve(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}),c&&h.push(c),null===(T=null==t?void 0:t.loggerProvider)||void 0===T||T.log("".concat(g," has been successfully added.")),window.opener&&p.enabled&&(u=e.cssSelectorAllowlist,l=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n[Qi]){n[Qi]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,c=function(t){e.notify({action:"element-selected",data:t})},u=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",(function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then((function(){var n;a=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:c,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:ji}}}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))})),e.registerActionHandler("close-visual-tagging-selector",(function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)}))}}(f=Or(),{dataExtractor:v,isElementSelectable:Ji(e,me(me([],ve(u),!1),ve(l),!1)),cssSelectorAllowlist:u,actionClickAllowlist:l}),function(e){var t=e;if(!0!==t[Cr]){t[Cr]=!0;var n="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.1.js.gz",r=null,i=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",(function(){var t,o;null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Initializing background capture (external script)");var s=new URL(n,e.endpoint).toString();e.loadScriptOnce(s).then((function(){var t,n,o;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),r=null===(o=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===o?void 0:o.call(window,{messenger:e,onBackgroundCapture:i}),e.notify({action:"background-capture-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")}))})),e.registerActionHandler("close-background-capture",(function(){var e;null===(e=null==r?void 0:r.close)||void 0===e||e.call(r),r=null}))}}(f),f.setup(de({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:_r[t.serverZone]})))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){try{for(e=he(h),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},mo=["mutation","navigate"];function yo(e,t){var n,r,i,o,s=t.event,a=s.pageX,c=s.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:c,c),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:c,c),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function bo(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:de({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map((function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}})),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function To(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=r.selectionObservable,a=[],c={},u=null;function l(e){a=[],c={},e&&(yo(c,e),a.push(e))}var d=gr(o.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return pe(t,void 0,void 0,(function(){var t;return ge(this,(function(n){return yo(c,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(a,e)||c.isOutOfBounds?(u&&(t=bo(a)),l(e)):a.push(e),u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=4?[2,new Promise((function(e){u={resolve:e,timerId:setTimeout((function(){e(bo(a))}),1e3)}}))]:[2,null]}))}))})),f=null==s?void 0:s.subscribe((function(){l()})),p=d.subscribe((function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})}));return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}var wo,ko;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(wo||(wo={})),function(e){e.X="x",e.Y="y"}(ko||(ko={}));function So(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function Eo(e){e.changes=[],e.startTime=void 0}function _o(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var Io=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?10:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new pr((function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},s=void 0,a=null;function c(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),Eo(n),Eo(i))}return t.subscribe((function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===ko.X?n:i);var t=function(e,t){var n=void 0;if(So(e)&&(n=e.startTime),So(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(s=s||t,a=setTimeout((function(){c(),a=null}),o)):c(),_o(n),_o(i),function(){null!==a&&(clearTimeout(a),a=null)}}))}))},Po=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?10:i,s=e.thresholdMs,a=void 0===s?2e3:s,c=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new pr((function(e){var n=null,r=null,i=null;return t.subscribe((function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===wo.DECREASING&&e.next(ko.X),r=wo.INCREASING):o.x<n.x&&(r===wo.INCREASING&&e.next(ko.X),r=wo.DECREASING),o.y>n.y?(i===wo.DECREASING&&e.next(ko.Y),i=wo.INCREASING):o.y<n.y&&(i===wo.INCREASING&&e.next(ko.Y),i=wo.DECREASING),n=o):n=o}))}))}({allWindowObservables:r});return Io({mouseDirectionChangeObservable:c,directionChanges:o,thresholdMs:a}).subscribe((function(e){Gi(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})}))};function Ao(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var Oo,Co,xo=4e3,Ro=function(e){var t;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,s=!1!==e.rageClicks&&null!==e.rageClicks,a=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(a=!1);var c=Ao(e,"rageClicks",mn,s),u=Ao(e,"deadClicks",hn,o),l=Ao(e,"errorClicks",vn,i),d=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:fn,f=new ho(e),p=me([],ve(new Set(me(me(me([],ve(c),!1),ve(u),!1),ve(l),!1))),!1),g=function(){var e,t,n=vr(eo("pointerdown").map((function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)}))),r=vr(to().map((function(e){return f.addTypeAndTimestamp(e,"error")}))),i=vr(Zi().map((function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)})));window.navigation&&(t=vr(new pr((function(e){var t=function(t){e.next(de(de({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)}))));var o=vr(new pr((function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}))),s=vr(new pr((function(e){var t=function(t){e.next(t)},n={capture:!0};return Xi.document.addEventListener("mousemove",t,n),function(){Xi.document.removeEventListener("mousemove",t,n)}})));return(e={})[go.ClickObservable]=n,e[go.MutationObservable]=i,e[go.NavigateObservable]=t,e[go.BrowserErrorObservable]=r,e[go.SelectionObservable]=o,e[go.MouseMoveObservable]=s,e};return{name:n,type:"enrichment",setup:function(t,p){return pe(void 0,void 0,void 0,(function(){var h,v,m,y,b,T,w,k,S,E,_;return ge(this,(function(I){return"undefined"==typeof document||(h=g(),s&&(v=Ji(e,c),m=To({allObservables:h,amplitude:p,shouldTrackRageClick:v}),r.push(m)),o&&(y=Ji(e,u),b=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackDeadClick,o=n.clickObservable,s=n.mutationObservable,a=n.navigateObservable,c=o.filter((function(e){return Yi(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Mi.LEFT_OR_TOUCH_CONTACT})),u=a?hr(s,a):s,l=hr(c,u),d=null;return gr(l,(function(e){return d&&mo.includes(e.type)?(clearTimeout(d),d=null,Promise.resolve(null)):"click"===e.type?d?Promise.resolve(null):new Promise((function(t){d=setTimeout((function(){t(e),d=null}),3e3)})):Promise.resolve(null)})).subscribe((function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",de(de({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}}))}({amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:y}),r.push(b)),i&&(T=Ji(e,l),w=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,i=n.clickObservable,o=n.browserErrorObservable,s=i.filter((function(e){return Yi(e)&&r("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Mi.LEFT_OR_TOUCH_CONTACT})),a=null,c=null,u=function(){null!==a&&(clearTimeout(a),a=null),c=null};return hr(s,o).subscribe((function(e){var n;if("click"===e.type)return u(),c=e,void(a=setTimeout(u,2e3));"error"===e.type&&c&&(t.track("[Amplitude] Error Click",de(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),c.targetElementProperties)),u())}))}({amplitude:p,allObservables:h,shouldTrackErrorClick:T}),r.push(w)),a&&(k=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,k&&k<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),S&&S>xo&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(xo,", setting to ").concat(xo)),S=xo)),E=Po({amplitude:p,options:e,allObservables:h,directionChanges:k,thresholdMs:S}),r.push(E)),null===(_=null==t?void 0:t.loggerProvider)||void 0===_||_.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,i;return ge(this,(function(o){try{for(e=he(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},Do="[Amplitude] Network Request",Lo="500-599";function No(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function Uo(e,t){var n,r,i=t.split(",");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split("-").map(Number),2),c=a[0],u=a[1];if(e===c&&void 0===u)return!0;if(e>=c&&e<=u)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function Mo(e){var t;if(e)try{var n=null===(t=Ke())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:r.href,host:a}}catch(e){return}}function jo(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return me([],ve(Ne),!1);if(void 0===e){return}}}function qo(e){var t,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)}function Fo(e,t){var n;void 0===t&&(t={});var r=Mo(e.url);if(!r)return!1;var i,o=r.host;if(!1!==t.ignoreAmplitudeRequests&&(No(o,"*.amplitude.com")||No(o,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find((function(e){return No(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Uo(e.status,Lo))return!1;if(t.captureRules&&(me([],ve(t.captureRules),!1).reverse().find((function(t){if(i=function(e,t,n,r,i){if((!e.hosts||e.hosts.find((function(e){return No(t,e)})))&&(!r||!e.urls||xt(r,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e}))))return!((n||0===n)&&!Uo(n,e.statusCodeRange||Lo))}(t,o,e.status,e.url,e.method),i){var n=jo(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var s=jo(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!qo(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!qo(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find((function(e){return e.event_type===Do})))return!0}catch(e){}return!1}(o,e.requestWrapper)}function Bo(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return Fo(e.event,n)})).subscribe((function(e){var t,n,o,s=e.event,a=Mo(s.url);if(a){var c=null===(n=s.responseWrapper)||void 0===n?void 0:n.bodySize,u=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,n,r){pe(this,void 0,void 0,(function(){var i,o,s;return ge(this,(function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=ve.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(Do,e),[2]}}))}))}(((t={})["[Amplitude] URL"]=a.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=a.query,t["[Amplitude] URL Fragment"]=a.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=c,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,r,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(Oo||(Oo={}));var $o=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new pr((function(e){var n=new Ln((function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)}));return Mn.subscribe(n,t),function(){Mn.unsubscribe(n)}}));return(e={})[Oo.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return pe(void 0,void 0,void 0,(function(){var s;return ge(this,(function(a){return"undefined"==typeof document||(s=r(),t=null==i?void 0:i.loggerProvider,Co=Bo({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return Co.unsubscribe(),[2]}))}))}}};let Ho=-1;const Ko=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Ho=t.timeStamp,e(t))}),!0)},zo=(e,t,n,r)=>{let i,o;return s=>{t.value>=0&&(s||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Go=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Jo=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vo=()=>{const e=Jo();return e?.activationStart??0},Wo=(e,t=-1)=>{const n=Jo();let r="navigate";return Ho>=0?r="back-forward-cache":n&&(document.prerendering||Vo()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Yo=new WeakMap;function Qo(e,t){return Yo.get(e)||Yo.set(e,new t),Yo.get(e)}class Xo{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const Zo=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},es=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let ts=-1;const ns=new Set,rs=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,is=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of ns)e();isFinite(ts)||(ts="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",is,!0))}},os=()=>{if(ts<0){const e=Vo(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;ts=t??rs(),addEventListener("visibilitychange",is,!0),addEventListener("prerenderingchange",is,!0),Ko((()=>{setTimeout((()=>{ts=rs()}))}))}return{get firstHiddenTime(){return ts},onHidden(e){ns.add(e)}}},ss=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},as=[1800,3e3],cs=(e,t={})=>{ss((()=>{const n=os();let r,i=Wo("FCP");const o=Zo("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Vo(),0),i.entries.push(t),r(!0)))}));o&&(r=zo(e,i,as,t.reportAllChanges),Ko((n=>{i=Wo("FCP"),r=zo(e,i,as,t.reportAllChanges),Go((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},us=[.1,.25];let ls=0,ds=1/0,fs=0;const ps=e=>{for(const t of e)t.interactionId&&(ds=Math.min(ds,t.interactionId),fs=Math.max(fs,t.interactionId),ls=fs?(fs-ds)/7+1:0)};let gs;const hs=()=>gs?ls:performance.interactionCount??0;let vs=0;class ms{u=[];l=new Map;m;p;v(){vs=hs(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((hs()-vs)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const ys=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=es(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},bs=[200,500],Ts=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=os();ss((()=>{"interactionCount"in performance||gs||(gs=Zo("event",ps,{type:"event",buffered:!0,durationThreshold:0}));let r,i=Wo("INP");const o=Qo(t,ms),s=e=>{ys((()=>{for(const t of e)o.h(t);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,r())}))},a=Zo("event",s,{durationThreshold:t.durationThreshold??40});r=zo(e,i,bs,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),Ko((()=>{o.v(),i=Wo("INP"),r=zo(e,i,bs,t.reportAllChanges)})))}))};class ws{m;h(e){this.m?.(e)}}const ks=[2500,4e3],Ss=[800,1800],Es=e=>{document.prerendering?ss((()=>Es(e))):"complete"!==document.readyState?addEventListener("load",(()=>Es(e)),!0):setTimeout(e)};function _s(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function Is(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(_s(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Ps,As=function(){var e=null,t=Ke(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return void 0===n||(o=Rt((null==r?void 0:r.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Rt((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Rt(o.split("?")[0],t.loggerProvider)},((e,t={})=>{ss((()=>{const n=os();let r,i=Wo("LCP");const o=Qo(t,ws),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Vo(),0),i.entries=[t],r())},a=Zo("largest-contentful-paint",s);if(a){r=zo(e,i,ks,t.reportAllChanges);const n=es((()=>{s(a.takeRecords()),a.disconnect(),r(!0)})),o=e=>{e.isTrusted&&(ys(n),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});Ko((n=>{i=Wo("LCP"),r=zo(e,i,ks,t.reportAllChanges),Go((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))})((function(e){s["[Amplitude] LCP"]=Is(e)})),cs((function(e){s["[Amplitude] FCP"]=Is(e)})),Ts((function(e){s["[Amplitude] INP"]=Is(e)})),((e,t={})=>{const n=os();cs(es((()=>{let r,i=Wo("CLS",0);const o=Qo(t,Xo),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=Zo("layout-shift",s);a&&(r=zo(e,i,us,t.reportAllChanges),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),Ko((()=>{o.i=0,i=Wo("CLS",0),r=zo(e,i,us,t.reportAllChanges),Go((()=>r()))})),setTimeout(r))})))})((function(e){s["[Amplitude] CLS"]=Is(e)})),((e,t={})=>{let n=Wo("TTFB"),r=zo(e,n,Ss,t.reportAllChanges);Es((()=>{const i=Jo();i&&(n.value=Math.max(i.responseStart-Vo(),0),n.entries=[i],r(!0),Ko((()=>{n=Wo("TTFB",0),r=zo(e,n,Ss,t.reportAllChanges),r(!0)})))}))})((function(e){s["[Amplitude] TTFB"]=Is(e)})),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]}))}))}}},Os=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Cs=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=fe(e,["referrer","referring_domain"]),a=t||{};a.referrer;var c=a.referring_domain,u=fe(a,["referrer","referring_domain"]);if(xs(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(s)!==JSON.stringify(u),d=Os(o||"")!==Os(c||""),f=!t||l||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},xs=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},Rs=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=de({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=null===(n=t.cookieOptions)||void 0===n?void 0:n.domain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[]),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=jt(t.apiKey,"MKTG"),this.webExpStorageKey=jt(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Le,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=ve.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||It(this.sessionTimeout,this.lastEventTime),Cs(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return pe(this,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new jn).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,o=(t=this.currentCampaign,n=this.options,r=de(de({},Le),t),i=Object.entries(r).reduce((function(e,t){var r,i=ve(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)}),new qe),Ve(i));return e&&(o.event_id=e),o},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Ds="AMP_CURRENT_PAGE",Ls="AMP_PREVIOUS_PAGE",Ns="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Ps||(Ps={}));var Us=new Set([le.IDENTIFY,le.GROUP_IDENTIFY,le.REVENUE]),Ms=function(e){var t={}.internalDomains,n=void 0===t?[]:t,r=Ke(),i=void 0,o=!1,s=void 0,a=!1,c=!1,u=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?function(e){var t;try{var n=Rt(e,s);t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t}(e):void 0;if(!r)return Ps.Direct;var i=n.some((function(e){return-1!==t.indexOf(e)})),o=n.some((function(e){return-1!==r.indexOf(e)}));return t===r||o&&i?Ps.Internal:Ps.External},l=function(){pe(void 0,void 0,void 0,(function(){var e,t,n,r,s;return ge(this,(function(a){switch(a.label){case 0:return i&&o?[4,i.get(Ns)]:[3,3];case 1:return e=a.sent(),t=Rt("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Ds])||"",r=void 0,r=t===n?(null==e?void 0:e[Ls])||"":n||document.referrer||"",[4,i.set(Ns,(s={},s[Ds]=t,s[Ls]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},d={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return(s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,r?[4,(i=new qt(r.sessionStorage)).isEnabled()]:[3,2];case 1:o=t.sent(),r.addEventListener("popstate",l),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),a=!0),t.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t,n,r,s,a;return ge(this,(function(c){switch(c.label){case 0:return t=Rt("undefined"!=typeof location&&location.href||""),i&&o?[4,i.get(Ns)]:[3,5];case 1:return(null==(n=c.sent())?void 0:n[Ds])?[3,3]:[4,i.set(Ns,(a={},a[Ds]=t,a[Ls]=document.referrer||"",a))];case 2:c.sent(),c.label=3;case 3:return[4,i.get(Ns)];case 4:if(r=c.sent(),s="",r&&(s=r[Ls]||""),Us.has(e.event_type))return[2,e];e.event_properties=de(de({},e.event_properties||{}),{"[Amplitude] Page Domain":js(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":js(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":js(e,"[Amplitude] Page Path","undefined"!=typeof location&&Rt(location.pathname)||""),"[Amplitude] Page Title":js(e,"[Amplitude] Page Title",zn(Kn)),"[Amplitude] Page URL":js(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":u(s)}),c.label=5;case 5:return[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",l),c=!1),i&&o?[4,i.set(Ns,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return d};function js(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var qs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return ce(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),We(this._init(de(de({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,c;return pe(this,void 0,void 0,(function(){var u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E=this;return ge(this,(function(_){switch(_.label){case 0:return this.initializing?[2]:(this.initializing=!0,u=function(e){var t,n;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),l=null!==(n=t.loggerProvider)&&void 0!==n?n:new et,d=null!==(r=t.serverZone)&&void 0!==r?r:"US",p=this._diagnosticsSampleRate,g=null===(i=t.enableDiagnostics)||void 0===i||i,u?(f=new nn(t.apiKey,l,d,null===(o=t.remoteConfig)||void 0===o?void 0:o.serverUrl),[4,new Promise((function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",(function(t,n,r){if(l.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(p=i);var o=t.enabled;"boolean"==typeof o&&(g=o)}e()}))}))]):[3,2]);case 1:_.sent(),_.label=2;case 2:return(h=new Xt(t.apiKey,l,d,{enabled:g,sampleRate:p})).setTag("library","".concat(Jr,"/").concat(Gr)),"undefined"!=typeof navigator&&h.setTag("user_agent",navigator.userAgent),[4,bi(t.apiKey,t,this,h,{loggerProvider:l,serverZone:d,enableDiagnostics:g,diagnosticsSampleRate:p})];case 3:return v=_.sent(),u&&f?[4,new Promise((function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,n,r){v.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&Ui(t,v),e()}))}))]:[3,5];case 4:_.sent(),_.label=5;case 5:return[4,e.prototype._init.call(this,v)];case 6:return _.sent(),this.logBrowserOptions(v),this.config.remoteConfigClient=f,Rr(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return e?[3,2]:(t=Hr(this.config),this.webAttribution=new Rs(t,this.config),[4,this.webAttribution.init()]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))})),m=Hr(this.config),this.webAttribution=new Rs(m,this.config),[4,this.webAttribution.init()]):[3,8];case 7:_.sent(),_.label=8;case 8:return y=Ot(),b=y.ampTimestamp?Number(y.ampTimestamp):void 0,T=!b||Date.now()<b,w=T&&!Number.isNaN(Number(y.ampSessionId))?Number(y.ampSessionId):void 0,-1!==(k=this.config.deferredSessionId)||this.config.optOut||(k=Date.now()),this.setSessionId(null!==(c=null!==(a=null!==(s=t.sessionId)&&void 0!==s?s:w)&&void 0!==a?a:k)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){return ge(this,(function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]}))}))})),(S=Et(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,10]:[4,this.add(Di()).promise];case 9:_.sent(),_.label=10;case 10:return[4,this.add(new pt({diagnosticsClient:h})).promise];case 11:return _.sent(),[4,this.add(new Vr).promise];case 12:return _.sent(),[4,this.add(new _t).promise];case 13:return _.sent(),P=this.config,Ri||void 0!==P.defaultTracking||(P.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Ri=!0),I=this.config.defaultTracking,xr(I,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(xi()).promise]):[3,15];case 14:_.sent(),_.label=15;case 15:return Dr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Ai()).promise]):[3,17];case 16:_.sent(),_.label=17;case 17:return Lr(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ei($r(this.config))).promise]):[3,20];case 18:return _.sent(),[3,20];case 19:this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ei($r(this.config))).promise]);case 1:return t.sent(),[2]}}))}))})),_.label=20;case 20:return Mr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(vo(qr(this.config),{diagnosticsClient:h})).promise]):[3,22];case 21:_.sent(),_.label=22;case 22:return jr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Ro(Fr(this.config))).promise]):[3,24];case 23:_.sent(),_.label=24;case 24:return Ur(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add($o(Br(this.config))).promise]):[3,26];case 25:_.sent(),_.label=26;case 26:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(As()).promise]):[3,28];case 27:_.sent(),_.label=28;case 28:return function(e){return xr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Ms()).promise]):[3,30];case 29:_.sent(),_.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return _.sent(),S.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},n=t.time,r=fe(t,["time"]),i="number"==typeof n?{time:n}:void 0;E.track(e.eventType,r,i)})),[2]}var I,P}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){Et(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){Et(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(Ge()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){var t,n,r;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new qe,o=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var s=he(Object.entries(o)),a=s.next();!a.done;a=s.next()){var c=ve(a.value,2),u=c[0],l=c[1];i.set(u,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),We(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,We(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return We(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Nr(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ci,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(Ve(this.config.identify)).promise),Nr(this.config.defaultTracking)&&n.push(this.track(ai,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,We(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=wi(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(zr(t)){var r=t._q;t._q=[],t=Kr(new qe,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(zr(r)){var o=r._q;r._q=[],r=Kr(new qe,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(zr(t)){var r=t._q;t._q=[],t=Kr(new Qe,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return pe(this,void 0,void 0,(function(){var n,r,i;return ge(this,(function(o){return n=Date.now(),r=It(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===ai||t.event_type===ci||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=de(de({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Sr(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(Ye),Fs=function(){var e=new qs;return{init:dt(e.init.bind(e),"init",ct(e),lt(e,["config"])),add:dt(e.add.bind(e),"add",ct(e),lt(e,["config.apiKey","timeline.plugins"])),remove:dt(e.remove.bind(e),"remove",ct(e),lt(e,["config.apiKey","timeline.plugins"])),track:dt(e.track.bind(e),"track",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),logEvent:dt(e.logEvent.bind(e),"logEvent",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),identify:dt(e.identify.bind(e),"identify",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:dt(e.groupIdentify.bind(e),"groupIdentify",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),setGroup:dt(e.setGroup.bind(e),"setGroup",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),revenue:dt(e.revenue.bind(e),"revenue",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),flush:dt(e.flush.bind(e),"flush",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),getUserId:dt(e.getUserId.bind(e),"getUserId",ct(e),lt(e,["config","config.userId"])),setUserId:dt(e.setUserId.bind(e),"setUserId",ct(e),lt(e,["config","config.userId"])),getDeviceId:dt(e.getDeviceId.bind(e),"getDeviceId",ct(e),lt(e,["config","config.deviceId"])),setDeviceId:dt(e.setDeviceId.bind(e),"setDeviceId",ct(e),lt(e,["config","config.deviceId"])),reset:dt(e.reset.bind(e),"reset",ct(e),lt(e,["config","config.userId","config.deviceId"])),getSessionId:dt(e.getSessionId.bind(e),"getSessionId",ct(e),lt(e,["config"])),setSessionId:dt(e.setSessionId.bind(e),"setSessionId",ct(e),lt(e,["config"])),extendSession:dt(e.extendSession.bind(e),"extendSession",ct(e),lt(e,["config"])),setOptOut:dt(e.setOptOut.bind(e),"setOptOut",ct(e),lt(e,["config"])),setTransport:dt(e.setTransport.bind(e),"setTransport",ct(e),lt(e,["config"])),getIdentity:dt(e.getIdentity.bind(e),"getIdentity",ct(e),lt(e,["config"])),setIdentity:dt(e.setIdentity.bind(e),"setIdentity",ct(e),lt(e,["config","config.userId","config.deviceId"])),getOptOut:dt(e.getOptOut.bind(e),"getOptOut",ct(e),lt(e,["config"])),_setDiagnosticsSampleRate:dt(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",ct(e),lt(e,["config"]))}},Bs=Fs(),$s=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:pn,DEFAULT_CSS_SELECTOR_ALLOWLIST:dn,DEFAULT_DATA_ATTRIBUTE_PREFIX:fn,get IdentifyOperation(){return ue},get LogLevel(){return Xe},OfflineDisabled:null,get RevenueProperty(){return $e},get ServerZone(){return un},get SpecialEventType(){return le}}),Hs=Bs.add,Ks=Bs.extendSession,zs=Bs.flush,Gs=Bs.getDeviceId,Js=Bs.getIdentity,Vs=Bs.getOptOut,Ws=Bs.getSessionId,Ys=Bs.getUserId,Qs=Bs.groupIdentify,Xs=Bs.identify,Zs=Bs.init,ea=Bs.logEvent,ta=Bs.remove,na=Bs.reset,ra=Bs.revenue,ia=Bs.setDeviceId,oa=Bs.setGroup,sa=Bs.setIdentity,aa=Bs.setOptOut,ca=Bs.setSessionId,ua=Bs.setTransport,la=Bs.setUserId,da=Bs.track,fa=Bs._setDiagnosticsSampleRate,pa=Object.freeze({__proto__:null,AmplitudeBrowser:qs,Identify:qe,Revenue:Qe,Types:$s,_setDiagnosticsSampleRate:fa,add:Hs,createInstance:Fs,extendSession:Ks,flush:zs,getDeviceId:Gs,getIdentity:Js,getOptOut:Vs,getSessionId:Ws,getUserId:Ys,groupIdentify:Qs,identify:Xs,init:Zs,logEvent:ea,remove:ta,reset:na,revenue:ra,runQueuedFunctions:function(e,t){Kr(e,t)},setDeviceId:ia,setGroup:oa,setIdentity:sa,setOptOut:aa,setSessionId:ca,setTransport:ua,setUserId:la,track:da});class ga{constructor(){this.isInitialized=!1}static getInstance(){return ga.instance||(ga.instance=new ga),ga.instance}initialize(){if(this.isInitialized||a())return;const e=b.getEnvironment()||"production",t=e===c.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";try{if(!pa||"function"!=typeof Zs)throw new Error("Analytics SDK module not available");const n={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==c.PRODUCTION?Xe.Debug:Xe.None};Zs(t,void 0,n),this.isInitialized=!0,this.track(oe)}catch(e){console.error("Failed to initialize analytics tracking:",e)}}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{da(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{na()}catch(e){console.error("Failed to reset analytics:",e)}}}const ha=ga.getInstance();function va(e,t){ha.track(e,t)}const ma=e=>{va(se,e)};class ya extends i{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function ba({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:n}){if(n){const e={...Object.fromEntries([..._(t.options?.headers)??{}])},r=P({...t,options:{...t.options,headers:e}}),i=await fetch(n.path,{method:n.method,headers:n.options.headers,body:r}),o=A(await i.text());if(!i.ok)throw new E({code:i.status,data:o,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return o}if(e){const n=Object.fromEntries([..._(t.options?.headers)??{}]),r=P({...t,options:{...t.options,headers:n}});return A(await e(r))}throw new ya("No proxy function or proxy endpoint descriptor provided for proxy call.")}var Ta;function wa(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(Ta||(Ta={}));const ka={getCards:async function(e){ma();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new R("membershipId must be a string");const{accessToken:n,stagingToken:r}=e?.operationSettings||{},i=n||s(),o=await async function({membershipId:e,accessToken:t,stagingToken:n}){const r=function({membershipId:e,accessToken:t,stagingToken:n}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({membershipId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i}({membershipId:t,accessToken:i,stagingToken:r});return o.map((e=>wa(e)))},getCard:async function({cardSettings:e,operationSettings:t}){!function(e){if(!e)throw new R("cardSettings parameter is required for the called function");if(!e.cardId)throw new R("cardId parameter is required for the called function");const t=L({cardId:e.cardId});if(t.length>0)throw new R(t)}(e);const n=e.cardId,{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({cardId:e,accessToken:t,stagingToken:n}){const r=function({cardId:e,accessToken:t,stagingToken:n}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({cardId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i[0]}({cardId:n,accessToken:o,stagingToken:i});return wa(a)}},Sa=e=>({id:e?.id,slug:e.slug,iban:e.iban,bic:e.bic,currency:e.currency,balance:parseFloat(e.balance),balanceCents:e.balance_cents,authorizedBalance:e.authorized_balance,authorizedBalanceCents:e.authorized_balance_cents,name:e.name,updatedAt:new Date(e.updated_at),status:e.status,main:e.main}),Ea={getOrganization:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/organization/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return{id:(o=i.organization).id,slug:o.slug,legalName:o.legal_name,legalNumber:o.legal_number,legalSector:o.legal_sector,legalRegistrationDate:o.legal_registration_date,legalAddress:o.legal_address,legalForm:o.legal_form,legalCountry:o.legal_country,legalShareCapital:o.legal_share_capital,locale:o.locale,contractSignedAt:o.contract_signed_at,bankAccounts:o.bank_accounts.map(Sa)};var o},getBankAccounts:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/bank_accounts/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return i.bank_accounts.map(Sa)}},_a={AED:"AED",AUD:"AUD",BGN:"BGN",CAD:"CAD",CHF:"CHF",CNY:"CNY",CZK:"CZK",DKK:"DKK",EUR:"EUR",GBP:"GBP",GHS:"GHS",HKD:"HKD",HUF:"HUF",ILS:"ILS",INR:"INR",MXN:"MXN",NOK:"NOK",NZD:"NZD",PEN:"PEN",PLN:"PLN",RON:"RON",RSD:"RSD",SAR:"SAR",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",ZAR:"ZAR",ZMW:"ZMW"},Ia=e=>{if(!(e=>Object.values(_a).includes(e))(e))throw new R(`currency ${e} is not valid, valid currencies are ${Object.values(_a).join(", ")}`)},Pa={GOOD:"good",SERVICE:"service"},Aa={UNIT:"unit",HOUR:"hour",DAY:"day",MONTH:"month",GRAM:"gram",KILOGRAM:"kilogram",LITER:"liter",METER:"meter",SQUARE_METER:"square_meter",CUBIC_METER:"cubic_meter",AMPERE:"ampere",NUMBER_OF_ARTICLES:"number_of_articles",CENTIMETER:"centimeter",CUBIC_METER_PER_HOUR:"cubic_meter_per_hour",GIGAJOULE:"gigajoule",GIGAWATT:"gigawatt",GIGAWATT_HOUR:"gigawatt_hour",HALF_YEAR:"half_year",JOULE:"joule",KILOJOULE:"kilojoule",KILOVAR:"kilovar",KILOWATT:"kilowatt",KILOWATT_HOUR:"kilowatt_hour",MEGAJOULE:"megajoule",MEGAWATT:"megawatt",MEGAWATT_HOUR:"megawatt_hour",MILLIGRAM:"milligram",MILLILITER:"milliliter",MILLIMETER:"millimeter",MINUTE:"minute",PAIR:"pair",QUARTER:"quarter",SECOND:"second",SET:"set",TON:"ton",TWO_WEEK:"two_week",WATT_HOUR:"watt_hour",WEEK:"week",YEAR:"year"},Oa=e=>{if(!(e=>Object.values(Aa).includes(e))(e))throw new R(`unit ${e} is not valid, valid units are ${Object.values(Aa).join(", ")}`)},Ca=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],xa=[{name:"currency"},{name:"value"}];const Ra=e=>{if(!Object.values(Pa).includes(e))throw new R(`type ${e} is not valid, valid types are ${Object.values(Pa).join(", ")}`)};const Da={getPaymentLinkCreationFlowUrl:async({paymentLinkSettings:e,operationSettings:t})=>{const{items:n}=e;!function(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{D(e,Ca),D(e.unitPrice,xa);const t=[...L({id:e.id,title:e.title,vatRate:e.vatRate,currency:e.unitPrice.currency,measureUnit:e.measureUnit,unitPrice:e.unitPrice.value,...e.description?{description:e.description}:{}}),...N({quantity:e.quantity})].flat();if(t.length>0)throw new R(t);Ra(e.type),Ia(e.unitPrice.currency),Oa(e.measureUnit)}))}(n);const r=function(e){if(!e?.callbackUrl)throw new R("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new R("callbackUrl cannot be empty");return e.callbackUrl}(e),i=await M({requestSettings:{action:p.PAYMENT_LINK_CREATE,callbackUrl:r},operationSettings:t}),o=new URLSearchParams({...n?{items:JSON.stringify(n)}:{}});return o.toString()?`${i.url}?${o.toString()}`:i.url}};function La(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function Na(e){return{name:e.name,iban:e.iban}}const Ua="/v2/sepa",Ma=`${Ua}/transfers`;async function ja({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${Ma}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{transfers:i,meta:o}=await I(r);return{transfers:i,meta:o}}async function qa({accessToken:e,stagingToken:t,sepaTransferId:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${Ma}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:n,accessToken:e,stagingToken:t}),{transfer:i}=await I(r);return i}async function Fa({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function(e){const t=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:t,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:Ma,options:{method:"POST",headers:{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o},body:{transfer:s,vop_proof_token:t}}}}({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}),{transfer:a}=await I(s);return a}async function Ba({sepaTransferId:e,accessToken:t,stagingToken:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${Ma}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:e,accessToken:t,stagingToken:n});await I(r)}async function $a({sepaPayee:e,accessToken:t,stagingToken:n}){const r=function({sepaPayee:e,accessToken:t,stagingToken:n}){return{path:`${Ua}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:t,stagingToken:n});return await I(r)}function Ha(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function Ka(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const za="/v2/sepa/bulk_transfers";async function Ga({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${za}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{bulk_transfers:i,meta:o}=await I(r);return{bulkTransfers:i,meta:o}}async function Ja({accessToken:e,stagingToken:t,bulkTransferId:n}){const r=function({bulkTransferId:e,accessToken:t,stagingToken:n}){return{path:`${za}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({bulkTransferId:n,accessToken:e,stagingToken:t}),{bulk_transfer:i}=await I(r);return i}async function Va({sepaPayees:e,accessToken:t,stagingToken:n}){const r=function({sepaPayees:e,accessToken:t,stagingToken:n}){return{path:`${Ua}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{requests:e.map(Na)}}}}({sepaPayees:e,accessToken:t,stagingToken:n});return await I(r)}function Wa(e){if(!e)throw new R("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new R("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new R("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new R("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{!function(e,t){if(!e)throw new R(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new R(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const n=L({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),r=N({amount:e.amount}),i=[...n,...r].flat();if(i.length>0)throw new R(i);if(e.amount>d&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new R(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €30000`)}(e,t)})),e}const Ya={requiresUI:!1};function Qa(e,{requiresUI:t}=Ya){const n=e?.uiParentElementId||S.getUIParentElementId();if(t){if(!n)throw new R("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof n))throw new R("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const r=e?.mfaPreference||S.getMFAPreference();if(r){const e=(i=Object.values(l),b.isProductionEnvironment()?i.filter((e=>e!==l.MOCK)):i);if(!e.includes(r))throw new R(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(b.isProductionEnvironment()&&r===l.MOCK)throw new R("operationSettings.mfaPreference cannot be set to mock in production environment.")}var i;const o=e?.debugMode||S.getDebugMode();if(void 0!==o&&"boolean"!=typeof o)throw new R("operationSettings.debugMode must be a boolean.");const s=e?.proxyRequestFunction||S.getProxyRequestFunction();if(s&&"function"!=typeof s)throw new R("operationSettings.proxyRequestFunction must be a function.");const a=e?.proxyEndpointDescriptor||S.getProxyEndpointDescriptor();if(a&&!a.path)throw new R("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:n,mfaPreference:r,debugMode:o,proxyRequestFunction:s,proxyEndpointDescriptor:a}}async function Xa({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{proxyRequestFunction:r,proxyEndpointDescriptor:i,accessToken:o,stagingToken:a}=Qa(t||{});if(r||i){const e=Q({beneficiaryId:n});return J((await ba({proxyFunction:r,proxyEndpointDescriptor:i,networkCallDescriptor:e})).body.beneficiary)}{const e=o||s();return J(await X({beneficiaryId:n,accessToken:e,stagingToken:a}))}}({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function Za(e,t){const n=t?.locale||w.getLocale(),r=new URL(e);return n&&r.searchParams.append("lang",n),t?.mfaPreference&&r.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&r.searchParams.append("idempotencyKey",t.idempotencyKey),r.toString()}const ec=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const tc={getSepaTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await ja({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.transfers.map(La),c=F(o.meta);return{transfers:a,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return La(await qa({sepaTransferId:n,accessToken:o,stagingToken:i}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||G();!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new R("Either beneficiaryId or beneficiary must be provided");const t=L({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new R(t)}(e);const u=e?.beneficiary?e.beneficiary:await Xa({sepaTransferSettings:e,operationSettings:t}),l={name:u.name,iban:u.iban},p=await $a({sepaPayee:l,accessToken:a,stagingToken:r}),g=yield(h=p,{matchResult:h.match_result,matchedName:h.matched_name});var h;let v;if("string"==typeof g){if(g===f)return}else{if(g.vopDecision===f)return;v=g.sepaTransferSettings}const m={...e,...v};!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");D(e,ec);const t=[...L({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...N({amount:e.amount})].flat();if(t.length>0)throw new R(t);if(e.amount>d&&(!e.attachmentIds||0===e.attachmentIds.length))throw new R("Attachments are required for transfers over €30,000")}(m);const y={...m,beneficiary:u};return{transfer:La(await Fa({transfer:y,vopProofToken:p.proof_token.token,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();await Ba({sepaTransferId:n,accessToken:o,stagingToken:i})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e||!e.callbackUrl)throw new R("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({requestSettings:e,operationSettings:t}){U(e);const{proxyRequestFunction:n,proxyEndpointDescriptor:r,stagingToken:i}=Qa(t||{});if(n||r){const t=O({stagingToken:i,action:e.action,callbackUrl:e.callbackUrl});return x((await ba({proxyFunction:n,proxyEndpointDescriptor:r,networkCallDescriptor:t})).body)}{const n=t?.accessToken||s();return x(await C({accessToken:n,stagingToken:i,action:e.action,callbackUrl:e.callbackUrl}))}}({requestSettings:{action:p.SEPA_TRANSFER_CREATE,callbackUrl:n},operationSettings:{stagingToken:i,accessToken:o}});return{...a,url:Za(a.url,t)}},bulkTransfers:{getBulkTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Ga({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.bulkTransfers?.map(Ha),c=F(o.meta);return{bulkTransfers:a,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new R("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return Ha(await Ja({accessToken:o,stagingToken:i,bulkTransferId:n}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||G(),u=Wa(e),l=new Map;for(const e of u.bulkTransfers){const t=e.beneficiary;if(t){const e=t.iban;e&&!l.has(e)&&l.set(e,{name:t.name,iban:e})}}const d=Array.from(l.values()),p=await Va({sepaPayees:d,accessToken:a,stagingToken:r});if((yield p.requests.map(Ka))===f)return;const g=await async function({bulkTransfers:e,accessToken:t,stagingToken:n,scaSessionToken:r,bankAccountId:i,idempotencyKey:o}){const s={method:"POST",headers:{..._({accessToken:t,stagingToken:n,scaSessionToken:r,idempotencyKey:o})},body:JSON.stringify({bank_account_id:i,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},a=new URL(`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${za}`),c=await fetch(a,s),u=await c.json();if(!c.ok||u.errors)throw new E({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c});return{bulkTransfer:Ha(g),meta:{idempotencyKey:c}}}}},nc="/v2/transactions";async function rc(e){const t=function({bankAccountId:e,iban:t,status:n,updatedAtFrom:r,updatedAtTo:i,emittedAtFrom:o,emittedAtTo:s,settledAtFrom:a,settledAtTo:c,side:u,operationType:l,withAttachments:d,paginationSettings:f,accessToken:p,stagingToken:g}){const h={method:"GET",headers:{accessToken:p,stagingToken:g}},v=new URLSearchParams;e&&v.append("bank_account_id",e),t&&v.append("iban",t),n&&v.append("status",n),r&&v.append("updated_at_from",r),i&&v.append("updated_at_to",i),o&&v.append("emitted_at_from",o),s&&v.append("emitted_at_to",s),a&&v.append("settled_at_from",a),c&&v.append("settled_at_to",c),u&&v.append("side",u),l&&v.append("operation_type",l),void 0!==d&&v.append("with_attachments",String(d));const m=q(f);for(const[e,t]of m)v.append(e,t);const y=v.toString();return{path:`${nc}${y?`?${y}`:""}`,options:h}}(e),{transactions:n,meta:r}=await I(t);return{transactions:n,meta:r}}async function ic(e){const t=function({transactionId:e,accessToken:t,stagingToken:n}){return{path:`${nc}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}(e),{transaction:n}=await I(t);return n}function oc(e){return{transactionId:e.transaction_id,amount:e.amount,amountCents:e.amount_cents,settledBalance:e.settled_balance,settledBalanceCents:e.settled_balance_cents,attachmentIds:e.attachment_ids,localAmount:e.local_amount,localAmountCents:e.local_amount_cents,side:e.side,operationType:e.operation_type,currency:e.currency,localCurrency:e.local_currency,label:e.label,settledAt:new Date(e.settled_at),emittedAt:new Date(e.emitted_at),updatedAt:new Date(e.updated_at),status:e.status,note:e.note,reference:e.reference,vatAmount:e.vat_amount,vatAmountCents:e.vat_amount_cents,vatRate:e.vat_rate,initiatorId:e.initiator_id,labelIds:e.label_ids,attachmentLost:e.attachment_lost,attachmentRequired:e.attachment_required,cardLastDigits:e.card_last_digits,category:e.category,cashflowCategory:{name:e.cashflow_category?.name||""},cashflowSubcategory:{name:e.cashflow_subcategory?.name||""},id:e.id,subjectType:e.subject_type,...e.transfer?{transfer:{counterpartyAccountNumber:e.transfer.counterparty_account_number,counterpartyName:e.transfer.counterparty_name,counterpartyBic:e.transfer.counterparty_bic,counterpartyIban:e.transfer.counterparty_iban}}:{}}}const sc={getTransactions:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i={...e?.transactionSettings||{},paginationSettings:r},o=t||s(),a=await rc({...i,accessToken:o,stagingToken:n});return{transactions:a.transactions.map(oc),meta:F(a.meta)}},getTransaction:async function({transactionSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r}=t||{},{transactionId:i}=function(e){if(!e)throw new R("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new R("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new R("transactionSettings.transactionId must be a string.");return e}(e),o=n||s();return oc(await ic({transactionId:i,accessToken:o,stagingToken:r}))}};e.authLinks=j,e.beneficiaries=ie,e.cards=ka,e.organizations=Ea,e.paymentLinks=Da,e.sepaTransfers=tc,e.transactions=sc}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}class n{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return n.instance||(n.instance=new n),n.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const r=n.getInstance();class i extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class o extends i{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function s(){if(!r.hasAccessToken())throw new o;return r.getAccessToken()}function a(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}const c={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},u={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},l={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},d=3e4,f="REJECT",p={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},g="https://embed.qonto.com",h="https://embed-js{branch}.staging.qonto.co",v="https://embed.dev.qonto.co",m={[c.PRODUCTION]:{EMBED_BASE_URL:g,EMBED_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[c.STAGING]:{EMBED_BASE_URL:h,EMBED_URL:`${h}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[c.LOCAL]:{EMBED_BASE_URL:v,EMBED_URL:`${v}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class y{constructor(){let e,t;this.environment=c.PRODUCTION,this.branch=u.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(c).includes(e)?e:c.PRODUCTION,this.branch=Object.values(u).includes(t)?t:u.SANDBOX}static getInstance(){return y.instance||(y.instance=new y),y.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===c.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=c.PRODUCTION,this.branch=u.MASTER}getEnvironmentUrls(){if(this.environment===c.PRODUCTION)return m.production;{const e=m[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const b=y.getInstance();class w{constructor(){this.currentLocale="en"}static getInstance(){return w.instance||(w.instance=new w),w.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const T=w.getInstance();class k{constructor(){this.mfaPreference=l.PASSKEY,this.debugMode=!1}static getInstance(){return k.instance||(k.instance=new k),k.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=l.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const E=k.getInstance();class S extends i{constructor({message:e,data:t,code:n}){super(),this.code=500;const r=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${r}`,this.data=t||{},this.code=n||this.code}}function _({accessToken:e,stagingToken:t,idempotencyKey:n,mfaPreference:i,scaSessionToken:o}){const s=new Headers;s.append("Authorization",`Bearer ${e}`);const a=t||r.getStagingToken();a&&s.append("X-Qonto-Staging-Token",a),n&&s.append("X-Qonto-Idempotency-Key",n);const c=i||E.getMFAPreference();return c&&s.append("X-Qonto-2fa-Preference",c),o&&s.append("X-Qonto-SCA-Session-Token",o),s.append("Content-Type","application/json"),s.append("Accept-Language",T.getLocale()),s}async function I({path:e,options:t}){const n=`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,r=await fetch(n,{...t,headers:_(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===r.status)return;const i=await r.json();if(!r.ok)throw i.errors?new S({code:r.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new S({code:r.status,message:`${i.code}: ${i.detail}`,data:i});return i}function P(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},n=JSON.stringify(t);return r=n,a()?Buffer.from(r).toString("base64"):btoa(r);var r}function A(e){return JSON.parse((t=e,a()?Buffer.from(t,"base64").toString("utf-8"):atob(t)));var t}function O({accessToken:e,stagingToken:t,action:n,callbackUrl:r}){const i={post_authn_action:n};return r&&(i.callback_url=r),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}async function x(e){const t=O({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:n}=await I(t);return{url:n.url,post_authn_action:n.post_authn_action,callback_url:n.callback_url,expired_at:n.expired_at,used_at:n.used_at}}function C(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}class R extends i{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function D(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(n.length>0)throw new R(n.map((e=>`Missing required parameter: ${e}`)))}function L(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function N(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function U(e){if(!e||"object"!=typeof e)throw new R("requestSettings must be an object");const t=e,{action:n,callbackUrl:r}=e;D(t,[{name:"action"}]);const i=L(t),o=Object.values(p);if(o.includes(n)||i.push(`action must be one of ${o.join(", ")}`),i.length>0)throw new R(i);if(void 0!==r&&""===r.trim())throw new R("callbackUrl cannot be empty")}async function M({requestSettings:e,operationSettings:t}){U(e);const{accessToken:n,stagingToken:r}=t||{},i=n||s();return C(await x({accessToken:i,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}const j={request:M};function q(e){const t=new URLSearchParams;return e?.page&&t.append("page",e.page.toString()),e?.itemsPerPage&&t.append("per_page",e.itemsPerPage.toString()),t}function F(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}const B=[];for(let e=0;e<256;++e)B.push((e+256).toString(16).slice(1));let $;const H=new Uint8Array(16);var K={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function z(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!$){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$=crypto.getRandomValues.bind(crypto)}return $(H)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(B[e[t+0]]+B[e[t+1]]+B[e[t+2]]+B[e[t+3]]+"-"+B[e[t+4]]+B[e[t+5]]+"-"+B[e[t+6]]+B[e[t+7]]+"-"+B[e[t+8]]+B[e[t+9]]+"-"+B[e[t+10]]+B[e[t+11]]+B[e[t+12]]+B[e[t+13]]+B[e[t+14]]+B[e[t+15]]).toLowerCase()}(r)}function V(e,t,n){return K.randomUUID&&!e?K.randomUUID():z(e)}function G(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function W(e){return{name:e.name,...e.email&&{email:e.email},...e.activityTag&&{activity_tag:e.activityTag},iban:e.iban,...e.bic&&{bic:e.bic}}}const J="/v2/sepa/beneficiaries";async function Y({paginationSettings:e,accessToken:t,stagingToken:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${J}${o}`,options:r}}({paginationSettings:e,accessToken:t,stagingToken:n}),{beneficiaries:i,meta:o}=await I(r);return{beneficiaries:i,meta:o}}function X({beneficiaryId:e,accessToken:t,stagingToken:n}){return{path:`${J}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}async function Q({accessToken:e,stagingToken:t,beneficiaryId:n}){const r=X({beneficiaryId:n,accessToken:e,stagingToken:t}),{beneficiary:i}=await I(r);return i}async function Z({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=V()}){const i=function({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=V()}){return{path:J,options:{method:"POST",headers:{accessToken:t,stagingToken:n,idempotencyKey:r},body:{beneficiary:W(e)}}}}({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r}),{beneficiary:o}=await I(i);return o}async function ee({beneficiaryIds:e,accessToken:t,stagingToken:n}){const r=function({beneficiaryIds:e,accessToken:t,stagingToken:n}){return{path:`${J}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:n},body:{ids:e}}}}({beneficiaryIds:e,accessToken:t,stagingToken:n}),{beneficiaries:i}=await I(r);return i}async function te({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const o=function({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const{name:o,email:s,activityTag:a}=e,c={method:"PATCH",headers:{accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i},body:{beneficiary:{name:o,email:s,activity_tag:a}}};return{path:`${J}/${e.id}`,options:c}}({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}),{beneficiary:s}=await I(o);return s}const ne=[{name:"name"},{name:"iban"}];function re(e){if(!e)throw new R("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("beneficiaryId must be a string");return e}const ie={getBeneficiaries:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Y({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.beneficiaries.map((e=>G(e))),c=F(o.meta);return{beneficiaries:a,...c?{meta:c}:{}}},getBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return G(await Q({beneficiaryId:n,accessToken:o,stagingToken:i}))},addBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new R("beneficiary must be an object");D(e,ne);const t=L({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new R(t);return e}(e),{accessToken:r,stagingToken:i,idempotencyKey:o}=t||{},a=r||s();return G(await Z({beneficiary:n,accessToken:a,stagingToken:i,idempotencyKey:o}))},updateBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){const{id:t,name:n,email:r,activityTag:i}=e||{};if(!t)throw new R("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!n&&!r&&!i)throw new R("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const o=L({name:n,email:r,activityTag:i});if(o.length>0)throw new R(o);return{id:t,name:n,email:r,activityTag:i}}(e),{accessToken:r,stagingToken:i,idempotencyKey:o,mfaPreference:a}=t||{},c={beneficiaryParamsBeingEdited:n,accessToken:r||s(),stagingToken:i,idempotencyKey:o,mfaPreference:a};return G(await te(c))},untrustBeneficiaries:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new R("beneficiaryIds must be an array of strings");return e}(e?.beneficiaryIds),{accessToken:r,stagingToken:i}=t||{},o=r||s();return(await ee({beneficiaryIds:n,accessToken:o,stagingToken:i})).map(G)}},oe="SDK Initialized",se="Cards List";var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)};function ce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ue,le,de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de.apply(this,arguments)};function fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function pe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function ge(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function he(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ve(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function me(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ue||(ue={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(le||(le={}));var ye,be="AMP",we="".concat(be,"_unsent"),Te="$default_instance",ke="https://api2.amplitude.com/2/httpapi",Ee="https://api.eu.amplitude.com/2/httpapi",Se="https://api2.amplitude.com/batch",_e="https://api.eu.amplitude.com/batch",Ie="dclid",Pe="fbclid",Ae="gbraid",Oe="gclid",xe="ko_click_id",Ce="li_fat_id",Re="msclkid",De="rdt_cid",Le="ttclid",Ne="twclid",Ue="wbraid",Me={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},je=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],qe=["authorization","cookie","set-cookie"],Fe=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!Be(t,n))return!1}return!0},Be=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Fe(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return Fe(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},$e=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return de({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(ye.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(ye.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(ye.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(ye.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(ye.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(ye.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(ye.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(ye.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(ye.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[ye.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[ye.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===ye.ADD?"number"==typeof n:e===ye.UNSET||e===ye.REMOVE||Be(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ye||(ye={}));var He,Ke=[ye.CLEAR_ALL,ye.UNSET,ye.SET,ye.SET_ONCE,ye.ADD,ye.APPEND,ye.PREPEND,ye.PREINSERT,ye.POSTINSERT,ye.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(He||(He={}));var ze,Ve=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=He.Unknown),{event:e,code:t,message:n}},Ge=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},We=me([],ve(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),Je=function(e){var t,n=Ge();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Je)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,me([],ve(r.entries()),!1).map((function(e){var t=ve(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(We[r]):We[r]})).join("")},Ye=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return pe(this,void 0,void 0,(function(){return ge(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=Je(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var n;return pe(this,void 0,void 0,(function(){var r,i;return ge(this,(function(o){switch(o.label){case 0:return r=this.plugins.findIndex((function(t){return t.name===e})),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,w;return ge(this,(function(T){switch(T.label){case 0:if(!e)return[2];t=ve(e,1),n=t[0],r=ve(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),o=this.plugins.filter((function(e){return"before"===e.type})),T.label=1;case 1:T.trys.push([1,6,7,8]),s=he(o),a=s.next(),T.label=2;case 2:return a.done?[3,5]:(f=a.value).execute?[4,f.execute(de({},n))]:[3,4];case 3:if(null===(p=T.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),T.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return c=T.sent(),m={error:c},[3,8];case 7:try{a&&!a.done&&(y=s.return)&&y.call(s)}finally{if(m)throw m.error}return[7];case 8:u=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),T.label=9;case 9:T.trys.push([9,14,15,16]),l=he(u),d=l.next(),T.label=10;case 10:return d.done?[3,13]:(f=d.value).execute?[4,f.execute(de({},n))]:[3,12];case 11:if(null===(p=T.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),T.label=12;case 12:return d=l.next(),[3,10];case 13:return[3,16];case 14:return g=T.sent(),b={error:g},[3,16];case 15:try{d&&!d.done&&(w=l.return)&&w.call(l)}finally{if(b)throw b.error}return[7];case 16:return h=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),v=h.map((function(e){var t=de({},n);return e.execute(t).catch((function(e){return Ve(t,0,String(e))}))})),Promise.all(v).then((function(e){var t=ve(e,1)[0]||Ve(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r=this;return ge(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return r.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),t=he(this._optOutListeners),n=t.next(),c.label=1;case 1:if(n.done)return[3,6];r=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,r(e)];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o=c.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}}))}))},e.prototype.onReset=function(){this.plugins.forEach((function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)}))},e}(),Xe=function(e,t){return de(de({},t),{event_type:le.IDENTIFY,user_properties:e.getUserProperties()})},Qe=function(e){return{promise:e||Promise.resolve()}},Ze=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Ye(this),this.name=e}return e.prototype._init=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return ge(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),n=he(t),r=n.next(),u.label=2;case 2:return r.done?[3,7]:(i=r.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return de(de(de({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Qe(this.dispatch(r))},e.prototype.identify=function(e,t){var n=Xe(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Qe(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return de(de({},r),{event_type:le.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return Qe(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new $e;return i.set(e,t),de(de({},n),{event_type:le.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Qe(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return de(de({},t),{event_type:le.REVENUE,event_properties:e.getEventProperties()})}(e,t);return Qe(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),Qe())},e.prototype._addPlugin=function(e){return Qe(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),Qe())},e.prototype._removePlugin=function(e){return Qe(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(Ve(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return pe(this,void 0,void 0,(function(){var t=this;return ge(this,(function(n){return this.isReady?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=de({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach((function(t){Object.values(ue).includes(t)||(i[t]=e[t])})),Ke.forEach((function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case ue.CLEAR_ALL:Object.keys(r).forEach((function(e){delete r[e]}));break;case ue.UNSET:Object.keys(n).forEach((function(e){delete r[e]}));break;case ue.SET:Object.assign(r,n)}}})),Object.assign(r,i),r},e.prototype.process=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,Ve(e,0,"Event skipped due to optOut config")]:(e.event_type===le.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return t=i.sent(),n=String(t),this.config.loggerProvider.error(n),[2,r=Ve(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return Qe(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),et=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));Fe(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?de({},this.properties):{};return e[ze.REVENUE_PRODUCT_ID]=this.productId,e[ze.REVENUE_QUANTITY]=this.quantity,e[ze.REVENUE_PRICE]=this.price,e[ze.REVENUE_TYPE]=this.revenueType,e[ze.REVENUE_CURRENCY]=this.currency,e[ze.REVENUE]=this.revenue,e[ze.RECEIPT]=this.receipt,e[ze.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(ze||(ze={}));var tt;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(tt||(tt={}));var nt="Amplitude Logger ",rt=function(){function e(){this.logLevel=tt.None}return e.prototype.disable=function(){this.logLevel=tt.None},e.prototype.enable=function(e){void 0===e&&(e=tt.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<tt.Verbose||console.log("".concat(nt,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<tt.Warn||console.warn("".concat(nt,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<tt.Error||console.error("".concat(nt,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<tt.Debug||console.log("".concat(nt,"[Debug]: ").concat(e.join(" ")))},e}(),it=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Te,logLevel:tt.Warn,loggerProvider:new rt,offline:!1,optOut:!1,serverUrl:ke,serverZone:"US",useBatch:!1}},ot=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=it();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=at(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),st=function(e,t){return"EU"===e?t?_e:Ee:t?Se:ke},at=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=it().serverZone),void 0===n&&(n=it().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:it().serverZone;return{serverZone:r,serverUrl:st(r,n)}},ct=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ut(e){return e>=200&&e<300}var lt=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},dt=function(e){return function(){var t=de({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ft=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=he(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},pt=function(e,t){return function(){var n,r,i={};try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ft(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},gt=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),c=a.logger,u=a.logLevel;if(u&&u<tt.Debug||!u||!c)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:lt(1),time:{start:(new Date).toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))})):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))),d}},ht=new Set([ke,Ee,Se,_e]);function vt(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var mt=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return pe(this,void 0,void 0,(function(){var n,r=this;return ge(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(we,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map((function(e){return r.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=Je()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),s=t,a=this.config.flushQueueSize,c=Math.max(a,1),r=s.reduce((function(e,t,n){var r=Math.floor(n/c);return e[r]||(e[r]=[]),e[r].push(t),e}),[]),[4,r.reduce((function(t,n){return pe(i,void 0,void 0,(function(){return ge(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,a,c}))}))},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),pe(this,void 0,void 0,(function(){var r,i,o,s,a,c;return ge(this,(function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,fe(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new ct,u.label=1;case 1:return u.trys.push([1,3,,4]),i=at(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,o=function(e,t){return void 0===t&&(t=!1),!!ht.has(e)||t}(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,r,this.config._enableRequestBodyCompressionExperimental&&o)];case 2:return null===(s=u.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(s,e),[3,4]):("body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(vt(s))):this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return a=u.sent(),c=(l=a)instanceof Error?l.message:String(l),this.config.loggerProvider.error(c),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:c,stack_trace:lt()}),this.handleResponse({status:He.Failed,statusCode:0},e),[3,4];case 4:return[2]}var l}))}))},e.prototype.handleResponse=function(e,t){var n;ut(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:vt(e),stack_trace:lt()});var r=e.status;switch(r){case He.Success:this.handleSuccessResponse(e,t);break;case He.Invalid:this.handleInvalidResponse(e,t);break;case He.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case He.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=me(me(me(me([],ve(Object.values(e.body.eventsWithInvalidFields)),!1),ve(Object.values(e.body.eventsWithMissingFields)),!1),ve(Object.values(e.body.eventsWithInvalidIdLengths)),!1),ve(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter((function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(vt(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(vt(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),c=new Set(o),u=t.filter((function(t,r){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return c.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(vt(e));var l=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;ut(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map((function(e){return e.event.event_type})),code:t,message:n,stack_trace:lt()})),this.removeEvents(e),e.forEach((function(e){return e.callback(Ve(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),yt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:bt(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),bt=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},wt=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),Tt=function(){return Tt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tt.apply(this,arguments)};function kt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Et(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var St=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=kt(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),c=Array.isArray(t);if(a!==c)return!1;if(!a||!c){var u=Object.keys(e).sort(),l=Object.keys(t).sort();if(!St(u,l))return!1;var d=!0;return Object.keys(e).forEach((function(n){St(e[n],t[n])||(d=!1)})),d}for(var f=0;f<e.length;f++)if(!St(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var _t=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Tt({},this.identity.userProperties),n=Tt(Tt({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,c=n.userProperties||{};try{for(var u=kt(Object.entries(e)),l=u.next();!l.done;l=u.next()){var d=Et(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var g=(i=void 0,kt(Object.entries(p))),h=g.next();!h.done;h=g.next()){var v=Et(h.value,2),m=v[0],y=v[1];c[m]=y}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,kt(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete c[m=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":c={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return Tt({},this.identity)},e.prototype.setIdentity=function(e){var t=Tt({},this.identity);this.identity=Tt({},e),St(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),It="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Pt=function(){function e(){this.identityStore=new _t,this.eventBridge=new wt,this.applicationContextProvider=new yt}return e.getInstance=function(t){return It.analyticsConnectorInstances||(It.analyticsConnectorInstances={}),It.analyticsConnectorInstances[t]||(It.analyticsConnectorInstances[t]=new e),It.analyticsConnectorInstances[t]},e}(),At=function(e){return void 0===e&&(e=Te),Pt.getInstance(e)},Ot=function(){function e(){this.name="identity",this.type="before",this.identityStore=At().identityStore}return e.prototype.execute=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return e.instanceName&&(this.identityStore=At(e.instanceName).identityStore),[2]}))}))},e}(),xt=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Ct=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},Rt=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},Dt=function(){var e,t=Ge();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Lt(n[0]),i=Lt(n[1]);return i?(e[r]=i,e):e}),{}):{}},Lt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Nt=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Ut=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},Mt=function(e,t){var n=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}(e.toString());return 31*Math.abs(n)%1e5/1e5<t},jt=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),qt=function(){function e(e,t){void 0===t&&(t={}),this.options=de({},e),this.config=t}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return t="AMP_TEST",n=de({},this.options),r=new e(n),i=String(Date.now()),[4,r.transaction(t,(function(e){var n,r;try{e.set(i);var s=e.get()===i;return!s&&o.config.diagnosticsClient&&(null===(n=o.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),s}catch(e){if(o.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null===(r=o.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:a,sync:!0})}return!1}finally{e.set(null)}}))];case 1:return[2,s.sent()]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}}))}))},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=Ft(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(n){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return pe(this,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,d;return ge(this,(function(f){switch(f.label){case 0:r=Ge(),i=r,f.label=1;case 1:return f.trys.push([1,4,,5]),(o=null==i?void 0:i.cookieStore)?[4,o.getAll(e)]:[3,3];case 2:if(s=f.sent()){s.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:s.map((function(e){return e.domain}))}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(a=he(s),c=a.next();!c.done;c=a.next())if(u=c.value,Bt(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{c&&!c.done&&(d=a.return)&&d.call(a)}finally{if(l)throw l.error}}}f.label=3;case 3:return[3,5];case 4:return f.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}}))}))},e.prototype.getRawSync=function(e){var t,n,r=this,i=Ge(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter((function(t){return 0===t.indexOf(e+"=")})),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find((function(t){var n;try{var i=a(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}}))),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return this.setSync(e,t),[2]}))}))},e.prototype.setSync=function(e,t){var n;try{var r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0;if(i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3),o=s}var a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite));var c=Ge();(null==c?void 0:c.document)&&(c.document.cookie=a)}catch(t){var u=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2]}))}))},e.isDomainWritable=function(t){return pe(this,void 0,void 0,(function(){var n,r;return ge(this,(function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",r=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.transaction(n,(function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}}))];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}}))}))},e.prototype.transaction=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:if(n=function(){var e,t=Ge();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),r=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!n)return[2,r()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,r()];case 4:return[2]}}))}))},e.cachedTlds={},e}(),Ft=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Bt=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},$t=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},Ht=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return pe(this,void 0,void 0,(function(){return ge(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return pe(this,void 0,void 0,(function(){return ge(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Kt="tags",zt="counters",Vt="histograms",Gt="events",Wt="internal",Jt="last_flush_timestamp",Yt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=Ge())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]}))}))},e.prototype.openDB=function(){var e=this;return new Promise((function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Kt)||e.createObjectStore(Kt,{keyPath:"key"}),e.objectStoreNames.contains(zt)||e.createObjectStore(zt,{keyPath:"key"}),e.objectStoreNames.contains(Vt)||e.createObjectStore(Vt,{keyPath:"key"}),e.objectStoreNames.contains(Gt))||e.createObjectStore(Gt,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Wt)||e.createObjectStore(Wt,{keyPath:"key"})},e.prototype.setTags=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Kt],"readwrite"),r=n.objectStore(Kt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([zt],"readwrite"),r=n.objectStore(zt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e=s.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Vt],"readwrite"),r=n.objectStore(Vt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e,t=s.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Gt],"readwrite"),r=n.objectStore(Gt),[2,new Promise((function(t){n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach((function(e){r.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i,o;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),r=n.transaction([Wt],"readwrite"),i=r.objectStore(Wt),[2,new Promise((function(n,o){r.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return n()},s.onerror=function(){return o(new Error("Failed to set internal value"))}}))];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([Wt],"readonly"),r=n.objectStore(Wt),[2,new Promise((function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(Jt)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}}))}))},e.prototype.setLastFlushTimestamp=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(Jt,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}}))}))},e.prototype.clearTable=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent(),t=e.transaction([Kt,zt,Vt,Gt],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Kt),this.getAllFromStore(t,zt),this.getAllFromStore(t,Vt),this.getAllFromStore(t,Gt)])];case 2:return n=ve.apply(void 0,[c.sent(),4]),r=n[0],i=n[1],o=n[2],s=n[3],[4,Promise.all([this.clearTable(t,zt),this.clearTable(t,Vt),this.clearTable(t,Gt)])];case 3:return c.sent(),[2,{tags:r,counters:i,histogramStats:o,events:s}];case 4:return a=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}}))}))},e.prototype.getAllFromStore=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}}))},e}(),Xt=function(e){var t,n,r=function(){var e=Ge();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]}();if(0!==r.length)try{for(var i=he(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},Qt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Zt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},en=3e5,tn=1e4,nn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=de({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=Mt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Yt.isSupported()?this.storage=new Yt(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=Ge();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",de({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",(function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Xt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})}),!0),t.addEventListener("unhandledrejection",(function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Qt(i),s=Xt({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Zt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})}),!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=tn?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=tn?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=tn)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout((function(){e.saveAllDataToStorage().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)})).finally((function(){e.saveTimer=null}))}),1e3)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),en))},e.prototype.saveAllDataToStorage=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.storage?(e=de({},this.inMemoryTags),t=de({},this.inMemoryCounters),n=de({},this.inMemoryHistograms),r=me([],ve(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,u;return ge(this,(function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach((function(e){o[e.key]=e.value})),s={},n.forEach((function(e){s[e.key]=e.value})),a={},r.forEach((function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),c=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(s).length&&0===Object.keys(a).length&&0===c.length?[2]:(u={tags:o,histogram:a,counters:s,events:c},this.fetch(u),[2])}}))}))},e.prototype.fetch=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!Ge())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return pe(this,void 0,void 0,(function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(en),[2]):(n=e-t)>=en?(this._flush(),[2]):(this._setFlushTimer(en-n),[2])}}))}))},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout((function(){t._flush().catch((function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)})).finally((function(){t.flushTimer=null}))}),e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Mt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),rn=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,w,T,k;if("object"!=typeof e)return null;var E=e.code||0,S=this.buildStatus(E);switch(S){case He.Success:return{status:S,statusCode:E,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case He.Invalid:return{status:S,statusCode:E,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case He.PayloadTooLarge:return{status:S,statusCode:E,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case He.RateLimit:return{status:S,statusCode:E,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(T=e.exceeded_daily_quota_users)&&void 0!==T?T:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case He.Timeout:default:return{status:S,statusCode:E}}},e.prototype.buildStatus=function(e){return ut(e)?He.Success:429===e?He.RateLimit:413===e?He.PayloadTooLarge:408===e?He.Timeout:e>=400&&e<500?He.Invalid:e>=500?He.Failed:He.Unknown},e}();function on(){return"undefined"!=typeof CompressionStream}function sn(e){return pe(this,void 0,void 0,(function(){var t,n;return ge(this,(function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}}))}))}var an=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),cn=401,un=403,ln=429,dn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new an(e,t)}return e.prototype.subscribe=function(e,t,n){var r=Je(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex((function(t){return t.id===e}));return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return pe(this,void 0,void 0,(function(){var e,t=this;return ge(this,(function(n){switch(n.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(n){t.sendCallback(n,e,"remote")})),[2]}}))}))},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally((function(){e.fetchPromise=null})),this.fetchPromise):(this.fetchPromise=this.fetch().then((function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t})).finally((function(){e.fetchPromise=null})),this.fetchPromise)},e.prototype.subscribeAll=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then((function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)})),n=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return pe(this,void 0,void 0,(function(){var n,r;return ge(this,(function(i){switch(i.label){case 0:n=new Promise((function(e,n){setTimeout((function(){n("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce((function(e,t){return null===e?e:t in e?e[t]:null}),t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),pe(this,void 0,void 0,(function(){var n,r,i,o,s,a,c=this;return ge(this,(function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,u,l,d;return ge(this,(function(f){switch(f.label){case 0:i=!0,s=new AbortController,a=setTimeout((function(){return s.abort()}),t),f.label=1;case 1:return f.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(u=f.sent()).ok?[3,4]:[4,u.text()];case 3:return l=f.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(l)),u.status===cn||u.status===un?(o.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):u.status>=400&&u.status<500&&u.status!==ln&&(i=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:f.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=f.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(a),[7];case 9:return i?r<e-1?[4,new Promise((function(e){return setTimeout(e,c.getJitterDelay(n))}))]:[3,11]:[2,"break"];case 10:f.sent(),f.label=11;case 11:return[2]}}))},o=this,s=0,u.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];if("break"===a)return[3,4];u.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),fn=Ge(),pn=null==fn?void 0:fn.console,gn={},hn={},vn=!1;var mn,yn={addListener:function(e,t){var n,r=(n=e,!!pn&&"function"==typeof pn[n]&&(hn[n]||(hn[n]=pn[n],pn[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(gn[n]&&!vn){vn=!0;var r=gn[n];r&&r.forEach((function(t){try{t(n,e)}catch(e){}}))}}catch(e){}return vn=!1,hn[n].apply(pn,e)}),!0));if(!r)return new Error("Console override failed");gn[e]?gn[e].push(t):gn[e]=[t]},removeListener:function(e){var t,n;try{for(var r=he(Object.values(gn)),i=r.next();!i.done;i=r.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=he(Object.entries(hn)),r=n.next();!r.done;r=n.next()){var i=ve(r.value,2),o=i[0],s=i[1];s&&(pn[o]=s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}hn={},gn={}}};!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(mn||(mn={}));var bn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],wn="data-amp-track-",Tn=["div","span","h1","h2","h3","h4","h5","h6"],kn=me(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],ve(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),En=kn,Sn=kn,_n=["*"];function In(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function Pn(e,t,n){e&&An({json:e,allowlist:t.map(On),excludelist:n.map(On),ancestors:[]})}function An(e){var t,n,r=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,c=e.parentObject,u=e.targetKey;i||(i=r);var l=Object.keys(i);try{for(var d=he(l),f=d.next();!f.done;f=d.next()){var p=f.value,g=me(me([],ve(a),!1),[p],!1);In(i[p])?Cn(g,o)&&!Cn(g,s)||delete i[p]:An({json:r,targetObject:i[p],allowlist:o,excludelist:s,ancestors:g,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&c&&u&&delete c[u]}function On(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function xn(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&"**"===t[r];)r++;return r===t.length}var i=t[r];if("**"===i){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(xn(e,t,o,r+1))return!0;return!1}return("*"===i||i===e[n])&&xn(e,t,n+1,r+1)}function Cn(e,t){return t.some((function(t){return xn(e,t)}))}var Rn=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,i={};if(Array.isArray(r))r.forEach((function(e){var t=ve(e,2),n=t[0],r=t[1];i[n]=r}));else if(r instanceof Headers)r.forEach((function(e,t){i[t]=e}));else if("object"==typeof r&&null!==r)try{for(var o=he(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=ve(s.value,2),c=a[0],u=a[1];i[c]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Fn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=Ge();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=Ln(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,jn(this.body,e,t)]}))}))},e}(),Dn=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Fn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return Ln(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,jn(this.body,e,t)]}))}))},e}();function Ln(e,t){var n,r,i,o=Ge(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var c=e,u=0,l=0;try{for(var d=he(c.entries()),f=d.next();!f.done;f=d.next()){var p=ve(f.value,2),g=p[0],h=p[1];if(u+=g.length,"string"==typeof h)u+=(new s).encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream)return void(a=e);return i}}var Nn,Un=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,(function(e,t){r[t]=e})),Fn(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),500)})),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,jn(n.sent(),e,t)]}}))}))},e}(),Mn=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},i=this.headersString.split("\r\n");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split(": "),2),c=a[0],u=a[1];c&&u&&(r[c]=u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Fn(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){var n;return ge(this,(function(r){return 0===e.length?[2,null]:(n=this.getJson())?(Pn(n,e,t),[2,n]):[2,null]}))}))},e}();function jn(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return Pn(r,t,n),r}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(Nn||(Nn={}));var qn="[REDACTED]",Fn=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?Nn.REMOVE:s,c=me([],ve(qe),!1),u={},l=function(t){var n=t.toLowerCase();c.find((function(e){return e.toLowerCase()===n}))?a===Nn.REDACT&&(u[t]=qn):o.find((function(e){return e.toLowerCase()===n}))?u[t]=e[t]:a===Nn.REDACT&&(u[t]=qn)};try{for(var d=he(Object.keys(e)),f=d.next();!f.done;f=d.next()){l(f.value)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return u},Bn=function(){function e(e,t,n,r,i,o,s,a,c,u,l){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=c,this.error=u,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(me([],ve(je),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers(me([],ve(je),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=ve(e,2);return t[0],void 0!==t[1]})))},e}();var $n=function(e,t){void 0===t&&(t=Je()),this.callback=e,this.id=t};function Hn(e){try{e()}catch(e){}}var Kn=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=Ge();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=Ge();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,c,u,l,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,g=null===(l=null===(u=null===(c=this.globalScope)||void 0===c?void 0:c.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===l?void 0:l.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(n){try{n.callback(e)}catch(e){Hn((function(){var n;null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)}))}}))},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){var a;if(void 0!==o&&void 0!==s){var c,u,l,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?c=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(c=t.url,d=t.method),c)try{var f=new URL(c);c="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(u=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-s),g=Math.floor(o+p),h=new Bn(e,d,o,o,c,n,u,p,r,l,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return pe(t,void 0,void 0,(function(){var t,i,o,s,a=this;return ge(this,(function(c){switch(c.label){case 0:try{t=this.getTimestamps()}catch(e){Hn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)}))}c.label=1;case 1:return c.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=c.sent(),[3,4];case 3:return s=c.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new Rn(r):void 0,i?new Un(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){Hn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)}))}if(i)return[2,i];throw o}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){return n instanceof Error&&"InvalidStateError"===n.name&&Hn((function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=ve(n,2),s=i[0],a=i[1];try{this.$$AmplitudeAnalyticsEvent=de({method:s,url:null===(e=null==a?void 0:a.toString)||void 0===e?void 0:e.call(a),headers:{}},o.getTimestamps())}catch(e){Hn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)}))}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],c=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",(function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new Mn(i.status,e,t?parseInt(t,10):void 0,s),r=i.$$AmplitudeAnalyticsEvent.headers,u=new Dn(a,r);c.status=i.status,o.handleNetworkRequestEvent("xhr",{url:c.url,method:c.method},u,n,void 0,c.startTime,c.durationStart)}catch(e){Hn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)}))}})),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){Hn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)}))}r.apply(this,[e,t])}}},e}(),zn=new Kn,Vn=function(){function e(){}return e.prototype.parse=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,de(de(de(de({},Me),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Dt();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=Dt();return(e={})[Ie]=t[Ie],e[Pe]=t[Pe],e[Ae]=t[Ae],e[Oe]=t[Oe],e[xe]=t[xe],e[Ce]=t[Ce],e[Re]=t[Re],e[De]=t[De],e[Le]=t[Le],e[Ne]=t[Ne],e[Ue]=t[Ue],e},e}(),Gn="data-amp-mask",Wn="*****",Jn=/\b(?:\d[ -]*?){13,16}\b/,Yn=/(\d{3}-?\d{2}-?\d{4})/g,Xn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Qn=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Jn,Wn)).replace(Yn,Wn)).replace(Xn,Wn);try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Wn)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},Zn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Gn)?Wn:e?e(document.title):document.title};function er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tr,nr,rr,ir={};function or(){if(tr)return ir;tr=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.Observable=void 0;const e=e=>Boolean(Symbol[e]),t=t=>e(t)?Symbol[t]:"@@"+t,n=t("iterator"),r=t("observable"),i=t("species");function o(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function s(e){let t=e.constructor;return void 0!==t&&(t=t[i],null===t&&(t=void 0)),void 0!==t?t:g}function a(e){a.log?a.log(e):setTimeout((()=>{throw e}))}function c(e){Promise.resolve().then((()=>{try{e()}catch(e){a(e)}}))}function u(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=o(t,"unsubscribe");e&&e.call(t)}}catch(e){a(e)}}function l(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function d(e,t,n){e._state="running";let r=e._observer;try{let i=o(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(l(e),!i)throw n;i.call(r,n);break;case"complete":l(e),i&&i.call(r)}}catch(e){a(e)}"closed"===e._state?u(e):"running"===e._state&&(e._state="ready")}function f(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void c((()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(d(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)))):void d(e,t,n);e._queue.push({type:t,value:n})}}class p{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){f(n,"next",e)},error(e){f(n,"error",e)},complete(){f(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(l(this),u(this))}}class g{constructor(e){if(!(this instanceof g))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new p(e,this._subscriber)}forEach(e){return new Promise(((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})}))}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(s(this))((t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(s(this))((t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=s(this),n=arguments.length>1,r=!1,i=arguments[1];return new t((t=>this.subscribe({next(o){let s=!r;if(r=!0,!s||n)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}})))}async all(){let e=[];return await this.forEach((t=>e.push(t))),e}concat(...e){let t=s(this);return new t((n=>{let r,i=0;return function o(s){r=s.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}}))}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=s(this);return new t((n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return n.error(e)}let s=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(s);e>=0&&r.splice(e,1),o()}});r.push(s)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[r](){return this}static from(t){let i="function"==typeof this?this:g;if(null==t)throw new TypeError(t+" is not an object");let s=o(t,r);if(s){let e=s.call(t);if(Object(e)!==e)throw new TypeError(e+" is not an object");return function(e){return e instanceof g}(e)&&e.constructor===i?e:new i((t=>e.subscribe(t)))}if(e("iterator")&&(s=o(t,n),s))return new i((e=>{c((()=>{if(!e.closed){for(let n of s.call(t))if(e.next(n),e.closed)return;e.complete()}}))}));if(Array.isArray(t))return new i((e=>{c((()=>{if(!e.closed){for(let n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}static of(...e){return new("function"==typeof this?this:g)((t=>{c((()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}}))}))}static get[i](){return this}}return ir.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:r,hostReportError:a},configurable:!0}),ir}var sr=er(rr?nr:(rr=1,nr=or().Observable));function ar(e,t){return new sr((function(n){e.subscribe({next:function(e){t(e).then((function(e){return n.next(e)})).catch((function(e){return n.error(e)}))},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}function cr(e,t){return new sr((function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=he(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o}))}function ur(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new sr((function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){var n,i,o;try{for(var s=he(t),a=s.next();!a.done;a=s.next()){var c=a.value;null===(o=c.error)||void 0===o||o.call(c,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}}))}var lr,dr={exports:{}};var fr,pr=function(){if(lr)return dr.exports;lr=1;var e=Object.prototype.hasOwnProperty;function t(e){return"[Throws: "+(e?e.message:"?")+"]"}function n(n){var r=[];return function n(i){if(null===i||"object"!=typeof i)return i;if(-1!==r.indexOf(i))return"[Circular]";if(r.push(i),"function"==typeof i.toJSON)try{var o=n(i.toJSON());return r.pop(),o}catch(e){return t(e)}if(Array.isArray(i)){var s=i.map(n);return r.pop(),s}var a=Object.keys(i).reduce((function(r,o){return r[o]=n(function(n,r){if(e.call(n,r))try{return n[r]}catch(e){return t(e)}return n[r]}(i,o)),r}),{});return r.pop(),a}(n)}return dr.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},dr.exports.ensureProperties=n,dr.exports}(),gr=er(pr),hr=gr||t({__proto__:null,default:gr},[pr]),vr="https://app.amplitude.com",mr={US:vr,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var yr="__AMPLITUDE_MESSENGER_INSTANCE__",br="__AMPLITUDE_MESSENGER__",wr=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?vr:t;this[fr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise((function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){n({status:!1,message:"Failed to load the script ".concat(e)})})),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}}))}(e).then((function(){})),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}}))}))},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===vr&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,s;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var a=e.data,c=null==a?void 0:a.action;if(c)if("id"in a&&a.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a);else{if("ping"===c)return void r.notify({action:"pong"});var u=r.actionHandlers.get(c);if(u)u(a.data);else{var l=null!==(s=r.pendingMessages.get(c))&&void 0!==s?s:[];l.push(a.data),r.pendingMessages.set(c,l)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=Ge();(null==e?void 0:e[br])===this&&delete e[br]},e}();function Tr(e){var t,n=Ge(),r=null==n?void 0:n[br];if("object"==typeof(t=r)&&null!==t&&yr in t&&!0===t[yr])return r;var i=new wr(e);return n&&(n[br]=i),i}fr=yr;var kr="__AMPLITUDE_BACKGROUND_CAPTURE__";var Er={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},Sr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},_r=function(e){return Sr(e,"attribution")},Ir=function(e){return Sr(e,"formInteractions")},Pr=function(e){return Sr(e,"pageViews")},Ar=function(e){return Sr(e,"sessions")},Or=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},xr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},Cr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},Rr=function(e){if(xr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Dr=function(e){if(Cr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},Lr=function(e){var t;if(Or(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),de(de({},n),{captureRules:null===(t=null==n?void 0:n.captureRules)||void 0===t?void 0:t.map((function(t){var n,r,i;if((null===(n=t.urls)||void 0===n?void 0:n.length)&&(null===(r=t.hosts)||void 0===r?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),de(de({},t),{hosts:void 0})}return t}))})}},Nr=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return Pr(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},Ur=function(e){return _r(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?de({},e.defaultTracking.attribution):{}},Mr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var c=a.apply(e,o);"function"==typeof s&&s(null==c?void 0:c.promise)}}return e},jr=function(e){return e&&void 0!==e._q},qr="2.37.2",Fr="amplitude-ts",Br=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Fr,"/").concat(qr),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return pe(this,void 0,void 0,(function(){var r,i,o;return ge(this,(function(s){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,de(de(de(de(de(de(de(de({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:Rt()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:Je(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]}))}))},e}(),$r=1e3,Hr=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=Ge())||void 0===n?void 0:n.localStorage}catch(e){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return ce(t,e),t.prototype.set=function(t,n){var r;return pe(this,void 0,void 0,(function(){var i;return ge(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>$r?(i=n.length-$r,[4,e.prototype.set.call(this,t,n.slice(0,$r))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat($r,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(Ht),Kr=function(e){function t(){var t;return e.call(this,null===(t=Ge())||void 0===t?void 0:t.sessionStorage)||this}return ce(t,e),t}(Ht),zr=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),pe(this,void 0,void 0,(function(){var r=this;return ge(this,(function(i){return[2,new Promise((function(i,o){"undefined"==typeof XMLHttpRequest&&o(new Error("XHRTransport is not supported."));var s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===r.state.done){var e=s.responseText;try{i(r.buildResponse(JSON.parse(e)))}catch(e){i(r.buildResponse({code:s.status}))}}};var a={"Content-Type":"application/json",Accept:"*/*"},c=JSON.stringify(t),u=n&&c.length>=2048&&on(),l=function(e){var t,n;a=de(de({},r.customHeaders),a);try{for(var i=he(Object.entries(a)),o=i.next();!o.done;o=i.next()){var c=ve(o.value,2),u=c[0],l=c[1];s.setRequestHeader(u,l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}s.send(e)};pe(r,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return u?[4,sn(c)]:[3,2];case 1:return(e=t.sent())?(a["Content-Encoding"]="gzip",l(e)):l(c),[3,3];case 2:l(c),t.label=3;case 3:return[2]}}))})).catch(o)}))]}))}))},t}(rn),Vr=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),pe(this,void 0,void 0,(function(){var r,i,o,s,a,c,u;return ge(this,(function(l){switch(l.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r=JSON.stringify(t),i=n&&r.length>=2048&&on(),o=r,s={"Content-Type":"application/json",Accept:"*/*"},i?[4,sn(r)]:[3,2];case 1:(a=l.sent())&&(s["Content-Encoding"]="gzip",o=a),l.label=2;case 2:return s=de(de({},this.customHeaders),s),[4,fetch(e,{headers:s,body:o,method:"POST"})];case 3:return[4,(c=l.sent()).text()];case 4:u=l.sent();try{return[2,this.buildResponse(JSON.parse(u))]}catch(e){return[2,this.buildResponse({code:c.status})]}return[2]}}))}))},t}(rn),Gr=function(e){function t(){return e.call(this)||this}return ce(t,e),t.prototype.send=function(e,t,n){return pe(this,void 0,void 0,(function(){var n=this;return ge(this,(function(r){return[2,new Promise((function(r,i){var o=Ge();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return r(o.navigator.sendBeacon(e,s)?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(rn),Wr=function(e,t,n){return void 0===n&&(n=!0),pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,d;return ge(this,(function(f){switch(f.label){case 0:return r=function(e){return"".concat(be.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=f.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return o=ve(i.split("."),6),s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],d=o[5],[2,{deviceId:s,userId:Yr(a),sessionId:Jr(u),lastEventId:Jr(d),lastEventTime:Jr(l),optOut:Boolean(c)}]}}))}))},Jr=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Yr=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Xr="[Amplitude]",Qr="".concat(Xr," Form Started"),Zr="".concat(Xr," Form Submitted"),ei="".concat(Xr," File Downloaded"),ti="session_start",ni="session_end",ri="".concat(Xr," File Extension"),ii="".concat(Xr," File Name"),oi="".concat(Xr," Link ID"),si="".concat(Xr," Link Text"),ai="".concat(Xr," Link URL"),ci="".concat(Xr," Form ID"),ui="".concat(Xr," Form Name"),li="".concat(Xr," Form Destination"),di="cookie",fi=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:Tn,DEFAULT_CSS_SELECTOR_ALLOWLIST:bn,DEFAULT_DATA_ATTRIBUTE_PREFIX:wn,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:Er,get IdentifyOperation(){return ue},get LogLevel(){return tt},OfflineDisabled:null,get RevenueProperty(){return ze},get ServerZone(){return mn},get SpecialEventType(){return le}}),pi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},gi=function(e,t,n,r,i,o){void 0===i&&(i=!0),e.referrer;var s=e.referring_domain,a=fe(e,["referrer","referring_domain"]),c=t||{};c.referrer;var u,l=c.referring_domain,d=fe(c,["referrer","referring_domain"]),f=n.excludeInternalReferrers;if(f){var p=vi(f,r);if(!(p instanceof TypeError)&&e.referring_domain&&wi(e.referring_domain,o)){if("always"===p)return mi(p,e.referring_domain,r),!1;if("ifEmptyCampaign"===p&&(u=de(de({},e),{referring_domain:void 0,referrer:void 0}),Object.values(u).every((function(e){return!e}))))return mi(p,e.referring_domain,r),!1}}if(hi(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var g=JSON.stringify(a)!==JSON.stringify(d),h=pi(s||"")!==pi(l||""),v=!t||g||h;return v?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),v},hi=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},vi=function(e,t){if(!0===e)return Er.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(Er).includes(n))return n;if(void 0===n)return Er.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function mi(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?n.debug(r):"ifEmptyCampaign"===e&&n.debug("".concat(r," with empty campaign parameters"))}var yi=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],bi=function(e){var t,n,r=e||(null===(n=null===(t=Ge())||void 0===t?void 0:t.location)||void 0===n?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],s=i[i.length-2];return yi.find((function(e){return r.endsWith(".".concat(e))}))&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s?"".concat(s,".").concat(o):o},wi=function(e,t){var n=Ge();if(!n)return!1;var r,i,o,s=(t||"").trim()||bi(n.location.hostname);return r=e,o=(i=s).startsWith(".")?i:".".concat(i),!!(r.startsWith(".")?r:".".concat(r)).endsWith(o)},Ti=function(e){function t(t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,w,T,k,E,S,_,I,P,A,O,x,C,R,D,L,N,U,M,j,q,F,B,$,H,K,z){void 0===r&&(r=new jt),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===c&&(c=1e3),void 0===u&&(u=5),void 0===l&&(l=30),void 0===d&&(d=di),void 0===v&&(v=new rt),void 0===m&&(m=tt.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===E&&(E=""),void 0===S&&(S="US"),void 0===P&&(P=18e5),void 0===A&&(A=new Hr({loggerProvider:v})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===x&&(x="fetch"),void 0===C&&(C=!1),void 0===R&&(R=!0),void 0===j&&(j=!0),void 0===q&&(q=0),void 0===H&&(H=!1),void 0===K&&(K=!1);var V,G=this;(G=e.call(this,{apiKey:t,storageProvider:A,transportProvider:Si(x)})||this).apiKey=t,G.appVersion=n,G.cookieOptions=i,G.defaultTracking=o,G.autocapture=s,G.flushIntervalMillis=c,G.flushMaxRetries=u,G.flushQueueSize=l,G.identityStorage=d,G.ingestionMetadata=f,G.instanceName=p,G.loggerProvider=v,G.logLevel=m,G.minIdLength=y,G.offline=b,G.partnerId=T,G.plan=k,G.serverUrl=E,G.serverZone=S,G.sessionTimeout=P,G.storageProvider=A,G.trackingOptions=O,G.transport=x,G.useBatch=C,G.fetchRemoteConfig=R,G.networkTrackingOptions=U,G.identify=M,G.enableDiagnostics=j,G.diagnosticsSampleRate=q,G.diagnosticsClient=F,G.remoteConfig=B,G.topLevelDomain=$,G.enableRequestBodyCompression=H,G._enableRequestBodyCompressionExperimental=K,G.customEnrichment=z,G.version=qr,G._optOut=!1,G._cookieStorage=r,G.deviceId=a,G.lastEventId=g,G.lastEventTime=h,G.optOut=w,G.deferredSessionId=I,G.sessionId=_,G.pageCounter=L,G.userId=D,G.debugLogsEnabled=N,G.loggerProvider.enable(N?tt.Debug:G.logLevel),G.networkTrackingOptions=U,G.identify=M,G.enableDiagnostics=j,G.diagnosticsSampleRate=q,G.diagnosticsClient=F;var W=null!==(V=null==B?void 0:B.fetchRemoteConfig)&&void 0!==V?V:R;return G.remoteConfig=G.remoteConfig||{},G.remoteConfig.fetchRemoteConfig=W,G.fetchRemoteConfig=W,G.topLevelDomain=$||bi(),G}return ce(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof qt&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Ct(this.apiKey),e)},t}(ot),ki=function(e,t,n,r,i){return void 0===t&&(t={}),pe(void 0,void 0,void 0,(function(){var o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,w,T,k,E,S,_,I,P,A,O,x,C,R,D,L,N,U,M,j,q,F,B,$,H,K,z,V,G,W,J,Y,X,Q,Z,ee,te;return ge(this,(function(ne){switch(ne.label){case 0:return o=t.identityStorage||di,s="",o!==di||(null===(I=t.cookieOptions)||void 0===I?void 0:I.domain)||""===(null===(P=t.cookieOptions)||void 0===P?void 0:P.domain)?[3,2]:[4,_i(void 0,r)];case 1:s=ne.sent(),ne.label=2;case 2:return a=de({domain:null!==(O=null===(A=t.cookieOptions)||void 0===A?void 0:A.domain)&&void 0!==O?O:s,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),c={duplicateResolverFn:function(e){var t=Ft(e);if(!t)return!1;var n=JSON.parse(t);return Bt(n.cookieDomain,a.domain)},diagnosticsClient:r},u=Ei(t.identityStorage,a,c),[4,Wr(e,u,null===(C=null===(x=t.cookieOptions)||void 0===x?void 0:x.upgrade)||void 0===C||C)];case 3:return l=ne.sent(),[4,u.get(Ct(e))];case 4:return d=ne.sent(),f=Dt(),p=f.ampTimestamp?Number(f.ampTimestamp):void 0,g=!p||Date.now()<p,h=null!==(U=null!==(N=null!==(L=null!==(R=t.deviceId)&&void 0!==R?R:g?null!==(D=f.ampDeviceId)&&void 0!==D?D:f.deviceId:void 0)&&void 0!==L?L:null==d?void 0:d.deviceId)&&void 0!==N?N:l.deviceId)&&void 0!==U?U:Je(),v=null!==(M=null==d?void 0:d.lastEventId)&&void 0!==M?M:l.lastEventId,m=null!==(j=null==d?void 0:d.lastEventTime)&&void 0!==j?j:l.lastEventTime,y=null!==(F=null!==(q=t.optOut)&&void 0!==q?q:null==d?void 0:d.optOut)&&void 0!==F?F:l.optOut,b=null!==(B=null==d?void 0:d.sessionId)&&void 0!==B?B:l.sessionId,w=null==d?void 0:d.deferredSessionId,T=null!==(H=null!==($=t.userId)&&void 0!==$?$:null==d?void 0:d.userId)&&void 0!==H?H:l.userId,n.previousSessionDeviceId=null!==(K=null==d?void 0:d.deviceId)&&void 0!==K?K:l.deviceId,n.previousSessionUserId=null!==(z=null==d?void 0:d.userId)&&void 0!==z?z:l.userId,k={ipAddress:null===(G=null===(V=t.trackingOptions)||void 0===V?void 0:V.ipAddress)||void 0===G||G,language:null===(J=null===(W=t.trackingOptions)||void 0===W?void 0:W.language)||void 0===J||J,platform:null===(X=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.platform)||void 0===X||X},E=null==d?void 0:d.pageCounter,S=null==d?void 0:d.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(_=new Ti(e,t.appVersion,u,a,t.defaultTracking,t.autocapture,h,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,v,m,null!==(Q=null==i?void 0:i.loggerProvider)&&void 0!==Q?Q:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,null!==(Z=null==i?void 0:i.serverZone)&&void 0!==Z?Z:t.serverZone,b,w,t.sessionTimeout,t.storageProvider,k,t.transport,t.useBatch,t.fetchRemoteConfig,T,E,S,t.networkTrackingOptions,t.identify,null!==(ee=null==i?void 0:i.enableDiagnostics)&&void 0!==ee?ee:t.enableDiagnostics,null!==(te=null==i?void 0:i.diagnosticsSampleRate)&&void 0!==te?te:n._diagnosticsSampleRate,r,t.remoteConfig,s,t.enableRequestBodyCompression,n._enableRequestBodyCompressionExperimentalValue,t.customEnrichment)).storageProvider.isEnabled()];case 5:return ne.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new jt),[2,_]}}))}))},Ei=function(e,t,n){switch(void 0===e&&(e=di),void 0===t&&(t={}),e){case"localStorage":return new Hr;case"sessionStorage":return new Kr;case"none":return new jt;default:return new qt(de(de({},t),{expirationDays:t.expiration}),n)}},Si=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0;return"xhr"===t?new zr(n):"beacon"===t?new Gr:new Vr(n)},_i=function(e,t){return pe(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return[4,new qt(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!c.sent()||"undefined"==typeof location||!location.hostname)return[2,""];if(e=location.hostname,1===(n=e.split(".")).length)return[2,""];for(r=[],i=1,yi.find((function(t){return e.endsWith(".".concat(t))}))&&(i=2),o=n.length-i-1;o>=0;--o)r.push(n.slice(o).join("."));o=0,c.label=2;case 2:if(!(o<r.length))return[3,7];s=r[o],c.label=3;case 3:return c.trys.push([3,5,,6]),[4,qt.isDomainWritable(s)];case 4:return c.sent()?[2,"."+s]:[3,6];case 5:return a=c.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(s),error:a instanceof Error?a.message:String(a)}),[3,6];case 6:return o++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}}))}))},Ii=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Pi="AMP_PAGE_VIEW",Ai=function(e){var t;void 0===e&&(e={});var n,r,i=Ge(),o=void 0,s=!1,a=e.trackOn,c=e.trackHistoryChanges,u=e.eventType,l=void 0===u?"[Amplitude] Page Viewed":u,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},f=function(e){return pe(void 0,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:return t=d("undefined"!=typeof location&&location.href||""),r={event_type:l},n=[{}],[4,Oi()];case 1:return[2,(r.event_properties=de.apply(void 0,[de.apply(void 0,n.concat([i.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&d(location.pathname)||"","[Amplitude] Page Title":Zn(Qn),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),r)]}}))}))},p=function(){return void 0===a||"function"==typeof a&&a()},g="undefined"!=typeof location?location.href:null,h=function(){pe(void 0,void 0,void 0,(function(){var e,n,i,s,a;return ge(this,(function(u){switch(u.label){case 0:return e=location.href,n=Ci(c,e,g||"")&&p(),g=e,n?(i=void 0,r&&(i=Je(),r.set(Pi,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return a=(s=t).track,[4,f(i)];case 2:a.apply(s,[u.sent()]),u.label=3;case 3:u.label=4;case 4:return[2]}}))}))},v={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,a){return pe(void 0,void 0,void 0,(function(){var c,u,l;return ge(this,(function(d){switch(d.label){case 0:if(t=a,n=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,i){try{r=new Ht(i.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",h),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),s&&h()}})}return p()?(o.log("Tracking page view event"),c=void 0,r&&(c=Je(),r.set(Pi,{pageViewId:c})),l=(u=t).track,[4,f(c)]):[3,2];case 1:l.apply(u,[d.sent()]),d.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t,i,s;return ge(this,(function(c){switch(c.label){case 0:return"attribution"===a&&xi(e)?(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,r?[4,r.get(Pi)]:[3,2]):[3,4];case 1:i=c.sent(),t=null==i?void 0:i.pageViewId,c.label=2;case 2:return[4,f(t)];case 3:s=c.sent(),e.event_type=s.event_type,e.event_properties=de(de({},e.event_properties),s.event_properties),c.label=4;case 4:return n&&e.event_type===l&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=de(de({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return i&&(i.removeEventListener("popstate",h),s=!1),[2]}))}))}};return v},Oi=function(){return pe(void 0,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return e=Ii,[4,(new Vn).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},xi=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[ue.SET]||{},r=t[ue.UNSET]||{},i=me(me([],ve(Object.keys(n)),!1),ve(Object.keys(r)),!1);return Object.keys(Me).every((function(e){return i.includes(e)}))}return!1},Ci=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},Ri=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return t=function(e){if(Ir(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(n),o=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",(function(){var t,n=Li(e);s||i.track(Qr,((t={})[ci]=Di(e.id),t[ui]=Di(e.name),t[li]=n,t)),s=!0})),r(e,"submit",(function(r){var o,a,c=Li(e);if(s||i.track(Qr,((o={})[ci]=Di(e.id),o[ui]=Di(e.name),o[li]=c,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(Zr,((a={})[ci]=Di(e.id),a[ui]=Di(e.name),a[li]=c,a)),s=!1}))}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=Ge())?s.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return null==e||e.disconnect(),n.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),n=[],[2]}))}))}}},Di=function(e){if("string"==typeof e)return e},Li=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},Ni=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return pe(void 0,void 0,void 0,(function(){var i,o;return ge(this,(function(s){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(n.href),s=null==i?void 0:i[1];s&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;s&&r.track(ei,((t={})[ri]=s,t[ii]=n.pathname,t[oi]=e.id,t[si]=e.text,t[ai]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=Ge())?o.addEventListener("load",i):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},Ui=!1,Mi=function(){var e=Ge(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),n("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)})),t=[],[2]}))}))}}};function ji(e){var t,n,r,i,o,s,a,c,u,l,d;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var f=Object.keys(e);try{for(var p=he(f),g=p.next();!g.done;g=p.next()){var h=g.value;try{var v=e[h];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(e[h]=!0)):e[h]=!1),ji(v)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{if(null===(u=null===(c=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===u?void 0:u.length)try{for(var m=he(e.autocapture.networkTracking.captureRules),y=m.next();!y.done;y=m.next()){var b=y.value;try{for(var w=(o=void 0,he(["responseHeaders","requestHeaders"])),T=w.next();!T.done;T=w.next()){var k=T.value,E=null!==(l=b[k])&&void 0!==l?l:{},S=E.captureSafeHeaders,_=E.allowlist;(S||_)&&(void 0===_||Array.isArray(_)?b[k]=me(me([],ve(S?je:[]),!1),ve(null!=_?_:[]),!1):delete b[k])}}catch(e){o={error:e}}finally{try{T&&!T.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}catch(e){}var I=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick))}}function qi(e,t,n){var r,i,o=[];try{for(var s=he(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var c=a.value;try{o.push(new RegExp(c))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(c),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}function Fi(e,t){var n,r,i,o,s,a,c;if(e){ji(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if("boolean"==typeof u.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture&&null!==u.autocapture){var l=de({},u.autocapture);if(void 0===t.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture.elementInteractions&&null!==u.autocapture.elementInteractions&&(null===(i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){l.elementInteractions=de({},u.autocapture.elementInteractions);var d=l.elementInteractions,f=null!==(o=d.pageUrlAllowlist)&&void 0!==o?o:[],p=u.autocapture.elementInteractions.pageUrlAllowlistRegex;d.pageUrlAllowlist=qi(f,p,t),delete d.pageUrlAllowlistRegex}if("object"==typeof u.autocapture.networkTracking&&null!==u.autocapture.networkTracking&&(null===(s=u.autocapture.networkTracking.captureRules)||void 0===s?void 0:s.length)){l.networkTracking=de({},u.autocapture.networkTracking);var g=null!==(a=l.networkTracking.captureRules)&&void 0!==a?a:[];try{for(var h=he(g),v=h.next();!v.done;v=h.next()){var m=v.value;m.urls=qi(null!==(c=m.urls)&&void 0!==c?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=de({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=de(de({},t.autocapture),l))}t.defaultTracking=t.autocapture}"customEnrichment"in u&&null!==u.customEnrichment&&(t.customEnrichment=u.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var Bi,$i="1.24.2",Hi="[Amplitude] Element Clicked",Ki="[Amplitude] Element Tag",zi="[Amplitude] Element Text",Vi="[Amplitude] Page URL",Gi="[Amplitude] Viewport Height",Wi="[Amplitude] Viewport Width",Ji="[Amplitude] Page View ID",Yi="data-amp-mask-attributes",Xi=["input","select","textarea"],Qi=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t},Zi=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&Nt(window.location.href,n))&&!!Nt(window.location.href,t)},eo=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(a)return a(r,i);if(!Zi(e))return!1;var u=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var l=Qi(i,r);if(n&&l)return!0;if(t){var d=t.some((function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}));if(!d)return!1}switch(c){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!l||"click"===r}}},to=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},no=function(){var e;try{var t=Ge(),n=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(e){}},ro=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:ro(null==e?void 0:e.parentElement,t):null},io=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Bi||(Bi={}));var oo="__AMPLITUDE_VISUAL_TAGGING__";var so=Ge(),ao=function(){return new sr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}}))},co=function(e){return void 0===e&&(e="click"),new sr((function(t){var n,r=function(e){t.next(e)};return null===(n=Ge())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=Ge())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}}))},uo=function(){var e=cr(new sr((function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=de(de({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return so.addEventListener("error",t),function(){so.removeEventListener("error",t)}})),new sr((function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return so.addEventListener("unhandledrejection",t),function(){so.removeEventListener("unhandledrejection",t)}})));return cr(e,new sr((function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return yn.addListener("error",t),function(){yn.removeListener(t)}})))},lo=function(e,t,n){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))},fo={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},po=function(e){var t,n,r,i,o=Object.values(fo).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{try{for(var u=(r=void 0,he(c.definition)),l=u.next();!l.done;l=u.next()){var d=l.value,f=fo[d.event_type];f&&o[f].add(c.id)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},go=function(e){var t,n,r,i,o=new Map;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{for(var u=(r=void 0,he(c.conditions)),l=u.next();!l.done;l=u.next()){var d=l.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},ho=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return fo[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},vo=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=function(e,t){var n,r,i,o,s=new Set;try{for(var a=he(e),c=a.next();!c.done;c=a.next()){var u=c.value,l=t.get(u.id);if(l)try{for(var d=(i=void 0,he(l)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)}(ho(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return r.labeledEvents[e]}))),this.labeledEventToTriggerMap);try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=s.value;lo(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),mo=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Yi,Gn]),yo=["type"],bo=["svg","path","g"],wo=["password","hidden"];function To(e,t){var n,r,i,o,s,a;if(null===e)return null;var c=String(e.tagName).toLowerCase(),u={tag:c},l=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var g={},h=Array.from(e.attributes).filter((function(e){return!mo.has(e.name)})),v=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Xi.includes(i)&&!o}(e);if(!wo.includes(String(e.getAttribute("type")))&&!bo.includes(c))try{for(var m=he(h),y=m.next();!y.done;y=m.next()){var b=y.value;v&&!yo.includes(b.name)||(t.has(b.name)?g[b.name]=Wn:g[b.name]=String(b.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(g).length&&(u.attrs=g),u}var ko,Eo=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),So=function(e,t,n){var r,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new Eo(l(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new Eo(s,!0)}var a=e.tagName.toLowerCase();if(o)return new Eo(a+l(o),!0);var c=e.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new Eo(a,!0);function u(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map((function(e){return"$"+e})):[]}function l(e){return"#"+CSS.escape(e)}for(var d=u(e),f=!1,p=!1,g=-1,h=-1,v=c.children,m=0;v&&(-1===g||!p)&&m<v.length;++m){var y=v[m];if(y.nodeType===Node.ELEMENT_NODE)if(h+=1,y!==e){if(!p&&y.tagName.toLowerCase()===a){f=!0;var b=new Set(d);if(b.size)for(var w=u(y),T=0;T<w.length;++T){var k=w[T];if(b.has(k)&&(b.delete(k),!b.size)){p=!0;break}}else p=!0}}else g=h}var E=a;if(n&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(E+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),p)E+=":nth-child("+String(g+1)+")";else if(f)try{for(var S=he(d),_=S.next();!_.done;_=S.next()){var I=_.value;E+="."+CSS.escape(I.slice(1))}}catch(e){r={error:e}}finally{try{_&&!_.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}return new Eo(E,!1)},_o=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return Qn(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s,a=performance.now();if(!e)return[];for(var c,u=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=u.length-1;d>=0;d--){var f=u[d];if(f){var p=(c=f.getAttribute(Yi))?c.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],g=d===u.length-1?[]:null!==(r=l.get(u[d+1]))&&void 0!==r?r:new Set,h=new Set(me(me([],ve(g),!1),ve(p),!1));l.set(f,h)}}s=u.map((function(e){var t;return To(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)}));var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var n=ve(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))}))};try{for(var m=he(s),y=m.next();!y.done;y=m.next())v(y.value)}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getElementPath=function(e){var t;if(!e)return"";var n=performance.now(),r=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=So(r,Boolean(t),r===e);if(!i)break;if(n.push(i),i.optimized)break;r=r.parentElement}return n.reverse(),n.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.getEventProperties=function(e,t,n){var r,i,s,a,c,u,l=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),p=null===(a=f[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),h=(c=null!=p?p:{},u=n,Object.entries(c).reduce((function(e,t){var n=ve(t,2),r=n[0],i=n[1];if(r.startsWith(u)){var o=r.replace(u,"");o&&(e[o]=i||"")}return e}),{})),v=((r={})["[Amplitude] Element Hierarchy"]=f,r[Ki]=l,r[zi]=o.getText(t),r["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),r["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),r["[Amplitude] Element Attributes"]=h,r["[Amplitude] Element Path"]=o.getElementPath(t),r["[Amplitude] Element Parent Label"]=g,r[Vi]=Ut(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=Zn(o.replaceSensitiveString),r[Gi]=window.innerHeight,r[Wi]=window.innerWidth,r),m=no();if(m&&(v[Ji]=m),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var y=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(y)}return to(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&Qi(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=ro(s.event.target,n);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?o.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(Gn,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.nodeType!==Node.TEXT_NODE?u instanceof Element&&(u.hasAttribute(Gn)||u.hasAttribute("contenteditable")?i+=Wn:i+=o.getTextWithMaskedDescendants(u)):i+=u.textContent||""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(Gn,"]")))return Wn;var t="";return t=e.querySelector("[".concat(Gn,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),s=((t={})[Ki]=i,t[zi]=o.getText(e),t[Vi]=window.location.href.split("?")[0],t);return to(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var c=he(s),u=c.next();!u.done;u=c.next()){var l=u.value;if(a.length>=25)break;if(l instanceof RegExp)a.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{a.push(new RegExp(l.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(ko||(ko={}));var Io=function(e,t){var n,r,i,o,s,a,c,u,l,d,f;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",$i);var p=e.dataAttributePrefix,g=void 0===p?wn:p,h=e.visualTaggingOptions,v=void 0===h?{enabled:!0}:h;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:bn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:Tn,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0;var m=null!==(a=null!==(s=null===(o=e.viewportContentUpdated)||void 0===o?void 0:o.exposureDuration)&&void 0!==s?s:e.exposureDuration)&&void 0!==a?a:150;e.viewportContentUpdated=de(de({},e.viewportContentUpdated),{exposureDuration:m}),e.pageUrlExcludelist=null===(c=e.pageUrlExcludelist)||void 0===c?void 0:c.reduce((function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e}),[]);var y,b="@amplitude/plugin-autocapture-browser",w=[],T=new _o(e,t),k=new Set,E=new Set,S=function(){var t,n,r=ur(co().map((function(t){return T.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,g)}))),i=ur(new sr((function(t){var n,r=function(n){var r=T.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,g);t.next(r)};return null===(n=Ge())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=Ge())||void 0===e?void 0:e.document.removeEventListener("change",r)}})));window.navigation&&(n=ur(new sr((function(t){var n=function(n){var r=T.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,g);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}))));var o=ur(ao().map((function(t){return T.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,g)}))),s=new sr((function(e){var t,n=function(t){e.next(t)};return null===(t=Ge())||void 0===t||t.addEventListener("scroll",n),function(){var e;null===(e=Ge())||void 0===e||e.removeEventListener("scroll",n)}})),a=function(e,t){return new sr((function(n){var r,i=Ge();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver((function(e){e.forEach((function(e){n.next(e)}))}),{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");(null!==(r=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==r?r:[]).forEach((function(e){o.observe(e)}));var a=e.subscribe((function(e){return e.event.forEach((function(e){return e.addedNodes.forEach((function(e){e instanceof Element&&(e.matches(s)&&o.observe(e),e.querySelectorAll(s).forEach((function(e){o.observe(e)})))}))}))}));return function(){a.unsubscribe(),o.disconnect()}}))}(o,e.cssSelectorAllowlist);return(t={})[ko.ChangeObservable]=i,t[ko.ClickObservable]=r,t[ko.MutationObservable]=o,t[ko.NavigateObservable]=n,t[ko.ScrollObservable]=s,t[ko.ExposureObservable]=a,t},_=po(Object.values(null!==(l=null===(u=e.pageActions)||void 0===u?void 0:u.labeledEvents)&&void 0!==l?l:{})),I=go(null!==(f=null===(d=e.pageActions)||void 0===d?void 0:d.triggers)&&void 0!==f?f:[]),P=function(e,t,n,r){return new vo(e,t,n,r)}(_,I,T,e);return{name:b,type:"enrichment",setup:function(t,n){return pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,d,f,p,h,A,O,x,C,R,D,L,N,U;return ge(this,(function(M){return"undefined"==typeof document||(r=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var n,r;t&&(e.pageActions=de(de({},e.pageActions),t),_=po(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),I=go(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),P.update(_,I,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),o=eo(e,e.cssSelectorAllowlist),s=eo(e,e.actionClickAllowlist),a=S(),c=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(io).filter((function(e){return r("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(Hi,e.targetElementProperties)}))}({allObservables:a,amplitude:n,shouldTrackEvent:o,evaluateTriggers:P.evaluate.bind(P)}),w.push(c),u=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(io).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return o(e)})).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:a,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,me(me([],ve(e),!1),[g],!1))},amplitude:n,shouldTrackEvent:o,evaluateTriggers:P.evaluate.bind(P)}),w.push(u),l=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=n.clickObservable,c=n.mutationObservable,u=n.navigateObservable,l=a.filter((function(e){return!o("click",e.closestTrackedAncestor)})).map((function(e){var t=ro(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(io).filter((function(e){return s("click",e.closestTrackedAncestor)})),d=u?cr(c,u):c,f=cr(l,d),p=null,g=null;return ar(f,(function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return g=e,p=setTimeout((function(){p=null,g=null}),500),Promise.resolve(null);if(g){var t=g;return g=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(Hi,i("click",e.closestTrackedAncestor)))}))}({allObservables:a,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,me(me([],ve(e),!1),[g],!1))},amplitude:n,shouldTrackEvent:o,shouldTrackActionClick:s}),l&&w.push(l),d=function(e){var t=e.allObservables.scrollObservable,n={maxX:0,maxY:0},r=t.subscribe((function(){var e,t,r,i,o=Ge(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);n.maxX=Math.max(n.maxX,s),n.maxY=Math.max(n.maxY,a)}));return{unsubscribe:function(){r.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}({allObservables:a}),w.push(d),f={},p=Ge(),h=function(e){e&&r||(setTimeout((function(){r=!1}),100),r=!0,function(e){var t,n,r,i,o=e.amplitude,s=e.scrollTracker,a=e.currentElementExposed,c=e.elementExposedForPage,u=e.exposureTracker,l=e.isPageEnd,d=e.lastScroll,f=s.getState(),p=Ge(),g=null!==(n=null==p?void 0:p.innerWidth)&&void 0!==n?n:0,h=null!==(r=null==p?void 0:p.innerHeight)&&void 0!==r?r:0,v=((t={})[Vi]=null===(i=null==p?void 0:p.location)||void 0===i?void 0:i.href,t["[Amplitude] Max Page X"]=f.maxX+g,t["[Amplitude] Max Page Y"]=f.maxY+h,t[Gi]=h,t[Wi]=g,t["[Amplitude] Element Exposed"]=Array.from(a),t),m=no();m&&(v[Ji]=m),0!==a.size||f.maxX!==d.maxX||f.maxY!==d.maxY?(null==o||o.track("[Amplitude] Viewport Content Updated",v),d.maxX=f.maxX,d.maxY=f.maxY,a.clear(),l&&(s.reset(),c.clear(),null==u||u.reset())):l&&(s.reset(),c.clear(),null==u||u.reset())}({amplitude:n,scrollTracker:d,currentElementExposed:E,elementExposedForPage:k,exposureTracker:f.exposure,isPageEnd:e,lastScroll:i}))},A=function(e){!function(e,t,n,r){if(!t.has(e)){t.add(e),n.add(e);var i=Array.from(n);JSON.stringify(i).length>=18e3&&r(!1)}}(e,k,E,h)},f.exposure=function(e){var t=e.allObservables,n=e.onExposure,r=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,s=new Map,a=new Map,c=t.exposureObservable.subscribe((function(e){var t=e,i=t.target;if(t.isIntersecting){if(!s.get(i)){var c=setTimeout((function(){s.set(i,!0);var e=r.getElementPath(i);n(e),a.set(i,null)}),o);a.set(i,c)}}else!t.isIntersecting&&t.intersectionRatio<1&&(c=a.get(i))&&(clearTimeout(c),a.set(i,null))}));return{unsubscribe:function(){c.unsubscribe()},reset:function(){a.forEach((function(e){e&&clearTimeout(e)})),a.clear(),s.clear()}}}({allObservables:a,onExposure:A,dataExtractor:T,exposureDuration:m}),f.exposure&&w.push(f.exposure),O=function(){h(!0)},null==p||p.addEventListener("beforeunload",O),y=function(){null==p||p.removeEventListener("beforeunload",O)},w.push({unsubscribe:function(){return y()}}),(x=a[ko.NavigateObservable])?w.push(x.subscribe((function(){h(!0)}))):p&&(C=function(){h(!0)},p.addEventListener("popstate",C),R=p.history.pushState,p.history&&R&&(p.history.pushState=new Proxy(R,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),h(!0)}})),w.push({unsubscribe:function(){p.removeEventListener("popstate",C),p.history&&R&&(p.history.pushState=R)}})),null===(U=null==t?void 0:t.loggerProvider)||void 0===U||U.log("".concat(b," has been successfully added.")),window.opener&&v.enabled&&(D=e.cssSelectorAllowlist,L=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n[oo]){n[oo]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,c=function(t){e.notify({action:"element-selected",data:t})},u=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",(function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then((function(){var n;a=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:c,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:$i}}}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))})),e.registerActionHandler("close-visual-tagging-selector",(function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)}))}}(N=Tr(),{dataExtractor:T,isElementSelectable:eo(e,me(me([],ve(D),!1),ve(L),!1)),cssSelectorAllowlist:D,actionClickAllowlist:L}),function(e){var t=e;if(!0!==t[kr]){t[kr]=!0;var n="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",r=null,i=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",(function(){var t,o;null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Initializing background capture (external script)");var s=new URL(n,e.endpoint).toString();e.loadScriptOnce(s).then((function(){var t,n,o;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),r=null===(o=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===o?void 0:o.call(window,{messenger:e,onBackgroundCapture:i}),e.notify({action:"background-capture-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")}))})),e.registerActionHandler("close-background-capture",(function(){var e;null===(e=null==r?void 0:r.close)||void 0===e||e.call(r),r=null}))}}(N),N.setup(de({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:mr[t.serverZone]})))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){try{for(e=he(w),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},Po=["mutation","navigate"];function Ao(e,t){var n,r,i,o,s=t.event,a=s.pageX,c=s.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:c,c),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:c,c),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function Oo(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:de({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map((function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}})),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function xo(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=r.selectionObservable,a=[],c={},u=null;function l(e){a=[],c={},e&&(Ao(c,e),a.push(e))}var d=ar(o.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return pe(t,void 0,void 0,(function(){var t;return ge(this,(function(n){return Ao(c,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(a,e)||c.isOutOfBounds?(u&&(t=Oo(a)),l(e)):a.push(e),u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=4?[2,new Promise((function(e){u={resolve:e,timerId:setTimeout((function(){e(Oo(a))}),1e3)}}))]:[2,null]}))}))})),f=null==s?void 0:s.subscribe((function(){l()})),p=d.subscribe((function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})}));return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}var Co,Ro;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(Co||(Co={})),function(e){e.X="x",e.Y="y"}(Ro||(Ro={}));function Do(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function Lo(e){e.changes=[],e.startTime=void 0}function No(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var Uo=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new sr((function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},s=void 0,a=null;function c(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),Lo(n),Lo(i))}return t.subscribe((function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===Ro.X?n:i);var t=function(e,t){var n=void 0;if(Do(e)&&(n=e.startTime),Do(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(s=s||t,a=setTimeout((function(){c(),a=null}),o)):c(),No(n),No(i),function(){null!==a&&(clearTimeout(a),a=null)}}))}))},Mo=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,s=e.thresholdMs,a=void 0===s?2e3:s,c=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new sr((function(e){var n=null,r=null,i=null;return t.subscribe((function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===Co.DECREASING&&e.next(Ro.X),r=Co.INCREASING):o.x<n.x&&(r===Co.INCREASING&&e.next(Ro.X),r=Co.DECREASING),o.y>n.y?(i===Co.DECREASING&&e.next(Ro.Y),i=Co.INCREASING):o.y<n.y&&(i===Co.INCREASING&&e.next(Ro.Y),i=Co.DECREASING),n=o):n=o}))}))}({allWindowObservables:r});return Uo({mouseDirectionChangeObservable:c,directionChanges:o,thresholdMs:a}).subscribe((function(e){Zi(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})}))};function jo(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var qo,Fo,Bo=4e3,$o=function(e){var t;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,s=!1!==e.rageClicks&&null!==e.rageClicks,a=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(a=!1);var c=jo(e,"rageClicks",_n,s),u=jo(e,"deadClicks",En,o),l=jo(e,"errorClicks",Sn,i),d=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:wn,f=new _o(e),p=me([],ve(new Set(me(me(me([],ve(c),!1),ve(u),!1),ve(l),!1))),!1),g=function(){var e,t,n=ur(co("pointerdown").map((function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)}))),r=ur(uo().map((function(e){return f.addTypeAndTimestamp(e,"error")}))),i=ur(ao().map((function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)})));window.navigation&&(t=ur(new sr((function(e){var t=function(t){e.next(de(de({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)}))));var o=ur(new sr((function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}))),s=ur(new sr((function(e){var t=function(t){e.next(t)},n={capture:!0};return so.document.addEventListener("mousemove",t,n),function(){so.document.removeEventListener("mousemove",t,n)}})));return(e={})[ko.ClickObservable]=n,e[ko.MutationObservable]=i,e[ko.NavigateObservable]=t,e[ko.BrowserErrorObservable]=r,e[ko.SelectionObservable]=o,e[ko.MouseMoveObservable]=s,e};return{name:n,type:"enrichment",setup:function(t,p){return pe(void 0,void 0,void 0,(function(){var h,v,m,y,b,w,T,k,E,S,_;return ge(this,(function(I){return"undefined"==typeof document||(h=g(),s&&(v=eo(e,c),m=xo({allObservables:h,amplitude:p,shouldTrackRageClick:v}),r.push(m)),o&&(y=eo(e,u),b=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackDeadClick,o=n.clickObservable,s=n.mutationObservable,a=n.navigateObservable,c=o.filter((function(e){return io(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Bi.LEFT_OR_TOUCH_CONTACT})),u=a?cr(s,a):s,l=cr(c,u),d=null;return ar(l,(function(e){return d&&Po.includes(e.type)?(clearTimeout(d),d=null,Promise.resolve(null)):"click"===e.type?d?Promise.resolve(null):new Promise((function(t){d=setTimeout((function(){t(e),d=null}),3e3)})):Promise.resolve(null)})).subscribe((function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",de(de({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}}))}({amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:y}),r.push(b)),i&&(w=eo(e,l),T=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,i=n.clickObservable,o=n.browserErrorObservable,s=i.filter((function(e){return io(e)&&r("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Bi.LEFT_OR_TOUCH_CONTACT})),a=null,c=null,u=function(){null!==a&&(clearTimeout(a),a=null),c=null};return cr(s,o).subscribe((function(e){var n;if("click"===e.type)return u(),c=e,void(a=setTimeout(u,2e3));"error"===e.type&&c&&(t.track("[Amplitude] Error Click",de(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),c.targetElementProperties)),u())}))}({amplitude:p,allObservables:h,shouldTrackErrorClick:w}),r.push(T)),a&&(k=void 0,E=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,E=e.thrashedCursor.threshold,k&&k<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),E&&E>Bo&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(E," is above the maximum of ").concat(Bo,", setting to ").concat(Bo)),E=Bo)),S=Mo({amplitude:p,options:e,allObservables:h,directionChanges:k,thresholdMs:E}),r.push(S)),null===(_=null==t?void 0:t.loggerProvider)||void 0===_||_.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,i;return ge(this,(function(o){try{for(e=he(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},Ho="[Amplitude] Network Request",Ko="500-599";function zo(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function Vo(e,t){var n,r,i=t.split(",");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split("-").map(Number),2),c=a[0],u=a[1];if(e===c&&void 0===u)return!0;if(e>=c&&e<=u)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function Go(e){var t;if(e)try{var n=null===(t=Ge())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:r.href,host:a}}catch(e){return}}function Wo(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return me([],ve(je),!1);if(void 0===e){return}}}function Jo(e){var t,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)}function Yo(e,t){var n;void 0===t&&(t={});var r=Go(e.url);if(!r)return!1;var i,o=r.host;if(!1!==t.ignoreAmplitudeRequests&&(zo(o,"*.amplitude.com")||zo(o,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find((function(e){return zo(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Vo(e.status,Ko))return!1;if(t.captureRules&&(me([],ve(t.captureRules),!1).reverse().find((function(t){if(i=function(e,t,n,r,i){if((!e.hosts||e.hosts.find((function(e){return zo(t,e)})))&&(!r||!e.urls||Nt(r,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e}))))return!((n||0===n)&&!Vo(n,e.statusCodeRange||Ko))}(t,o,e.status,e.url,e.method),i){var n=Wo(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var s=Wo(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!Jo(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!Jo(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find((function(e){return e.event_type===Ho})))return!0}catch(e){}return!1}(o,e.requestWrapper)}function Xo(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return Yo(e.event,n)})).subscribe((function(e){var t,n,o,s=e.event,a=Go(s.url);if(a){var c=null===(n=s.responseWrapper)||void 0===n?void 0:n.bodySize,u=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,n,r){pe(this,void 0,void 0,(function(){var i,o,s;return ge(this,(function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=ve.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(Ho,e),[2]}}))}))}(((t={})["[Amplitude] URL"]=a.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=a.query,t["[Amplitude] URL Fragment"]=a.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=c,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,r,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(qo||(qo={}));var Qo=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new sr((function(e){var n=new $n((function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)}));return zn.subscribe(n,t),function(){zn.unsubscribe(n)}}));return(e={})[qo.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return pe(void 0,void 0,void 0,(function(){var s;return ge(this,(function(a){return"undefined"==typeof document||(s=r(),t=null==i?void 0:i.loggerProvider,Fo=Xo({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return Fo.unsubscribe(),[2]}))}))}}};let Zo=-1;const es=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Zo=t.timeStamp,e(t))}),!0)},ts=(e,t,n,r)=>{let i,o;return s=>{t.value>=0&&(s||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},ns=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},rs=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},is=()=>{const e=rs();return e?.activationStart??0},os=(e,t=-1)=>{const n=rs();let r="navigate";return Zo>=0?r="back-forward-cache":n&&(document.prerendering||is()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},ss=new WeakMap;function as(e,t){return ss.get(e)||ss.set(e,new t),ss.get(e)}class cs{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const us=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ls=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let ds=-1;const fs=new Set,ps=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,gs=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of fs)e();isFinite(ds)||(ds="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",gs,!0))}},hs=()=>{if(ds<0){const e=is(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;ds=t??ps(),addEventListener("visibilitychange",gs,!0),addEventListener("prerenderingchange",gs,!0),es((()=>{setTimeout((()=>{ds=ps()}))}))}return{get firstHiddenTime(){return ds},onHidden(e){fs.add(e)}}},vs=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},ms=[1800,3e3],ys=(e,t={})=>{vs((()=>{const n=hs();let r,i=os("FCP");const o=us("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-is(),0),i.entries.push(t),r(!0)))}));o&&(r=ts(e,i,ms,t.reportAllChanges),es((n=>{i=os("FCP"),r=ts(e,i,ms,t.reportAllChanges),ns((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},bs=[.1,.25];let ws=0,Ts=1/0,ks=0;const Es=e=>{for(const t of e)t.interactionId&&(Ts=Math.min(Ts,t.interactionId),ks=Math.max(ks,t.interactionId),ws=ks?(ks-Ts)/7+1:0)};let Ss;const _s=()=>Ss?ws:performance.interactionCount??0;let Is=0;class Ps{u=[];l=new Map;m;p;v(){Is=_s(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((_s()-Is)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const As=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=ls(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},Os=[200,500],xs=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=hs();vs((()=>{"interactionCount"in performance||Ss||(Ss=us("event",Es,{type:"event",buffered:!0,durationThreshold:0}));let r,i=os("INP");const o=as(t,Ps),s=e=>{As((()=>{for(const t of e)o.h(t);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,r())}))},a=us("event",s,{durationThreshold:t.durationThreshold??40});r=ts(e,i,Os,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),es((()=>{o.v(),i=os("INP"),r=ts(e,i,Os,t.reportAllChanges)})))}))};class Cs{m;h(e){this.m?.(e)}}const Rs=[2500,4e3],Ds=[800,1800],Ls=e=>{document.prerendering?vs((()=>Ls(e))):"complete"!==document.readyState?addEventListener("load",(()=>Ls(e)),!0):setTimeout(e)};function Ns(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function Us(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Ns(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Ms,js=function(){var e=null,t=Ge(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return void 0===n||(o=Ut((null==r?void 0:r.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Ut((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Ut(o.split("?")[0],t.loggerProvider)},((e,t={})=>{vs((()=>{const n=hs();let r,i=os("LCP");const o=as(t,Cs),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-is(),0),i.entries=[t],r())},a=us("largest-contentful-paint",s);if(a){r=ts(e,i,Rs,t.reportAllChanges);const n=ls((()=>{s(a.takeRecords()),a.disconnect(),r(!0)})),o=e=>{e.isTrusted&&(As(n),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});es((n=>{i=os("LCP"),r=ts(e,i,Rs,t.reportAllChanges),ns((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))})((function(e){s["[Amplitude] LCP"]=Us(e)})),ys((function(e){s["[Amplitude] FCP"]=Us(e)})),xs((function(e){s["[Amplitude] INP"]=Us(e)})),((e,t={})=>{const n=hs();ys(ls((()=>{let r,i=os("CLS",0);const o=as(t,cs),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=us("layout-shift",s);a&&(r=ts(e,i,bs,t.reportAllChanges),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),es((()=>{o.i=0,i=os("CLS",0),r=ts(e,i,bs,t.reportAllChanges),ns((()=>r()))})),setTimeout(r))})))})((function(e){s["[Amplitude] CLS"]=Us(e)})),((e,t={})=>{let n=os("TTFB"),r=ts(e,n,Ds,t.reportAllChanges);Ls((()=>{const i=rs();i&&(n.value=Math.max(i.responseStart-is(),0),n.entries=[i],r(!0),es((()=>{n=os("TTFB",0),r=ts(e,n,Ds,t.reportAllChanges),r(!0)})))}))})((function(e){s["[Amplitude] TTFB"]=Us(e)})),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]}))}))}}},qs=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=de({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=(null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)||t.topLevelDomain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[]),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=$t(t.apiKey,"MKTG"),this.webExpStorageKey=$t(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Me,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=ve.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||xt(this.sessionTimeout,this.lastEventTime),gi(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return pe(this,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new Vn).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,o=(t=this.currentCampaign,n=this.options,r=de(de({},Me),t),i=Object.entries(r).reduce((function(e,t){var r,i=ve(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)}),new $e),Xe(i));return e&&(o.event_id=e),o},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Fs="AMP_CURRENT_PAGE",Bs="AMP_PREVIOUS_PAGE",$s="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Ms||(Ms={}));var Hs=new Set([le.IDENTIFY,le.GROUP_IDENTIFY,le.REVENUE]),Ks=function(e){var t={}.internalDomains,n=void 0===t?[]:t,r=Ge(),i=void 0,o=!1,s=void 0,a=!1,c=!1,u=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?function(e){var t;try{var n=Ut(e,s);t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t}(e):void 0;if(!r)return Ms.Direct;var i=n.some((function(e){return-1!==t.indexOf(e)})),o=n.some((function(e){return-1!==r.indexOf(e)}));return t===r||o&&i?Ms.Internal:Ms.External},l=function(){pe(void 0,void 0,void 0,(function(){var e,t,n,r,s;return ge(this,(function(a){switch(a.label){case 0:return i&&o?[4,i.get($s)]:[3,3];case 1:return e=a.sent(),t=Ut("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Fs])||"",r=void 0,r=t===n?(null==e?void 0:e[Bs])||"":n||document.referrer||"",[4,i.set($s,(s={},s[Fs]=t,s[Bs]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},d={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,!r)return[3,2];try{i=new Ht(r.sessionStorage)}catch(e){null==s||s.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:o=null!==(t=n.sent())&&void 0!==t&&t,r.addEventListener("popstate",l),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),a=!0),n.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t,n,r,s,a;return ge(this,(function(c){switch(c.label){case 0:return t=Ut("undefined"!=typeof location&&location.href||""),i&&o?[4,i.get($s)]:[3,5];case 1:return(null==(n=c.sent())?void 0:n[Fs])?[3,3]:[4,i.set($s,(a={},a[Fs]=t,a[Bs]=document.referrer||"",a))];case 2:c.sent(),c.label=3;case 3:return[4,i.get($s)];case 4:if(r=c.sent(),s="",r&&(s=r[Bs]||""),Hs.has(e.event_type))return[2,e];e.event_properties=de(de({},e.event_properties||{}),{"[Amplitude] Page Domain":zs(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":zs(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":zs(e,"[Amplitude] Page Path","undefined"!=typeof location&&Ut(location.pathname)||""),"[Amplitude] Page Title":zs(e,"[Amplitude] Page Title",Zn(Qn)),"[Amplitude] Page URL":zs(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":u(s)}),c.label=5;case 5:return[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",l),c=!1),i&&o?[4,i.set($s,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return d};function zs(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var Vs=function(){var e,t,n;function r(t){if(t)try{var n=new Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}var i={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(s=i.remoteConfig)||void 0===s?void 0:s.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",(function(e){n=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?r(e.body||""):r("")})),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]}))}))},execute:function(t){return pe(void 0,void 0,void 0,(function(){var r;return ge(this,(function(i){if(n)try{return[2,null!==(r=n(t))&&void 0!==r?r:null]}catch(n){return null==e||e.error("Could not execute custom enrichment function",n),[2,t]}return[2,t]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return t&&t(),[2]}))}))}};return i},Gs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t._enableRequestBodyCompressionExperimentalValue=!1,t}return ce(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),Qe(this._init(de(de({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,c,u;return pe(this,void 0,void 0,(function(){var l,d,f,p,g,h,v,m,y,b,w,T,k,E,S,_=this;return ge(this,(function(I){switch(I.label){case 0:return this.initializing?[2]:(this.initializing=!0,l=function(e){var t,n;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),d=null!==(n=t.loggerProvider)&&void 0!==n?n:new rt,t.loggerProvider||d.enable(null!==(r=t.logLevel)&&void 0!==r?r:tt.Warn),f=null!==(i=t.serverZone)&&void 0!==i?i:"US",g=this._diagnosticsSampleRate,h=null===(o=t.enableDiagnostics)||void 0===o||o,l?(p=new dn(t.apiKey,d,f,null===(s=t.remoteConfig)||void 0===s?void 0:s.serverUrl),[4,new Promise((function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",(function(t,n,r){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(g=i);var o=t.enabled;"boolean"==typeof o&&(h=o)}e()}))}))]):[3,2]);case 1:I.sent(),I.label=2;case 2:return(v=new nn(t.apiKey,d,f,{enabled:h,sampleRate:g})).setTag("library","".concat(Fr,"/").concat(qr)),"undefined"!=typeof navigator&&v.setTag("user_agent",navigator.userAgent),[4,ki(t.apiKey,t,this,v,{loggerProvider:d,serverZone:f,enableDiagnostics:h,diagnosticsSampleRate:g})];case 3:return m=I.sent(),l&&p?[4,new Promise((function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,n,r){m.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&Fi(t,m),e()}))}))]:[3,5];case 4:I.sent(),I.label=5;case 5:return[4,e.prototype._init.call(this,m)];case 6:return I.sent(),this.logBrowserOptions(m),this.config.remoteConfigClient=p,_r(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(_,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return e?[3,2]:(t=Ur(this.config),this.webAttribution=new qs(t,this.config),[4,this.webAttribution.init()]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))})),y=Ur(this.config),this.webAttribution=new qs(y,this.config),[4,this.webAttribution.init()]):[3,8];case 7:I.sent(),I.label=8;case 8:return b=Dt(),w=b.ampTimestamp?Number(b.ampTimestamp):void 0,T=!w||Date.now()<w,k=T&&!Number.isNaN(Number(b.ampSessionId))?Number(b.ampSessionId):void 0,-1!==(E=this.config.deferredSessionId)||this.config.optOut||(E=Date.now()),this.setSessionId(null!==(u=null!==(c=null!==(a=t.sessionId)&&void 0!==a?a:k)&&void 0!==c?c:E)&&void 0!==u?u:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(_,void 0,void 0,(function(){return ge(this,(function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]}))}))})),(S=At(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,10]:[4,this.add(Mi()).promise];case 9:I.sent(),I.label=10;case 10:return[4,this.add(new mt({diagnosticsClient:v})).promise];case 11:return I.sent(),[4,this.add(new Br).promise];case 12:return I.sent(),[4,this.add(new Ot).promise];case 13:return I.sent(),O=this.config,Ui||void 0!==O.defaultTracking||(O.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Ui=!0),A=this.config.defaultTracking,Sr(A,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Ni()).promise]):[3,15];case 14:I.sent(),I.label=15;case 15:return Ir(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Ri()).promise]):[3,17];case 16:I.sent(),I.label=17;case 17:return Pr(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ai(Nr(this.config))).promise]):[3,20];case 18:return I.sent(),[3,20];case 19:this.timeline.addOptOutListener((function(e){return pe(_,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ai(Nr(this.config))).promise]);case 1:return t.sent(),[2]}}))}))})),I.label=20;case 20:return xr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Io(Rr(this.config),{diagnosticsClient:v})).promise]):[3,22];case 21:I.sent(),I.label=22;case 22:return Cr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add($o(Dr(this.config))).promise]):[3,24];case 23:I.sent(),I.label=24;case 24:return Or(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Qo(Lr(this.config))).promise]):[3,26];case 25:I.sent(),I.label=26;case 26:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(js()).promise]):[3,28];case 27:I.sent(),I.label=28;case 28:return function(e){return Sr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Ks()).promise]):[3,30];case 29:I.sent(),I.label=30;case 30:return("boolean"==typeof(P=this.config.customEnrichment)?P:"object"==typeof P&&null!==P&&!1!==P.enabled)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(Vs()).promise]):[3,32];case 31:I.sent(),I.label=32;case 32:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 33:return I.sent(),S.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},n=t.time,r=fe(t,["time"]),i="number"==typeof n?{time:n}:void 0;_.track(e.eventType,r,i)})),[2]}var P,A,O}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){At(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){At(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(Je()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){var t,n,r;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new $e,o=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var s=he(Object.entries(o)),a=s.next();!a.done;a=s.next()){var c=ve(a.value,2),u=c[0],l=c[1];i.set(u,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),Qe(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,Qe(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return Qe(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Ar(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ni,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(Xe(this.config.identify)).promise),Ar(this.config.defaultTracking)&&n.push(this.track(ti,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Qe(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=Si(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(jr(t)){var r=t._q;t._q=[],t=Mr(new $e,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(jr(r)){var o=r._q;r._q=[],r=Mr(new $e,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(jr(t)){var r=t._q;t._q=[],t=Mr(new et,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return pe(this,void 0,void 0,(function(){var n,r,i;return ge(this,(function(o){return n=Date.now(),r=xt(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===ti||t.event_type===ni||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=de(de({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",hr(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t.prototype._enableRequestBodyCompressionExperimental=function(e){this.config||(this._enableRequestBodyCompressionExperimentalValue=e)},t}(Ze),Ws=function(){var e=new Gs;return{init:gt(e.init.bind(e),"init",dt(e),pt(e,["config"])),add:gt(e.add.bind(e),"add",dt(e),pt(e,["config.apiKey","timeline.plugins"])),remove:gt(e.remove.bind(e),"remove",dt(e),pt(e,["config.apiKey","timeline.plugins"])),track:gt(e.track.bind(e),"track",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),logEvent:gt(e.logEvent.bind(e),"logEvent",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),identify:gt(e.identify.bind(e),"identify",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:gt(e.groupIdentify.bind(e),"groupIdentify",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),setGroup:gt(e.setGroup.bind(e),"setGroup",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),revenue:gt(e.revenue.bind(e),"revenue",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),flush:gt(e.flush.bind(e),"flush",dt(e),pt(e,["config.apiKey","timeline.queue.length"])),getUserId:gt(e.getUserId.bind(e),"getUserId",dt(e),pt(e,["config","config.userId"])),setUserId:gt(e.setUserId.bind(e),"setUserId",dt(e),pt(e,["config","config.userId"])),getDeviceId:gt(e.getDeviceId.bind(e),"getDeviceId",dt(e),pt(e,["config","config.deviceId"])),setDeviceId:gt(e.setDeviceId.bind(e),"setDeviceId",dt(e),pt(e,["config","config.deviceId"])),reset:gt(e.reset.bind(e),"reset",dt(e),pt(e,["config","config.userId","config.deviceId"])),getSessionId:gt(e.getSessionId.bind(e),"getSessionId",dt(e),pt(e,["config"])),setSessionId:gt(e.setSessionId.bind(e),"setSessionId",dt(e),pt(e,["config"])),extendSession:gt(e.extendSession.bind(e),"extendSession",dt(e),pt(e,["config"])),setOptOut:gt(e.setOptOut.bind(e),"setOptOut",dt(e),pt(e,["config"])),setTransport:gt(e.setTransport.bind(e),"setTransport",dt(e),pt(e,["config"])),getIdentity:gt(e.getIdentity.bind(e),"getIdentity",dt(e),pt(e,["config"])),setIdentity:gt(e.setIdentity.bind(e),"setIdentity",dt(e),pt(e,["config","config.userId","config.deviceId"])),getOptOut:gt(e.getOptOut.bind(e),"getOptOut",dt(e),pt(e,["config"])),_setDiagnosticsSampleRate:gt(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",dt(e),pt(e,["config"])),_enableRequestBodyCompressionExperimental:gt(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",dt(e),pt(e,["config"]))}},Js=Ws(),Ys=Js.add,Xs=Js.extendSession,Qs=Js.flush,Zs=Js.getDeviceId,ea=Js.getIdentity,ta=Js.getOptOut,na=Js.getSessionId,ra=Js.getUserId,ia=Js.groupIdentify,oa=Js.identify,sa=Js.init,aa=Js.logEvent,ca=Js.remove,ua=Js.reset,la=Js.revenue,da=Js.setDeviceId,fa=Js.setGroup,pa=Js.setIdentity,ga=Js.setOptOut,ha=Js.setSessionId,va=Js.setTransport,ma=Js.setUserId,ya=Js.track,ba=Js._setDiagnosticsSampleRate,wa=Js._enableRequestBodyCompressionExperimental,Ta=Object.freeze({__proto__:null,AmplitudeBrowser:Gs,Identify:$e,Revenue:et,Types:fi,_enableRequestBodyCompressionExperimental:wa,_setDiagnosticsSampleRate:ba,add:Ys,createInstance:Ws,extendSession:Xs,flush:Qs,getDeviceId:Zs,getIdentity:ea,getOptOut:ta,getSessionId:na,getUserId:ra,groupIdentify:ia,identify:oa,init:sa,logEvent:aa,remove:ca,reset:ua,revenue:la,runQueuedFunctions:function(e,t){Mr(e,t)},setDeviceId:da,setGroup:fa,setIdentity:pa,setOptOut:ga,setSessionId:ha,setTransport:va,setUserId:ma,track:ya});class ka{constructor(){this.isInitialized=!1}static getInstance(){return ka.instance||(ka.instance=new ka),ka.instance}initialize(){if(this.isInitialized||a())return;const e=b.getEnvironment()||"production",t=e===c.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";try{if(!Ta||"function"!=typeof sa)throw new Error("Analytics SDK module not available");const n={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==c.PRODUCTION?tt.Debug:tt.None};sa(t,void 0,n),this.isInitialized=!0,this.track(oe)}catch(e){console.error("Failed to initialize analytics tracking:",e)}}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{ya(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{ua()}catch(e){console.error("Failed to reset analytics:",e)}}}const Ea=ka.getInstance();function Sa(e,t){Ea.track(e,t)}const _a=e=>{Sa(se,e)};class Ia extends i{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function Pa({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:n}){if(n){const e={...Object.fromEntries([..._(t.options?.headers)??{}])},r=P({...t,options:{...t.options,headers:e}}),i=await fetch(n.path,{method:n.method,headers:n.options.headers,body:r}),o=A(await i.text());if(!i.ok)throw new S({code:i.status,data:o,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return o}if(e){const n=Object.fromEntries([..._(t.options?.headers)??{}]),r=P({...t,options:{...t.options,headers:n}});return A(await e(r))}throw new Ia("No proxy function or proxy endpoint descriptor provided for proxy call.")}var Aa;function Oa(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(Aa||(Aa={}));const xa={getCards:async function(e){_a();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new R("membershipId must be a string");const{accessToken:n,stagingToken:r}=e?.operationSettings||{},i=n||s(),o=await async function({membershipId:e,accessToken:t,stagingToken:n}){const r=function({membershipId:e,accessToken:t,stagingToken:n}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({membershipId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i}({membershipId:t,accessToken:i,stagingToken:r});return o.map((e=>Oa(e)))},getCard:async function({cardSettings:e,operationSettings:t}){!function(e){if(!e)throw new R("cardSettings parameter is required for the called function");if(!e.cardId)throw new R("cardId parameter is required for the called function");const t=L({cardId:e.cardId});if(t.length>0)throw new R(t)}(e);const n=e.cardId,{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({cardId:e,accessToken:t,stagingToken:n}){const r=function({cardId:e,accessToken:t,stagingToken:n}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({cardId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i[0]}({cardId:n,accessToken:o,stagingToken:i});return Oa(a)}},Ca=e=>({id:e?.id,slug:e.slug,iban:e.iban,bic:e.bic,currency:e.currency,balance:parseFloat(e.balance),balanceCents:e.balance_cents,authorizedBalance:e.authorized_balance,authorizedBalanceCents:e.authorized_balance_cents,name:e.name,updatedAt:new Date(e.updated_at),status:e.status,main:e.main}),Ra={getOrganization:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/organization/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return{id:(o=i.organization).id,slug:o.slug,legalName:o.legal_name,legalNumber:o.legal_number,legalSector:o.legal_sector,legalRegistrationDate:o.legal_registration_date,legalAddress:o.legal_address,legalForm:o.legal_form,legalCountry:o.legal_country,legalShareCapital:o.legal_share_capital,locale:o.locale,contractSignedAt:o.contract_signed_at,bankAccounts:o.bank_accounts.map(Ca)};var o},getBankAccounts:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/bank_accounts/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return i.bank_accounts.map(Ca)}},Da={AED:"AED",AUD:"AUD",BGN:"BGN",CAD:"CAD",CHF:"CHF",CNY:"CNY",CZK:"CZK",DKK:"DKK",EUR:"EUR",GBP:"GBP",GHS:"GHS",HKD:"HKD",HUF:"HUF",ILS:"ILS",INR:"INR",MXN:"MXN",NOK:"NOK",NZD:"NZD",PEN:"PEN",PLN:"PLN",RON:"RON",RSD:"RSD",SAR:"SAR",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",ZAR:"ZAR",ZMW:"ZMW"},La=e=>{if(!(e=>Object.values(Da).includes(e))(e))throw new R(`currency ${e} is not valid, valid currencies are ${Object.values(Da).join(", ")}`)},Na={GOOD:"good",SERVICE:"service"},Ua={UNIT:"unit",HOUR:"hour",DAY:"day",MONTH:"month",GRAM:"gram",KILOGRAM:"kilogram",LITER:"liter",METER:"meter",SQUARE_METER:"square_meter",CUBIC_METER:"cubic_meter",AMPERE:"ampere",NUMBER_OF_ARTICLES:"number_of_articles",CENTIMETER:"centimeter",CUBIC_METER_PER_HOUR:"cubic_meter_per_hour",GIGAJOULE:"gigajoule",GIGAWATT:"gigawatt",GIGAWATT_HOUR:"gigawatt_hour",HALF_YEAR:"half_year",JOULE:"joule",KILOJOULE:"kilojoule",KILOVAR:"kilovar",KILOWATT:"kilowatt",KILOWATT_HOUR:"kilowatt_hour",MEGAJOULE:"megajoule",MEGAWATT:"megawatt",MEGAWATT_HOUR:"megawatt_hour",MILLIGRAM:"milligram",MILLILITER:"milliliter",MILLIMETER:"millimeter",MINUTE:"minute",PAIR:"pair",QUARTER:"quarter",SECOND:"second",SET:"set",TON:"ton",TWO_WEEK:"two_week",WATT_HOUR:"watt_hour",WEEK:"week",YEAR:"year"},Ma=e=>{if(!(e=>Object.values(Ua).includes(e))(e))throw new R(`unit ${e} is not valid, valid units are ${Object.values(Ua).join(", ")}`)},ja=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],qa=[{name:"currency"},{name:"value"}];const Fa=e=>{if(!Object.values(Na).includes(e))throw new R(`type ${e} is not valid, valid types are ${Object.values(Na).join(", ")}`)};const Ba={getPaymentLinkCreationFlowUrl:async({paymentLinkSettings:e,operationSettings:t})=>{const{items:n}=e;!function(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{D(e,ja),D(e.unitPrice,qa);const t=[...L({id:e.id,title:e.title,vatRate:e.vatRate,currency:e.unitPrice.currency,measureUnit:e.measureUnit,unitPrice:e.unitPrice.value,...e.description?{description:e.description}:{}}),...N({quantity:e.quantity})].flat();if(t.length>0)throw new R(t);Fa(e.type),La(e.unitPrice.currency),Ma(e.measureUnit)}))}(n);const r=function(e){if(!e?.callbackUrl)throw new R("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new R("callbackUrl cannot be empty");return e.callbackUrl}(e),i=await M({requestSettings:{action:p.PAYMENT_LINK_CREATE,callbackUrl:r},operationSettings:t}),o=new URLSearchParams({...n?{items:JSON.stringify(n)}:{}});return o.toString()?`${i.url}?${o.toString()}`:i.url}};function $a(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function Ha(e){return{name:e.name,iban:e.iban}}const Ka="/v2/sepa",za=`${Ka}/transfers`;async function Va({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${za}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{transfers:i,meta:o}=await I(r);return{transfers:i,meta:o}}async function Ga({accessToken:e,stagingToken:t,sepaTransferId:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${za}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:n,accessToken:e,stagingToken:t}),{transfer:i}=await I(r);return i}async function Wa({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function(e){const t=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:t,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:za,options:{method:"POST",headers:{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o},body:{transfer:s,vop_proof_token:t}}}}({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}),{transfer:a}=await I(s);return a}async function Ja({sepaTransferId:e,accessToken:t,stagingToken:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${za}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:e,accessToken:t,stagingToken:n});await I(r)}async function Ya({sepaPayee:e,accessToken:t,stagingToken:n}){const r=function({sepaPayee:e,accessToken:t,stagingToken:n}){return{path:`${Ka}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:t,stagingToken:n});return await I(r)}function Xa(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function Qa(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const Za="/v2/sepa/bulk_transfers";async function ec({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${Za}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{bulk_transfers:i,meta:o}=await I(r);return{bulkTransfers:i,meta:o}}async function tc({accessToken:e,stagingToken:t,bulkTransferId:n}){const r=function({bulkTransferId:e,accessToken:t,stagingToken:n}){return{path:`${Za}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({bulkTransferId:n,accessToken:e,stagingToken:t}),{bulk_transfer:i}=await I(r);return i}async function nc({sepaPayees:e,accessToken:t,stagingToken:n}){const r=function({sepaPayees:e,accessToken:t,stagingToken:n}){return{path:`${Ka}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{requests:e.map(Ha)}}}}({sepaPayees:e,accessToken:t,stagingToken:n});return await I(r)}function rc(e){if(!e)throw new R("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new R("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new R("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new R("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{!function(e,t){if(!e)throw new R(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new R(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const n=L({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),r=N({amount:e.amount}),i=[...n,...r].flat();if(i.length>0)throw new R(i);if(e.amount>d&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new R(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €30000`)}(e,t)})),e}const ic={requiresUI:!1};function oc(e,{requiresUI:t}=ic){const n=e?.uiParentElementId||E.getUIParentElementId();if(t){if(!n)throw new R("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof n))throw new R("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const r=e?.mfaPreference||E.getMFAPreference();if(r){const e=(i=Object.values(l),b.isProductionEnvironment()?i.filter((e=>e!==l.MOCK)):i);if(!e.includes(r))throw new R(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(b.isProductionEnvironment()&&r===l.MOCK)throw new R("operationSettings.mfaPreference cannot be set to mock in production environment.")}var i;const o=e?.debugMode||E.getDebugMode();if(void 0!==o&&"boolean"!=typeof o)throw new R("operationSettings.debugMode must be a boolean.");const s=e?.proxyRequestFunction||E.getProxyRequestFunction();if(s&&"function"!=typeof s)throw new R("operationSettings.proxyRequestFunction must be a function.");const a=e?.proxyEndpointDescriptor||E.getProxyEndpointDescriptor();if(a&&!a.path)throw new R("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:n,mfaPreference:r,debugMode:o,proxyRequestFunction:s,proxyEndpointDescriptor:a}}async function sc({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{proxyEndpointDescriptor:r,accessToken:i,stagingToken:o}=oc(t||{});if(r){const e=X({beneficiaryId:n});return G((await Pa({proxyEndpointDescriptor:r,networkCallDescriptor:e})).body.beneficiary)}{const e=i||s();return G(await Q({beneficiaryId:n,accessToken:e,stagingToken:o}))}}({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function ac(e,t){const n=t?.locale||T.getLocale(),r=new URL(e);return n&&r.searchParams.append("lang",n),t?.mfaPreference&&r.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&r.searchParams.append("idempotencyKey",t.idempotencyKey),r.toString()}const cc=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const uc={getSepaTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Va({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.transfers.map($a),c=F(o.meta);return{transfers:a,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return $a(await Ga({sepaTransferId:n,accessToken:o,stagingToken:i}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||V();!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new R("Either beneficiaryId or beneficiary must be provided");const t=L({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new R(t)}(e);const u=e?.beneficiary?e.beneficiary:await sc({sepaTransferSettings:e,operationSettings:t}),l={name:u.name,iban:u.iban},p=await Ya({sepaPayee:l,accessToken:a,stagingToken:r}),g=yield(h=p,{matchResult:h.match_result,matchedName:h.matched_name});var h;let v;if("string"==typeof g){if(g===f)return}else{if(g.vopDecision===f)return;v=g.sepaTransferSettings}const m={...e,...v};!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");D(e,cc);const t=[...L({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...N({amount:e.amount})].flat();if(t.length>0)throw new R(t);if(e.amount>d&&(!e.attachmentIds||0===e.attachmentIds.length))throw new R("Attachments are required for transfers over €30,000")}(m);const y={...m,beneficiary:u};return{transfer:$a(await Wa({transfer:y,vopProofToken:p.proof_token.token,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();await Ja({sepaTransferId:n,accessToken:o,stagingToken:i})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e||!e.callbackUrl)throw new R("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({requestSettings:e,operationSettings:t}){U(e);const{proxyEndpointDescriptor:n,stagingToken:r}=oc(t||{});if(n){const t=O({stagingToken:r,action:e.action,callbackUrl:e.callbackUrl});return C((await Pa({proxyEndpointDescriptor:n,networkCallDescriptor:t})).body)}{const n=t?.accessToken||s();return C(await x({accessToken:n,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}}({requestSettings:{action:p.SEPA_TRANSFER_CREATE,callbackUrl:n},operationSettings:{stagingToken:i,accessToken:o}});return{...a,url:ac(a.url,t)}},bulkTransfers:{getBulkTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await ec({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.bulkTransfers?.map(Xa),c=F(o.meta);return{bulkTransfers:a,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new R("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return Xa(await tc({accessToken:o,stagingToken:i,bulkTransferId:n}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||V(),u=rc(e),l=new Map;for(const e of u.bulkTransfers){const t=e.beneficiary;if(t){const e=t.iban;e&&!l.has(e)&&l.set(e,{name:t.name,iban:e})}}const d=Array.from(l.values()),p=await nc({sepaPayees:d,accessToken:a,stagingToken:r});if((yield p.requests.map(Qa))===f)return;const g=await async function({bulkTransfers:e,accessToken:t,stagingToken:n,scaSessionToken:r,bankAccountId:i,idempotencyKey:o}){const s={method:"POST",headers:{..._({accessToken:t,stagingToken:n,scaSessionToken:r,idempotencyKey:o})},body:JSON.stringify({bank_account_id:i,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},a=new URL(`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${Za}`),c=await fetch(a,s),u=await c.json();if(!c.ok||u.errors)throw new S({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c});return{bulkTransfer:Xa(g),meta:{idempotencyKey:c}}}}},lc="/v2/transactions";async function dc(e){const t=function({bankAccountId:e,iban:t,status:n,updatedAtFrom:r,updatedAtTo:i,emittedAtFrom:o,emittedAtTo:s,settledAtFrom:a,settledAtTo:c,side:u,operationType:l,withAttachments:d,paginationSettings:f,accessToken:p,stagingToken:g}){const h={method:"GET",headers:{accessToken:p,stagingToken:g}},v=new URLSearchParams;e&&v.append("bank_account_id",e),t&&v.append("iban",t),n&&v.append("status",n),r&&v.append("updated_at_from",r),i&&v.append("updated_at_to",i),o&&v.append("emitted_at_from",o),s&&v.append("emitted_at_to",s),a&&v.append("settled_at_from",a),c&&v.append("settled_at_to",c),u&&v.append("side",u),l&&v.append("operation_type",l),void 0!==d&&v.append("with_attachments",String(d));const m=q(f);for(const[e,t]of m)v.append(e,t);const y=v.toString();return{path:`${lc}${y?`?${y}`:""}`,options:h}}(e),{transactions:n,meta:r}=await I(t);return{transactions:n,meta:r}}async function fc(e){const t=function({transactionId:e,accessToken:t,stagingToken:n}){return{path:`${lc}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}(e),{transaction:n}=await I(t);return n}function pc(e){return{transactionId:e.transaction_id,amount:e.amount,amountCents:e.amount_cents,settledBalance:e.settled_balance,settledBalanceCents:e.settled_balance_cents,attachmentIds:e.attachment_ids,localAmount:e.local_amount,localAmountCents:e.local_amount_cents,side:e.side,operationType:e.operation_type,currency:e.currency,localCurrency:e.local_currency,label:e.label,settledAt:new Date(e.settled_at),emittedAt:new Date(e.emitted_at),updatedAt:new Date(e.updated_at),status:e.status,note:e.note,reference:e.reference,vatAmount:e.vat_amount,vatAmountCents:e.vat_amount_cents,vatRate:e.vat_rate,initiatorId:e.initiator_id,labelIds:e.label_ids,attachmentLost:e.attachment_lost,attachmentRequired:e.attachment_required,cardLastDigits:e.card_last_digits,category:e.category,cashflowCategory:{name:e.cashflow_category?.name||""},cashflowSubcategory:{name:e.cashflow_subcategory?.name||""},id:e.id,subjectType:e.subject_type,...e.transfer?{transfer:{counterpartyAccountNumber:e.transfer.counterparty_account_number,counterpartyName:e.transfer.counterparty_name,counterpartyBic:e.transfer.counterparty_bic,counterpartyIban:e.transfer.counterparty_iban}}:{}}}const gc={getTransactions:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i={...e?.transactionSettings||{},paginationSettings:r},o=t||s(),a=await dc({...i,accessToken:o,stagingToken:n});return{transactions:a.transactions.map(pc),meta:F(a.meta)}},getTransaction:async function({transactionSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r}=t||{},{transactionId:i}=function(e){if(!e)throw new R("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new R("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new R("transactionSettings.transactionId must be a string.");return e}(e),o=n||s();return pc(await fc({transactionId:i,accessToken:o,stagingToken:r}))}};e.authLinks=j,e.beneficiaries=ie,e.cards=xa,e.organizations=Ra,e.paymentLinks=Ba,e.sepaTransfers=uc,e.transactions=gc}));