@rebilly/instruments 4.8.1 → 4.8.2
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/CHANGELOG.md +7 -0
- package/dist/index.js +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +5 -1
- package/.babelrc +0 -26
- package/project.json +0 -31
- package/rollup.config.mjs +0 -79
- package/src/data/options-schema/index.js +0 -112
- package/src/data/options-schema/schemas/options-schema.js +0 -448
- package/src/events/base-event.js +0 -47
- package/src/events/events.spec.js +0 -11
- package/src/events/index.js +0 -15
- package/src/functions/destroy.js +0 -29
- package/src/functions/destroy.spec.js +0 -63
- package/src/functions/mount/fetch-data.js +0 -236
- package/src/functions/mount/fetch-data.spec.js +0 -317
- package/src/functions/mount/get-lead-source-data.js +0 -46
- package/src/functions/mount/get-lead-source-data.spec.js +0 -38
- package/src/functions/mount/index.js +0 -105
- package/src/functions/mount/mount.spec.js +0 -96
- package/src/functions/mount/setup-element.js +0 -29
- package/src/functions/mount/setup-framepay-theme.js +0 -104
- package/src/functions/mount/setup-framepay.js +0 -26
- package/src/functions/mount/setup-i18n.js +0 -21
- package/src/functions/mount/setup-options.js +0 -100
- package/src/functions/mount/setup-options.spec.js +0 -353
- package/src/functions/mount/setup-storefront.js +0 -23
- package/src/functions/mount/setup-styles-vars.js +0 -30
- package/src/functions/mount/setup-user-flow.js +0 -60
- package/src/functions/on.js +0 -22
- package/src/functions/on.spec.js +0 -75
- package/src/functions/purchase.js +0 -173
- package/src/functions/purchase.spec.js +0 -80
- package/src/functions/setup.js +0 -66
- package/src/functions/setup.spec.js +0 -111
- package/src/functions/show.js +0 -30
- package/src/functions/show.spec.js +0 -62
- package/src/functions/update.js +0 -40
- package/src/functions/update.spec.js +0 -104
- package/src/i18n/en.json +0 -35
- package/src/i18n/es.json +0 -32
- package/src/i18n/i18n.spec.js +0 -27
- package/src/i18n/index.js +0 -59
- package/src/index.js +0 -3
- package/src/instance.js +0 -48
- package/src/instance.spec.js +0 -44
- package/src/loader/index.js +0 -145
- package/src/loader/loader.spec.js +0 -74
- package/src/state/iframes.js +0 -23
- package/src/state/index.js +0 -64
- package/src/storefront/account-and-website.js +0 -18
- package/src/storefront/account-and-website.spec.js +0 -73
- package/src/storefront/deposit-requests.js +0 -12
- package/src/storefront/fetch-plans-from-addons-bumpOffer.js +0 -30
- package/src/storefront/fetch-products-from-plans.js +0 -59
- package/src/storefront/fetch-products-from-plans.spec.js +0 -113
- package/src/storefront/index.js +0 -78
- package/src/storefront/invoices.js +0 -23
- package/src/storefront/invoices.spec.js +0 -92
- package/src/storefront/models/account-model.js +0 -36
- package/src/storefront/models/base-model.js +0 -7
- package/src/storefront/models/deposit-request-model.js +0 -24
- package/src/storefront/models/invoice-model.js +0 -20
- package/src/storefront/models/payment-metadata.js +0 -7
- package/src/storefront/models/plan-model.js +0 -94
- package/src/storefront/models/product-model.js +0 -3
- package/src/storefront/models/ready-to-pay-model.js +0 -76
- package/src/storefront/models/summary-model.js +0 -56
- package/src/storefront/models/transaction-model.js +0 -16
- package/src/storefront/models/website-model.js +0 -3
- package/src/storefront/payment-instruments.js +0 -47
- package/src/storefront/payment-instruments.spec.js +0 -88
- package/src/storefront/purchase.js +0 -60
- package/src/storefront/purchase.spec.js +0 -53
- package/src/storefront/ready-to-pay.js +0 -96
- package/src/storefront/ready-to-pay.spec.js +0 -76
- package/src/storefront/storefront.spec.js +0 -14
- package/src/storefront/summary.js +0 -114
- package/src/storefront/summary.spec.js +0 -136
- package/src/storefront/transactions.js +0 -12
- package/src/style/base/__snapshots__/theme.spec.js.snap +0 -143
- package/src/style/base/default-theme.js +0 -955
- package/src/style/base/index.js +0 -688
- package/src/style/base/theme.js +0 -30
- package/src/style/base/theme.spec.js +0 -19
- package/src/style/index.js +0 -11
- package/src/style/utils/border.js +0 -47
- package/src/style/utils/color-values.js +0 -35
- package/src/style/utils/minifyCss.js +0 -14
- package/src/utils/add-dom-element.js +0 -17
- package/src/utils/format-currency.js +0 -8
- package/src/utils/has-valid-css-selector.js +0 -4
- package/src/utils/index.js +0 -15
- package/src/utils/is-dom-element.js +0 -3
- package/src/utils/process-property-as-dom-element.js +0 -31
- package/src/utils/quantity.js +0 -47
- package/src/utils/sleep.js +0 -5
- package/src/views/amount-selector.js +0 -46
- package/src/views/common/iframe/base-iframe.js +0 -66
- package/src/views/common/iframe/events/change-iframe-src-handler.js +0 -6
- package/src/views/common/iframe/events/dispatch-event-handler.js +0 -8
- package/src/views/common/iframe/events/resize-component-handler.js +0 -9
- package/src/views/common/iframe/events/show-error-handler.js +0 -5
- package/src/views/common/iframe/events/stop-loader-handler.js +0 -9
- package/src/views/common/iframe/events/update-addons-handler.js +0 -23
- package/src/views/common/iframe/events/update-coupons-handler.js +0 -12
- package/src/views/common/iframe/events/update-items-handler.js +0 -34
- package/src/views/common/iframe/index.js +0 -5
- package/src/views/common/iframe/modal-iframe.js +0 -82
- package/src/views/common/iframe/view-iframe.js +0 -23
- package/src/views/common/render-utilities.js +0 -4
- package/src/views/confirmation.js +0 -45
- package/src/views/errors.js +0 -115
- package/src/views/form.js +0 -61
- package/src/views/method-selector/__snapshots__/method-selector.spec.js.snap +0 -135
- package/src/views/method-selector/express-methods.js +0 -52
- package/src/views/method-selector/generate-digital-wallet.js +0 -53
- package/src/views/method-selector/generate-digital-wallet.spec.js +0 -121
- package/src/views/method-selector/generate-framepay-config.js +0 -56
- package/src/views/method-selector/generate-framepay-config.spec.js +0 -216
- package/src/views/method-selector/get-method-data.js +0 -11
- package/src/views/method-selector/get-payment-methods.js +0 -25
- package/src/views/method-selector/get-payment-methods.spec.js +0 -41
- package/src/views/method-selector/index.js +0 -223
- package/src/views/method-selector/method-selector.spec.js +0 -20
- package/src/views/method-selector/mount-bump-offer.js +0 -120
- package/src/views/method-selector/mount-express-methods.js +0 -107
- package/src/views/modal.js +0 -103
- package/src/views/result.js +0 -24
- package/src/views/summary.js +0 -38
- package/tests/async-utilities.js +0 -22
- package/tests/mocks/framepay-mock.js +0 -15
- package/tests/mocks/rebilly-api-mock.js +0 -11
- package/tests/mocks/rebilly-instruments-mock.js +0 -141
- package/tests/mocks/storefront-api-mock.js +0 -62
- package/tests/mocks/storefront-mock.js +0 -20
- package/tests/msw/server.js +0 -14
- package/tests/setup-test.js +0 -30
- package/vitest.config.js +0 -18
package/dist/index.min.js
CHANGED
|
@@ -39,4 +39,4 @@ function R(e){var t=S(e);return null===t?null:("hsl"===t.type&&(t.values=P(t.val
|
|
|
39
39
|
* @version v2.1.1
|
|
40
40
|
* @link http://noeldelgado.github.io/values.js/
|
|
41
41
|
* @license MIT
|
|
42
|
-
*/var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},j=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=S(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},L={hex:{configurable:!0}};return L.hex.get=function(){return this.hexString().replace(/^#/,"")},j.prototype.setColor=function(e){var t=S(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},j.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new j("rgb("+C("#fff",this.rgbString(),t).rgba+")","tint",t)},j.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new j("rgb("+C("#000",this.rgbString(),t).rgba+")","shade",t)},j.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},j.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},j.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},j.prototype.hexString=function(){return T(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},j.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},j.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},j.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},j.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(j.prototype,L),j.VERSION="v2.1.1",j}()})),yp=hp;const gp=e=>new yp(e);function bp(e,t=1){if(null===e)return e;const n=gp(e);return n.alpha=t,n.rgbString()}const vp=e=>bp(e,.5),wp=(e,t)=>{if(null===e)return e;return gp(e).shade(t).hexString()};function kp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $p{constructor(e){kp(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Ep={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>vp(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?bp(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?wp(e.buttonColorBackground,20):wp(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new $p(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${wp(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new $p(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?vp(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new $p(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?vp(e.inputErrorColorText):vp(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var _p=new Proxy(Ep,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class xp{constructor(e={}){this.overrides=e,this.theme=_p}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!xp.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xp,"nonCssProperties",["labels"]);function Sp(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Pp=()=>{const{theme:e={},css:t}=Qr.options,n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n min-height: 48px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new xp(e).build())}\n `;return t})(e||{});return Eu({element:"style",attributes:{type:"text/css"},content:Sp(n),target:"head"}),t&&Eu({element:"style",attributes:{type:"text/css"},content:Sp(t),target:"head"}),n};const Ap=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var Ip,Tp=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Ap},Op=function(e){if("Function"===$(e))return v(e)},Rp=Object.keys||function(e){return $t(e,Et)},Cp=l&&!Ie?Object.defineProperties:function(e,t){Re(e);for(var n,r=I(t),a=Rp(t),o=a.length,i=0;o>i;)De.f(e,n=a[i++],r[n]);return e},Np={f:Cp},jp=L("document","documentElement"),Lp="prototype",Mp="script",Fp=et("IE_PROTO"),Hp=function(){},Dp=function(e){return"<"+Mp+">"+e+"</"+Mp+">"},qp=function(e){e.write(Dp("")),e.close();var t=e.parentWindow.Object;return e=null,t},Bp=function(){try{Ip=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;Bp="undefined"!=typeof document?document.domain&&Ip?qp(Ip):(t=_e("iframe"),n="java"+Mp+":",t.style.display="none",jp.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Dp("document.F=Object")),e.close(),e.F):qp(Ip);for(var r=Et.length;r--;)delete Bp[Lp][Et[r]];return Bp()};tt[Fp]=!0;var zp,Up,Vp,Wp=Object.create||function(e,t){var n;return null!==e?(Hp[Lp]=Re(e),n=new Hp,Hp[Lp]=null,n[Fp]=e):n=Bp(),void 0===t?n:Np.f(n,t)},Kp=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Gp=et("IE_PROTO"),Jp=Object,Xp=Jp.prototype,Yp=Kp?Jp.getPrototypeOf:function(e){var t=se(e);if(ce(t,Gp))return t[Gp];var n=t.constructor;return C(n)&&t instanceof n?n.prototype:t instanceof Jp?Xp:null},Qp=ge("iterator"),Zp=!1;[].keys&&("next"in(Vp=[].keys())?(Up=Yp(Yp(Vp)))!==Object.prototype&&(zp=Up):Zp=!0);var em=!j(zp)||s((function(){var e={};return zp[Qp].call(e)!==e}));em&&(zp={}),C(zp[Qp])||ct(zp,Qp,(function(){return this}));var tm={IteratorPrototype:zp,BUGGY_SAFARI_ITERATORS:Zp},nm=De.f,rm=ge("toStringTag"),am=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ce(e,rm)&&nm(e,rm,{configurable:!0,value:t})},om=tm.IteratorPrototype,im=function(e,t){return{value:e,done:t}},sm=ge("match"),lm=function(){var e=Re(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cm=RegExp.prototype,um=function(e){var t=e.flags;return void 0!==t||"flags"in cm||ce(e,"flags")||!M(cm,e)?t:d(lm,e)},dm=function(){},pm=[],mm=L("Reflect","construct"),fm=/^\s*(?:class|function)\b/,hm=v(fm.exec),ym=!fm.exec(dm),gm=function(e){if(!C(e))return!1;try{return mm(dm,pm,e),!0}catch(e){return!1}},bm=function(e){if(!C(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ym||!!hm(fm,Xe(e))}catch(e){return!0}};bm.sham=!0;var vm,wm,km=!mm||s((function(){var e;return gm(gm.call)||!gm(Object)||!gm((function(){e=!0}))||e}))?bm:gm,$m=TypeError,Em=ge("species"),_m=function(e,t){var n,r=Re(e).constructor;return void 0===r||S(n=Re(r)[Em])?t:function(e){if(km(e))return e;throw $m(X(e)+" is not a constructor")}(n)},xm=v("".charAt),Sm=v("".charCodeAt),Pm=v("".slice),Am=function(e){return function(t,n){var r,a,o=Zt(A(t)),i=mt(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Sm(o,i))<55296||r>56319||i+1===s||(a=Sm(o,i+1))<56320||a>57343?e?xm(o,i):r:e?Pm(o,i,i+2):a-56320+(r-55296<<10)+65536}},Im={codeAt:Am(!1),charAt:Am(!0)}.charAt,Tm=i.RegExp,Om=s((function(){var e=Tm("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Rm=Om||s((function(){return!Tm("a","y").sticky})),Cm={BROKEN_CARET:Om||s((function(){var e=Tm("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Rm,UNSUPPORTED_Y:Om},Nm=i.RegExp,jm=s((function(){var e=Nm(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Lm=i.RegExp,Mm=s((function(){var e=Lm("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Fm=st.get,Hm=oe("native-string-replace",String.prototype.replace),Dm=RegExp.prototype.exec,qm=Dm,Bm=v("".charAt),zm=v("".indexOf),Um=v("".replace),Vm=v("".slice),Wm=(wm=/b*/g,d(Dm,vm=/a/,"a"),d(Dm,wm,"a"),0!==vm.lastIndex||0!==wm.lastIndex),Km=Cm.BROKEN_CARET,Gm=void 0!==/()??/.exec("")[1];(Wm||Gm||Km||jm||Mm)&&(qm=function(e){var t,n,r,a,o,i,s,l=this,c=Fm(l),u=Zt(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(qm,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=Km&&l.sticky,h=d(lm,l),y=l.source,g=0,b=u;if(f&&(h=Um(h,"y",""),-1===zm(h,"g")&&(h+="g"),b=Vm(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Bm(u,l.lastIndex-1))&&(y="(?: "+y+")",b=" "+b,g++),n=new RegExp("^(?:"+y+")",h)),Gm&&(n=new RegExp("^"+y+"$(?!\\s)",h)),Wm&&(r=l.lastIndex),a=d(Dm,f?n:l,b),f?a?(a.input=Vm(a.input,g),a[0]=Vm(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:Wm&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),Gm&&a&&a.length>1&&d(Hm,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=Wp(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var Jm=qm,Xm=TypeError,Ym=ge("matchAll"),Qm="RegExp String",Zm=Qm+" Iterator",ef=st.set,tf=st.getterFor(Zm),nf=RegExp.prototype,rf=TypeError,af=Op("".indexOf),of=Op("".matchAll),sf=!!of&&!s((function(){of("a",/./)})),lf=function(e,t,n,r){var a=t+" Iterator";return e.prototype=Wp(om,{next:h(+!r,n)}),am(e,a,!1),e}((function(e,t,n,r){ef(this,{type:Zm,regexp:e,string:t,global:n,unicode:r,done:!1})}),Qm,(function(){var e=tf(this);if(e.done)return im(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(C(n)){var r=d(n,e,t);return null!==r&&Re(r),r}if("RegExp"===$(e))return d(Jm,e,t);throw Xm("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,im(void 0,!0)):e.global?(""===Zt(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Im(e,t).length:1)}(n,gt(t.lastIndex),e.unicode)),im(r,!1)):(e.done=!0,im(r,!1))})),cf=function(e){var t,n,r,a=Re(this),o=Zt(e),i=_m(a,RegExp),s=Zt(um(a));return t=new i(i===RegExp?a.source:a,s),n=!!~af(s,"g"),r=!!~af(s,"u"),t.lastIndex=gt(a.lastIndex),new lf(t,o,n,r)};function uf(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}Ht({target:"String",proto:!0,forced:sf},{matchAll:function(e){var t,n,r,a,o,i=A(this);if(S(e)){if(sf)return of(i,e)}else{if(j(a=e)&&(void 0!==(o=a[sm])?o:"RegExp"===$(a))&&(t=Zt(A(um(e))),!~af(t,"g")))throw rf("`.matchAll` does not allow non-global regexes");if(sf)return of(i,e);if(r=Z(e,Ym))return d(r,e,i)}return n=Zt(i),new RegExp(e,"g")[Ym](n)}}),Ym in nf||ct(nf,Ym,cf);const df=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});var pf=()=>{var e;const t=uf(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...df(t,"input"),":hover":df(t,"inputHover"),":focus":df(t,"inputFocus"),"::placeholder":df(t,"inputPlaceholder"),"::selection":df(t,"inputSelection")},invalid:{...df(t,"inputError"),":hover":df(t,"inputErrorHover"),":focus":df(t,"inputErrorFocus"),"::placeholder":df(t,"inputErrorPlaceholder"),"::selection":df(t,"inputErrorSelection")},buttons:{base:{...df(t,"buttonSecondary"),":hover":df(t,"buttonSecondaryHover"),":focus":df(t,"buttonSecondaryActive")},active:{...df(t,"button"),":hover":df(t,"buttonHover"),":focus":df(t,"buttonActive")}}}};function mf({eventName:e,callback:t}){if(!Ti.includes(e))throw new Error(`${e} is not a supported event`);const n=go(e);Ii[n].addEventListener(t)}const ff=(e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`;async function hf({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",ff(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Fi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function yf({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return Fl((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function gf({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=Ul(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return Fl((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function bf({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let a;var r;if(a=Qr.data.isPayment?await yf({payload:e}):await gf({payload:e}),null!==(t=a.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=a.transaction)||void 0===n?void 0:n.result))if(Qr.options.features.fullPageRedirect)window.location=null===(r=a.transaction)||void 0===r?void 0:r.approvalUrl;else!function({fields:e,payload:t}){var n,r,a,o;if(Qr.options.features.fullPageRedirect&&(t.redirectUrl||null!==(n=e.transaction)&&void 0!==n&&n.approvalUrl))window.location=t.redirectUrl||(null===(o=e.transaction)||void 0===o?void 0:o.approvalUrl);else if(t.redirectUrl||null===(r=e.transaction)||void 0===r||!r.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new su({...e});const a="rebilly-instruments-approval-url";hf({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ii.purchaseCompleted.dispatch(e)}})}else if(null!==(a=e.transaction)&&void 0!==a&&a.approvalUrl){var i;window.location=null===(i=e.transaction)||void 0===i?void 0:i.approvalUrl}}({fields:a,payload:e});else Ii.purchaseCompleted.dispatch(a)}catch(e){return Ni(e),e}}async function vf({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return Fl((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new su({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result)if(Qr.options.features.fullPageRedirect)window.location=i.approvalUrl;else{const{paymentMethodsUrl:e}=Qr.options._computed;hf({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ii.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ii.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Ni(e),e}}async function wf({componentName:e,payload:t}){switch(e){case"result":gu(),async function({payload:e}){var t,n;const r=Yr.form;r||await $u();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":gu(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&Jl({instrument:e});const o=Yr.form;o||await $u();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{bf({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{vf({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function kf({state:e,payload:t}){wf({componentName:"result",payload:t,state:e})}var $f=({state:e={}})=>{e.options.features.autoConfirmation&&mf({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?vf({state:e,payload:t}):bf({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});wf({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(mf({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),kf({state:e,payload:t})}}),mf({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),kf({state:e,payload:t})}}))};async function Ef({setupFramepay:e=fp,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=mp({options:t}),Qr.form=_u({element:"form"}),Qr.summary=_u({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=xu(),Qr.mainStyleVars=Pp(),Qr.options.themeFramepay=pf(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([lu(),e()]);Qr.data=l,Ii.dataReady.dispatch(Qr.data),Qr.i18n=Tp(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&$u().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?fu():wu()})),Qr.summary&&Gl(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Ni(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Ni(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Ni(e),e}$f({state:Qr})}async function _f(){var e;await(e=1e3,new Promise((t=>{setTimeout(t,e)}))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Pi.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",xl.cancelAll(),Qr.loader.clearAll()}var xf=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Ef(e)}async destroy(){await _f()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Kr({...Qr.options},e);await _f(),Ef({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await bf({payload:e})}async setup(e){await vf({payload:e})}async show(e,t){await wf({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.8.0"}on(e,t){mf({eventName:e,callback:t})}};return xf}();
|
|
42
|
+
*/var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},j=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=S(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},L={hex:{configurable:!0}};return L.hex.get=function(){return this.hexString().replace(/^#/,"")},j.prototype.setColor=function(e){var t=S(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},j.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new j("rgb("+C("#fff",this.rgbString(),t).rgba+")","tint",t)},j.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new j("rgb("+C("#000",this.rgbString(),t).rgba+")","shade",t)},j.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},j.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},j.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},j.prototype.hexString=function(){return T(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},j.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},j.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},j.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},j.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(j.prototype,L),j.VERSION="v2.1.1",j}()})),yp=hp;const gp=e=>new yp(e);function bp(e,t=1){if(null===e)return e;const n=gp(e);return n.alpha=t,n.rgbString()}const vp=e=>bp(e,.5),wp=(e,t)=>{if(null===e)return e;return gp(e).shade(t).hexString()};function kp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $p{constructor(e){kp(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Ep={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>vp(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?bp(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?wp(e.buttonColorBackground,20):wp(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new $p(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${wp(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new $p(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?vp(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new $p(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?vp(e.inputErrorColorText):vp(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var _p=new Proxy(Ep,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class xp{constructor(e={}){this.overrides=e,this.theme=_p}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!xp.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xp,"nonCssProperties",["labels"]);function Sp(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Pp=()=>{const{theme:e={},css:t}=Qr.options,n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n min-height: 48px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new xp(e).build())}\n `;return t})(e||{});return Eu({element:"style",attributes:{type:"text/css"},content:Sp(n),target:"head"}),t&&Eu({element:"style",attributes:{type:"text/css"},content:Sp(t),target:"head"}),n};const Ap=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var Ip,Tp=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Ap},Op=function(e){if("Function"===$(e))return v(e)},Rp=Object.keys||function(e){return $t(e,Et)},Cp=l&&!Ie?Object.defineProperties:function(e,t){Re(e);for(var n,r=I(t),a=Rp(t),o=a.length,i=0;o>i;)De.f(e,n=a[i++],r[n]);return e},Np={f:Cp},jp=L("document","documentElement"),Lp="prototype",Mp="script",Fp=et("IE_PROTO"),Hp=function(){},Dp=function(e){return"<"+Mp+">"+e+"</"+Mp+">"},qp=function(e){e.write(Dp("")),e.close();var t=e.parentWindow.Object;return e=null,t},Bp=function(){try{Ip=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;Bp="undefined"!=typeof document?document.domain&&Ip?qp(Ip):(t=_e("iframe"),n="java"+Mp+":",t.style.display="none",jp.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Dp("document.F=Object")),e.close(),e.F):qp(Ip);for(var r=Et.length;r--;)delete Bp[Lp][Et[r]];return Bp()};tt[Fp]=!0;var zp,Up,Vp,Wp=Object.create||function(e,t){var n;return null!==e?(Hp[Lp]=Re(e),n=new Hp,Hp[Lp]=null,n[Fp]=e):n=Bp(),void 0===t?n:Np.f(n,t)},Kp=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Gp=et("IE_PROTO"),Jp=Object,Xp=Jp.prototype,Yp=Kp?Jp.getPrototypeOf:function(e){var t=se(e);if(ce(t,Gp))return t[Gp];var n=t.constructor;return C(n)&&t instanceof n?n.prototype:t instanceof Jp?Xp:null},Qp=ge("iterator"),Zp=!1;[].keys&&("next"in(Vp=[].keys())?(Up=Yp(Yp(Vp)))!==Object.prototype&&(zp=Up):Zp=!0);var em=!j(zp)||s((function(){var e={};return zp[Qp].call(e)!==e}));em&&(zp={}),C(zp[Qp])||ct(zp,Qp,(function(){return this}));var tm={IteratorPrototype:zp,BUGGY_SAFARI_ITERATORS:Zp},nm=De.f,rm=ge("toStringTag"),am=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ce(e,rm)&&nm(e,rm,{configurable:!0,value:t})},om=tm.IteratorPrototype,im=function(e,t){return{value:e,done:t}},sm=ge("match"),lm=function(){var e=Re(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cm=RegExp.prototype,um=function(e){var t=e.flags;return void 0!==t||"flags"in cm||ce(e,"flags")||!M(cm,e)?t:d(lm,e)},dm=function(){},pm=[],mm=L("Reflect","construct"),fm=/^\s*(?:class|function)\b/,hm=v(fm.exec),ym=!fm.exec(dm),gm=function(e){if(!C(e))return!1;try{return mm(dm,pm,e),!0}catch(e){return!1}},bm=function(e){if(!C(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ym||!!hm(fm,Xe(e))}catch(e){return!0}};bm.sham=!0;var vm,wm,km=!mm||s((function(){var e;return gm(gm.call)||!gm(Object)||!gm((function(){e=!0}))||e}))?bm:gm,$m=TypeError,Em=ge("species"),_m=function(e,t){var n,r=Re(e).constructor;return void 0===r||S(n=Re(r)[Em])?t:function(e){if(km(e))return e;throw $m(X(e)+" is not a constructor")}(n)},xm=v("".charAt),Sm=v("".charCodeAt),Pm=v("".slice),Am=function(e){return function(t,n){var r,a,o=Zt(A(t)),i=mt(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Sm(o,i))<55296||r>56319||i+1===s||(a=Sm(o,i+1))<56320||a>57343?e?xm(o,i):r:e?Pm(o,i,i+2):a-56320+(r-55296<<10)+65536}},Im={codeAt:Am(!1),charAt:Am(!0)}.charAt,Tm=i.RegExp,Om=s((function(){var e=Tm("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Rm=Om||s((function(){return!Tm("a","y").sticky})),Cm={BROKEN_CARET:Om||s((function(){var e=Tm("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Rm,UNSUPPORTED_Y:Om},Nm=i.RegExp,jm=s((function(){var e=Nm(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Lm=i.RegExp,Mm=s((function(){var e=Lm("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Fm=st.get,Hm=oe("native-string-replace",String.prototype.replace),Dm=RegExp.prototype.exec,qm=Dm,Bm=v("".charAt),zm=v("".indexOf),Um=v("".replace),Vm=v("".slice),Wm=(wm=/b*/g,d(Dm,vm=/a/,"a"),d(Dm,wm,"a"),0!==vm.lastIndex||0!==wm.lastIndex),Km=Cm.BROKEN_CARET,Gm=void 0!==/()??/.exec("")[1];(Wm||Gm||Km||jm||Mm)&&(qm=function(e){var t,n,r,a,o,i,s,l=this,c=Fm(l),u=Zt(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(qm,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=Km&&l.sticky,h=d(lm,l),y=l.source,g=0,b=u;if(f&&(h=Um(h,"y",""),-1===zm(h,"g")&&(h+="g"),b=Vm(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Bm(u,l.lastIndex-1))&&(y="(?: "+y+")",b=" "+b,g++),n=new RegExp("^(?:"+y+")",h)),Gm&&(n=new RegExp("^"+y+"$(?!\\s)",h)),Wm&&(r=l.lastIndex),a=d(Dm,f?n:l,b),f?a?(a.input=Vm(a.input,g),a[0]=Vm(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:Wm&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),Gm&&a&&a.length>1&&d(Hm,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=Wp(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var Jm=qm,Xm=TypeError,Ym=ge("matchAll"),Qm="RegExp String",Zm=Qm+" Iterator",ef=st.set,tf=st.getterFor(Zm),nf=RegExp.prototype,rf=TypeError,af=Op("".indexOf),of=Op("".matchAll),sf=!!of&&!s((function(){of("a",/./)})),lf=function(e,t,n,r){var a=t+" Iterator";return e.prototype=Wp(om,{next:h(+!r,n)}),am(e,a,!1),e}((function(e,t,n,r){ef(this,{type:Zm,regexp:e,string:t,global:n,unicode:r,done:!1})}),Qm,(function(){var e=tf(this);if(e.done)return im(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(C(n)){var r=d(n,e,t);return null!==r&&Re(r),r}if("RegExp"===$(e))return d(Jm,e,t);throw Xm("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,im(void 0,!0)):e.global?(""===Zt(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Im(e,t).length:1)}(n,gt(t.lastIndex),e.unicode)),im(r,!1)):(e.done=!0,im(r,!1))})),cf=function(e){var t,n,r,a=Re(this),o=Zt(e),i=_m(a,RegExp),s=Zt(um(a));return t=new i(i===RegExp?a.source:a,s),n=!!~af(s,"g"),r=!!~af(s,"u"),t.lastIndex=gt(a.lastIndex),new lf(t,o,n,r)};function uf(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}Ht({target:"String",proto:!0,forced:sf},{matchAll:function(e){var t,n,r,a,o,i=A(this);if(S(e)){if(sf)return of(i,e)}else{if(j(a=e)&&(void 0!==(o=a[sm])?o:"RegExp"===$(a))&&(t=Zt(A(um(e))),!~af(t,"g")))throw rf("`.matchAll` does not allow non-global regexes");if(sf)return of(i,e);if(r=Z(e,Ym))return d(r,e,i)}return n=Zt(i),new RegExp(e,"g")[Ym](n)}}),Ym in nf||ct(nf,Ym,cf);const df=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});var pf=()=>{var e;const t=uf(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...df(t,"input"),":hover":df(t,"inputHover"),":focus":df(t,"inputFocus"),"::placeholder":df(t,"inputPlaceholder"),"::selection":df(t,"inputSelection")},invalid:{...df(t,"inputError"),":hover":df(t,"inputErrorHover"),":focus":df(t,"inputErrorFocus"),"::placeholder":df(t,"inputErrorPlaceholder"),"::selection":df(t,"inputErrorSelection")},buttons:{base:{...df(t,"buttonSecondary"),":hover":df(t,"buttonSecondaryHover"),":focus":df(t,"buttonSecondaryActive")},active:{...df(t,"button"),":hover":df(t,"buttonHover"),":focus":df(t,"buttonActive")}}}};function mf({eventName:e,callback:t}){if(!Ti.includes(e))throw new Error(`${e} is not a supported event`);const n=go(e);Ii[n].addEventListener(t)}const ff=(e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`;async function hf({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",ff(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Fi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function yf({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return Fl((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function gf({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=Ul(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return Fl((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function bf({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let a;var r;if(a=Qr.data.isPayment?await yf({payload:e}):await gf({payload:e}),null!==(t=a.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=a.transaction)||void 0===n?void 0:n.result))if(Qr.options.features.fullPageRedirect)window.location=null===(r=a.transaction)||void 0===r?void 0:r.approvalUrl;else!function({fields:e,payload:t}){var n,r,a,o;if(Qr.options.features.fullPageRedirect&&(t.redirectUrl||null!==(n=e.transaction)&&void 0!==n&&n.approvalUrl))window.location=t.redirectUrl||(null===(o=e.transaction)||void 0===o?void 0:o.approvalUrl);else if(t.redirectUrl||null===(r=e.transaction)||void 0===r||!r.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new su({...e});const a="rebilly-instruments-approval-url";hf({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ii.purchaseCompleted.dispatch(e)}})}else if(null!==(a=e.transaction)&&void 0!==a&&a.approvalUrl){var i;window.location=null===(i=e.transaction)||void 0===i?void 0:i.approvalUrl}}({fields:a,payload:e});else Ii.purchaseCompleted.dispatch(a)}catch(e){return Ni(e),e}}async function vf({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return Fl((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new su({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result)if(Qr.options.features.fullPageRedirect)window.location=i.approvalUrl;else{const{paymentMethodsUrl:e}=Qr.options._computed;hf({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ii.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ii.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Ni(e),e}}async function wf({componentName:e,payload:t}){switch(e){case"result":gu(),async function({payload:e}){var t,n;const r=Yr.form;r||await $u();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":gu(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&Jl({instrument:e});const o=Yr.form;o||await $u();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{bf({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{vf({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function kf({state:e,payload:t}){wf({componentName:"result",payload:t,state:e})}var $f=({state:e={}})=>{e.options.features.autoConfirmation&&mf({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?vf({state:e,payload:t}):bf({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});wf({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(mf({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),kf({state:e,payload:t})}}),mf({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),kf({state:e,payload:t})}}))};async function Ef({setupFramepay:e=fp,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=mp({options:t}),Qr.form=_u({element:"form"}),Qr.summary=_u({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=xu(),Qr.mainStyleVars=Pp(),Qr.options.themeFramepay=pf(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([lu(),e()]);Qr.data=l,Ii.dataReady.dispatch(Qr.data),Qr.i18n=Tp(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&$u().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?fu():wu()})),Qr.summary&&Gl(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Ni(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Ni(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Ni(e),e}$f({state:Qr})}async function _f(){var e;await(e=1e3,new Promise((t=>{setTimeout(t,e)}))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Pi.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",xl.cancelAll(),Qr.loader.clearAll()}var xf=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Ef(e)}async destroy(){await _f()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Kr({...Qr.options},e);await _f(),Ef({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await bf({payload:e})}async setup(e){await vf({payload:e})}async show(e,t){await wf({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.8.1"}on(e,t){mf({eventName:e,callback:t})}};return xf}();
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebilly/instruments",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.2",
|
|
4
4
|
"author": "Rebilly",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"unpkg": "dist/index.min.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CHANGELOG.md"
|
|
11
|
+
],
|
|
8
12
|
"scripts": {
|
|
9
13
|
"build": "yarn rollup -c --environment NODE_ENV:production",
|
|
10
14
|
"dev": "yarn rollup -c --watch --environment NODE_ENV:development",
|
package/.babelrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/preset-env",
|
|
5
|
-
{
|
|
6
|
-
"targets": {
|
|
7
|
-
"chrome": 70
|
|
8
|
-
},
|
|
9
|
-
"useBuiltIns": "usage",
|
|
10
|
-
"corejs": "3.23.3"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
],
|
|
14
|
-
"plugins": [
|
|
15
|
-
[
|
|
16
|
-
"module-resolver",
|
|
17
|
-
{
|
|
18
|
-
"root": ["./"],
|
|
19
|
-
"alias": {
|
|
20
|
-
"@": "./src/",
|
|
21
|
-
"test": "./test"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
]
|
|
26
|
-
}
|
package/project.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "instruments/core",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"projectType": "library",
|
|
5
|
-
"sourceRoot": "apps/instruments/core",
|
|
6
|
-
"targets": {
|
|
7
|
-
"semantic-release": {
|
|
8
|
-
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
|
|
9
|
-
"options": {
|
|
10
|
-
"plugins": [
|
|
11
|
-
[
|
|
12
|
-
"@semantic-release/exec",
|
|
13
|
-
{
|
|
14
|
-
"publishCmd": "node ../../../publish-to-s3.js ${nextRelease.version} ./dist/index.min.js core.js instruments",
|
|
15
|
-
"execCwd": "${PROJECT_DIR}"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"lint:no-fix": {
|
|
22
|
-
"executor": "nx:run-script",
|
|
23
|
-
"options": {
|
|
24
|
-
"script": "lint:no-fix"
|
|
25
|
-
},
|
|
26
|
-
"dependsOn": [
|
|
27
|
-
"^build"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
package/rollup.config.mjs
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { babel } from '@rollup/plugin-babel';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
-
import json from '@rollup/plugin-json';
|
|
5
|
-
import replace from '@rollup/plugin-replace';
|
|
6
|
-
import nodePolyfills from 'rollup-plugin-polyfill-node';
|
|
7
|
-
import ignore from 'rollup-plugin-ignore';
|
|
8
|
-
import versionInjector from 'rollup-plugin-version-injector';
|
|
9
|
-
import { builtinModules } from 'module';
|
|
10
|
-
import { terser } from 'rollup-plugin-terser';
|
|
11
|
-
|
|
12
|
-
const isDevMode = process.env.NODE_ENV === 'development';
|
|
13
|
-
|
|
14
|
-
const buildOptions = () => {
|
|
15
|
-
const options = [
|
|
16
|
-
// Locates a module in the project's node_modules
|
|
17
|
-
resolve({
|
|
18
|
-
extensions: ['.mjs', '.js', '.jsx', '.json'],
|
|
19
|
-
preferBuiltins: true,
|
|
20
|
-
mainFields: ['browser', 'jsnext:main', 'module', 'main'],
|
|
21
|
-
}),
|
|
22
|
-
// Converts CommonJS to ES6 modules
|
|
23
|
-
commonjs(),
|
|
24
|
-
// Fix commonjs issues with virtual node
|
|
25
|
-
// https://github.com/proteriax/rollup-plugin-ignore/issues/3
|
|
26
|
-
// https://github.com/rollup/plugins/issues/248
|
|
27
|
-
// https://github.com/rollup/rollup-plugin-commonjs/issues/315
|
|
28
|
-
ignore(builtinModules, { commonjsBugFix: true }),
|
|
29
|
-
// Replace values at bundle time
|
|
30
|
-
replace({
|
|
31
|
-
preventAssignment: true,
|
|
32
|
-
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
33
|
-
}),
|
|
34
|
-
// Allows the use of named imports in addition to the default import on node modules
|
|
35
|
-
nodePolyfills(),
|
|
36
|
-
// Babel transpiling
|
|
37
|
-
babel({
|
|
38
|
-
exclude: 'node_modules/**',
|
|
39
|
-
babelHelpers: 'runtime',
|
|
40
|
-
skipPreflightCheck: true,
|
|
41
|
-
}),
|
|
42
|
-
// Converts .json files to ES6 modules
|
|
43
|
-
json(),
|
|
44
|
-
];
|
|
45
|
-
if (!isDevMode) {
|
|
46
|
-
options.push(
|
|
47
|
-
// Inject version from package.json (RebillyInstruments.version)
|
|
48
|
-
versionInjector(),
|
|
49
|
-
// Minify and reduce bundle file sizes
|
|
50
|
-
terser(),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
return options;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const buildOutput = () => {
|
|
57
|
-
const output = [
|
|
58
|
-
{
|
|
59
|
-
file: 'dist/index.js',
|
|
60
|
-
format: 'es',
|
|
61
|
-
sourcemap: isDevMode ? 'inline' : false,
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
-
if (!isDevMode) {
|
|
65
|
-
output.push({
|
|
66
|
-
file: 'dist/index.min.js',
|
|
67
|
-
format: 'iife',
|
|
68
|
-
name: 'RebillyInstruments',
|
|
69
|
-
exports: 'default',
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return output;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default {
|
|
76
|
-
input: 'src/index.js',
|
|
77
|
-
output: [...buildOutput()],
|
|
78
|
-
plugins: [...buildOptions()],
|
|
79
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import AJV from 'ajv/dist/2019';
|
|
2
|
-
import schema from './schemas/options-schema';
|
|
3
|
-
|
|
4
|
-
export class RebillyInstrumentsConfigError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'Rebilly Instruments Configuration Error';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
trimStack() {
|
|
11
|
-
Error.captureStackTrace(this, RebillyInstrumentsConfigError);
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const ajv = new AJV({
|
|
17
|
-
allErrors: true,
|
|
18
|
-
removeAdditional: true,
|
|
19
|
-
useDefaults: true,
|
|
20
|
-
});
|
|
21
|
-
const validate = ajv.compile(schema);
|
|
22
|
-
|
|
23
|
-
export function sanitize(data) {
|
|
24
|
-
// cast data to be only json object
|
|
25
|
-
return JSON.parse(JSON.stringify(data));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function validateOptions(data) {
|
|
29
|
-
const sanitizedData = sanitize(data);
|
|
30
|
-
const valid = validate(sanitizedData);
|
|
31
|
-
if (valid) {
|
|
32
|
-
return sanitizedData;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
validate.errors.forEach((error) => {
|
|
36
|
-
let errorMessage = ``;
|
|
37
|
-
let instancePathReadable = error.instancePath
|
|
38
|
-
.substring(1)
|
|
39
|
-
.replace(/\//gi, '.');
|
|
40
|
-
instancePathReadable = instancePathReadable.replace(
|
|
41
|
-
/\.\d+/gi,
|
|
42
|
-
(match) => `[${match.replace('.', '')}]`,
|
|
43
|
-
);
|
|
44
|
-
if (!instancePathReadable.length) {
|
|
45
|
-
instancePathReadable = 'options';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let nodes;
|
|
49
|
-
let schemaPath;
|
|
50
|
-
let value;
|
|
51
|
-
switch (error.keyword) {
|
|
52
|
-
case 'if':
|
|
53
|
-
case 'false schema':
|
|
54
|
-
// ignore keywords
|
|
55
|
-
break;
|
|
56
|
-
case 'required':
|
|
57
|
-
if (error.schemaPath.match(/(oneOf|anyOf)/)) {
|
|
58
|
-
// ignore and allow their oneOf or anyOf keywords to handle error message
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
errorMessage = `${instancePathReadable} ${error.message}`;
|
|
62
|
-
break;
|
|
63
|
-
case 'oneOf':
|
|
64
|
-
case 'anyOf':
|
|
65
|
-
console.error(
|
|
66
|
-
new RebillyInstrumentsConfigError(
|
|
67
|
-
`${instancePathReadable} ${error.message}, see schemas below.`,
|
|
68
|
-
).trimStack(),
|
|
69
|
-
);
|
|
70
|
-
schemaPath = error.schemaPath.replace('#/', '').split('/');
|
|
71
|
-
nodes = schema;
|
|
72
|
-
schemaPath.forEach((item) => {
|
|
73
|
-
nodes = nodes[item];
|
|
74
|
-
});
|
|
75
|
-
nodes.forEach((node) => {
|
|
76
|
-
const displayNode = JSON.stringify(node, null, 2);
|
|
77
|
-
console.error(
|
|
78
|
-
`${instancePathReadable} ${error.keyword} schema.\n${displayNode}`,
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
break;
|
|
82
|
-
case 'enum':
|
|
83
|
-
value = instancePathReadable
|
|
84
|
-
.split('.')
|
|
85
|
-
.reduce((acc, key) => acc[key], data);
|
|
86
|
-
errorMessage = `${instancePathReadable} ${error.message}: ${error.params.allowedValues}. received: ${value}`;
|
|
87
|
-
break;
|
|
88
|
-
case 'dependentRequired':
|
|
89
|
-
case 'maxLength':
|
|
90
|
-
case 'minItems':
|
|
91
|
-
case 'pattern':
|
|
92
|
-
errorMessage = `${instancePathReadable} ${error.message}`;
|
|
93
|
-
break;
|
|
94
|
-
default:
|
|
95
|
-
errorMessage = `Error with ${instancePathReadable} - See error message`;
|
|
96
|
-
console.error(error);
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (errorMessage) {
|
|
100
|
-
console.error(
|
|
101
|
-
new RebillyInstrumentsConfigError(errorMessage).trimStack(),
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
console.error(
|
|
107
|
-
new RebillyInstrumentsConfigError(
|
|
108
|
-
'Configuration is invalid',
|
|
109
|
-
).trimStack(),
|
|
110
|
-
);
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|