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CjC,EAAIiC,sCAA8B,IAAAjC,GAAU,QAAVA,EAA9BA,EAAgCkC,gBAAQ,IAAAlC,GAAxCA,EAA0CmC,eAC1C,IAAIC,EAAAA,iBAAgB,EAAAC,EAAAA,kBAAiB,iBAAkB,CACnDpC,YAAAA,EACA0B,UAAW,qCACXzB,YAAAA,IAI8B,oBAA/BoC,4BACP,IAAIC,EAAAA,gBACAC,EAAAA,OACAF,2BACA,CACIG,GAAI,gBACJxC,YAAAA,EACAC,YAAa,SAACW,GACV,IAAOP,EAAYO,EAAS6B,KAArBpC,SACP,OAAOO,EAAS6B,KAAKP,cAAc1B,oBAAoBC,SAASJ,EACpE,G","sources":["webpack://wcStripeModules/external window [\"wcStripeModules\",\"checkoutModules\"]","webpack://wcStripeModules/external window [\"wcStripeModules\",\"messageModules\"]","webpack://wcStripeModules/external window [\"wc_stripe\"]","webpack://wcStripeModules/webpack/bootstrap","webpack://wcStripeModules/./assets/js/frontend/bnpl-messages/affirm/index.js"],"sourcesContent":["module.exports = window[\"wcStripeModules\"][\"checkoutModules\"];","module.exports = window[\"wcStripeModules\"][\"messageModules\"];","module.exports = window[\"wc_stripe\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import {BaseGateway, ProductGateway, stripe} from '@paymentplugins/wc-stripe';\nimport {getPaymentMethod} from '@paymentplugins/wc-stripe/checkout';\nimport {\n CartMessage,\n CheckoutMessage,\n CategoryMessage,\n ProductMessage\n} from '@paymentplugins/wc-stripe/message-modules';\n\nconst elementType = 'affirmMessage';\nconst isSupported = (gateway) => {\n const currency = gateway?.get_gateway_data()?.currency;\n return gateway?.params?.supportedCurrencies?.includes(currency);\n}\n\nclass AffirmGateway extends BaseGateway {\n constructor(params) {\n super(params);\n }\n};\n\nif (typeof wc_stripe_affirm_cart_params !== 'undefined') {\n new CartMessage(new AffirmGateway(wc_stripe_affirm_cart_params), {\n elementType,\n elementId: 'wc-stripe-affirm-cart-msg',\n containerId: 'wc-stripe-affirm-cart-container',\n isSupported\n });\n}\nif (typeof wc_stripe_affirm_product_params !== 'undefined') {\n Object.assign(AffirmGateway.prototype, ProductGateway.prototype);\n new ProductMessage(new AffirmGateway(wc_stripe_affirm_product_params), {\n elementType,\n elementId: 'wc-stripe-affirm-product-msg',\n isSupported\n });\n}\nif (typeof wc_stripe_local_payment_params !== 'undefined') {\n if (wc_stripe_local_payment_params?.gateways?.stripe_affirm) {\n new CheckoutMessage(getPaymentMethod('stripe_affirm'), {\n elementType,\n elementId: 'wc-stripe-affirm-message-container',\n isSupported\n });\n }\n}\nif (typeof wc_stripe_bnpl_shop_params !== 'undefined') {\n new CategoryMessage(\n stripe,\n wc_stripe_bnpl_shop_params,\n {\n id: 'stripe_affirm',\n elementType,\n isSupported: (instance) => {\n const {currency} = instance.data;\n return instance.data.stripe_affirm.supportedCurrencies.includes(currency);\n }\n });\n}"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","_wcStripe","require","_checkout","_messageModules","_callSuper","t","o","e","_getPrototypeOf","self","call","_typeof","TypeError","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","Object","setPrototypeOf","getPrototypeOf","bind","__proto__","_setPrototypeOf","p","_wc_stripe_local_paym","elementType","isSupported","gateway","_gateway$get_gateway_","_gateway$params","currency","get_gateway_data","params","supportedCurrencies","includes","AffirmGateway","_BaseGateway","instance","Constructor","_classCallCheck","subClass","superClass","create","value","writable","configurable","defineProperty","_inherits","BaseGateway","wc_stripe_affirm_cart_params","CartMessage","elementId","containerId","wc_stripe_affirm_product_params","assign","ProductGateway","ProductMessage","wc_stripe_local_payment_params","gateways","stripe_affirm","CheckoutMessage","getPaymentMethod","wc_stripe_bnpl_shop_params","CategoryMessage","stripe","id","data"],"sourceRoot":""}