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9BA,EAA8B,UAAI,WACnC,CARD,CAQGA,IAAuBA,EAAqB,CAAC,IAGhD,SAAWC,GACTA,EAA2B,MAAI,QAC/BA,EAA2B,MAAI,QAC/BA,EAAkC,aAAI,eACvC,CAJD,CAIGA,IAAwBA,EAAsB,CAAC,IAElD,S","sources":["webpack://webstaurantstore/../node_modules/@clarkinc/payment-client/dist/payment-client.esm.js"],"sourcesContent":["import React, { createContext, useState, useCallback, createRef, useEffect, useImperativeHandle, useContext } from 'react';\n\nfunction _regeneratorRuntime() {\n _regeneratorRuntime = function () {\n return e;\n };\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function (t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == typeof h && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function (t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator.return && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(typeof e + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function (e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function () {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function (e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function (t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function (t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function (t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n catch: function (t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function (e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nfunction _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}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\nfunction _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, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nvar MessageType;\n(function (MessageType) {\n MessageType[MessageType[\"SyncRequest\"] = 0] = \"SyncRequest\";\n MessageType[MessageType[\"SyncResponse\"] = 1] = \"SyncResponse\";\n MessageType[MessageType[\"SetStyles\"] = 2] = \"SetStyles\";\n MessageType[MessageType[\"UpdateContentHeight\"] = 3] = \"UpdateContentHeight\";\n MessageType[MessageType[\"TokenizePaymentMethodRequest\"] = 4] = \"TokenizePaymentMethodRequest\";\n MessageType[MessageType[\"TokenizePaymentMethodResponse\"] = 5] = \"TokenizePaymentMethodResponse\";\n MessageType[MessageType[\"GenerateTokenizeCardTokenRequest\"] = 6] = \"GenerateTokenizeCardTokenRequest\";\n MessageType[MessageType[\"GenerateTokenizeCardTokenResponse\"] = 7] = \"GenerateTokenizeCardTokenResponse\";\n MessageType[MessageType[\"AuthorizePaymentMethodRequest\"] = 8] = \"AuthorizePaymentMethodRequest\";\n MessageType[MessageType[\"AuthorizePaymentMethodResponse\"] = 9] = \"AuthorizePaymentMethodResponse\";\n MessageType[MessageType[\"ClearForm\"] = 10] = \"ClearForm\";\n})(MessageType || (MessageType = {}));\n\nvar SecureFrame = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var title = _ref.title,\n containerStyle = _ref.containerStyle,\n url = _ref.url;\n return url === undefined ? React.createElement(\"iframe\", {\n title: title,\n style: {\n display: 'none'\n },\n ref: ref\n }) : React.createElement(\"iframe\", {\n title: title,\n src: url,\n style: containerStyle,\n ref: ref\n });\n});\n\nvar PaymentFormStatus;\n(function (PaymentFormStatus) {\n PaymentFormStatus[PaymentFormStatus[\"Initializing\"] = 0] = \"Initializing\";\n PaymentFormStatus[PaymentFormStatus[\"Loading\"] = 1] = \"Loading\";\n PaymentFormStatus[PaymentFormStatus[\"Failed\"] = 2] = \"Failed\";\n PaymentFormStatus[PaymentFormStatus[\"PendingSync\"] = 3] = \"PendingSync\";\n PaymentFormStatus[PaymentFormStatus[\"Loaded\"] = 4] = \"Loaded\";\n})(PaymentFormStatus || (PaymentFormStatus = {}));\n\nvar PaymentFormContext = /*#__PURE__*/createContext({\n status: PaymentFormStatus.Initializing\n});\n\nvar clearForm = function clearForm(iframeWindow, iframeUrl) {\n if (iframeUrl === undefined || iframeWindow === undefined) {\n return;\n }\n var message = {\n messageType: MessageType.ClearForm\n };\n iframeWindow == null || iframeWindow.postMessage(message, iframeUrl);\n};\nvar tokenizePaymentMethod = function tokenizePaymentMethod(serviceCollection, setAsDefault, isAlreadyTokenizing, iframeWindow, iframeUrl) {\n var defaultResult = {\n isSuccessful: false,\n completedTokenizationAttempt: false,\n suggestVerifyInformation: false,\n isRewardsCard: false,\n tokenId: null,\n displayName: null,\n mask: null,\n type: null\n };\n if (iframeUrl === undefined || iframeWindow === undefined) {\n return function () {\n return new Promise(function (resolve) {\n resolve(defaultResult);\n });\n };\n }\n return function (timeout, callback) {\n if (callback === void 0) {\n callback = function callback(_) {};\n }\n return new Promise(function (resolve) {\n var shouldUpdate = true;\n var onMessage = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n var data, tokenResult;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(!shouldUpdate || event.origin !== iframeUrl)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n _context.t0 = event.data.messageType;\n _context.next = _context.t0 === MessageType.GenerateTokenizeCardTokenRequest ? 5 : _context.t0 === MessageType.TokenizePaymentMethodResponse ? 10 : 23;\n break;\n case 5:\n if (!(isAlreadyTokenizing === true)) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"return\");\n case 7:\n isAlreadyTokenizing = true;\n serviceCollection.application.generateTokenizeCardToken(setAsDefault, callback).then(function (token) {\n if (shouldUpdate && token !== undefined) {\n var attemptTokenMessage = {\n messageType: MessageType.GenerateTokenizeCardTokenResponse,\n token: token\n };\n iframeWindow == null || iframeWindow.postMessage(attemptTokenMessage, iframeUrl);\n }\n })[\"catch\"](function () {\n if (shouldUpdate) {\n shouldUpdate = false;\n window.removeEventListener('message', onMessage);\n resolve(defaultResult);\n }\n })[\"finally\"](function () {\n isAlreadyTokenizing = false;\n });\n return _context.abrupt(\"break\", 23);\n case 10:\n if (!shouldUpdate) {\n _context.next = 22;\n break;\n }\n shouldUpdate = false;\n window.removeEventListener('message', onMessage);\n data = event.data;\n if (!(data.completedTokenizationAttempt && data.resultToken !== undefined)) {\n _context.next = 21;\n break;\n }\n _context.next = 17;\n return serviceCollection.application.validateTokenizeCardResultToken(data.resultToken);\n case 17:\n tokenResult = _context.sent;\n resolve(tokenResult);\n _context.next = 22;\n break;\n case 21:\n resolve(defaultResult);\n case 22:\n return _context.abrupt(\"break\", 23);\n case 23:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onMessage(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n window.addEventListener('message', onMessage);\n var message = {\n messageType: MessageType.TokenizePaymentMethodRequest\n };\n iframeWindow.postMessage(message, iframeUrl);\n setTimeout(function () {\n if (shouldUpdate) {\n isAlreadyTokenizing = false;\n shouldUpdate = false;\n window.removeEventListener('message', onMessage);\n resolve(defaultResult);\n }\n }, timeout || 60000);\n });\n };\n};\n\nvar isApplicableMessage = function isApplicableMessage(event, url, messageType) {\n return event.data.messageType === messageType && event.origin === url;\n};\nvar initializingEffect = function initializingEffect(status, serviceCollection, supportedMethods, selectedSupportedMethod, setUrl, setStatus) {\n if (status !== PaymentFormStatus.Initializing) {\n return;\n }\n var shouldUpdate = true;\n serviceCollection.generateRenderFormUrl(supportedMethods, selectedSupportedMethod).then(function (value) {\n if (shouldUpdate) {\n setStatus(PaymentFormStatus.Loading);\n setUrl(value);\n }\n })[\"catch\"](function () {\n if (shouldUpdate) {\n setStatus(PaymentFormStatus.Failed);\n }\n });\n return function () {\n shouldUpdate = false;\n };\n};\nvar loadingEffect = function loadingEffect(status, iframeRef, setStatus, setIframeWindow) {\n var _iframeRef$current;\n if (status !== PaymentFormStatus.Loading) {\n return;\n }\n var shouldUpdate = true;\n var timeoutInMilliseconds = 30000;\n function onLoad() {\n return _onLoad.apply(this, arguments);\n }\n function _onLoad() {\n _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var contentWindow;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (shouldUpdate) {\n contentWindow = this.contentWindow;\n if (contentWindow === null) {\n setStatus(PaymentFormStatus.Failed);\n } else {\n setStatus(PaymentFormStatus.PendingSync);\n setIframeWindow(contentWindow);\n }\n }\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n return _onLoad.apply(this, arguments);\n }\n (_iframeRef$current = iframeRef.current) == null || _iframeRef$current.addEventListener('load', onLoad);\n setTimeout(function () {\n if (shouldUpdate) {\n setStatus(PaymentFormStatus.Failed);\n }\n }, timeoutInMilliseconds);\n return function () {\n var _iframeRef$current2;\n shouldUpdate = false;\n (_iframeRef$current2 = iframeRef.current) == null || _iframeRef$current2.removeEventListener('load', onLoad);\n };\n};\nvar pendingSyncEffect = function pendingSyncEffect(status, iframeWindow, iframeUrl, styles, setStatus) {\n if (status !== PaymentFormStatus.PendingSync || iframeWindow === undefined || iframeUrl === undefined) {\n return;\n }\n var shouldUpdate = true;\n var timeoutInMilliseconds = 500;\n var onMessage = function onMessage(event) {\n if (shouldUpdate && isApplicableMessage(event, iframeUrl, MessageType.SyncResponse)) {\n shouldUpdate = false;\n setStatus(PaymentFormStatus.Loaded);\n }\n };\n window.addEventListener('message', onMessage);\n var message = {\n messageType: MessageType.SyncRequest,\n styles: styles\n };\n iframeWindow.postMessage(message, iframeUrl);\n setTimeout(function () {\n if (shouldUpdate) {\n setStatus(PaymentFormStatus.Failed);\n }\n }, timeoutInMilliseconds);\n return function () {\n shouldUpdate = false;\n window.removeEventListener('message', onMessage);\n };\n};\nvar loadedEffect = function loadedEffect(status, iframeWindow, iframeUrl, styles, setContentHeight) {\n if (status !== PaymentFormStatus.Loaded || iframeWindow === undefined || iframeUrl === undefined) {\n return;\n }\n var shouldUpdate = true;\n var message = {\n messageType: MessageType.SetStyles,\n styles: styles\n };\n iframeWindow.postMessage(message, iframeUrl);\n var onMessage = function onMessage(event) {\n if (shouldUpdate && isApplicableMessage(event, iframeUrl, MessageType.UpdateContentHeight)) {\n setContentHeight(event.data.height);\n }\n };\n window.addEventListener('message', onMessage);\n return function () {\n shouldUpdate = false;\n window.removeEventListener('message', onMessage);\n };\n};\nvar PaymentForm = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var title = _ref.title,\n supportedMethods = _ref.supportedMethods,\n defaultSelectedSupportedMethod = _ref.defaultSelectedSupportedMethod,\n serviceCollection = _ref.serviceCollection,\n containerStyle = _ref.containerStyle,\n contentStyles = _ref.contentStyles,\n children = _ref.children,\n setNewCardAsDefault = _ref.setNewCardAsDefault;\n var _useState = useState({\n status: PaymentFormStatus.Initializing\n }),\n context = _useState[0],\n setContext = _useState[1];\n var setStatus = useCallback(function (status) {\n if (status === context.status) {\n return;\n }\n var newContext = _extends({}, context);\n newContext.status = status;\n setContext(newContext);\n }, [context]);\n var isAlreadyTokenizing = false;\n var _useState2 = useState(0),\n contentHeight = _useState2[0],\n setContentHeight = _useState2[1];\n var _useState3 = useState(),\n url = _useState3[0],\n setUrl = _useState3[1];\n var _useState4 = useState(),\n iframeWindow = _useState4[0],\n setIframeWindow = _useState4[1];\n var _useState5 = useState(defaultSelectedSupportedMethod),\n selectedSupportedMethod = _useState5[0];\n var iframeRef = createRef();\n var iframeOrigin = (url == null ? void 0 : url.replace(/\\/\\?.*/, '')) || '';\n useEffect(function () {\n return initializingEffect(context.status, serviceCollection, supportedMethods, selectedSupportedMethod, setUrl, setStatus);\n }, [context.status, serviceCollection, supportedMethods, selectedSupportedMethod, setStatus]);\n useEffect(function () {\n return loadingEffect(context.status, iframeRef, setStatus, setIframeWindow);\n }, [context.status, iframeRef, setStatus]);\n useEffect(function () {\n return pendingSyncEffect(context.status, iframeWindow, iframeOrigin, contentStyles, setStatus);\n }, [context.status, iframeWindow, iframeOrigin, contentStyles, setStatus]);\n useEffect(function () {\n return loadedEffect(context.status, iframeWindow, iframeOrigin, contentStyles, setContentHeight);\n }, [context.status, iframeWindow, iframeOrigin, contentStyles, setContentHeight]);\n useImperativeHandle(ref, function () {\n return {\n tokenizePaymentMethod: tokenizePaymentMethod(serviceCollection, setNewCardAsDefault, isAlreadyTokenizing, iframeWindow, iframeOrigin),\n clearForm: function clearForm$1() {\n return clearForm(iframeWindow, iframeOrigin);\n }\n };\n }, [iframeWindow, iframeOrigin, serviceCollection, setNewCardAsDefault, isAlreadyTokenizing]);\n var localStyle = _extends({}, containerStyle);\n if (context.status !== PaymentFormStatus.Loaded) {\n localStyle.display = 'none';\n }\n if (contentHeight > 0) {\n localStyle.minHeight = contentHeight;\n }\n return React.createElement(PaymentFormContext.Provider, {\n value: context\n }, React.createElement(\"form\", {\n \"aria-label\": \"Payment form\"\n }, React.createElement(SecureFrame, {\n title: title,\n containerStyle: localStyle,\n url: url,\n ref: iframeRef\n })), children);\n});\n\nvar isContentStatus = function isContentStatus(contentStatuses, currentStatus) {\n return contentStatuses.includes(currentStatus);\n};\nvar PaymentFormContentContainer = function PaymentFormContentContainer(_ref) {\n var contentStatuses = _ref.contentStatuses,\n children = _ref.children;\n var context = useContext(PaymentFormContext);\n return isContentStatus(contentStatuses, context.status) ? React.createElement(React.Fragment, null, children) : React.createElement(React.Fragment, null);\n};\n\nvar contentStatuses = [PaymentFormStatus.Failed];\nvar PaymentFormLoadingFailedContentContainer = function PaymentFormLoadingFailedContentContainer(_ref) {\n var children = _ref.children;\n return React.createElement(PaymentFormContentContainer, {\n contentStatuses: contentStatuses\n }, children);\n};\n\nvar DefaultFailedAlert = function DefaultFailedAlert() {\n return React.createElement(PaymentFormLoadingFailedContentContainer, null, React.createElement(\"div\", null, React.createElement(\"p\", null, \"Failed to load payment form\")));\n};\n\nvar contentStatuses$1 = [PaymentFormStatus.Initializing, PaymentFormStatus.Loading, PaymentFormStatus.PendingSync];\nvar PaymentFormLoadingContentContainer = function PaymentFormLoadingContentContainer(_ref) {\n var children = _ref.children;\n return React.createElement(PaymentFormContentContainer, {\n contentStatuses: contentStatuses$1\n }, children);\n};\n\nvar DefaultLoadingAlert = function DefaultLoadingAlert() {\n return React.createElement(PaymentFormLoadingContentContainer, null, React.createElement(\"div\", null, React.createElement(\"p\", null, \"Loading...\")));\n};\n\nvar ServiceCollection = /*#__PURE__*/function () {\n function ServiceCollection(tokenizer, application) {\n this._tokenizer = tokenizer;\n this._application = application;\n }\n var _proto = ServiceCollection.prototype;\n _proto.generateRenderFormUrl = /*#__PURE__*/function () {\n var _generateRenderFormUrl = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(supportedMethods, selectedSupportedMethod) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this._tokenizer.generateRenderFormUrl(this._application, supportedMethods, selectedSupportedMethod);\n case 2:\n return _context.abrupt(\"return\", _context.sent);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function generateRenderFormUrl(_x, _x2) {\n return _generateRenderFormUrl.apply(this, arguments);\n }\n return generateRenderFormUrl;\n }();\n return _createClass(ServiceCollection, [{\n key: \"application\",\n get: function get() {\n return this._application;\n }\n }]);\n}();\n\nvar TokenizerService = /*#__PURE__*/function () {\n function TokenizerService(domain) {\n this._domain = domain;\n }\n var _proto = TokenizerService.prototype;\n _proto.generateRenderFormUrl = /*#__PURE__*/function () {\n var _generateRenderFormUrl = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(applicationService, supportedMethods, selectedSupportedMethod) {\n var token;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return applicationService.generateRenderFormToken(supportedMethods, selectedSupportedMethod);\n case 2:\n token = _context.sent;\n return _context.abrupt(\"return\", this._domain + \"/?token=\" + token);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function generateRenderFormUrl(_x, _x2, _x3) {\n return _generateRenderFormUrl.apply(this, arguments);\n }\n return generateRenderFormUrl;\n }();\n return TokenizerService;\n}();\n\nvar TokenType;\n(function (TokenType) {\n TokenType[TokenType[\"RenderForm\"] = 0] = \"RenderForm\";\n TokenType[TokenType[\"TokenizeCard\"] = 1] = \"TokenizeCard\";\n})(TokenType || (TokenType = {}));\n\nvar ApplicationService = /*#__PURE__*/function () {\n function ApplicationService(renderFormUrl, tokenizeCardUrl, validateResultUrl) {\n this._renderFormUrl = renderFormUrl;\n this._tokenizeCardUrl = tokenizeCardUrl;\n this._validateResultUrl = validateResultUrl;\n }\n var _proto = ApplicationService.prototype;\n _proto.generateTokenUrl = function generateTokenUrl(tokenType) {\n switch (tokenType) {\n case TokenType.RenderForm:\n return this._renderFormUrl;\n case TokenType.TokenizeCard:\n return this._tokenizeCardUrl;\n }\n };\n _proto.generateToken = /*#__PURE__*/function () {\n var _generateToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(tokenType, body) {\n var headers, response, token;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n headers = new Headers();\n headers.set('content-type', 'application/json');\n _context.next = 4;\n return fetch(this.generateTokenUrl(tokenType), {\n method: 'POST',\n body: JSON.stringify(body),\n headers: headers,\n credentials: 'include'\n });\n case 4:\n response = _context.sent;\n _context.t0 = response.status;\n _context.next = _context.t0 === 200 ? 8 : 14;\n break;\n case 8:\n _context.next = 10;\n return response.json();\n case 10:\n token = _context.sent;\n if (!(token.value === undefined)) {\n _context.next = 13;\n break;\n }\n throw new Error('Failed to generate token');\n case 13:\n return _context.abrupt(\"return\", token);\n case 14:\n throw new Error('Failed to generate token');\n case 15:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function generateToken(_x, _x2) {\n return _generateToken.apply(this, arguments);\n }\n return generateToken;\n }();\n _proto.generateRenderFormToken = /*#__PURE__*/function () {\n var _generateRenderFormToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(supportedMethods, selectedSupportedMethod) {\n var token;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.generateToken(TokenType.RenderForm, {\n supportedMethods: supportedMethods.map(function (paymentMethod) {\n return paymentMethod.toString().replace(/-/g, '');\n }),\n selectedSupportedMethod: selectedSupportedMethod.toString().replace(/-/g, '')\n });\n case 2:\n token = _context2.sent;\n return _context2.abrupt(\"return\", token.value);\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function generateRenderFormToken(_x3, _x4) {\n return _generateRenderFormToken.apply(this, arguments);\n }\n return generateRenderFormToken;\n }();\n _proto.generateTokenizeCardToken = /*#__PURE__*/function () {\n var _generateTokenizeCardToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(setAsDefault, callback) {\n var data, token;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n data = {\n setAsDefault: setAsDefault\n };\n callback(data);\n _context3.next = 4;\n return this.generateToken(TokenType.TokenizeCard, data);\n case 4:\n token = _context3.sent;\n return _context3.abrupt(\"return\", token);\n case 6:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function generateTokenizeCardToken(_x5, _x6) {\n return _generateTokenizeCardToken.apply(this, arguments);\n }\n return generateTokenizeCardToken;\n }();\n _proto.validateTokenizeCardResultToken = /*#__PURE__*/function () {\n var _validateTokenizeCardResultToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(token) {\n var headers, url, response, result;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n headers = new Headers();\n headers.set('content-type', 'application/json');\n url = this._validateResultUrl;\n _context4.next = 5;\n return fetch(url, {\n method: 'POST',\n body: JSON.stringify({\n token: token\n }),\n headers: headers,\n credentials: 'include'\n });\n case 5:\n response = _context4.sent;\n result = {\n isSuccessful: false,\n completedTokenizationAttempt: false,\n suggestVerifyInformation: false,\n isRewardsCard: false,\n tokenId: null,\n displayName: null,\n mask: null,\n type: null\n };\n if (!(response.status === 200)) {\n _context4.next = 12;\n break;\n }\n _context4.next = 10;\n return response.json();\n case 10:\n result = _context4.sent;\n result.completedTokenizationAttempt = true;\n case 12:\n return _context4.abrupt(\"return\", result);\n case 13:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function validateTokenizeCardResultToken(_x7) {\n return _validateTokenizeCardResultToken.apply(this, arguments);\n }\n return validateTokenizeCardResultToken;\n }();\n return ApplicationService;\n}();\n\nvar AuthorizeCreditKeyResult = function AuthorizeCreditKeyResult(statusCode, responseBody) {\n this.statusCode = statusCode;\n this.isSuccessful = statusCode === 200;\n this.responseBody = responseBody;\n if (this.isSuccessful) {\n this.creditKeyApplicationUrl = JSON.parse(responseBody).creditKeyApplicationUrl;\n } else {\n this.creditKeyApplicationUrl = null;\n }\n};\n\nvar PaymentMethodType;\n(function (PaymentMethodType) {\n PaymentMethodType[\"AmericanExpress\"] = \"AmericanExpress\";\n PaymentMethodType[\"Visa\"] = \"Visa\";\n PaymentMethodType[\"Mastercard\"] = \"Mastercard\";\n PaymentMethodType[\"Discover\"] = \"Discover\";\n PaymentMethodType[\"BlueTarp\"] = \"Bluetarp\";\n PaymentMethodType[\"ApplePay\"] = \"ApplePay\";\n PaymentMethodType[\"GooglePay\"] = \"GooglePay\";\n PaymentMethodType[\"CreditKey\"] = \"CreditKey\";\n})(PaymentMethodType || (PaymentMethodType = {}));\n\nvar PaymentMethodResult = function PaymentMethodResult(statusCode, responseBody) {\n this.statusCode = statusCode;\n this.isSuccessful = statusCode === 200;\n this.responseBody = responseBody;\n if (this.isSuccessful) {\n this.paymentMethods = JSON.parse(responseBody).paymentMethods;\n } else {\n this.paymentMethods = new Array();\n }\n this.isCreditKeyEnabled = this.paymentMethods.some(function (e) {\n return e.paymentMethodType === PaymentMethodType.CreditKey;\n });\n};\n\nvar PaymentService = /*#__PURE__*/function () {\n function PaymentService(domain) {\n this._domain = domain;\n }\n var _proto = PaymentService.prototype;\n _proto.sendSignedRequest = /*#__PURE__*/function () {\n var _sendSignedRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, path) {\n var headers, url, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n headers = new Headers();\n headers.set('Content-Type', 'application/json');\n headers.set('Clark-Division', request.division);\n headers.set('Authorization', 'Serial ' + request.serialNumber);\n headers.set('Clark-Content-Signature', request.signature);\n headers.set('Clark-Content-Date', request.timestamp);\n url = \"\" + this._domain + path;\n _context.next = 9;\n return fetch(url, {\n method: 'POST',\n body: request.requestBody,\n headers: headers,\n credentials: 'omit'\n });\n case 9:\n response = _context.sent;\n return _context.abrupt(\"return\", response);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function sendSignedRequest(_x, _x2) {\n return _sendSignedRequest.apply(this, arguments);\n }\n return sendSignedRequest;\n }();\n _proto.getAvailablePaymentMethods = /*#__PURE__*/function () {\n var _getAvailablePaymentMethods = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {\n var response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.sendSignedRequest(request, '/v2/Customer/getavailablepaymentmethods');\n case 2:\n response = _context2.sent;\n _context2.t0 = response.status;\n _context2.next = _context2.t0 === 200 ? 6 : 12;\n break;\n case 6:\n _context2.t1 = PaymentMethodResult;\n _context2.t2 = response.status;\n _context2.next = 10;\n return response.text();\n case 10:\n _context2.t3 = _context2.sent;\n return _context2.abrupt(\"return\", new _context2.t1(_context2.t2, _context2.t3));\n case 12:\n return _context2.abrupt(\"return\", new PaymentMethodResult(response.status, response.statusText));\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getAvailablePaymentMethods(_x3) {\n return _getAvailablePaymentMethods.apply(this, arguments);\n }\n return getAvailablePaymentMethods;\n }();\n _proto.authorizeCreditKeyPayment = /*#__PURE__*/function () {\n var _authorizeCreditKeyPayment = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {\n var response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.sendSignedRequest(request, '/v2/order/authorize/creditkey');\n case 2:\n response = _context3.sent;\n _context3.t0 = response.status;\n _context3.next = _context3.t0 === 200 ? 6 : 12;\n break;\n case 6:\n _context3.t1 = AuthorizeCreditKeyResult;\n _context3.t2 = response.status;\n _context3.next = 10;\n return response.text();\n case 10:\n _context3.t3 = _context3.sent;\n return _context3.abrupt(\"return\", new _context3.t1(_context3.t2, _context3.t3));\n case 12:\n return _context3.abrupt(\"return\", new AuthorizeCreditKeyResult(response.status, response.statusText));\n case 13:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function authorizeCreditKeyPayment(_x4) {\n return _authorizeCreditKeyPayment.apply(this, arguments);\n }\n return authorizeCreditKeyPayment;\n }();\n return PaymentService;\n}();\n\nvar PaymentMethod;\n(function (PaymentMethod) {\n PaymentMethod[\"BasicCard\"] = \"basic-card\";\n PaymentMethod[\"SavedCard\"] = \"saved-card\";\n PaymentMethod[\"BlueTarp\"] = \"bluetarp\";\n PaymentMethod[\"ApplePay\"] = \"apple-pay\";\n PaymentMethod[\"GooglePay\"] = \"google-pay\";\n PaymentMethod[\"CreditKey\"] = \"credit-key\";\n})(PaymentMethod || (PaymentMethod = {}));\n\nvar generateEmptyBasicStyles = function generateEmptyBasicStyles() {\n var styles = {\n container: {\n style: {},\n cardNumberContainer: {\n style: {},\n iconContainer: {\n style: {},\n visa: {\n style: {}\n },\n discover: {\n style: {}\n },\n americanExpress: {\n style: {}\n },\n mastercard: {\n style: {}\n }\n },\n inputContainer: {\n defaultStyle: {},\n errorStyle: {},\n input: {\n defaultStyle: {},\n errorStyle: {}\n },\n label: {\n defaultStyle: {},\n errorStyle: {}\n }\n },\n error: {\n style: {}\n }\n },\n verificationDetailsContainer: {\n style: {},\n expiryYearContainer: {\n style: {},\n inputContainer: {\n defaultStyle: {},\n errorStyle: {},\n input: {\n defaultStyle: {},\n errorStyle: {}\n },\n label: {\n defaultStyle: {},\n errorStyle: {}\n },\n icon: {\n defaultStyle: {},\n errorStyle: {}\n }\n },\n error: {\n style: {}\n }\n },\n expiryMonthContainer: {\n style: {},\n inputContainer: {\n defaultStyle: {},\n errorStyle: {},\n input: {\n defaultStyle: {},\n errorStyle: {}\n },\n label: {\n defaultStyle: {},\n errorStyle: {}\n },\n icon: {\n defaultStyle: {},\n errorStyle: {}\n }\n },\n error: {\n style: {}\n }\n },\n cardSecurityCodeContainer: {\n style: {},\n inputContainer: {\n defaultStyle: {},\n errorStyle: {},\n input: {\n defaultStyle: {},\n errorStyle: {}\n },\n label: {\n defaultStyle: {},\n errorStyle: {}\n },\n tipIcon: {\n defaultStyle: {},\n errorStyle: {}\n }\n },\n error: {\n style: {}\n }\n }\n }\n }\n };\n return styles;\n};\n\nvar generateEmptyRenderFormStyles = function generateEmptyRenderFormStyles() {\n var styles = {\n basicCard: generateEmptyBasicStyles()\n };\n return styles;\n};\n\nvar SignedRequest = function SignedRequest(timestamp, requestBody, signature, division, serialNumber) {\n this.timestamp = timestamp;\n this.requestBody = requestBody;\n this.signature = signature;\n this.division = division;\n this.serialNumber = serialNumber;\n};\n\nvar State;\n(function (State) {\n State[State[\"LoadingSecureForm\"] = 0] = \"LoadingSecureForm\";\n State[State[\"Tokenizing\"] = 1] = \"Tokenizing\";\n State[State[\"Loaded\"] = 2] = \"Loaded\";\n State[State[\"Error\"] = 3] = \"Error\";\n})(State || (State = {}));\nvar PaymentContext = /*#__PURE__*/React.createContext({\n state: State.LoadingSecureForm,\n paymentServerFrameWindow: null,\n authorizePromise: undefined,\n authorizePayment: function authorizePayment() {\n return new Promise(function (resolve) {\n var defaultAuthorizeResult = {\n isInputValid: false,\n completedAuthorizeRequest: false,\n authorizeRequestId: undefined\n };\n resolve(defaultAuthorizeResult);\n });\n },\n setState: function setState() {},\n setPaymentServerFrameWindow: function setPaymentServerFrameWindow() {},\n logError: function logError() {}\n});\nvar PaymentProvider = function PaymentProvider(props) {\n var _useState = useState({\n state: State.LoadingSecureForm,\n paymentServerFrameWindow: null,\n authorizePromise: undefined\n }),\n paymentFormState = _useState[0],\n setPaymentFormState = _useState[1];\n var defaultOnError = function defaultOnError(type, event) {\n console.debug(\"Error: \" + type);\n console.debug(event);\n };\n var authorizePayment = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(signedData, timeoutInMilliseconds) {\n var validStates, tokenizeMessage, authorizePromise, response, defaultAuthorizeResult;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n validStates = [State.Loaded, State.Tokenizing];\n if (validStates.includes(paymentFormState.state)) {\n _context.next = 5;\n break;\n }\n logError('AuthorizePaymentNotReady', {\n message: 'Authorize called while not in Loaded or Tokenizing state',\n context: paymentFormState\n });\n _context.next = 24;\n break;\n case 5:\n if (!(paymentFormState.paymentServerFrameWindow === null)) {\n _context.next = 9;\n break;\n }\n logError('AuthorizePaymentNotReady', {\n message: 'Payment Iframe not set',\n context: paymentFormState\n });\n _context.next = 24;\n break;\n case 9:\n tokenizeMessage = {\n messageType: MessageType.AuthorizePaymentMethodRequest,\n signedData: signedData\n };\n authorizePromise = paymentFormState.authorizePromise || paymentFormState.paymentServerFrameWindow.sendMessage(MessageType.AuthorizePaymentMethodResponse, tokenizeMessage, timeoutInMilliseconds);\n setPaymentFormState(_extends({}, paymentFormState, {\n state: State.Tokenizing,\n authorizePromise: authorizePromise\n }));\n _context.prev = 12;\n _context.next = 15;\n return authorizePromise;\n case 15:\n response = _context.sent;\n defaultAuthorizeResult = {\n isInputValid: response.isInputValid,\n completedAuthorizeRequest: response.completedAuthorizeRequest,\n authorizeRequestId: response.authorizeRequestId\n };\n setPaymentFormState(function (currentState) {\n return _extends({}, currentState, {\n state: State.Loaded,\n authorizePromise: undefined\n });\n });\n return _context.abrupt(\"return\", defaultAuthorizeResult);\n case 21:\n _context.prev = 21;\n _context.t0 = _context[\"catch\"](12);\n logError('AuthorizePaymentException', {\n message: 'An unexpected exception was thrown during authorization',\n context: _context.t0\n });\n case 24:\n return _context.abrupt(\"return\", {\n isInputValid: false,\n completedAuthorizeRequest: false,\n authorizeRequestId: undefined\n });\n case 25:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[12, 21]]);\n }));\n return function authorizePayment(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n var logError = function logError(type, event) {\n var _props$onError;\n ((_props$onError = props.onError) != null ? _props$onError : defaultOnError)(type, event);\n if (paymentFormState.state === State.LoadingSecureForm) {\n setPaymentFormState(_extends({}, paymentFormState, {\n state: State.Error\n }));\n }\n };\n var paymentFormContext = _extends({}, paymentFormState, {\n setState: function setState(state) {\n return setPaymentFormState(_extends({}, paymentFormState, {\n state: state\n }));\n },\n authorizePayment: authorizePayment,\n setPaymentServerFrameWindow: function setPaymentServerFrameWindow(paymentServerFrameWindow) {\n return setPaymentFormState(_extends({}, paymentFormState, {\n paymentServerFrameWindow: paymentServerFrameWindow,\n state: State.Loaded\n }));\n },\n logError: logError\n });\n return React.createElement(PaymentContext.Provider, {\n value: paymentFormContext\n }, props.children);\n};\n\nfunction sendMessage(responseMessageType, message, timeoutInMilliseconds) {\n var iframeWindow = this;\n return new Promise(function (resolve, reject) {\n var onMessageReceived = function onMessageReceived(event) {\n clearTimeout(timeout);\n if (event.data.messageType === responseMessageType) {\n resolve(event.data);\n }\n };\n var timeout = setTimeout(function () {\n window.removeEventListener('message', onMessageReceived);\n reject(\"Timed out after \" + timeoutInMilliseconds + \" milliseconds\");\n }, timeoutInMilliseconds);\n window.addEventListener('message', onMessageReceived);\n iframeWindow.window.postMessage(message, iframeWindow.origin);\n });\n}\nvar convertWindowToCommunciationWindow = /*#__PURE__*/function () {\n var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iframeWindow, styles, origin) {\n var paymentServerFrameWindow, syncMessage, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n paymentServerFrameWindow = {\n window: iframeWindow,\n communicationSourceId: Date.now().toString(),\n communicationTargetId: undefined,\n sendMessage: sendMessage,\n origin: origin != null ? origin : ''\n };\n syncMessage = {\n messageType: MessageType.SyncRequest,\n styles: styles,\n sourceWindowId: paymentServerFrameWindow.communicationSourceId\n };\n _context.next = 4;\n return paymentServerFrameWindow.sendMessage(MessageType.SyncResponse, syncMessage, 3000);\n case 4:\n response = _context.sent;\n paymentServerFrameWindow.communicationTargetId = response.targetWindowId;\n return _context.abrupt(\"return\", paymentServerFrameWindow);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function convertWindowToCommunciationWindow(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n\nvar PaymentServerFrame = function PaymentServerFrame(_ref) {\n var title = _ref.title,\n containerStyles = _ref.containerStyles,\n formStyles = _ref.formStyles,\n url = _ref.url,\n hideIframe = _ref.hideIframe;\n var _useContext = useContext(PaymentContext),\n setPaymentServerFrameWindow = _useContext.setPaymentServerFrameWindow,\n logError = _useContext.logError;\n var _useState = useState(null),\n contentHeight = _useState[0],\n setContentHeight = _useState[1];\n var onLoad = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n var paymentServerFrameWindow;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(event.currentTarget.contentWindow !== null)) {\n _context.next = 13;\n break;\n }\n _context.prev = 1;\n _context.next = 4;\n return convertWindowToCommunciationWindow(event.currentTarget.contentWindow, formStyles || generateEmptyRenderFormStyles(), event.currentTarget.getAttribute('src'));\n case 4:\n paymentServerFrameWindow = _context.sent;\n setPaymentServerFrameWindow(paymentServerFrameWindow);\n _context.next = 11;\n break;\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](1);\n logError('PaymentServerFrameSyncException', {\n message: 'An unexpected exception was thrown while trying to sync the Payment Iframe',\n context: _context.t0\n });\n case 11:\n _context.next = 14;\n break;\n case 13:\n logError('PaymentServerFrameOnLoadException', {\n message: 'On load called without a content window',\n context: event\n });\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[1, 8]]);\n }));\n return function onLoad(_x) {\n return _ref2.apply(this, arguments);\n };\n }();\n var listenForContentHeightEffect = function listenForContentHeightEffect(setContentHeight) {\n var onMessage = function onMessage(event) {\n if (event.data.messageType === MessageType.UpdateContentHeight) {\n setContentHeight(event.data.height);\n }\n };\n window.addEventListener('message', onMessage);\n return function () {\n window.removeEventListener('message', onMessage);\n };\n };\n useEffect(function () {\n return listenForContentHeightEffect(setContentHeight);\n }, [setContentHeight]);\n var onError = function onError(event) {\n logError('PaymentServerFrameOnError', {\n message: 'An unexpected exception was thrown by the Payment Iframe',\n context: event\n });\n };\n var updatedStyles = containerStyles ? _extends({}, containerStyles) : {};\n updatedStyles.height = contentHeight || updatedStyles.height;\n if (hideIframe) {\n updatedStyles.display = 'none';\n }\n return React.createElement(\"iframe\", {\n title: title,\n src: url,\n style: updatedStyles,\n onLoad: onLoad,\n onError: onError\n });\n};\nvar BasicCardForm = function BasicCardForm(_ref3) {\n var title = _ref3.title,\n containerStyles = _ref3.containerStyles,\n paymentServerDomain = _ref3.paymentServerDomain,\n hideIframe = _ref3.hideIframe;\n return React.createElement(PaymentServerFrame, {\n title: title,\n containerStyles: containerStyles,\n url: \"https://\" + paymentServerDomain + \"/form\",\n hideIframe: hideIframe\n });\n};\n\nvar ApplePayService = /*#__PURE__*/function () {\n function ApplePayService(configuration) {\n this._configuration = configuration;\n }\n var _proto = ApplePayService.prototype;\n _proto.createApplePaySession = /*#__PURE__*/function () {\n var _createApplePaySession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(validationUrl, origin) {\n var requestData, response, json;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n requestData = {\n validationUrl: validationUrl,\n initiativeContext: origin\n };\n _context.next = 3;\n return fetch(this._configuration.tokenizerDomain + \"/ApplePay/session/\", {\n method: 'POST',\n mode: 'cors',\n headers: {\n 'Content-Type': 'application/json',\n 'Clark-Division': this._configuration.divisionName\n },\n body: JSON.stringify(requestData)\n });\n case 3:\n response = _context.sent;\n _context.next = 6;\n return response.json();\n case 6:\n json = _context.sent;\n return _context.abrupt(\"return\", json);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function createApplePaySession(_x, _x2) {\n return _createApplePaySession.apply(this, arguments);\n }\n return createApplePaySession;\n }();\n _proto.generateCheckoutSession = /*#__PURE__*/function () {\n var _generateCheckoutSession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this._configuration.generateCheckoutContext());\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function generateCheckoutSession() {\n return _generateCheckoutSession.apply(this, arguments);\n }\n return generateCheckoutSession;\n }();\n _proto.checkout = /*#__PURE__*/function () {\n var _checkout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(token, payment) {\n var response, json;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return fetch(this._configuration.tokenizerDomain + \"/ApplePay/checkout\", {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: \"Bearer \" + token.value\n },\n body: JSON.stringify({\n token: payment.token\n })\n });\n case 2:\n response = _context3.sent;\n _context3.next = 5;\n return response.json();\n case 5:\n json = _context3.sent;\n return _context3.abrupt(\"return\", json);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function checkout(_x3, _x4) {\n return _checkout.apply(this, arguments);\n }\n return checkout;\n }();\n _proto.getTransactionTotal = function getTransactionTotal(paymentDisplay) {\n return {\n label: paymentDisplay.label,\n amount: paymentDisplay.total.toString()\n };\n };\n _proto.getTransactionCharges = function getTransactionCharges(paymentDisplay) {\n var charges = [];\n this.pushCharge(charges, 'Subtotal', paymentDisplay.subtotal);\n this.pushCharge(charges, 'Tax', paymentDisplay.tax);\n this.pushCharge(charges, 'Shipping', paymentDisplay.shipping);\n this.pushCharge(charges, 'Duty', paymentDisplay.duty);\n this.pushCharge(charges, 'Discount', paymentDisplay.discount);\n return charges;\n };\n _proto.pushCharge = function pushCharge(charges, name, amount) {\n if (amount === 0) {\n return;\n }\n charges.push({\n label: name,\n amount: amount.toString()\n });\n };\n return ApplePayService;\n}();\n\nfunction IsApplePayAvailableEffect(setIsApplePayAvailable) {\n useEffect(function () {\n var script = loadSrcScript();\n script.onload = function () {\n if (typeof ApplePaySession === 'undefined') {\n return;\n }\n var canMakePayments = ApplePaySession.canMakePayments();\n setIsApplePayAvailable(canMakePayments);\n };\n return function () {\n document.body.removeChild(script);\n };\n });\n}\nfunction LoadApplePayJavaScriptEffect(onLoad) {\n useEffect(function () {\n var script = loadSrcScript();\n script.onload = onLoad;\n return function () {\n document.body.removeChild(script);\n };\n });\n}\nfunction ConfigureApplePayWebsiteIcon(websiteIconSrc) {\n useEffect(function () {\n var linkElement = document.createElement('link');\n linkElement.rel = 'apple-touch-icon';\n linkElement.href = websiteIconSrc;\n document.head.appendChild(linkElement);\n return function () {\n document.head.removeChild(linkElement);\n };\n });\n}\nvar loadSrcScript = function loadSrcScript() {\n var applePayJsSrc = 'https://applepay.cdn-apple.com/jsapi/v1.1.0/apple-pay-sdk.js';\n var script = document.createElement('script');\n script.async = true;\n script.src = applePayJsSrc;\n document.body.appendChild(script);\n return script;\n};\n\nfunction ApplePayButton(props) {\n var _props$styles, _props$styles2, _props$styles3, _props$styles$buttonT, _props$styles4, _props$styles$color$t, _props$styles5;\n var applePayButtonId = 'apple-pay-button';\n var setApplePayButtonClick = function setApplePayButtonClick() {\n var applePayButton = document.getElementById(applePayButtonId);\n if (applePayButton) {\n applePayButton.onclick = onApplePayButtonClicked;\n }\n };\n LoadApplePayJavaScriptEffect(setApplePayButtonClick);\n if (props.websiteIconSrc) {\n ConfigureApplePayWebsiteIcon(props.websiteIconSrc);\n }\n var numberToPixels = function numberToPixels(value, defaultValue) {\n return value === undefined ? defaultValue : value + \"px\";\n };\n var styles = {\n '--apple-pay-button-width': (_props$styles = props.styles) == null ? void 0 : _props$styles.width,\n '--apple-pay-button-height': (_props$styles2 = props.styles) == null ? void 0 : _props$styles2.height,\n '--apple-pay-button-border-radius': numberToPixels((_props$styles3 = props.styles) == null ? void 0 : _props$styles3.borderRadiusPixels, '5px'),\n '--apple-pay-button-padding': '5px 0px'\n };\n var buttonType = (_props$styles$buttonT = (_props$styles4 = props.styles) == null || (_props$styles4 = _props$styles4.buttonType) == null ? void 0 : _props$styles4.toString()) != null ? _props$styles$buttonT : 'check-out';\n var color = (_props$styles$color$t = (_props$styles5 = props.styles) == null || (_props$styles5 = _props$styles5.color) == null ? void 0 : _props$styles5.toString()) != null ? _props$styles$color$t : 'black';\n var onApplePayButtonClicked = function onApplePayButtonClicked() {\n if (!ApplePaySession || props.enableApplePayButton && !props.enableApplePayButton()) {\n return;\n }\n var applePayService = new ApplePayService(props.configuration);\n var request = {\n countryCode: 'US',\n currencyCode: 'USD',\n merchantCapabilities: ['supports3DS'],\n supportedNetworks: ['visa', 'masterCard', 'amex', 'discover'],\n lineItems: applePayService.getTransactionCharges(props.paymentDisplay),\n total: applePayService.getTransactionTotal(props.paymentDisplay)\n };\n var session = new ApplePaySession(3, request);\n session.onvalidatemerchant = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n var merchantSession;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return applePayService.createApplePaySession(event.validationURL, window.location.hostname);\n case 2:\n merchantSession = _context.sent;\n session.completeMerchantValidation(merchantSession);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n session.onpaymentmethodselected = function (_) {\n var update = {\n newTotal: applePayService.getTransactionTotal(props.paymentDisplay),\n newLineItems: applePayService.getTransactionCharges(props.paymentDisplay)\n };\n session.completePaymentMethodSelection(update);\n };\n session.onpaymentauthorized = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {\n var status, checkoutSessionToken, checkoutResult, result;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n status = ApplePaySession.STATUS_SUCCESS;\n _context2.prev = 1;\n _context2.next = 4;\n return applePayService.generateCheckoutSession();\n case 4:\n checkoutSessionToken = _context2.sent;\n _context2.next = 7;\n return applePayService.checkout(checkoutSessionToken, event.payment);\n case 7:\n checkoutResult = _context2.sent;\n props.onCheckoutCompleted(checkoutResult);\n if (!checkoutResult.isApproved) {\n status = ApplePaySession.STATUS_FAILURE;\n }\n _context2.next = 15;\n break;\n case 12:\n _context2.prev = 12;\n _context2.t0 = _context2[\"catch\"](1);\n status = ApplePaySession.STATUS_FAILURE;\n case 15:\n result = {\n status: status\n };\n session.completePayment(result);\n case 17:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[1, 12]]);\n }));\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n session.oncancel = function (_) {};\n session.begin();\n };\n return React.createElement(\"apple-pay-button\", {\n id: applePayButtonId,\n style: styles,\n buttonstyle: color,\n type: buttonType,\n locale: \"en-US\"\n });\n}\n\nvar ApplePayButtonType;\n(function (ApplePayButtonType) {\n ApplePayButtonType[\"Checkout\"] = \"check-out\";\n ApplePayButtonType[\"Continue\"] = \"continue\";\n ApplePayButtonType[\"Donate\"] = \"donate\";\n ApplePayButtonType[\"Order\"] = \"order\";\n ApplePayButtonType[\"Pay\"] = \"pay\";\n ApplePayButtonType[\"Plain\"] = \"plain\";\n ApplePayButtonType[\"Subscribe\"] = \"subscribe\";\n})(ApplePayButtonType || (ApplePayButtonType = {}));\n\nvar ApplePayButtonColor;\n(function (ApplePayButtonColor) {\n ApplePayButtonColor[\"Black\"] = \"black\";\n ApplePayButtonColor[\"White\"] = \"white\";\n ApplePayButtonColor[\"WhiteOutline\"] = \"white-outline\";\n})(ApplePayButtonColor || (ApplePayButtonColor = {}));\n\nexport default PaymentForm;\nexport { ApplePayButton, ApplePayButtonColor, ApplePayButtonType, ApplicationService, AuthorizeCreditKeyResult, BasicCardForm, DefaultFailedAlert, DefaultLoadingAlert, IsApplePayAvailableEffect, PaymentContext, State as PaymentContextState, PaymentFormContentContainer, PaymentFormContext, PaymentFormLoadingContentContainer, PaymentFormLoadingFailedContentContainer, PaymentFormStatus, PaymentMethod, PaymentMethodResult, PaymentMethodType, PaymentProvider, PaymentService, PaymentMethodType as PaymentType, ServiceCollection, SignedRequest, TokenizerService, generateEmptyRenderFormStyles };\n//# sourceMappingURL=payment-client.esm.js.map\n"],"names":["MessageType","_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","delegateYield","_toPropertyKey","toPrimitive","String","Number","_toPrimitive","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_defineProperties","target","props","descriptor","_extends","assign","bind","source","PaymentFormStatus","SecureFrame","_ref","ref","title","containerStyle","url","style","display","src","TokenType","PaymentFormContext","createContext","status","Initializing","tokenizePaymentMethod","serviceCollection","setAsDefault","isAlreadyTokenizing","iframeWindow","iframeUrl","defaultResult","isSuccessful","completedTokenizationAttempt","suggestVerifyInformation","isRewardsCard","tokenId","mask","timeout","callback","_","shouldUpdate","onMessage","_callee","event","data","tokenResult","_context","origin","t0","messageType","GenerateTokenizeCardTokenRequest","TokenizePaymentMethodResponse","application","generateTokenizeCardToken","token","attemptTokenMessage","GenerateTokenizeCardTokenResponse","postMessage","window","removeEventListener","resultToken","validateTokenizeCardResultToken","_x","addEventListener","message","TokenizePaymentMethodRequest","setTimeout","isApplicableMessage","PaymentForm","supportedMethods","defaultSelectedSupportedMethod","contentStyles","children","setNewCardAsDefault","_useState","useState","context","setContext","setStatus","useCallback","newContext","_useState2","contentHeight","setContentHeight","_useState3","setUrl","_useState4","setIframeWindow","selectedSupportedMethod","iframeRef","createRef","iframeOrigin","replace","useEffect","generateRenderFormUrl","Loading","Failed","initializingEffect","_iframeRef$current","current","onLoad","_iframeRef$current2","_onLoad","contentWindow","PendingSync","loadingEffect","styles","SyncResponse","Loaded","SyncRequest","pendingSyncEffect","SetStyles","UpdateContentHeight","height","loadedEffect","useImperativeHandle","clearForm","ClearForm","localStyle","minHeight","Provider","PaymentFormContentContainer","contentStatuses","currentStatus","includes","isContentStatus","useContext","PaymentFormLoadingFailedContentContainer","DefaultFailedAlert","contentStatuses$1","PaymentFormLoadingContentContainer","DefaultLoadingAlert","ServiceCollection","tokenizer","_tokenizer","_application","Constructor","protoProps","staticProps","_generateRenderFormUrl","_x2","get","TokenizerService","domain","_domain","applicationService","generateRenderFormToken","_x3","PaymentMethodType","ApplicationService","renderFormUrl","tokenizeCardUrl","validateResultUrl","_renderFormUrl","_tokenizeCardUrl","_validateResultUrl","_proto","generateTokenUrl","tokenType","RenderForm","TokenizeCard","generateToken","_generateToken","body","headers","response","Headers","set","fetch","JSON","stringify","credentials","json","_generateRenderFormToken","_callee2","_context2","map","paymentMethod","toString","_x4","_generateTokenizeCardToken","_callee3","_context3","_x5","_x6","_validateTokenizeCardResultToken","_callee4","result","_context4","_x7","AuthorizeCreditKeyResult","statusCode","responseBody","creditKeyApplicationUrl","parse","PaymentMethod","PaymentMethodResult","paymentMethods","Array","isCreditKeyEnabled","some","paymentMethodType","CreditKey","PaymentService","sendSignedRequest","_sendSignedRequest","request","path","division","serialNumber","signature","timestamp","requestBody","getAvailablePaymentMethods","_getAvailablePaymentMethods","t1","t2","text","t3","statusText","authorizeCreditKeyPayment","_authorizeCreditKeyPayment","State","generateEmptyRenderFormStyles","basicCard","container","cardNumberContainer","iconContainer","visa","discover","americanExpress","mastercard","inputContainer","defaultStyle","errorStyle","input","label","verificationDetailsContainer","expiryYearContainer","icon","expiryMonthContainer","cardSecurityCodeContainer","tipIcon","SignedRequest","PaymentContext","state","LoadingSecureForm","paymentServerFrameWindow","authorizePromise","authorizePayment","isInputValid","completedAuthorizeRequest","authorizeRequestId","setState","setPaymentServerFrameWindow","logError","PaymentProvider","paymentFormState","setPaymentFormState","defaultOnError","console","debug","signedData","timeoutInMilliseconds","tokenizeMessage","defaultAuthorizeResult","Tokenizing","AuthorizePaymentMethodRequest","sendMessage","AuthorizePaymentMethodResponse","currentState","_props$onError","onError","paymentFormContext","responseMessageType","onMessageReceived","clearTimeout","convertWindowToCommunciationWindow","syncMessage","communicationSourceId","Date","now","communicationTargetId","sourceWindowId","targetWindowId","PaymentServerFrame","containerStyles","formStyles","hideIframe","_useContext","_ref2","currentTarget","getAttribute","listenForContentHeightEffect","updatedStyles","BasicCardForm","_ref3","paymentServerDomain","ApplePayService","configuration","_configuration","createApplePaySession","_createApplePaySession","validationUrl","requestData","initiativeContext","tokenizerDomain","mode","divisionName","generateCheckoutSession","_generateCheckoutSession","generateCheckoutContext","checkout","_checkout","payment","Authorization","getTransactionTotal","paymentDisplay","amount","total","getTransactionCharges","charges","pushCharge","subtotal","tax","shipping","duty","discount","IsApplePayAvailableEffect","setIsApplePayAvailable","script","loadSrcScript","onload","ApplePaySession","canMakePayments","document","removeChild","ApplePayButtonType","ApplePayButtonColor","createElement","appendChild","ApplePayButton","_props$styles","_props$styles2","_props$styles3","_props$styles$buttonT","_props$styles4","_props$styles$color$t","_props$styles5","websiteIconSrc","applePayButtonId","applePayButton","getElementById","onclick","onApplePayButtonClicked","linkElement","rel","href","head","defaultValue","width","borderRadiusPixels","buttonType","color","enableApplePayButton","applePayService","countryCode","currencyCode","merchantCapabilities","supportedNetworks","lineItems","session","onvalidatemerchant","merchantSession","validationURL","location","hostname","completeMerchantValidation","onpaymentmethodselected","update","newTotal","newLineItems","completePaymentMethodSelection","onpaymentauthorized","checkoutSessionToken","checkoutResult","STATUS_SUCCESS","onCheckoutCompleted","isApproved","STATUS_FAILURE","completePayment","oncancel","begin","id","buttonstyle","locale"],"sourceRoot":""}