{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/packages/utils/src/number.js","webpack:///./js/packages/utils/src/api-request.js","webpack:///./js/packages/cart/src/line-item.js","webpack:///./js/packages/cart/src/cart.js","webpack:///./js/frontend/payment-forms/stripe-checkout/cart/line-item.js","webpack:///./js/frontend/payment-forms/stripe-checkout/cart/index.js","webpack:///./js/frontend/payments/customer.js","webpack:///./js/frontend/payments/session.js","webpack:///./js/frontend/payment-forms/stripe-checkout/submit.js","webpack:///./js/frontend/payment-forms/stripe-checkout/index.js","webpack:///./js/frontend/payment-forms/stripe-checkout/setup.js","webpack:///./js/packages/cart/src/index.js","webpack:///./js/frontend/payment-forms/index.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/defineProperty.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/createClass.js","webpack:///./js/frontend/index.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///external \"jQuery\"","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/typeof.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/regenerator/index.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/form-serialize/index.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/inherits.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///./js/packages/utils/src/index.js","webpack:////Users/spencerfinnell/dev/wpsimplepay/wp-content/plugins/wp-simple-pay-pro/node_modules/regenerator-runtime/runtime.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Number","isInteger","isFinite","Math","floor","isSafeInteger","abs","MAX_SAFE_INTEGER","apiRequest","route","data","a","jQuery","ajax","method","url","wpApiSettings","root","beforeSend","xhr","setRequestHeader","nonce","responseJSON","LineItem","args","cart","this","id","title","amount","quantity","subscription","message","update","remainingItems","getLineItems","filter","items","tax","taxDecimal","getTaxDecimal","getQuantity","subtotal","getSubtotal","round","Cart","currency","taxPercent","coupon","isNonDecimalCurrency","isNaN","parseFloat","filteredItems","length","item","lineitem","push","unitPrice","getUnitPrice","BaseLineItem","forEach","getCoupon","percentOff","percent_off","amountOff","amount_off","discount","getDiscount","BaseCart","spFormElem","formData","form_values","serialize","hash","form_data","form_id","formId","window","simpayApp","enableForm","disableForm","triggerBrowserValidation","checkValidity","trigger","isValid","customer_id","hasCustomerFields","createCustomer","createSession","session","stripeInstance","redirectToCheckout","sessionId","then","error","onPaymentFormError","setup","e","submitBtn","find","spShared","debugLog","getPaymentFormType","convertToCents","spGeneral","booleans","isZeroDecimal","stripeParams","isSubscription","isTrial","planInterval","planIntervalCount","feePercent","feeAmount","setupFee","interval","intervalCount","singleAmount","convertFormDataToCartData","addLineItem","addEventListener","preventDefault","getPaymentForms","submit","onError","undefined","formDisplayType","stripeCheckout","showError","obj","configurable","writable","instance","Constructor","TypeError","_defineProperties","target","props","descriptor","protoProps","staticProps","$","body","formCount","spFormElList","spFormData","spFormElems","init","document","setupPaymentForm","on","each","setupCoreForm","isStripeCheckoutForm","attr","localizedFormData","simplePayForms","formInstance","stripe","strings","bools","form","integers","i18n","config","elementsLocale","Stripe","locale","setCoreFinalAmount","finalAmount","getTotal","setSubmitButtonAsLoading","loadingText","paymentButtonLoadingText","addClass","checkoutButtonLoadingText","prop","html","buttonText","paymentButtonText","removeClass","checkoutButtonText","embeddedHtml","createElement","innerHTML","convertToDollars","formatted","formatCurrency","replace","errorMessage","type","style","display","appendTo","click","remove","ready","self","ReferenceError","_setPrototypeOf","setPrototypeOf","__proto__","_typeof","iterator","constructor","k_r_submitter","k_r_success_contrls","brackets","hash_serializer","result","match","hash_assign","keys","shift","between","Array","isArray","_values","string","index","children","RegExp","exec","parse_keys","existing","str_serialize","encodeURIComponent","options","serializer","elements","radio_store","element","disabled","test","nodeName","val","checked","empty","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","assertThisInitialized","_getPrototypeOf","getPrototypeOf","subClass","superClass","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","done","Promise","fn","arguments","apply","err","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","values","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","invoke","__await","unwrapped","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","toString","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,E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E,QAASA,GAGS,SAAhBhS,KAAKZ,SAGPY,KAAKuO,SA1qBPpI,GA6qBOoK,IAQJnU,EA1rBK,CAisBiBC,EAAOD,SAGtC,IACEsY,mBAAqB3F,EACrB,MAAO4F,GAUPC,SAAS,IAAK,yBAAdA,CAAwC7F","file":"simpay-public.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 327);\n","// @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill\nNumber.isInteger = Number.isInteger || function( value ) {\n\treturn typeof value === 'number' &&\n\t\tisFinite( value ) &&\n\t\tMath.floor( value ) === value;\n};\n\n// @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger#Polyfill\nNumber.isSafeInteger = Number.isSafeInteger || function( value ) {\n\treturn Number.isInteger( value ) && Math.abs( value ) <= Number.MAX_SAFE_INTEGER;\n};\n\n// @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#Polyfill\nif ( ! Number.MAX_SAFE_INTEGER ) {\n\tNumber.MAX_SAFE_INTEGER = 9007199254740991; // Math.pow(2, 53) - 1;\n}\n","/* global jQuery, wpApiSettings */\n\n/**\n * Make an API request to the REST API.\n *\n * @param {string} route REST route.\n * @param {Object} data Data to send to the request.\n * @return {Promise} jQuery promise.\n */\nexport async function apiRequest( route, data ) {\n\ttry {\n\t\treturn await jQuery.ajax( {\n\t\t\tdata,\n\t\t\tmethod: 'POST',\n\t\t\turl: `${ wpApiSettings.root }wpsp/${ route }`,\n\t\t\tbeforeSend: ( xhr ) => {\n\t\t\t\txhr.setRequestHeader( 'X-WP-Nonce', wpApiSettings.nonce );\n\t\t\t},\n\t\t} );\n\t} catch ( { responseJSON } ) {\n\t\tthrow responseJSON;\n\t}\n}\n","/**\n * Internal dependencies\n */\nimport { Cart } from './cart.js';\n\n/**\n * LineItem\n */\nexport const LineItem = class LineItem {\n\t/**\n\t * Create a line item.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param {Object} args Line item arguments.\n\t * @param {string} args.id Cart line item ID.\n\t * @param {string} args.title Cart line item title.\n\t * @param {number} args.amount Cart line item amount.\n\t * @param {number} args.quantity Cart line item quantity.\n\t * @param {boolean|Object} args.subscription Cart line item subscription data.\n\t * @param {boolean} args.subscription.isTrial Cart line item subscription trial designation.\n\t * @param {number} args.subscription.intervalCount Cart line item subscription interval count.\n\t * @param {number} args.subscription.interval Cart line item subscription interval.\n\t * @param {Cart} cart Cart this line item is attached to.\n\t * @return {LineItem} LineItem\n\t */\n\tconstructor( args, cart ) {\n\t\t// Set defaults.\n\t\t// @todo add support for classProperties.\n\t\tthis.cart = null;\n\t\tthis.id = null;\n\t\tthis.title = null;\n\t\tthis.amount = 0;\n\t\tthis.quantity = 1;\n\t\tthis.subscription = false;\n\n\t\tif ( 'object' !== typeof cart ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-cart',\n\t\t\t\tmessage: 'Item must have an cart.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.cart = cart;\n\t\t}\n\n\t\tthis.update( args );\n\t}\n\n\t/**\n\t * Updates a line item.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param {Object} args Cart line item arguments.\n\t * @param {string} args.id Cart line item ID.\n\t * @param {string} args.title Cart line item title.\n\t * @param {number} args.amount Cart line item amount.\n\t * @param {number} args.quantity Cart line item quantity.\n\t * @param {boolean|Object} args.subscription Cart line item subscription data.\n\t * @param {boolean} args.subscription.isTrial Cart line item subscription trial designation.\n\t * @param {number} args.subscription.intervalCount Cart line item subscription interval count.\n\t * @param {number} args.subscription.interval Cart line item subscription interval.\n\t * @return {LineItem} Line item.\n\t */\n\tupdate( args ) {\n\t\t// Parse and retrieve specific arguments.\n\t\tconst {\n\t\t\tid,\n\t\t\ttitle,\n\t\t\tamount,\n\t\t\tquantity,\n\t\t\tsubscription,\n\t\t} = {\n\t\t\t...this,\n\t\t\t...args,\n\t\t};\n\n\t\t// ID must be a string.\n\t\tif ( 'string' !== typeof id ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-id',\n\t\t\t\tmessage: 'Item ID must be a string.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.id = id;\n\t\t}\n\n\t\t// Title must be a string.\n\t\t// Not currently shown in any UI, but may be in the future.\n\t\tif ( 'string' !== typeof title ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-title',\n\t\t\t\tmessage: 'Item title must be a string.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.title = title;\n\t\t}\n\n\t\t// Amount must be a number.\n\t\tif ( ! Number.isSafeInteger( amount ) ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-amount',\n\t\t\t\tmessage: 'Item amount must be an integer.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.amount = amount;\n\t\t}\n\n\t\t// Quantity must be a number.\n\t\tif ( ! Number.isSafeInteger( quantity ) ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-quantity',\n\t\t\t\tmessage: 'Item quantity must be an integer.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.quantity = quantity;\n\t\t}\n\n\t\t// Subscription must be false or contain subscription data.\n\t\t// @todo Validate subscription data.\n\t\tif ( ! ( false === subscription || 'object' === typeof subscription ) ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item-subscription',\n\t\t\t\tmessage: 'Item subscription data must be a false or contain subscription data.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.subscription = subscription;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes the line item from the cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {LineItem} Removed line item.\n\t */\n\tremove() {\n\t\tconst allItems = this.cart.getLineItems();\n\t\tconst remainingItems = allItems.filter( ( { id } ) => ( this.id !== id ) );\n\n\t\tthis.cart.items = remainingItems;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Retrieves a cart line item's unit price.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart line item unit price.\n\t */\n\tgetUnitPrice() {\n\t\treturn this.amount;\n\t}\n\n\t/**\n\t * Retrieves the cart line item's quantity.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart line item quantity.\n\t */\n\tgetQuantity() {\n\t\treturn this.quantity;\n\t}\n\t\n\t/**\n\t * Retrieves a cart line item's tax.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart line item tax.\n\t */\n\tgetTax() {\n\t\tlet tax = 0;\n\t\tlet i = 0;\n\n\t\tconst taxDecimal = this.cart.getTaxDecimal();\n\t\tconst quantity = this.getQuantity();\n\t\tconst subtotal = this.getSubtotal();\n\n\t\tfor ( i = 0; i < quantity; i++ ) {\n\t\t\ttax += Math.round( subtotal * taxDecimal );\n\t\t}\n\n\t\treturn tax;\n\t}\n};\n\nexport default LineItem;\n","/**\n * Internal dependencies\n */\nimport LineItem from './line-item.js';\n\n/**\n * Cart\n */\nexport const Cart = class Cart {\n\t/**\n\t * Creates a cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @see `update()`\n\t *\n\t * @param {Object} args Cart arguments.\n\t * @return {Cart} Cart.\n\t */\n\tconstructor( args ) {\n\t\t// Set defaults.\n\t\t// @todo add support for classProperties.\n\t\tthis.items = [];\n\t\tthis.currency = 'usd';\n\t\tthis.taxPercent = 0;\n\t\tthis.coupon = false;\n\t\tthis.isNonDecimalCurrency = false;\n\n\t\tthis.update( args );\n\t}\n\n\t/**\n\t * Updates the cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param {Object} args Cart arguments.\n\t * @param {number} args.taxPercent Tax percentage.\n\t * @param {false|Object} args.coupon Stripe Coupon.\n\t * @param {boolean} args.isNonDecimalCurrency If the currency is non-decimal based.\n\t * @return {Cart} Cart.\n\t */\n\tupdate( args ) {\n\t\t// Parse and retrieve specific arguments.\n\t\tconst {\n\t\t\tcurrency,\n\t\t\ttaxPercent,\n\t\t\tcoupon,\n\t\t\tisNonDecimalCurrency,\n\t\t} = {\n\t\t\t...this,\n\t\t\t...args,\n\t\t};\n\n\t\t// Set currency.\n\t\tif ( 'string' !== typeof currency ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-currency',\n\t\t\t\tmessage: 'Currency must be a string.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.currency = currency;\n\t\t}\n\n\t\t// Set fees.\n\t\tif ( isNaN( taxPercent ) ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-tax-percent',\n\t\t\t\tmessage: 'Tax percentage must be a number.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.taxPercent = parseFloat( taxPercent );\n\t\t}\n\n\t\t// Set coupon.\n\t\t// @todo Validate coupon data.\n\t\tif ( ! ( false === coupon || 'object' === typeof coupon ) ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-coupon',\n\t\t\t\tmessage: 'Coupon must be a false or contain coupon data.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.coupon = coupon;\n\t\t}\n\n\t\tif ( 'boolean' !== typeof isNonDecimalCurrency ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-non-decimal-currency',\n\t\t\t\tmessage: 'Declaring a non-decimal currency must be a boolean.',\n\t\t\t};\n\t\t} else {\n\t\t\tthis.isNonDecimalCurrency = isNonDecimalCurrency;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Resets the cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {Cart} Cart.\n\t */\n\treset() {\n\t\treturn new Cart;\n\t}\n\n\t/**\n\t * Retrieves coupon information.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {Object} Stripe Coupon.\n\t */\n\tgetCoupon() {\n\t\treturn this.coupon;\n\t}\n\n\t/**\n\t * Retrieves the cart's tax percent amount.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number}\n\t */\n\tgetTaxPercent() {\n\t\treturn this.taxPercent;\n\t}\n\n\t/**\n\t * Retrieves the cart's tax decimal amount for calculations.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number}\n\t */\n\tgetTaxDecimal() {\n\t\treturn ( this.taxPercent / 100 );\n\t}\n\n\t/**\n\t * Retrieves the items in the cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {Array} List of cart items.\n\t */\n\tgetLineItems() {\n\t\treturn this.items;\n\t}\n\n\t/**\n\t * Retrieves an item.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param {string} id Cart line item ID.\n\t * @return {LineItem} Cart line item.\n\t */\n\tgetLineItem( id ) {\n\t\tconst items = this.getLineItems();\n\n\t\t// Can't use `find` because it is not supported in IE.\n\t\tconst filteredItems = items.filter( ( { id: itemId } ) => ( itemId === id ) );\n\n\t\tif ( 0 === filteredItems.length ) {\n\t\t\tthrow {\n\t\t\t\tid: 'invalid-line-item',\n\t\t\t\tmessage: `Unable to retrieve line item \"${ id }\"`,\n\t\t\t};\n\t\t}\n\n\t\treturn filteredItems[ 0 ];\n\t}\n\n\t/**\n\t * Adds a line item to the cart.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param {Object|LineItem} item Cart line item or arguments to create one.\n\t * @return {LineItem} Added line item.\n\t */\n\taddLineItem( item ) {\n\t\tlet lineitem;\n\n\t\tif ( true === item instanceof LineItem ) {\n\t\t\tlineitem = item;\n\t\t} else {\n\t\t\tlineitem = new this.LineItem( item, this );\n\t\t}\n\n\t\tthis.items.push( lineitem );\n\n\t\treturn lineitem;\n\t}\n};\n","/**\n * Internal dependencies\n */\nimport { LineItem as BaseLineItem } from '@wpsimplepay/cart';\n\n/**\n * LineItem\n */\nclass LineItem extends BaseLineItem {\n\t/**\n\t * Retrieves a cart line item's subtotal.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart line item subtotal.\n\t */\n\tgetSubtotal() {\n\t\tlet subtotal = 0;\n\t\tlet i = 0;\n\n\t\tconst taxDecimal = this.cart.getTaxDecimal();\n\n\t\t// Calculate tax for each unit and create a sum.\n\t\tfor ( i = 0; i < this.getQuantity(); i++ ) {\n\t\t\tconst unitPrice = this.getUnitPrice();\n\t\t\tconst unitPriceTaxAmount = Math.round( unitPrice * taxDecimal );\n\n\t\t\tsubtotal += unitPrice + unitPriceTaxAmount;\n\t\t}\n\n\t\treturn subtotal;\n\t}\n\n\t/**\n\t * Retrieves a cart line item's total.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart line item total.\n\t */\n\tgetTotal() {\n\t\treturn Math.round( this.getSubtotal() );\n\t}\n}\n\nexport default LineItem;\n","/**\n * Internal dependencies\n */\nimport { Cart as BaseCart } from '@wpsimplepay/cart';\nimport LineItem from './line-item.js';\n\n/**\n * Cart for Stripe Checkout form types.\n *\n * @since 3.7.0\n */\nexport const Cart = class Cart extends BaseCart {\n\t/**\n\t * @since 3.7.0\n\t *\n\t * @param {Object} args Cart arguments.\n\t */\n\tconstructor( args ) {\n\t\tsuper( args );\n\n\t\t// Define the type of line item to use.\n\t\tthis.LineItem = LineItem;\n\t}\n\n\t/**\n\t * Retrieves subtotal.\n\t *\n\t * Taxes are added to each line item amount to create a subtotal.\n\t * This is done because Stripe Checkout Sessions do not support\n\t * `tax_percent` or `tax_rates`.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart subtotal.\n\t */\n\tgetSubtotal() {\n\t\tlet subtotal = 0;\n\n\t\tthis.getLineItems().forEach( ( item ) => {\n\t\t\tsubtotal += item.getSubtotal();\n\t\t} );\n\n\t\treturn subtotal;\n\t}\n\n\t/**\n\t * Retrieves the total discount amount.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart discount amount.\n\t */\n\tgetDiscount() {\n\t\tconst coupon = this.getCoupon();\n\n\t\tconst {\n\t\t\tpercent_off: percentOff,\n\t\t\tamount_off: amountOff,\n\t\t} = coupon;\n\n\t\tlet discount = 0;\n\n\t\tif ( false === coupon ) {\n\t\t\treturn discount;\n\t\t}\n\n\t\tif ( percentOff ) {\n\t\t\tdiscount += Math.round( this.getSubtotal() * ( percentOff / 100 ) );\n\t\t} else if ( amountOff ) {\n\t\t\tdiscount += amountOff;\n\t\t}\n\n\t\treturn discount;\n\t}\n\n\t/**\n\t * Retrieves the total tax amount.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart tax.\n\t */\n\tgetTax() {\n\t\tlet tax = 0;\n\t\tlet i = 0;\n\n\t\tconst taxDecimal = this.getTaxDecimal();\n\t\tconst lineItems = this.getLineItems();\n\n\t\tlineItems.forEach( ( item ) => {\n\t\t\tfor ( i = 0; i < item.getQuantity(); i++ ) {\n\t\t\t\ttax += Math.round( item.getUnitPrice() * taxDecimal );\n\t\t\t}\n\t\t} );\n\n\t\treturn tax;\n\t}\n\n\t/**\n\t * Retrieves the total.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return {number} Cart total.\n\t */\n\tgetTotal() {\n\t\tconst subtotal = this.getSubtotal();\n\t\tconst discount = this.getDiscount();\n\n\t\treturn Math.round( subtotal - discount );\n\t}\n};\n","/**\n * External dependencies.\n */\nimport serialize from 'form-serialize';\n\n/**\n * Internal dependencies.\n */\nimport { apiRequest } from '@wpsimplepay/utils';\n\n/**\n * Create a Customer object based on current formData.\n *\n * @param {Object} data Data to pass to REST endpoint.\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n * @return {Promise} AJAX promise.\n */\nexport function create( data = {}, spFormElem, formData ) {\n\treturn apiRequest( 'v2/customer', {\n\t\tform_values: serialize( spFormElem[ 0 ], { hash: true } ),\n\t\tform_data: formData,\n\t\tform_id: formData.formId,\n\t\t...data,\n\t} );\n}\n","/**\n * External dependencies.\n */\nimport serialize from 'form-serialize';\n\n/**\n * Internal dependencies.\n */\nimport { apiRequest } from '@wpsimplepay/utils';\n\n/**\n * Create a Customer object based on current formData.\n *\n * @param {Object} data Data to pass to REST endpoint.\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n * @return {Promise} AJAX promise.\n */\nexport function create( data = {}, spFormElem, formData ) {\n\treturn apiRequest( 'v2/checkout-session', {\n\t\tform_values: serialize( spFormElem[ 0 ], { hash: true } ),\n\t\tform_data: formData,\n\t\tform_id: formData.formId,\n\t\t...data,\n\t} );\n}\n","/* global _ */\n\n/**\n * External dependencies.\n */\nimport serialize from 'form-serialize';\n\n/**\n * Internal dependencies.\n */\nimport { onPaymentFormError } from '@wpsimplepay/core/frontend/payment-forms';\nimport { create as createCustomer } from '@wpsimplepay/core/frontend/payments/customer.js';\nimport { create as createSession } from '@wpsimplepay/core/frontend/payments/session.js';\n\n/**\n * Submit Stripe Checkout Payment Form.\n *\n * @todo DRY presubmission validation checks?\n *\n * @since 3.8.0\n *\n * @param {Element} cardElementInstance Stripe Elements card.\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n */\nexport async function submit( spFormElem, formData ) {\n\tconst {\n\t\tenableForm,\n\t\tdisableForm,\n\t\ttriggerBrowserValidation,\n\t} = window.simpayApp;\n\n\t// Disable form while processing.\n\tdisableForm( spFormElem, formData, true );\n\n\t// HTML5 validation check.\n\tif ( ! spFormElem[ 0 ].checkValidity() ) {\n\t\ttriggerBrowserValidation( spFormElem, formData );\n\t\tenableForm( spFormElem, formData );\n\n\t\treturn;\n\t}\n\n\t// Allow further validation.\n\t//\n\t// jQuery( document.body ).on( 'simpayBeforeStripePayment', function( e, spFormElem, formData ) {\n\t// formData.isValid = false;\n\t// } );\n\tspFormElem.trigger( 'simpayBeforeStripePayment', [ spFormElem, formData ] );\n\n\tif ( ! formData.isValid ) {\n\t\tenableForm( spFormElem, formData );\n\n\t\treturn;\n\t}\n\n\ttry {\n\n\t\t// @todo Implement as a \"Stripe Checkout\" Payment Method?\n\n\t\tlet customer_id = null;\n\t\tconst { hasCustomerFields } = formData;\n\n\t\t// Only generate a custom Customer if we need to map on-page form fields.\n\t\tif ( hasCustomerFields ) {\n\t\t\tconst { id } = await createCustomer( {}, spFormElem, formData );\n\t\t\tcustomer_id = id;\n\t\t}\n\n\t\t// Generate a Checkout Session.\n\t\tconst session = await createSession(\n\t\t\t{\n\t\t\t\tcustomer_id,\n\t\t\t},\n\t\t\tspFormElem,\n\t\t\tformData\n\t\t);\n\n\t\t// Redirect to Stripe.\n\t\tspFormElem.stripeInstance\n\t\t\t.redirectToCheckout( {\n\t\t\t\tsessionId: session.sessionId,\n\t\t\t} )\n\t\t\t.then( ( { error } ) => {\n\t\t\t\tif ( error ) {\n\t\t\t\t\tonPaymentFormError( error, spFormElem, formData );\n\t\t\t\t}\n\t\t\t} );\n\n\t} catch ( error ) {\n\t\tonPaymentFormError( error, spFormElem, formData );\n\t}\n}\n","/**\n * Internal dependencies\n */\nimport { setup } from './setup.js';\nimport { submit } from './submit.js';\nimport { onPaymentFormError as onError } from '@wpsimplepay/core/frontend/payment-forms';\n\nexport default {\n\tsetup,\n\tsubmit,\n\tonError,\n};\n","/**\n * Internal dependencies\n */\nimport { convertFormDataToCartData } from '@wpsimplepay/cart';\nimport { Cart } from '@wpsimplepay/core/frontend/payment-forms/stripe-checkout/cart';\nimport { onPaymentFormError, getPaymentFormType, getPaymentForms } from '@wpsimplepay/core/frontend/payment-forms';\n\n/**\n * Bind events for Stripe Checkout.\n *\n * @param {Event} e simpayBindCoreFormEventsAndTriggers Event.\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n */\nexport function setup( e, spFormElem, formData ) {\n\tconst submitBtn = spFormElem.find( '.simpay-payment-btn' )[0];\n\n\tconst { enableForm, disableForm } = window.simpayApp;\n\tconst { debugLog } = window.spShared;\n\n\t// Don't continue if this form is not using Stripe Checkout.\n\t// We need to check here due to legacy implementation of form setups.\n\tif ( 'stripe-checkout' !== getPaymentFormType( spFormElem, formData ) ) {\n\t\treturn;\n\t}\n\n\t// Disable Payment Form during setup.\n\tdisableForm( spFormElem, formData, true );\n\n\ttry {\n\t\t// Convert legacay data in to Cart data.\n\t\tconst {\n\t\t\titems,\n\t\t\tcurrency,\n\t\t\ttaxPercent,\n\t\t\tisNonDecimalCurrency,\n\t\t} = convertFormDataToCartData( formData );\n\n\t\t// Create a cart.\n\t\tconst cart = new Cart( {\n\t\t\tcurrency,\n\t\t\ttaxPercent,\n\t\t\tisNonDecimalCurrency,\n\t\t} );\n\n\t\t// Add items to the Cart.\n\t\tif ( items.length > 0 ) {\n\t\t\titems.forEach( ( item ) => {\n\t\t\t\tcart.addLineItem( item );\n\t\t\t} );\n\t\t}\n\n\t\t// Attach cart to the Payment Form instance.\n\t\tspFormElem.cart = cart;\n\n\t\t// Reenable form.\n\t\tenableForm( spFormElem, formData );\n\n\t\t// Attach submission handler.\n\t\tsubmitBtn.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\n\t\t\t// Find and submit the Payment Form.\n\t\t\tgetPaymentForms()[ getPaymentFormType( spFormElem, formData ) ]\n\t\t\t\t.submit( spFormElem, formData );\n\t\t} );\n\t} catch ( error ) {\n\t\tonPaymentFormError( error, spFormElem, formData );\n\t}\n}\n","export * from './cart.js';\nexport * from './line-item.js';\n\n/**\n * Converts current `formData` to a structured cart.\n *\n * @since 3.7.0\n *\n * @param {Object} formData Legacy form data.\n * @return {Object} data Cart data.\n */\nexport function convertFormDataToCartData( formData ) {\n\tconst {\n\t\tdebugLog,\n\t\tconvertToCents,\n\t} = window.spShared;\n\n\tconst {\n\t\tbooleans: {\n\t\t\tisZeroDecimal: isNonDecimalCurrency,\n\t\t},\n\t} = window.spGeneral;\n\n\tconst {\n\t\tstripeParams: {\n\t\t\tcurrency,\n\t\t},\n\n\t\t// Items.\n\t\tamount,\n\t\tisSubscription,\n\t\tquantity,\n\t\tisTrial,\n\t\tplanInterval,\n\t\tplanIntervalCount,\n\n\t\t// Fees.\n\t\tfeePercent,\n\t\tfeeAmount,\n\t\ttaxPercent,\n\t\tsetupFee,\n\t} = formData;\n\n\tconst data = {\n\t\tcurrency,\n\t\titems: [],\n\t\ttaxPercent: 0,\n\t\tisNonDecimalCurrency,\n\t};\n\n\t//\n\t// Add items.\n\t//\n\n\t// Initial Setup Fee.\n\tif ( ! isNaN( setupFee ) ) {\n\t\tdata.items.push( {\n\t\t\tid: 'setup-fee',\n\t\t\ttitle: 'Initial Setup Fee',\n\t\t\tamount: convertToCents( setupFee ),\n\t\t\tquantity: 1,\n\t\t\tsubscription: false,\n\t\t} );\n\t}\n\n\t// Plan Setup Fee.\n\tdata.items.push( {\n\t\tid: 'plan-setup-fee',\n\t\ttitle: 'Plan Setup Fee',\n\t\tamount: 0,\n\t\tquantity: 1,\n\t\tsubscription: false,\n\t} );\n\n\t// Base item.\n\tif ( isSubscription ) {\n\t\tdata.items.push( {\n\t\t\tid: 'base',\n\t\t\ttitle: 'Subscription',\n\t\t\tamount: convertToCents( amount ),\n\t\t\tquantity,\n\t\t\tsubscription: {\n\t\t\t\tisTrial,\n\t\t\t\tinterval: planInterval,\n\t\t\t\tintervalCount: planIntervalCount,\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tlet singleAmount = amount;\n\n\t\tif ( ! isNaN( feeAmount ) && feeAmount > 0 ) {\n\t\t\tsingleAmount += feeAmount;\n\n\t\t\tdebugLog( 'feeAmount:', 'Arbitrary fee amounts should be added to the base amount directly.' );\n\t\t}\n\n\t\tdata.items.push( {\n\t\t\tid: 'base',\n\t\t\ttitle: 'One-time amount',\n\t\t\tamount: convertToCents( singleAmount ),\n\t\t\tquantity,\n\t\t\tsubscription: false,\n\t\t} );\n\t}\n\n\t// Tax.\n\tif ( ! isNaN( taxPercent ) ) {\n\t\tdata.taxPercent = taxPercent;\n\t}\n\n\t// Add any arbitrary fee percentage to tax percentage.\n\t// @link https://github.com/wpsimplepay/wp-simple-pay-pro/issues/1161\n\tif ( ! isNaN( feePercent ) && feePercent > 0 ) {\n\t\tdata.taxPercent = data.taxPercent + feePercent;\n\t\tdebugLog( 'feePercent:', 'Arbitrary fee percentages should be added to the taxPercent directly.' );\n\t};\n\n\treturn data;\n}\n","/* global _ */\n\n/**\n * Internal dependencies\n */\nimport { default as stripeCheckout } from './stripe-checkout';\n\n/**\n * Returns the current form type.\n *\n * @since 3.8.0\n *\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n * @return {string} Form type. Currently supports `stripe-checkout` or `stripe-elements`.\n */\nexport function getPaymentFormType( spFormElem, formData ) {\n\tif (\n\t\tundefined === formData.formDisplayType ||\n\t\t'stripe_checkout' === formData.formDisplayType\n\t) {\n\t\treturn 'stripe-checkout';\n\t} else {\n\t\treturn 'stripe-elements';\n\t}\n};\n\n/**\n * Returns available Payment Forms.\n *\n * @todo Create a registry/datastore.\n *\n * @since 3.8.0\n *\n * @return {Object} List of available Payment Forms.\n */\nexport const getPaymentForms = () => ( {\n\t'stripe-checkout': stripeCheckout,\n} );\n\n/**\n * Handles an error on submission.\n *\n * @since 3.8.0\n *\n * @param {Object} error Error data.\n * @param {jQuery} spFormElem Form element jQuery object.\n * @param {Object} formData Configured form data.\n */\nexport function onPaymentFormError( error = {}, spFormElem, formData ) {\n\tconst { showError, enableForm } = window.simpayApp;\n\tconst { debugLog } = window.spShared;\n\tconst { id = '', message = '' } = error;\n\n\tshowError( spFormElem, formData, message );\n\tenableForm( spFormElem, formData );\n}\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/* global simplePayForms, spGeneral, jQuery */\n\n/**\n * Internal dependencies.\n */\nimport { getPaymentForms } from '@wpsimplepay/core/frontend/payment-forms';\n\nlet simpayApp;\n\n( function( $ ) {\n\t'use strict';\n\n\tlet body;\n\n\tsimpayApp = {\n\n\t\tformCount: 0,\n\n\t\t// Collection of DOM elements of all payment forms.\n\t\tspFormElList: {},\n\n\t\t// Internal organized collection of all form data.\n\t\tspFormData: {},\n\t\tspFormElems: {},\n\n\t\t/**\n\t\t *\n\t\t */\n\t\tinit() {\n\t\t\tbody = $( document.body );\n\n\t\t\t// Skip \"Update Payment Method Forms\"\n\t\t\t// We need to keep .simpay-checkout-form so styles are applied.\n\t\t\tsimpayApp.spFormElList = body.find( '.simpay-checkout-form:not(.simpay-update-payment-method)' );\n\n\t\t\tconst stripeCheckout = getPaymentForms()['stripe-checkout'];\n\t\t\tconst { setup: setupPaymentForm } = stripeCheckout;\n\n\t\t\t// Setup Stripe Checkout when formData is available.\n\t\t\tbody.on( 'simpayCoreFormVarsInitialized', setupPaymentForm );\n\n\t\t\tsimpayApp.spFormElList.each( function( i ) {\n\t\t\t\tconst spFormElem = $( this );\n\n\t\t\t\tsimpayApp.setupCoreForm( spFormElem );\n\t\t\t\tsimpayApp.formCount++;\n\n\t\t\t\tbody.trigger( 'simpaySetupCoreForm', [ spFormElem ] );\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Does this payment form use the Stripe Checkout overlay?\n\t\t *\n\t\t * @param {Object} formData Configured form data.\n\t\t */\n\t\tisStripeCheckoutForm( formData ) {\n\t\t\treturn ( undefined === formData.formDisplayType ) || ( 'stripe_checkout' === formData.formDisplayType );\n\t\t},\n\n\t\t/**\n\t\t * Setup form object properties and additional data.\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t */\n\t\tsetupCoreForm( spFormElem ) {\n\t\t\t// Add a unique identifier to the form for unique selectors.\n\t\t\tspFormElem.attr( 'data-simpay-form-instance', simpayApp.formCount );\n\n\t\t\tconst formId = spFormElem.data( 'simpay-form-id' );\n\n\t\t\t// Grab the localized data for this form ID.\n\t\t\tconst localizedFormData = simplePayForms[ formId ];\n\n\t\t\t// Merge form data from bootstrapped data (separated based on type... for some reason).\n\t\t\tconst formData = {\n\t\t\t\tformId,\n\t\t\t\tformInstance: simpayApp.formCount,\n\t\t\t\tquantity: 1,\n\t\t\t\tisValid: true,\n\t\t\t\tstripeParams: {\n\t\t\t\t\t...localizedFormData.stripe.strings,\n\t\t\t\t\t...localizedFormData.stripe.bools,\n\t\t\t\t},\n\t\t\t\t...localizedFormData.form.bools,\n\t\t\t\t...localizedFormData.form.integers,\n\t\t\t\t...localizedFormData.form.i18n,\n\t\t\t\t...localizedFormData.form.strings,\n\t\t\t\t...localizedFormData.form.config,\n\t\t\t};\n\n\t\t\tconst {\n\t\t\t\tstripeParams: {\n\t\t\t\t\tkey,\n\t\t\t\t\telementsLocale,\n\t\t\t\t}\n\t\t\t} = formData;\n\n\t\t\t// Attach Stripe instance to spFormElem to avoid tampering when adjusting formData.\n\t\t\tspFormElem.stripeInstance = Stripe( key, {\n\t\t\t\tlocale: elementsLocale || 'auto',\n\t\t\t} );\n\n\t\t\t// Track in global namespace.\n\t\t\twindow.simpayApp.spFormData[ formId ] = formData;\n\t\t\twindow.simpayApp.spFormElems[ formId ] = spFormElem;\n\n\t\t\tbody.trigger( 'simpayCoreFormVarsInitialized', [ spFormElem, formData ] );\n\t\t\tbody.trigger( 'simpayBindCoreFormEventsAndTriggers', [ spFormElem, formData ] );\n\t\t},\n\n\t\t/**\n\t\t * Set the final amount for the Payment Form.\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t * @param {Object} formData Configured form data.\n\t\t */\n\t\tsetCoreFinalAmount( spFormElem, formData ) {\n\t\t\t// Backwards compat.\n\t\t\tformData.finalAmount = spFormElem.cart.getTotal();\n\n\t\t\tbody.trigger( 'simpayFinalizeCoreAmount', [ spFormElem, formData ] );\n\t\t},\n\n\t\t/**\n\t\t * Disable Payment Form.\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t * @param {Object} formData Configured form data.\n\t\t * @param {bool} setSubmitAsLoading Adjust button text to Processing text state.\n\t\t */\n\t\tdisableForm( spFormElem, formData, setSubmitButtonAsLoading ) {\n\t\t\tlet submitBtn = spFormElem.find( '.simpay-payment-btn' );\n\t\t\tlet loadingText = formData.paymentButtonLoadingText;\n\n\t\t\tspFormElem.addClass( 'simpay-checkout-form--loading' );\n\n\t\t\tif ( ! window.simpayApp.isStripeCheckoutForm( formData ) ) {\n\t\t\t\tsubmitBtn = spFormElem.find( '.simpay-checkout-btn' );\n\t\t\t\tloadingText = formData.checkoutButtonLoadingText;\n\t\t\t}\n\n\t\t\t// Disable the form submit button upon initial form load or form submission.\n\t\t\tsubmitBtn\n\t\t\t\t.prop( 'disabled', true );\n\n\t\t\tif ( true === setSubmitButtonAsLoading ) {\n\t\t\t\tsubmitBtn\n\t\t\t\t\t.addClass( 'simpay-disabled' )\n\t\t\t\t\t.find( 'span' )\n\t\t\t\t\t.html( loadingText );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable Payment Form.\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t * @param {Object} formData Configured form data.\n\t\t */\n\t\tenableForm( spFormElem, formData ) {\n\t\t\tconst { cart } = spFormElem;\n\n\t\t\t// Do nothing if Cart is unavailable.\n\t\t\tif ( undefined === cart ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet submitBtn = spFormElem.find( '.simpay-payment-btn' );\n\t\t\tlet loadingText = formData.paymentButtonLoadingText;\n\t\t\tlet buttonText = formData.paymentButtonText;\n\n\t\t\tspFormElem.removeClass( 'simpay-checkout-form--loading' );\n\n\t\t\tif ( ! window.simpayApp.isStripeCheckoutForm( formData ) ) {\n\t\t\t\tsubmitBtn = spFormElem.find( '.simpay-checkout-btn' );\n\t\t\t\tloadingText = formData.checkoutButtonLoadingText;\n\t\t\t\tbuttonText = formData.checkoutButtonText;\n\t\t\t}\n\n\t\t\t// Re-enable button.\n\t\t\tsubmitBtn\n\t\t\t\t.prop( 'disabled', false )\n\t\t\t\t.removeClass( 'simpay-disabled' );\n\n\t\t\t// Embed in to an arbitrary node to retrieve parsed entities.\n\t\t\tconst embeddedHtml = document.createElement( 'div' );\n\t\t\tembeddedHtml.innerHTML = loadingText;\n\n\t\t\t// Reset button text back to original if needed during validation.\n\t\t\tif ( $( embeddedHtml ).html() === submitBtn.find( 'span' ).html() ) {\n\t\t\t\tconst {\n\t\t\t\t\tconvertToDollars,\n\t\t\t\t\tformatCurrency,\n\t\t\t\t} = window.spShared;\n\n\t\t\t\tconst total = convertToDollars( cart.getTotal() );\n\t\t\t\tconst formatted = formatCurrency( total, true );\n\t\t\t\tconst amount = `${ formatted }`;\n\n\t\t\t\tbuttonText = buttonText\n\t\t\t\t\t.replace( '{{amount}}', amount );\n\n\t\t\t\treturn submitBtn\n\t\t\t\t\t.find( 'span' )\n\t\t\t\t\t.html( buttonText );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show an error.\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t * @param {Object} formData Configured form data.\n\t\t * @param {string} errorMessage Message to show.\n\t\t */\n\t\tshowError( spFormElem, formData, errorMessage ) {\n\t\t\treturn spFormElem\n\t\t\t\t.find( '.simpay-errors' )\n\t\t\t\t.html( errorMessage );\n\t\t},\n\n\t\t/**\n\t\t * Ref triggerBrowserValidation in https://stripe.github.io/elements-examples/\n\t\t *\n\t\t * @param {jQuery} spFormElem Form element jQuery object.\n\t\t * @param {Object} formData Configured form data.\n\t\t */\n\t\ttriggerBrowserValidation( spFormElem, formData ) {\n\t\t\treturn $( '' )\n\t\t\t\t.attr( {\n\t\t\t\t\ttype: 'submit',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t} )\n\t\t\t\t.appendTo( spFormElem )\n\t\t\t\t.click()\n\t\t\t\t.remove();\n\t\t},\n\t};\n\n\t// Initialize form.\n\t$( document ).ready( () => simpayApp.init() );\n}( jQuery ) );\n\nwindow.simpayApp = simpayApp;\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","module.exports = jQuery;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","module.exports = require(\"regenerator-runtime\");\n","// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n"],"sourceRoot":""}