@qonto/embed-sdk 0.67.0 → 0.68.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 (70) hide show
  1. package/dist/cards/client/cards.client.d.ts.map +1 -1
  2. package/dist/common/common.types.d.ts +0 -1
  3. package/dist/common/common.types.d.ts.map +1 -1
  4. package/dist/common/common.utils.d.ts +3 -4
  5. package/dist/common/common.utils.d.ts.map +1 -1
  6. package/dist/common/initialize/initialize.validate.d.ts.map +1 -1
  7. package/dist/common/operation-settings/operation-settings.d.ts +0 -2
  8. package/dist/common/operation-settings/operation-settings.d.ts.map +1 -1
  9. package/dist/index.umd.js +5 -5
  10. package/dist/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
  11. package/dist/sepa-transfers/bulk-transfers/index.d.ts +1 -1
  12. package/dist/sepa-transfers/shared/sepa-transfers.api.d.ts +3 -3
  13. package/dist/server/_virtual/index.js +1 -1
  14. package/dist/server/_virtual/index2.js +1 -1
  15. package/dist/server/cards/client/cards.client.d.ts.map +1 -1
  16. package/dist/server/common/common.types.d.ts +0 -1
  17. package/dist/server/common/common.types.d.ts.map +1 -1
  18. package/dist/server/common/common.utils.d.ts +3 -4
  19. package/dist/server/common/common.utils.d.ts.map +1 -1
  20. package/dist/server/common/initialize/initialize.validate.d.ts.map +1 -1
  21. package/dist/server/common/operation-settings/operation-settings.d.ts +0 -2
  22. package/dist/server/common/operation-settings/operation-settings.d.ts.map +1 -1
  23. package/dist/server/index.server.umd.js +1 -1
  24. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -1
  25. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +1 -1
  26. 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 -1
  27. 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 -1
  28. 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 -1
  29. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -1
  30. 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 -1
  31. package/dist/server/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
  32. package/dist/server/sepa-transfers/bulk-transfers/index.d.ts +1 -1
  33. package/dist/server/sepa-transfers/shared/sepa-transfers.api.d.ts +3 -3
  34. package/dist/server/src/common/common.utils.js +1 -1
  35. package/dist/server/src/common/operation-settings/operation-settings.js +1 -1
  36. package/dist/server/src/errors/AuthenticationError.js +1 -1
  37. package/dist/server/src/validation/operation-settings-validation.js +1 -1
  38. package/dist/server/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.d.ts.map +1 -1
  39. package/dist/server/ui/ui-elements/sepa-transfer-creation/create-sepa-transfer-creation-element.d.ts +1 -1
  40. package/dist/server/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.d.ts.map +1 -1
  41. package/dist/server/ui/ui-elements/transaction-list/create-transaction-list-element.d.ts +1 -1
  42. package/dist/server/ui/ui-elements/transaction-list/transaction-list.d.ts.map +1 -1
  43. package/dist/server/ui/ui-elements/transfer-list/create-transfer-list-element.d.ts +1 -1
  44. package/dist/server/ui/ui-elements.types.d.ts +2 -3
  45. package/dist/server/ui/ui-elements.types.d.ts.map +1 -1
  46. package/dist/server/validation/operation-settings-validation.d.ts +8 -45
  47. package/dist/server/validation/operation-settings-validation.d.ts.map +1 -1
  48. package/dist/src/cards/client/cards.client.js +1 -1
  49. package/dist/src/common/common.utils.js +1 -1
  50. package/dist/src/common/initialize/initialize.validate.js +1 -1
  51. package/dist/src/common/operation-settings/operation-settings.js +1 -1
  52. package/dist/src/errors/AuthenticationError.js +1 -1
  53. package/dist/src/sepa-transfers/client/sepa-transfers.client.js +1 -1
  54. package/dist/src/sepa-transfers/shared/sepa-transfers.utils.js +1 -1
  55. package/dist/src/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js +1 -1
  56. package/dist/src/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.js +7 -7
  57. package/dist/src/ui/ui-elements/transaction-list/transaction-list.js +4 -4
  58. package/dist/src/validation/operation-settings-validation.js +1 -1
  59. package/dist/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.d.ts.map +1 -1
  60. package/dist/ui/ui-elements/sepa-transfer-creation/create-sepa-transfer-creation-element.d.ts +1 -1
  61. package/dist/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.d.ts.map +1 -1
  62. package/dist/ui/ui-elements/transaction-list/create-transaction-list-element.d.ts +1 -1
  63. package/dist/ui/ui-elements/transaction-list/transaction-list.d.ts.map +1 -1
  64. package/dist/ui/ui-elements/transfer-list/create-transfer-list-element.d.ts +1 -1
  65. package/dist/ui/ui-elements.types.d.ts +2 -3
  66. package/dist/ui/ui-elements.types.d.ts.map +1 -1
  67. package/dist/validation/operation-settings-validation.d.ts +8 -45
  68. package/dist/validation/operation-settings-validation.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/dist/server/src/errors/EmbedOperationError.js +0 -1
