@flash-pay/vue 1.0.0 → 2.0.1
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.
- package/dist/index.cjs.js +7 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +7 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -34,6 +34,9 @@ var FlashpayCheckout = (0, import_vue.defineComponent)({
|
|
|
34
34
|
showTitle: { type: Boolean, default: true },
|
|
35
35
|
showDescription: { type: Boolean, default: true },
|
|
36
36
|
showAmount: { type: Boolean, default: true },
|
|
37
|
+
showLogo: { type: Boolean, default: true },
|
|
38
|
+
showTerms: { type: Boolean, default: true },
|
|
39
|
+
qrEnabled: { type: Boolean, default: true },
|
|
37
40
|
style: { type: Object, default: void 0 },
|
|
38
41
|
origin: { type: String, default: void 0 },
|
|
39
42
|
onSuccess: { type: Function, default: void 0 },
|
|
@@ -53,6 +56,9 @@ var FlashpayCheckout = (0, import_vue.defineComponent)({
|
|
|
53
56
|
showTitle: props.showTitle,
|
|
54
57
|
showDescription: props.showDescription,
|
|
55
58
|
showAmount: props.showAmount,
|
|
59
|
+
showLogo: props.showLogo,
|
|
60
|
+
showTerms: props.showTerms,
|
|
61
|
+
qrEnabled: props.qrEnabled,
|
|
56
62
|
style: props.style,
|
|
57
63
|
origin: props.origin,
|
|
58
64
|
onSuccess: (data) => props.onSuccess?.(data),
|
|
@@ -62,7 +68,7 @@ var FlashpayCheckout = (0, import_vue.defineComponent)({
|
|
|
62
68
|
}
|
|
63
69
|
(0, import_vue.onMounted)(init);
|
|
64
70
|
(0, import_vue.watch)(
|
|
65
|
-
() => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.style, props.origin],
|
|
71
|
+
() => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.showLogo, props.showTerms, props.qrEnabled, props.style, props.origin],
|
|
66
72
|
init,
|
|
67
73
|
{ deep: true }
|
|
68
74
|
);
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/FlashpayCheckout.ts"],"sourcesContent":["export { FlashpayCheckout } from \"./FlashpayCheckout\";\nexport type { FlashpayCheckoutProps } from \"./types\";\nexport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\n","import { defineComponent, ref, watch, onMounted, onUnmounted, h, type PropType } from 'vue';\nimport { checkout } from '@flash-pay/browser-sdk';\nimport type { CheckoutInstance, PaymentEventData } from '@flash-pay/browser-sdk';\n\nexport const FlashpayCheckout = defineComponent({\n name: 'FlashpayCheckout',\n props: {\n transactionId: { type: String, required: true },\n showTitle: { type: Boolean, default: true },\n showDescription: { type: Boolean, default: true },\n showAmount: { type: Boolean, default: true },\n style: { type: Object as PropType<Partial<CSSStyleDeclaration>>, default: undefined },\n origin: { type: String, default: undefined },\n onSuccess: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onFailure: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onClose: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n },\n setup(props) {\n const containerRef = ref<HTMLElement | null>(null);\n let instance: CheckoutInstance | null = null;\n\n function init() {\n instance?.destroy();\n instance = null;\n if (!containerRef.value) return;\n instance = checkout({\n transactionId: props.transactionId,\n container: containerRef.value,\n showTitle: props.showTitle,\n showDescription: props.showDescription,\n showAmount: props.showAmount,\n style: props.style,\n origin: props.origin,\n onSuccess: (data) => props.onSuccess?.(data),\n onFailure: (data) => props.onFailure?.(data),\n onClose: (data) => props.onClose?.(data),\n });\n }\n\n onMounted(init);\n\n // Re-init when any config prop changes; deep:true handles style object mutations\n watch(\n () => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.style, props.origin],\n init,\n { deep: true },\n );\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return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AAM,WAAW,MAAM,iBAAiB,MAAM,YAAY,MAAM,OAAO,MAAM,MAAM;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/FlashpayCheckout.ts"],"sourcesContent":["export { FlashpayCheckout } from \"./FlashpayCheckout\";\nexport type { FlashpayCheckoutProps } from \"./types\";\nexport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\n","import { defineComponent, ref, watch, onMounted, onUnmounted, h, type PropType } from 'vue';\nimport { checkout } from '@flash-pay/browser-sdk';\nimport type { CheckoutInstance, PaymentEventData } from '@flash-pay/browser-sdk';\n\nexport const FlashpayCheckout = defineComponent({\n name: 'FlashpayCheckout',\n props: {\n transactionId: { type: String, required: true },\n showTitle: { type: Boolean, default: true },\n showDescription: { type: Boolean, default: true },\n showAmount: { type: Boolean, default: true },\n showLogo: { type: Boolean, default: true },\n showTerms: { type: Boolean, default: true },\n qrEnabled: { type: Boolean, default: true },\n style: { type: Object as PropType<Partial<CSSStyleDeclaration>>, default: undefined },\n origin: { type: String, default: undefined },\n onSuccess: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onFailure: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onClose: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n },\n setup(props) {\n const containerRef = ref<HTMLElement | null>(null);\n let instance: CheckoutInstance | null = null;\n\n function init() {\n instance?.destroy();\n instance = null;\n if (!containerRef.value) return;\n instance = checkout({\n transactionId: props.transactionId,\n container: containerRef.value,\n showTitle: props.showTitle,\n showDescription: props.showDescription,\n showAmount: props.showAmount,\n showLogo: props.showLogo,\n showTerms: props.showTerms,\n qrEnabled: props.qrEnabled,\n style: props.style,\n origin: props.origin,\n onSuccess: (data) => props.onSuccess?.(data),\n onFailure: (data) => props.onFailure?.(data),\n onClose: (data) => props.onClose?.(data),\n });\n }\n\n onMounted(init);\n\n // Re-init when any config prop changes; deep:true handles style object mutations\n watch(\n () => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.showLogo, props.showTerms, props.qrEnabled, props.style, props.origin],\n init,\n { deep: true },\n );\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => h('div', { ref: containerRef });\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAsF;AACtF,yBAAyB;AAGlB,IAAM,uBAAmB,4BAAgB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,IACL,eAAe,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IAC9C,WAAW,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C,iBAAiB,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAChD,YAAY,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC3C,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IACzC,WAAW,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C,WAAW,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C,OAAO,EAAE,MAAM,QAAkD,SAAS,OAAU;AAAA,IACpF,QAAQ,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,IAC3C,WAAW,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,IAC9F,WAAW,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,IAC9F,SAAS,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,EAC9F;AAAA,EACA,MAAM,OAAO;AACX,UAAM,mBAAe,gBAAwB,IAAI;AACjD,QAAI,WAAoC;AAExC,aAAS,OAAO;AACd,gBAAU,QAAQ;AAClB,iBAAW;AACX,UAAI,CAAC,aAAa,MAAO;AACzB,qBAAW,6BAAS;AAAA,QAClB,eAAe,MAAM;AAAA,QACrB,WAAW,aAAa;AAAA,QACxB,WAAW,MAAM;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB,YAAY,MAAM;AAAA,QAClB,UAAU,MAAM;AAAA,QAChB,WAAW,MAAM;AAAA,QACjB,WAAW,MAAM;AAAA,QACjB,OAAO,MAAM;AAAA,QACb,QAAQ,MAAM;AAAA,QACd,WAAW,CAAC,SAAS,MAAM,YAAY,IAAI;AAAA,QAC3C,WAAW,CAAC,SAAS,MAAM,YAAY,IAAI;AAAA,QAC3C,SAAS,CAAC,SAAS,MAAM,UAAU,IAAI;AAAA,MACzC,CAAC;AAAA,IACH;AAEA,8BAAU,IAAI;AAGd;AAAA,MACE,MAAM,CAAC,MAAM,eAAe,MAAM,WAAW,MAAM,iBAAiB,MAAM,YAAY,MAAM,UAAU,MAAM,WAAW,MAAM,WAAW,MAAM,OAAO,MAAM,MAAM;AAAA,MACjK;AAAA,MACA,EAAE,MAAM,KAAK;AAAA,IACf;AAEA,gCAAY,MAAM;AAChB,gBAAU,QAAQ;AAClB,iBAAW;AAAA,IACb,CAAC;AAED,WAAO,UAAM,cAAE,OAAO,EAAE,KAAK,aAAa,CAAC;AAAA,EAC7C;AACF,CAAC;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,18 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
+
showLogo: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
showTerms: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
qrEnabled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
23
35
|
style: {
|
|
24
36
|
type: PropType<Partial<CSSStyleDeclaration>>;
|
|
25
37
|
default: undefined;
|
|
@@ -59,6 +71,18 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
59
71
|
type: BooleanConstructor;
|
|
60
72
|
default: boolean;
|
|
61
73
|
};
|
|
74
|
+
showLogo: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
showTerms: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
qrEnabled: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
62
86
|
style: {
|
|
63
87
|
type: PropType<Partial<CSSStyleDeclaration>>;
|
|
64
88
|
default: undefined;
|
|
@@ -83,6 +107,9 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
83
107
|
showTitle: boolean;
|
|
84
108
|
showDescription: boolean;
|
|
85
109
|
showAmount: boolean;
|
|
110
|
+
showLogo: boolean;
|
|
111
|
+
showTerms: boolean;
|
|
112
|
+
qrEnabled: boolean;
|
|
86
113
|
style: Partial<CSSStyleDeclaration>;
|
|
87
114
|
origin: string;
|
|
88
115
|
onSuccess: (data: PaymentEventData) => void;
|
|
@@ -98,6 +125,9 @@ interface FlashpayCheckoutProps {
|
|
|
98
125
|
showTitle?: boolean;
|
|
99
126
|
showDescription?: boolean;
|
|
100
127
|
showAmount?: boolean;
|
|
128
|
+
showLogo?: boolean;
|
|
129
|
+
showTerms?: boolean;
|
|
130
|
+
qrEnabled?: boolean;
|
|
101
131
|
style?: Partial<CSSStyleDeclaration>;
|
|
102
132
|
origin?: string;
|
|
103
133
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,18 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
+
showLogo: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
showTerms: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
qrEnabled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
23
35
|
style: {
|
|
24
36
|
type: PropType<Partial<CSSStyleDeclaration>>;
|
|
25
37
|
default: undefined;
|
|
@@ -59,6 +71,18 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
59
71
|
type: BooleanConstructor;
|
|
60
72
|
default: boolean;
|
|
61
73
|
};
|
|
74
|
+
showLogo: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
showTerms: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
qrEnabled: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
62
86
|
style: {
|
|
63
87
|
type: PropType<Partial<CSSStyleDeclaration>>;
|
|
64
88
|
default: undefined;
|
|
@@ -83,6 +107,9 @@ declare const FlashpayCheckout: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
83
107
|
showTitle: boolean;
|
|
84
108
|
showDescription: boolean;
|
|
85
109
|
showAmount: boolean;
|
|
110
|
+
showLogo: boolean;
|
|
111
|
+
showTerms: boolean;
|
|
112
|
+
qrEnabled: boolean;
|
|
86
113
|
style: Partial<CSSStyleDeclaration>;
|
|
87
114
|
origin: string;
|
|
88
115
|
onSuccess: (data: PaymentEventData) => void;
|
|
@@ -98,6 +125,9 @@ interface FlashpayCheckoutProps {
|
|
|
98
125
|
showTitle?: boolean;
|
|
99
126
|
showDescription?: boolean;
|
|
100
127
|
showAmount?: boolean;
|
|
128
|
+
showLogo?: boolean;
|
|
129
|
+
showTerms?: boolean;
|
|
130
|
+
qrEnabled?: boolean;
|
|
101
131
|
style?: Partial<CSSStyleDeclaration>;
|
|
102
132
|
origin?: string;
|
|
103
133
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -8,6 +8,9 @@ var FlashpayCheckout = defineComponent({
|
|
|
8
8
|
showTitle: { type: Boolean, default: true },
|
|
9
9
|
showDescription: { type: Boolean, default: true },
|
|
10
10
|
showAmount: { type: Boolean, default: true },
|
|
11
|
+
showLogo: { type: Boolean, default: true },
|
|
12
|
+
showTerms: { type: Boolean, default: true },
|
|
13
|
+
qrEnabled: { type: Boolean, default: true },
|
|
11
14
|
style: { type: Object, default: void 0 },
|
|
12
15
|
origin: { type: String, default: void 0 },
|
|
13
16
|
onSuccess: { type: Function, default: void 0 },
|
|
@@ -27,6 +30,9 @@ var FlashpayCheckout = defineComponent({
|
|
|
27
30
|
showTitle: props.showTitle,
|
|
28
31
|
showDescription: props.showDescription,
|
|
29
32
|
showAmount: props.showAmount,
|
|
33
|
+
showLogo: props.showLogo,
|
|
34
|
+
showTerms: props.showTerms,
|
|
35
|
+
qrEnabled: props.qrEnabled,
|
|
30
36
|
style: props.style,
|
|
31
37
|
origin: props.origin,
|
|
32
38
|
onSuccess: (data) => props.onSuccess?.(data),
|
|
@@ -36,7 +42,7 @@ var FlashpayCheckout = defineComponent({
|
|
|
36
42
|
}
|
|
37
43
|
onMounted(init);
|
|
38
44
|
watch(
|
|
39
|
-
() => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.style, props.origin],
|
|
45
|
+
() => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.showLogo, props.showTerms, props.qrEnabled, props.style, props.origin],
|
|
40
46
|
init,
|
|
41
47
|
{ deep: true }
|
|
42
48
|
);
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/FlashpayCheckout.ts"],"sourcesContent":["import { defineComponent, ref, watch, onMounted, onUnmounted, h, type PropType } from 'vue';\nimport { checkout } from '@flash-pay/browser-sdk';\nimport type { CheckoutInstance, PaymentEventData } from '@flash-pay/browser-sdk';\n\nexport const FlashpayCheckout = defineComponent({\n name: 'FlashpayCheckout',\n props: {\n transactionId: { type: String, required: true },\n showTitle: { type: Boolean, default: true },\n showDescription: { type: Boolean, default: true },\n showAmount: { type: Boolean, default: true },\n style: { type: Object as PropType<Partial<CSSStyleDeclaration>>, default: undefined },\n origin: { type: String, default: undefined },\n onSuccess: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onFailure: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onClose: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n },\n setup(props) {\n const containerRef = ref<HTMLElement | null>(null);\n let instance: CheckoutInstance | null = null;\n\n function init() {\n instance?.destroy();\n instance = null;\n if (!containerRef.value) return;\n instance = checkout({\n transactionId: props.transactionId,\n container: containerRef.value,\n showTitle: props.showTitle,\n showDescription: props.showDescription,\n showAmount: props.showAmount,\n style: props.style,\n origin: props.origin,\n onSuccess: (data) => props.onSuccess?.(data),\n onFailure: (data) => props.onFailure?.(data),\n onClose: (data) => props.onClose?.(data),\n });\n }\n\n onMounted(init);\n\n // Re-init when any config prop changes; deep:true handles style object mutations\n watch(\n () => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.style, props.origin],\n init,\n { deep: true },\n );\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => h('div', { ref: containerRef });\n },\n});\n"],"mappings":";AAAA,SAAS,iBAAiB,KAAK,OAAO,WAAW,aAAa,SAAwB;AACtF,SAAS,gBAAgB;AAGlB,IAAM,mBAAmB,gBAAgB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,IACL,eAAe,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IAC9C,WAAW,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C,iBAAiB,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAChD,YAAY,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC3C,OAAO,EAAE,MAAM,QAAkD,SAAS,OAAU;AAAA,IACpF,QAAQ,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,IAC3C,WAAW,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,IAC9F,WAAW,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,IAC9F,SAAS,EAAE,MAAM,UAAwD,SAAS,OAAU;AAAA,EAC9F;AAAA,EACA,MAAM,OAAO;AACX,UAAM,eAAe,IAAwB,IAAI;AACjD,QAAI,WAAoC;AAExC,aAAS,OAAO;AACd,gBAAU,QAAQ;AAClB,iBAAW;AACX,UAAI,CAAC,aAAa,MAAO;AACzB,iBAAW,SAAS;AAAA,QAClB,eAAe,MAAM;AAAA,QACrB,WAAW,aAAa;AAAA,QACxB,WAAW,MAAM;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB,YAAY,MAAM;AAAA,QAClB,OAAO,MAAM;AAAA,QACb,QAAQ,MAAM;AAAA,QACd,WAAW,CAAC,SAAS,MAAM,YAAY,IAAI;AAAA,QAC3C,WAAW,CAAC,SAAS,MAAM,YAAY,IAAI;AAAA,QAC3C,SAAS,CAAC,SAAS,MAAM,UAAU,IAAI;AAAA,MACzC,CAAC;AAAA,IACH;AAEA,cAAU,IAAI;AAGd;AAAA,MACE,MAAM,CAAC,MAAM,eAAe,MAAM,WAAW,MAAM,iBAAiB,MAAM,YAAY,MAAM,OAAO,MAAM,MAAM;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/FlashpayCheckout.ts"],"sourcesContent":["import { defineComponent, ref, watch, onMounted, onUnmounted, h, type PropType } from 'vue';\nimport { checkout } from '@flash-pay/browser-sdk';\nimport type { CheckoutInstance, PaymentEventData } from '@flash-pay/browser-sdk';\n\nexport const FlashpayCheckout = defineComponent({\n name: 'FlashpayCheckout',\n props: {\n transactionId: { type: String, required: true },\n showTitle: { type: Boolean, default: true },\n showDescription: { type: Boolean, default: true },\n showAmount: { type: Boolean, default: true },\n showLogo: { type: Boolean, default: true },\n showTerms: { type: Boolean, default: true },\n qrEnabled: { type: Boolean, default: true },\n style: { type: Object as PropType<Partial<CSSStyleDeclaration>>, default: undefined },\n origin: { type: String, default: undefined },\n onSuccess: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onFailure: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n onClose: { type: Function as PropType<(data: PaymentEventData) => void>, default: undefined },\n },\n setup(props) {\n const containerRef = ref<HTMLElement | null>(null);\n let instance: CheckoutInstance | null = null;\n\n function init() {\n instance?.destroy();\n instance = null;\n if (!containerRef.value) return;\n instance = checkout({\n transactionId: props.transactionId,\n container: containerRef.value,\n showTitle: props.showTitle,\n showDescription: props.showDescription,\n showAmount: props.showAmount,\n showLogo: props.showLogo,\n showTerms: props.showTerms,\n qrEnabled: props.qrEnabled,\n style: props.style,\n origin: props.origin,\n onSuccess: (data) => props.onSuccess?.(data),\n onFailure: (data) => props.onFailure?.(data),\n onClose: (data) => props.onClose?.(data),\n });\n }\n\n onMounted(init);\n\n // Re-init when any config prop changes; deep:true handles style object mutations\n watch(\n () => [props.transactionId, props.showTitle, props.showDescription, props.showAmount, props.showLogo, props.showTerms, props.qrEnabled, props.style, props.origin],\n init,\n { deep: true },\n );\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => h('div', { ref: containerRef });\n },\n});\n"],"mappings":";AAAA,SAAS,iBAAiB,KAAK,OAAO,WAAW,aAAa,SAAwB;AACtF,SAAS,gBAAgB;AAGlB,IAAM,mBAAmB,gBAAgB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,IACL,eAAe,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IAC9C,WAAW,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C,iBAAiB,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAChD,YAAY,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC3C,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IACzC,WAAW,EAAE,MAAM,SAAS,SAAS,KAA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