@juspay-tech/react-hyper-js 1.2.2 → 1.2.3
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/LICENSE +201 -0
- package/README.md +35 -1
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/package.json +31 -31
- package/.babelrc +0 -3
- package/CHANGELOG.md +0 -15
- package/build.js +0 -38
- package/index.js +0 -1
- package/index.mjs +0 -1
- package/rescript.json +0 -23
- package/src/Context.bs.js +0 -173
- package/src/Context.res +0 -232
- package/src/Index.bs.js +0 -101
- package/src/Index.res +0 -58
- package/src/Index.resi +0 -204
- package/src/OrcaJs.bs.js +0 -63
- package/src/OrcaJs.res +0 -66
- package/src/Window.bs.js +0 -11
- package/src/Window.res +0 -26
- package/src/components/ApplePayElement.bs.js +0 -26
- package/src/components/ApplePayElement.res +0 -25
- package/src/components/CardCVC.bs.js +0 -26
- package/src/components/CardCVC.res +0 -25
- package/src/components/CardElement.bs.js +0 -26
- package/src/components/CardElement.res +0 -25
- package/src/components/CardExpiry.bs.js +0 -26
- package/src/components/CardExpiry.res +0 -25
- package/src/components/CardNumber.bs.js +0 -26
- package/src/components/CardNumber.res +0 -25
- package/src/components/Elements.bs.js +0 -71
- package/src/components/Elements.res +0 -39
- package/src/components/ExpressCheckoutElement.bs.js +0 -26
- package/src/components/ExpressCheckoutElement.res +0 -25
- package/src/components/GooglePayElement.bs.js +0 -26
- package/src/components/GooglePayElement.res +0 -25
- package/src/components/HyperElements.bs.js +0 -71
- package/src/components/HyperElements.res +0 -39
- package/src/components/HyperManagementElements.bs.js +0 -65
- package/src/components/HyperManagementElements.res +0 -41
- package/src/components/PayPalElement.bs.js +0 -26
- package/src/components/PayPalElement.res +0 -25
- package/src/components/PaymentElement.bs.js +0 -26
- package/src/components/PaymentElement.res +0 -25
- package/src/components/PaymentElementsWrapper.bs.js +0 -54
- package/src/components/PaymentElementsWrapper.res +0 -39
- package/src/components/PaymentMethodsManagementElement.bs.js +0 -58
- package/src/components/PaymentMethodsManagementElement.res +0 -45
- package/src/components/PazeElement.bs.js +0 -26
- package/src/components/PazeElement.res +0 -25
- package/webpack.config.js +0 -34
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2022] [Juspay Technologies]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
# @juspay-tech/react-hyper-js
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The `@juspay-tech/react-hyper-js` package provides a suite of React components that enable seamless integration of HyperSwitch's secure checkout and payment features into your React applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the package via npm or yarn:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @juspay-tech/react-hyper-js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
or
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @juspay-tech/react-hyper-js
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
To integrate this project, refer to the [Integration Guide](https://docs.hyperswitch.io/explore-hyperswitch/merchant-controls/integration-guide/web/node-and-react) for step-by-step instructions on setting up with **Node.js** and **React**.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Offers a comprehensive set of React components for seamless merchant integration.
|
|
26
|
+
|
|
27
|
+
## Development and Contributions
|
|
28
|
+
|
|
29
|
+
Contributions are welcome! Please ensure that your changes align with the existing code style and add appropriate documentation.
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
This project is licensed under the Apache License. See the [LICENSE](./LICENSE) file for details.
|
|
34
|
+
|
|
35
|
+
## Support
|
|
36
|
+
|
|
37
|
+
For further assistance, please contact [Support](https://github.com/juspay/hyperswitch-web/issues).
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(()=>{var gt=Object.create;var we=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var St=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty;var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wt=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Rt(t))!Ot.call(e,r)&&r!==o&&we(e,r,{get:()=>t[r],enumerable:!(n=kt(t,r))||n.enumerable});return e};var s=(e,t,o)=>(o=e!=null?gt(St(e)):{},wt(t||!e||!e.__esModule?we(o,"default",{value:e,enumerable:!0}):o,e));var Ie=L(l=>{"use strict";var I=Symbol.for("react.element"),Mt=Symbol.for("react.portal"),Bt=Symbol.for("react.fragment"),Nt=Symbol.for("react.strict_mode"),bt=Symbol.for("react.profiler"),Vt=Symbol.for("react.provider"),Ft=Symbol.for("react.context"),Tt=Symbol.for("react.forward_ref"),Jt=Symbol.for("react.suspense"),$t=Symbol.for("react.memo"),Ut=Symbol.for("react.lazy"),Me=Symbol.iterator;function jt(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var be={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ve=Object.assign,Fe={};function M(e,t,o){this.props=e,this.context=t,this.refs=Fe,this.updater=o||be}M.prototype.isReactComponent={};M.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};M.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Te(){}Te.prototype=M.prototype;function ce(e,t,o){this.props=e,this.context=t,this.refs=Fe,this.updater=o||be}var fe=ce.prototype=new Te;fe.constructor=ce;Ve(fe,M.prototype);fe.isPureReactComponent=!0;var Be=Array.isArray,Je=Object.prototype.hasOwnProperty,se={current:null},$e={key:!0,ref:!0,__self:!0,__source:!0};function Ue(e,t,o){var n,r={},u=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(u=""+t.key),t)Je.call(t,n)&&!$e.hasOwnProperty(n)&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=o;else if(1<i){for(var c=Array(i),m=0;m<i;m++)c[m]=arguments[m+2];r.children=c}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return{$$typeof:I,type:e,key:u,ref:a,props:r,_owner:se.current}}function It(e,t){return{$$typeof:I,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function de(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}function Dt(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return t[o]})}var Ne=/\/+/g;function le(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Dt(""+e.key):t.toString(36)}function X(e,t,o,n,r){var u=typeof e;(u==="undefined"||u==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case I:case Mt:a=!0}}if(a)return a=e,r=r(a),e=n===""?"."+le(a,0):n,Be(r)?(o="",e!=null&&(o=e.replace(Ne,"$&/")+"/"),X(r,t,o,"",function(m){return m})):r!=null&&(de(r)&&(r=It(r,o+(!r.key||a&&a.key===r.key?"":(""+r.key).replace(Ne,"$&/")+"/")+e)),t.push(r)),1;if(a=0,n=n===""?".":n+":",Be(e))for(var i=0;i<e.length;i++){u=e[i];var c=n+le(u,i);a+=X(u,t,o,c,r)}else if(c=jt(e),typeof c=="function")for(e=c.call(e),i=0;!(u=e.next()).done;)u=u.value,c=n+le(u,i++),a+=X(u,t,o,c,r);else if(u==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function z(e,t,o){if(e==null)return e;var n=[],r=0;return X(e,n,"","",function(u){return t.call(o,u,r++)}),n}function At(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(o){(e._status===0||e._status===-1)&&(e._status=1,e._result=o)},function(o){(e._status===0||e._status===-1)&&(e._status=2,e._result=o)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var v={current:null},Y={transition:null},Wt={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:Y,ReactCurrentOwner:se};function je(){throw Error("act(...) is not supported in production builds of React.")}l.Children={map:z,forEach:function(e,t,o){z(e,function(){t.apply(this,arguments)},o)},count:function(e){var t=0;return z(e,function(){t++}),t},toArray:function(e){return z(e,function(t){return t})||[]},only:function(e){if(!de(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};l.Component=M;l.Fragment=Bt;l.Profiler=bt;l.PureComponent=ce;l.StrictMode=Nt;l.Suspense=Jt;l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wt;l.act=je;l.cloneElement=function(e,t,o){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Ve({},e.props),r=e.key,u=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(u=t.ref,a=se.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(c in t)Je.call(t,c)&&!$e.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&i!==void 0?i[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=o;else if(1<c){i=Array(c);for(var m=0;m<c;m++)i[m]=arguments[m+2];n.children=i}return{$$typeof:I,type:e.type,key:r,ref:u,props:n,_owner:a}};l.createContext=function(e){return e={$$typeof:Ft,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Vt,_context:e},e.Consumer=e};l.createElement=Ue;l.createFactory=function(e){var t=Ue.bind(null,e);return t.type=e,t};l.createRef=function(){return{current:null}};l.forwardRef=function(e){return{$$typeof:Tt,render:e}};l.isValidElement=de;l.lazy=function(e){return{$$typeof:Ut,_payload:{_status:-1,_result:e},_init:At}};l.memo=function(e,t){return{$$typeof:$t,type:e,compare:t===void 0?null:t}};l.startTransition=function(e){var t=Y.transition;Y.transition={};try{e()}finally{Y.transition=t}};l.unstable_act=je;l.useCallback=function(e,t){return v.current.useCallback(e,t)};l.useContext=function(e){return v.current.useContext(e)};l.useDebugValue=function(){};l.useDeferredValue=function(e){return v.current.useDeferredValue(e)};l.useEffect=function(e,t){return v.current.useEffect(e,t)};l.useId=function(){return v.current.useId()};l.useImperativeHandle=function(e,t,o){return v.current.useImperativeHandle(e,t,o)};l.useInsertionEffect=function(e,t){return v.current.useInsertionEffect(e,t)};l.useLayoutEffect=function(e,t){return v.current.useLayoutEffect(e,t)};l.useMemo=function(e,t){return v.current.useMemo(e,t)};l.useReducer=function(e,t,o){return v.current.useReducer(e,t,o)};l.useRef=function(e){return v.current.useRef(e)};l.useState=function(e){return v.current.useState(e)};l.useSyncExternalStore=function(e,t,o){return v.current.useSyncExternalStore(e,t,o)};l.useTransition=function(){return v.current.useTransition()};l.version="18.3.1"});var x=L((mr,De)=>{"use strict";De.exports=Ie()});var We=L(Q=>{"use strict";var qt=x(),Ht=Symbol.for("react.element"),Gt=Symbol.for("react.fragment"),Kt=Object.prototype.hasOwnProperty,Lt=qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zt={key:!0,ref:!0,__self:!0,__source:!0};function Ae(e,t,o){var n,r={},u=null,a=null;o!==void 0&&(u=""+o),t.key!==void 0&&(u=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)Kt.call(t,n)&&!zt.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)r[n]===void 0&&(r[n]=t[n]);return{$$typeof:Ht,type:e,key:u,ref:a,props:r,_owner:Lt.current}}Q.Fragment=Gt;Q.jsx=Ae;Q.jsxs=Ae});var y=L((cr,qe)=>{"use strict";qe.exports=We()});var K=s(x());var rt=s(y());var R=s(x());var D=s(x());function Xt(e,t){}function Yt(){}function Qt(){}function Zt(e){}function en(){}function tn(){}function nn(e){}function rn(){}function on(){}function un(e){}var He={on:Xt,collapse:Yt,blur:Qt,update:Zt,destroy:en,unmount:tn,mount:nn,focus:rn,clear:on,onSDKHandleClick:un};function mn(e){if(typeof e=="boolean")return e}function ln(e){if(e===null)return null}function cn(e){if(typeof e=="string")return e}function fn(e){if(typeof e=="number")return e}function sn(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return e}function dn(e){if(Array.isArray(e))return e}var g={bool:mn,$$null:ln,string:cn,$$float:fn,object:sn,array:dn};function pe(e,t,o){for(var n=new Array(o),r=0,u=t;r<o;)n[r]=e[u],r=r+1|0,u=u+1|0;return n}function Ge(e,t){for(;;){var o=t,n=e,r=n.length,u=r===0?1:r,a=o.length,i=u-a|0;if(i===0)return n.apply(null,o);if(i>=0)return function(c,m){return function(f){return Ge(c,m.concat([f]))}}(n,o);t=pe(o,u,-i|0),e=n.apply(null,pe(o,0,u))}}function Cn(e,t){var o=e.length;if(o===1)return e(t);switch(o){case 1:return e(t);case 2:return function(n){return e(t,n)};case 3:return function(n,r){return e(t,n,r)};case 4:return function(n,r,u){return e(t,n,r,u)};case 5:return function(n,r,u,a){return e(t,n,r,u,a)};case 6:return function(n,r,u,a,i){return e(t,n,r,u,a,i)};case 7:return function(n,r,u,a,i,c){return e(t,n,r,u,a,i,c)};default:return Ge(e,[t])}}function Z(e){var t=e.length;return t===1?e:function(o){return Cn(e,o)}}function B(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function ee(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function vn(e,t){if(e!==void 0)return t(ee(e))}function N(e,t){return vn(e,Z(t))}function k(e,t){return e!==void 0?ee(e):t}function hn(e){return Promise.resolve({})}function Pn(e,t,o){return Promise.resolve({})}function xn(e){return Promise.resolve({})}function Le(e){return e}function gn(e){return Promise.resolve({})}function kn(){return Promise.resolve({})}var A={clientSecret:"",confirmPayment:hn,confirmCardPayment:Pn,retrievePaymentIntent:xn,paymentRequest:Le,completeUpdateIntent:gn,initiateUpdateIntent:kn},V=D.createContext(A),Rn=V.Provider,ne={make:Rn},ye={ephemeralKey:"",paymentRequest:Le},Ce=D.createContext(ye),Sn=Ce.Provider,ze={make:Sn};function b(e,t,o){return k(N(e[t],g.string),o)}function re(e){var t=k(g.object(e),{});return{fonts:k(N(t.fonts,g.array),[]),locale:b(t,"locale",""),clientSecret:b(t,"clientSecret",""),appearance:k(N(t.appearance,g.object),{}),loader:b(t,"loader","auto")}}function Xe(e){}function Ye(e){}function Qe(){return new Promise(function(e,t){setTimeout(function(){e({})},1e3)})}function Ze(e,t){return He}var On={fonts:[],locale:"",clientSecret:"",appearance:{},loader:""},W={options:On,update:Xe,getElement:Ye,fetchUpdates:Qe,create:Ze},F=D.createContext(W),wn=F.Provider,oe={make:wn};function et(e){var t=k(g.object(e),{});return{fonts:k(N(t.fonts,g.array),[]),locale:b(t,"locale",""),ephemeralKey:b(t,"ephemeralKey",""),appearance:k(N(t.appearance,g.object),{}),loader:b(t,"loader","auto")}}var Mn={fonts:[],locale:"",ephemeralKey:"",appearance:{},loader:""},ve={options:Mn,update:Xe,getElement:Ye,fetchUpdates:Qe,create:Ze},_e=D.createContext(ve),Bn=_e.Provider,tt={make:Bn};var nt=s(y());function Nn(e){var t=e.onPaymentButtonClick,o=e.onPaymentComplete,n=e.onClick,r=e.onBlur,u=e.onFocus,a=e.componentType,i=e.onReady,c=e.onChange,m=e.options,f=e.id,h=f!==void 0?f:"payment-Element",E=R.useContext(V),_=R.useContext(F),p=R.useRef(null),C=_.create(a,m);return R.useEffect(function(){var O=_.create(a,m);O.mount("#orca-elements-payment-element-"+h)},[p,_]),R.useEffect(function(){C.on("ready",i),C.on("focus",u),C.on("blur",r),C.on("clickTriggered",n),C.on("change",c),C.on("completeDoThis",o),C.onSDKHandleClick(t)},[_,E]),nt.jsx("div",{ref:B(p),id:"orca-elements-payment-element-"+h})}var d=Nn;function bn(e){return rt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardCvc",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Ee=bn;var q=s(x());function J(e,t){return t.then(Z(e))}var Pe=s(y());function Fn(e){var t=e.options,o=e.stripe,n=re(t),r=q.useState(function(){return A}),u=r[1],a=q.useState(function(){return W}),i=a[1];return q.useEffect(function(){(function(c){return J(function(m){var f=m.elements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.clientSecret,$=m.confirmPayment,w=m.confirmCardPayment,U=m.retrievePaymentIntent,ue=m.paymentRequest,ae=m.completeUpdateIntent,ie=m.initiateUpdateIntent,j={clientSecret:O,confirmPayment:$,confirmCardPayment:w,retrievePaymentIntent:U,paymentRequest:ue,completeUpdateIntent:ae,initiateUpdateIntent:ie};return u(function(me){return j}),i(function(me){return C}),Promise.resolve(j)},c)})(o)},[]),Pe.jsx(ne.make,{value:r[0],children:Pe.jsx(oe.make,{value:a[0],children:e.children})})}var ot=Fn;var ut=s(y());function Jn(e){return ut.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardExpiry",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var xe=Jn;var at=s(y());function Un(e){return at.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardNumber",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ge=Un;var it=s(y());function In(e){return it.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"card",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ke=In;var mt=s(y());function An(e){return mt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"paze",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var lt=An;var H=s(x());var Re=s(y());function qn(e){var t=e.options,o=e.hyper,n=re(t),r=H.useState(function(){return A}),u=r[1],a=H.useState(function(){return W}),i=a[1];return H.useEffect(function(){(function(c){return J(function(m){var f=m.elements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.clientSecret,$=m.confirmPayment,w=m.confirmCardPayment,U=m.retrievePaymentIntent,ue=m.paymentRequest,ae=m.completeUpdateIntent,ie=m.initiateUpdateIntent,j={clientSecret:O,confirmPayment:$,confirmCardPayment:w,retrievePaymentIntent:U,paymentRequest:ue,completeUpdateIntent:ae,initiateUpdateIntent:ie};return u(function(me){return j}),i(function(me){return C}),Promise.resolve(j)},c)})(o)},[]),Re.jsx(ne.make,{value:r[0],children:Re.jsx(oe.make,{value:a[0],children:e.children})})}var ct=qn;var ft=s(y());function Gn(e){return ft.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payPal",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var st=Gn;var dt=s(y());function Ln(e){return dt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payment",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Se=Ln;var pt=s(y());function Xn(e){return pt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"applePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var yt=Xn;var Ct=s(y());function Qn(e){return Ct.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"googlePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var vt=Qn;var _t=s(y());function er(e){return _t.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"expressCheckout",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Et=er;var G=s(x());var Oe=s(y());function nr(e){var t=e.options,o=e.hyper,n=et(t),r=G.useState(function(){return ye}),u=r[1],a=G.useState(function(){return ve}),i=a[1];return G.useEffect(function(){(function(c){return J(function(m){var f=m.paymentMethodsManagementElements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.ephemeralKey,$=m.paymentRequest,w={ephemeralKey:O,paymentRequest:$};return u(function(U){return w}),i(function(U){return C}),Promise.resolve(w)},c)})(o)},[]),Oe.jsx(ze.make,{value:r[0],children:Oe.jsx(tt.make,{value:a[0],children:e.children})})}var ht=nr;var S=s(x());var Pt=s(y());function or(e){var t=e.onClick,o=e.onBlur,n=e.onFocus,r=e.componentType,u=e.onReady,a=e.onChange,i=e.options,c=e.id,m=c!==void 0?c:"payment-management",f=r!==void 0?r:"paymentMethodsManagement",h=S.useContext(Ce),E=S.useContext(_e),_=S.useRef(null),p=E.create(f,i);return S.useEffect(function(){var C=E.create(f,i);C.mount("#orca-elements-payment-management-"+m)},[_,E]),S.useEffect(function(){return p.on("ready",u),p.on("focus",n),p.on("blur",o),p.on("clickTriggered",t),p.on("change",a),function(){p.on("ready",void 0),p.on("focus",void 0),p.on("blur",void 0),p.on("clickTriggered",void 0),p.on("change",void 0)}},[E,h]),Pt.jsx("div",{ref:B(_),id:"orca-elements-payment-management-"+m})}var xt=or;function sr(){return K.useContext(V)}function dr(){return console.warn("useStripe() is deprecated. Use useHyper() instead"),K.useContext(V)}function pr(){return K.useContext(F)}function yr(){return console.warn("useElements() is deprecated. Use useWidgets() instead"),K.useContext(F)}var Cr=ot,vr=ct,_r=Se,Er=Se,hr=ke,Pr=ke,xr=ge,gr=ge,kr=Ee,Rr=Ee,Sr=xe,Or=xe,wr=vt,Mr=yt,Br=lt,Nr=st,br=Et,Vr=ht,Fr=xt;})();
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.min.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.min.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.min.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.min.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var gt=Object.create;var we=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var St=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty;var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wt=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Rt(t))!Ot.call(e,r)&&r!==o&&we(e,r,{get:()=>t[r],enumerable:!(n=kt(t,r))||n.enumerable});return e};var s=(e,t,o)=>(o=e!=null?gt(St(e)):{},wt(t||!e||!e.__esModule?we(o,"default",{value:e,enumerable:!0}):o,e));var Ie=L(l=>{"use strict";var I=Symbol.for("react.element"),Mt=Symbol.for("react.portal"),Bt=Symbol.for("react.fragment"),Nt=Symbol.for("react.strict_mode"),bt=Symbol.for("react.profiler"),Vt=Symbol.for("react.provider"),Ft=Symbol.for("react.context"),Tt=Symbol.for("react.forward_ref"),Jt=Symbol.for("react.suspense"),$t=Symbol.for("react.memo"),Ut=Symbol.for("react.lazy"),Me=Symbol.iterator;function jt(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var be={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ve=Object.assign,Fe={};function M(e,t,o){this.props=e,this.context=t,this.refs=Fe,this.updater=o||be}M.prototype.isReactComponent={};M.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};M.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Te(){}Te.prototype=M.prototype;function ce(e,t,o){this.props=e,this.context=t,this.refs=Fe,this.updater=o||be}var fe=ce.prototype=new Te;fe.constructor=ce;Ve(fe,M.prototype);fe.isPureReactComponent=!0;var Be=Array.isArray,Je=Object.prototype.hasOwnProperty,se={current:null},$e={key:!0,ref:!0,__self:!0,__source:!0};function Ue(e,t,o){var n,r={},u=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(u=""+t.key),t)Je.call(t,n)&&!$e.hasOwnProperty(n)&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=o;else if(1<i){for(var c=Array(i),m=0;m<i;m++)c[m]=arguments[m+2];r.children=c}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return{$$typeof:I,type:e,key:u,ref:a,props:r,_owner:se.current}}function It(e,t){return{$$typeof:I,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function de(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}function Dt(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return t[o]})}var Ne=/\/+/g;function le(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Dt(""+e.key):t.toString(36)}function X(e,t,o,n,r){var u=typeof e;(u==="undefined"||u==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case I:case Mt:a=!0}}if(a)return a=e,r=r(a),e=n===""?"."+le(a,0):n,Be(r)?(o="",e!=null&&(o=e.replace(Ne,"$&/")+"/"),X(r,t,o,"",function(m){return m})):r!=null&&(de(r)&&(r=It(r,o+(!r.key||a&&a.key===r.key?"":(""+r.key).replace(Ne,"$&/")+"/")+e)),t.push(r)),1;if(a=0,n=n===""?".":n+":",Be(e))for(var i=0;i<e.length;i++){u=e[i];var c=n+le(u,i);a+=X(u,t,o,c,r)}else if(c=jt(e),typeof c=="function")for(e=c.call(e),i=0;!(u=e.next()).done;)u=u.value,c=n+le(u,i++),a+=X(u,t,o,c,r);else if(u==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function z(e,t,o){if(e==null)return e;var n=[],r=0;return X(e,n,"","",function(u){return t.call(o,u,r++)}),n}function At(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(o){(e._status===0||e._status===-1)&&(e._status=1,e._result=o)},function(o){(e._status===0||e._status===-1)&&(e._status=2,e._result=o)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var v={current:null},Y={transition:null},Wt={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:Y,ReactCurrentOwner:se};function je(){throw Error("act(...) is not supported in production builds of React.")}l.Children={map:z,forEach:function(e,t,o){z(e,function(){t.apply(this,arguments)},o)},count:function(e){var t=0;return z(e,function(){t++}),t},toArray:function(e){return z(e,function(t){return t})||[]},only:function(e){if(!de(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};l.Component=M;l.Fragment=Bt;l.Profiler=bt;l.PureComponent=ce;l.StrictMode=Nt;l.Suspense=Jt;l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wt;l.act=je;l.cloneElement=function(e,t,o){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Ve({},e.props),r=e.key,u=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(u=t.ref,a=se.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(c in t)Je.call(t,c)&&!$e.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&i!==void 0?i[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=o;else if(1<c){i=Array(c);for(var m=0;m<c;m++)i[m]=arguments[m+2];n.children=i}return{$$typeof:I,type:e.type,key:r,ref:u,props:n,_owner:a}};l.createContext=function(e){return e={$$typeof:Ft,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Vt,_context:e},e.Consumer=e};l.createElement=Ue;l.createFactory=function(e){var t=Ue.bind(null,e);return t.type=e,t};l.createRef=function(){return{current:null}};l.forwardRef=function(e){return{$$typeof:Tt,render:e}};l.isValidElement=de;l.lazy=function(e){return{$$typeof:Ut,_payload:{_status:-1,_result:e},_init:At}};l.memo=function(e,t){return{$$typeof:$t,type:e,compare:t===void 0?null:t}};l.startTransition=function(e){var t=Y.transition;Y.transition={};try{e()}finally{Y.transition=t}};l.unstable_act=je;l.useCallback=function(e,t){return v.current.useCallback(e,t)};l.useContext=function(e){return v.current.useContext(e)};l.useDebugValue=function(){};l.useDeferredValue=function(e){return v.current.useDeferredValue(e)};l.useEffect=function(e,t){return v.current.useEffect(e,t)};l.useId=function(){return v.current.useId()};l.useImperativeHandle=function(e,t,o){return v.current.useImperativeHandle(e,t,o)};l.useInsertionEffect=function(e,t){return v.current.useInsertionEffect(e,t)};l.useLayoutEffect=function(e,t){return v.current.useLayoutEffect(e,t)};l.useMemo=function(e,t){return v.current.useMemo(e,t)};l.useReducer=function(e,t,o){return v.current.useReducer(e,t,o)};l.useRef=function(e){return v.current.useRef(e)};l.useState=function(e){return v.current.useState(e)};l.useSyncExternalStore=function(e,t,o){return v.current.useSyncExternalStore(e,t,o)};l.useTransition=function(){return v.current.useTransition()};l.version="18.3.1"});var x=L((mr,De)=>{"use strict";De.exports=Ie()});var We=L(Q=>{"use strict";var qt=x(),Ht=Symbol.for("react.element"),Gt=Symbol.for("react.fragment"),Kt=Object.prototype.hasOwnProperty,Lt=qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zt={key:!0,ref:!0,__self:!0,__source:!0};function Ae(e,t,o){var n,r={},u=null,a=null;o!==void 0&&(u=""+o),t.key!==void 0&&(u=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)Kt.call(t,n)&&!zt.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)r[n]===void 0&&(r[n]=t[n]);return{$$typeof:Ht,type:e,key:u,ref:a,props:r,_owner:Lt.current}}Q.Fragment=Gt;Q.jsx=Ae;Q.jsxs=Ae});var y=L((cr,qe)=>{"use strict";qe.exports=We()});var K=s(x());var rt=s(y());var R=s(x());var D=s(x());function Xt(e,t){}function Yt(){}function Qt(){}function Zt(e){}function en(){}function tn(){}function nn(e){}function rn(){}function on(){}function un(e){}var He={on:Xt,collapse:Yt,blur:Qt,update:Zt,destroy:en,unmount:tn,mount:nn,focus:rn,clear:on,onSDKHandleClick:un};function mn(e){if(typeof e=="boolean")return e}function ln(e){if(e===null)return null}function cn(e){if(typeof e=="string")return e}function fn(e){if(typeof e=="number")return e}function sn(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return e}function dn(e){if(Array.isArray(e))return e}var g={bool:mn,$$null:ln,string:cn,$$float:fn,object:sn,array:dn};function pe(e,t,o){for(var n=new Array(o),r=0,u=t;r<o;)n[r]=e[u],r=r+1|0,u=u+1|0;return n}function Ge(e,t){for(;;){var o=t,n=e,r=n.length,u=r===0?1:r,a=o.length,i=u-a|0;if(i===0)return n.apply(null,o);if(i>=0)return function(c,m){return function(f){return Ge(c,m.concat([f]))}}(n,o);t=pe(o,u,-i|0),e=n.apply(null,pe(o,0,u))}}function Cn(e,t){var o=e.length;if(o===1)return e(t);switch(o){case 1:return e(t);case 2:return function(n){return e(t,n)};case 3:return function(n,r){return e(t,n,r)};case 4:return function(n,r,u){return e(t,n,r,u)};case 5:return function(n,r,u,a){return e(t,n,r,u,a)};case 6:return function(n,r,u,a,i){return e(t,n,r,u,a,i)};case 7:return function(n,r,u,a,i,c){return e(t,n,r,u,a,i,c)};default:return Ge(e,[t])}}function Z(e){var t=e.length;return t===1?e:function(o){return Cn(e,o)}}function B(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function ee(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function vn(e,t){if(e!==void 0)return t(ee(e))}function N(e,t){return vn(e,Z(t))}function k(e,t){return e!==void 0?ee(e):t}function hn(e){return Promise.resolve({})}function Pn(e,t,o){return Promise.resolve({})}function xn(e){return Promise.resolve({})}function Le(e){return e}function gn(e){return Promise.resolve({})}function kn(){return Promise.resolve({})}var A={clientSecret:"",confirmPayment:hn,confirmCardPayment:Pn,retrievePaymentIntent:xn,paymentRequest:Le,completeUpdateIntent:gn,initiateUpdateIntent:kn},V=D.createContext(A),Rn=V.Provider,ne={make:Rn},ye={ephemeralKey:"",paymentRequest:Le},Ce=D.createContext(ye),Sn=Ce.Provider,ze={make:Sn};function b(e,t,o){return k(N(e[t],g.string),o)}function re(e){var t=k(g.object(e),{});return{fonts:k(N(t.fonts,g.array),[]),locale:b(t,"locale",""),clientSecret:b(t,"clientSecret",""),appearance:k(N(t.appearance,g.object),{}),loader:b(t,"loader","auto")}}function Xe(e){}function Ye(e){}function Qe(){return new Promise(function(e,t){setTimeout(function(){e({})},1e3)})}function Ze(e,t){return He}var On={fonts:[],locale:"",clientSecret:"",appearance:{},loader:""},W={options:On,update:Xe,getElement:Ye,fetchUpdates:Qe,create:Ze},F=D.createContext(W),wn=F.Provider,oe={make:wn};function et(e){var t=k(g.object(e),{});return{fonts:k(N(t.fonts,g.array),[]),locale:b(t,"locale",""),ephemeralKey:b(t,"ephemeralKey",""),appearance:k(N(t.appearance,g.object),{}),loader:b(t,"loader","auto")}}var Mn={fonts:[],locale:"",ephemeralKey:"",appearance:{},loader:""},ve={options:Mn,update:Xe,getElement:Ye,fetchUpdates:Qe,create:Ze},_e=D.createContext(ve),Bn=_e.Provider,tt={make:Bn};var nt=s(y());function Nn(e){var t=e.onPaymentButtonClick,o=e.onPaymentComplete,n=e.onClick,r=e.onBlur,u=e.onFocus,a=e.componentType,i=e.onReady,c=e.onChange,m=e.options,f=e.id,h=f!==void 0?f:"payment-Element",E=R.useContext(V),_=R.useContext(F),p=R.useRef(null),C=_.create(a,m);return R.useEffect(function(){var O=_.create(a,m);O.mount("#orca-elements-payment-element-"+h)},[p,_]),R.useEffect(function(){C.on("ready",i),C.on("focus",u),C.on("blur",r),C.on("clickTriggered",n),C.on("change",c),C.on("completeDoThis",o),C.onSDKHandleClick(t)},[_,E]),nt.jsx("div",{ref:B(p),id:"orca-elements-payment-element-"+h})}var d=Nn;function bn(e){return rt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardCvc",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Ee=bn;var q=s(x());function J(e,t){return t.then(Z(e))}var Pe=s(y());function Fn(e){var t=e.options,o=e.stripe,n=re(t),r=q.useState(function(){return A}),u=r[1],a=q.useState(function(){return W}),i=a[1];return q.useEffect(function(){(function(c){return J(function(m){var f=m.elements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.clientSecret,$=m.confirmPayment,w=m.confirmCardPayment,U=m.retrievePaymentIntent,ue=m.paymentRequest,ae=m.completeUpdateIntent,ie=m.initiateUpdateIntent,j={clientSecret:O,confirmPayment:$,confirmCardPayment:w,retrievePaymentIntent:U,paymentRequest:ue,completeUpdateIntent:ae,initiateUpdateIntent:ie};return u(function(me){return j}),i(function(me){return C}),Promise.resolve(j)},c)})(o)},[]),Pe.jsx(ne.make,{value:r[0],children:Pe.jsx(oe.make,{value:a[0],children:e.children})})}var ot=Fn;var ut=s(y());function Jn(e){return ut.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardExpiry",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var xe=Jn;var at=s(y());function Un(e){return at.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardNumber",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ge=Un;var it=s(y());function In(e){return it.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"card",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ke=In;var mt=s(y());function An(e){return mt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"paze",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var lt=An;var H=s(x());var Re=s(y());function qn(e){var t=e.options,o=e.hyper,n=re(t),r=H.useState(function(){return A}),u=r[1],a=H.useState(function(){return W}),i=a[1];return H.useEffect(function(){(function(c){return J(function(m){var f=m.elements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.clientSecret,$=m.confirmPayment,w=m.confirmCardPayment,U=m.retrievePaymentIntent,ue=m.paymentRequest,ae=m.completeUpdateIntent,ie=m.initiateUpdateIntent,j={clientSecret:O,confirmPayment:$,confirmCardPayment:w,retrievePaymentIntent:U,paymentRequest:ue,completeUpdateIntent:ae,initiateUpdateIntent:ie};return u(function(me){return j}),i(function(me){return C}),Promise.resolve(j)},c)})(o)},[]),Re.jsx(ne.make,{value:r[0],children:Re.jsx(oe.make,{value:a[0],children:e.children})})}var ct=qn;var ft=s(y());function Gn(e){return ft.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payPal",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var st=Gn;var dt=s(y());function Ln(e){return dt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payment",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Se=Ln;var pt=s(y());function Xn(e){return pt.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"applePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var yt=Xn;var Ct=s(y());function Qn(e){return Ct.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"googlePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var vt=Qn;var _t=s(y());function er(e){return _t.jsx(d,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"expressCheckout",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Et=er;var G=s(x());var Oe=s(y());function nr(e){var t=e.options,o=e.hyper,n=et(t),r=G.useState(function(){return ye}),u=r[1],a=G.useState(function(){return ve}),i=a[1];return G.useEffect(function(){(function(c){return J(function(m){var f=m.paymentMethodsManagementElements(t),h=f.update,E=f.getElement,_=f.fetchUpdates,p=f.create,C={options:n,update:h,getElement:E,fetchUpdates:_,create:p},O=n.ephemeralKey,$=m.paymentRequest,w={ephemeralKey:O,paymentRequest:$};return u(function(U){return w}),i(function(U){return C}),Promise.resolve(w)},c)})(o)},[]),Oe.jsx(ze.make,{value:r[0],children:Oe.jsx(tt.make,{value:a[0],children:e.children})})}var ht=nr;var S=s(x());var Pt=s(y());function or(e){var t=e.onClick,o=e.onBlur,n=e.onFocus,r=e.componentType,u=e.onReady,a=e.onChange,i=e.options,c=e.id,m=c!==void 0?c:"payment-management",f=r!==void 0?r:"paymentMethodsManagement",h=S.useContext(Ce),E=S.useContext(_e),_=S.useRef(null),p=E.create(f,i);return S.useEffect(function(){var C=E.create(f,i);C.mount("#orca-elements-payment-management-"+m)},[_,E]),S.useEffect(function(){return p.on("ready",u),p.on("focus",n),p.on("blur",o),p.on("clickTriggered",t),p.on("change",a),function(){p.on("ready",void 0),p.on("focus",void 0),p.on("blur",void 0),p.on("clickTriggered",void 0),p.on("change",void 0)}},[E,h]),Pt.jsx("div",{ref:B(_),id:"orca-elements-payment-management-"+m})}var xt=or;function sr(){return K.useContext(V)}function dr(){return console.warn("useStripe() is deprecated. Use useHyper() instead"),K.useContext(V)}function pr(){return K.useContext(F)}function yr(){return console.warn("useElements() is deprecated. Use useWidgets() instead"),K.useContext(F)}var Cr=ot,vr=ct,_r=Se,Er=Se,hr=ke,Pr=ke,xr=ge,gr=ge,kr=Ee,Rr=Ee,Sr=xe,Or=xe,wr=vt,Mr=yt,Br=lt,Nr=st,br=Et,Vr=ht,Fr=xt;export{Mr as ApplePayElement,kr as CardCVCElement,Rr as CardCVCWidget,hr as CardElement,Sr as CardExpiryElement,Or as CardExpiryWidget,xr as CardNumberElement,gr as CardNumberWidget,Pr as CardWidget,Cr as Elements,br as ExpressCheckoutElement,wr as GooglePayElement,vr as HyperElements,Vr as HyperManagementElements,Nr as PayPalElement,_r as PaymentElement,Fr as PaymentMethodsManagementElement,Br as PazeElement,Er as UnifiedCheckout,yr as useElements,sr as useHyper,dr as useStripe,pr as useWidgets};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.min.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.min.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.min.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.min.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,29 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay-tech/react-hyper-js",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"module": "index.mjs",
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"import": "./index.mjs",
|
|
9
|
-
"require": "./index.js"
|
|
8
|
+
"import": "./dist/index.mjs",
|
|
9
|
+
"require": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"react",
|
|
19
|
+
"hyper-js",
|
|
20
|
+
"sdk",
|
|
21
|
+
"payments",
|
|
22
|
+
"integration"
|
|
23
|
+
],
|
|
12
24
|
"dependencies": {
|
|
25
|
+
"@rescript/core": "^0.7.0",
|
|
13
26
|
"@rescript/react": "^0.12.1",
|
|
14
|
-
"@ryyppy/rescript-promise": "^2.1.0"
|
|
15
|
-
"postcss": "^8.4.19",
|
|
16
|
-
"react-scripts": "^5.0.1",
|
|
17
|
-
"@rescript/core": "^0.7.0"
|
|
27
|
+
"@ryyppy/rescript-promise": "^2.1.0"
|
|
18
28
|
},
|
|
19
29
|
"peerDependencies": {
|
|
20
30
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
|
21
31
|
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
|
|
22
32
|
},
|
|
23
33
|
"scripts": {
|
|
24
|
-
"start": "
|
|
25
|
-
"build": "
|
|
26
|
-
"build:
|
|
34
|
+
"start": "esbuild src/Index.bs.js --bundle --outfile=dist/index.js --servedir=dist",
|
|
35
|
+
"build": "npm run build:js && npm run build:es",
|
|
36
|
+
"build:js": "esbuild src/Index.bs.js --bundle --outfile=dist/index.js --minify",
|
|
37
|
+
"build:es": "esbuild src/Index.bs.js --bundle --format=esm --outfile=dist/index.mjs --minify",
|
|
27
38
|
"re:build": "rescript",
|
|
28
39
|
"re:start": "rescript build -w",
|
|
29
40
|
"re:format": "rescript format -all",
|
|
@@ -31,29 +42,18 @@
|
|
|
31
42
|
"publish:public": "npm publish --access public"
|
|
32
43
|
},
|
|
33
44
|
"devDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"babel-loader": "^8.3.0",
|
|
37
|
-
"css-loader": "^6.8.1",
|
|
38
|
-
"esbuild": "^0.17.4",
|
|
39
|
-
"esbuild-plugin-copy": "^1.3.0",
|
|
40
|
-
"esbuild-plugin-inline-image": "0.0.8",
|
|
41
|
-
"esbuild-postcss": "0.0.4",
|
|
42
|
-
"rescript": "^11.1.0",
|
|
43
|
-
"style-loader": "^0.21.0"
|
|
44
|
-
},
|
|
45
|
-
"directories": {
|
|
46
|
-
"lib": "lib"
|
|
45
|
+
"esbuild": "^0.18.17",
|
|
46
|
+
"rescript": "^11.1.0"
|
|
47
47
|
},
|
|
48
|
+
"author": "Pritish Budhiraja <pritish.budhiraja@juspay.in>",
|
|
49
|
+
"description": "React wrapper for Hyper JS SDK for seamless payment integrations.",
|
|
50
|
+
"homepage": "https://github.com/juspay/react-hyper-js#readme",
|
|
48
51
|
"repository": {
|
|
49
52
|
"type": "git",
|
|
50
|
-
"url": "
|
|
53
|
+
"url": "https://github.com/juspay/react-hyper-js.git"
|
|
51
54
|
},
|
|
52
|
-
"author": "",
|
|
53
|
-
"license": "ISC",
|
|
54
|
-
"homepage": "https://bitbucket.org/juspay/react-orca-js#readme",
|
|
55
55
|
"bugs": {
|
|
56
|
-
"url": "https://
|
|
56
|
+
"url": "https://github.com/juspay/react-hyper-js/issues"
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"license": "Apache-2.0"
|
|
59
59
|
}
|
package/.babelrc
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## v1.1.0 (2024-07-12)
|
|
2
|
-
|
|
3
|
-
### Feature
|
|
4
|
-
|
|
5
|
-
- Added Payment Management & Express Checkout Widgets
|
|
6
|
-
|
|
7
|
-
### Refactoring
|
|
8
|
-
|
|
9
|
-
- Upgraded the Rescript Version & better coding practices.
|
|
10
|
-
|
|
11
|
-
## v1.1.1 (2024-07-12)
|
|
12
|
-
|
|
13
|
-
### Fix
|
|
14
|
-
|
|
15
|
-
- Build files updated.
|
package/build.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const esbuild = require("esbuild");
|
|
2
|
-
const inlineImage = require("esbuild-plugin-inline-image");
|
|
3
|
-
const postcss = require("esbuild-postcss");
|
|
4
|
-
|
|
5
|
-
esbuild
|
|
6
|
-
.build({
|
|
7
|
-
entryPoints: ["./src/Index.bs.js"],
|
|
8
|
-
outfile: "index.mjs",
|
|
9
|
-
minify: true,
|
|
10
|
-
bundle: true,
|
|
11
|
-
loader: {
|
|
12
|
-
".js": "jsx",
|
|
13
|
-
},
|
|
14
|
-
format: "esm",
|
|
15
|
-
external: ["react", "react-dom"],
|
|
16
|
-
plugins: [
|
|
17
|
-
inlineImage(),
|
|
18
|
-
postcss(),
|
|
19
|
-
],
|
|
20
|
-
})
|
|
21
|
-
.catch(() => process.exit(1));
|
|
22
|
-
|
|
23
|
-
esbuild
|
|
24
|
-
.build({
|
|
25
|
-
entryPoints: ["./src/Index.bs.js"],
|
|
26
|
-
outfile: "index.js",
|
|
27
|
-
minify: true,
|
|
28
|
-
bundle: true,
|
|
29
|
-
loader: {
|
|
30
|
-
".js": "jsx",
|
|
31
|
-
},
|
|
32
|
-
format: "cjs",
|
|
33
|
-
external: ["react", "react-dom"],
|
|
34
|
-
plugins: [
|
|
35
|
-
inlineImage(),
|
|
36
|
-
postcss(),
|
|
37
|
-
],
|
|
38
|
-
}).catch(() => process.exit(1));
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var qe=Object.create;var U=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Ke=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Xe=(e,n)=>{for(var r in n)U(e,r,{get:n[r],enumerable:!0})},fe=(e,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of Ge(n))!ze.call(e,t)&&t!==r&&U(e,t,{get:()=>n[t],enumerable:!(o=He(n,t))||o.enumerable});return e};var i=(e,n,r)=>(r=e!=null?qe(Ke(e)):{},fe(n||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),Le=e=>fe(U({},"__esModule",{value:!0}),e);var Mt={};Xe(Mt,{ApplePayElement:()=>xt,CardCVCElement:()=>vt,CardCVCWidget:()=>Et,CardElement:()=>dt,CardExpiryElement:()=>_t,CardExpiryWidget:()=>ht,CardNumberElement:()=>yt,CardNumberWidget:()=>pt,CardWidget:()=>Ct,Elements:()=>lt,ExpressCheckoutElement:()=>kt,GooglePayElement:()=>Pt,HyperElements:()=>ct,HyperManagementElements:()=>Ot,PayPalElement:()=>Rt,PaymentElement:()=>ft,PaymentMethodsManagementElement:()=>St,PazeElement:()=>gt,UnifiedCheckout:()=>st,useElements:()=>it,useHyper:()=>at,useStripe:()=>ut,useWidgets:()=>mt});module.exports=Le(Mt);var j=i(require("react"));var Re=i(require("react/jsx-runtime"));var P=i(require("react"));var T=i(require("react"));function Qe(e,n){}function Ye(){}function Ze(){}function en(e){}function nn(){}function tn(){}function rn(e){}function on(){}function an(){}function un(e){}var se={on:Qe,collapse:Ye,blur:Ze,update:en,destroy:nn,unmount:tn,mount:rn,focus:on,clear:an,onSDKHandleClick:un};function ln(e){if(typeof e=="boolean")return e}function cn(e){if(e===null)return null}function fn(e){if(typeof e=="string")return e}function sn(e){if(typeof e=="number")return e}function dn(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return e}function Cn(e){if(Array.isArray(e))return e}var _={bool:ln,$$null:cn,string:fn,$$float:sn,object:dn,array:Cn};function Q(e,n,r){for(var o=new Array(r),t=0,a=n;t<r;)o[t]=e[a],t=t+1|0,a=a+1|0;return o}function de(e,n){for(;;){var r=n,o=e,t=o.length,a=t===0?1:t,l=r.length,s=a-l|0;if(s===0)return o.apply(null,r);if(s>=0)return function(C,u){return function(m){return de(C,u.concat([m]))}}(o,r);n=Q(r,a,-s|0),e=o.apply(null,Q(r,0,a))}}function vn(e,n){var r=e.length;if(r===1)return e(n);switch(r){case 1:return e(n);case 2:return function(o){return e(n,o)};case 3:return function(o,t){return e(n,o,t)};case 4:return function(o,t,a){return e(n,o,t,a)};case 5:return function(o,t,a,l){return e(n,o,t,a,l)};case 6:return function(o,t,a,l,s){return e(n,o,t,a,l,s)};case 7:return function(o,t,a,l,s,C){return e(n,o,t,a,l,s,C)};default:return de(e,[n])}}function I(e){var n=e.length;return n===1?e:function(r){return vn(e,r)}}function k(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function q(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var n=e.BS_PRIVATE_NESTED_SOME_NONE;if(n!==0)return{BS_PRIVATE_NESTED_SOME_NONE:n-1|0}}function En(e,n){if(e!==void 0)return n(q(e))}function O(e,n){return En(e,I(n))}function h(e,n){return e!==void 0?q(e):n}function Pn(e){return Promise.resolve({})}function xn(e,n,r){return Promise.resolve({})}function gn(e){return Promise.resolve({})}function ye(e){return e}var b={clientSecret:"",confirmPayment:Pn,confirmCardPayment:xn,retrievePaymentIntent:gn,paymentRequest:ye},M=T.createContext(b),Rn=M.Provider,G={make:Rn},Y={ephemeralKey:"",paymentRequest:ye},Z=T.createContext(Y),kn=Z.Provider,pe={make:kn};function S(e,n,r){return h(O(e[n],_.string),r)}function K(e){var n=h(_.object(e),{});return{fonts:h(O(n.fonts,_.array),[]),locale:S(n,"locale",""),clientSecret:S(n,"clientSecret",""),appearance:h(O(n.appearance,_.object),{}),loader:S(n,"loader","auto")}}function ve(e){}function Ee(e){}function _e(){return new Promise(function(e,n){setTimeout(function(){e({})},1e3)})}function he(e,n){return se}var On={fonts:[],locale:"",clientSecret:"",appearance:{},loader:""},W={options:On,update:ve,getElement:Ee,fetchUpdates:_e,create:he},w=T.createContext(W),Sn=w.Provider,z={make:Sn};function Pe(e){var n=h(_.object(e),{});return{fonts:h(O(n.fonts,_.array),[]),locale:S(n,"locale",""),ephemeralKey:S(n,"ephemeralKey",""),appearance:h(O(n.appearance,_.object),{}),loader:S(n,"loader","auto")}}var Mn={fonts:[],locale:"",ephemeralKey:"",appearance:{},loader:""},ee={options:Mn,update:ve,getElement:Ee,fetchUpdates:_e,create:he},ne=T.createContext(ee),wn=ne.Provider,xe={make:wn};var ge=i(require("react/jsx-runtime"));function Bn(e){var n=e.onPaymentButtonClick,r=e.onPaymentComplete,o=e.onClick,t=e.onBlur,a=e.onFocus,l=e.componentType,s=e.onReady,C=e.onChange,u=e.options,m=e.id,v=m!==void 0?m:"payment-Element",p=P.useContext(M),y=P.useContext(w),f=P.useRef(null),d=y.create(l,u);return P.useEffect(function(){var g=y.create(l,u);g.mount("#orca-elements-payment-element-"+v)},[f,y]),P.useEffect(function(){d.on("ready",s),d.on("focus",a),d.on("blur",t),d.on("clickTriggered",o),d.on("change",C),d.on("completeDoThis",r),d.onSDKHandleClick(n)},[y,p]),ge.jsx("div",{ref:k(f),id:"orca-elements-payment-element-"+v})}var c=Bn;function Nn(e){return Re.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardCvc",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var te=Nn;var A=i(require("react"));function N(e,n){return n.then(I(e))}var oe=i(require("react/jsx-runtime"));function Jn(e){var n=e.options,r=e.stripe,o=K(n),t=A.useState(function(){return b}),a=t[1],l=A.useState(function(){return W}),s=l[1];return A.useEffect(function(){(function(C){return N(function(u){var m=u.elements(n),v=m.update,p=m.getElement,y=m.fetchUpdates,f=m.create,d={options:o,update:v,getElement:p,fetchUpdates:y,create:f},g=o.clientSecret,F=u.confirmPayment,R=u.confirmCardPayment,J=u.retrievePaymentIntent,X=u.paymentRequest,V={clientSecret:g,confirmPayment:F,confirmCardPayment:R,retrievePaymentIntent:J,paymentRequest:X};return a(function(L){return V}),s(function(L){return d}),Promise.resolve(V)},C)})(r)},[]),oe.jsx(G.make,{value:t[0],children:oe.jsx(z.make,{value:l[0],children:e.children})})}var ke=Jn;var Oe=i(require("react/jsx-runtime"));function Tn(e){return Oe.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardExpiry",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ae=Tn;var Se=i(require("react/jsx-runtime"));function Wn(e){return Se.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardNumber",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ue=Wn;var Me=i(require("react/jsx-runtime"));function Dn(e){return Me.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"card",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var me=Dn;var we=i(require("react/jsx-runtime"));function jn(e){return we.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"paze",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Be=jn;var D=i(require("react"));var ie=i(require("react/jsx-runtime"));function In(e){var n=e.options,r=e.hyper,o=K(n),t=D.useState(function(){return b}),a=t[1],l=D.useState(function(){return W}),s=l[1];return D.useEffect(function(){(function(C){return N(function(u){var m=u.elements(n),v=m.update,p=m.getElement,y=m.fetchUpdates,f=m.create,d={options:o,update:v,getElement:p,fetchUpdates:y,create:f},g=o.clientSecret,F=u.confirmPayment,R=u.confirmCardPayment,J=u.retrievePaymentIntent,X=u.paymentRequest,V={clientSecret:g,confirmPayment:F,confirmCardPayment:R,retrievePaymentIntent:J,paymentRequest:X};return a(function(L){return V}),s(function(L){return d}),Promise.resolve(V)},C)})(r)},[]),ie.jsx(G.make,{value:t[0],children:ie.jsx(z.make,{value:l[0],children:e.children})})}var Ne=In;var Fe=i(require("react/jsx-runtime"));function Hn(e){return Fe.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payPal",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Je=Hn;var Ve=i(require("react/jsx-runtime"));function Kn(e){return Ve.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payment",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var le=Kn;var Te=i(require("react/jsx-runtime"));function Xn(e){return Te.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"applePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var be=Xn;var We=i(require("react/jsx-runtime"));function Qn(e){return We.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"googlePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Ae=Qn;var De=i(require("react/jsx-runtime"));function Zn(e){return De.jsx(c,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"expressCheckout",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var $e=Zn;var $=i(require("react"));var ce=i(require("react/jsx-runtime"));function nt(e){var n=e.options,r=e.hyper,o=Pe(n),t=$.useState(function(){return Y}),a=t[1],l=$.useState(function(){return ee}),s=l[1];return $.useEffect(function(){(function(C){return N(function(u){var m=u.paymentMethodsManagementElements(n),v=m.update,p=m.getElement,y=m.fetchUpdates,f=m.create,d={options:o,update:v,getElement:p,fetchUpdates:y,create:f},g=o.ephemeralKey,F=u.paymentRequest,R={ephemeralKey:g,paymentRequest:F};return a(function(J){return R}),s(function(J){return d}),Promise.resolve(R)},C)})(r)},[]),ce.jsx(pe.make,{value:t[0],children:ce.jsx(xe.make,{value:l[0],children:e.children})})}var je=nt;var x=i(require("react"));var Ue=i(require("react/jsx-runtime"));function rt(e){var n=e.onClick,r=e.onBlur,o=e.onFocus,t=e.componentType,a=e.onReady,l=e.onChange,s=e.options,C=e.id,u=C!==void 0?C:"payment-management",m=t!==void 0?t:"paymentMethodsManagement",v=x.useContext(Z),p=x.useContext(ne),y=x.useRef(null),f=p.create(m,s);return x.useEffect(function(){var d=p.create(m,s);d.mount("#orca-elements-payment-management-"+u)},[y,p]),x.useEffect(function(){return f.on("ready",a),f.on("focus",o),f.on("blur",r),f.on("clickTriggered",n),f.on("change",l),function(){f.on("ready",void 0),f.on("focus",void 0),f.on("blur",void 0),f.on("clickTriggered",void 0),f.on("change",void 0)}},[p,v]),Ue.jsx("div",{ref:k(y),id:"orca-elements-payment-management-"+u})}var Ie=rt;function at(){return j.useContext(M)}function ut(){return console.warn("useStripe() is deprecated. Use useHyper() instead"),j.useContext(M)}function mt(){return j.useContext(w)}function it(){return console.warn("useElements() is deprecated. Use useWidgets() instead"),j.useContext(w)}var lt=ke,ct=Ne,ft=le,st=le,dt=me,Ct=me,yt=ue,pt=ue,vt=te,Et=te,_t=ae,ht=ae,Pt=Ae,xt=be,gt=Be,Rt=Je,kt=$e,Ot=je,St=Ie;
|
package/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as $ from"react";import*as Pe from"react/jsx-runtime";import*as h from"react";import*as V from"react";function je(e,n){}function Ue(){}function Ie(){}function qe(e){}function He(){}function Ge(){}function Ke(e){}function ze(){}function Xe(){}function Le(e){}var le={on:je,collapse:Ue,blur:Ie,update:qe,destroy:He,unmount:Ge,mount:Ke,focus:ze,clear:Xe,onSDKHandleClick:Le};function Ye(e){if(typeof e=="boolean")return e}function Ze(e){if(e===null)return null}function en(e){if(typeof e=="string")return e}function nn(e){if(typeof e=="number")return e}function tn(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return e}function rn(e){if(Array.isArray(e))return e}var E={bool:Ye,$$null:Ze,string:en,$$float:nn,object:tn,array:rn};function X(e,n,o){for(var t=new Array(o),r=0,a=n;r<o;)t[r]=e[a],r=r+1|0,a=a+1|0;return t}function ce(e,n){for(;;){var o=n,t=e,r=t.length,a=r===0?1:r,i=o.length,f=a-i|0;if(f===0)return t.apply(null,o);if(f>=0)return function(d,u){return function(m){return ce(d,u.concat([m]))}}(t,o);n=X(o,a,-f|0),e=t.apply(null,X(o,0,a))}}function un(e,n){var o=e.length;if(o===1)return e(n);switch(o){case 1:return e(n);case 2:return function(t){return e(n,t)};case 3:return function(t,r){return e(n,t,r)};case 4:return function(t,r,a){return e(n,t,r,a)};case 5:return function(t,r,a,i){return e(n,t,r,a,i)};case 6:return function(t,r,a,i,f){return e(n,t,r,a,i,f)};case 7:return function(t,r,a,i,f,d){return e(n,t,r,a,i,f,d)};default:return ce(e,[n])}}function j(e){var n=e.length;return n===1?e:function(o){return un(e,o)}}function R(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function U(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var n=e.BS_PRIVATE_NESTED_SOME_NONE;if(n!==0)return{BS_PRIVATE_NESTED_SOME_NONE:n-1|0}}function mn(e,n){if(e!==void 0)return n(U(e))}function k(e,n){return mn(e,j(n))}function _(e,n){return e!==void 0?U(e):n}function fn(e){return Promise.resolve({})}function sn(e,n,o){return Promise.resolve({})}function dn(e){return Promise.resolve({})}function se(e){return e}var T={clientSecret:"",confirmPayment:fn,confirmCardPayment:sn,retrievePaymentIntent:dn,paymentRequest:se},S=V.createContext(T),Cn=S.Provider,q={make:Cn},L={ephemeralKey:"",paymentRequest:se},Q=V.createContext(L),yn=Q.Provider,de={make:yn};function O(e,n,o){return _(k(e[n],E.string),o)}function H(e){var n=_(E.object(e),{});return{fonts:_(k(n.fonts,E.array),[]),locale:O(n,"locale",""),clientSecret:O(n,"clientSecret",""),appearance:_(k(n.appearance,E.object),{}),loader:O(n,"loader","auto")}}function Ce(e){}function ye(e){}function pe(){return new Promise(function(e,n){setTimeout(function(){e({})},1e3)})}function ve(e,n){return le}var pn={fonts:[],locale:"",clientSecret:"",appearance:{},loader:""},b={options:pn,update:Ce,getElement:ye,fetchUpdates:pe,create:ve},M=V.createContext(b),vn=M.Provider,G={make:vn};function Ee(e){var n=_(E.object(e),{});return{fonts:_(k(n.fonts,E.array),[]),locale:O(n,"locale",""),ephemeralKey:O(n,"ephemeralKey",""),appearance:_(k(n.appearance,E.object),{}),loader:O(n,"loader","auto")}}var En={fonts:[],locale:"",ephemeralKey:"",appearance:{},loader:""},Y={options:En,update:Ce,getElement:ye,fetchUpdates:pe,create:ve},Z=V.createContext(Y),_n=Z.Provider,_e={make:_n};import*as he from"react/jsx-runtime";function hn(e){var n=e.onPaymentButtonClick,o=e.onPaymentComplete,t=e.onClick,r=e.onBlur,a=e.onFocus,i=e.componentType,f=e.onReady,d=e.onChange,u=e.options,m=e.id,p=m!==void 0?m:"payment-Element",y=h.useContext(S),C=h.useContext(M),c=h.useRef(null),s=C.create(i,u);return h.useEffect(function(){var x=C.create(i,u);x.mount("#orca-elements-payment-element-"+p)},[c,C]),h.useEffect(function(){s.on("ready",f),s.on("focus",a),s.on("blur",r),s.on("clickTriggered",t),s.on("change",d),s.on("completeDoThis",o),s.onSDKHandleClick(n)},[C,y]),he.jsx("div",{ref:R(c),id:"orca-elements-payment-element-"+p})}var l=hn;function Pn(e){return Pe.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardCvc",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ee=Pn;import*as W from"react";function B(e,n){return n.then(j(e))}import*as te from"react/jsx-runtime";function gn(e){var n=e.options,o=e.stripe,t=H(n),r=W.useState(function(){return T}),a=r[1],i=W.useState(function(){return b}),f=i[1];return W.useEffect(function(){(function(d){return B(function(u){var m=u.elements(n),p=m.update,y=m.getElement,C=m.fetchUpdates,c=m.create,s={options:t,update:p,getElement:y,fetchUpdates:C,create:c},x=t.clientSecret,N=u.confirmPayment,g=u.confirmCardPayment,F=u.retrievePaymentIntent,K=u.paymentRequest,J={clientSecret:x,confirmPayment:N,confirmCardPayment:g,retrievePaymentIntent:F,paymentRequest:K};return a(function(z){return J}),f(function(z){return s}),Promise.resolve(J)},d)})(o)},[]),te.jsx(q.make,{value:r[0],children:te.jsx(G.make,{value:i[0],children:e.children})})}var xe=gn;import*as ge from"react/jsx-runtime";function kn(e){return ge.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardExpiry",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var re=kn;import*as Re from"react/jsx-runtime";function Sn(e){return Re.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"cardNumber",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var oe=Sn;import*as ke from"react/jsx-runtime";function wn(e){return ke.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"card",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var ae=wn;import*as Oe from"react/jsx-runtime";function Nn(e){return Oe.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"paze",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Se=Nn;import*as A from"react";import*as ue from"react/jsx-runtime";function Jn(e){var n=e.options,o=e.hyper,t=H(n),r=A.useState(function(){return T}),a=r[1],i=A.useState(function(){return b}),f=i[1];return A.useEffect(function(){(function(d){return B(function(u){var m=u.elements(n),p=m.update,y=m.getElement,C=m.fetchUpdates,c=m.create,s={options:t,update:p,getElement:y,fetchUpdates:C,create:c},x=t.clientSecret,N=u.confirmPayment,g=u.confirmCardPayment,F=u.retrievePaymentIntent,K=u.paymentRequest,J={clientSecret:x,confirmPayment:N,confirmCardPayment:g,retrievePaymentIntent:F,paymentRequest:K};return a(function(z){return J}),f(function(z){return s}),Promise.resolve(J)},d)})(o)},[]),ue.jsx(q.make,{value:r[0],children:ue.jsx(G.make,{value:i[0],children:e.children})})}var Me=Jn;import*as we from"react/jsx-runtime";function Tn(e){return we.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payPal",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Be=Tn;import*as Ne from"react/jsx-runtime";function Wn(e){return Ne.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"payment",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var me=Wn;import*as Fe from"react/jsx-runtime";function Dn(e){return Fe.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"applePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Je=Dn;import*as Ve from"react/jsx-runtime";function jn(e){return Ve.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"googlePay",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var Te=jn;import*as be from"react/jsx-runtime";function In(e){return be.jsx(l,{id:e.id,options:e.options,onChange:e.onChange,onReady:e.onReady,componentType:"expressCheckout",onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onPaymentComplete:e.onPaymentComplete,onPaymentButtonClick:e.onPaymentButtonClick})}var We=In;import*as D from"react";import*as ie from"react/jsx-runtime";function Hn(e){var n=e.options,o=e.hyper,t=Ee(n),r=D.useState(function(){return L}),a=r[1],i=D.useState(function(){return Y}),f=i[1];return D.useEffect(function(){(function(d){return B(function(u){var m=u.paymentMethodsManagementElements(n),p=m.update,y=m.getElement,C=m.fetchUpdates,c=m.create,s={options:t,update:p,getElement:y,fetchUpdates:C,create:c},x=t.ephemeralKey,N=u.paymentRequest,g={ephemeralKey:x,paymentRequest:N};return a(function(F){return g}),f(function(F){return s}),Promise.resolve(g)},d)})(o)},[]),ie.jsx(de.make,{value:r[0],children:ie.jsx(_e.make,{value:i[0],children:e.children})})}var Ae=Hn;import*as P from"react";import*as De from"react/jsx-runtime";function Kn(e){var n=e.onClick,o=e.onBlur,t=e.onFocus,r=e.componentType,a=e.onReady,i=e.onChange,f=e.options,d=e.id,u=d!==void 0?d:"payment-management",m=r!==void 0?r:"paymentMethodsManagement",p=P.useContext(Q),y=P.useContext(Z),C=P.useRef(null),c=y.create(m,f);return P.useEffect(function(){var s=y.create(m,f);s.mount("#orca-elements-payment-management-"+u)},[C,y]),P.useEffect(function(){return c.on("ready",a),c.on("focus",t),c.on("blur",o),c.on("clickTriggered",n),c.on("change",i),function(){c.on("ready",void 0),c.on("focus",void 0),c.on("blur",void 0),c.on("clickTriggered",void 0),c.on("change",void 0)}},[y,p]),De.jsx("div",{ref:R(C),id:"orca-elements-payment-management-"+u})}var $e=Kn;function Ln(){return $.useContext(S)}function Qn(){return console.warn("useStripe() is deprecated. Use useHyper() instead"),$.useContext(S)}function Yn(){return $.useContext(M)}function Zn(){return console.warn("useElements() is deprecated. Use useWidgets() instead"),$.useContext(M)}var et=xe,nt=Me,tt=me,rt=me,ot=ae,at=ae,ut=oe,mt=oe,it=ee,lt=ee,ct=re,ft=re,st=Te,dt=Je,Ct=Se,yt=Be,pt=We,vt=Ae,Et=$e;export{dt as ApplePayElement,it as CardCVCElement,lt as CardCVCWidget,ot as CardElement,ct as CardExpiryElement,ft as CardExpiryWidget,ut as CardNumberElement,mt as CardNumberWidget,at as CardWidget,et as Elements,pt as ExpressCheckoutElement,st as GooglePayElement,nt as HyperElements,vt as HyperManagementElements,yt as PayPalElement,tt as PaymentElement,Et as PaymentMethodsManagementElement,Ct as PazeElement,rt as UnifiedCheckout,Zn as useElements,Ln as useHyper,Qn as useStripe,Yn as useWidgets};
|
package/rescript.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-orca-js",
|
|
3
|
-
"sources": [
|
|
4
|
-
{
|
|
5
|
-
"dir": "src",
|
|
6
|
-
"subdirs": true
|
|
7
|
-
}
|
|
8
|
-
],
|
|
9
|
-
"bsc-flags": ["-bs-super-errors", "-open RescriptCore"],
|
|
10
|
-
"package-specs": [
|
|
11
|
-
{
|
|
12
|
-
"module": "esmodule",
|
|
13
|
-
"in-source": true
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"suffix": ".bs.js",
|
|
17
|
-
"jsx": { "version": 4 },
|
|
18
|
-
"bs-dependencies": [
|
|
19
|
-
"@rescript/react",
|
|
20
|
-
"@ryyppy/rescript-promise",
|
|
21
|
-
"@rescript/core"
|
|
22
|
-
]
|
|
23
|
-
}
|