@rebilly/instruments 9.74.2 → 9.74.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1 @@
1
- ## [9.74.2](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.74.1...instruments/core-v9.74.2) (2024-08-21)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * **instruments:** Update email property placeholder ([#7145](https://github.com/Rebilly/rebilly/issues/7145)) ([664ff33](https://github.com/Rebilly/rebilly/commit/664ff33cb5aebfa4181bd0dfd6c020929bcc26f3))
1
+ ## [9.74.3](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.74.2...instruments/core-v9.74.3) (2024-08-21)
package/dist/index.d.ts CHANGED
@@ -3,14 +3,15 @@ export interface PlanItem {
3
3
  quantity: number;
4
4
  thumbnail?: string;
5
5
  }
6
+ export interface Quantity {
7
+ default?: number;
8
+ minimum?: number;
9
+ maximum?: number;
10
+ multipleOf?: number;
11
+ }
6
12
  export interface Item {
7
13
  planId: string;
8
- quantity: number | {
9
- default?: number;
10
- minimum?: number;
11
- maximum?: number;
12
- multipleOf?: number;
13
- };
14
+ quantity: number | Quantity;
14
15
  thumbnail?: string;
15
16
  }
16
17
  export interface Money {
@@ -256,6 +257,8 @@ export interface DevProperties {
256
257
  framePayScriptLink?: string;
257
258
  framePayStyleLink?: string;
258
259
  }
260
+ export type BCP47 = "af" | "af-NA" | "af-ZA" | "agq" | "agq-CM" | "ak" | "ak-GH" | "am" | "am-ET" | "ar" | "ar-001" | "ar-AE" | "ar-BH" | "ar-DJ" | "ar-DZ" | "ar-EG" | "ar-EH" | "ar-ER" | "ar-IL" | "ar-IQ" | "ar-JO" | "ar-KM" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-MR" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SD" | "ar-SO" | "ar-SS" | "ar-SY" | "ar-TD" | "ar-TN" | "ar-YE" | "as" | "as-IN" | "asa" | "asa-TZ" | "ast" | "ast-ES" | "az" | "az-Cyrl" | "az-Cyrl-AZ" | "az-Latn" | "az-Latn-AZ" | "bas" | "bas-CM" | "be" | "be-BY" | "bem" | "bem-ZM" | "bez" | "bez-TZ" | "bg" | "bg-BG" | "bm" | "bm-ML" | "bn" | "bn-BD" | "bn-IN" | "bo" | "bo-CN" | "bo-IN" | "br" | "br-FR" | "brx" | "brx-IN" | "bs" | "bs-Cyrl" | "bs-Cyrl-BA" | "bs-Latn" | "bs-Latn-BA" | "ca" | "ca-AD" | "ca-ES" | "ca-FR" | "ca-IT" | "ccp" | "ccp-BD" | "ccp-IN" | "ce" | "ce-RU" | "cgg" | "cgg-UG" | "chr" | "chr-US" | "ckb" | "ckb-IQ" | "ckb-IR" | "cs" | "cs-CZ" | "cy" | "cy-GB" | "da" | "da-DK" | "da-GL" | "dav" | "dav-KE" | "de" | "de-AT" | "de-BE" | "de-CH" | "de-DE" | "de-IT" | "de-LI" | "de-LU" | "dje" | "dje-NE" | "dsb" | "dsb-DE" | "dua" | "dua-CM" | "dyo" | "dyo-SN" | "dz" | "dz-BT" | "ebu" | "ebu-KE" | "ee" | "ee-GH" | "ee-TG" | "el" | "el-CY" | "el-GR" | "en" | "en-001" | "en-150" | "en-AG" | "en-AI" | "en-AS" | "en-AT" | "en-AU" | "en-BB" | "en-BE" | "en-BI" | "en-BM" | "en-BS" | "en-BW" | "en-BZ" | "en-CA" | "en-CC" | "en-CH" | "en-CK" | "en-CM" | "en-CX" | "en-CY" | "en-DE" | "en-DG" | "en-DK" | "en-DM" | "en-ER" | "en-FI" | "en-FJ" | "en-FK" | "en-FM" | "en-GB" | "en-GD" | "en-GG" | "en-GH" | "en-GI" | "en-GM" | "en-GU" | "en-GY" | "en-HK" | "en-IE" | "en-IL" | "en-IM" | "en-IN" | "en-IO" | "en-JE" | "en-JM" | "en-KE" | "en-KI" | "en-KN" | "en-KY" | "en-LC" | "en-LR" | "en-LS" | "en-MG" | "en-MH" | "en-MO" | "en-MP" | "en-MS" | "en-MT" | "en-MU" | "en-MW" | "en-MY" | "en-NA" | "en-NF" | "en-NG" | "en-NL" | "en-NR" | "en-NU" | "en-NZ" | "en-PG" | "en-PH" | "en-PK" | "en-PN" | "en-PR" | "en-PW" | "en-RW" | "en-SB" | "en-SC" | "en-SD" | "en-SE" | "en-SG" | "en-SH" | "en-SI" | "en-SL" | "en-SS" | "en-SX" | "en-SZ" | "en-TC" | "en-TK" | "en-TO" | "en-TT" | "en-TV" | "en-TZ" | "en-UG" | "en-UM" | "en-US" | "en-US-POSIX" | "en-VC" | "en-VG" | "en-VI" | "en-VU" | "en-WS" | "en-ZA" | "en-ZM" | "en-ZW" | "eo" | "es" | "es-419" | "es-AR" | "es-BO" | "es-BR" | "es-BZ" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EA" | "es-EC" | "es-ES" | "es-GQ" | "es-GT" | "es-HN" | "es-IC" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PH" | "es-PR" | "es-PY" | "es-SV" | "es-US" | "es-UY" | "es-VE" | "et" | "et-EE" | "eu" | "eu-ES" | "ewo" | "ewo-CM" | "fa" | "fa-AF" | "fa-IR" | "ff" | "ff-CM" | "ff-GN" | "ff-MR" | "ff-SN" | "fi" | "fi-FI" | "fil" | "fil-PH" | "fo" | "fo-DK" | "fo-FO" | "fr" | "fr-BE" | "fr-BF" | "fr-BI" | "fr-BJ" | "fr-BL" | "fr-CA" | "fr-CD" | "fr-CF" | "fr-CG" | "fr-CH" | "fr-CI" | "fr-CM" | "fr-DJ" | "fr-DZ" | "fr-FR" | "fr-GA" | "fr-GF" | "fr-GN" | "fr-GP" | "fr-GQ" | "fr-HT" | "fr-KM" | "fr-LU" | "fr-MA" | "fr-MC" | "fr-MF" | "fr-MG" | "fr-ML" | "fr-MQ" | "fr-MR" | "fr-MU" | "fr-NC" | "fr-NE" | "fr-PF" | "fr-PM" | "fr-RE" | "fr-RW" | "fr-SC" | "fr-SN" | "fr-SY" | "fr-TD" | "fr-TG" | "fr-TN" | "fr-VU" | "fr-WF" | "fr-YT" | "fur" | "fur-IT" | "fy" | "fy-NL" | "ga" | "ga-IE" | "gd" | "gd-GB" | "gl" | "gl-ES" | "gsw" | "gsw-CH" | "gsw-FR" | "gsw-LI" | "gu" | "gu-IN" | "guz" | "guz-KE" | "gv" | "gv-IM" | "ha" | "ha-GH" | "ha-NE" | "ha-NG" | "haw" | "haw-US" | "he" | "he-IL" | "hi" | "hi-IN" | "hr" | "hr-BA" | "hr-HR" | "hsb" | "hsb-DE" | "hu" | "hu-HU" | "hy" | "hy-AM" | "id" | "id-ID" | "ig" | "ig-NG" | "ii" | "ii-CN" | "is" | "is-IS" | "it" | "it-CH" | "it-IT" | "it-SM" | "it-VA" | "ja" | "ja-JP" | "jgo" | "jgo-CM" | "jmc" | "jmc-TZ" | "ka" | "ka-GE" | "kab" | "kab-DZ" | "kam" | "kam-KE" | "kde" | "kde-TZ" | "kea" | "kea-CV" | "khq" | "khq-ML" | "ki" | "ki-KE" | "kk" | "kk-KZ" | "kkj" | "kkj-CM" | "kl" | "kl-GL" | "kln" | "kln-KE" | "km" | "km-KH" | "kn" | "kn-IN" | "ko" | "ko-KP" | "ko-KR" | "kok" | "kok-IN" | "ks" | "ks-IN" | "ksb" | "ksb-TZ" | "ksf" | "ksf-CM" | "ksh" | "ksh-DE" | "kw" | "kw-GB" | "ky" | "ky-KG" | "lag" | "lag-TZ" | "lb" | "lb-LU" | "lg" | "lg-UG" | "lkt" | "lkt-US" | "ln" | "ln-AO" | "ln-CD" | "ln-CF" | "ln-CG" | "lo" | "lo-LA" | "lrc" | "lrc-IQ" | "lrc-IR" | "lt" | "lt-LT" | "lu" | "lu-CD" | "luo" | "luo-KE" | "luy" | "luy-KE" | "lv" | "lv-LV" | "mas" | "mas-KE" | "mas-TZ" | "mer" | "mer-KE" | "mfe" | "mfe-MU" | "mg" | "mg-MG" | "mgh" | "mgh-MZ" | "mgo" | "mgo-CM" | "mk" | "mk-MK" | "ml" | "ml-IN" | "mn" | "mn-MN" | "mr" | "mr-IN" | "ms" | "ms-BN" | "ms-MY" | "ms-SG" | "mt" | "mt-MT" | "mua" | "mua-CM" | "my" | "my-MM" | "mzn" | "mzn-IR" | "naq" | "naq-NA" | "nb" | "nb-NO" | "nb-SJ" | "nd" | "nd-ZW" | "nds" | "nds-DE" | "nds-NL" | "ne" | "ne-IN" | "ne-NP" | "nl" | "nl-AW" | "nl-BE" | "nl-BQ" | "nl-CW" | "nl-NL" | "nl-SR" | "nl-SX" | "nmg" | "nmg-CM" | "nn" | "nn-NO" | "nnh" | "nnh-CM" | "nus" | "nus-SS" | "nyn" | "nyn-UG" | "om" | "om-ET" | "om-KE" | "or" | "or-IN" | "os" | "os-GE" | "os-RU" | "pa" | "pa-Arab" | "pa-Arab-PK" | "pa-Guru" | "pa-Guru-IN" | "pl" | "pl-PL" | "ps" | "ps-AF" | "pt" | "pt-AO" | "pt-BR" | "pt-CH" | "pt-CV" | "pt-GQ" | "pt-GW" | "pt-LU" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "rm" | "rm-CH" | "rn" | "rn-BI" | "ro" | "ro-MD" | "ro-RO" | "rof" | "rof-TZ" | "ru" | "ru-BY" | "ru-KG" | "ru-KZ" | "ru-MD" | "ru-RU" | "ru-UA" | "rw" | "rw-RW" | "rwk" | "rwk-TZ" | "sah" | "sah-RU" | "saq" | "saq-KE" | "sbp" | "sbp-TZ" | "se" | "se-FI" | "se-NO" | "se-SE" | "seh" | "seh-MZ" | "ses" | "ses-ML" | "sg" | "sg-CF" | "shi" | "shi-Latn" | "shi-Latn-MA" | "shi-Tfng" | "shi-Tfng-MA" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "smn" | "smn-FI" | "sn" | "sn-ZW" | "so" | "so-DJ" | "so-ET" | "so-KE" | "so-SO" | "sq" | "sq-AL" | "sq-MK" | "sq-XK" | "sr" | "sr-Cyrl" | "sr-Cyrl-BA" | "sr-Cyrl-ME" | "sr-Cyrl-RS" | "sr-Cyrl-XK" | "sr-Latn" | "sr-Latn-BA" | "sr-Latn-ME" | "sr-Latn-RS" | "sr-Latn-XK" | "sv" | "sv-AX" | "sv-FI" | "sv-SE" | "sw" | "sw-CD" | "sw-KE" | "sw-TZ" | "sw-UG" | "ta" | "ta-IN" | "ta-LK" | "ta-MY" | "ta-SG" | "te" | "te-IN" | "teo" | "teo-KE" | "teo-UG" | "tg" | "tg-TJ" | "th" | "th-TH" | "ti" | "ti-ER" | "ti-ET" | "to" | "to-TO" | "tr" | "tr-CY" | "tr-TR" | "tt" | "tt-RU" | "twq" | "twq-NE" | "tzm" | "tzm-MA" | "ug" | "ug-CN" | "uk" | "uk-UA" | "ur" | "ur-IN" | "ur-PK" | "uz" | "uz-Arab" | "uz-Arab-AF" | "uz-Cyrl" | "uz-Cyrl-UZ" | "uz-Latn" | "uz-Latn-UZ" | "vai" | "vai-Latn" | "vai-Latn-LR" | "vai-Vaii" | "vai-Vaii-LR" | "vi" | "vi-VN" | "vun" | "vun-TZ" | "wae" | "wae-CH" | "wo" | "wo-SN" | "xog" | "xog-UG" | "yav" | "yav-CM" | "yi" | "yi-001" | "yo" | "yo-BJ" | "yo-NG" | "yue" | "yue-Hans" | "yue-Hans-CN" | "yue-Hant" | "yue-Hant-HK" | "zgh" | "zgh-MA" | "zh" | "zh-Hans" | "zh-Hans-CN" | "zh-Hans-HK" | "zh-Hans-MO" | "zh-Hans-SG" | "zh-Hant" | "zh-Hant-HK" | "zh-Hant-MO" | "zh-Hant-TW" | "zu" | "zu-ZA";
261
+ export type Locales = BCP47 | "auto";
259
262
  export interface Options {
260
263
  organizationId?: string;
261
264
  publishableKey?: string;
@@ -277,7 +280,7 @@ export interface Options {
277
280
  theme?: ThemeProperties;
278
281
  i18n?: I18n;
279
282
  countryCode?: string;
280
- locale?: "en" | "es" | "auto";
283
+ locale?: Locales;
281
284
  paymentInstruments?: PaymentInstrumentsDisplayOptions;
282
285
  features?: Features;
283
286
  _dev?: DevProperties;
package/dist/index.js CHANGED
@@ -28075,18 +28075,19 @@ const setupStylesVars = () => {
28075
28075
  return styleVars;
28076
28076
  };
28077
28077
  const triggerTranslations = () => {
28078
- state.translate.init(state.options.locale, state.options.i18n);
28078
+ var _a, _b;
28079
+ state.translate.init((_a = state.options) == null ? void 0 : _a.locale, (_b = state.options) == null ? void 0 : _b.i18n);
28079
28080
  state.translate.translateItems();
28080
28081
  };
28081
28082
  const setupI18n = () => {
28082
- var _a, _b;
28083
- if (state.options.locale === "auto" && ((_b = (_a = state.data.riskMetadata) == null ? void 0 : _a.browserData) == null ? void 0 : _b.language)) {
28083
+ var _a, _b, _c, _d, _e2, _f;
28084
+ if (((_a = state.options) == null ? void 0 : _a.locale) === "auto" && ((_d = (_c = (_b = state.data) == null ? void 0 : _b.riskMetadata) == null ? void 0 : _c.browserData) == null ? void 0 : _d.language)) {
28084
28085
  const {
28085
28086
  browserData: { language }
28086
28087
  } = state.data.riskMetadata;
28087
28088
  state.options.locale = language;
28088
28089
  }
28089
- state.translate.init(state.options.locale, state.options.i18n);
28090
+ state.translate.init((_e2 = state.options) == null ? void 0 : _e2.locale, (_f = state.options) == null ? void 0 : _f.i18n);
28090
28091
  return triggerTranslations;
28091
28092
  };
28092
28093
  function processCSS(rawCss) {
@@ -28794,12 +28795,14 @@ async function destroy() {
28794
28795
  iframes[frame] = null;
28795
28796
  }
28796
28797
  });
28797
- registeredListeners.removeAll(document);
28798
+ registeredListeners.removeAll();
28798
28799
  state.hasMounted = false;
28799
- if (state.summary) {
28800
+ if (state.summary instanceof HTMLElement) {
28800
28801
  state.summary.textContent = "";
28801
28802
  }
28802
- state.form.textContent = "";
28803
+ if (state.form instanceof HTMLElement) {
28804
+ state.form.textContent = "";
28805
+ }
28803
28806
  await cn$1.cancelAll();
28804
28807
  state.loader.clearAll();
28805
28808
  }
package/dist/index.min.js CHANGED
@@ -47,4 +47,4 @@ var RebillyInstruments=function(){"use strict";function e(e,t){const n=Object.cr
47
47
  * @version v2.1.1
48
48
  * @link http://noeldelgado.github.io/values.js/
49
49
  * @license MIT
50
- */class mE{constructor(e="#000",t="base",n=0){[this.rgb,this.alpha,this.type,this.weight]=[[0,0,0],1,t,n];const r=null===e?"#000":e;if("string"!=typeof r)throw new TypeError(`Input should be a string: ${r}`);const a=dE(r);if(!a)throw new Error(`Unable to parse color from string: ${r}`);return this[`_setFrom${a.type.toUpperCase()}`]([...a.values,a.alpha])}get hex(){return this.hexString().replace(/^#/,"")}setColor(e){const t=dE(e);return t?this[`_setFrom${t.type.toUpperCase()}`]([...t.values,t.alpha]):null}tint(e,t=pE(e,50)){return new mE(`rgb(${qS("#fff",this.rgbString(),t).rgba})`,"tint",t)}shade(e,t=pE(e,50)){return new mE(`rgb(${qS("#000",this.rgbString(),t).rgba})`,"shade",t)}tints(e,t=pE(e,10)){return Array.from({length:100/t},((e,n)=>this.tint((n+1)*t)))}shades(e,t=pE(e,10)){return Array.from({length:100/t},((e,n)=>this.shade((n+1)*t)))}all(e=10){return[...this.tints(e).reverse(),Object.assign(this),...this.shades(e)]}hexString(){return MS(this.alpha>=1?this.rgb:[...this.rgb,this.alpha])}rgbString(){const e=(this.alpha>=1?this.rgb:[...this.rgb,this.alpha]).join(", ");return`${this.alpha>=1?"rgb":"rgba"}(${e})`}getBrightness(){return Math.round(this.rgb.reduce(((e,t)=>e+t))/765*100)}_setFromRGB([e,t,n,r]){return[this.rgb,this.alpha]=[[e,t,n],r],this}_setFromHSL([e,t,n,r]){return[this.rgb,this.alpha]=[NS([e,t,n]).map(Math.round),r],this}}mE.VERSION="v2.1.1";const fE=e=>new mE(e.trim());function hE(e,t=1){if(null===e)return e;const n=fE(e);return n.alpha=t,n.rgbString()}const yE=e=>hE(e,.5),gE=(e,t)=>{if(null===e)return e;return fE(e).shade(t).hexString()};class bE{constructor(e){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)));if(null==t)throw new Error("Invalid border style.");const 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 vE=new Proxy({colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>yE(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?hE(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},colorSuccess:{fallback:{type:"static",value:"#22BC32"}},colorSuccessMuted:{fallback:{type:"static",value:"#DDF5E0"}},colorSuccessDark:{fallback:{type:"static",value:"#0C4112"}},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"}},buttonBorderColor:{fallback:{type:"variable",value:"colorPrimary"}},buttonBorderWidth:{fallback:{type:"static",value:"1px"}},buttonBorderType:{fallback:{type:"static",value:"solid"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorText"}},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.colorMutedBorder}`}},buttonSecondaryBorderColor:{fallback:{type:"variable",value:"colorMutedBorder"}},buttonSecondaryBorderWidth:{fallback:{type:"static",value:"1px"}},buttonSecondaryBorderType:{fallback:{type:"static",value:"solid"}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?gE(e.buttonColorBackground,20):gE(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 bE(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderColor:{fallback:{type:"variable",value:"colorPrimary"}},buttonHoverBorderWidth:{fallback:{type:"variable",value:"buttonBorderWidth"}},buttonHoverBorderType:{fallback:{type:"variable",value:"buttonBorderType"}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"func",value:e=>(e.colorBackgroundProvided,gE(e.colorBackground,3))}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"colorText"}},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"}},buttonSecondaryHoverBorderColor:{fallback:{type:"variable",value:"buttonSecondaryBorderColor"}},buttonSecondaryHoverBorderWidth:{fallback:{type:"variable",value:"buttonSecondaryBorderWidth"}},buttonSecondaryHoverBorderType:{fallback:{type:"variable",value:"buttonSecondaryBorderType"}},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"}},buttonActiveBorderColor:{fallback:{type:"variable",value:"buttonHoverBorderColor"}},buttonActiveBorderWidth:{fallback:{type:"variable",value:"buttonHoverBorderWidth"}},buttonActiveBorderType:{fallback:{type:"variable",value:"buttonHoverBorderType"}},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"}},buttonSecondaryActiveBorderColor:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderColor"}},buttonSecondaryActiveBorderWidth:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderWidth"}},buttonSecondaryActiveBorderType:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderType"}},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 ${gE(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 bE(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?yE(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 bE(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?yE(e.inputErrorColorText):yE(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"}}},{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&&"function"==typeof a)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}}),wE=class e{constructor(e={}){this.overrides=e,this.theme=vE}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((t=>!e.nonCssProperties.includes(t))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}};wE.nonCssProperties=["labels"];let kE=wE;function $E(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}const SE=()=>{so(lo.options);const{theme:e={},css:t}=lo.options,n=(e=>{const t=new kE(e).build();var n;return`\n ${n=t,`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root, :host {\n ${n.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-fontSizeXs: calc(var(--rebilly-fontSizeS) * var(--rebilly-fontScaleFactorS));\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 --rebilly-monoFontFamily: 'SFMono-Medium', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Courier, monospace;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method iframe {\n width: 100%;\n height: 100%;\n border: none;\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.rebilly-instruments-confirmation-modal-container {\n width: 350px;\n margin: var(--rebilly-spacingL) auto;\n padding: var(--rebilly-spacingM);\n font-size: var(--rebilly-fontSizeBase);\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-confirmation-modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: var(--rebilly-fontWeight600);\n line-height: var(--rebilly-fontLineHeightBase);\n margin-bottom: var(--rebilly-spacingM);\n}\n\n.rebilly-instruments-confirmation-modal-content {\n text-align: left !important;\n padding: 0 !important;\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-confirmation-modal-actions {\n display: flex;\n justify-content: flex-end;\n align-items: baseline;\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-confirmation-modal-actions .rebilly-instruments-confirmation-modal-confirm {\n margin-left: var(--rebilly-spacingS);\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/* Components. Button\n------------------------------------------------------------ */\n.rebilly-instruments-button {\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: var(--rebilly-buttonColorText);\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n box-shadow: var(--rebilly-buttonBoxShadow);\n margin: calc(var(--rebilly-spacing2xs) + var(--rebilly-spacingS) / 2) 0;\n width: 100%;\n cursor: pointer;\n min-height: 44px;\n transition: all 0.2s ease;\n outline: none;\n}\n\n.rebilly-instruments-button:not([disabled]):hover {\n background: var(--rebilly-buttonHoverColorBackground);\n color: var(--rebilly-buttonHoverColorText);\n font-family: var(--rebilly-buttonHoverFontFamily);\n font-size: var(--rebilly-buttonHoverFontSize);\n line-height: var(--rebilly-buttonHoverFontLineHeight);\n font-weight: var(--rebilly-buttonHoverFontWeight);\n border: var(--rebilly-buttonHoverBorder);\n border-radius: var(--rebilly-buttonHoverBorderRadius);\n box-shadow: var(--rebilly-buttonHoverBoxShadow);\n}\n\n.rebilly-instruments-button:not([disabled]):active {\n background: var(--rebilly-buttonActiveColorBackground);\n color: var(--rebilly-buttonActiveColorText);\n font-family: var(--rebilly-buttonActiveFontFamily);\n font-size: var(--rebilly-buttonActiveFontSize);\n line-height: var(--rebilly-buttonActiveFontLineHeight);\n font-weight: var(--rebilly-buttonActiveFontWeight);\n border: var(--rebilly-buttonActiveBorder);\n border-radius: var(--rebilly-buttonActiveBorderRadius);\n box-shadow: var(--rebilly-buttonActiveBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary {\n font-size: var(--rebilly-buttonSecondaryFontSize);\n font-family: var(--rebilly-buttonSecondaryFontFamily);\n line-height: var(--rebilly-buttonSecondaryFontLineHeight);\n background: var(--rebilly-buttonSecondaryColorBackground);\n color: var(--rebilly-buttonSecondaryColorText);\n border: var(--rebilly-buttonSecondaryBorder);\n box-shadow: var(--rebilly-buttonSecondaryBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary:not(\n [disabled]\n ):hover {\n font-size: var(--rebilly-buttonSecondaryHoverFontSize);\n font-family: var(--rebilly-buttonSecondaryHoverFontFamily);\n line-height: var(--rebilly-buttonSecondaryHoverFontLineHeight);\n background: var(--rebilly-buttonSecondaryHoverColorBackground);\n color: var(--rebilly-buttonSecondaryHoverColorText);\n border: var(--rebilly-buttonSecondaryHoverBorder);\n box-shadow: var(--rebilly-buttonSecondaryHoverBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary:not(\n [disabled]\n ):active {\n font-size: var(--rebilly-buttonSecondaryActiveFontSize);\n font-family: var(--rebilly-buttonSecondaryActiveFontFamily);\n line-height: var(--rebilly-buttonSecondaryActiveFontLineHeight);\n background: var(--rebilly-buttonSecondaryActiveColorBackground);\n color: var(--rebilly-buttonSecondaryActiveColorText);\n border: var(--rebilly-buttonSecondaryActiveBorder);\n box-shadow: var(--rebilly-buttonSecondaryActiveBoxShadow);\n}\n\n.rebilly-instruments-button:focus {\n box-shadow: none;\n}\n\n.rebilly-instruments-button:disabled,\n.rebilly-instruments-button:disabled:hover {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.rebilly-instruments-button::first-letter {\n text-transform: uppercase;\n}\n\n.rebilly-instruments-button:first-of-type {\n margin-top: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-button:last-of-type {\n margin-bottom: 0;\n}\n\n.rebilly-instruments-button-group {\n display: flex;\n align-items: stretch;\n margin-top: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button {\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button:first-of-type {\n margin-left: 0;\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button:last-of-type {\n margin-right: 0;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-button-group {\n flex-direction: column-reverse;\n }\n\n .rebilly-instruments-button-group\n .rebilly-instruments-button:first-of-type {\n margin: 0;\n }\n\n .rebilly-instruments-button-group .rebilly-instruments-button:last-of-type {\n margin: 0;\n }\n\n .rebilly-instruments-button-group\n .rebilly-instruments-button\n + .rebilly-instruments-button {\n margin-bottom: var(--rebilly-spacingS);\n }\n}\n\n.rebilly-instruments-button-transparent {\n border: none;\n background: transparent;\n cursor: pointer;\n color: inherit;\n font: inherit;\n}\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`}\n `})(e||{});return Df({element:"style",attributes:{type:"text/css"},content:$E(n),target:lo.shadowRoot||"head"}),t&&Df({element:"style",attributes:{type:"text/css"},content:$E(t),target:lo.shadowRoot||"head"}),n},EE=()=>{lo.translate.init(lo.options.locale,lo.options.i18n),lo.translate.translateItems()},xE=()=>{var e,t;if("auto"===lo.options.locale&&(null==(t=null==(e=lo.data.riskMetadata)?void 0:e.browserData)?void 0:t.language)){const{browserData:{language:e}}=lo.data.riskMetadata;lo.options.locale=e}return lo.translate.init(lo.options.locale,lo.options.i18n),EE};function PE(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);r&&(a=e.replace(n,t[r[1]]))})),n(a)}return e}return Array.from(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}const _E=(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`],borderColor:e[`--rebilly-${t}BorderColor`],borderWidth:e[`--rebilly-${t}BorderWidth`],borderType:e[`--rebilly-${t}BorderType`]}),AE=()=>{var e;const t=PE(`\n ${lo.mainStyleVars}\n ${(null==(e=lo.options)?void 0:e.css)||""}\n `);return{base:{..._E(t,"input"),":hover":_E(t,"inputHover"),":focus":_E(t,"inputFocus"),"::placeholder":_E(t,"inputPlaceholder"),"::selection":_E(t,"inputSelection")},invalid:{..._E(t,"inputError"),":hover":_E(t,"inputErrorHover"),":focus":_E(t,"inputErrorFocus"),"::placeholder":_E(t,"inputErrorPlaceholder"),"::selection":_E(t,"inputErrorSelection")},buttons:{base:{..._E(t,"buttonSecondary"),":hover":_E(t,"buttonSecondaryHover"),":focus":_E(t,"buttonSecondaryActive")},focus:{..._E(t,"buttonSecondary")},active:{..._E(t,"button"),":hover":_E(t,"buttonHover"),":focus":_E(t,"buttonActive")}}}};function IE({eventName:e,callback:t}){if(!Yi.includes(e))throw new Error(`${e} is not a supported event`);const n=Gi(e);Ji[n].addEventListener(t)}const TE=(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 LE({name:e="",url:t="",model:n={},classListArray:r=[],close:a=()=>{}}={}){var o,i;const s=null==(o=null==n?void 0:n.method)?void 0:o.method,l="rebilly-instruments-approval-url"===e;lo.form.insertAdjacentHTML("beforeend",TE(l,s));const c=lo.form.querySelector(".rebilly-instruments-modal-overlay"),u=lo.form.querySelector(".rebilly-instruments-modal-container"),d=lo.form.querySelector(".rebilly-instruments-modal-close"),p=lo.form.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),lo.loader.addDOMElement({section:"modal",el:p}),lo.loader.startLoading({section:"modal",id:e});const m={options:lo.toModel().options,...n},f=await new ls({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:lo.loader}),l||d.addEventListener("click",h),null==(i=f.component)||i.call("route",{name:"approval-url"}),f}async function CE({payload:e}){let t={websiteId:lo.options.websiteId,paymentInstruction:{token:e._raw.id},...e};lo.data.acceptBumpOffer?t.items=lo.options.bumpOffer:t.items=Sp(lo.options.items),lo.data.couponIds&&Array.isArray(lo.data.couponIds)&&(t.couponIds=lo.data.couponIds),lo.options.addons&&lo.data.addons&&Array.isArray(lo.data.addons)&&lo.options.addons.forEach((e=>{lo.data.addons.includes(e.planId)&&t.items.push(e)})),t.additionalFields&&(t={...t,...t.additionalFields});const{fields:n}=await async function({data:e}){return gp((async()=>{io(lo.storefront);const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl","poNumber"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),lo.storefront.purchase.purchase({data:e})}))}({data:t});return n}async function RE({payload:e}){var t,n,r,a,o,i;const{_raw:{id:s},isExistingInstrument:l}=e;delete e.isExistingInstrument,delete e._raw;const c={...e};l?c.paymentInstrumentId=s:c.token=s,(null==(t=lo.options)?void 0:t.invoiceId)&&(c.invoiceId=lo.options.invoiceId),(null==(n=lo.options)?void 0:n.transactionId)&&(c.transactionId=lo.options.transactionId),(null==(r=lo.options)?void 0:r.money)&&(c.websiteId=lo.options.websiteId,c.amount=lo.options.money.amount,c.currency=lo.options.money.currency),(null==(a=lo.options)?void 0:a.deposit)&&(c.websiteId=lo.options.websiteId,c.amount=lo.data.amountAndCurrency.amount,c.currency=lo.data.amountAndCurrency.currency),(null==(o=lo.data)?void 0:o.couponIds)&&Array.isArray(lo.data.couponIds)&&(c.couponIds=lo.data.couponIds),(null==(i=lo.data)?void 0:i.riskMetadata)&&(c.riskMetadata=lo.data.riskMetadata);let{fields:u}=await async function({data:e}){return gp((async()=>{io(lo.storefront);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]})),lo.storefront.purchase.payment({data:e})}))}({data:c});return u={transaction:u,token:u.token||lo.options.jwt},lo.data.invoice&&(u.invoice=lo.data.invoice),u}async function jE({payload:{isExistingInstrument:e,_raw:{id:t}}}){if(!e){const{id:e}=await async function({data:e}){return gp((async()=>{io(lo.storefront);const{fields:t}=await lo.storefront.paymentInstruments.create({data:e});return t}))}({data:{token:t}});t=e}return await async function(e){return gp((async()=>{io(lo.storefront);const{fields:t}=await lo.storefront.payoutRequests.update(e);return new vf(t)}))}({id:lo.data.payout.id,data:{paymentInstrumentId:t}})}async function NE({payload:e}){var t,n;Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{let r,a,o;lo.options.payout?(r=await jE({payload:e}),a=Ji.payoutCompleted,o="payout"):lo.data.isPayment?(r=await RE({payload:e}),a=Ji.purchaseCompleted,o="payment"):(r=await CE({payload:e}),a=Ji.purchaseCompleted,o="purchase"),(null==(t=r.transaction)?void 0:t.approvalUrl)&&"unknown"===(null==(n=r.transaction)?void 0:n.result)?lo.options.features.fullPageRedirect?window.location=r.transaction.approvalUrl:function({fields:e,payload:t}){var n,r,a,o,i;if(lo.options.features.fullPageRedirect&&(t.redirectUrl||(null==(n=e.transaction)?void 0:n.approvalUrl)))window.location=t.redirectUrl||(null==(r=e.transaction)?void 0:r.approvalUrl);else if(t.redirectUrl||!(null==(a=e.transaction)?void 0:a.approvalUrl)){const{paymentMethodsUrl:t}=lo.options._computed,n=JSON.parse(JSON.stringify(e)),r={};lo.data.isPayment?r.payment=n:r.purchase=n,lo.data=new Pf({...e});const a="rebilly-instruments-approval-url";LE({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ji.purchaseCompleted.dispatch(e)}})}else(null==(o=e.transaction)?void 0:o.approvalUrl)&&(window.location=null==(i=e.transaction)?void 0:i.approvalUrl)}({fields:r,payload:e}):"payout"!==o&&r.selectedPaymentInstrumentRedirectUrl?window.location=r.selectedPaymentInstrumentRedirectUrl:a.dispatch(r)}catch(r){return ns(r),r}}async function OE({payload:e}){var t;try{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 gp((async()=>{var t,n,r;io(lo.storefront),so(lo.options);const{fields:a}=await lo.storefront.paymentInstruments.create({data:e});lo.storefront.setSessionToken(a.token||lo.options.jwt);const o={id:a.id,data:{websiteId:lo.options.websiteId,...e}};(null==(t=lo.data)?void 0:t.amountAndCurrency)&&(o.data={...o.data,...lo.data.amountAndCurrency}),(null==(r=null==(n=lo.data)?void 0:n.transaction)?void 0:r.redirectUrl)&&(o.data.redirectUrl=`${o.data.redirectUrl}&originalRedirectUrl=${lo.data.transaction.redirectUrl}`);const{fields:i}=await lo.storefront.paymentInstruments.setup(o);return{instrument:a,transaction:i}}))}({data:{websiteId:null==(t=lo.options)?void 0:t.websiteId,...a}});if(lo.data=new Pf({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result)if(lo.options.features.fullPageRedirect)window.location=i.approvalUrl;else{const{paymentMethodsUrl:e}=lo.options._computed;LE({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ji.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ji.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(n){return ns(n,!1),n}}async function FE({componentName:e,payload:t}){switch(e){case"result":Of(),async function({payload:e}){var t,n;const r=oo.form;r||await Bf();const a=lo.toModel(),o={data:a.data,options:a.options};lo.data.payout?o.payoutRequest=e:o[lo.options.transactionType]=e,null==(t=null==r?void 0:r.component)||t.call("route",{name:"result"}),null==(n=null==r?void 0:r.component)||n.call("update",o)}({payload:t});break;case"confirmation":Of(),async function({payload:e}){var t,n,r,a,o,i,s,l;e.billingAddress&&lo.summary&&lo.data.isPurchase&&Ap({instrument:e});const c=oo.form;c||await Bf();const u=lo.toModel(),d={options:u.options,data:u.data,instrument:e};null==(t=null==c?void 0:c.component)||t.call("update",d),null==(n=null==c?void 0:c.component)||n.call("route",{name:"confirmation"}),(null==(a=null==(r=null==c?void 0:c.component)?void 0:r.events)?void 0:a[`${c.name}-confirm-purchase`])||null==(o=null==c?void 0:c.component)||o.on(`${c.name}-confirm-purchase`,(e=>{NE({payload:e})})),(null==(s=null==(i=null==c?void 0:c.component)?void 0:i.events)?void 0:s[`${c.name}-confirm-setup`])||null==(l=null==c?void 0:c.component)||l.on(`${c.name}-confirm-setup`,(e=>{OE({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function ME({payload:e}){FE({componentName:"result",payload:e})}const HE=({state:e={}})=>{var t,n,r,a;(null==(n=null==(t=null==e?void 0:e.options)?void 0:t.features)?void 0:n.hideConfirmation)||IE({eventName:"instrument-ready",callback:t=>{var n,r,a,o;if("paypal"===(null==(n=t._raw)?void 0:n.method)&&!(null==(r=e.data)?void 0:r.isShippingRequired))return"setup"===(null==(a=e.options)?void 0:a.transactionType)?OE({payload:t}):NE({payload:t}),void(null==(o=e.loader)||o.startLoading({id:"express-purchase"}));FE({componentName:"confirmation",payload:t})}}),(null==(a=null==(r=null==e?void 0:e.options)?void 0:r.features)?void 0:a.hideResult)||(IE({eventName:"payout-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}),IE({eventName:"purchase-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}),IE({eventName:"setup-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}))};async function BE({setupFramepay:e=rS,...t}={}){var n,r,a,o,i,s,l,c,u,d,p,m,f,h,y,g,b,v,w,k,$;try{lo.data={},lo.options={},lo.options=nS({options:t}),lo.form=zf({element:"form"}),lo.summary=zf({element:"summary"}),lo.shadowRoot=($=lo.form).getRootNode()instanceof ShadowRoot?$.getRootNode():null,lo.form&&(lo.form.style.maxWidth="750px"),lo.summary&&(lo.summary.style.maxWidth="750px"),lo.storefront=Vf(),lo.mainStyleVars=SE(),lo.options&&(lo.options.themeFramepay=AE()),lo.loader.addDOMElement({el:lo.form}),lo.loader.addDOMElement({section:"summary",el:lo.summary}),lo.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),lo.loader.startLoading({id:"rebilly-instruments-form"});const[S]=await Promise.all([_f(),e()]);lo.data=S,Ji.dataReady.dispatch(lo.data),lo.i18n=xE(),lo.options&&!lo.options.websiteId&&(null==(n=lo.data.transaction)?void 0:n.websiteId)?lo.options.websiteId=lo.data.transaction.websiteId:lo.options&&!lo.options.websiteId&&(null==(r=lo.data.invoice)?void 0:r.websiteId)&&(lo.options.websiteId=lo.data.invoice.websiteId),lo.options&&lo.data.transaction&&"setup"===(null==(a=lo.data.transaction)?void 0:a.type)&&(lo.options.transactionType="setup"),lo.form&&Bf().then((()=>qf())),lo.summary&&_p(),lo.i18n(),lo.hasMounted=!0;const E=e=>{lo.loader.stopLoading({id:"rebilly-instruments-form"}),lo.form.querySelector('[data-rebilly-instruments="form"]').remove(),ns(lo.translate.getTranslation(e),!1)},x=(null==(o=lo.options)?void 0:o.invoiceId)||(null==(s=null==(i=lo.data)?void 0:i.transaction)?void 0:s.invoiceId);x&&(null==(l=lo.data.invoice)?void 0:l.isPaid)?E("form.error.invoiceIsPaid"):x&&(null==(c=lo.data.invoice)?void 0:c.isAbandoned)?E("form.error.invoiceIsAbandoned"):x&&(null==(u=lo.data.invoice)?void 0:u.isVoid)?E("form.error.invoiceIsVoid"):x&&(null==(d=lo.data.invoice)?void 0:d.isRefunded)&&E("form.error.invoiceIsRefunded");((null==(p=lo.options)?void 0:p.transactionId)||(null==(f=null==(m=lo.data)?void 0:m.transaction)?void 0:f.id))&&(null==(y=null==(h=lo.data)?void 0:h.transaction)?void 0:y.transactionIsCompleted)&&E("form.error.transactionIsCompleted"),(null==(b=null==(g=lo.options)?void 0:g.payout)?void 0:b.payoutRequestId)&&!(null==(v=lo.data.payout)?void 0:v.isPending)&&E("form.error.payoutNotPending");let P=!1;P=S.payout?!(null==(w=S.readyToPayout)?void 0:w.length):!(null==(k=S.readyToPay)?void 0:k.length),P&&(lo.loader.stopLoading({id:"rebilly-instruments-form"}),ns(lo.translate.getTranslation("form.error.noPaymentMethods"),!1))}catch(S){throw ns(S,!1),S}HE({state:lo})}async function qE(){Object.keys(oo).forEach((e=>{oo.hasFrame(e)&&(oo[e].destroy(),oo[e]=null)})),Xi.removeAll(document),lo.hasMounted=!1,lo.summary&&(lo.summary.textContent=""),lo.form.textContent="",await rp.cancelAll(),lo.loader.clearAll()}return new class{constructor(){this.state=lo,this.iframes=oo}async mount(e){await BE(e)}async destroy(){await qE()}async update(e){await async function({newOptions:e={}}={}){if(!lo.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=to({...lo.options},e);await qE(),BE({form:lo.form,summary:lo.summary,...t})}({newOptions:e})}async purchase(e){await NE({payload:e})}async setup(e){await OE({payload:e})}async show(e,t){await FE({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.0.0.0"}on(e,t){IE({eventName:e,callback:t})}}}();
50
+ */class mE{constructor(e="#000",t="base",n=0){[this.rgb,this.alpha,this.type,this.weight]=[[0,0,0],1,t,n];const r=null===e?"#000":e;if("string"!=typeof r)throw new TypeError(`Input should be a string: ${r}`);const a=dE(r);if(!a)throw new Error(`Unable to parse color from string: ${r}`);return this[`_setFrom${a.type.toUpperCase()}`]([...a.values,a.alpha])}get hex(){return this.hexString().replace(/^#/,"")}setColor(e){const t=dE(e);return t?this[`_setFrom${t.type.toUpperCase()}`]([...t.values,t.alpha]):null}tint(e,t=pE(e,50)){return new mE(`rgb(${qS("#fff",this.rgbString(),t).rgba})`,"tint",t)}shade(e,t=pE(e,50)){return new mE(`rgb(${qS("#000",this.rgbString(),t).rgba})`,"shade",t)}tints(e,t=pE(e,10)){return Array.from({length:100/t},((e,n)=>this.tint((n+1)*t)))}shades(e,t=pE(e,10)){return Array.from({length:100/t},((e,n)=>this.shade((n+1)*t)))}all(e=10){return[...this.tints(e).reverse(),Object.assign(this),...this.shades(e)]}hexString(){return MS(this.alpha>=1?this.rgb:[...this.rgb,this.alpha])}rgbString(){const e=(this.alpha>=1?this.rgb:[...this.rgb,this.alpha]).join(", ");return`${this.alpha>=1?"rgb":"rgba"}(${e})`}getBrightness(){return Math.round(this.rgb.reduce(((e,t)=>e+t))/765*100)}_setFromRGB([e,t,n,r]){return[this.rgb,this.alpha]=[[e,t,n],r],this}_setFromHSL([e,t,n,r]){return[this.rgb,this.alpha]=[NS([e,t,n]).map(Math.round),r],this}}mE.VERSION="v2.1.1";const fE=e=>new mE(e.trim());function hE(e,t=1){if(null===e)return e;const n=fE(e);return n.alpha=t,n.rgbString()}const yE=e=>hE(e,.5),gE=(e,t)=>{if(null===e)return e;return fE(e).shade(t).hexString()};class bE{constructor(e){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)));if(null==t)throw new Error("Invalid border style.");const 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 vE=new Proxy({colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>yE(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?hE(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},colorSuccess:{fallback:{type:"static",value:"#22BC32"}},colorSuccessMuted:{fallback:{type:"static",value:"#DDF5E0"}},colorSuccessDark:{fallback:{type:"static",value:"#0C4112"}},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"}},buttonBorderColor:{fallback:{type:"variable",value:"colorPrimary"}},buttonBorderWidth:{fallback:{type:"static",value:"1px"}},buttonBorderType:{fallback:{type:"static",value:"solid"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorText"}},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.colorMutedBorder}`}},buttonSecondaryBorderColor:{fallback:{type:"variable",value:"colorMutedBorder"}},buttonSecondaryBorderWidth:{fallback:{type:"static",value:"1px"}},buttonSecondaryBorderType:{fallback:{type:"static",value:"solid"}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?gE(e.buttonColorBackground,20):gE(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 bE(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderColor:{fallback:{type:"variable",value:"colorPrimary"}},buttonHoverBorderWidth:{fallback:{type:"variable",value:"buttonBorderWidth"}},buttonHoverBorderType:{fallback:{type:"variable",value:"buttonBorderType"}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"func",value:e=>(e.colorBackgroundProvided,gE(e.colorBackground,3))}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"colorText"}},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"}},buttonSecondaryHoverBorderColor:{fallback:{type:"variable",value:"buttonSecondaryBorderColor"}},buttonSecondaryHoverBorderWidth:{fallback:{type:"variable",value:"buttonSecondaryBorderWidth"}},buttonSecondaryHoverBorderType:{fallback:{type:"variable",value:"buttonSecondaryBorderType"}},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"}},buttonActiveBorderColor:{fallback:{type:"variable",value:"buttonHoverBorderColor"}},buttonActiveBorderWidth:{fallback:{type:"variable",value:"buttonHoverBorderWidth"}},buttonActiveBorderType:{fallback:{type:"variable",value:"buttonHoverBorderType"}},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"}},buttonSecondaryActiveBorderColor:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderColor"}},buttonSecondaryActiveBorderWidth:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderWidth"}},buttonSecondaryActiveBorderType:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderType"}},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 ${gE(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 bE(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?yE(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 bE(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?yE(e.inputErrorColorText):yE(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"}}},{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&&"function"==typeof a)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}}),wE=class e{constructor(e={}){this.overrides=e,this.theme=vE}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((t=>!e.nonCssProperties.includes(t))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}};wE.nonCssProperties=["labels"];let kE=wE;function $E(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}const SE=()=>{so(lo.options);const{theme:e={},css:t}=lo.options,n=(e=>{const t=new kE(e).build();var n;return`\n ${n=t,`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root, :host {\n ${n.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-fontSizeXs: calc(var(--rebilly-fontSizeS) * var(--rebilly-fontScaleFactorS));\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 --rebilly-monoFontFamily: 'SFMono-Medium', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Courier, monospace;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method iframe {\n width: 100%;\n height: 100%;\n border: none;\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.rebilly-instruments-confirmation-modal-container {\n width: 350px;\n margin: var(--rebilly-spacingL) auto;\n padding: var(--rebilly-spacingM);\n font-size: var(--rebilly-fontSizeBase);\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-confirmation-modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: var(--rebilly-fontWeight600);\n line-height: var(--rebilly-fontLineHeightBase);\n margin-bottom: var(--rebilly-spacingM);\n}\n\n.rebilly-instruments-confirmation-modal-content {\n text-align: left !important;\n padding: 0 !important;\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-confirmation-modal-actions {\n display: flex;\n justify-content: flex-end;\n align-items: baseline;\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-confirmation-modal-actions .rebilly-instruments-confirmation-modal-confirm {\n margin-left: var(--rebilly-spacingS);\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/* Components. Button\n------------------------------------------------------------ */\n.rebilly-instruments-button {\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: var(--rebilly-buttonColorText);\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n box-shadow: var(--rebilly-buttonBoxShadow);\n margin: calc(var(--rebilly-spacing2xs) + var(--rebilly-spacingS) / 2) 0;\n width: 100%;\n cursor: pointer;\n min-height: 44px;\n transition: all 0.2s ease;\n outline: none;\n}\n\n.rebilly-instruments-button:not([disabled]):hover {\n background: var(--rebilly-buttonHoverColorBackground);\n color: var(--rebilly-buttonHoverColorText);\n font-family: var(--rebilly-buttonHoverFontFamily);\n font-size: var(--rebilly-buttonHoverFontSize);\n line-height: var(--rebilly-buttonHoverFontLineHeight);\n font-weight: var(--rebilly-buttonHoverFontWeight);\n border: var(--rebilly-buttonHoverBorder);\n border-radius: var(--rebilly-buttonHoverBorderRadius);\n box-shadow: var(--rebilly-buttonHoverBoxShadow);\n}\n\n.rebilly-instruments-button:not([disabled]):active {\n background: var(--rebilly-buttonActiveColorBackground);\n color: var(--rebilly-buttonActiveColorText);\n font-family: var(--rebilly-buttonActiveFontFamily);\n font-size: var(--rebilly-buttonActiveFontSize);\n line-height: var(--rebilly-buttonActiveFontLineHeight);\n font-weight: var(--rebilly-buttonActiveFontWeight);\n border: var(--rebilly-buttonActiveBorder);\n border-radius: var(--rebilly-buttonActiveBorderRadius);\n box-shadow: var(--rebilly-buttonActiveBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary {\n font-size: var(--rebilly-buttonSecondaryFontSize);\n font-family: var(--rebilly-buttonSecondaryFontFamily);\n line-height: var(--rebilly-buttonSecondaryFontLineHeight);\n background: var(--rebilly-buttonSecondaryColorBackground);\n color: var(--rebilly-buttonSecondaryColorText);\n border: var(--rebilly-buttonSecondaryBorder);\n box-shadow: var(--rebilly-buttonSecondaryBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary:not(\n [disabled]\n ):hover {\n font-size: var(--rebilly-buttonSecondaryHoverFontSize);\n font-family: var(--rebilly-buttonSecondaryHoverFontFamily);\n line-height: var(--rebilly-buttonSecondaryHoverFontLineHeight);\n background: var(--rebilly-buttonSecondaryHoverColorBackground);\n color: var(--rebilly-buttonSecondaryHoverColorText);\n border: var(--rebilly-buttonSecondaryHoverBorder);\n box-shadow: var(--rebilly-buttonSecondaryHoverBoxShadow);\n}\n\n.rebilly-instruments-button.rebilly-instruments-button-secondary:not(\n [disabled]\n ):active {\n font-size: var(--rebilly-buttonSecondaryActiveFontSize);\n font-family: var(--rebilly-buttonSecondaryActiveFontFamily);\n line-height: var(--rebilly-buttonSecondaryActiveFontLineHeight);\n background: var(--rebilly-buttonSecondaryActiveColorBackground);\n color: var(--rebilly-buttonSecondaryActiveColorText);\n border: var(--rebilly-buttonSecondaryActiveBorder);\n box-shadow: var(--rebilly-buttonSecondaryActiveBoxShadow);\n}\n\n.rebilly-instruments-button:focus {\n box-shadow: none;\n}\n\n.rebilly-instruments-button:disabled,\n.rebilly-instruments-button:disabled:hover {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.rebilly-instruments-button::first-letter {\n text-transform: uppercase;\n}\n\n.rebilly-instruments-button:first-of-type {\n margin-top: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-button:last-of-type {\n margin-bottom: 0;\n}\n\n.rebilly-instruments-button-group {\n display: flex;\n align-items: stretch;\n margin-top: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button {\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button:first-of-type {\n margin-left: 0;\n}\n\n.rebilly-instruments-button-group .rebilly-instruments-button:last-of-type {\n margin-right: 0;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-button-group {\n flex-direction: column-reverse;\n }\n\n .rebilly-instruments-button-group\n .rebilly-instruments-button:first-of-type {\n margin: 0;\n }\n\n .rebilly-instruments-button-group .rebilly-instruments-button:last-of-type {\n margin: 0;\n }\n\n .rebilly-instruments-button-group\n .rebilly-instruments-button\n + .rebilly-instruments-button {\n margin-bottom: var(--rebilly-spacingS);\n }\n}\n\n.rebilly-instruments-button-transparent {\n border: none;\n background: transparent;\n cursor: pointer;\n color: inherit;\n font: inherit;\n}\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`}\n `})(e||{});return Df({element:"style",attributes:{type:"text/css"},content:$E(n),target:lo.shadowRoot||"head"}),t&&Df({element:"style",attributes:{type:"text/css"},content:$E(t),target:lo.shadowRoot||"head"}),n},EE=()=>{var e,t;lo.translate.init(null==(e=lo.options)?void 0:e.locale,null==(t=lo.options)?void 0:t.i18n),lo.translate.translateItems()},xE=()=>{var e,t,n,r,a,o;if("auto"===(null==(e=lo.options)?void 0:e.locale)&&(null==(r=null==(n=null==(t=lo.data)?void 0:t.riskMetadata)?void 0:n.browserData)?void 0:r.language)){const{browserData:{language:e}}=lo.data.riskMetadata;lo.options.locale=e}return lo.translate.init(null==(a=lo.options)?void 0:a.locale,null==(o=lo.options)?void 0:o.i18n),EE};function PE(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);r&&(a=e.replace(n,t[r[1]]))})),n(a)}return e}return Array.from(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}const _E=(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`],borderColor:e[`--rebilly-${t}BorderColor`],borderWidth:e[`--rebilly-${t}BorderWidth`],borderType:e[`--rebilly-${t}BorderType`]}),AE=()=>{var e;const t=PE(`\n ${lo.mainStyleVars}\n ${(null==(e=lo.options)?void 0:e.css)||""}\n `);return{base:{..._E(t,"input"),":hover":_E(t,"inputHover"),":focus":_E(t,"inputFocus"),"::placeholder":_E(t,"inputPlaceholder"),"::selection":_E(t,"inputSelection")},invalid:{..._E(t,"inputError"),":hover":_E(t,"inputErrorHover"),":focus":_E(t,"inputErrorFocus"),"::placeholder":_E(t,"inputErrorPlaceholder"),"::selection":_E(t,"inputErrorSelection")},buttons:{base:{..._E(t,"buttonSecondary"),":hover":_E(t,"buttonSecondaryHover"),":focus":_E(t,"buttonSecondaryActive")},focus:{..._E(t,"buttonSecondary")},active:{..._E(t,"button"),":hover":_E(t,"buttonHover"),":focus":_E(t,"buttonActive")}}}};function IE({eventName:e,callback:t}){if(!Yi.includes(e))throw new Error(`${e} is not a supported event`);const n=Gi(e);Ji[n].addEventListener(t)}const TE=(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 LE({name:e="",url:t="",model:n={},classListArray:r=[],close:a=()=>{}}={}){var o,i;const s=null==(o=null==n?void 0:n.method)?void 0:o.method,l="rebilly-instruments-approval-url"===e;lo.form.insertAdjacentHTML("beforeend",TE(l,s));const c=lo.form.querySelector(".rebilly-instruments-modal-overlay"),u=lo.form.querySelector(".rebilly-instruments-modal-container"),d=lo.form.querySelector(".rebilly-instruments-modal-close"),p=lo.form.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),lo.loader.addDOMElement({section:"modal",el:p}),lo.loader.startLoading({section:"modal",id:e});const m={options:lo.toModel().options,...n},f=await new ls({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:lo.loader}),l||d.addEventListener("click",h),null==(i=f.component)||i.call("route",{name:"approval-url"}),f}async function CE({payload:e}){let t={websiteId:lo.options.websiteId,paymentInstruction:{token:e._raw.id},...e};lo.data.acceptBumpOffer?t.items=lo.options.bumpOffer:t.items=Sp(lo.options.items),lo.data.couponIds&&Array.isArray(lo.data.couponIds)&&(t.couponIds=lo.data.couponIds),lo.options.addons&&lo.data.addons&&Array.isArray(lo.data.addons)&&lo.options.addons.forEach((e=>{lo.data.addons.includes(e.planId)&&t.items.push(e)})),t.additionalFields&&(t={...t,...t.additionalFields});const{fields:n}=await async function({data:e}){return gp((async()=>{io(lo.storefront);const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl","poNumber"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),lo.storefront.purchase.purchase({data:e})}))}({data:t});return n}async function RE({payload:e}){var t,n,r,a,o,i;const{_raw:{id:s},isExistingInstrument:l}=e;delete e.isExistingInstrument,delete e._raw;const c={...e};l?c.paymentInstrumentId=s:c.token=s,(null==(t=lo.options)?void 0:t.invoiceId)&&(c.invoiceId=lo.options.invoiceId),(null==(n=lo.options)?void 0:n.transactionId)&&(c.transactionId=lo.options.transactionId),(null==(r=lo.options)?void 0:r.money)&&(c.websiteId=lo.options.websiteId,c.amount=lo.options.money.amount,c.currency=lo.options.money.currency),(null==(a=lo.options)?void 0:a.deposit)&&(c.websiteId=lo.options.websiteId,c.amount=lo.data.amountAndCurrency.amount,c.currency=lo.data.amountAndCurrency.currency),(null==(o=lo.data)?void 0:o.couponIds)&&Array.isArray(lo.data.couponIds)&&(c.couponIds=lo.data.couponIds),(null==(i=lo.data)?void 0:i.riskMetadata)&&(c.riskMetadata=lo.data.riskMetadata);let{fields:u}=await async function({data:e}){return gp((async()=>{io(lo.storefront);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]})),lo.storefront.purchase.payment({data:e})}))}({data:c});return u={transaction:u,token:u.token||lo.options.jwt},lo.data.invoice&&(u.invoice=lo.data.invoice),u}async function jE({payload:{isExistingInstrument:e,_raw:{id:t}}}){if(!e){const{id:e}=await async function({data:e}){return gp((async()=>{io(lo.storefront);const{fields:t}=await lo.storefront.paymentInstruments.create({data:e});return t}))}({data:{token:t}});t=e}return await async function(e){return gp((async()=>{io(lo.storefront);const{fields:t}=await lo.storefront.payoutRequests.update(e);return new vf(t)}))}({id:lo.data.payout.id,data:{paymentInstrumentId:t}})}async function NE({payload:e}){var t,n;Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{let r,a,o;lo.options.payout?(r=await jE({payload:e}),a=Ji.payoutCompleted,o="payout"):lo.data.isPayment?(r=await RE({payload:e}),a=Ji.purchaseCompleted,o="payment"):(r=await CE({payload:e}),a=Ji.purchaseCompleted,o="purchase"),(null==(t=r.transaction)?void 0:t.approvalUrl)&&"unknown"===(null==(n=r.transaction)?void 0:n.result)?lo.options.features.fullPageRedirect?window.location=r.transaction.approvalUrl:function({fields:e,payload:t}){var n,r,a,o,i;if(lo.options.features.fullPageRedirect&&(t.redirectUrl||(null==(n=e.transaction)?void 0:n.approvalUrl)))window.location=t.redirectUrl||(null==(r=e.transaction)?void 0:r.approvalUrl);else if(t.redirectUrl||!(null==(a=e.transaction)?void 0:a.approvalUrl)){const{paymentMethodsUrl:t}=lo.options._computed,n=JSON.parse(JSON.stringify(e)),r={};lo.data.isPayment?r.payment=n:r.purchase=n,lo.data=new Pf({...e});const a="rebilly-instruments-approval-url";LE({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ji.purchaseCompleted.dispatch(e)}})}else(null==(o=e.transaction)?void 0:o.approvalUrl)&&(window.location=null==(i=e.transaction)?void 0:i.approvalUrl)}({fields:r,payload:e}):"payout"!==o&&r.selectedPaymentInstrumentRedirectUrl?window.location=r.selectedPaymentInstrumentRedirectUrl:a.dispatch(r)}catch(r){return ns(r),r}}async function OE({payload:e}){var t;try{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 gp((async()=>{var t,n,r;io(lo.storefront),so(lo.options);const{fields:a}=await lo.storefront.paymentInstruments.create({data:e});lo.storefront.setSessionToken(a.token||lo.options.jwt);const o={id:a.id,data:{websiteId:lo.options.websiteId,...e}};(null==(t=lo.data)?void 0:t.amountAndCurrency)&&(o.data={...o.data,...lo.data.amountAndCurrency}),(null==(r=null==(n=lo.data)?void 0:n.transaction)?void 0:r.redirectUrl)&&(o.data.redirectUrl=`${o.data.redirectUrl}&originalRedirectUrl=${lo.data.transaction.redirectUrl}`);const{fields:i}=await lo.storefront.paymentInstruments.setup(o);return{instrument:a,transaction:i}}))}({data:{websiteId:null==(t=lo.options)?void 0:t.websiteId,...a}});if(lo.data=new Pf({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result)if(lo.options.features.fullPageRedirect)window.location=i.approvalUrl;else{const{paymentMethodsUrl:e}=lo.options._computed;LE({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ji.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ji.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(n){return ns(n,!1),n}}async function FE({componentName:e,payload:t}){switch(e){case"result":Of(),async function({payload:e}){var t,n;const r=oo.form;r||await Bf();const a=lo.toModel(),o={data:a.data,options:a.options};lo.data.payout?o.payoutRequest=e:o[lo.options.transactionType]=e,null==(t=null==r?void 0:r.component)||t.call("route",{name:"result"}),null==(n=null==r?void 0:r.component)||n.call("update",o)}({payload:t});break;case"confirmation":Of(),async function({payload:e}){var t,n,r,a,o,i,s,l;e.billingAddress&&lo.summary&&lo.data.isPurchase&&Ap({instrument:e});const c=oo.form;c||await Bf();const u=lo.toModel(),d={options:u.options,data:u.data,instrument:e};null==(t=null==c?void 0:c.component)||t.call("update",d),null==(n=null==c?void 0:c.component)||n.call("route",{name:"confirmation"}),(null==(a=null==(r=null==c?void 0:c.component)?void 0:r.events)?void 0:a[`${c.name}-confirm-purchase`])||null==(o=null==c?void 0:c.component)||o.on(`${c.name}-confirm-purchase`,(e=>{NE({payload:e})})),(null==(s=null==(i=null==c?void 0:c.component)?void 0:i.events)?void 0:s[`${c.name}-confirm-setup`])||null==(l=null==c?void 0:c.component)||l.on(`${c.name}-confirm-setup`,(e=>{OE({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function ME({payload:e}){FE({componentName:"result",payload:e})}const HE=({state:e={}})=>{var t,n,r,a;(null==(n=null==(t=null==e?void 0:e.options)?void 0:t.features)?void 0:n.hideConfirmation)||IE({eventName:"instrument-ready",callback:t=>{var n,r,a,o;if("paypal"===(null==(n=t._raw)?void 0:n.method)&&!(null==(r=e.data)?void 0:r.isShippingRequired))return"setup"===(null==(a=e.options)?void 0:a.transactionType)?OE({payload:t}):NE({payload:t}),void(null==(o=e.loader)||o.startLoading({id:"express-purchase"}));FE({componentName:"confirmation",payload:t})}}),(null==(a=null==(r=null==e?void 0:e.options)?void 0:r.features)?void 0:a.hideResult)||(IE({eventName:"payout-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}),IE({eventName:"purchase-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}),IE({eventName:"setup-completed",callback:e=>{ME({payload:e=JSON.parse(JSON.stringify(e))})}}))};async function BE({setupFramepay:e=rS,...t}={}){var n,r,a,o,i,s,l,c,u,d,p,m,f,h,y,g,b,v,w,k,$;try{lo.data={},lo.options={},lo.options=nS({options:t}),lo.form=zf({element:"form"}),lo.summary=zf({element:"summary"}),lo.shadowRoot=($=lo.form).getRootNode()instanceof ShadowRoot?$.getRootNode():null,lo.form&&(lo.form.style.maxWidth="750px"),lo.summary&&(lo.summary.style.maxWidth="750px"),lo.storefront=Vf(),lo.mainStyleVars=SE(),lo.options&&(lo.options.themeFramepay=AE()),lo.loader.addDOMElement({el:lo.form}),lo.loader.addDOMElement({section:"summary",el:lo.summary}),lo.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),lo.loader.startLoading({id:"rebilly-instruments-form"});const[S]=await Promise.all([_f(),e()]);lo.data=S,Ji.dataReady.dispatch(lo.data),lo.i18n=xE(),lo.options&&!lo.options.websiteId&&(null==(n=lo.data.transaction)?void 0:n.websiteId)?lo.options.websiteId=lo.data.transaction.websiteId:lo.options&&!lo.options.websiteId&&(null==(r=lo.data.invoice)?void 0:r.websiteId)&&(lo.options.websiteId=lo.data.invoice.websiteId),lo.options&&lo.data.transaction&&"setup"===(null==(a=lo.data.transaction)?void 0:a.type)&&(lo.options.transactionType="setup"),lo.form&&Bf().then((()=>qf())),lo.summary&&_p(),lo.i18n(),lo.hasMounted=!0;const E=e=>{lo.loader.stopLoading({id:"rebilly-instruments-form"}),lo.form.querySelector('[data-rebilly-instruments="form"]').remove(),ns(lo.translate.getTranslation(e),!1)},x=(null==(o=lo.options)?void 0:o.invoiceId)||(null==(s=null==(i=lo.data)?void 0:i.transaction)?void 0:s.invoiceId);x&&(null==(l=lo.data.invoice)?void 0:l.isPaid)?E("form.error.invoiceIsPaid"):x&&(null==(c=lo.data.invoice)?void 0:c.isAbandoned)?E("form.error.invoiceIsAbandoned"):x&&(null==(u=lo.data.invoice)?void 0:u.isVoid)?E("form.error.invoiceIsVoid"):x&&(null==(d=lo.data.invoice)?void 0:d.isRefunded)&&E("form.error.invoiceIsRefunded");((null==(p=lo.options)?void 0:p.transactionId)||(null==(f=null==(m=lo.data)?void 0:m.transaction)?void 0:f.id))&&(null==(y=null==(h=lo.data)?void 0:h.transaction)?void 0:y.transactionIsCompleted)&&E("form.error.transactionIsCompleted"),(null==(b=null==(g=lo.options)?void 0:g.payout)?void 0:b.payoutRequestId)&&!(null==(v=lo.data.payout)?void 0:v.isPending)&&E("form.error.payoutNotPending");let P=!1;P=S.payout?!(null==(w=S.readyToPayout)?void 0:w.length):!(null==(k=S.readyToPay)?void 0:k.length),P&&(lo.loader.stopLoading({id:"rebilly-instruments-form"}),ns(lo.translate.getTranslation("form.error.noPaymentMethods"),!1))}catch(S){throw ns(S,!1),S}HE({state:lo})}async function qE(){Object.keys(oo).forEach((e=>{oo.hasFrame(e)&&(oo[e].destroy(),oo[e]=null)})),Xi.removeAll(),lo.hasMounted=!1,lo.summary instanceof HTMLElement&&(lo.summary.textContent=""),lo.form instanceof HTMLElement&&(lo.form.textContent=""),await rp.cancelAll(),lo.loader.clearAll()}return new class{constructor(){this.state=lo,this.iframes=oo}async mount(e){await BE(e)}async destroy(){await qE()}async update(e){await async function({newOptions:e={}}={}){if(!lo.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=to({...lo.options},e);await qE(),BE({form:lo.form,summary:lo.summary,...t})}({newOptions:e})}async purchase(e){await NE({payload:e})}async setup(e){await OE({payload:e})}async show(e,t){await FE({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.0.0.0"}on(e,t){IE({eventName:e,callback:t})}}}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/instruments",
3
- "version": "9.74.2",
3
+ "version": "9.74.3",
4
4
  "author": "Rebilly",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -23,26 +23,31 @@
23
23
  "@rebilly/api-metadata": "*",
24
24
  "@rebilly/eslint-config": "*",
25
25
  "@rebilly/risk-data-collector": "*",
26
+ "@types/lodash.camelcase": "^4.3.7",
27
+ "@types/lodash.clonedeep": "^4.5.7",
28
+ "@types/lodash.isequal": "^4.5.6",
29
+ "@types/lodash.kebabcase": "^4.1.7",
30
+ "@types/lodash.merge": "^4.6.7",
26
31
  "@vue/reactivity": "^3.2.39",
27
32
  "ajv": "^8.17.1",
28
33
  "axios": "^1.7.2",
29
34
  "component-emitter": "^2.0.0",
30
35
  "concurrently": "^8.2.2",
31
36
  "core-js": "^3.38.0",
37
+ "dts-bundle-generator": "^9.5.1",
32
38
  "jsdom": "^21.1.1",
33
39
  "jwt-decode": "^3.1.2",
34
- "msw": "^1.2.1",
40
+ "lodash": "^4.17.21",
35
41
  "msw-when-then": "^1.5.1",
42
+ "msw": "^1.2.1",
36
43
  "popostmate": "2.0.0",
37
44
  "rebilly-js-sdk": "*",
38
45
  "typescript": "^5.4.5",
39
46
  "values.js": "^2.0.0",
40
- "vite": "^5.4.1",
41
47
  "vite-plugin-package-version": "^1.1.0",
42
- "dts-bundle-generator": "^9.5.1",
43
- "vitest": "^1.6.0",
48
+ "vite": "^5.4.1",
44
49
  "vitest-canvas-mock": "^0.3.3",
45
- "lodash": "^4.17.21",
46
- "vitest-fail-on-console": "^0.7.0"
50
+ "vitest-fail-on-console": "^0.7.0",
51
+ "vitest": "^1.6.0"
47
52
  }
48
53
  }