@@ -1 +1 @@
1
- import{__values as r}from"../../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import n from"../../../../../../../../../_virtual/index.js";function e(r,e){return new n((function(n){r.subscribe({next:function(r){e(r).then((function(r){return n.next(r)})).catch((function(r){return n.error(r)}))},error:function(r){n.error(r)},complete:function(){n.complete()}})}))}function t(e,t){return new n((function(n){var l=!1,o=new Set,u=function(){var n,e;l=!0;try{for(var t=r(o),u=t.next();!u.done;u=t.next()){var c=u.value;try{c.unsubscribe()}catch(r){}}}catch(r){n={error:r}}finally{try{u&&!u.done&&(e=t.return)&&e.call(t)}finally{if(n)throw n.error}}o.clear()},c=function(r){var e=r.subscribe({next:function(r){l||n.next(r)},error:function(r){l||(l=!0,n.error(r),u())},complete:function(){o.delete(e),l||0!==o.size||(n.complete(),u(),l=!0)}});o.add(e)};return c(e),c(t),u}))}function l(e){var t=new Set,l=null;function o(){null==l||l.unsubscribe(),l=null,t.clear()}return new n((function(n){return t.add(n),null===l&&(l=e.subscribe({next:function(n){var e,l,o;try{for(var u=r(t),c=u.next();!c.done;c=u.next()){var i=c.value;null===(o=i.next)||void 0===o||o.call(i,n)}}catch(r){e={error:r}}finally{try{c&&!c.done&&(l=u.return)&&l.call(u)}finally{if(e)throw e.error}}},error:function(n){var e,l,u;try{for(var c=r(t),i=c.next();!i.done;i=c.next()){var a=i.value;null===(u=a.error)||void 0===u||u.call(a,n)}}catch(r){e={error:r}}finally{try{i&&!i.done&&(l=c.return)&&l.call(c)}finally{if(e)throw e.error}}o()},complete:function(){var n,e,l;try{for(var u=r(t),c=u.next();!c.done;c=u.next()){var i=c.value;null===(l=i.complete)||void 0===l||l.call(i)}}catch(r){n={error:r}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(n)throw n.error}}o()}})),function(){t.delete(n),0===t.size&&l&&(l.unsubscribe(),l=null)}}))}export{n as Observable,e as asyncMap,t as merge,l as multicast};
1
+ import{__values as r}from"../../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import n from"../../../../../../../../../_virtual/index2.js";function e(r,e){return new n((function(n){r.subscribe({next:function(r){e(r).then((function(r){return n.next(r)})).catch((function(r){return n.error(r)}))},error:function(r){n.error(r)},complete:function(){n.complete()}})}))}function t(e,t){return new n((function(n){var l=!1,o=new Set,u=function(){var n,e;l=!0;try{for(var t=r(o),u=t.next();!u.done;u=t.next()){var c=u.value;try{c.unsubscribe()}catch(r){}}}catch(r){n={error:r}}finally{try{u&&!u.done&&(e=t.return)&&e.call(t)}finally{if(n)throw n.error}}o.clear()},c=function(r){var e=r.subscribe({next:function(r){l||n.next(r)},error:function(r){l||(l=!0,n.error(r),u())},complete:function(){o.delete(e),l||0!==o.size||(n.complete(),u(),l=!0)}});o.add(e)};return c(e),c(t),u}))}function l(e){var t=new Set,l=null;function o(){null==l||l.unsubscribe(),l=null,t.clear()}return new n((function(n){return t.add(n),null===l&&(l=e.subscribe({next:function(n){var e,l,o;try{for(var u=r(t),c=u.next();!c.done;c=u.next()){var i=c.value;null===(o=i.next)||void 0===o||o.call(i,n)}}catch(r){e={error:r}}finally{try{c&&!c.done&&(l=u.return)&&l.call(u)}finally{if(e)throw e.error}}},error:function(n){var e,l,u;try{for(var c=r(t),i=c.next();!i.done;i=c.next()){var a=i.value;null===(u=a.error)||void 0===u||u.call(a,n)}}catch(r){e={error:r}}finally{try{i&&!i.done&&(l=c.return)&&l.call(c)}finally{if(e)throw e.error}}o()},complete:function(){var n,e,l;try{for(var u=r(t),c=u.next();!c.done;c=u.next()){var i=c.value;null===(l=i.complete)||void 0===l||l.call(i)}}catch(r){n={error:r}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(n)throw n.error}}o()}})),function(){t.delete(n),0===t.size&&l&&(l.unsubscribe(),l=null)}}))}export{n as Observable,e as asyncMap,t as merge,l as multicast};
@@ -1 +1 @@
1
- import*as r from"../../../../../../../../../_virtual/index2.js";import i from"../../../../../../../../../_virtual/index2.js";var o=i||r;export{o as safeJsonStringify};
1
+ import*as r from"../../../../../../../../../_virtual/index.js";import i from"../../../../../../../../../_virtual/index.js";var o=i||r;export{o as safeJsonStringify};
@@ -1 +1 @@
1
- import{AMPLITUDE_THRASHED_CURSOR_EVENT as e}from"../constants.js";import{isUrlAllowed as n}from"../helpers.js";import t from"../../../../../../../../../_virtual/index.js";import"../../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";var r,i;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(r||(r={})),function(e){e.X="x",e.Y="y"}(i||(i={}));var s=function(e){var n=e.allWindowObservables.mouseMoveObservable;return new t((function(e){var t=null,s=null,o=null;return n.subscribe((function(n){var l={x:n.clientX,y:n.clientY};null!==t?(l.x>t.x?(s===r.DECREASING&&e.next(i.X),s=r.INCREASING):l.x<t.x&&(s===r.INCREASING&&e.next(i.X),s=r.DECREASING),l.y>t.y?(o===r.DECREASING&&e.next(i.Y),o=r.INCREASING):l.y<t.y&&(o===r.INCREASING&&e.next(i.Y),o=r.DECREASING),t=l):t=l}))}))};function o(e){var n=e.changes,t=e.changesThreshold,r=e.thresholdMs;return!(n.length<t)&&n[n.length-1]-n[0]<r}function l(e){e.changes=[],e.startTime=void 0}function a(e){for(var n=e.changes,t=e.thresholdMs,r=0,i=n[n.length-1];r<n.length;r++){if(i-n[r]<t)break}0!==r&&(e.startTime=n[r],e.changes.splice(0,r))}var u=function(e){var n=e.mouseDirectionChangeObservable,r=e.directionChanges,s=void 0===r?20:r,u=e.thresholdMs,c=void 0===u?2e3:u;return new t((function(e){var t={changes:[],changesThreshold:s,thresholdMs:c},r={changes:[],changesThreshold:s,thresholdMs:c},u=void 0,h=null;function v(){void 0!==u&&(e.next(u),u=void 0,null!==h&&clearTimeout(h),l(t),l(r))}return n.subscribe((function(e){null!==h&&clearTimeout(h),function(e){var n=+Date.now();e.startTime=e.startTime||n;var t=e.changes,r=e.changesThreshold;t.push(n),t.length>r&&t.shift()}(e===i.X?t:r);var n=function(e,n){var t=void 0;if(o(e)&&(t=e.startTime),o(n)){var r=n.startTime;r&&(!t||r<t)&&(t=r)}return t}(t,r);return n?(u=u||n,h=setTimeout((function(){v(),h=null}),c)):v(),a(t),a(r),function(){null!==h&&(clearTimeout(h),h=null)}}))}))},c=function(t){var r=t.amplitude,i=t.options,o=t.allObservables,l=t.directionChanges,a=void 0===l?20:l,c=t.thresholdMs,h=void 0===c?2e3:c,v=s({allWindowObservables:o});return u({mouseDirectionChangeObservable:v,directionChanges:a,thresholdMs:h}).subscribe((function(t){n(i)&&r.track(e,void 0,{time:t})}))};export{s as createMouseDirectionChangeObservable,u as createThrashedCursorObservable,c as trackThrashedCursor};
1
+ import{AMPLITUDE_THRASHED_CURSOR_EVENT as e}from"../constants.js";import{isUrlAllowed as n}from"../helpers.js";import t from"../../../../../../../../../_virtual/index2.js";import"../../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";var r,i;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(r||(r={})),function(e){e.X="x",e.Y="y"}(i||(i={}));var s=function(e){var n=e.allWindowObservables.mouseMoveObservable;return new t((function(e){var t=null,s=null,o=null;return n.subscribe((function(n){var l={x:n.clientX,y:n.clientY};null!==t?(l.x>t.x?(s===r.DECREASING&&e.next(i.X),s=r.INCREASING):l.x<t.x&&(s===r.INCREASING&&e.next(i.X),s=r.DECREASING),l.y>t.y?(o===r.DECREASING&&e.next(i.Y),o=r.INCREASING):l.y<t.y&&(o===r.INCREASING&&e.next(i.Y),o=r.DECREASING),t=l):t=l}))}))};function o(e){var n=e.changes,t=e.changesThreshold,r=e.thresholdMs;return!(n.length<t)&&n[n.length-1]-n[0]<r}function l(e){e.changes=[],e.startTime=void 0}function a(e){for(var n=e.changes,t=e.thresholdMs,r=0,i=n[n.length-1];r<n.length;r++){if(i-n[r]<t)break}0!==r&&(e.startTime=n[r],e.changes.splice(0,r))}var u=function(e){var n=e.mouseDirectionChangeObservable,r=e.directionChanges,s=void 0===r?20:r,u=e.thresholdMs,c=void 0===u?2e3:u;return new t((function(e){var t={changes:[],changesThreshold:s,thresholdMs:c},r={changes:[],changesThreshold:s,thresholdMs:c},u=void 0,h=null;function v(){void 0!==u&&(e.next(u),u=void 0,null!==h&&clearTimeout(h),l(t),l(r))}return n.subscribe((function(e){null!==h&&clearTimeout(h),function(e){var n=+Date.now();e.startTime=e.startTime||n;var t=e.changes,r=e.changesThreshold;t.push(n),t.length>r&&t.shift()}(e===i.X?t:r);var n=function(e,n){var t=void 0;if(o(e)&&(t=e.startTime),o(n)){var r=n.startTime;r&&(!t||r<t)&&(t=r)}return t}(t,r);return n?(u=u||n,h=setTimeout((function(){v(),h=null}),c)):v(),a(t),a(r),function(){null!==h&&(clearTimeout(h),h=null)}}))}))},c=function(t){var r=t.amplitude,i=t.options,o=t.allObservables,l=t.directionChanges,a=void 0===l?20:l,c=t.thresholdMs,h=void 0===c?2e3:c,v=s({allWindowObservables:o});return u({mouseDirectionChangeObservable:v,directionChanges:a,thresholdMs:h}).subscribe((function(t){n(i)&&r.track(e,void 0,{time:t})}))};export{s as createMouseDirectionChangeObservable,u as createThrashedCursorObservable,c as trackThrashedCursor};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as o,__values as r,__read as n,__spreadArray as i}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{VERSION as l}from"./version.js";import{PLUGIN_NAME as s}from"./constants.js";import{createShouldTrackEvent as a}from"./helpers.js";import{enableVisualTagging as u}from"./libs/messenger.js";import{trackClicks as c}from"./autocapture/track-click.js";import{trackChange as d}from"./autocapture/track-change.js";import{trackActionClick as p}from"./autocapture/track-action-click.js";import{trackScroll as v}from"./autocapture/track-scroll.js";import{createClickObservable as b,createMutationObservable as m,createScrollObservable as f,createExposureObservable as g}from"./observables.js";import{groupLabeledEventIdsByEventType as h,createLabeledEventToTriggerMap as w,createTriggerEvaluator as E}from"./pageActions/triggers.js";import{DataExtractor as y}from"./data-extractor.js";import{trackExposure as x}from"./autocapture/track-exposure.js";import{fireViewportContentUpdated as O,onExposure as A}from"./autocapture/track-viewport-content-updated.js";import{DEFAULT_CSS_SELECTOR_ALLOWLIST as k,DEFAULT_ACTION_CLICK_ALLOWLIST as j,DEFAULT_EXPOSURE_DURATION as S,DEFAULT_DATA_ATTRIBUTE_PREFIX as C}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js";import{getOrCreateWindowMessenger as _}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js";import{enableBackgroundCapture as P}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js";import{getGlobalScope as T}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js";import{multicast as L}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import D from"../../../../../../../../_virtual/index.js";import{AMPLITUDE_ORIGINS_MAP as M}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js";var U;!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"}(U||(U={}));var R=function(R,N){var Z,B,F,I,K,X,Y,q,z,G,H;void 0===R&&(R={}),null==N||N.diagnosticsClient.setTag("plugin.autocapture.version",l);var J=R.dataAttributePrefix,Q=void 0===J?C:J,V=R.visualTaggingOptions,W=void 0===V?{enabled:!0}:V;R.cssSelectorAllowlist=null!==(Z=R.cssSelectorAllowlist)&&void 0!==Z?Z:k,R.actionClickAllowlist=null!==(B=R.actionClickAllowlist)&&void 0!==B?B:j,R.debounceTime=null!==(F=R.debounceTime)&&void 0!==F?F:0;var $=null!==(X=null!==(K=null===(I=R.viewportContentUpdated)||void 0===I?void 0:I.exposureDuration)&&void 0!==K?K:R.exposureDuration)&&void 0!==X?X:S;R.viewportContentUpdated=e(e({},R.viewportContentUpdated),{exposureDuration:$}),R.pageUrlExcludelist=null===(Y=R.pageUrlExcludelist)||void 0===Y?void 0:Y.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(o){return console.warn("Invalid regex pattern: ".concat(t.pattern),o),e}return e}),[]);var ee,te=s,oe=[],re=new y(R,N),ne=new Set,ie=new Set,le=h(Object.values(null!==(z=null===(q=R.pageActions)||void 0===q?void 0:q.labeledEvents)&&void 0!==z?z:{})),se=w(null!==(H=null===(G=R.pageActions)||void 0===G?void 0:G.triggers)&&void 0!==H?H:[]),ae=E(le,se,re,R);return{name:te,type:"enrichment",setup:function(r,l){return t(void 0,void 0,void 0,(function(){var t,s,E,y,k,j,S,C,N,Z,B,F,I,K,X,Y,q,z,G,H,J;return o(this,(function(o){return"undefined"==typeof document||(t=!1,s={maxX:void 0,maxY:void 0},r.fetchRemoteConfig&&(r.remoteConfigClient?r.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var o,r;t&&(R.pageActions=e(e({},R.pageActions),t),le=h(Object.values(null!==(o=R.pageActions.labeledEvents)&&void 0!==o?o:{})),se=w(null!==(r=R.pageActions.triggers)&&void 0!==r?r:[]),ae.update(le,se,R))}(t)})):r.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),E=a(R,R.cssSelectorAllowlist),y=a(R,R.actionClickAllowlist),k=function(){var e,t,o=L(b().map((function(e){return re.addAdditionalEventProperties(e,"click",R.cssSelectorAllowlist,Q)}))),r=L(new D((function(e){var t,o=function(t){var o=re.addAdditionalEventProperties(t,"change",R.cssSelectorAllowlist,Q);e.next(o)};return null===(t=T())||void 0===t||t.document.addEventListener("change",o,{capture:!0}),function(){var e;return null===(e=T())||void 0===e?void 0:e.document.removeEventListener("change",o)}})));window.navigation&&(t=L(new D((function(e){var t=function(t){var o=re.addAdditionalEventProperties(t,"navigate",R.cssSelectorAllowlist,Q);e.next(o)};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}))));var n=L(m().map((function(e){return re.addAdditionalEventProperties(e,"mutation",R.cssSelectorAllowlist,Q)}))),i=f(),l=g(n,R.cssSelectorAllowlist);return(e={})[U.ChangeObservable]=r,e[U.ClickObservable]=o,e[U.MutationObservable]=n,e[U.NavigateObservable]=t,e[U.ScrollObservable]=i,e[U.ExposureObservable]=l,e}(),j=c({allObservables:k,amplitude:l,shouldTrackEvent:E,evaluateTriggers:ae.evaluate.bind(ae)}),oe.push(j),S=d({allObservables:k,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return re.getEventProperties.apply(re,i(i([],n(e),!1),[Q],!1))},amplitude:l,shouldTrackEvent:E,evaluateTriggers:ae.evaluate.bind(ae)}),oe.push(S),C=p({allObservables:k,options:R,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return re.getEventProperties.apply(re,i(i([],n(e),!1),[Q],!1))},amplitude:l,shouldTrackEvent:E,shouldTrackActionClick:y}),C&&oe.push(C),N=v({allObservables:k}),oe.push(N),Z={},B=T(),F=function(e){e&&t||(setTimeout((function(){t=!1}),100),t=!0,O({amplitude:l,scrollTracker:N,currentElementExposed:ie,elementExposedForPage:ne,exposureTracker:Z.exposure,isPageEnd:e,lastScroll:s}))},I=function(e){A(e,ne,ie,F)},Z.exposure=x({allObservables:k,onExposure:I,dataExtractor:re,exposureDuration:$}),Z.exposure&&oe.push(Z.exposure),K=function(){F(!0)},null==B||B.addEventListener("beforeunload",K),ee=function(){null==B||B.removeEventListener("beforeunload",K)},oe.push({unsubscribe:function(){return ee()}}),(X=k[U.NavigateObservable])?oe.push(X.subscribe((function(){F(!0)}))):B&&(Y=function(){F(!0)},B.addEventListener("popstate",Y),q=B.history.pushState,B.history&&q&&(B.history.pushState=new Proxy(q,{apply:function(e,t,o){var r=n(o,3),i=r[0],l=r[1],s=r[2];e.apply(t,[i,l,s]),F(!0)}})),oe.push({unsubscribe:function(){B.removeEventListener("popstate",Y),B.history&&q&&(B.history.pushState=q)}})),null===(J=null==r?void 0:r.loggerProvider)||void 0===J||J.log("".concat(te," has been successfully added.")),window.opener&&W.enabled&&(z=R.cssSelectorAllowlist,G=R.actionClickAllowlist,H=_(),u(H,{dataExtractor:re,isElementSelectable:a(R,i(i([],n(z),!1),n(G),!1)),cssSelectorAllowlist:z,actionClickAllowlist:G}),P(H),H.setup(e({logger:null==r?void 0:r.loggerProvider},(null==r?void 0:r.serverZone)&&{endpoint:M[r.serverZone]})))),[2]}))}))},execute:function(e){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,e]}))}))},teardown:function(){return t(void 0,void 0,void 0,(function(){var e,t,n,i;return o(this,(function(o){try{for(e=r(oe),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]}))}))}}};export{U as ObservablesEnum,R as autocapturePlugin};
1
+ import{__assign as e,__awaiter as t,__generator as o,__values as r,__read as n,__spreadArray as i}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{VERSION as l}from"./version.js";import{PLUGIN_NAME as s}from"./constants.js";import{createShouldTrackEvent as a}from"./helpers.js";import{enableVisualTagging as u}from"./libs/messenger.js";import{trackClicks as c}from"./autocapture/track-click.js";import{trackChange as d}from"./autocapture/track-change.js";import{trackActionClick as p}from"./autocapture/track-action-click.js";import{trackScroll as v}from"./autocapture/track-scroll.js";import{createClickObservable as b,createMutationObservable as m,createScrollObservable as f,createExposureObservable as g}from"./observables.js";import{groupLabeledEventIdsByEventType as h,createLabeledEventToTriggerMap as w,createTriggerEvaluator as E}from"./pageActions/triggers.js";import{DataExtractor as y}from"./data-extractor.js";import{trackExposure as x}from"./autocapture/track-exposure.js";import{fireViewportContentUpdated as O,onExposure as A}from"./autocapture/track-viewport-content-updated.js";import{DEFAULT_CSS_SELECTOR_ALLOWLIST as k,DEFAULT_ACTION_CLICK_ALLOWLIST as j,DEFAULT_EXPOSURE_DURATION as S,DEFAULT_DATA_ATTRIBUTE_PREFIX as C}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js";import{getOrCreateWindowMessenger as _}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js";import{enableBackgroundCapture as P}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js";import{getGlobalScope as T}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js";import{multicast as L}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import D from"../../../../../../../../_virtual/index2.js";import{AMPLITUDE_ORIGINS_MAP as M}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js";var U;!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"}(U||(U={}));var R=function(R,N){var Z,B,F,I,K,X,Y,q,z,G,H;void 0===R&&(R={}),null==N||N.diagnosticsClient.setTag("plugin.autocapture.version",l);var J=R.dataAttributePrefix,Q=void 0===J?C:J,V=R.visualTaggingOptions,W=void 0===V?{enabled:!0}:V;R.cssSelectorAllowlist=null!==(Z=R.cssSelectorAllowlist)&&void 0!==Z?Z:k,R.actionClickAllowlist=null!==(B=R.actionClickAllowlist)&&void 0!==B?B:j,R.debounceTime=null!==(F=R.debounceTime)&&void 0!==F?F:0;var $=null!==(X=null!==(K=null===(I=R.viewportContentUpdated)||void 0===I?void 0:I.exposureDuration)&&void 0!==K?K:R.exposureDuration)&&void 0!==X?X:S;R.viewportContentUpdated=e(e({},R.viewportContentUpdated),{exposureDuration:$}),R.pageUrlExcludelist=null===(Y=R.pageUrlExcludelist)||void 0===Y?void 0:Y.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(o){return console.warn("Invalid regex pattern: ".concat(t.pattern),o),e}return e}),[]);var ee,te=s,oe=[],re=new y(R,N),ne=new Set,ie=new Set,le=h(Object.values(null!==(z=null===(q=R.pageActions)||void 0===q?void 0:q.labeledEvents)&&void 0!==z?z:{})),se=w(null!==(H=null===(G=R.pageActions)||void 0===G?void 0:G.triggers)&&void 0!==H?H:[]),ae=E(le,se,re,R);return{name:te,type:"enrichment",setup:function(r,l){return t(void 0,void 0,void 0,(function(){var t,s,E,y,k,j,S,C,N,Z,B,F,I,K,X,Y,q,z,G,H,J;return o(this,(function(o){return"undefined"==typeof document||(t=!1,s={maxX:void 0,maxY:void 0},r.fetchRemoteConfig&&(r.remoteConfigClient?r.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var o,r;t&&(R.pageActions=e(e({},R.pageActions),t),le=h(Object.values(null!==(o=R.pageActions.labeledEvents)&&void 0!==o?o:{})),se=w(null!==(r=R.pageActions.triggers)&&void 0!==r?r:[]),ae.update(le,se,R))}(t)})):r.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),E=a(R,R.cssSelectorAllowlist),y=a(R,R.actionClickAllowlist),k=function(){var e,t,o=L(b().map((function(e){return re.addAdditionalEventProperties(e,"click",R.cssSelectorAllowlist,Q)}))),r=L(new D((function(e){var t,o=function(t){var o=re.addAdditionalEventProperties(t,"change",R.cssSelectorAllowlist,Q);e.next(o)};return null===(t=T())||void 0===t||t.document.addEventListener("change",o,{capture:!0}),function(){var e;return null===(e=T())||void 0===e?void 0:e.document.removeEventListener("change",o)}})));window.navigation&&(t=L(new D((function(e){var t=function(t){var o=re.addAdditionalEventProperties(t,"navigate",R.cssSelectorAllowlist,Q);e.next(o)};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}))));var n=L(m().map((function(e){return re.addAdditionalEventProperties(e,"mutation",R.cssSelectorAllowlist,Q)}))),i=f(),l=g(n,R.cssSelectorAllowlist);return(e={})[U.ChangeObservable]=r,e[U.ClickObservable]=o,e[U.MutationObservable]=n,e[U.NavigateObservable]=t,e[U.ScrollObservable]=i,e[U.ExposureObservable]=l,e}(),j=c({allObservables:k,amplitude:l,shouldTrackEvent:E,evaluateTriggers:ae.evaluate.bind(ae)}),oe.push(j),S=d({allObservables:k,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return re.getEventProperties.apply(re,i(i([],n(e),!1),[Q],!1))},amplitude:l,shouldTrackEvent:E,evaluateTriggers:ae.evaluate.bind(ae)}),oe.push(S),C=p({allObservables:k,options:R,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return re.getEventProperties.apply(re,i(i([],n(e),!1),[Q],!1))},amplitude:l,shouldTrackEvent:E,shouldTrackActionClick:y}),C&&oe.push(C),N=v({allObservables:k}),oe.push(N),Z={},B=T(),F=function(e){e&&t||(setTimeout((function(){t=!1}),100),t=!0,O({amplitude:l,scrollTracker:N,currentElementExposed:ie,elementExposedForPage:ne,exposureTracker:Z.exposure,isPageEnd:e,lastScroll:s}))},I=function(e){A(e,ne,ie,F)},Z.exposure=x({allObservables:k,onExposure:I,dataExtractor:re,exposureDuration:$}),Z.exposure&&oe.push(Z.exposure),K=function(){F(!0)},null==B||B.addEventListener("beforeunload",K),ee=function(){null==B||B.removeEventListener("beforeunload",K)},oe.push({unsubscribe:function(){return ee()}}),(X=k[U.NavigateObservable])?oe.push(X.subscribe((function(){F(!0)}))):B&&(Y=function(){F(!0)},B.addEventListener("popstate",Y),q=B.history.pushState,B.history&&q&&(B.history.pushState=new Proxy(q,{apply:function(e,t,o){var r=n(o,3),i=r[0],l=r[1],s=r[2];e.apply(t,[i,l,s]),F(!0)}})),oe.push({unsubscribe:function(){B.removeEventListener("popstate",Y),B.history&&q&&(B.history.pushState=q)}})),null===(J=null==r?void 0:r.loggerProvider)||void 0===J||J.log("".concat(te," has been successfully added.")),window.opener&&W.enabled&&(z=R.cssSelectorAllowlist,G=R.actionClickAllowlist,H=_(),u(H,{dataExtractor:re,isElementSelectable:a(R,i(i([],n(z),!1),n(G),!1)),cssSelectorAllowlist:z,actionClickAllowlist:G}),P(H),H.setup(e({logger:null==r?void 0:r.loggerProvider},(null==r?void 0:r.serverZone)&&{endpoint:M[r.serverZone]})))),[2]}))}))},execute:function(e){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,e]}))}))},teardown:function(){return t(void 0,void 0,void 0,(function(){var e,t,n,i;return o(this,(function(o){try{for(e=r(oe),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]}))}))}}};export{U as ObservablesEnum,R as autocapturePlugin};
@@ -1 +1 @@
1
- import{__spreadArray as e,__read as r,__awaiter as t,__generator as o,__values as n,__assign as i}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{FRUSTRATION_PLUGIN_NAME as a}from"./constants.js";import{createShouldTrackEvent as s}from"./helpers.js";import{trackDeadClick as l}from"./autocapture/track-dead-click.js";import{trackRageClicks as c}from"./autocapture/track-rage-click.js";import{ObservablesEnum as u}from"./autocapture-plugin.js";import{createClickObservable as d,createErrorObservable as m,createMutationObservable as v,createMouseMoveObservable as p}from"./observables.js";import{DataExtractor as f}from"./data-extractor.js";import{trackErrorClicks as h}from"./autocapture/track-error-click.js";import{trackThrashedCursor as b}from"./autocapture/track-thrashed-cursor.js";import{DEFAULT_DATA_ATTRIBUTE_PREFIX as g}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js";import{DEFAULT_RAGE_CLICK_ALLOWLIST as w,DEFAULT_DEAD_CLICK_ALLOWLIST as C,DEFAULT_ERROR_CLICK_ALLOWLIST as k}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js";import{multicast as y}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import j from"../../../../../../../../_virtual/index.js";function E(e,r,t,o){if(!o)return[];var n=e[r];return"object"==typeof n&&null!==n&&"cssSelectorAllowlist"in n&&Array.isArray(n.cssSelectorAllowlist)?n.cssSelectorAllowlist:t}var A=4e3,_=function(_){var x;void 0===_&&(_={});var O=a,P=[],T=!1!==_.errorClicks;_.errorClicks||(T=!1);var S=!1!==_.deadClicks&&null!==_.deadClicks,L=!1!==_.rageClicks&&null!==_.rageClicks,M=!1!==_.thrashedCursor&&null!==_.thrashedCursor;_.thrashedCursor||(M=!1);var N=E(_,"rageClicks",w,L),R=E(_,"deadClicks",C,S),B=E(_,"errorClicks",k,T),D=null!==(x=_.dataAttributePrefix)&&void 0!==x?x:g,I=new f(_),U=e([],r(new Set(e(e(e([],r(N),!1),r(R),!1),r(B),!1))),!1);return{name:O,type:"enrichment",setup:function(e,r){return t(void 0,void 0,void 0,(function(){var t,n,a,f,g,w,C,k,E,x,X;return o(this,(function(o){return"undefined"==typeof document||(t=function(){var e,r,t=y(d("pointerdown").map((function(e){return I.addAdditionalEventProperties(e,"click",U,D,!0)}))),o=y(m().map((function(e){return I.addTypeAndTimestamp(e,"error")}))),n=y(v().map((function(e){return I.addAdditionalEventProperties(e,"mutation",U,D)})));if(window.navigation){var a=new j((function(e){var r=function(r){e.next(i(i({},r),{type:"navigate"}))};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}));r=y(a.map((function(e){return I.addAdditionalEventProperties(e,"navigate",U,D)})))}var s=y(new j((function(e){var r=function(){var r=document.activeElement;if(r&&("TEXTAREA"===r.tagName||"INPUT"===r.tagName)){try{if(r.selectionStart===r.selectionEnd)return}catch(e){return}return e.next()}var t=window.getSelection();if(t&&!t.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",r),function(){window.document.removeEventListener("selectionchange",r)}}))),l=y(p());return(e={})[u.ClickObservable]=t,e[u.MutationObservable]=n,e[u.NavigateObservable]=r,e[u.BrowserErrorObservable]=o,e[u.SelectionObservable]=s,e[u.MouseMoveObservable]=l,e}(),L&&(n=s(_,N),a=c({allObservables:t,amplitude:r,shouldTrackRageClick:n}),P.push(a)),S&&(f=s(_,R),g=l({amplitude:r,allObservables:t,getEventProperties:function(e,r){return I.getEventProperties(e,r,D)},shouldTrackDeadClick:f}),P.push(g)),T&&(w=s(_,B),C=h({amplitude:r,allObservables:t,shouldTrackErrorClick:w}),P.push(C)),M&&(k=void 0,E=void 0,"object"==typeof _.thrashedCursor&&(k=_.thrashedCursor.directionChanges,E=_.thrashedCursor.threshold,k&&k<5&&(e.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),E&&E>A&&(e.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(E," is above the maximum of ").concat(A,", setting to ").concat(A)),E=A)),x=b({amplitude:r,options:_,allObservables:t,directionChanges:k,thresholdMs:E}),P.push(x)),null===(X=null==e?void 0:e.loggerProvider)||void 0===X||X.log("".concat(O," has been successfully added."))),[2]}))}))},execute:function(e){return t(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,e]}))}))},teardown:function(){return t(void 0,void 0,void 0,(function(){var e,r,t,i;return o(this,(function(o){try{for(e=n(P),r=e.next();!r.done;r=e.next())r.value.unsubscribe()}catch(e){t={error:e}}finally{try{r&&!r.done&&(i=e.return)&&i.call(e)}finally{if(t)throw t.error}}return[2]}))}))}}};export{_ as frustrationPlugin};
1
+ import{__spreadArray as e,__read as r,__awaiter as t,__generator as o,__values as n,__assign as i}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{FRUSTRATION_PLUGIN_NAME as a}from"./constants.js";import{createShouldTrackEvent as s}from"./helpers.js";import{trackDeadClick as l}from"./autocapture/track-dead-click.js";import{trackRageClicks as c}from"./autocapture/track-rage-click.js";import{ObservablesEnum as u}from"./autocapture-plugin.js";import{createClickObservable as d,createErrorObservable as m,createMutationObservable as v,createMouseMoveObservable as p}from"./observables.js";import{DataExtractor as f}from"./data-extractor.js";import{trackErrorClicks as h}from"./autocapture/track-error-click.js";import{trackThrashedCursor as b}from"./autocapture/track-thrashed-cursor.js";import{DEFAULT_DATA_ATTRIBUTE_PREFIX as g}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js";import{DEFAULT_RAGE_CLICK_ALLOWLIST as w,DEFAULT_DEAD_CLICK_ALLOWLIST as C,DEFAULT_ERROR_CLICK_ALLOWLIST as k}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js";import{multicast as y}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import j from"../../../../../../../../_virtual/index2.js";function E(e,r,t,o){if(!o)return[];var n=e[r];return"object"==typeof n&&null!==n&&"cssSelectorAllowlist"in n&&Array.isArray(n.cssSelectorAllowlist)?n.cssSelectorAllowlist:t}var A=4e3,_=function(_){var x;void 0===_&&(_={});var O=a,P=[],T=!1!==_.errorClicks;_.errorClicks||(T=!1);var S=!1!==_.deadClicks&&null!==_.deadClicks,L=!1!==_.rageClicks&&null!==_.rageClicks,M=!1!==_.thrashedCursor&&null!==_.thrashedCursor;_.thrashedCursor||(M=!1);var N=E(_,"rageClicks",w,L),R=E(_,"deadClicks",C,S),B=E(_,"errorClicks",k,T),D=null!==(x=_.dataAttributePrefix)&&void 0!==x?x:g,I=new f(_),U=e([],r(new Set(e(e(e([],r(N),!1),r(R),!1),r(B),!1))),!1);return{name:O,type:"enrichment",setup:function(e,r){return t(void 0,void 0,void 0,(function(){var t,n,a,f,g,w,C,k,E,x,X;return o(this,(function(o){return"undefined"==typeof document||(t=function(){var e,r,t=y(d("pointerdown").map((function(e){return I.addAdditionalEventProperties(e,"click",U,D,!0)}))),o=y(m().map((function(e){return I.addTypeAndTimestamp(e,"error")}))),n=y(v().map((function(e){return I.addAdditionalEventProperties(e,"mutation",U,D)})));if(window.navigation){var a=new j((function(e){var r=function(r){e.next(i(i({},r),{type:"navigate"}))};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}));r=y(a.map((function(e){return I.addAdditionalEventProperties(e,"navigate",U,D)})))}var s=y(new j((function(e){var r=function(){var r=document.activeElement;if(r&&("TEXTAREA"===r.tagName||"INPUT"===r.tagName)){try{if(r.selectionStart===r.selectionEnd)return}catch(e){return}return e.next()}var t=window.getSelection();if(t&&!t.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",r),function(){window.document.removeEventListener("selectionchange",r)}}))),l=y(p());return(e={})[u.ClickObservable]=t,e[u.MutationObservable]=n,e[u.NavigateObservable]=r,e[u.BrowserErrorObservable]=o,e[u.SelectionObservable]=s,e[u.MouseMoveObservable]=l,e}(),L&&(n=s(_,N),a=c({allObservables:t,amplitude:r,shouldTrackRageClick:n}),P.push(a)),S&&(f=s(_,R),g=l({amplitude:r,allObservables:t,getEventProperties:function(e,r){return I.getEventProperties(e,r,D)},shouldTrackDeadClick:f}),P.push(g)),T&&(w=s(_,B),C=h({amplitude:r,allObservables:t,shouldTrackErrorClick:w}),P.push(C)),M&&(k=void 0,E=void 0,"object"==typeof _.thrashedCursor&&(k=_.thrashedCursor.directionChanges,E=_.thrashedCursor.threshold,k&&k<5&&(e.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),E&&E>A&&(e.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(E," is above the maximum of ").concat(A,", setting to ").concat(A)),E=A)),x=b({amplitude:r,options:_,allObservables:t,directionChanges:k,thresholdMs:E}),P.push(x)),null===(X=null==e?void 0:e.loggerProvider)||void 0===X||X.log("".concat(O," has been successfully added."))),[2]}))}))},execute:function(e){return t(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,e]}))}))},teardown:function(){return t(void 0,void 0,void 0,(function(){var e,r,t,i;return o(this,(function(o){try{for(e=n(P),r=e.next();!r.done;r=e.next())r.value.unsubscribe()}catch(e){t={error:e}}finally{try{r&&!r.done&&(i=e.return)&&i.call(e)}finally{if(t)throw t.error}}return[2]}))}))}}};export{_ as frustrationPlugin};
@@ -1 +1 @@
1
- import{__assign as e}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import n from"../../../../../../../../_virtual/index.js";import{merge as r}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import{getGlobalScope as t}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js";import{consoleObserver as o}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js";var i=t(),c=function(){return new n((function(e){var n=new MutationObserver((function(n){e.next(n)}));return document.body&&n.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return n.disconnect()}}))},u=function(e){return void 0===e&&(e="click"),new n((function(n){var r,o=function(e){n.next(e)};return null===(r=t())||void 0===r||r.document.addEventListener(e,o,{capture:!0}),function(){var n;null===(n=t())||void 0===n||n.document.removeEventListener(e,o,{capture:!0})}}))},s=function(){return new n((function(e){var n,r=function(n){e.next(n)};return null===(n=t())||void 0===n||n.addEventListener("scroll",r),function(){var e;null===(e=t())||void 0===e||e.removeEventListener("scroll",r)}}))},a=function(e,r){return new n((function(n){var o,i=t();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var c=new IntersectionObserver((function(e){e.forEach((function(e){n.next(e)}))}),{root:null,rootMargin:"0px",threshold:1}),u=r.join(",");(null!==(o=null==i?void 0:i.document.querySelectorAll(u))&&void 0!==o?o:[]).forEach((function(e){c.observe(e)}));var s=e.subscribe((function(e){return e.event.forEach((function(e){return e.addedNodes.forEach((function(e){e instanceof Element&&(e.matches(u)&&c.observe(e),e.querySelectorAll(u).forEach((function(e){c.observe(e)})))}))}))}));return function(){s.unsubscribe(),c.disconnect()}}))},l=function(){var t=r(new n((function(n){var r=function(r){if(r instanceof ErrorEvent){var t={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?t=e(e({},t),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):"string"==typeof r.error&&(t.message=r.error),n.next(t)}};return i.addEventListener("error",r),function(){i.removeEventListener("error",r)}})),new n((function(e){var n=function(n){var r={kind:"unhandledrejection"};n.reason instanceof Error||n.reason instanceof DOMException?(r.message=n.reason.message,r.stack=n.reason.stack):"string"==typeof n.reason&&(r.message=n.reason),e.next(r)};return i.addEventListener("unhandledrejection",n),function(){i.removeEventListener("unhandledrejection",n)}})));return r(t,new n((function(e){var n=function(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var o=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(o=r[0][0]),e.next({kind:"console",message:o})};return o.addListener("error",n),function(){o.removeListener(n)}})))},d=function(){return new n((function(e){var n=function(n){e.next(n)},r={capture:!0};return i.document.addEventListener("mousemove",n,r),function(){i.document.removeEventListener("mousemove",n,r)}}))};export{u as createClickObservable,l as createErrorObservable,a as createExposureObservable,d as createMouseMoveObservable,c as createMutationObservable,s as createScrollObservable};
1
+ import{__assign as e}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import n from"../../../../../../../../_virtual/index2.js";import{merge as r}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js";import{getGlobalScope as t}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js";import{consoleObserver as o}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js";var i=t(),c=function(){return new n((function(e){var n=new MutationObserver((function(n){e.next(n)}));return document.body&&n.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return n.disconnect()}}))},u=function(e){return void 0===e&&(e="click"),new n((function(n){var r,o=function(e){n.next(e)};return null===(r=t())||void 0===r||r.document.addEventListener(e,o,{capture:!0}),function(){var n;null===(n=t())||void 0===n||n.document.removeEventListener(e,o,{capture:!0})}}))},s=function(){return new n((function(e){var n,r=function(n){e.next(n)};return null===(n=t())||void 0===n||n.addEventListener("scroll",r),function(){var e;null===(e=t())||void 0===e||e.removeEventListener("scroll",r)}}))},a=function(e,r){return new n((function(n){var o,i=t();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var c=new IntersectionObserver((function(e){e.forEach((function(e){n.next(e)}))}),{root:null,rootMargin:"0px",threshold:1}),u=r.join(",");(null!==(o=null==i?void 0:i.document.querySelectorAll(u))&&void 0!==o?o:[]).forEach((function(e){c.observe(e)}));var s=e.subscribe((function(e){return e.event.forEach((function(e){return e.addedNodes.forEach((function(e){e instanceof Element&&(e.matches(u)&&c.observe(e),e.querySelectorAll(u).forEach((function(e){c.observe(e)})))}))}))}));return function(){s.unsubscribe(),c.disconnect()}}))},l=function(){var t=r(new n((function(n){var r=function(r){if(r instanceof ErrorEvent){var t={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?t=e(e({},t),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):"string"==typeof r.error&&(t.message=r.error),n.next(t)}};return i.addEventListener("error",r),function(){i.removeEventListener("error",r)}})),new n((function(e){var n=function(n){var r={kind:"unhandledrejection"};n.reason instanceof Error||n.reason instanceof DOMException?(r.message=n.reason.message,r.stack=n.reason.stack):"string"==typeof n.reason&&(r.message=n.reason),e.next(r)};return i.addEventListener("unhandledrejection",n),function(){i.removeEventListener("unhandledrejection",n)}})));return r(t,new n((function(e){var n=function(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var o=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(o=r[0][0]),e.next({kind:"console",message:o})};return o.addListener("error",n),function(){o.removeListener(n)}})))},d=function(){return new n((function(e){var n=function(n){e.next(n)},r={capture:!0};return i.document.addEventListener("mousemove",n,r),function(){i.document.removeEventListener("mousemove",n,r)}}))};export{u as createClickObservable,l as createErrorObservable,a as createExposureObservable,d as createMouseMoveObservable,c as createMutationObservable,s as createScrollObservable};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as n}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{PLUGIN_NAME as r}from"./constants.js";import{trackNetworkEvents as t}from"./track-network-event.js";import o from"../../../../../../../../_virtual/index.js";import{NetworkEventCallback as i,networkObserver as u}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js";var s,c;!function(e){e.NetworkObservable="networkObservable"}(s||(s={}));var l=function(l){void 0===l&&(l={});var a,d=r,v=function(){var e,n=new o((function(e){var n=new i((function(n){var r=function(e,n){return{event:e,timestamp:Date.now(),type:n}}(n,"network");e.next(r)}));return u.subscribe(n,a),function(){u.unsubscribe(n)}}));return(e={})[s.NetworkObservable]=n,e};return{name:d,type:"enrichment",setup:function(r,o){return e(void 0,void 0,void 0,(function(){var e;return n(this,(function(n){return"undefined"==typeof document||(e=v(),a=null==r?void 0:r.loggerProvider,c=t({allObservables:e,networkTrackingOptions:l,amplitude:o,loggerProvider:a}),null==a||a.log("".concat(d," has been successfully added."))),[2]}))}))},execute:function(r){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,r]}))}))},teardown:function(){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return c.unsubscribe(),[2]}))}))}}};export{s as ObservablesEnum,l as networkCapturePlugin};
1
+ import{__awaiter as e,__generator as n}from"../../../../../../@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{PLUGIN_NAME as r}from"./constants.js";import{trackNetworkEvents as t}from"./track-network-event.js";import o from"../../../../../../../../_virtual/index2.js";import{NetworkEventCallback as i,networkObserver as u}from"../../../../../../@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js";var s,c;!function(e){e.NetworkObservable="networkObservable"}(s||(s={}));var l=function(l){void 0===l&&(l={});var a,d=r,v=function(){var e,n=new o((function(e){var n=new i((function(n){var r=function(e,n){return{event:e,timestamp:Date.now(),type:n}}(n,"network");e.next(r)}));return u.subscribe(n,a),function(){u.unsubscribe(n)}}));return(e={})[s.NetworkObservable]=n,e};return{name:d,type:"enrichment",setup:function(r,o){return e(void 0,void 0,void 0,(function(){var e;return n(this,(function(n){return"undefined"==typeof document||(e=v(),a=null==r?void 0:r.loggerProvider,c=t({allObservables:e,networkTrackingOptions:l,amplitude:o,loggerProvider:a}),null==a||a.log("".concat(d," has been successfully added."))),[2]}))}))},execute:function(r){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,r]}))}))},teardown:function(){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return c.unsubscribe(),[2]}))}))}}};export{s as ObservablesEnum,l as networkCapturePlugin};
@@ -1 +1 @@
1
- {"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAiBzF,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAMxC;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAqBnE;AAqBD;;GAEG;AACH,UAAU,8BAA8B;IACtC,oBAAoB,EAAE,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,8BAA8B,GAAG,cAAc,CAChD,+BAA+B,EAAE,EACjC,0BAA0B,GAAG,SAAS,CACvC,CAkEA"}
1
+ {"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAiBzF,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAMxC;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAqBnE;AAqBD;;GAEG;AACH,UAAU,8BAA8B;IACtC,oBAAoB,EAAE,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,8BAA8B,GAAG,cAAc,CAChD,+BAA+B,EAAE,EACjC,0BAA0B,GAAG,SAAS,CACvC,CAkEA"}
@@ -1,7 +1,7 @@
1
1
  import { createBulkTransfer, getBulkTransfer, getBulkTransfers } from './client/bulk-transfers.client';
2
2
  /**
3
3
  * The bulkTransfers namespace contains client-side functions for SEPA bulk transfer operations.
4
- * This version uses proxy-based authentication (proxyRequestFunction or proxyEndpointDescriptor)
4
+ * This version uses proxy-based authentication (proxyEndpointDescriptor)
5
5
  * and is designed for browser environments.
6
6
  *
7
7
  * For server-side operations using access tokens, import from '\@qonto/embed-sdk/server/sepa-transfers' and access sepaTransfers.bulkTransfers.
@@ -46,7 +46,7 @@ export declare function prepareGetSepaTransfersCall({ paginationSettings, access
46
46
  export declare function getSepaTransfers({ accessToken, stagingToken, paginationSettings, }: GetSepaTransfersParams): Promise<GetSepaTransfersApiResponse>;
47
47
  /**
48
48
  * Prepares a network call descriptor for fetching a single SEPA transfer by ID.
49
- * This function is used internally to support both the proxyRequestFunction flow
49
+ * This function is used internally to support the proxyEndpointDescriptor flow
50
50
  * and the access token flow in the getSepaTransfer function.
51
51
  *
52
52
  * @param params - An object containing:
@@ -65,7 +65,7 @@ export declare function prepareGetSepaTransferCall({ sepaTransferId, accessToken
65
65
  export declare function getSepaTransfer({ accessToken, stagingToken, sepaTransferId, }: GetSepaTransferParams): Promise<SepaTransferDataObject>;
66
66
  /**
67
67
  * Prepares a network call descriptor for creating a SEPA transfer.
68
- * This function is used internally to support both the proxyRequestFunction flow
68
+ * This function is used internally to support the proxyEndpointDescriptor flow
69
69
  * and the access token flow in the createSepaTransfer function.
70
70
  *
71
71
  * @param params - An object containing:
@@ -82,7 +82,7 @@ export declare function prepareCreateSepaTransferCall({ transfer, vopProofToken,
82
82
  export declare function createSepaTransfer({ transfer, vopProofToken, accessToken, stagingToken, scaSessionToken, idempotencyKey, }: CreateSepaTransferParams): Promise<SepaTransferDataObject>;
83
83
  /**
84
84
  * Prepares a network call descriptor for canceling a SEPA transfer by ID.
85
- * This function is used internally to support both the proxyRequestFunction flow
85
+ * This function is used internally to support the proxyEndpointDescriptor flow
86
86
  * and the access token flow in the cancelSepaTransfer function.
87
87
  *
88
88
  * @param params - An object containing:
@@ -1 +1 @@
1
- import{buildRequestHeaders as o,encodeNetworkCall as r,decodeNetworkResponse as t}from"./network/network.js";import{EmbedApiError as e}from"../errors/EmbedApiError.js";import{EmbedOperationError as s}from"../errors/EmbedOperationError.js";async function n({proxyFunction:n,networkCallDescriptor:i,proxyEndpointDescriptor:p}){if(p){const s={...Object.fromEntries([...o(i.options?.headers)??{}])},n={...i,options:{...i.options,headers:s}},a=r(n),d=await fetch(p.path,{method:p.method,headers:p.options.headers,body:a}),c=await d.text(),m=t(c);if(!d.ok)throw new e({code:d.status,data:m,message:`Error from proxy endpoint: ${d.status} ${d.statusText}`});return m}if(n){const e=Object.fromEntries([...o(i.options?.headers)??{}]),s={...i,options:{...i.options,headers:e}},p=r(s),a=await n(p);return t(a)}throw new s("No proxy function or proxy endpoint descriptor provided for proxy call.")}export{n as callProxyFunction};
1
+ import{buildRequestHeaders as t,encodeNetworkCall as o,decodeNetworkResponse as r}from"./network/network.js";import{EmbedApiError as e}from"../errors/EmbedApiError.js";async function s({networkCallDescriptor:s,proxyEndpointDescriptor:n}){const a={...Object.fromEntries([...t(s.options?.headers)??{}])},i={...s,options:{...s.options,headers:a}},p=o(i),d=await fetch(n.path,{method:n.method,headers:n.options.headers,body:p}),m=await d.text(),h=r(m);if(!d.ok)throw new e({code:d.status,data:h,message:`Error from proxy endpoint: ${d.status} ${d.statusText}`});return h}export{s as callProxyFunction};
@@ -1 +1 @@
1
- import{MFA_METHODS as e}from"../constants.js";class t{constructor(){this.mfaPreference=e.PASSKEY,this.debugMode=!1}static getInstance(){return t.instance||(t.instance=new t),t.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=e.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 n=t.getInstance();export{t as OperationSettingsManager,n as operationSettingsManager};
1
+ import{MFA_METHODS as e}from"../constants.js";class t{constructor(){this.mfaPreference=e.PASSKEY,this.debugMode=!1}static getInstance(){return t.instance||(t.instance=new t),t.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=e.PASSKEY,this.debugMode=!1,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode}}}const r=t.getInstance();export{t as OperationSettingsManager,r as operationSettingsManager};
@@ -1 +1 @@
1
- import{QontoEmbedSdkError as e}from"./QontoEmbedSdkError.js";class t extends e{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."}}export{t as AuthenticationError};
1
+ import{QontoEmbedSdkError as t}from"./QontoEmbedSdkError.js";class e extends t{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyEndpointDescriptor or accessToken, either as parameters or by calling the initialize function first."}}export{e as AuthenticationError};
@@ -1 +1 @@
1
- import{MFA_METHODS as e}from"../common/constants.js";import{environmentManager as t}from"../common/environment/environment-manager.js";import{operationSettingsManager as n}from"../common/operation-settings/operation-settings.js";import{InvalidParametersError as o}from"../errors/InvalidParametersError.js";const r={requiresUI:!1};function i(i,{requiresUI:s}=r){const a=i?.uiParentElementId||n.getUIParentElementId();if(s){if(!a)throw new o("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 a))throw new o("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const c=i?.mfaPreference||n.getMFAPreference();if(c){const n=(u=Object.values(e),t.isProductionEnvironment()?u.filter((t=>t!==e.MOCK)):u);if(!n.includes(c))throw new o(`operationSettings.mfaPreference must be one of ${n.join(", ")}`);if(t.isProductionEnvironment()&&c===e.MOCK)throw new o("operationSettings.mfaPreference cannot be set to mock in production environment.")}var u;const m=i?.debugMode||n.getDebugMode();if(void 0!==m&&"boolean"!=typeof m)throw new o("operationSettings.debugMode must be a boolean.");const p=i?.proxyRequestFunction||n.getProxyRequestFunction();if(p&&"function"!=typeof p)throw new o("operationSettings.proxyRequestFunction must be a function.");const f=i?.proxyEndpointDescriptor||n.getProxyEndpointDescriptor();if(f&&!f.path)throw new o("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...i,uiParentElementId:a,mfaPreference:c,debugMode:m,proxyRequestFunction:p,proxyEndpointDescriptor:f}}export{i as validateOperationSettingsParams};
1
+ import{MFA_METHODS as e}from"../common/constants.js";import{environmentManager as t}from"../common/environment/environment-manager.js";import{operationSettingsManager as n}from"../common/operation-settings/operation-settings.js";import{InvalidParametersError as o}from"../errors/InvalidParametersError.js";const r={requiresUI:!1};function i(i,{requiresUI:a}=r){const s=i?.uiParentElementId||n.getUIParentElementId();if(a){if(!s)throw new o("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 s))throw new o("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const m=i?.mfaPreference||n.getMFAPreference();if(m){const n=(c=Object.values(e),t.isProductionEnvironment()?c.filter((t=>t!==e.MOCK)):c);if(!n.includes(m))throw new o(`operationSettings.mfaPreference must be one of ${n.join(", ")}`);if(t.isProductionEnvironment()&&m===e.MOCK)throw new o("operationSettings.mfaPreference cannot be set to mock in production environment.")}var c;const p=i?.debugMode||n.getDebugMode();if(void 0!==p&&"boolean"!=typeof p)throw new o("operationSettings.debugMode must be a boolean.");const f=i?.proxyEndpointDescriptor||n.getProxyEndpointDescriptor();if(f&&!f.path)throw new o("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...i,uiParentElementId:s,mfaPreference:m,debugMode:p,proxyEndpointDescriptor:f}}export{i as validateOperationSettingsParams};
@@ -1 +1 @@
1
- {"version":3,"file":"qonto-sca-passkey-waiting.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAMxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGtF,OAAO,oEAAoE,CAAC;AAC5E,OAAO,sDAAsD,CAAC;AAC9D,OAAO,0DAA0D,CAAC;AAClE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AAMzD,qBAEa,sBAAuB,SAAQ,UAAU;IACpD,MAAM,CAAC,MAAM,0BAAgC;IAG7C,gBAAgB,EAAE,MAAM,CAAM;IAG9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAG9C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAGtC,OAAO,CAAC,WAAW,CAAkB;IAGrC,OAAO,CAAC,YAAY,CAAkB;IAEtC,OAAO,CAAC,gBAAgB,CAEV;IAEd,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;YAKd,YAAY;IAkC1B,OAAO,CAAC,WAAW;YAOL,kBAAkB;YAwClB,iBAAiB;IAsB/B,OAAO,CAAC,gBAAgB;IAWxB,MAAM;CA4CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,sBAAsB,CAAC;KACrD;CACF"}
1
+ {"version":3,"file":"qonto-sca-passkey-waiting.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAMxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGtF,OAAO,oEAAoE,CAAC;AAC5E,OAAO,sDAAsD,CAAC;AAC9D,OAAO,0DAA0D,CAAC;AAClE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AAMzD,qBAEa,sBAAuB,SAAQ,UAAU;IACpD,MAAM,CAAC,MAAM,0BAAgC;IAG7C,gBAAgB,EAAE,MAAM,CAAM;IAG9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAG9C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAGtC,OAAO,CAAC,WAAW,CAAkB;IAGrC,OAAO,CAAC,YAAY,CAAkB;IAEtC,OAAO,CAAC,gBAAgB,CAEV;IAEd,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;YAKd,YAAY;IAkC1B,OAAO,CAAC,WAAW;YAOL,kBAAkB;YAmClB,iBAAiB;IAsB/B,OAAO,CAAC,gBAAgB;IAWxB,MAAM;CA4CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,sBAAsB,CAAC;KACrD;CACF"}
@@ -6,7 +6,7 @@ import type { UIElementCreatorParams } from '@ui/ui-elements.types';
6
6
  *
7
7
  * @param params - Object containing:
8
8
  * - containerElement: The DOM element where the component will be appended
9
- * - operationSettings: Settings passed to the component (accessToken, proxyRequestFunction, locale, etc.)
9
+ * - operationSettings: Settings passed to the component (accessToken, proxyEndpointDescriptor, locale, etc.)
10
10
  * - uiElementSettings: Optional settings including event listeners
11
11
  */
12
12
  export declare function createSepaTransferCreationElement({ containerElement, uiElementSettings, operationSettings, }: UIElementCreatorParams<never>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"sepa-transfer-creation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAgBvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AASnF,OAAO,uCAAuC,CAAC;AAC/C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,iDAAiD,CAAC;AASzD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE;;;;;;;;;;;;;GAaG;AACH,qBAEa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,0BAA8B;IAG3C,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAGjD,MAAM,EAAE,MAAM,CAAQ;IAGtB,OAAO,CAAC,WAAW,CACyB;IAG5C,OAAO,CAAC,QAAQ,CAKd;IAGF,OAAO,CAAC,uBAAuB,CAKjB;IAGd,OAAO,CAAC,SAAS,CAAoC;IAGrD,OAAO,CAAC,kBAAkB,CAAkB;IAG5C,OAAO,CAAC,aAAa,CAAqB;IAE1C,iBAAiB;IAkBjB,oBAAoB;IAoBpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAM/C,OAAO,CAAC,4BAA4B,CA8DlC;IAEF,OAAO,CAAC,8BAA8B,CAYpC;IAEF,OAAO,CAAC,cAAc,CAEpB;IAEF,OAAO,CAAC,uBAAuB,CAkD7B;IAEF,MAAM;CA+CP"}
1
+ {"version":3,"file":"sepa-transfer-creation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAgBvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AASnF,OAAO,uCAAuC,CAAC;AAC/C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,iDAAiD,CAAC;AASzD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE;;;;;;;;;;;;;GAaG;AACH,qBAEa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,0BAA8B;IAG3C,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAGjD,MAAM,EAAE,MAAM,CAAQ;IAGtB,OAAO,CAAC,WAAW,CACyB;IAG5C,OAAO,CAAC,QAAQ,CAKd;IAGF,OAAO,CAAC,uBAAuB,CAKjB;IAGd,OAAO,CAAC,SAAS,CAAoC;IAGrD,OAAO,CAAC,kBAAkB,CAAkB;IAG5C,OAAO,CAAC,aAAa,CAAqB;IAE1C,iBAAiB;IAkBjB,oBAAoB;IAoBpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAM/C,OAAO,CAAC,4BAA4B,CA4DlC;IAEF,OAAO,CAAC,8BAA8B,CAYpC;IAEF,OAAO,CAAC,cAAc,CAEpB;IAEF,OAAO,CAAC,uBAAuB,CAkD7B;IAEF,MAAM;CA+CP"}
@@ -7,7 +7,7 @@ import type { UIElementCreatorParams } from '@ui/ui-elements.types';
7
7
  *
8
8
  * @param params - Object containing:
9
9
  * - containerElement: The DOM element where the component will be appended
10
- * - operationSettings: Settings passed to the component (accessToken, proxyRequestFunction, paginationSettings, etc.)
10
+ * - operationSettings: Settings passed to the component (accessToken, proxyEndpointDescriptor, paginationSettings, etc.)
11
11
  * - uiElementSettings: Optional settings including event listeners
12
12
  */
13
13
  export declare function createTransactionListElement({ containerElement, uiElementSettings, operationSettings, }: UIElementCreatorParams<GetTransactionsSettings>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-list.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/transaction-list/transaction-list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EAGxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAMnF,OAAO,iDAAiD,CAAC;AACzD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,uDAAuD,CAAC;AAE/D,qBAEa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,MAAM,0BAAe;IAG5B,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAGjD,mBAAmB,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAGzD,OAAO,CAAC,YAAY,CAA4B;IAGhD,OAAO,CAAC,eAAe,CAA8B;IAGrD,OAAO,CAAC,SAAS,CAAkB;IAGnC,OAAO,CAAC,KAAK,CAAqB;IAElC,iBAAiB;IAMjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;YAMjC,iBAAiB;IAkC/B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,cAAc;IAOtB,MAAM;CAsEP"}
1
+ {"version":3,"file":"transaction-list.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ui-elements/transaction-list/transaction-list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EAGxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAMnF,OAAO,iDAAiD,CAAC;AACzD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,uDAAuD,CAAC;AAE/D,qBAEa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,MAAM,0BAAe;IAG5B,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAGjD,mBAAmB,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAGzD,OAAO,CAAC,YAAY,CAA4B;IAGhD,OAAO,CAAC,eAAe,CAA8B;IAGrD,OAAO,CAAC,SAAS,CAAkB;IAGnC,OAAO,CAAC,KAAK,CAAqB;IAElC,iBAAiB;IAMjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;YAMjC,iBAAiB;IAiC/B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,cAAc;IAOtB,MAAM;CAsEP"}
@@ -6,7 +6,7 @@ import type { UIElementCreatorParams } from '@ui/ui-elements.types';
6
6
  *
7
7
  * @param params - Object containing:
8
8
  * - containerElement: The DOM element where the component will be appended
9
- * - operationSettings: Settings passed to the component (accessToken, proxyRequestFunction, paginationSettings, etc.)
9
+ * - operationSettings: Settings passed to the component (accessToken, proxyEndpointDescriptor, paginationSettings, etc.)
10
10
  * - uiElementSettings: Optional settings including event listeners
11
11
  */
12
12
  export declare function createTransferListElement({ containerElement, uiElementSettings, operationSettings, }: UIElementCreatorParams<never>): void;
@@ -44,8 +44,7 @@ export interface UIElementSettings<T> {
44
44
  * initialize function previously) and contains settings related
45
45
  * to the overall operation. For UI elements, it has to include at least the
46
46
  * `uiParentElementId`, which specifies the DOM element where the UI element
47
- * will be appended. In addition, it may include authentication details, in which
48
- * the preferred method is to provide a `proxyRequestFunction`.
47
+ * will be appended. In addition, it may include authentication details via `proxyEndpointDescriptor`.
49
48
  */
50
49
  export interface UIElementParams<T> {
51
50
  uiElementSettings: UIElementSettings<T>;
@@ -66,7 +65,7 @@ export interface UIElementCreatorParams<T> {
66
65
  */
67
66
  uiElementSettings?: UIElementSettings<T>;
68
67
  /**
69
- * Operation-level settings such as accessToken, stagingToken, proxyRequestFunction, etc.
68
+ * Operation-level settings such as accessToken, stagingToken, proxyEndpointDescriptor, etc.
70
69
  * These settings are passed directly to SDK API functions.
71
70
  */
72
71
  operationSettings?: OperationSettings;
@@ -1 +1 @@
1
- {"version":3,"file":"ui-elements.types.d.ts","sourceRoot":"","sources":["../../../src/ui/ui-elements.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;GAEG;AACH,KAAK,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE/E;;;;;;;;GAQG;AACH,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,aAAa,EAAE,cAAc,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC;IACpB,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC;;OAEG;IACH,gBAAgB,EAAE,WAAW,CAAC;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
1
+ {"version":3,"file":"ui-elements.types.d.ts","sourceRoot":"","sources":["../../../src/ui/ui-elements.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;GAEG;AACH,KAAK,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE/E;;;;;;;;GAQG;AACH,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,aAAa,EAAE,cAAc,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC;IACpB,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC;;OAEG;IACH,gBAAgB,EAAE,WAAW,CAAC;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
@@ -1,5 +1,5 @@
1
1
  import type { PaginationSettings } from '@common/api-pagination/api-pagination.types';
2
- import type { ProxyEndpointDescriptor, ProxyRequestFunction } from '@common/common.types.ts';
2
+ import type { ProxyEndpointDescriptor } from '@common/common.types.ts';
3
3
  import type { Locale } from '@common/locale/locale.types';
4
4
  import type { MfaMethod } from '@common/operation-settings/operation-settings.types';
5
5
  export type UIParentElementId = string | (() => HTMLElement);
@@ -49,26 +49,6 @@ export interface OperationSettings {
49
49
  * is not subject to pagination, this parameter will be ignored.
50
50
  */
51
51
  paginationSettings?: PaginationSettings;
52
- /**
53
- * `proxyRequestFunction` is a mechanism to avoid operating with sensitive
54
- * information, like the access token and the staging token, in client side
55
- * environments. Using them in client side could lead to data leak.It works as
56
- * follows:
57
- *
58
- * Qonto Embed exposes a proxy endpoint in its API that is capable of getting
59
- * requests prepared by the SDK. In your web application, you must implement a
60
- * backend endpoint that receives a string value in the body,
61
- * adds the access token in the `Authentication` header and calls the Qonto
62
- * Embed proxy endpoint with the string payload you received. The `proxyRequestFunction`
63
- * the SDK expects is a function in which you will implement the call to your
64
- * backend endpoint. It receives a string parameter, it must perform a call to
65
- * your endpoint and return the data the endpoint sends you back.
66
- *
67
- * The SDK will then decode the received data and return the appropriate return
68
- * value to the called function. Read more about implementing the whole flow in
69
- * [the Proxy Endpoint Implementation guide](https://docs.qonto.com/api-reference/embed-sdk-api/variables/overview-common).
70
- */
71
- proxyRequestFunction?: ProxyRequestFunction;
72
52
  /**
73
53
  * `proxyEndpointDescriptor` is a mechanism to avoid operating with sensitive
74
54
  * information, like the access token and the staging token, in client side
@@ -120,24 +100,6 @@ export type OperationSettingsWithUI = OperationSettings & {
120
100
  * to authentication tokens should be avoided for security reasons.
121
101
  */
122
102
  export interface ClientOperationSettings {
123
- /**
124
- * Required for client-side operations: either proxyRequestFunction or proxyEndpointDescriptor.
125
- *
126
- * `proxyRequestFunction` is a mechanism to avoid operating with sensitive
127
- * information, like the access token and the staging token, in client side
128
- * environments. Using them in client side could lead to data leak. It works as
129
- * follows:
130
- *
131
- * Qonto Embed exposes a proxy endpoint in its API that is capable of getting
132
- * requests prepared by the SDK. In your web application, you must implement a
133
- * backend endpoint that receives a string value in the body,
134
- * adds the access token in the `Authentication` header and calls the Qonto
135
- * Embed proxy endpoint with the string payload you received. The `proxyRequestFunction`
136
- * the SDK expects is a function in which you will implement the call to your
137
- * backend endpoint. It receives a string parameter, it must perform a call to
138
- * your endpoint and return the data the endpoint sends you back.
139
- */
140
- proxyRequestFunction?: ProxyRequestFunction;
141
103
  /**
142
104
  * `proxyEndpointDescriptor` is a mechanism to avoid operating with sensitive
143
105
  * information, like the access token and the staging token, in client side
@@ -240,7 +202,6 @@ export interface ServerOperationSettings {
240
202
  * Client-only properties are explicitly excluded from server settings.
241
203
  * Use `@qonto/embed-sdk/{namespace}` for client-side operations.
242
204
  */
243
- proxyRequestFunction?: never;
244
205
  proxyEndpointDescriptor?: never;
245
206
  uiParentElementId?: never;
246
207
  mfaPreference?: never;
@@ -254,23 +215,25 @@ export declare function validateOperationSettingsParams(params: OperationSetting
254
215
  requiresUI?: false;
255
216
  }): OperationSettings;
256
217
  /**
257
- * Validates client operation settings and ensures either proxyRequestFunction
258
- * or proxyEndpointDescriptor is provided (either in params or from global settings).
218
+ * Validates client operation settings and ensures proxyEndpointDescriptor is provided
219
+ * (either in params or from global settings).
259
220
  *
260
221
  * @param params - Client operation settings to validate
261
222
  * @param errorMessage - Custom error message to throw if validation fails
262
223
  * @returns Validated client operation settings with proxy configuration
263
- * @throws InvalidParametersError if neither proxyRequestFunction nor proxyEndpointDescriptor is provided
224
+ * @throws InvalidParametersError if proxyEndpointDescriptor is not provided
264
225
  *
265
226
  * @example
266
227
  * ```typescript
267
228
  * const settings = validateClientOperationSettings(
268
229
  * params?.operationSettings,
269
- * 'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. ' +
230
+ * 'Client-side operations require proxyEndpointDescriptor. ' +
270
231
  * 'For security, never expose access tokens in the browser. ' +
271
232
  * 'Use "@qonto/embed-sdk/server/{namespace}" only in server-side/backend environments.'
272
233
  * );
273
234
  * ```
274
235
  */
275
- export declare function validateClientOperationSettings(params: ClientOperationSettings | undefined, errorMessage?: string): ClientOperationSettings;
236
+ export declare function validateClientOperationSettings(params: ClientOperationSettings | undefined, errorMessage?: string): ClientOperationSettings & {
237
+ proxyEndpointDescriptor: ProxyEndpointDescriptor;
238
+ };
276
239
  //# sourceMappingURL=operation-settings-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation-settings-validation.d.ts","sourceRoot":"","sources":["../../../src/validation/operation-settings-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAIrF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC,MAAM,WAAW,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IAEH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;;;;;;;;;;;;;;;;OAkBG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wCAAwC;IACvD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C;;;;;;;;;;;;;OAaG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,GAAG;IACpE,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B,uBAAuB,CAAC,EAAE,KAAK,CAAC;IAChC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAMD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,EAAE,wCAAwC,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACtE,uBAAuB,CAAC;AAC3B,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,CAAC,EAAE,wCAAwC,GAAG;IAAE,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACzE,iBAAiB,CAAC;AA+ErB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAC3C,YAAY,CAAC,EAAE,MAAM,GACpB,uBAAuB,CAqBzB"}
1
+ {"version":3,"file":"operation-settings-validation.d.ts","sourceRoot":"","sources":["../../../src/validation/operation-settings-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAIrF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC,MAAM,WAAW,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IAEH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wCAAwC;IACvD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;OAaG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,GAAG;IACpE,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,KAAK,CAAC;IAChC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAMD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,EAAE,wCAAwC,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACtE,uBAAuB,CAAC;AAC3B,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,CAAC,EAAE,wCAAwC,GAAG;IAAE,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACzE,iBAAiB,CAAC;AAqErB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAC3C,YAAY,CAAC,EAAE,MAAM,GACpB,uBAAuB,GAAG;IAAE,uBAAuB,EAAE,uBAAuB,CAAA;CAAE,CAiBhF"}
@@ -1 +1 @@
1
- import{tracker as e}from"../../common/analytics/analytics-tracker.js";import{authManager as r}from"../../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../../common/auth/auth.validate.js";import{callProxyFunction as o}from"../../common/common.utils.js";import{validateOperationSettingsParams as n,validateClientOperationSettings as i}from"../../validation/operation-settings-validation.js";import{InvalidParametersError as s}from"../../errors/InvalidParametersError.js";import{buildIframeUrl as a,createIframe as d}from"../../iframe/iframe-manager.js";import{prepareGetCardIframeUrl as c,prepareGetCardCall as p,prepareGetCardsCall as m}from"../shared/cards.api.js";import{createEmbedUI as g}from"../shared/cards.helper.js";import{serializeUnlockCardPayload as u,serializeCard as l,serializeOrderCardPayload as f}from"../shared/cards.serializer.js";import{validateDisplayCardParams as y,validateUnlockCardParams as w,validateOrderCardParams as k,validateGetCardParams as h}from"../shared/cards.validate.js";async function b(r){e.cardsList();const t=r?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new s("membershipId must be a string");if(r?.operationSettings?.proxyRequestFunction)throw new s("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");const{proxyEndpointDescriptor:n,stagingToken:a}=i(r?.operationSettings,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),d=m({membershipId:t,stagingToken:a});return(await o({proxyEndpointDescriptor:n,networkCallDescriptor:d})).body.cards.map((e=>l(e)))}async function E({cardSettings:r,operationSettings:t}){e.cardsGet(),h(r);const n=r.cardId;if(t?.proxyRequestFunction)throw new s("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");const{proxyEndpointDescriptor:a,stagingToken:d}=i(t,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),c=p({cardId:n,stagingToken:d}),m=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:c})).body.cards;if(Array.isArray(m)&&m.length>0)return l(m[0]);throw new s("Unable to retrieve card data")}async function x(o){e.cardsOrder();const n=t(),{uiParentElementId:i,debugMode:c}=o.operationSettings;if(!i)throw new s("uiParentElementId is required");k(o.cardSettings);const p=a({accessToken:n,stagingToken:r.getStagingToken()||void 0,debugMode:c}),m=await d({iframeUrl:p,parentElementId:i}),g=f(o.cardSettings),u=await m.postMessage(g);return m.destroy(),l(u)}async function I(o){e.cardsUnlock();const n=t(),{uiParentElementId:i,debugMode:c}=o.operationSettings;if(!i)throw new s("uiParentElementId is required");w(o.cardSettings);const p=a({accessToken:n,stagingToken:r.getStagingToken()||void 0,debugMode:c}),m=await d({iframeUrl:p,parentElementId:i}),g=u(o),f=await m.postMessage(g);return m.destroy(),l(f)}async function S(r){e.cardsDisplay();const{uiParentElementId:i,accessToken:a,stagingToken:d,debugMode:p,mfaPreference:m,proxyEndpointDescriptor:u,proxyRequestFunction:l}=n(r.operationSettings,{requiresUI:!0});if(!i)throw new s("uiParentElementId is required");if(y(r.cardSettings),l&&!u)throw new s("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");if(u){const e=c({stagingToken:d}),t=(await o({proxyEndpointDescriptor:u,networkCallDescriptor:e})).body.embed_auth_link;return g({decorationParams:r.cardSettings,operationSettings:{uiParentElementId:i,debugMode:p},cardIframeUrl:t.url})}{const e=a||t(),{getCardIframeURL:o}=await import("../shared/cards.api.js"),n=await o({...r.cardSettings,accessToken:e,stagingToken:d});return g({decorationParams:r.cardSettings,operationSettings:{uiParentElementId:i,debugMode:p},cardIframeUrl:n.url})}}export{S as displayCard,E as getCard,b as getCards,x as orderCard,I as unlockCard};
1
+ import{tracker as e}from"../../common/analytics/analytics-tracker.js";import{authManager as r}from"../../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../../common/auth/auth.validate.js";import{callProxyFunction as n}from"../../common/common.utils.js";import{validateOperationSettingsParams as o,validateClientOperationSettings as i}from"../../validation/operation-settings-validation.js";import{InvalidParametersError as a}from"../../errors/InvalidParametersError.js";import{buildIframeUrl as s,createIframe as d}from"../../iframe/iframe-manager.js";import{prepareGetCardIframeUrl as c,prepareGetCardCall as m,prepareGetCardsCall as p}from"../shared/cards.api.js";import{createEmbedUI as g}from"../shared/cards.helper.js";import{serializeUnlockCardPayload as u,serializeCard as l,serializeOrderCardPayload as f}from"../shared/cards.serializer.js";import{validateDisplayCardParams as y,validateUnlockCardParams as k,validateOrderCardParams as w,validateGetCardParams as b}from"../shared/cards.validate.js";async function h(r){e.cardsList();const t=r?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new a("membershipId must be a string");const{proxyEndpointDescriptor:o,stagingToken:s}=i(r?.operationSettings,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),d=p({membershipId:t,stagingToken:s});return(await n({proxyEndpointDescriptor:o,networkCallDescriptor:d})).body.cards.map((e=>l(e)))}async function I({cardSettings:r,operationSettings:t}){e.cardsGet(),b(r);const o=r.cardId,{proxyEndpointDescriptor:s,stagingToken:d}=i(t,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),c=m({cardId:o,stagingToken:d}),p=(await n({proxyEndpointDescriptor:s,networkCallDescriptor:c})).body.cards;if(Array.isArray(p)&&p.length>0)return l(p[0]);throw new a("Unable to retrieve card data")}async function E(n){e.cardsOrder();const o=t(),{uiParentElementId:i,debugMode:c}=n.operationSettings;if(!i)throw new a("uiParentElementId is required");w(n.cardSettings);const m=s({accessToken:o,stagingToken:r.getStagingToken()||void 0,debugMode:c}),p=await d({iframeUrl:m,parentElementId:i}),g=f(n.cardSettings),u=await p.postMessage(g);return p.destroy(),l(u)}async function S(n){e.cardsUnlock();const o=t(),{uiParentElementId:i,debugMode:c}=n.operationSettings;if(!i)throw new a("uiParentElementId is required");k(n.cardSettings);const m=s({accessToken:o,stagingToken:r.getStagingToken()||void 0,debugMode:c}),p=await d({iframeUrl:m,parentElementId:i}),g=u(n),f=await p.postMessage(g);return p.destroy(),l(f)}async function v(r){e.cardsDisplay();const{uiParentElementId:i,accessToken:s,stagingToken:d,debugMode:m,mfaPreference:p,proxyEndpointDescriptor:u}=o(r.operationSettings,{requiresUI:!0});if(!i)throw new a("uiParentElementId is required");if(y(r.cardSettings),u){const e=c({stagingToken:d}),t=(await n({proxyEndpointDescriptor:u,networkCallDescriptor:e})).body.embed_auth_link;return g({decorationParams:r.cardSettings,operationSettings:{uiParentElementId:i,debugMode:m},cardIframeUrl:t.url})}{const e=s||t(),{getCardIframeURL:n}=await import("../shared/cards.api.js"),o=await n({...r.cardSettings,accessToken:e,stagingToken:d});return g({decorationParams:r.cardSettings,operationSettings:{uiParentElementId:i,debugMode:m},cardIframeUrl:o.url})}}export{v as displayCard,I as getCard,h as getCards,E as orderCard,S as unlockCard};
@@ -1 +1 @@
1
- import{buildRequestHeaders as e,encodeNetworkCall as t,decodeNetworkResponse as o}from"./network/network.js";import{EmbedApiError as r}from"../errors/EmbedApiError.js";import{EmbedOperationError as n}from"../errors/EmbedOperationError.js";function s(e){let t=null;if(t="function"==typeof e?e():document.getElementById(e),!(t&&t instanceof HTMLElement))throw new n(`Could not install the UI Element because the parent element with id ${e} was not found.\nPlease make sure to pass a valid parentElementId or ensure the parentElementId function returns a valid element.`);return t}async function i({proxyFunction:s,networkCallDescriptor:i,proxyEndpointDescriptor:a}){if(a){const n={...Object.fromEntries([...e(i.options?.headers)??{}])},s={...i,options:{...i.options,headers:n}},p=t(s),d=await fetch(a.path,{method:a.method,headers:a.options.headers,body:p}),m=await d.text(),c=o(m);if(!d.ok)throw new r({code:d.status,data:c,message:`Error from proxy endpoint: ${d.status} ${d.statusText}`});return c}if(s){const r=Object.fromEntries([...e(i.options?.headers)??{}]),n={...i,options:{...i.options,headers:r}},a=t(n),p=await s(a);return o(p)}throw new n("No proxy function or proxy endpoint descriptor provided for proxy call.")}export{i as callProxyFunction,s as getUIParentElement};
1
+ import{buildRequestHeaders as e,encodeNetworkCall as t,decodeNetworkResponse as o}from"./network/network.js";import{EmbedApiError as r}from"../errors/EmbedApiError.js";import{EmbedOperationError as n}from"../errors/EmbedOperationError.js";function s(e){let t=null;if(t="function"==typeof e?e():document.getElementById(e),!(t&&t instanceof HTMLElement))throw new n(`Could not install the UI Element because the parent element with id ${e} was not found.\nPlease make sure to pass a valid parentElementId or ensure the parentElementId function returns a valid element.`);return t}async function a({networkCallDescriptor:n,proxyEndpointDescriptor:s}){const a={...Object.fromEntries([...e(n.options?.headers)??{}])},i={...n,options:{...n.options,headers:a}},d=t(i),m=await fetch(s.path,{method:s.method,headers:s.options.headers,body:d}),p=await m.text(),l=o(p);if(!m.ok)throw new r({code:m.status,data:l,message:`Error from proxy endpoint: ${m.status} ${m.statusText}`});return l}export{a as callProxyFunction,s as getUIParentElement};
@@ -1 +1 @@
1
- import{validateLocale as n}from"../locale/locale.validate.js";import{validateOperationSettingsParams as o}from"../../validation/operation-settings-validation.js";import{InvalidParametersError as t}from"../../errors/InvalidParametersError.js";function e(e){if(!e?.accessToken&&!e?.operationSettings?.proxyRequestFunction&&!e?.operationSettings?.proxyEndpointDescriptor)throw new t("Either operationSettings.proxyRequestFunction, operationSettings.proxyEndpointDescriptor, or access token is required when calling initialize()");return e?.operationSettings&&o(e.operationSettings),function(n){if(n.environment){if(!["production","staging","local"].includes(n.environment))throw new t('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(n.branch&&!["master","sandbox","qa"].includes(n.branch))throw new t('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}}(e),e.locale&&n(e.locale),e}export{e as validateInitializeParams};
1
+ import{validateLocale as n}from"../locale/locale.validate.js";import{validateOperationSettingsParams as o}from"../../validation/operation-settings-validation.js";import{InvalidParametersError as t}from"../../errors/InvalidParametersError.js";function e(e){if(!e?.accessToken&&!e?.operationSettings?.proxyEndpointDescriptor)throw new t("Either operationSettings.proxyEndpointDescriptor or access token is required when calling initialize()");return e?.operationSettings&&o(e.operationSettings),function(n){if(n.environment){if(!["production","staging","local"].includes(n.environment))throw new t('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(n.branch&&!["master","sandbox","qa"].includes(n.branch))throw new t('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}}(e),e.locale&&n(e.locale),e}export{e as validateInitializeParams};
@@ -1 +1 @@
1
- import{MFA_METHODS as e}from"../constants.js";class t{constructor(){this.mfaPreference=e.PASSKEY,this.debugMode=!1}static getInstance(){return t.instance||(t.instance=new t),t.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=e.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 n=t.getInstance();export{t as OperationSettingsManager,n as operationSettingsManager};
1
+ import{MFA_METHODS as e}from"../constants.js";class t{constructor(){this.mfaPreference=e.PASSKEY,this.debugMode=!1}static getInstance(){return t.instance||(t.instance=new t),t.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=e.PASSKEY,this.debugMode=!1,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode}}}const r=t.getInstance();export{t as OperationSettingsManager,r as operationSettingsManager};
@@ -1 +1 @@
1
- import{QontoEmbedSdkError as e}from"./QontoEmbedSdkError.js";class t extends e{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."}}export{t as AuthenticationError};
1
+ import{QontoEmbedSdkError as t}from"./QontoEmbedSdkError.js";class e extends t{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyEndpointDescriptor or accessToken, either as parameters or by calling the initialize function first."}}export{e as AuthenticationError};
@@ -1 +1 @@
1
- import{authLinks as e}from"../../auth-links/index.js";import{tracker as r}from"../../common/analytics/analytics-tracker.js";import{serializePaginationResponse as n}from"../../common/api-pagination/api-pagination.js";import{authManager as t}from"../../common/auth/auth.js";import{callProxyFunction as o}from"../../common/common.utils.js";import{VOP_DECISIONS as s,HTTP_CODES as i,AUTH_LINK_ACTIONS as a}from"../../common/constants.js";import{isRunningInBrowser as p}from"../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as c}from"../../validation/operation-settings-validation.js";import{EmbedApiError as d}from"../../errors/EmbedApiError.js";import{InvalidParametersError as m}from"../../errors/InvalidParametersError.js";import{InvalidRuntimeError as f,RUNTIME_ENVIRONMENT as y}from"../../errors/InvalidRuntimeError.js";import{serializePreconditionRequiredResponse as l}from"../../sca/sca.serializer.js";import{prepareCreateSepaTransferCall as u,prepareGetSepaTransfersCall as k,prepareCancelSepaTransferCall as E,prepareGetSepaTransferCall as g,prepareVerifySepaPayeeCall as v}from"../shared/sepa-transfers.api.js";import{serializeToVopVerificationResult as b,serializeSepaTransfer as w}from"../shared/sepa-transfers.serializer.js";import{findBeneficiary as D,createSepaTransferScaElement as S,waitForSepaTransferScaResult as T,decorateUrlWithExtraParams as x}from"../shared/sepa-transfers.utils.js";import{validateTransferBeneficiaryParams as C,validateCreateSepaTransferParams as j,validateGetSepaTransferCreationFlowLinkParams as h,validateCancelSepaTransferParams as q,validateGetSepaTransferParams as I}from"../shared/sepa-transfers.validate.js";import"../../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";import P from"../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function R(e){r.sepaTransferList();const{proxyEndpointDescriptor:t,paginationSettings:s}=c(e?.operationSettings,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=k({paginationSettings:s}),a=await o({proxyEndpointDescriptor:t,networkCallDescriptor:i}),p=a.body.transfers.map(w),d=n(a.body.meta);return{transfers:p,...d?{meta:d}:{}}}async function U({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferGet();const t=I(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=g({sepaTransferId:t}),a=await o({proxyEndpointDescriptor:s,networkCallDescriptor:i});return w(a.body.transfer)}async function*F({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCreate();const{proxyEndpointDescriptor:a,uiParentElementId:k,locale:E}=c(n),g=t.getStagingToken(),x=n?.idempotencyKey||P();let h;C(e);const q=await D({sepaTransferSettings:e,operationSettings:n}),I={name:q.name,iban:q.iban},R=await async function({sepaPayee:e,operationSettings:r}){const{proxyEndpointDescriptor:n}=c(r,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),t=v({sepaPayee:e}),s=await o({proxyEndpointDescriptor:n,networkCallDescriptor:t});return s.body}({sepaPayee:I,operationSettings:n}),U=yield b(R);let F;if("string"==typeof U){if(U===s.REJECT)return}else{if(U.vopDecision===s.REJECT)return;F=U.sepaTransferSettings}const _={...e,...F};j(_);const A={..._,beneficiary:q};if(A.beneficiary?.trusted){const e=u({transfer:A,vopProofToken:R.proof_token.token,idempotencyKey:x});h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}else{if(!p())throw new f(y.BROWSER);if(!k)throw new m("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=u({transfer:A,vopProofToken:R.proof_token.token,stagingToken:g||void 0,idempotencyKey:x});let r;try{h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof d&&e.code===i.PRECONDITION_REQUIRED))throw e;r=l(e.data.body).scaSessionToken}const n=S({networkCallDescriptor:e,scaSessionToken:r,operationSettings:{uiParentElementId:k,locale:E}});try{h=await T(n)}finally{n.remove()}}return{transfer:w(h),meta:{idempotencyKey:x}}}async function _({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCancel();const t=q(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=E({sepaTransferId:t});await o({proxyEndpointDescriptor:s,networkCallDescriptor:i})}async function A({sepaTransferSettings:n,operationSettings:t}){r.sepaTransferCreationFlowLink();const o=h(n),{proxyEndpointDescriptor:s}=c(t,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=await e.request({requestSettings:{action:a.SEPA_TRANSFER_CREATE,callbackUrl:o},operationSettings:{proxyEndpointDescriptor:s}});return{...i,url:x(i.url,t)}}export{_ as cancelSepaTransfer,F as createSepaTransfer,U as getSepaTransfer,A as getSepaTransferCreationFlowLink,R as getSepaTransfers};
1
+ import{authLinks as e}from"../../auth-links/index.js";import{tracker as r}from"../../common/analytics/analytics-tracker.js";import{serializePaginationResponse as n}from"../../common/api-pagination/api-pagination.js";import{authManager as t}from"../../common/auth/auth.js";import{callProxyFunction as o}from"../../common/common.utils.js";import{VOP_DECISIONS as s,HTTP_CODES as i,AUTH_LINK_ACTIONS as a}from"../../common/constants.js";import{isRunningInBrowser as p}from"../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as c}from"../../validation/operation-settings-validation.js";import{EmbedApiError as d}from"../../errors/EmbedApiError.js";import{InvalidParametersError as m}from"../../errors/InvalidParametersError.js";import{InvalidRuntimeError as f,RUNTIME_ENVIRONMENT as y}from"../../errors/InvalidRuntimeError.js";import{serializePreconditionRequiredResponse as l}from"../../sca/sca.serializer.js";import{prepareCreateSepaTransferCall as u,prepareGetSepaTransfersCall as k,prepareCancelSepaTransferCall as E,prepareGetSepaTransferCall as g,prepareVerifySepaPayeeCall as v}from"../shared/sepa-transfers.api.js";import{serializeToVopVerificationResult as b,serializeSepaTransfer as w}from"../shared/sepa-transfers.serializer.js";import{findBeneficiary as D,createSepaTransferScaElement as S,waitForSepaTransferScaResult as T,decorateUrlWithExtraParams as x}from"../shared/sepa-transfers.utils.js";import{validateTransferBeneficiaryParams as C,validateCreateSepaTransferParams as j,validateGetSepaTransferCreationFlowLinkParams as h,validateCancelSepaTransferParams as q,validateGetSepaTransferParams as I}from"../shared/sepa-transfers.validate.js";import"../../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";import P from"../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function R(e){r.sepaTransferList();const{proxyEndpointDescriptor:t,paginationSettings:s}=c(e?.operationSettings,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=k({paginationSettings:s}),a=await o({proxyEndpointDescriptor:t,networkCallDescriptor:i}),p=a.body.transfers.map(w),d=n(a.body.meta);return{transfers:p,...d?{meta:d}:{}}}async function U({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferGet();const t=I(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=g({sepaTransferId:t}),a=await o({proxyEndpointDescriptor:s,networkCallDescriptor:i});return w(a.body.transfer)}async function*F({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCreate();const{proxyEndpointDescriptor:a,uiParentElementId:k,locale:E}=c(n),g=t.getStagingToken(),x=n?.idempotencyKey||P();let h;C(e);const q=await D({sepaTransferSettings:e,operationSettings:n}),I={name:q.name,iban:q.iban},R=await async function({sepaPayee:e,operationSettings:r}){const{proxyEndpointDescriptor:n}=c(r,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),t=v({sepaPayee:e}),s=await o({proxyEndpointDescriptor:n,networkCallDescriptor:t});return s.body}({sepaPayee:I,operationSettings:n}),U=yield b(R);let F;if("string"==typeof U){if(U===s.REJECT)return}else{if(U.vopDecision===s.REJECT)return;F=U.sepaTransferSettings}const _={...e,...F};j(_);const A={..._,beneficiary:q};if(A.beneficiary?.trusted){const e=u({transfer:A,vopProofToken:R.proof_token.token,idempotencyKey:x});h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}else{if(!p())throw new f(y.BROWSER);if(!k)throw new m("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=u({transfer:A,vopProofToken:R.proof_token.token,stagingToken:g||void 0,idempotencyKey:x});let r;try{h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof d&&e.code===i.PRECONDITION_REQUIRED))throw e;r=l(e.data.body).scaSessionToken}const n=S({networkCallDescriptor:e,scaSessionToken:r,operationSettings:{proxyEndpointDescriptor:a,uiParentElementId:k,locale:E}});try{h=await T(n)}finally{n.remove()}}return{transfer:w(h),meta:{idempotencyKey:x}}}async function _({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCancel();const t=q(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=E({sepaTransferId:t});await o({proxyEndpointDescriptor:s,networkCallDescriptor:i})}async function A({sepaTransferSettings:n,operationSettings:t}){r.sepaTransferCreationFlowLink();const o=h(n),{proxyEndpointDescriptor:s}=c(t,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=await e.request({requestSettings:{action:a.SEPA_TRANSFER_CREATE,callbackUrl:o},operationSettings:{proxyEndpointDescriptor:s}});return{...i,url:x(i.url,t)}}export{_ as cancelSepaTransfer,F as createSepaTransfer,U as getSepaTransfer,A as getSepaTransferCreationFlowLink,R as getSepaTransfers};
@@ -1 +1 @@
1
- import{getBeneficiary as e}from"../../beneficiaries/beneficiaries.js";import{getUIParentElement as n}from"../../common/common.utils.js";import{localeManager as t}from"../../common/locale/locale-manager.js";async function r({sepaTransferSettings:n,operationSettings:t}){return n?.beneficiary?n.beneficiary:await e({beneficiarySettings:{beneficiaryId:n?.beneficiaryId},operationSettings:t})}function o(e,n){const r=n?.locale||t.getLocale(),o=new URL(e);return r&&o.searchParams.append("lang",r),n?.mfaPreference&&o.searchParams.append("mfaPreference",n.mfaPreference),n?.idempotencyKey&&o.searchParams.append("idempotencyKey",n.idempotencyKey),o.toString()}function a({networkCallDescriptor:e,scaSessionToken:t,operationSettings:r}){const{uiParentElementId:o,proxyRequestFunction:a,locale:i}=r,s=n(o);s.innerHTML="";const c=document.createElement("qonto-sca-passkey-waiting");return c.networkCallDescriptor={...e,options:{...e.options,headers:{...e.options.headers,scaSessionToken:t}}},c.operationSettings={uiParentElementId:o,proxyRequestFunction:a,locale:i},s.appendChild(c),c}async function i(e){return new Promise(((n,t)=>{e.addEventListener("sca-success",(e=>{n(e.detail.result.transfer)}),{once:!0}),e.addEventListener("sca-error",(e=>{t(e.detail.error)}),{once:!0}),e.addEventListener("sca-abort",(e=>{t(e.detail.result)}),{once:!0})}))}export{a as createSepaTransferScaElement,o as decorateUrlWithExtraParams,r as findBeneficiary,i as waitForSepaTransferScaResult};
1
+ import{getBeneficiary as e}from"../../beneficiaries/beneficiaries.js";import{getUIParentElement as n}from"../../common/common.utils.js";import{localeManager as r}from"../../common/locale/locale-manager.js";async function t({sepaTransferSettings:n,operationSettings:r}){return n?.beneficiary?n.beneficiary:await e({beneficiarySettings:{beneficiaryId:n?.beneficiaryId},operationSettings:r})}function o(e,n){const t=n?.locale||r.getLocale(),o=new URL(e);return t&&o.searchParams.append("lang",t),n?.mfaPreference&&o.searchParams.append("mfaPreference",n.mfaPreference),n?.idempotencyKey&&o.searchParams.append("idempotencyKey",n.idempotencyKey),o.toString()}function a({networkCallDescriptor:e,scaSessionToken:r,operationSettings:t}){const{uiParentElementId:o,locale:a}=t,i=n(o);i.innerHTML="";const s=document.createElement("qonto-sca-passkey-waiting");return s.networkCallDescriptor={...e,options:{...e.options,headers:{...e.options.headers,scaSessionToken:r}}},s.operationSettings={uiParentElementId:o,proxyEndpointDescriptor:t.proxyEndpointDescriptor,locale:a},i.appendChild(s),s}async function i(e){return new Promise(((n,r)=>{e.addEventListener("sca-success",(e=>{n(e.detail.result.transfer)}),{once:!0}),e.addEventListener("sca-error",(e=>{r(e.detail.error)}),{once:!0}),e.addEventListener("sca-abort",(e=>{r(e.detail.result)}),{once:!0})}))}export{a as createSepaTransferScaElement,o as decorateUrlWithExtraParams,t as findBeneficiary,i as waitForSepaTransferScaResult};
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{str as e}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import{msg as o}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as i}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js";import{html as n}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as s}from"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as l}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";import{property as r}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";import{state as a}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";import{callProxyFunction as p}from"../../../common/common.utils.js";import{environmentManager as m}from"../../../common/environment/environment-manager.js";import{makeNetworkCall as c}from"../../../common/network/network.js";import d from"../../animations/generic_sca_approval.json.js";import{renderTestingScaHelper as u}from"./qonto-sca-passkey-waiting.utils.js";import{qontoScaPasskeyWaitingStyles as h}from"./qonto-sca-passkey-waiting.styles.js";import"../../customizable-components/lottie-player/qonto-lottie-player.js";import"../../customizable-components/button/qonto-button.js";import"../../customizable-components/text/qonto-text-heading.js";import"../../customizable-components/text/qonto-text-body.js";import"../../customizable-components/styles/styles.css.js";import{pollScaSession as b}from"../../../sca/sca.js";let g=class extends s{constructor(){super(...arguments),this.phoneLast4Digits="",this.isResending=!1,this.isLinkCopied=!1}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling()}async startPolling(){try{this.pollingGenerator=b({scaSettings:{scaSessionToken:this.networkCallDescriptor?.options.headers.scaSessionToken},operationSettings:this.operationSettings});let t=await this.pollingGenerator.next();for(;!t.done;)await new Promise((t=>setTimeout(t,3e3))),t=await this.pollingGenerator.next();"allow"===t.value.result?await this.executeNetworkCall():"deny"===t.value.result&&this.handleAbortClick()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:t},bubbles:!0,composed:!0}))}}stopPolling(){this.pollingGenerator?.return({result:"waiting",canceledAt:(new Date).toISOString()})}async executeNetworkCall(){if(this.networkCallDescriptor)try{let t;if(this.operationSettings?.proxyRequestFunction||this.operationSettings?.proxyEndpointDescriptor){t=(await p({proxyFunction:this.operationSettings?.proxyRequestFunction,networkCallDescriptor:this.networkCallDescriptor,proxyEndpointDescriptor:this.operationSettings?.proxyEndpointDescriptor})).body}else t=await c(this.networkCallDescriptor);this.dispatchEvent(new CustomEvent("sca-success",{detail:{result:t},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:t},bubbles:!0,composed:!0}))}else console.warn("No network call descriptor provided")}async handleResendClick(){this.isResending||(this.isResending=!0,this.dispatchEvent(new CustomEvent("resend-request",{bubbles:!0,composed:!0})),await this.stopPolling(),this.startPolling(),setTimeout((()=>{this.isResending=!1}),2e3))}handleAbortClick(){this.stopPolling(),this.dispatchEvent(new CustomEvent("sca-abort",{detail:{result:"User aborted SCA"},bubbles:!0,composed:!0}))}render(){return n`
1
+ import{__decorate as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js";import{str as e}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import{msg as o}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as i}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js";import{html as s}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as n}from"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as l}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";import{property as r}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";import{state as a}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";import{callProxyFunction as p}from"../../../common/common.utils.js";import{environmentManager as m}from"../../../common/environment/environment-manager.js";import{makeNetworkCall as c}from"../../../common/network/network.js";import d from"../../animations/generic_sca_approval.json.js";import{renderTestingScaHelper as u}from"./qonto-sca-passkey-waiting.utils.js";import{qontoScaPasskeyWaitingStyles as h}from"./qonto-sca-passkey-waiting.styles.js";import"../../customizable-components/lottie-player/qonto-lottie-player.js";import"../../customizable-components/button/qonto-button.js";import"../../customizable-components/text/qonto-text-heading.js";import"../../customizable-components/text/qonto-text-body.js";import"../../customizable-components/styles/styles.css.js";import{pollScaSession as b}from"../../../sca/sca.js";let g=class extends n{constructor(){super(...arguments),this.phoneLast4Digits="",this.isResending=!1,this.isLinkCopied=!1}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling()}async startPolling(){try{this.pollingGenerator=b({scaSettings:{scaSessionToken:this.networkCallDescriptor?.options.headers.scaSessionToken},operationSettings:this.operationSettings});let t=await this.pollingGenerator.next();for(;!t.done;)await new Promise((t=>setTimeout(t,3e3))),t=await this.pollingGenerator.next();"allow"===t.value.result?await this.executeNetworkCall():"deny"===t.value.result&&this.handleAbortClick()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:t},bubbles:!0,composed:!0}))}}stopPolling(){this.pollingGenerator?.return({result:"waiting",canceledAt:(new Date).toISOString()})}async executeNetworkCall(){if(this.networkCallDescriptor)try{let t;if(this.operationSettings?.proxyEndpointDescriptor){t=(await p({networkCallDescriptor:this.networkCallDescriptor,proxyEndpointDescriptor:this.operationSettings.proxyEndpointDescriptor})).body}else t=await c(this.networkCallDescriptor);this.dispatchEvent(new CustomEvent("sca-success",{detail:{result:t},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:t},bubbles:!0,composed:!0}))}else console.warn("No network call descriptor provided")}async handleResendClick(){this.isResending||(this.isResending=!0,this.dispatchEvent(new CustomEvent("resend-request",{bubbles:!0,composed:!0})),await this.stopPolling(),this.startPolling(),setTimeout((()=>{this.isResending=!1}),2e3))}handleAbortClick(){this.stopPolling(),this.dispatchEvent(new CustomEvent("sca-abort",{detail:{result:"User aborted SCA"},bubbles:!0,composed:!0}))}render(){return s`
2
2
  <qonto-button
3
3
  variant="ghost"
4
4
  data-close-button