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AI,MDD7BZ,EACTJ,OAAOC,eAAeG,EAAKN,EAAK,CAC9Ba,MAAOA,EACPT,YAAY,EACZqB,cAAc,EACdC,UAAU,IAGZpB,EAAIN,GAAOa,EAENP,ECXM,IACTY,CDWN,C,OGdA,MAAM,EAA+BS,OAAe,O,aCApD,MAAM,EAA+BA,OAAkB,U,+jBCGvD,IAAMC,EAAoB,SAACP,GAGvBQ,EAAAA,iBAASC,SAAQ,SAAAC,GACTA,EAAQC,sBAERD,EAAQC,sBAGhB,GACJ,EASAC,KAAE,WACMJ,EAAAA,iBAASK,SAETL,EAAAA,iBAASC,SAAQ,SAAAC,GAEb,IAAMI,EAAmBJ,EAAQK,qBACjCL,EAAQK,qBAAuB,WAC3B,OAAAC,EAAAA,EAAA,GACOF,EAAiBzB,KAAKqB,IAd5BE,IAAE,yBAAyBK,iBAAiBC,QAAO,SAACC,EAAOlC,GACpE,OAAA+B,EAAAA,EAAA,GAAWG,GAAK,GAAAvB,EAAA,GAAGX,EAAImC,KAAOnC,EAAIO,OACtC,GAAG,CAAC,GAeI,CACJ,IAEAoB,IAAES,SAASC,MAAMC,GAAG,SAAU,wBAAyBhB,GAE/D,K","sources":["webpack://wc_stripe/webpack/bootstrap","webpack://wc_stripe/webpack/runtime/compat get default export","webpack://wc_stripe/webpack/runtime/define property getters","webpack://wc_stripe/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe/webpack/runtime/make namespace object","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://wc_stripe/external window \"jQuery\"","webpack://wc_stripe/external window [\"wc_stripe\"]","webpack://wc_stripe/./packages/woocommerce-tm-extra-product-options/assets/js/product.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\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 return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"jQuery\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wc_stripe\"];","import $ from 'jquery';\nimport {product_gateways as gateways} from '@paymentplugins/wc-stripe';\n\nconst handleFieldChange = (e) => {\n let tmcpCalculation = false;\n // when a extra product option field changes, update the cart calculation\n gateways.forEach(gateway => {\n if (gateway.maybe_calculate_cart) {\n tmcpCalculation = true;\n gateway.maybe_calculate_cart();\n tmcpCalculation = false;\n }\n });\n}\n\nconst getExtraProductData = () => {\n const data = $('form.cart .tmcp-field').serializeArray().reduce((carry, obj) => {\n return {...carry, [obj.name]: obj.value};\n }, {});\n return data;\n}\n\n$(() => {\n if (gateways.length) {\n\n gateways.forEach(gateway => {\n // add to cart data function wrapper\n const getAddToCartData = gateway.get_add_to_cart_data;\n gateway.get_add_to_cart_data = () => {\n return {\n ...getAddToCartData.call(gateway),\n ...getExtraProductData()\n }\n }\n });\n\n $(document.body).on('change', 'form.cart .tmcp-field', handleFieldChange);\n }\n})"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_typeof","iterator","constructor","_defineProperty","i","t","r","e","toPrimitive","TypeError","String","configurable","writable","window","handleFieldChange","gateways","forEach","gateway","maybe_calculate_cart","$","length","getAddToCartData","get_add_to_cart_data","_objectSpread","serializeArray","reduce","carry","name","document","body","on"],"sourceRoot":""}