var StripeTerminal;StripeTerminal=function(){var e={2362:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,f(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,e)})(e)}function u(e,t,n){return(u=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&l(o,n.prototype),o}).apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.r(t),n.d(t,{ConnectionStatus:function(){return Gn},DEFAULT_DISCOVERY_CONFIG:function(){return Br},OutputLogLevel:function(){return Ri},PaymentStatus:function(){return Yn},RpcEndpoint:function(){return ze},SIMULATED_ID:function(){return Yr},SIMULATED_LABEL:function(){return Gr},SIMULATED_READER:function(){return Hr},Terminal:function(){return Pr},TerminalFactory:function(){return cc},create:function(){return ac}}),n(5666),n(4916),n(5306),n(9600),n(1249),n(3123),n(7042),n(1539),n(9714),n(2222),n(8674),n(6699),n(2023),n(4747),n(8309),n(7941),n(2526),n(7327),n(5003),n(9337),n(1817),n(2165),n(6992),n(8783),n(3948),n(489),n(2772),n(2419),n(1532);var p,h,d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(p,e);var t,n,r,a,u=(t=p,n=s(),function(){var e,r=f(t);if(n){var o=f(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return i(this,e)});function p(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),(t=u.call(this,e.message)).error=e,Object.setPrototypeOf(c(t),p.prototype),t}return r=p,(a=[{key:"toErrorResponse",value:function(){return{error:this.error}}}])&&o(r.prototype,a),p}(a(Error));function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.NO_ESTABLISHED_CONNECTION="no_established_connection",e.LIVE_PAYMENT_OVER_NON_SSL="live_payment_over_non_ssl",e.UNSUPPORTED_ENV="unsupported_env",e.INVALID_READER_SHAPE="invalid_reader_shape",e.INVALID_PAYMENT_INTENT_CLIENT_SECRET="invalid_payment_intent_client_secret",e.INVALID_SETUP_INTENT_CLIENT_SECRET="invalid_setup_intent_client_secret",e.INVALID_PAYMENT_INTENT_INPUT_SHAPE="invalid_payment_intent_input_shape",e.INVALID_SETUP_INTENT_INPUT_SHAPE="invalid_setup_intent_input_shape",e.INVALID_CHARGE_ID_INPUT_SHAPE="invalid_charge_id_input_shape",e.INVALID_PAYMENT_INTENT_ID_INPUT_SHAPE="invalid_payment_intent_id_input_shape",e.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT="no_active_collect_payment_method_attempt",e.CANCELED="canceled",e.CANCELED_BY_CUSTOMER="canceled_by_customer",e.CANCELABLE_ALREADY_COMPLETED="cancelable_already_completed",e.CANCELABLE_ALREADY_CANCELED="cancelable_already_canceled",e.NETWORK_ERROR="network_error",e.NETWORK_TIMEOUT="network_timeout",e.READER_CONNECTION_ERROR="reader_connection_error",e.INTERNET_CONNECTION_UNAVAILABLE="internet_connection_unavailable",e.ALREADY_CONNECTED="already_connected",e.AUTHENTICATION_ERROR="authentication_error",e.INVALID_CONNECTION_TOKEN="invalid_connection_token",e.FAILED_FETCH_CONNECTION_TOKEN="failed_fetch_connection_token",e.DISCOVERY_ALREADY_RUNNING="discovery_already_running",e.DISCOVERY_NOT_RUNNING="discovery_not_running",e.DISCOVERY_TOO_MANY_READERS="discovery_too_many_readers",e.INVALID_TYPE="invalid_type",e.INVALID_NUMBER="invalid_number",e.ILLEGAL_STATE="illegal_state",e.INVALID_ARGUMENT="invalid_argument",e.INVALID_TIP_PARAMETER="invalid_tip_parameter",e.INVALID_ON_FETCH_CONNECTION_TOKEN="invalid_on_fetch_connection_token",e.INVALID_ON_UNEXPECTED_READER_DISCONNECT="invalid_on_unexpected_reader_disconnect",e.INVALID_ON_CONNECTION_STATUS_CHANGE="invalid_on_connection_status_change",e.INVALID_ON_PAYMENT_STATUS_CHANGE="invalid_on_payment_status_change",e.INVALID_READER_VERSION="invalid_reader_version",e.JSON_RPC_PARSE_ERROR="json_rpc_parse_error",e.READER_BUSY="reader_busy",e.READER_ERROR="reader_error",e.RPC_ERROR="rpc_error",e.COMMAND_ALREADY_IN_PROGRESS="command_already_in_progress",e.REFUND_FAILED="refund_failed",e.CUSTOMER_CONSENT_NOT_COLLECTED="customer_consent_not_collected",e.UNSUPPORTED_FEATURE="unsupported_feature"}(p||(p={})),function(e){var t,n=e.CodeToMessageMap=(y(t={},p.NO_ESTABLISHED_CONNECTION,(function(){return"No established connection to the Reader. Make sure\n            you call `discoverReaders()` and then `connectReader()` to one of the resolved discovered readers.\n            You should not make any other calls to the SDK until the `connectReader()` response resolves without an error or until the connectionStatus changes to 'connected'."})),y(t,p.LIVE_PAYMENT_OVER_NON_SSL,(function(){return"A live mode payment is being attempted over a non-SSL connection."})),y(t,p.UNSUPPORTED_ENV,(function(){return"You are running the SDK in an unsupported non-browser environment. Currently we only support the following browser environments: https://stripe.com/docs/terminal/sdk/js#supported-browsers"})),y(t,p.INVALID_READER_SHAPE,(function(){return"This should be a reader from the results of the `discoverReaders()` method call."})),y(t,p.INVALID_PAYMENT_INTENT_CLIENT_SECRET,(function(){return"Invalid `PaymentIntent` `client_secret`. This should be the `client_secret` field from the `PaymentIntent` associated with your checkout."})),y(t,p.INVALID_SETUP_INTENT_CLIENT_SECRET,(function(){return"Invalid `SetupIntent` `client_secret`. This should be the `client_secret` field from the `SetupIntent` associated with your checkout."})),y(t,p.INVALID_PAYMENT_INTENT_INPUT_SHAPE,(function(){return"This should be the `PaymentIntent` object resolved from the `collectPaymentMethod()` method call."})),y(t,p.INVALID_SETUP_INTENT_INPUT_SHAPE,(function(){return"This should be the `SetupIntent` object resolved from the `collectSetupIntentPaymentMethod()` method call."})),y(t,p.INVALID_CHARGE_ID_INPUT_SHAPE,(function(){return"The Charge ID can be found on the `PaymentIntent` object, which you should get from your backend."})),y(t,p.INVALID_PAYMENT_INTENT_ID_INPUT_SHAPE,(function(){return"The PaymentIntent ID can be found on the `PaymentIntent` object, which you should get from your backend."})),y(t,p.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT,(function(e){return"`".concat(null==e?void 0:e.command,"()` cancels an active attempt to get a payment method from a customer. However, there was no active attempt.")})),y(t,p.CANCELED_BY_CUSTOMER,(function(){return"Action canceled by customer."})),y(t,p.CANCELED,(function(){return"Action canceled."})),y(t,p.CANCELABLE_ALREADY_COMPLETED,(function(){return"Failed to cancel as action has already completed."})),y(t,p.CANCELABLE_ALREADY_CANCELED,(function(){return"This action has already been canceled."})),y(t,p.NETWORK_TIMEOUT,(function(){return"Network timed out! Check and ensure your browser is connected to the internet and has a stable connection."})),y(t,p.READER_CONNECTION_ERROR,(function(e){var t=null!=e&&e.rpcEndpoint?", and that the host `".concat(e.rpcEndpoint.url_path,"` is resolvable by your DNS provider"):"";return"Could not communicate with the Reader. Please make sure your reader is online and on the same network as your device".concat(t,". See https://support.stripe.com/questions/terminal-connectivity-issues for more details.")})),y(t,p.INTERNET_CONNECTION_UNAVAILABLE,(function(){return"Error connecting to the internet. Please make sure your browser can connect to the web pages such as https://stripe.com."})),y(t,p.ALREADY_CONNECTED,(function(){return"Already have an active connection to a reader. Call `disconnectReader()` first."})),y(t,p.AUTHENTICATION_ERROR,(function(){return"Detected Authentication Error. There may be an issue with the connection token or the `Reader` might have been hot swapped."})),y(t,p.INVALID_CONNECTION_TOKEN,(function(e){return"Invalid `ConnectionToken`. Expected Promise that resolves to pst_xxxxx. Resolved to ".concat(null==e?void 0:e.token)})),y(t,p.FAILED_FETCH_CONNECTION_TOKEN,(function(){return"`onFetchConnectionToken` failure. Please make sure your function creates a new connection token via your backend."})),y(t,p.DISCOVERY_ALREADY_RUNNING,(function(){return"Discovery is already running"})),y(t,p.DISCOVERY_NOT_RUNNING,(function(){return"Discovery isn't running. Start discovery with `startDiscovery()`"})),y(t,p.DISCOVERY_TOO_MANY_READERS,(function(){return"More than 100 readers were discovered. The list of results returned by the SDK may be truncated. Please use the locations API to group readers by locations, and use a location ID to filter your discoverReaders call. For more information, see https://stripe.com/docs/terminal/readers/fleet-management."})),y(t,p.INVALID_TYPE,(function(e){return"Invalid Type. Received ".concat(null==e?void 0:e.actual," but expected something of format: ").concat(null==e?void 0:e.expectedType,". ").concat(null==e?void 0:e.typeDescription)})),y(t,p.INVALID_NUMBER,(function(){return"Invalid number. Amount should be an integer."})),y(t,p.ILLEGAL_STATE,(function(e){return"Invalid state: ".concat(null==e?void 0:e.msg)})),y(t,p.INVALID_ARGUMENT,(function(e){return"Invalid argument: ".concat(null==e?void 0:e.msg)})),y(t,p.INVALID_TIP_PARAMETER,(function(e){return"Invalid tip parameter: ".concat(null==e?void 0:e.msg)})),y(t,p.INVALID_ON_FETCH_CONNECTION_TOKEN,(function(){return"Invalid `onFetchConnectionToken` handler given.\n            You must pass a function that will retreive an connection token via your backend using your api secret key."})),y(t,p.INVALID_ON_UNEXPECTED_READER_DISCONNECT,(function(){return"Invalid `onUnexpectedReaderDisconnect` handler given.\n            You must pass a function that will handle unexpected disconnects from a connected reader."})),y(t,p.INVALID_ON_CONNECTION_STATUS_CHANGE,(function(){return"Invalid `onConnectionStatusChange` handler given.\n            You must pass a function that will accept an updated connection status as an argument."})),y(t,p.INVALID_ON_PAYMENT_STATUS_CHANGE,(function(){return"Invalid `onPaymentStatusChange` handler given.\n            You must pass a function that will accept an updated payment status as an argument."})),y(t,p.INVALID_READER_VERSION,(function(){return"Invalid Reader version. Please upgrade your device to use this version of the SDK"})),y(t,p.JSON_RPC_PARSE_ERROR,(function(e){return"Failed to parse json rpc content: ".concat(null==e?void 0:e.content)})),y(t,p.NETWORK_ERROR,(function(e){return"Unknown Network Error Occured: ".concat(null==e?void 0:e.content)})),y(t,p.READER_ERROR,(function(e){return"Reader Error: ".concat(null==e?void 0:e.msg)})),y(t,p.READER_BUSY,(function(e){return"Reader is busy: ".concat(null==e?void 0:e.state)})),y(t,p.RPC_ERROR,(function(e){return"".concat(null==e?void 0:e.msg)})),y(t,p.COMMAND_ALREADY_IN_PROGRESS,(function(e){return"Terminal command ".concat(null==e?void 0:e.command," is already in progress and cannot be performed again.")})),y(t,p.REFUND_FAILED,(function(){return"The charge could not be refunded; the customer’s bank or card issuer was unable to process the refund."})),y(t,p.CUSTOMER_CONSENT_NOT_COLLECTED,(function(){return"You must collect customer consent in order to save a payment method."})),y(t,p.UNSUPPORTED_FEATURE,(function(e){return"Terminal command ".concat(null==e?void 0:e.command," is not currently available on the connected reader.")})),t);function r(e,t){return n[e](t)}e.generateErrorMessage=r,e.generateError=function(e,t){return{code:e.toLowerCase(),message:r(e,t)}}}(h||(h={}));var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=R(r);if(o){var n=R(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=i.call(this,{message:e,code:p.READER_ERROR}),Object.setPrototypeOf(_(t),c.prototype),t}return t=c,n=[{key:"fromErrorCode",value:function(e,t){return new c(h.generateErrorMessage(e,t))}}],null&&m(t.prototype,null),n&&m(t,n),c}(d);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?P(e):t}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){var t="function"==typeof Map?new Map:void 0;return(T=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return C(e,arguments,x(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),I(r,e)})(e)}function C(e,t,n){return(C=k()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&I(o,n.prototype),o}).apply(null,arguments)}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(c,e);var t,n,r,o,i=(t=c,n=k(),function(){var e,r=x(t);if(n){var o=x(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return S(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,e.message)).error=e,Object.setPrototypeOf(P(t),c.prototype),t}return r=c,(o=[{key:"toErrorResponse",value:function(){return{error:this.error}}}])&&O(r.prototype,o),c}(T(Error));function N(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function j(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){N(i,r,o,c,a,"next",e)}function a(e){N(i,r,o,c,a,"throw",e)}c(void 0)}))}}function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e){return"object"===D(e)&&null!==e&&"string"==typeof e.message}function L(e){return"object"===D(e)&&null!==e&&M(e.error)}function U(e){return B.apply(this,arguments)}function B(){return(B=j(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!(e.t0 instanceof d)){e.next=10;break}return e.abrupt("return",e.t0.toErrorResponse());case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function F(e){try{var t=JSON.parse(e);return"message"in t?t.message:"error"in t?t.error.message:JSON.stringify(t)}catch(t){return e.message||e}}function V(e){try{var t=JSON.parse(e);return"code"in t?t.code:"error"in t?t.error.code:"no_code"}catch(t){return e.code||"no_code"}}function Y(e){var t=V(e),n=F(e);if(n.includes("An unknown error"))return"UNEXPECTED_ERROR";if(e instanceof d||e instanceof A||e instanceof w)return"EXPECTED_ERROR";var r=["Cannot read property 'fetchConnectionToken' of undefined","We're currently in Beta","Your card's security code is incorrect.","Action canceled by customer","Collect Interac refund method must have correct currency.","Collect Interac refund method must use traditional transaction type.","CollectPaymentMethodOp Tipping is still under development and is not available for use.","Confirmation attempted without a confirmable refund","Could not communicate with the Reader.","Error connecting to Reader.","Having more permissions would allow this request to continue.","Only test mode keys are allowed with the simulator","Reader is currently in use.","Reusable card creation is currently not in progress","Reusable card payment methods can only be created via insert or swipe","SetReaderDisplayOp must have a valid type. ","Terminal is currently only available in some countries.","The Location parameter does not match the Location on the Connection Token.","The POS is no longer authenticated","The PaymentMethod provided (card_present) is not allowed for this PaymentIntent.","The PaymentMethod provided (interac_present) is not allowed for this PaymentIntent","The Stripe Terminal ConnectionToken has already been redeemed","The Stripe Terminal ConnectionToken has expired.","The card number specified in the EMV data is incorrect.","The charge to be refunded and the PaymentMethod provided for the refund must both be `interac_present` type.","The operation was aborted","The reader being used to confirm this payment is registered to a Location","The reader is available on the network","The reader is downloading an update","The reader is performing network selection, and is temporarily unavailable","The simulator does not handle SCA","The specified refund cannot be performed with the simulated reader","Transaction is currently not in progress.","Unable to reach Stripe, reader offline","is already fully reversed","is greater than charge amount","is greater than unrefunded amount on charge"];if(["api_key_expired","authentication_required","canceled","card_decline_rate_limit_exceeded","card_declined","command_already_in_progress","connection_error","connection_error_unknown_state","expired_card","idempotency_key_in_use","incorrect_number","invalid_cvc","invalid_expiry_month","invalid_expiry_year","invalid_number","invalid_test_card","invalid_type","network_timeout","no_code","parameter_invalid_empty","payment_intent_invalid_parameter","payment_intent_payment_attempt_failed","payment_intent_unexpected_state","platform_api_key_expired","processing_error","rate_limit","reader_error","resource_missing","stripe_server_error","testmode_charges_only"].includes(t))return"EXPECTED_ERROR";for(var o=0;o<r.length;o++)if(n.includes(r[o]))return"EXPECTED_ERROR";return"UNEXPECTED_ERROR"}function G(e,t,n){var r=n.value;if(!r)throw new Error("no method to trace!");return n.value=function(){for(var e=this,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return U((function(){return r.apply(e,n)}))},n}var H=JSON.parse('{"u2":"pos-js","Jz":{"minRabbitVersion":{"RACCOON":"3.0.0.19","ANDROID_READER":"0.0.0.1"}},"i8":"1.3.2"}');function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var W=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"getProjectName",value:function(){return H.u2}},{key:"getVersion",value:function(){return H.i8}},{key:"getProjectConfig",value:function(){return H.Jz}}],null&&q(t.prototype,null),n&&q(t,n),e}();function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n(4723);var J=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"sanitizeNonAsciiToDashes",value:function(e){return encodeURIComponent(e).replace(/%[0-9A-Fa-f]{2}/g,"-")}},{key:"sanitizePageTitle",value:function(t){var n=e.sanitizeNonAsciiToDashes(t);return n.match(/^[-]+$/)?null:n}},{key:"formEncode",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.keys(t).map((function(r){return"object"===z(t[r])?e.formEncode(t[r],null===n?r:"".concat(n,"[").concat(r,"]")):null===n?"".concat(r,"=").concat(t[r].toString()):"".concat(n,"[").concat(r,"]=").concat(t[r].toString())})).join("&")}}],null&&K(t.prototype,null),n&&K(t,n),e}(),$=function(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"},X=function(e,t,n,r){this.name=e,this.version=t,this.os=n,this.bot=r,this.type="bot-device"},Q=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},Z=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ee=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],te=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ne(e){var t=function(e){return""!==e&&ee.reduce((function(t,n){var r=n[0],o=n[1];if(t)return t;var i=o.exec(e);return!!i&&[r,i]}),!1)}(e);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new Q;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],c=0,a=i.length;c<a;c++,o++)r[o]=i[c];return r}(o,function(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}(3-o.length))):o=[];var i=o.join("."),c=function(e){for(var t=0,n=te.length;t<n;t++){var r=te[t],o=r[0];if(r[1].exec(e))return o}return null}(e),a=Z.exec(e);return a&&a[1]?new X(n,i,c,a[1]):new $(n,i,c)}function re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ie(e,t,n){return t&&oe(e.prototype,t),n&&oe(e,n),e}var ce=function(){function e(t){re(this,e),this.binName=t}return ie(e,[{key:"setValue",value:function(e){localStorage.setItem(this.binName,JSON.stringify(e))}},{key:"getValue",value:function(){var e=localStorage.getItem(this.binName);return null==e?e:JSON.parse(e)}},{key:"clearValue",value:function(){localStorage.setItem(this.binName,null)}}],[{key:"isEnabled",value:function(){try{var e=window.localStorage,t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}}}]),e}(),ae=function(){function e(t){re(this,e),this.binName=t}return ie(e,[{key:"setValue",value:function(t){e.storageMap[this.binName]=t}},{key:"getValue",value:function(){return e.storageMap[this.binName]||null}},{key:"clearValue",value:function(){e.storageMap[this.binName]=null}}],[{key:"isEnabled",value:function(){return!0}}]),e}();ae.storageMap={};var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pos";re(this,e),this.namespace=t}return ie(e,[{key:"getStorageBin",value:function(e){var t="".concat(this.namespace,"-").concat(e);return ce.isEnabled()?new ce(t):new ae(t)}}]),e}();function se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var le=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storageBin=t}var t,n;return t=e,(n=[{key:"getDeviceFingerprint",value:function(){return this.storageBin.getValue()||this.storageBin.setValue("pos-".concat(Math.random().toString(36).substring(2))),this.storageBin.getValue()}}])&&se(t.prototype,n),e}(),fe=("undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}:"undefined"!=typeof navigator?ne(navigator.userAgent):"undefined"!=typeof process&&process.version?new function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}(process.version.slice(1)):null)||{os:"unknown",name:"unknown",version:"unknown"},pe=new le((new ue).getStorageBin("posdeviceid")).getDeviceFingerprint();function he(){var e="".concat(fe.os,":").concat(fe.name);return{device_class:"POS",device_uuid:pe,host_os_version:fe.os,hardware_model:{pos_info:{description:e}},app_model:{app_id:J.sanitizePageTitle(document.title)||window.location.hostname,app_version:"".concat(window.location.origin).concat(window.location.pathname)}}}var de={client_type:"JS_SDK",client_version:W.getVersion()};function ye(e){return e.split(/\.|-/).map((function(e){return parseInt(e,10)}))}function ve(e,t){var n=ye(e),r=ye(t);if(n.length!==r.length)throw new Error("Invalid Semantic Version Check");for(var o=0;o<n.length;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!0}function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ge(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Re,we=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"setCollectors",value:function(e){this.collectors=e}},{key:"forwardToCollectors",value:function(e){this.collectors.forEach((function(t){return t.collect(e)}))}},{key:"collect",value:function(t){e.logPoints.push({timestamp:(new Date).valueOf(),log:t})}},{key:"getActiveTraceId",value:function(){return e.activeTraceId||""}},{key:"getSessionId",value:function(){return e.sessionId||""}},{key:"startSession",value:function(t){var n=t.reader;e.sessionId=e.generateTraceId(),e.connectedReader=n}},{key:"endSession",value:function(){e.sessionId=null,e.connectedReader=null}},{key:"traceFn",value:function(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{recordReqRespOnErrorOnly:!1};return function(){for(var i=r||t.name,c=arguments.length,a=new Array(c),u=0;u<c;u++)a[u]=arguments[u];"connectReader"===i&&e.startSession({reader:a[0]});var s=e.openTracingContext(),l=s.traceId,f=s.startTime,p=s.parentTraceId,h=JSON.stringify({args:a}),d={id:l,parent_trace_id:p||"",start_time_ms:f,service:n,method:i,request:h,version_info:de,session_id:e.getSessionId(),connected_reader:e.connectedReader,trace_points:[]};try{var y=t.apply(this,a);if(y instanceof Promise)return e.tracePromise(d,y,o),y;if(L(y))return e.exceptionTrace(d,JSON.stringify(y)),y;var v=JSON.stringify(y);return e.successTrace(d,v,o),y}catch(t){throw e.exceptionTrace(d,t),t}finally{"disconnectReader"===i&&e.endSession()}}}},{key:"generateTraceId",value:function(){return"".concat(Math.floor(1e8*Math.random()))}},{key:"generateActionId",value:function(){return e.activeTraceId?"".concat(parseInt(e.activeTraceId,10)+1):e.generateTraceId()}},{key:"openTracingContext",value:function(){return e.activeTraceId=e.generateActionId(),{traceId:e.activeTraceId,parentTraceId:"",startTime:(new Date).valueOf()}}},{key:"closeTracingContext",value:function(t){var n=e.logPoints.map((function(n){return{type:"log",time_offset_ms:e.calculateElapsedTimeMs(t.start_time_ms,n.timestamp),log:n.log}}));return e.logPoints=[],be(be({},t),{},{total_time_ms:e.calculateElapsedTimeMs(t.start_time_ms),trace_points:n})}},{key:"successTrace",value:function(t,n,r){var o=be(be({},e.closeTracingContext(t)),{},{type:"success",response:n});r.recordReqRespOnErrorOnly&&(o.request="",o.response=""),e.forwardToCollectors(o)}},{key:"exceptionTrace",value:function(t,n){var r,o={message:F(r=n),code:V(r),type:Y(r)},i=be(be({},e.closeTracingContext(t)),{},{type:"exception",exception:o.message,errorCode:o.type,response:JSON.stringify(be({},o))});e.forwardToCollectors(i)}},{key:"tracePromise",value:function(t,n,r){var o=be({},t);n.then((function(t){if(L(t))e.exceptionTrace(o,JSON.stringify(t));else{var n=JSON.stringify(t);e.successTrace(o,n,r)}})).catch((function(t){e.exceptionTrace(o,t)}))}},{key:"calculateElapsedTimeMs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(new Date).valueOf();return t-e}}],null&&_e(t.prototype,null),n&&_e(t,n),e}();function Ee(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){Ee(i,r,o,c,a,"next",e)}function a(e){Ee(i,r,o,c,a,"throw",e)}c(void 0)}))}}function Se(e){return Pe.apply(this,arguments)}function Pe(){return(Pe=Oe(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout(e,t)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=Oe(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Se(n).then((function(){return t()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return e().catch((function(r){if(0===n)throw r;return Promise.resolve().then((function(){return t(r)})).then((function(o){return o?Ce(e,t,n-1):Promise.reject(r)}))}))}function ke(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500,o=function(){var e=Oe(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(n);case 2:if(e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return e.next=7,Se(r);case 7:return e.abrupt("return",!0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Ce(e,o,n)}function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ae(e,t){return(Ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ne(e,t){return!t||"object"!==Ie(t)&&"function"!=typeof t?je(e):t}function je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(e){return(De=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Me(e){return"SERVER_UNREACHABLE"===e||"SERVER_UNRESOLVABLE"===e||"RETRY"===e||"SERVER_BUSY"===e||"TIMEOUT"===e||"NETWORK_UNAVAILABLE"===e}we.collectors=[],we.sessionId=null,we.connectedReader=null,we.activeTraceId=null,we.logPoints=[],function(e){e[e.RPC=0]="RPC",e[e.APPLICATION=1]="APPLICATION"}(Re||(Re={}));var Le=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ae(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=De(r);if(o){var n=De(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ne(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,h.generateError(p.RPC_ERROR,{msg:e.error}))).response=e,Object.setPrototypeOf(je(t),c.prototype),t}return t=c,(n=[{key:"errorType",value:function(){return"OK"!==this.applicationEc()?Re.APPLICATION:Re.RPC}},{key:"rpcEc",value:function(){return this.response.rpc_error_code||"RPC_EC_INVALID"}},{key:"applicationEc",value:function(){return this.response.app_error_code||"APPLICATION_EC_INVALID"}}])&&xe(t.prototype,n),c}(d);function Ue(e){return(Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Be(e,t){return(Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e,t){return!t||"object"!==Ue(t)&&"function"!=typeof t?Ve(e):t}function Ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(e){return(Ye=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Be(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ye(t);if(n){var o=Ye(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Fe(this,e)});function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,h.generateError(p.NETWORK_ERROR,{content:t}))).response=e,n.responseBodyText=t,Object.setPrototypeOf(Ve(n),o.prototype),n}return o}(d);function He(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function We(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ze=function e(){We(this,e),this.url_path=void 0,this.port=void 0,this.simulator=void 0};function Ke(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)})))}function Je(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))})).join(""))}var $e=function(){function e(t,n,r,o,i){We(this,e),this.serviceName=t,this.postClient=n,this.rpcEndpoint=r,this.networkMonitor=o,this.retryBackoff=i}var t,n,r,o;return t=e,(n=[{key:"getUntracedMethods",value:function(){return[]}},{key:"getRpcEndpoint",value:function(){return this.rpcEndpoint}},{key:"createRpcHeaders",value:function(){return new Headers}},{key:"createRpcRequest",value:function(e,t,n){return{id:Date.now(),service:this.serviceName,method:e,content:Ke(JSON.stringify(t)),session_token:n||"",version_info:de,parent_trace_id:we.getActiveTraceId()||"",device_info:he()}}},{key:"rpc",value:(r=regeneratorRuntime.mark((function t(n,r,o){var i,c,a,u,s,l,f,d,y=this,v=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=v.length>3&&void 0!==v[3]?v[3]:{isRetriable:!0},c=this.rpcEndpoint.port?":".concat(this.rpcEndpoint.port):"",a="".concat(this.rpcEndpoint.url_path+c,"/protojsonservice/").concat(this.serviceName),u=this.createRpcRequest(n,r,o),s=this.createRpcHeaders(),l=function(e){return i.isRetriable&&e.errorType()===Re.RPC&&Me(e.rpcEc())},d=f=function(){return y.postClient.post(a,u,s).catch((function(e){return{rpc_error_code:"NETWORK_UNAVAILABLE",app_error_code:"OK",error:e instanceof Ge?e.error.message:e.message}})).then((function(e){if("RPC_OK"!==e.rpc_error_code||"OK"!==e.app_error_code){var t=new Le(e);return Promise.reject(t)}try{return JSON.parse(Je((null==e?void 0:e.content)||""))}catch(t){throw new Error(h.generateErrorMessage(p.JSON_RPC_PARSE_ERROR,{content:e.content}))}}))},this.getUntracedMethods().includes(n)||(d=function(){return y.networkMonitor.withMonitoring(y.serviceName,n,f)}),t.abrupt("return",ke(d,l,e.NUM_RETRIES,this.retryBackoff));case 10:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){He(i,n,o,c,a,"next",e)}function a(e){He(i,n,o,c,a,"throw",e)}c(void 0)}))},function(e,t,n){return o.apply(this,arguments)})}])&&qe(t.prototype,n),e}();function Xe(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}$e.NUM_RETRIES=1,n(5827);var nt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r,o;return t=e,null,(n=[{key:"setCollectors",value:function(e){this.collectors=e}},{key:"forwardToCollectors",value:function(e){this.collectors.forEach((function(t){return t.collect(e)}))}},{key:"log",value:function(t,n,r,o,i){var c=Ze({type:"log",instant:{millis:Date.now()}},e.baseEvent(t,n,r,o,i));e.forwardToCollectors(c)}},{key:"collect",value:function(e){this.captureMeter("Tracer",e.service||null,e.method,e.start_time_ms,e.total_time_ms||null,"success"===e.type,e.errorCode)}},{key:"count",value:function(t,n,r,o,i){var c=Ze({type:"count"},e.baseEvent(t,n,r,o,i));e.forwardToCollectors(c)}},{key:"gauge",value:function(t,n,r,o,i,c){var a=Ze({type:"gauge",measurement:i},e.baseEvent(t,n,r,o,c));e.forwardToCollectors(a)}},{key:"meterAsync",value:(r=regeneratorRuntime.mark((function e(t,n,r,o){var i,c,a,u,s,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(new Date).valueOf(),a=!0,u=null,e.prev=3,e.next=6,o();case 6:c=e.sent,e.next=15;break;case 9:e.prev=9,e.t0=e.catch(3),a=!1,c=e.t0,e.t0 instanceof d&&(u=e.t0.error.code),e.t0 instanceof A&&(u=e.t0.error.code);case 15:return s=(new Date).valueOf()-i,l=this.captureMeter(t,n,r,i,s,a,u),e.abrupt("return",{result:function(){if(a)return c;throw c},meter:l});case 18:case"end":return e.stop()}}),e,this,[[3,9]])})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){Xe(i,n,o,c,a,"next",e)}function a(e){Xe(i,n,o,c,a,"throw",e)}c(void 0)}))},function(e,t,n,r){return o.apply(this,arguments)})},{key:"captureMeter",value:function(t,n,r,o,i,c,a){var u=Ze({type:"meter",duration:i},e.baseEvent(t,n,r,c?"OK":"ERROR",a));return e.forwardToCollectors(u),u}},{key:"baseEvent",value:function(e,t,n,r,o){return{domain:e,scope:t,event:n,result:r,error_code:o}}}])&&tt(t,n),e}();function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){return function(t,n,r){var o=r.value;return ot(ot({},r),{},{value:we.traceFn(o,t.constructor.name,n,e)})}}function at(e){return(at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lt(e,t){return!t||"object"!==at(t)&&"function"!=typeof t?ft(e):t}function ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}nt.collectors=[],n(4819);var ht=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&st(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pt(r);if(o){var n=pt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return lt(this,e)});function c(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),r=i.call(this,{message:e,request_id:t,code:n}),Object.setPrototypeOf(ft(r),c.prototype),r}return t=c,n=[{key:"fromHttpError",value:function(e){var t,n,r,o={message:e.error.message,code:e.error.code};try{o=JSON.parse(e.responseBodyText).error}catch(e){}var i=(null==e||null===(t=e.response)||void 0===t||null===(n=t.headers)||void 0===n?void 0:n.get("request-id"))||"";return new c(o.message,i,(null===(r=o)||void 0===r?void 0:r.code)||"no_code")}}],null&&ut(t.prototype,null),n&&ut(t,n),c}(d);function dt(e){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yt(e,t,n){return(yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=bt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function vt(e,t){return(vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mt(e,t){return!t||"object"!==dt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bt(e){return(bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gt(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wt(e,t,n){return t&&Rt(e.prototype,t),n&&Rt(e,n),e}var Et,Ot=JSON.stringify({pos_version_info:de,pos_device_info:he()}),St=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"v1";_t(this,e),this.resourceName=t,this.httpClient=n,this.networkMonitor=r,this.resourceVersion=o}return wt(e,[{key:"createHeaders",value:function(e){var t=new Headers;return t.append("Stripe-Version","2018-08-23"),t.append("X-Stripe-Terminal-User-Agent",encodeURI(Ot)),t.append("X-Stripe-Client-Trace-Id",we.getActiveTraceId()),e&&t.append("Authorization","Bearer ".concat(e)),t}},{key:"createUrl",value:function(e){return t=this.resourceVersion,n=this.resourceName,o=(r=e)?"/".concat(r):"","".concat("https://api.stripe.com/"+t,"/").concat(n).concat(o);var t,n,r,o}},{key:"makeRequest",value:function(e,t){var n=function(){var e,n=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!(e.t0 instanceof Ge)){e.next=13;break}throw ht.fromHttpError(e.t0);case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,6]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){gt(i,r,o,c,a,"next",e)}function a(e){gt(i,r,o,c,a,"throw",e)}c(void 0)}))});return function(){return n.apply(this,arguments)}}();return this.networkMonitor.withMonitoring("StripeApiClient",this.resourceName,n)}},{key:"postFormEncoded",value:function(e,t,n){var r=this;return this.makeRequest(e,(function(){return r.httpClient.postFormEncoded(r.createUrl(e),t,r.createHeaders(n))}))}},{key:"get",value:function(e,t,n){var r=this;return this.makeRequest(e,(function(){return r.httpClient.get(r.createUrl(e),t,r.createHeaders(n))}))}}]),e}(),Pt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vt(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=bt(t);if(n){var o=bt(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return mt(this,e)});function o(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"v1";return _t(this,o),r.call(this,e,t,n,i)}return wt(o,[{key:"postResource",value:function(e,t){return yt(bt(o.prototype),"postFormEncoded",this).call(this,null,e,t)}},{key:"loadResource",value:function(e,t,n){return yt(bt(o.prototype),"get",this).call(this,e,t,n)}},{key:"queryResource",value:function(e,t){return yt(bt(o.prototype),"get",this).call(this,null,e,t)}}]),o}(St);function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function It(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n(3161),n(9653),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(Et||(Et={}));var xt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"setCollectors",value:function(e){this.collectors=e}},{key:"forwardToCollectors",value:function(e){this.collectors.forEach((function(t){return t.collect(e)}))}},{key:"log",value:function(t,n){e.textLog("log",n,t)}},{key:"debug",value:function(t){var n;n=t instanceof Error?F(t):JSON.stringify(t),e.textLog("debug",Et.DEBUG,n)}},{key:"info",value:function(t){e.textLog("log",Et.INFO,t)}},{key:"warning",value:function(t){e.textLog("log",Et.WARN,t)}},{key:"user_error",value:function(t){e.textLog("user_error",Et.WARN,t)}},{key:"error",value:function(t){e.textLog("log",Et.ERROR,t)}},{key:"exception",value:function(t){var n=Ct(Ct({},e.baseLog("exception",Et.ERROR)),{},{type:"exception",exception:F(t)});e.forwardToCollectors(n)}},{key:"textLog",value:function(t,n,r){var o=Ct({type:"text",message:r},e.baseLog(t,n));e.forwardToCollectors(o)}},{key:"baseLog",value:function(e,t){return{log_level:t,tag:e}}}],null&&It(t.prototype,null),n&&It(t,n),e}();function At(e){return(At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dt(e,t,n){return t&&jt(e.prototype,t),n&&jt(e,n),e}xt.collectors=[];var Mt=function(){function e(){Nt(this,e)}return Dt(e,null,[{key:"softAssert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!e){nt.log("AssertUtils","FailedSoftAssertion","FailedAssert","ERROR",t);var o=h.generateErrorMessage(t,n),i=r?h.generateErrorMessage(r,{msg:o}):o;xt.log(i,Et.INFO)}}},{key:"assert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Et.ERROR;if(!e){nt.log("AssertUtils","FailedAssertion","FailedAssert","ERROR",t);var i=h.generateErrorMessage(t,n),c=r?h.generateErrorMessage(r,{msg:i}):i;throw xt.log(c,o),new A({message:c,code:t})}}},{key:"validateInteger",value:function(t){e.assert(Number.isInteger(t),p.INVALID_NUMBER)}},{key:"checkUserGivenArg",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.assert(t,n,r,p.INVALID_ARGUMENT)}},{key:"checkState",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.assert(t,n,r,p.ILLEGAL_STATE)}},{key:"checkType",value:function(e,t,n){if(!e.matchesType(t)){nt.count("AssertUtils","FailedParamCheck","TypeError","ERROR",null==n?p.INVALID_TYPE:n);var r=null==n?"":h.generateErrorMessage(n),o=h.generateErrorMessage(p.INVALID_TYPE,{actual:JSON.stringify(t,null,2),expectedType:JSON.stringify(e.getTypeDescriptor(),null,2),typeDescription:r});throw xt.error(o),new A({code:p.INVALID_TYPE,message:o})}}}]),e}(),Lt=function(){function e(){Nt(this,e)}return Dt(e,[{key:"matchesType",value:function(e){return null==e}},{key:"getTypeDescriptor",value:function(){return"null | undefined"}}]),e}(),Ut=function(){function e(t,n){Nt(this,e),this.regex=t,this.regexName=n}return Dt(e,[{key:"matchesType",value:function(e){return this.regex.test(e)}},{key:"getTypeDescriptor",value:function(){return(this.regexName?"(".concat(this.regexName,") "):"")+this.regex.toString()}}]),e}(),Bt=function(){function e(t){Nt(this,e),this.expected=t}return Dt(e,[{key:"matchesType",value:function(e){return JSON.stringify(this.expected)===JSON.stringify(e)}},{key:"getTypeDescriptor",value:function(){return this.expected}}]),e}(),Ft=function(){function e(t){Nt(this,e),this.checkers=t}return Dt(e,[{key:"matchesType",value:function(e){return this.checkers.reduce((function(t,n){return t||n.matchesType(e)}),!1)}},{key:"getTypeDescriptor",value:function(){var e=[];return this.checkers.forEach((function(t){e.push(t.getTypeDescriptor())})),{"<oneOf>":e}}}]),e}();function Vt(e){return new Ft([new Lt,e])}var Yt=function(){function e(t){Nt(this,e),this.type=t}return Dt(e,[{key:"matchesType",value:function(e){return At(e)===this.type}},{key:"getTypeDescriptor",value:function(){return this.type}}]),e}(),Gt=function(){function e(t){Nt(this,e),this.checker=t}return Dt(e,[{key:"matchesType",value:function(e){var t=this;return!!Array.isArray(e)&&e.reduce((function(e,n){return e&&t.checker.matchesType(n)}),!0)}},{key:"getTypeDescriptor",value:function(){return[this.checker.getTypeDescriptor()]}}]),e}(),Ht=function(){function e(t){Nt(this,e),this.objectTypeDef=t}return Dt(e,[{key:"matchesType",value:function(e){var t=this;return!(!new Yt("object").matchesType(e)||null===e)&&Object.keys(this.objectTypeDef).reduce((function(n,r){return n&&t.objectTypeDef[r].matchesType(e[r])}),!0)}},{key:"getTypeDescriptor",value:function(){var e=this,t={};return Object.keys(this.objectTypeDef).forEach((function(n){t[n]=e.objectTypeDef[n].getTypeDescriptor()})),t}}]),e}();function qt(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Wt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){qt(i,r,o,c,a,"next",e)}function a(e){qt(i,r,o,c,a,"throw",e)}c(void 0)}))}}function zt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Kt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cancelableOp=t,this.internalPromise=void 0,this.isPending=!0,this.canceled=!1,this.rejectFn=void 0,this.resource=void 0,this.internalPromise=new Promise((function(e,t){n.rejectFn=t;var r=n.cancelableOp.execute((function(){return n.isCanceled()}));n.resource=r.resource,r.result.then((function(e){return n.isPending=!1,e}),(function(e){return n.isPending=!1,Promise.reject(e)})).then(e,t)}))}var t,n,r,o;return t=e,r=[{key:"chainCancelable",value:function(t,n){var r,o=t;return new e({execute:function(){return{result:t.result().then((function(e){var t=n(e);return o=t,t.result()}))}},onCancel:(r=Wt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.isCanceled()||!o.isPending){e.next=2;break}return e.abrupt("return",o.cancel());case 2:return e.abrupt("return",Promise.resolve());case 3:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})})}}],(n=[{key:"result",value:function(){return this.internalPromise}},{key:"cancel",value:(o=Wt(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isPending){e.next=2;break}throw new A({message:"Failed to cancel. Action has already completed."});case 2:if(!this.canceled){e.next=4;break}throw new A({message:"Action has already been canceled."});case 4:return this.canceled=!0,this.rejectFn(new d(h.generateError(p.CANCELED))),t=null,this.cancelableOp.onCancel&&(t=this.cancelableOp.onCancel(this.resource)),e.abrupt("return",Promise.resolve().then((function(){return t})).then((function(){})));case 9:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"isCanceled",value:function(){return this.canceled}}])&&zt(t.prototype,n),r&&zt(t,r),e}();function Jt(e){return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $t(e,t){return($t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xt(e,t){return!t||"object"!==Jt(t)&&"function"!=typeof t?Qt(e):t}function Qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var en=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$t(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Zt(t);if(n){var o=Zt(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Xt(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=r.call(this,{message:e})).message=e,Object.setPrototypeOf(Qt(t),A.prototype),t}return o}(A);function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rn(e,t,n){return t&&nn(e.prototype,t),n&&nn(e,n),e}n(6755),n(2087);var on=function(){function e(t){tn(this,e),this.flags=void 0,this.flags=t}return rn(e,[{key:"hasTippingEnabled",value:function(){var e;return Boolean(null===(e=this.flags)||void 0===e?void 0:e.tipping_enabled)}},{key:"allowNonBrowserEnv",value:function(){var e;return Boolean(null===(e=this.flags)||void 0===e?void 0:e.allow_non_browser_env)}},{key:"isTipEligibleCircuitBreakerEnabled",value:function(){var e;return Boolean(null===(e=this.flags)||void 0===e?void 0:e.tip_eligible_amounts_circuit_breaker)}}]),e}(),cn=function(){function e(){tn(this,e)}return rn(e,null,[{key:"setFlags",value:function(t){e.instance=new on(t)}},{key:"clearFlags",value:function(){e.instance=new on(null)}},{key:"getInstance",value:function(){return e.instance||(e.instance=new on(null)),e.instance}}]),e}();cn.instance=void 0;var an=function(e){var t,n,r,o,i,c,a=new Ht({id:new Ut(/^pi_/),sdk_payment_details:new Yt("object")});Mt.checkType(a,e,p.INVALID_PAYMENT_INTENT_INPUT_SHAPE),Mt.softAssert(!(Boolean(e.livemode)&&(null===(t=window)||void 0===t||null===(n=t.location)||void 0===n||null===(r=n.protocol)||void 0===r||!r.startsWith("https"))),p.LIVE_PAYMENT_OVER_NON_SSL),window&&null!==(o=window)&&void 0!==o&&o.location&&null!==(i=window)&&void 0!==i&&null!==(c=i.location)&&void 0!==c&&c.protocol||(cn.getInstance().allowNonBrowserEnv()||Mt.softAssert(!1,p.UNSUPPORTED_ENV),console.warn(h.generateErrorMessage(p.UNSUPPORTED_ENV)))};function un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ln=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;un(this,e),this.requestTimeoutMs=t}var t,n;return t=e,(n=[{key:"get",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Headers,r=Object.keys(t).filter((function(e){return void 0!==t[e]})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t[e]))})).join("&"),o={method:"GET",headers:n},i="".concat(e,"?").concat(r);return this.doFetch(i,o)}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Headers;n.append("Content-Type","application/json");var r={method:"POST",body:JSON.stringify(t),headers:n};return this.doFetch(e,r)}},{key:"postFormEncoded",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Headers;n.append("Content-Type","application/x-www-form-urlencoded");var r={method:"POST",body:t.toString(),headers:n};return this.doFetch(e,r)}},{key:"doFetch",value:function(e,t){var n=this,r=[fetch(e,t)];if(this.requestTimeoutMs){var o=function(e,t){return Te.apply(this,arguments)}((function(){return n.createFakeTimeoutResponse()}),this.requestTimeoutMs);r.push(o)}return Promise.race(r).then((function(e){return 408===e.status&&xt.error(h.generateErrorMessage(p.NETWORK_TIMEOUT)),e.ok?e.json():function(e,t){return function(e){return e.text()}(t).then((function(n){throw nt.count("HttpClient",e,"HttpFailure","ERROR","".concat(t.status)),new Ge(t,n)}))}(t.method,e)}),(function(){throw new d(h.generateError(p.NETWORK_TIMEOUT))}))}},{key:"createFakeTimeoutResponse",value:function(){return new Response(h.generateErrorMessage(p.NETWORK_TIMEOUT),{status:408,statusText:"Client Timeout"})}}])&&sn(t.prototype,n),e}();function fn(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function pn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var hn,dn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r,o;return t=e,(n=[{key:"withMonitoring",value:(r=regeneratorRuntime.mark((function e(t,n,r){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nt.meterAsync("NetworkMonitor",t,n,r);case 2:return o=e.sent,e.abrupt("return",o.result());case 4:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){fn(i,n,o,c,a,"next",e)}function a(e){fn(i,n,o,c,a,"throw",e)}c(void 0)}))},function(e,t,n){return o.apply(this,arguments)})}])&&pn(t.prototype,n),e}();function yn(e){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(n),!0).forEach((function(t){bn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gn(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function _n(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){gn(i,r,o,c,a,"next",e)}function a(e){gn(i,r,o,c,a,"throw",e)}c(void 0)}))}}function Rn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wn(e,t,n){return(wn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Sn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function En(e,t){return(En=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function On(e,t){return!t||"object"!==yn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sn(e){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.P400="verifone_P400",e.WISEPOSE="bbpos_wisepos_e",e.S700="stripe_s700"}(hn||(hn={}));var Pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&En(e,t)}(s,e);var t,n,r,o,i,c,a,u=(c=s,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sn(c);if(a){var n=Sn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return On(this,e)});function s(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(r=u.call(this,"terminal/readers",e,n)).connectionTokenMgr=t,r.handlePosRpcSessionResponse=void 0,r}return t=s,(n=[{key:"retrieveReader",value:(i=_n(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connectionTokenMgr.getActiveCredentials();case 2:return n=e.sent,this.generatePosRpcSession(n).then(this.handlePosRpcSessionResponse),e.abrupt("return",wn(Sn(s.prototype),"loadResource",this).call(this,t,{},n));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"discoverReaders",value:(o=_n(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connectionTokenMgr.getActiveCredentials();case 2:return n=e.sent,this.generatePosRpcSession(n).then(this.handlePosRpcSessionResponse),e.abrupt("return",wn(Sn(s.prototype),"queryResource",this).call(this,mn(mn({},t),{},{limit:100,compatible_sdk_type:"js",compatible_sdk_version:W.getVersion()}),n));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"generatePosRpcSession",value:(r=_n(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new St("terminal",new ln,new dn),e.abrupt("return",n.postFormEncoded("connection_tokens/generate_pos_rpc_session",J.formEncode(he(),"pos_device_info"),t));case 2:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}])&&Rn(t.prototype,n),s}(Pt);function Tn(e){return(Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cn(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function In(e,t,n){return(In="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Nn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function xn(e,t){return(xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function An(e,t){return!t||"object"!==Tn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Nn(e){return(Nn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xn(e,t)}(u,e);var t,n,r,o,i,c,a=(i=u,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Nn(i);if(c){var n=Nn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return An(this,e)});function u(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(r=a.call(this,"payment_intents",e,n)).connectionTokenMgr=t,r}return t=u,(n=[{key:"getPaymentIntentIdFromClientSecret",value:function(e){var t=e.match(u.CLIENT_SECRET_REGEX);if(Mt.assert(!!t,p.INVALID_PAYMENT_INTENT_CLIENT_SECRET),null==t||!t.length||t.length<2)throw Error("No payment intent client secret found!");return t[1]}},{key:"loadPaymentIntentBySecret",value:(r=regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getPaymentIntentIdFromClientSecret(t),e.next=3,this.connectionTokenMgr.getActiveCredentials();case 3:return r=e.sent,e.next=6,In(Nn(u.prototype),"loadResource",this).call(this,n,{client_secret:t},r);case 6:return o=e.sent,e.abrupt("return",o);case 8:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){Cn(i,n,o,c,a,"next",e)}function a(e){Cn(i,n,o,c,a,"throw",e)}c(void 0)}))},function(e){return o.apply(this,arguments)})}])&&kn(t.prototype,n),u}(Pt);function Dn(e){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mn(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Un(e,t,n){return(Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Bn(e,t){return(Bn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fn(e,t){return!t||"object"!==Dn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vn(e){return(Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}jn.CLIENT_SECRET_REGEX=/^(pi_[^_]+)_secret_[^-]+$/;var Yn,Gn,Hn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bn(e,t)}(u,e);var t,n,r,o,i,c,a=(i=u,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Vn(i);if(c){var n=Vn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fn(this,e)});function u(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(r=a.call(this,"setup_intents",e,n)).connectionTokenMgr=t,r}return t=u,(n=[{key:"getSetupIntentIdFromClientSecret",value:function(e){var t=e.match(u.CLIENT_SECRET_REGEX);if(Mt.checkType(new Ut(u.CLIENT_SECRET_REGEX),e,p.INVALID_SETUP_INTENT_CLIENT_SECRET),null==t||!t.length||t.length<2)throw Error("No setup intent client secret found!");return t[1]}},{key:"loadSetupIntentBySecret",value:(r=regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSetupIntentIdFromClientSecret(t),e.next=3,this.connectionTokenMgr.getActiveCredentials();case 3:return r=e.sent,e.next=6,Un(Vn(u.prototype),"loadResource",this).call(this,n,{client_secret:t},r);case 6:return o=e.sent,e.abrupt("return",o);case 8:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){Mn(i,n,o,c,a,"next",e)}function a(e){Mn(i,n,o,c,a,"throw",e)}c(void 0)}))},function(e){return o.apply(this,arguments)})}])&&Ln(t.prototype,n),u}(Pt);Hn.CLIENT_SECRET_REGEX=/^(seti_[^_]+)_secret_[^-]+$/,function(e){e.NOT_READY="not_ready",e.READY="ready",e.WAITING_FOR_INPUT="waiting_for_input",e.PROCESSING="processing"}(Yn||(Yn={})),function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.NOT_CONNECTED="not_connected"}(Gn||(Gn={}));var qn,Wn,zn,Kn,Jn,$n,Xn,Qn,Zn,er,tr,nr,rr,or,ir,cr,ar,ur,sr,lr,fr,pr,hr=["payment_intent"],dr=["payment_intent"];function yr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function vr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(n),!0).forEach((function(t){br(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gr(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function _r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){gr(i,r,o,c,a,"next",e)}function a(e){gr(i,r,o,c,a,"throw",e)}c(void 0)}))}}function Rr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wr(e,t,n,r,o){var i={};return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}var Er=new Ht({ip_address:new Yt("string"),serial_number:new Yt("string")}),Or=["offline_pin_required","online_or_offline_pin_required","mobile_device_authentication_required"],Sr=999999999,Pr=(qn=ct({recordReqRespOnErrorOnly:!0}),Wn=ct(),zn=ct(),Kn=ct(),Jn=ct(),$n=ct(),Xn=ct({recordReqRespOnErrorOnly:!0}),Qn=ct(),Zn=ct(),er=ct(),tr=ct(),nr=ct(),rr=ct(),or=ct(),ir=ct(),cr=ct(),ar=ct(),ur=ct(),sr=ct(),lr=ct(),fr=ct(),wr((pr=function(){function e(t,n,r,o,i,c,a){var u=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.discoveryService=t,this.jackRabbitService=n,this.jackRabbitRpcAuthService=r,this.delegate=o,this.paymentIntentClient=i,this.setupIntentClient=c,this.connectionTokenMgr=a,this.collectPaymentMethodAttempt=null,this.collectReusableCardAttempt=null,this.refundInteracCardAttempt=null,this.pendingInteracRefund=null,this.connectionStatus=Gn.NOT_CONNECTED,this.paymentStatus=Yn.NOT_READY,this.jackRabbitService.setOnUnexpectedDisconnectHandler((function(e){we.endSession(),u.setConnectionStatus(Gn.NOT_CONNECTED),u.delegate.onUnexpectedReaderDisconnect&&u.delegate.onUnexpectedReaderDisconnect(e)}))}var t,n,r,o,i,c,a,u,s,l,f,d,y,v,m,b,g,_,R,w,E,O,S;return t=e,(n=[{key:"getConnectionStatus",value:function(){return this.connectionStatus}},{key:"getPaymentStatus",value:function(){return this.paymentStatus}},{key:"discoverReaders",value:(S=_r(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Ht({device_type:Vt(new Ft([new Bt("verifone_P400"),new Bt("bbpos_wisepos_e"),new Bt("stripe_s700")])),method:Vt(new Bt("internet")),location:Vt(new Yt("string")),simulated:Vt(new Yt("boolean"))}),t&&null===t.location&&delete t.location,Mt.checkType(Vt(n),t),e.abrupt("return",this.discoveryService.discoverReaders(t||void 0));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"connectReader",value:(O=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},Mt.checkType(Er,t,p.INVALID_READER_SHAPE),!t.base_url){e.next=6;break}e.t0=t,e.next=9;break;case 6:return e.next=8,this.discoveryService.retrieveReader(t.id);case 8:e.t0=e.sent;case 9:return r=e.t0,this.setConnectionStatus(Gn.CONNECTING),e.prev=11,e.next=14,this.jackRabbitService.connect(r,n);case 14:return o=e.sent,this.setConnectionStatus(Gn.CONNECTED),this.setPaymentStatus(Yn.READY),e.abrupt("return",{reader:o.reader});case 20:throw e.prev=20,e.t1=e.catch(11),this.setConnectionStatus(Gn.NOT_CONNECTED),e.t1;case 24:case"end":return e.stop()}}),e,this,[[11,20]])}))),function(e){return O.apply(this,arguments)})},{key:"getConnectedReader",value:function(){return this.getConnectionStatus()!==Gn.CONNECTED?null:this.jackRabbitService.getConnectedReader()}},{key:"disconnectReader",value:(E=_r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.jackRabbitService.disconnect();case 2:return cn.clearFlags(),this.setConnectionStatus(Gn.NOT_CONNECTED),e.abrupt("return",{});case 5:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"clearCachedCredentials",value:(w=_r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.disconnectReader();case 2:return this.connectionTokenMgr.invalidateConnectionToken(),e.abrupt("return",{});case 4:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"clearReaderDisplay",value:(R=_r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this&&this.jackRabbitService){e.next=2;break}throw new en("Terminal Object not instantiated!");case 2:return e.next=4,this.jackRabbitRpcAuthService.clearReaderDisplay({});case 4:return e.abrupt("return",{});case 5:case"end":return e.stop()}}),e,this)}))),function(){return R.apply(this,arguments)})},{key:"setReaderDisplay",value:(_=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i,c,a,u,s,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this&&this.jackRabbitService){e.next=2;break}throw new en("Terminal Object not instantiated!");case 2:if(this.paymentStatus===Yn.READY){e.next=5;break}return Mt.softAssert(!1,p.READER_BUSY,{status:this.paymentStatus}),e.abrupt("return",{});case 5:return a=new Ht({description:new Yt("string"),quantity:new Yt("number"),amount:new Yt("number")}),u=new Ht({line_items:new Gt(a),tax:Vt(new Yt("number")),total:new Yt("number"),currency:new Yt("string")}),s=new Ht({cart:u,type:new Bt("cart")}),Mt.checkType(s,t),null!==(n=t.cart)&&void 0!==n&&n.tax&&Mt.validateInteger(t.cart.tax),Mt.validateInteger(null===(r=t.cart)||void 0===r?void 0:r.total),null===(o=t.cart)||void 0===o||o.line_items.forEach((function(e){Mt.validateInteger(e.amount),Mt.validateInteger(e.quantity)})),this.ensureConnected(),l=mr(mr({},t.cart),{},{currency:null==t||null===(i=t.cart)||void 0===i||null===(c=i.currency)||void 0===c?void 0:c.toLowerCase()}),e.next=16,this.jackRabbitRpcAuthService.setReaderDisplay({type:t.type,cart:l});case 16:return e.abrupt("return",{});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"collectPaymentMethod",value:(g=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i,c,a,u,s,l,f,d,y,v,m,b,g,_,R,w,E,O=this,S=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=S.length>1&&void 0!==S[1]?S[1]:{},Mt.checkType(new Ut(jn.CLIENT_SECRET_REGEX,"PaymentIntent client_secret"),t,p.INVALID_PAYMENT_INTENT_CLIENT_SECRET),a=new Ht({options:new Gt(new Ht({amount:new Yt("number"),label:new Yt("string")})),hide_custom_amount:new Yt("boolean")}),u=new Ht({skip_tipping:Vt(new Yt("boolean")),tipping:Vt(new Ht({eligible_amount:Vt(new Yt("number"))}))}),s=new Ht({tip_configuration:Vt(a),config_override:Vt(u)}),Mt.checkType(s,c),null!==(n=c.config_override)&&void 0!==n&&null!==(r=n.tipping)&&void 0!==r&&r.eligible_amount&&Mt.validateInteger(c.config_override.tipping.eligible_amount),null===(o=c.tip_configuration)||void 0===o||null===(i=o.options)||void 0===i||i.forEach((function(e){null!=e&&e.amount&&Mt.validateInteger(e.amount)})),this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=11;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"collectPaymentMethod"})}});case 11:if(!(l=this.validateConfigOverride(c.config_override))){e.next=14;break}return e.abrupt("return",l);case 14:return f=this.fetchPaymentIntent(t),d=function(e){return O.startCollectingPaymentMethod(e,c)},e.prev=16,this.collectPaymentMethodAttempt=Kt.chainCancelable(f,d),this.setPaymentStatus(Yn.WAITING_FOR_INPUT),e.next=21,f.result();case 21:return m=e.sent,null!==(y=c.config_override)&&void 0!==y&&y.update_payment_intent&&this.setSimulatorConfiguration(mr({update_payment_intent:!0,payment_intent_id:m.id},this.getSimulatorConfiguration())),e.next=25,this.collectPaymentMethodAttempt.result();case 25:return b=e.sent,g=b.payment_intent,_=yr(b,hr),R={},null!==(v=c.config_override)&&void 0!==v&&v.update_payment_intent&&(m=g,R={payment_intent:g}),w={sdk_payment_details:mr(mr({},_),R),status:"requires_confirmation"},E=mr(mr({},m),w),e.abrupt("return",{paymentIntent:E});case 32:return e.prev=32,this.collectPaymentMethodAttempt=null,this.setPaymentStatus(Yn.READY),e.finish(32);case 36:case"end":return e.stop()}}),e,this,[[16,,32,36]])}))),function(e){return g.apply(this,arguments)})},{key:"collectSetupIntentPaymentMethod",value:(b=_r(regeneratorRuntime.mark((function e(t,n){var r,o,i,c,a,u,s=this,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.length>2&&void 0!==l[2]?l[2]:null,(null==(o=this.getConnectedReader())?void 0:o.device_type)!==hn.P400){e.next=4;break}return e.abrupt("return",{error:{code:p.UNSUPPORTED_FEATURE,message:h.generateErrorMessage(p.UNSUPPORTED_FEATURE,{command:"collectSetupIntentPaymentMethod"})}});case 4:if(Mt.checkType(new Ut(Hn.CLIENT_SECRET_REGEX,"SetupIntent client_secret"),t,p.INVALID_SETUP_INTENT_CLIENT_SECRET),!0===n){e.next=8;break}return i=p.CUSTOMER_CONSENT_NOT_COLLECTED,e.abrupt("return",{error:{code:i,message:h.generateErrorMessage(i,{command:"confirmSetupIntent"})}});case 8:if(this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=11;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"collectSetupIntentPaymentMethod"})}});case 11:return c=this.fetchSetupIntent(t),a=function(e){return s.startCollectingSetupIntentPaymentMethod({setup_intent_id:e.id,enable_customer_cancellation:null==r?void 0:r.enable_customer_cancellation})},e.prev=13,this.collectPaymentMethodAttempt=Kt.chainCancelable(c,a),this.setPaymentStatus(Yn.WAITING_FOR_INPUT),e.next=18,c.result();case 18:return u=e.sent,e.next=21,this.collectPaymentMethodAttempt.result();case 21:return e.abrupt("return",{setupIntent:u});case 22:return e.prev=22,this.collectPaymentMethodAttempt=null,this.setPaymentStatus(Yn.READY),e.finish(22);case 26:case"end":return e.stop()}}),e,this,[[13,,22,26]])}))),function(e,t){return b.apply(this,arguments)})},{key:"processPayment",value:(m=_r(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(an(t),this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=4;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"processPayment"})}});case 4:return this.setPaymentStatus(Yn.PROCESSING),e.prev=5,e.next=8,this.jackRabbitService.confirmPayment({payment_intent_id:t.id,payment_method:t.sdk_payment_details});case 8:if(n=e.sent,this.isPaymentSoftDeclined(n)){e.next=11;break}return e.abrupt("return",this.confirmPaymentIntentResponseToClientResponse(n));case 11:return e.next=13,this.retrySoftDeclinedPaymentIntent(n);case 13:return e.abrupt("return",e.sent);case 14:return e.prev=14,this.setPaymentStatus(Yn.READY),this.jackRabbitService.setSimulatorConfig({}),e.finish(14);case 18:case"end":return e.stop()}}),e,this,[[5,,14,18]])}))),function(e){return m.apply(this,arguments)})},{key:"confirmSetupIntent",value:(v=_r(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Mt.checkType(new Ut(/^seti_/),t.id,p.INVALID_SETUP_INTENT_INPUT_SHAPE),this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=4;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"confirmSetupIntent"})}});case 4:return this.setPaymentStatus(Yn.PROCESSING),e.prev=5,e.next=8,this.jackRabbitService.confirmSetupIntent({setup_intent_id:t.id});case 8:if(n=e.sent,!this.isPaymentSoftDeclined(n)){e.next=13;break}return e.next=12,this.retrySoftDeclinedSetupIntent(n);case 12:return e.abrupt("return",e.sent);case 13:return e.abrupt("return",this.confirmSetupIntentResponseToClientResponse(n));case 14:return e.prev=14,this.setPaymentStatus(Yn.READY),this.jackRabbitService.setSimulatorConfig({}),e.finish(14);case 18:case"end":return e.stop()}}),e,this,[[5,,14,18]])}))),function(e){return v.apply(this,arguments)})},{key:"cancelCollectPaymentMethod",value:(y=_r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mt.checkState(null!=this.collectPaymentMethodAttempt,p.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT,{command:"cancelCollectPaymentMethod"}),e.next=3,null===(t=this.collectPaymentMethodAttempt)||void 0===t?void 0:t.cancel();case 3:return this.setPaymentStatus(Yn.READY),e.abrupt("return",{});case 5:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"cancelCollectSetupIntentPaymentMethod",value:(d=_r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mt.checkState(null!=this.collectPaymentMethodAttempt,p.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT,{command:"cancelCollectSetupIntentPaymentMethod"}),e.next=3,null===(t=this.collectPaymentMethodAttempt)||void 0===t?void 0:t.cancel();case 3:return this.collectPaymentMethodAttempt=null,this.setPaymentStatus(Yn.READY),e.abrupt("return",{});case 6:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"readReusableCard",value:(f=_r(regeneratorRuntime.mark((function e(){var t,n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=4;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"readReusableCard"})}});case 4:return this.setPaymentStatus(Yn.WAITING_FOR_INPUT),e.prev=5,this.collectReusableCardAttempt=this.jackRabbitService.readReusableCard(t),e.next=9,this.collectReusableCardAttempt.result();case 9:if(!(n=e.sent).confirm_error){e.next=12;break}return e.abrupt("return",{error:{code:n.confirm_error.code,message:n.confirm_error.message||"no error message provided!"}});case 12:return e.abrupt("return",{payment_method:n.created_reusable_card||n.created_reusuable_card||{}});case 13:return e.prev=13,this.setPaymentStatus(Yn.READY),e.finish(13);case 16:case"end":return e.stop()}}),e,this,[[5,,13,16]])}))),function(){return f.apply(this,arguments)})},{key:"collectRefundPaymentMethod",value:(l=_r(regeneratorRuntime.mark((function e(t,n,r){var o,i,c,a,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:null,i=u.length>4&&void 0!==u[4]?u[4]:null,c=u.length>5&&void 0!==u[5]?u[5]:null,Mt.checkState(null!=c!=(null!=t),p.INVALID_ARGUMENT,{command:"collectRefundPaymentMethod",msg:"Refund request must have only one of payment_intent_id or charge_id."}),Mt.checkState(null!=r,p.INVALID_ARGUMENT,{command:"collectRefundPaymentMethod",msg:"Refund request must have a currency."}),null!=t&&Mt.checkType(new Ut(/^ch_/),t,p.INVALID_CHARGE_ID_INPUT_SHAPE),null!=c&&Mt.checkType(new Ut(/^pi_/),c,p.INVALID_PAYMENT_INTENT_ID_INPUT_SHAPE),Mt.checkType(new Yt("number"),n),Mt.checkType(Vt(new Ht({reverse_transfer:Vt(new Yt("boolean")),refund_application_fee:Vt(new Yt("boolean")),metadata:Vt(new Ht({}))})),o),Mt.validateInteger(n),this.ensureConnected(),this.setPaymentStatus(Yn.WAITING_FOR_INPUT),e.prev=12,this.refundInteracCardAttempt=this.jackRabbitService.collectInteracRefundMethod({charge_id:t,charge_amount:{charge_amount:n,currency:r},enable_customer_cancellation:null==i?void 0:i.enable_customer_cancellation,payment_id:c}),e.next=16,this.refundInteracCardAttempt.result();case 16:return a=e.sent,this.pendingInteracRefund={charge_id:t,payment_intent_id:c,collected_payment_method:a,options:o||{}},e.abrupt("return",{});case 19:return e.prev=19,this.refundInteracCardAttempt=null,this.setPaymentStatus(Yn.READY),e.finish(19);case 23:case"end":return e.stop()}}),e,this,[[12,,19,23]])}))),function(e,t,n){return l.apply(this,arguments)})},{key:"processRefund",value:(s=_r(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ensureConnected(),this.setPaymentStatus(Yn.PROCESSING),this.pendingInteracRefund){e.next=4;break}throw new en("No refund payment method collected. Make sure to call collectRefundPaymentMethod before processing a refund.");case 4:return e.prev=4,t=this.pendingInteracRefund.collected_payment_method,n={interac_payment_method:t,charge_id:this.pendingInteracRefund.charge_id,payment_id:this.pendingInteracRefund.payment_intent_id},this.pendingInteracRefund.options&&(this.pendingInteracRefund.options.refund_application_fee&&(n.refund_application_fee=this.pendingInteracRefund.options.refund_application_fee),this.pendingInteracRefund.options.reverse_transfer&&(n.reverse_transfer=this.pendingInteracRefund.options.reverse_transfer),this.pendingInteracRefund.options.metadata&&(n.metadata=this.pendingInteracRefund.options.metadata)),e.next=10,this.jackRabbitRpcAuthService.confirmInteracRefund(n);case 10:if(!(r=e.sent).confirm_error){e.next=13;break}return e.abrupt("return",{error:{request_id:r.request_id,code:r.confirm_error.code,message:r.confirm_error.message||"no error message provided!"}});case 13:if(!r.decline_response){e.next=15;break}return e.abrupt("return",r.decline_response);case 15:if(!r.interac_refund||"failed"!==r.interac_refund.status){e.next=17;break}return e.abrupt("return",{error:{code:p.REFUND_FAILED,message:h.generateErrorMessage(p.REFUND_FAILED),failure_reason:r.interac_refund.failure_reason}});case 17:return e.abrupt("return",{refund:r.interac_refund||{}});case 20:return e.prev=20,e.t0=e.catch(4),e.abrupt("return",{error:(o=e.t0,M(o)?o:{code:"no_code",message:"Unknown error!"})});case 23:return e.prev=23,this.setPaymentStatus(Yn.READY),e.finish(23);case 26:case"end":return e.stop()}var o}),e,this,[[4,20,23,26]])}))),function(){return s.apply(this,arguments)})},{key:"cancelCollectRefundPaymentMethod",value:(u=_r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mt.checkState(null!=this.refundInteracCardAttempt,p.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT,{command:"cancelCollectRefundPaymentMethod"}),e.next=3,null===(t=this.refundInteracCardAttempt)||void 0===t?void 0:t.cancel();case 3:return this.setPaymentStatus(Yn.READY),this.refundInteracCardAttempt=null,e.abrupt("return",{});case 6:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"cancelReadReusableCard",value:(a=_r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mt.checkState(null!=this.collectReusableCardAttempt,p.NO_ACTIVE_COLLECT_PAYMENT_METHOD_ATTEMPT,{command:"cancelReadReusableCard"}),e.next=3,null===(t=this.collectReusableCardAttempt)||void 0===t?void 0:t.cancel();case 3:return e.abrupt("return",{});case 4:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"setSimulatorConfiguration",value:function(e){Mt.checkType(new Ht({}),e),this.jackRabbitService.setSimulatorConfig(e)}},{key:"getSimulatorConfiguration",value:function(){return this.jackRabbitService.getSimulatorConfig()}},{key:"declineResponseToErrorResponse",value:function(e,t){return{error:mr(mr({},e),{},{message:(null==e?void 0:e.message)||t})}}},{key:"fetchPaymentIntent",value:function(e){var t=this;return new Kt({execute:function(){return{result:t.paymentIntentClient.loadPaymentIntentBySecret(e)}}})}},{key:"fetchSetupIntent",value:function(e){var t=this;return new Kt({execute:function(){return{result:t.setupIntentClient.loadSetupIntentBySecret(e)}}})}},{key:"startCollectingPaymentMethod",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Kt({execute:function(){var t,o,i,c,a,u,s,l,f,p,h={charge_amount:e.amount,currency:e.currency,tip_amount:0,cashback_amount:0},d=null!==(null===(t=r.config_override)||void 0===t||null===(o=t.tipping)||void 0===o?void 0:o.eligible_amount)&&cn.getInstance().isTipEligibleCircuitBreakerEnabled()?null:null===(i=r.config_override)||void 0===i||null===(c=i.tipping)||void 0===c?void 0:c.eligible_amount,y=n.jackRabbitService.collectPaymentMethod({charge_amount:h,tip_configuration:r.tip_configuration,skip_tipping:(null===(a=r.config_override)||void 0===a?void 0:a.skip_tipping)||!1,tip_eligible_amount:d,update_payment_intent:(null===(u=r.config_override)||void 0===u?void 0:u.update_payment_intent)||!1,payment_intent_id:e.id,computed_routing_priority:(null===(s=e.payment_method_options)||void 0===s||null===(l=s.card_present)||void 0===l||null===(f=l.routing)||void 0===f?void 0:f.computed_priority)||null,enable_customer_cancellation:(null===(p=r.config_override)||void 0===p?void 0:p.enable_customer_cancellation)||!1});return{result:y.result,resource:y}},onCancel:(t=_r(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.cancel();case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})})}},{key:"startCollectingSetupIntentPaymentMethod",value:function(e){var t,n=this;return new Kt({execute:function(){if(!e.setup_intent_id)throw Error("No setup intent id to collect payment method for!");var t=n.jackRabbitService.collectSetupIntentPaymentMethod(e);return{result:t.result,resource:t}},onCancel:(t=_r(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.cancel();case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})})}},{key:"confirmPaymentIntentResponseToClientResponse",value:function(e){var t,n,r,o,i;return e.confirmed_payment_intent?(nt.count("Terminal","ConfirmResult","ChargeApprove","OK"),{paymentIntent:e.confirmed_payment_intent}):e.decline_response?(nt.count("Terminal","ConfirmResult","ChargeDecline","ERROR",(null==e||null===(o=e.decline_response)||void 0===o||null===(i=o.error)||void 0===i?void 0:i.code)||"unknown_decline_error"),this.declineResponseToErrorResponse(e.decline_response.error,"Failed to confirm the payment intent")):(nt.count("Terminal","ConfirmResult","ConfirmError","ERROR",null==e||null===(t=e.confirm_error)||void 0===t?void 0:t.code),{error:{code:null==e||null===(n=e.confirm_error)||void 0===n?void 0:n.code,message:(null==e||null===(r=e.confirm_error)||void 0===r?void 0:r.message)||"No error message provided!",payment_intent:null}})}},{key:"confirmSetupIntentResponseToClientResponse",value:function(e){var t,n,r,o,i,c,a;return e.confirmed_setup_intent?(nt.count("Terminal","ConfirmResult","SetupIntentApprove","OK"),{setupIntent:e.confirmed_setup_intent}):e.decline_response?(nt.count("Terminal","ConfirmResult","SetupIntentDecline","ERROR",(null==e||null===(i=e.decline_response)||void 0===i||null===(c=i.error)||void 0===c?void 0:c.code)||"unknown_decline_error"),this.declineResponseToErrorResponse(null==e||null===(a=e.decline_response)||void 0===a?void 0:a.error,"Failed to confirm the setup intent")):(nt.count("Terminal","ConfirmResult","ConfirmSetupIntentError","ERROR",null==e||null===(t=e.confirm_error)||void 0===t?void 0:t.code),{error:{code:null==e||null===(n=e.confirm_error)||void 0===n?void 0:n.code,message:null!==(r=null==e||null===(o=e.confirm_error)||void 0===o?void 0:o.message)&&void 0!==r?r:"No error message provided!",setup_intent:null}})}},{key:"ensureConnected",value:function(){var e=this.getConnectionStatus();Mt.checkState(e===Gn.CONNECTED,p.NO_ESTABLISHED_CONNECTION)}},{key:"setPaymentStatus",value:function(e){this.paymentStatus=e,this.delegate.onPaymentStatusChange&&this.delegate.onPaymentStatusChange({status:e})}},{key:"setConnectionStatus",value:function(e){e===Gn.NOT_CONNECTED&&this.setPaymentStatus(Yn.NOT_READY),this.connectionStatus=e,this.delegate.onConnectionStatusChange&&this.delegate.onConnectionStatusChange({status:this.connectionStatus})}},{key:"overrideBaseURL",value:function(e){}},{key:"isPaymentSoftDeclined",value:function(e){var t,n;return Boolean(e.decline_response&&Or.includes((null==e||null===(t=e.decline_response)||void 0===t||null===(n=t.error)||void 0===n?void 0:n.code)||"no_soft_decline_code"))}},{key:"retrySoftDeclinedPaymentIntent",value:(c=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i,c,a,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t;case 1:if(!this.isPaymentSoftDeclined(n)){e.next=20;break}if(i=null==t||null===(r=t.decline_response)||void 0===r||null===(o=r.error)||void 0===o?void 0:o.payment_intent,this.setPaymentStatus(Yn.READY),i){e.next=6;break}throw Error("No retriable payment intent found!");case 6:return e.next=8,this.resumeCollectPaymentMethod(i);case 8:if(c=e.sent,a=c.paymentIntent,!(u=c.error)){e.next=14;break}return this.setPaymentStatus(Yn.READY),e.abrupt("return",{error:u});case 14:return this.setPaymentStatus(Yn.PROCESSING),e.next=17,this.jackRabbitService.confirmPayment({payment_intent_id:null==a?void 0:a.id,payment_method:null==a?void 0:a.sdk_payment_details});case 17:n=e.sent,e.next=1;break;case 20:return e.abrupt("return",this.confirmPaymentIntentResponseToClientResponse(n));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"retrySoftDeclinedSetupIntent",value:(i=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t;case 1:if(!this.isPaymentSoftDeclined(n)){e.next=19;break}if(i=null==t||null===(r=t.decline_response)||void 0===r||null===(o=r.error)||void 0===o?void 0:o.setup_intent){e.next=5;break}throw Error("No retriable setup intent found!");case 5:return this.setPaymentStatus(Yn.READY),e.next=8,this.resumeCollectSetupIntentPaymentMethod(i);case 8:if(!("error"in(c=e.sent))||!c.error){e.next=12;break}return this.setPaymentStatus(Yn.READY),e.abrupt("return",{error:c.error});case 12:if(!("setupIntent"in c)){e.next=17;break}return this.setPaymentStatus(Yn.PROCESSING),e.next=16,this.jackRabbitService.confirmSetupIntent({setup_intent_id:c.setupIntent.id});case 16:n=e.sent;case 17:e.next=1;break;case 19:return e.abrupt("return",this.confirmSetupIntentResponseToClientResponse(n));case 20:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"resumeCollectPaymentMethod",value:(o=_r(regeneratorRuntime.mark((function e(t){var n,r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=3;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"resumeCollectPaymentMethod"})},paymentIntent:void 0});case 3:return e.prev=3,this.setPaymentStatus(Yn.WAITING_FOR_INPUT),this.collectPaymentMethodAttempt=this.startResumingCollectPaymentMethod(t),e.next=8,this.collectPaymentMethodAttempt.result();case 8:return(n=e.sent).payment_intent,r=yr(n,dr),o={sdk_payment_details:r,status:"requires_confirmation"},i=mr(mr({},t),o),e.abrupt("return",{paymentIntent:i,error:void 0});case 13:return e.prev=13,this.collectPaymentMethodAttempt=null,this.setPaymentStatus(Yn.READY),e.finish(13);case 17:case"end":return e.stop()}}),e,this,[[3,,13,17]])}))),function(e){return o.apply(this,arguments)})},{key:"resumeCollectSetupIntentPaymentMethod",value:(r=_r(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ensureConnected(),this.paymentStatus===Yn.READY){e.next=3;break}return e.abrupt("return",{error:{code:p.COMMAND_ALREADY_IN_PROGRESS,message:h.generateErrorMessage(p.COMMAND_ALREADY_IN_PROGRESS,{command:"resumeCollectSetupIntentPaymentMethod"})}});case 3:return e.prev=3,this.setPaymentStatus(Yn.WAITING_FOR_INPUT),this.collectPaymentMethodAttempt=this.startResumingCollectSetupIntentPaymentMethod({setup_intent_id:t.id}),e.next=8,this.collectPaymentMethodAttempt.result();case 8:return e.abrupt("return",{setupIntent:t});case 9:return e.prev=9,this.collectPaymentMethodAttempt=null,this.setPaymentStatus(Yn.READY),e.finish(9);case 13:case"end":return e.stop()}}),e,this,[[3,,9,13]])}))),function(e){return r.apply(this,arguments)})},{key:"startResumingCollectSetupIntentPaymentMethod",value:function(e){var t=this;return new Kt({execute:function(){if(!e.setup_intent_id)throw Error("No setup intent id to resume!");var n=t.jackRabbitService.collectSetupIntentPaymentMethod(e);return{result:n.result,resource:n}},onCancel:function(e){e.cancel()}})}},{key:"startResumingCollectPaymentMethod",value:function(e){var t=this;return new Kt({execute:function(){if(null==e||!e.id)throw Error("No payment intent id to resume!");var n=t.jackRabbitService.resumeCollectPaymentMethod(e.id);return{result:n.result,resource:n}},onCancel:function(e){e.cancel()}})}},{key:"validateConfigOverride",value:function(e){var t,n,r;return null!=e&&null!==(t=e.tipping)&&void 0!==t&&t.eligible_amount&&e.tipping.eligible_amount<0?{error:{code:p.INVALID_TIP_PARAMETER,message:h.generateErrorMessage(p.INVALID_TIP_PARAMETER,{msg:"Invalid tip eligible amount. Tip eligible amount must be greater than or equal to 0"})}}:null!=e&&null!==(n=e.tipping)&&void 0!==n&&n.eligible_amount&&e.tipping.eligible_amount>0&&null!=e&&e.skip_tipping?{error:{code:p.INVALID_TIP_PARAMETER,message:h.generateErrorMessage(p.INVALID_TIP_PARAMETER,{msg:"Invalid combination of skip_tipping and eligible_amount. If eligible_amount is greater than 0, skip_tipping cannot be set to true."})}}:null!=e&&null!==(r=e.tipping)&&void 0!==r&&r.eligible_amount&&e.tipping.eligible_amount>Sr?{error:{code:p.INVALID_TIP_PARAMETER,message:h.generateErrorMessage(p.INVALID_TIP_PARAMETER,{msg:"Invalid tip eligible amount. Tip eligible amount must be less than ".concat(Sr)})}}:null}}])&&Rr(t.prototype,n),e}()).prototype,"discoverReaders",[qn,G],Object.getOwnPropertyDescriptor(pr.prototype,"discoverReaders"),pr.prototype),wr(pr.prototype,"connectReader",[Wn,G],Object.getOwnPropertyDescriptor(pr.prototype,"connectReader"),pr.prototype),wr(pr.prototype,"getConnectedReader",[zn],Object.getOwnPropertyDescriptor(pr.prototype,"getConnectedReader"),pr.prototype),wr(pr.prototype,"disconnectReader",[Kn,G],Object.getOwnPropertyDescriptor(pr.prototype,"disconnectReader"),pr.prototype),wr(pr.prototype,"clearCachedCredentials",[Jn,G],Object.getOwnPropertyDescriptor(pr.prototype,"clearCachedCredentials"),pr.prototype),wr(pr.prototype,"clearReaderDisplay",[$n,G],Object.getOwnPropertyDescriptor(pr.prototype,"clearReaderDisplay"),pr.prototype),wr(pr.prototype,"setReaderDisplay",[Xn,G],Object.getOwnPropertyDescriptor(pr.prototype,"setReaderDisplay"),pr.prototype),wr(pr.prototype,"collectPaymentMethod",[Qn,G],Object.getOwnPropertyDescriptor(pr.prototype,"collectPaymentMethod"),pr.prototype),wr(pr.prototype,"collectSetupIntentPaymentMethod",[Zn,G],Object.getOwnPropertyDescriptor(pr.prototype,"collectSetupIntentPaymentMethod"),pr.prototype),wr(pr.prototype,"processPayment",[er,G],Object.getOwnPropertyDescriptor(pr.prototype,"processPayment"),pr.prototype),wr(pr.prototype,"cancelCollectPaymentMethod",[tr,G],Object.getOwnPropertyDescriptor(pr.prototype,"cancelCollectPaymentMethod"),pr.prototype),wr(pr.prototype,"cancelCollectSetupIntentPaymentMethod",[nr,G],Object.getOwnPropertyDescriptor(pr.prototype,"cancelCollectSetupIntentPaymentMethod"),pr.prototype),wr(pr.prototype,"readReusableCard",[rr,G],Object.getOwnPropertyDescriptor(pr.prototype,"readReusableCard"),pr.prototype),wr(pr.prototype,"collectRefundPaymentMethod",[or,G],Object.getOwnPropertyDescriptor(pr.prototype,"collectRefundPaymentMethod"),pr.prototype),wr(pr.prototype,"processRefund",[ir,G],Object.getOwnPropertyDescriptor(pr.prototype,"processRefund"),pr.prototype),wr(pr.prototype,"cancelCollectRefundPaymentMethod",[cr,G],Object.getOwnPropertyDescriptor(pr.prototype,"cancelCollectRefundPaymentMethod"),pr.prototype),wr(pr.prototype,"cancelReadReusableCard",[ar,G],Object.getOwnPropertyDescriptor(pr.prototype,"cancelReadReusableCard"),pr.prototype),wr(pr.prototype,"setSimulatorConfiguration",[ur],Object.getOwnPropertyDescriptor(pr.prototype,"setSimulatorConfiguration"),pr.prototype),wr(pr.prototype,"getSimulatorConfiguration",[sr],Object.getOwnPropertyDescriptor(pr.prototype,"getSimulatorConfiguration"),pr.prototype),wr(pr.prototype,"resumeCollectPaymentMethod",[lr,G],Object.getOwnPropertyDescriptor(pr.prototype,"resumeCollectPaymentMethod"),pr.prototype),wr(pr.prototype,"resumeCollectSetupIntentPaymentMethod",[fr,G],Object.getOwnPropertyDescriptor(pr.prototype,"resumeCollectSetupIntentPaymentMethod"),pr.prototype),pr);function Tr(e,t){return e(),setInterval(e,t)}function Cr(e){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kr(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Ir(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){kr(i,r,o,c,a,"next",e)}function a(e){kr(i,r,o,c,a,"throw",e)}c(void 0)}))}}function xr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ar(e,t,n){return t&&xr(e.prototype,t),n&&xr(e,n),e}function Nr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jr(e,t)}function jr(e,t){return(jr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lr(e);if(t){var o=Lr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Mr(this,n)}}function Mr(e,t){return!t||"object"!==Cr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Lr(e){return(Lr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Br={method:"internet"},Fr=function e(t){Ur(this,e),this.config=t},Vr=function(e){Nr(n,e);var t=Dr(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;return Ur(this,n),(o=t.call(this,e)).discoveryClient=r,o.queryIntervalMs=i,o.intervalId=void 0,o}return Ar(n,[{key:"retrieveReader",value:function(e){return this.discoveryClient.retrieveReader(e)}},{key:"startDiscovery",value:function(e,t){var n=this;this.intervalId=Tr(Ir(regeneratorRuntime.mark((function r(){var o,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,n.discoveryClient.discoverReaders({location:null===(o=n.config)||void 0===o?void 0:o.location,device_type:n.config.device_type});case 3:(i=r.sent).has_more&&xt.error(h.generateErrorMessage(p.DISCOVERY_TOO_MANY_READERS)),e(i.data),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(0),t(r.t0);case 11:case"end":return r.stop()}}),r,null,[[0,8]])}))),this.queryIntervalMs)}},{key:"stopDiscovery",value:function(){this.intervalId&&clearInterval(this.intervalId)}}]),n}(Fr),Yr="SIMULATOR",Gr="Reader Simulator",Hr={id:Yr,object:"terminal.reader",device_type:hn.WISEPOSE,ip_address:"0.0.0.0",label:Gr,serial_number:Yr,location:"st_simulated",status:"online",device_sw_version:"0.0.0",livemode:!1,metadata:{}},qr=function(e){Nr(n,e);var t=Dr(n);function n(){return Ur(this,n),t.apply(this,arguments)}return Ar(n,[{key:"retrieveReader",value:function(e){return e!==Yr?Promise.reject():Promise.resolve(Hr)}},{key:"startDiscovery",value:function(e){e([Hr])}},{key:"stopDiscovery",value:function(){}}]),n}(Fr),Wr=function(){function e(t){Ur(this,e),this.discoveryClient=t}return Ar(e,[{key:"createDiscoveryMethod",value:function(e){return e.simulated?new qr(e):new Vr(e,this.discoveryClient)}}]),e}(),zr=function(){function e(t){Ur(this,e),this.discoveryMethodFactory=t,this.activeDiscovery=null,this.lastResult=null,this.nextResult=null}var t,n;return Ar(e,[{key:"getDiscoveredReaders",value:function(){return Mt.assert(!!this.activeDiscovery,p.DISCOVERY_NOT_RUNNING),this.lastResult}},{key:"retrieveReader",value:(n=Ir(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.discoveryMethodFactory.createDiscoveryMethod({simulated:t===Yr}),e.abrupt("return",n.retrieveReader(t));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"discoverReaders",value:(t=Ir(regeneratorRuntime.mark((function e(){var t,n=this,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:Br,this.activeDiscovery||(this.nextResult=new Promise((function(e,r){n.startDiscovery(t,(function(t){return e(t)}),(function(e){return r(e)}))})).then((function(e){return n.stopDiscovery(),e}),(function(e){return Promise.reject(e)}))),e.abrupt("return",this.nextResult);case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"startDiscovery",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Br,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Mt.assert(!this.activeDiscovery,p.DISCOVERY_ALREADY_RUNNING),this.activeDiscovery=this.discoveryMethodFactory.createDiscoveryMethod(t);var o=function(t){e.stopDiscovery(),r(t)},i=function(t){var r={discoveredReaders:t};JSON.stringify(r)!==JSON.stringify(e.lastResult)&&(e.lastResult=r,n(e.lastResult))};this.activeDiscovery.startDiscovery(i,o)}},{key:"stopDiscovery",value:function(){this.activeDiscovery&&this.activeDiscovery.stopDiscovery(),this.lastResult=null,this.activeDiscovery=null,this.nextResult=null}}]),e}(),Kr="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Kr&&Kr,Jr="URLSearchParams"in Kr,$r="Symbol"in Kr&&"iterator"in Symbol,Xr="FileReader"in Kr&&"Blob"in Kr&&function(){try{return new Blob,!0}catch(e){return!1}}(),Qr="FormData"in Kr,Zr="ArrayBuffer"in Kr;if(Zr)var eo=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],to=ArrayBuffer.isView||function(e){return e&&eo.indexOf(Object.prototype.toString.call(e))>-1};function no(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function ro(e){return"string"!=typeof e&&(e=String(e)),e}function oo(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return $r&&(t[Symbol.iterator]=function(){return t}),t}function io(e){this.map={},e instanceof io?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function co(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function ao(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function uo(e){var t=new FileReader,n=ao(t);return t.readAsArrayBuffer(e),n}function so(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function lo(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Xr&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Qr&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Jr&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Zr&&Xr&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=so(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Zr&&(ArrayBuffer.prototype.isPrototypeOf(e)||to(e))?this._bodyArrayBuffer=so(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Jr&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Xr&&(this.blob=function(){var e=co(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?co(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(uo)}),this.text=function(){var e,t,n,r=co(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=ao(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Qr&&(this.formData=function(){return this.text().then(ho)}),this.json=function(){return this.text().then(JSON.parse)},this}io.prototype.append=function(e,t){e=no(e),t=ro(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},io.prototype.delete=function(e){delete this.map[no(e)]},io.prototype.get=function(e){return e=no(e),this.has(e)?this.map[e]:null},io.prototype.has=function(e){return this.map.hasOwnProperty(no(e))},io.prototype.set=function(e,t){this.map[no(e)]=ro(t)},io.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},io.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),oo(e)},io.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),oo(e)},io.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),oo(e)},$r&&(io.prototype[Symbol.iterator]=io.prototype.entries);var fo=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function po(e,t){if(!(this instanceof po))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,o=(t=t||{}).body;if(e instanceof po){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new io(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new io(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),fo.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function ho(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function yo(e,t){if(!(this instanceof yo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new io(t.headers),this.url=t.url||"",this._initBody(e)}po.prototype.clone=function(){return new po(this,{body:this._bodyInit})},lo.call(po.prototype),lo.call(yo.prototype),yo.prototype.clone=function(){return new yo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new io(this.headers),url:this.url})},yo.error=function(){var e=new yo(null,{status:0,statusText:""});return e.type="error",e};var vo=[301,302,303,307,308];yo.redirect=function(e,t){if(-1===vo.indexOf(t))throw new RangeError("Invalid status code");return new yo(null,{status:t,headers:{location:e}})};var mo=Kr.DOMException;try{new mo}catch(e){(mo=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),mo.prototype.constructor=mo}function bo(e,t){return new Promise((function(n,r){var o=new po(e,t);if(o.signal&&o.signal.aborted)return r(new mo("Aborted","AbortError"));var i=new XMLHttpRequest;function c(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new io,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var o="response"in i?i.response:i.responseText;setTimeout((function(){n(new yo(o,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new mo("Aborted","AbortError"))}),0)},i.open(o.method,function(e){try{return""===e&&Kr.location.href?Kr.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(Xr?i.responseType="blob":Zr&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof io?o.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,ro(t.headers[e]))})),o.signal&&(o.signal.addEventListener("abort",c),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",c)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}function go(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}bo.polyfill=!0,Kr.fetch||(Kr.fetch=bo,Kr.Headers=io,Kr.Request=po,Kr.Response=yo);var Ro=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:console;go(this,e),this.stdOut=t}var t,n;return t=e,(n=[{key:"collect",value:function(e){e.log_level!==Et.WARN&&e.log_level!==Et.ERROR||this.stdOut.warn(e.message||e.exception)}}])&&_o(t.prototype,n),e}();function wo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Eo=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"collect",value:function(e){console.log(e)}}])&&wo(t.prototype,n),e}();function Oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function So(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Po=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:45e3,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;Oo(this,e),this.flushInterval=t,this.maxCapacity=n,this.interval=void 0,this.items=[]}var t,n;return t=e,(n=[{key:"start",value:function(){var e,t=this;this.interval=Tr((function(){return t.flush()}),this.flushInterval),null!==(e=window)&&void 0!==e&&e.addEventListener&&window.addEventListener("pagehide",(function(){return t.flush()}))}},{key:"collect",value:function(e){this.items.push(e),this.items.length===this.maxCapacity&&this.flush()}},{key:"flush",value:function(){if(this.items.length>0){var e=this.items;this.items=[],this.doFlush(e).catch((function(e){return xt.debug(e)}))}}},{key:"shutdown",value:function(){clearInterval(this.interval)}}])&&So(t.prototype,n),e}();function To(e){return(To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Co(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Io(e,t){return!t||"object"!==To(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xo(e){return(xo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ao(e){return{domain:e.domain,scope:e.scope,event:e.event,result:"OK"===e.result?"OK":"ERROR",outcome:e.error_code,duration:"meter"===e.type?e.duration:void 0,measurement:"gauge"===e.type?e.measurement:void 0}}var No=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ko(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xo(r);if(o){var n=xo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Io(this,e)});function c(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(r=i.call(this,n)).posDeviceId=e,r.gator=t,r}return t=c,(n=[{key:"doFlush",value:function(e){var t=this,n=e.map((function(e){return{origin_role:W.getProjectName(),origin_id:t.posDeviceId,event:Ao(e)}}));return this.gator.reportEvent({proxy_events:n})}}])&&Co(t.prototype,n),c}(Po);function jo(e){return(jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Do(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lo(e,t){return(Lo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uo(e,t){return!t||"object"!==jo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bo(e){return(Bo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lo(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bo(r);if(o){var n=Bo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Uo(this,e)});function c(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e4;return Do(this,c),(n=i.call(this,r)).posDeviceId=e,n.gator=t,n}return t=c,(n=[{key:"doFlush",value:function(e){var t=this,n=e.map((function(e){return function(e){var t;return{action_id:e.id,request_info:{user_agent:navigator.userAgent},start_time_ms:e.start_time_ms,total_time_ms:e.total_time_ms,service:e.service,method:e.method,request:e.request||JSON.stringify({}),response:e.response||JSON.stringify({}),exception:"exception"===e.type?e.exception:void 0,version_info:e.version_info,traces:e.trace_points.map((function(e){return function(e){return{time_offset_ms:e.time_offset_ms,log_point:"log"===e.type?(n=e.log,{log_level:(r=n.log_level,(Fo(o={},Et.DEBUG,0),Fo(o,Et.INFO,1),Fo(o,Et.WARN,2),Fo(o,Et.ERROR,3),o)[r]),tag:n.tag,message:"text"===n.type?n.message:void 0,exception:"exception"===n.type?n.exception:void 0}):void 0,meter_point:"meter"===e.type?(t=e.meter,{event_name:t.event,elapsed_ms:t.duration}):void 0};var t,n,r,o}(e)})),additional_context:{action_id:e.id,session_id:e.session_id||"",serial_number:(null===(t=e.connected_reader)||void 0===t?void 0:t.serial_number)||""}}}(e)})).map((function(e){return{origin_role:W.getProjectName(),origin_id:t.posDeviceId,trace:e}}));return this.gator.reportTrace({proxy_traces:n})}}])&&Mo(t.prototype,n),c}(Po);function Yo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Go=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serializedPromise=Promise.resolve()}var t,n;return t=e,(n=[{key:"synchronize",value:function(e){return this.serializedPromise=this.serializedPromise.then((function(){return e()}),(function(){return e()})),this.serializedPromise}}])&&Yo(t.prototype,n),e}();function Ho(e){return(Ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zo(e,t,n){return(zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$o(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Ko(e,t){return(Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jo(e,t){return!t||"object"!==Ho(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $o(e){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xo(e){return(Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ei(e,t){return!t||"object"!==Xo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ti(e){return(ti=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ni=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zo(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ti(r);if(o){var n=ti(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ei(this,e)});function c(e,t,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),i.call(this,"JackRabbitService",e,t,n)}return t=c,(n=[{key:"getUntracedMethods",value:function(){return["queryPaymentMethod","queryCollectSource"]}},{key:"createRpcHeaders",value:function(){return new Headers({"X-Stripe-Session-Id":we.getSessionId(),"X-Stripe-Action-Id":we.getActiveTraceId()})}},{key:"activateTerminal",value:function(e,t){return this.rpc("activateTerminal",e,t,{isRetriable:!1})}},{key:"terminalHeartbeat",value:function(e,t){return this.rpc("terminalHeartbeat",e,t)}},{key:"setReaderDisplay",value:function(e,t){return this.rpc("setReaderDisplay",e,t)}},{key:"fetchReaderConfig",value:function(e,t){return this.rpc("fetchReaderConfig",e,t)}},{key:"clearReaderDisplay",value:function(e,t){return this.rpc("clearReaderDisplay",e,t)}},{key:"collectPaymentMethod",value:function(e,t){return this.rpc("collectPaymentMethod",e,t)}},{key:"queryPaymentMethod",value:function(e,t){return this.rpc("queryPaymentMethod",e,t)}},{key:"confirmPayment",value:function(e,t){return this.rpc("confirmPayment",e,t)}},{key:"resumeCollectPaymentMethod",value:function(e,t){return this.rpc("resumeCollectPaymentMethod",e,t)}},{key:"cancelCollectPaymentMethod",value:function(e,t){return this.rpc("cancelCollectPaymentMethod",e,t)}},{key:"collectSetupIntentPaymentMethod",value:function(e,t){return this.rpc("collectSetupIntentPaymentMethod",e,t)}},{key:"querySetupIntentPaymentMethod",value:function(e,t){return this.rpc("querySetupIntentPaymentMethod",e,t)}},{key:"cancelSetupIntentPaymentMethod",value:function(e,t){return this.rpc("cancelSetupIntentPaymentMethod",e,t)}},{key:"resumeCollectSetupIntentPaymentMethod",value:function(e,t){return this.rpc("resumeCollectSetupIntentPaymentMethod",e,t)}},{key:"confirmSetupIntent",value:function(e,t){return this.rpc("confirmSetupIntent",e,t)}},{key:"collectReusableCard",value:function(e,t){return this.rpc("collectReusableCard",e,t)}},{key:"queryCollectReusableCard",value:function(e,t){return this.rpc("queryCollectReusableCard",e,t)}},{key:"confirmReusableCard",value:function(e,t){return this.rpc("confirmReusableCard",e,t)}},{key:"cancelCollectReusableCard",value:function(e,t){return this.rpc("cancelCollectReusableCard",e,t)}},{key:"collectInteracRefundMethod",value:function(e,t){return this.rpc("collectInteracRefundMethod",e,t)}},{key:"queryInteracRefundMethod",value:function(e,t){return this.rpc("queryInteracRefundMethod",e,t)}},{key:"confirmInteracRefund",value:function(e,t){return this.rpc("confirmInteracRefund",e,t)}},{key:"cancelCollectInteracRefundMethod",value:function(e,t){return this.rpc("cancelCollectInteracRefundMethod",e,t)}}])&&Qo(t.prototype,n),c}(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$o(r);if(o){var n=$o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Jo(this,e)});function c(){var e;qo(this,c);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))).synchronizer=new Go,e}return t=c,(n=[{key:"rpc",value:function(e,t,n,r){var o=this;return this.synchronizer.synchronize((function(){return zo($o(c.prototype),"rpc",o).call(o,e,t,n,r)}))}}])&&Wo(t.prototype,n),c}($e));function ri(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function oi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){ri(i,r,o,c,a,"next",e)}function a(e){ri(i,r,o,c,a,"throw",e)}c(void 0)}))}}function ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ci=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.connectionMgr=t}var t,n,r,o,i,c,a,u,s,l,f,p,h,d,y,v,m,b,g,_,R,w,E;return t=e,(n=[{key:"confirmInteracRefund",value:(E=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.confirmInteracRefund(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"queryPaymentMethod",value:(w=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.queryPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"collectReusableCard",value:(R=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.collectReusableCard(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"collectSetupIntentPaymentMethod",value:(_=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.collectSetupIntentPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"querySetupIntentPaymentMethod",value:(g=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.querySetupIntentPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"cancelSetupIntentPaymentMethod",value:(b=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.cancelSetupIntentPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"resumeCollectSetupIntentPaymentMethod",value:(m=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.resumeCollectSetupIntentPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"confirmSetupIntent",value:(v=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.confirmSetupIntent(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"fetchReaderConfig",value:(y=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.fetchReaderConfig(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"setReaderDisplay",value:(d=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.setReaderDisplay(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"resumeCollectPaymentMethod",value:(h=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.resumeCollectPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"clearReaderDisplay",value:(p=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.clearReaderDisplay(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"collectPaymentMethod",value:(f=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.collectPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"queryInteracRefundMethod",value:(l=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.queryInteracRefundMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"collectInteracRefund",value:(s=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.collectInteracRefundMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"cancelCollectInteracRefundMethod",value:(u=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.cancelCollectInteracRefundMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"queryCollectReusableCard",value:(a=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.queryCollectReusableCard(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"cancelCollectReusableCard",value:(c=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.cancelCollectReusableCard(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"confirmReusableCard",value:(i=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.confirmReusableCard(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"confirmPayment",value:(o=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.confirmPayment(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"cancelCollectPaymentMethod",value:(r=oi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionMgr.rabbitCallAuthenticated((function(e,n){return e.cancelCollectPaymentMethod(t,n)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}])&&ii(t.prototype,n),e}();function ai(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function ui(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){ai(i,r,o,c,a,"next",e)}function a(e){ai(i,r,o,c,a,"throw",e)}c(void 0)}))}}function si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function li(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var fi=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];si(this,e),this.connectionMgr=t,this.rpcAuthService=n,this.querySettleIntervalMs=r,this.allowCustomerCancel=o}var t,n,r,o;return t=e,(n=[{key:"hasCustomerCanceled",value:function(e){return null!=e&&this.allowCustomerCancel&&e>0}},{key:"hasReusableCard",value:function(e){return null!=e.reusable_card_method}},{key:"setSimulatorConfig",value:function(e){this.connectionMgr.simulatorConfiguration=e}},{key:"getSimulatorConfig",value:function(){return this.connectionMgr.simulatorConfiguration}},{key:"setOnUnexpectedDisconnectHandler",value:function(e){this.connectionMgr.setOnUnexpectedDisconnectHandler(e)}},{key:"connect",value:function(e,t){return this.connectionMgr.connect(e,t)}},{key:"getConnectedReader",value:function(){var e=this.connectionMgr.getActiveConnection();return e?e.reader:null}},{key:"disconnect",value:function(){return this.connectionMgr.getActiveConnection()&&this.rpcAuthService.clearReaderDisplay({}),this.connectionMgr.disconnect()}},{key:"collectSetupIntentPaymentMethod",value:function(e){var t,n=this,r=!1;return{result:function(){var t=ui(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.rpcAuthService.collectSetupIntentPaymentMethod(e);case 2:return t.abrupt("return",n.waitForPaymentMethod({isCanceled:function(){return r},queryPaymentMethod:function(){return n.rpcAuthService.querySetupIntentPaymentMethod({})},cancel:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.rpcAuthService.cancelSetupIntentPaymentMethod({});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()(),cancel:(t=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,e.abrupt("return",n.rpcAuthService.cancelSetupIntentPaymentMethod({}));case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}}},{key:"confirmPayment",value:(o=ui(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.rpcAuthService.confirmPayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"confirmSetupIntent",value:function(e){return this.rpcAuthService.confirmSetupIntent(e)}},{key:"collectInteracRefundMethod",value:function(e){var t=this;return new Kt({execute:function(n){return{result:function(){var r=ui(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.rpcAuthService.collectInteracRefund(e);case 2:return r.abrupt("return",t.waitForPaymentMethod({isCanceled:n,queryPaymentMethod:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.rpcAuthService.queryInteracRefundMethod({}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cancel:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.rpcAuthService.cancelCollectInteracRefundMethod({});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}));case 3:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}()()}},onCancel:function(){t.rpcAuthService.cancelCollectInteracRefundMethod({})}})}},{key:"readReusableCard",value:function(e){var t=this,n=new Kt({execute:function(n){return{result:function(){var r=ui(regeneratorRuntime.mark((function r(){var o,i,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.rpcAuthService.collectReusableCard(e);case 2:i={};case 3:if(t.hasReusableCard(i)){r.next=18;break}return r.next=6,Se(t.querySettleIntervalMs);case 6:if(!n()){r.next=8;break}throw w.fromErrorCode(p.CANCELED);case 8:if("REUSABLE_CARD_CANCELED"!==i.reusable_card_status){r.next=10;break}throw w.fromErrorCode(p.CANCELED_BY_CUSTOMER);case 10:if(!t.hasCustomerCanceled(null===(c=i)||void 0===c?void 0:c.num_of_canceled_payments)){r.next=13;break}throw t.rpcAuthService.cancelCollectReusableCard({}),w.fromErrorCode(p.CANCELED_BY_CUSTOMER);case 13:return r.next=15,t.rpcAuthService.queryCollectReusableCard({});case 15:i=r.sent,r.next=3;break;case 18:if(null!==(o=i)&&void 0!==o&&o.reusable_card_method){r.next=20;break}throw Error("No proper IPaymentMethod returned!");case 20:return r.abrupt("return",i.reusable_card_method);case 21:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}()()}},onCancel:function(){t.rpcAuthService.cancelCollectReusableCard({})}});return Kt.chainCancelable(n,(function(e){return new Kt({execute:function(){return{result:t.rpcAuthService.confirmReusableCard({reusable_card_method:e})}}})}))}},{key:"collectPaymentMethod",value:function(e){var t,n=this,r=!1;return{result:function(){var t=ui(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.rpcAuthService.collectPaymentMethod(e);case 2:return t.abrupt("return",n.waitForPaymentMethod({isCanceled:function(){return r},queryPaymentMethod:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.rpcAuthService.queryPaymentMethod({}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cancel:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.rpcAuthService.cancelCollectPaymentMethod({});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()(),cancel:(t=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,e.abrupt("return",n.rpcAuthService.cancelCollectPaymentMethod({}));case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}}},{key:"resumeCollectPaymentMethod",value:function(e){var t,n=this,r=!1;return{result:function(){var t=ui(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.rpcAuthService.resumeCollectPaymentMethod({payment_intent_id:e});case 2:return t.abrupt("return",n.waitForPaymentMethod({isCanceled:function(){return r},queryPaymentMethod:function(){return n.rpcAuthService.queryPaymentMethod({})},cancel:function(){var e=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.rpcAuthService.cancelCollectPaymentMethod({});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()(),cancel:(t=ui(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,e.abrupt("return",n.rpcAuthService.cancelCollectPaymentMethod({}));case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}}},{key:"waitForPaymentMethod",value:(r=ui(regeneratorRuntime.mark((function e(t){var n,r,o,i,c,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.isCanceled,r=t.queryPaymentMethod,o=t.cancel,e.next=3,r();case 3:i=e.sent;case 4:if(null!=i.payment_method){e.next=19;break}return e.next=7,Se(this.querySettleIntervalMs);case 7:if(!n()){e.next=9;break}throw w.fromErrorCode(p.CANCELED);case 9:if("PAYMENT_CANCELED"!==i.payment_status){e.next=11;break}throw w.fromErrorCode(p.CANCELED_BY_CUSTOMER);case 11:if(!this.hasCustomerCanceled(null===(c=i)||void 0===c?void 0:c.num_of_canceled_payments)){e.next=14;break}throw o(),w.fromErrorCode(p.CANCELED_BY_CUSTOMER);case 14:return e.next=16,r();case 16:i=e.sent,e.next=4;break;case 19:return a=i.payment_method,i.payment_intent&&(a.payment_intent=i.payment_intent),e.abrupt("return",a);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}])&&li(t.prototype,n),e}();function pi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(n),!0).forEach((function(t){di(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yi(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function vi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){yi(i,r,o,c,a,"next",e)}function a(e){yi(i,r,o,c,a,"throw",e)}c(void 0)}))}}function mi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gi(e,t){var n;if((null==t?void 0:t.id)===Yr)return{simulator:!0,url_path:e,port:null};var r=null==t||null===(n=t.ip_address)||void 0===n?void 0:n.replace(/\./g,"-"),o=(null==t?void 0:t.base_url)||"device.stripe-terminal-local-reader.net";return{url_path:"https://".concat(r,".").concat(o),port:4443}}function _i(e){return e instanceof Le?"NETWORK_UNAVAILABLE"===e.rpcEc()?w.fromErrorCode(p.READER_CONNECTION_ERROR,{rpcEndpoint:null}):new w(e.error.message):(nt.count("JackRabbitConnectionMgr","UnexpectedNonRpcError",e.toString(),"ERROR"),new w(e.toString()))}var Ri,wi="https://terminal-simulator.stripe.com",Ei=function(){function e(t,n,r,o){var i=this,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:wi,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:6e4;mi(this,e),this.deviceFingerprint=t,this.connectionTokenMgr=n,this.jackRabbitRpcServiceFactory=r,this.gatorRpcService=o,this.simulatorBaseUrl=c,this.heartbeatIntervalMs=a,this.sessionToken=null,this.jackRabbitRpcClient=null,this.rabbitCall=null,this.synchronizer=new Go,this.preConnectionReader=null,this.activeConnection=null,this.onUnexpectedDisconnectHandler=function(){},this.simulatorConfiguration=null,this.readerConfigHash=null,this.rabbitCallFactory=function(e){return e.id===Yr?function(e,t,n){var r=function(){var r=vi(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,e){r.next=3;break}throw Error("no resolved client!");case 3:return"setSimulatorConfig"in e&&e.setSimulatorConfig(i.simulatorConfiguration),r.next=6,t(e,n||"activate_session_token");case 6:return r.abrupt("return",r.sent);case 9:throw r.prev=9,r.t0=r.catch(0),o=r.t0 instanceof Le||r.t0 instanceof Error?r.t0:new Error("Unknown error!"),i.handleErrors(o),_i(o);case 14:case"end":return r.stop()}}),r,null,[[0,9]])})));return function(){return r.apply(this,arguments)}}();return i.synchronizer.synchronize(r)}:function(e,t,n){var r=function(){var r=vi(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,e){r.next=3;break}throw Error("no resolved client!");case 3:return r.next=5,t(e,n||"activate_session_token");case 5:return r.abrupt("return",r.sent);case 8:throw r.prev=8,r.t0=r.catch(0),o=r.t0 instanceof Le||r.t0 instanceof Error?r.t0:new Error("Unknown error!"),i.handleErrors(o),_i(o);case 13:case"end":return r.stop()}}),r,null,[[0,8]])})));return function(){return r.apply(this,arguments)}}();return i.synchronizer.synchronize(r)}}}var t,n,r,o,i,c;return t=e,(n=[{key:"setOnUnexpectedDisconnectHandler",value:function(e){this.onUnexpectedDisconnectHandler=e}},{key:"connect",value:(c=vi(regeneratorRuntime.mark((function e(t,n){var r,o,i,c,a,u,s,l,f,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mt.assert(!this.activeConnection,p.ALREADY_CONNECTED),this.preConnectionReader=t,r=gi(this.simulatorBaseUrl,this.preConnectionReader),o=this.jackRabbitRpcServiceFactory(r,t),this.rabbitCall=this.rabbitCallFactory(t),e.prev=5,e.next=8,this.connectionTokenMgr.getActiveCredentials();case 8:return u=e.sent,e.next=11,this.activateTerminal(u,o,n);case 11:if(s=e.sent,l=(null==s||null===(i=s.version)||void 0===i?void 0:i.client_version)||"0.0.0.0",f=(null==s||null===(c=s.version)||void 0===c?void 0:c.client_type)||"RACCOON",ve(W.getProjectConfig().minRabbitVersion[f],l)){e.next=16;break}throw new w(p.INVALID_READER_VERSION);case 16:return nt.count("JackRabbitConnectionMgr","ReaderVersion",l,"OK"),nt.count("JackRabbitConnectionMgr","ReaderType",(null==s||null===(a=s.version)||void 0===a?void 0:a.client_type)||"Unknown","OK"),this.sessionToken=s.session_token||null,this.gatorRpcService&&(s.sdk_rpc_session&&(this.gatorRpcService.sessionToken=s.sdk_rpc_session),s.account_id&&(this.gatorRpcService.accountId=s.account_id)),this.jackRabbitRpcClient=o,e.next=23,this.terminalHeartbeat();case 23:return this.activeConnection={posId:this.deviceFingerprint,reader:this.preConnectionReader,sdkRpcSession:s.sdk_rpc_session,heartbeatIntervalId:setInterval((function(){return h.terminalHeartbeat()}),this.heartbeatIntervalMs)},e.abrupt("return",this.activeConnection);case 27:throw e.prev=27,e.t0=e.catch(5),this.clearSession(),e.t0;case 31:case"end":return e.stop()}}),e,this,[[5,27]])}))),function(e,t){return c.apply(this,arguments)})},{key:"getActiveConnection",value:function(){return this.activeConnection}},{key:"disconnect",value:function(){return this.clearSession(),Promise.resolve({})}},{key:"rabbitCallAuthenticated",value:(i=vi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Mt.assert(null!=this.jackRabbitRpcClient&&null!=this.sessionToken,p.NO_ESTABLISHED_CONNECTION),this.rabbitCall){e.next=3;break}throw Error("no rabbit call defined!");case 3:return e.abrupt("return",this.rabbitCall(this.jackRabbitRpcClient,t,this.sessionToken));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clearSession",value:function(){this.activeConnection&&clearInterval(this.activeConnection.heartbeatIntervalId),this.activeConnection=null,this.connectionTokenMgr.invalidateConnectionToken(),this.sessionToken=null,this.jackRabbitRpcClient=null,this.readerConfigHash=null}},{key:"handleErrors",value:function(e){if(e instanceof Le){var t=e.errorType()===Re.RPC&&Me(e.rpcEc()),n=e.errorType()===Re.APPLICATION&&function(e){return"AUTHENTICATION_FAILURE"===e||"UNAUTHORIZED"===e||"INVALID_SESSION_TOKEN"===e}(e.applicationEc()),r=!window.navigator.onLine;if(n&&xt.error(h.generateErrorMessage(p.AUTHENTICATION_ERROR)),t)if(r)xt.error(h.generateErrorMessage(p.INTERNET_CONNECTION_UNAVAILABLE));else if(this.activeConnection||this.preConnectionReader){var o,i=gi(this.simulatorBaseUrl,this.activeConnection?this.activeConnection.reader:this.preConnectionReader||null);xt.error(h.generateErrorMessage(p.READER_CONNECTION_ERROR,{rpcEndpoint:i})),Mt.softAssert("offline"===(null===(o=this.preConnectionReader)||void 0===o?void 0:o.status),p.READER_CONNECTION_ERROR)}else xt.error(h.generateErrorMessage(p.READER_CONNECTION_ERROR,{rpcEndpoint:null}));if(n||t){var c=!!this.activeConnection;this.clearSession(),c&&this.onUnexpectedDisconnectHandler({error:{message:e.error.message}})}}}},{key:"terminalHeartbeat",value:(o=vi(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.rabbitCallAuthenticated((function(e,t){return e.terminalHeartbeat({},t)}));case 2:if((null==(t=e.sent)?void 0:t.reader_config_hash)===this.readerConfigHash){e.next=15;break}return e.prev=4,e.next=7,this.rabbitCallAuthenticated((function(e,t){return e.fetchReaderConfig({},t)}));case 7:r=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),r={reader_feature_flags:{}};case 13:cn.setFlags((null===(n=r)||void 0===n?void 0:n.reader_feature_flags)||null),this.readerConfigHash=null==t?void 0:t.reader_config_hash;case 15:return e.abrupt("return",t);case 16:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return o.apply(this,arguments)})},{key:"activateTerminal",value:(r=vi(regeneratorRuntime.mark((function e(t,n,r){var o,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=hi(hi({},r),{},{pos_activation_token:t,store_name:"empty",pos_device_id:this.deviceFingerprint,pos_software_info:{pos_type:W.getProjectName(),sdk_version:W.getVersion()}}),this.rabbitCall){e.next=3;break}throw Error("no rabbit call defined!");case 3:return e.abrupt("return",this.rabbitCall(n,(function(){return n.activateTerminal(o,i.sessionToken||void 0)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"setSessionTokenEarlierThanActivate",value:function(e){this.sessionToken||(this.sessionToken=e)}}])&&bi(t.prototype,n),e}();function Oi(e){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Si(Object(n),!0).forEach((function(t){Ti(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Si(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ci(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ki(e,t){return(ki=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ii(e,t){return!t||"object"!==Oi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xi(e){return(xi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.NONE="none",e.VERBOSE="verbose"}(Ri||(Ri={}));var Ai={url_path:"https://gator.stripe.com",port:443},Ni=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ki(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xi(r);if(o){var n=xi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ii(this,e)});function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=i.call(this,"GatorService",e,Ai,t)).sessionToken=void 0,n.accountId=void 0,n}return t=c,(n=[{key:"createRpcHeaders",value:function(){return new Headers({"X-Stripe-Session-Token":this.sessionToken||"","Stripe-Account":this.accountId||""})}},{key:"createRpcRequest",value:function(e,t,n){var r=Pi(Pi({},de),{},{client_version:"d58ac1b"});return{id:Date.now(),service:this.serviceName,method:e,content:Ke(JSON.stringify(t)),session_token:n||"",version_info:r,parent_trace_id:we.getActiveTraceId()||"",device_info:he()}}},{key:"reportEvent",value:function(e){return this.rpc("reportEvent",e,this.sessionToken)}},{key:"reportTrace",value:function(e){return this.rpc("reportTrace",e,this.sessionToken)}},{key:"reportLogEvents",value:function(e){return this.rpc("reportLogEvents",e,this.sessionToken)}}])&&Ci(t.prototype,n),c}($e);function ji(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Di(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){ji(i,r,o,c,a,"next",e)}function a(e){ji(i,r,o,c,a,"throw",e)}c(void 0)}))}}function Mi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Li=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchConnectionTokenFn=t,this.networkMonitor=n,this.activeCredentials=null}var t,n,r;return t=e,(n=[{key:"getActiveCredentials",value:(r=Di(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.activeCredentials||(this.activeCredentials=this.networkMonitor.withMonitoring("ConnectionTokenMgr","get",Di(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.fetchConnectionTokenFn(),e.next=4,n;case 4:return r=e.sent,Mt.assert(!!r&&"string"==typeof r&&r.startsWith("pst_"),p.INVALID_CONNECTION_TOKEN,{token:r}),e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(0),t.invalidateConnectionToken(),o=p.FAILED_FETCH_CONNECTION_TOKEN,xt.error(h.generateErrorMessage(o)),new A(h.generateError(o));case 15:case"end":return e.stop()}}),e,null,[[0,9]])}))))),e.abrupt("return",this.activeCredentials);case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"invalidateConnectionToken",value:function(){this.activeCredentials=null}}])&&Mi(t.prototype,n),e}();function Ui(e){return(Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vi(e,t){return(Vi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yi(e,t){return!t||"object"!==Ui(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Gi(e){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vi(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gi(r);if(o){var n=Gi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Yi(this,e)});function c(){var e;Bi(this,c);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))).simulatorConfiguration={},e}return t=c,(n=[{key:"setSimulatorConfig",value:function(e){this.simulatorConfiguration=e||{}}},{key:"createRpcRequest",value:function(e,t,n){var r={id:Date.now(),service:this.serviceName,method:e,content:Ke(JSON.stringify(t)),session_token:n||"",version_info:de,parent_trace_id:we.getActiveTraceId()||"",device_info:he()};return r.config=JSON.stringify(this.simulatorConfiguration),r}}])&&Fi(t.prototype,n),c}(ni);function qi(e){return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zi(e,t){return(zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ki(e,t){return!t||"object"!==qi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ji(e){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $i,Xi,Qi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zi(e,t)}(c,e);var t,n,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ji(r);if(o){var n=Ji(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ki(this,e)});function c(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(r=i.call(this,n)).posDeviceId=e,r.gator=t,r}return t=c,(n=[{key:"doFlush",value:function(e){var t=this,n=e.filter((function(e){return"object"===qi(e)&&"log"===e.type})).map((function(e){return function(e,t){return{instant:e.instant,tags:{domain:e.domain||"unknown_domain",scope:e.scope||"unknown_scope",event:e.event,result:"OK"===e.result?"OK":"ERROR",outcome:e.error_code||"unknown_outcome",origin_id:t}}}(e,t.posDeviceId)}));return void 0===n||0===n.length?Promise.resolve():this.gator.reportLogEvents({events:n})}}])&&Wi(t.prototype,n),c}(Po);function Zi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ec,tc,nc,rc,oc,ic,cc=($i=ct(),ec=Xi=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"create",value:function(e){Mt.checkUserGivenArg("function"==typeof e.onFetchConnectionToken,p.INVALID_ON_FETCH_CONNECTION_TOKEN),Mt.checkUserGivenArg("function"==typeof e.onUnexpectedReaderDisconnect,p.INVALID_ON_UNEXPECTED_READER_DISCONNECT),Mt.checkUserGivenArg(!e.onConnectionStatusChange||"function"==typeof e.onConnectionStatusChange,p.INVALID_ON_CONNECTION_STATUS_CHANGE),Mt.checkUserGivenArg(!e.onPaymentStatusChange||"function"==typeof e.onPaymentStatusChange,p.INVALID_ON_PAYMENT_STATUS_CHANGE);var t=new ln,n=he(),r=new dn,o=[we];o.push(new Ro);var i=[],c=[nt];if(e.logLevel===Ri.VERBOSE){var a=new Eo;o.push(a),i.push(a),c.push(a),console.log("Stripe Terminal: Pos Device ID is ".concat(n.device_uuid,". Please send this when requesting assistance from support for fastest help. Happy Coding :)"))}var u=null,s=n.device_uuid||"unknown_device_uuid";u=new Ni(t,r);var l=new No(s,u);l.start(),i.push(l);var f=new Qi(s,u);i.push(f);var h=new Vo(s,u);h.start(),c.push(h),xt.setCollectors(o),nt.setCollectors(i),we.setCollectors(c);var d=new Li(e.onFetchConnectionToken,r),y=new Pn(t,d,r),v=new Wr(y),m=new zr(v),b=new ln(2e4),g=new Ei(s,d,(function(e,t){return t.id===Yr?new Hi(b,e,r):new ni(b,e,r)}),u,e.simulatorBaseUrl),_=new ci(g),R=new fi(g,_,void 0,e.readerBehavior&&e.readerBehavior.allowCustomerCancel),w=new jn(t,d,r),E=new Hn(t,d,r);return y.handlePosRpcSessionResponse=function(e){g.setSessionTokenEarlierThanActivate(e.sdk_rpc_session_token),u&&(u.sessionToken=e.sdk_rpc_session_token)},new Pr(m,R,_,e,w,E,d)}}],null&&Zi(t.prototype,null),n&&Zi(t,n),e}(),tc="create",nc=[$i],rc=Object.getOwnPropertyDescriptor(Xi,"create"),oc=Xi,ic={},Object.keys(rc).forEach((function(e){ic[e]=rc[e]})),ic.enumerable=!!ic.enumerable,ic.configurable=!!ic.configurable,("value"in ic||ic.initializer)&&(ic.writable=!0),ic=nc.slice().reverse().reduce((function(e,t){return t(ec,tc,e)||e}),ic),oc&&void 0!==ic.initializer&&(ic.value=ic.initializer?ic.initializer.call(oc):void 0,ic.initializer=void 0),void 0===ic.initializer&&(Object.defineProperty(ec,tc,ic),ic=null),Xi);function ac(e){return cc.create(e)}},3099:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},6077:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},1223:function(e,t,n){var r=n(5112),o=n(30),i=n(3070),c=r("unscopables"),a=Array.prototype;null==a[c]&&i.f(a,c,{configurable:!0,value:o(null)}),e.exports=function(e){a[c][e]=!0}},1530:function(e,t,n){"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5787:function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},9670:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},8533:function(e,t,n){"use strict";var r=n(2092).forEach,o=n(9341)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},1318:function(e,t,n){var r=n(5656),o=n(7466),i=n(1400),c=function(e){return function(t,n,c){var a,u=r(t),s=o(u.length),l=i(c,s);if(e&&n!=n){for(;s>l;)if((a=u[l++])!=a)return!0}else for(;s>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},2092:function(e,t,n){var r=n(9974),o=n(8361),i=n(7908),c=n(7466),a=n(5417),u=[].push,s=function(e){var t=1==e,n=2==e,s=3==e,l=4==e,f=6==e,p=7==e,h=5==e||f;return function(d,y,v,m){for(var b,g,_=i(d),R=o(_),w=r(y,v,3),E=c(R.length),O=0,S=m||a,P=t?S(d,E):n||p?S(d,0):void 0;E>O;O++)if((h||O in R)&&(g=w(b=R[O],O,_),e))if(t)P[O]=g;else if(g)switch(e){case 3:return!0;case 5:return b;case 6:return O;case 2:u.call(P,b)}else switch(e){case 4:return!1;case 7:u.call(P,b)}return f?-1:s||l?l:P}};e.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterOut:s(7)}},1194:function(e,t,n){var r=n(7293),o=n(5112),i=n(7392),c=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[c]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,n){"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},3671:function(e,t,n){var r=n(3099),o=n(7908),i=n(8361),c=n(7466),a=function(e){return function(t,n,a,u){r(n);var s=o(t),l=i(s),f=c(s.length),p=e?f-1:0,h=e?-1:1;if(a<2)for(;;){if(p in l){u=l[p],p+=h;break}if(p+=h,e?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:f>p;p+=h)p in l&&(u=n(u,l[p],p,s));return u}};e.exports={left:a(!1),right:a(!0)}},5417:function(e,t,n){var r=n(111),o=n(3157),i=n(5112)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},7072:function(e,t,n){var r=n(5112)("iterator"),o=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){o=!0}};c[r]=function(){return this},Array.from(c,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},4326:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},648:function(e,t,n){var r=n(1694),o=n(4326),i=n(5112)("toStringTag"),c="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:c?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},5631:function(e,t,n){"use strict";var r=n(3070).f,o=n(30),i=n(2248),c=n(9974),a=n(5787),u=n(408),s=n(654),l=n(6340),f=n(9781),p=n(2423).fastKey,h=n(9909),d=h.set,y=h.getterFor;e.exports={getConstructor:function(e,t,n,s){var l=e((function(e,r){a(e,l,t),d(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),f||(e.size=0),null!=r&&u(r,e[s],{that:e,AS_ENTRIES:n})})),h=y(t),v=function(e,t,n){var r,o,i=h(e),c=m(e,t);return c?c.value=n:(i.last=c={index:o=p(t,!0),key:t,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=c),r&&(r.next=c),f?i.size++:e.size++,"F"!==o&&(i.index[o]=c)),e},m=function(e,t){var n,r=h(e),o=p(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return i(l.prototype,{clear:function(){for(var e=h(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,f?e.size=0:this.size=0},delete:function(e){var t=this,n=h(t),r=m(t,e);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first==r&&(n.first=o),n.last==r&&(n.last=i),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=h(this),r=c(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!m(this,e)}}),i(l.prototype,n?{get:function(e){var t=m(this,e);return t&&t.value},set:function(e,t){return v(this,0===e?0:e,t)}}:{add:function(e){return v(this,e=0===e?0:e,e)}}),f&&r(l.prototype,"size",{get:function(){return h(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",o=y(t),i=y(r);s(e,t,(function(e,t){d(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),l(t)}}},7710:function(e,t,n){"use strict";var r=n(2109),o=n(7854),i=n(4705),c=n(1320),a=n(2423),u=n(408),s=n(5787),l=n(111),f=n(7293),p=n(7072),h=n(8003),d=n(9587);e.exports=function(e,t,n){var y=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),m=y?"set":"add",b=o[e],g=b&&b.prototype,_=b,R={},w=function(e){var t=g[e];c(g,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!l(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(i(e,"function"!=typeof b||!(v||g.forEach&&!f((function(){(new b).entries().next()})))))_=n.getConstructor(t,e,y,m),a.REQUIRED=!0;else if(i(e,!0)){var E=new _,O=E[m](v?{}:-0,1)!=E,S=f((function(){E.has(1)})),P=p((function(e){new b(e)})),T=!v&&f((function(){for(var e=new b,t=5;t--;)e[m](t,t);return!e.has(-0)}));P||((_=t((function(t,n){s(t,_,e);var r=d(new b,t,_);return null!=n&&u(n,r[m],{that:r,AS_ENTRIES:y}),r}))).prototype=g,g.constructor=_),(S||T)&&(w("delete"),w("has"),y&&w("get")),(T||O)&&w(m),v&&g.clear&&delete g.clear}return R[e]=_,r({global:!0,forced:_!=b},R),h(_,e),v||n.setStrong(_,e,y),_}},9920:function(e,t,n){var r=n(6656),o=n(3887),i=n(1236),c=n(3070);e.exports=function(e,t){for(var n=o(t),a=c.f,u=i.f,s=0;s<n.length;s++){var l=n[s];r(e,l)||a(e,l,u(t,l))}}},4964:function(e,t,n){var r=n(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:function(e,t,n){var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:function(e,t,n){"use strict";var r=n(3383).IteratorPrototype,o=n(30),i=n(9114),c=n(8003),a=n(7497),u=function(){return this};e.exports=function(e,t,n){var s=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),c(e,s,!1,!0),a[s]=u,e}},8880:function(e,t,n){var r=n(9781),o=n(3070),i=n(9114);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,n){"use strict";var r=n(7593),o=n(3070),i=n(9114);e.exports=function(e,t,n){var c=r(t);c in e?o.f(e,c,i(0,n)):e[c]=n}},654:function(e,t,n){"use strict";var r=n(2109),o=n(4994),i=n(9518),c=n(7674),a=n(8003),u=n(8880),s=n(1320),l=n(5112),f=n(1913),p=n(7497),h=n(3383),d=h.IteratorPrototype,y=h.BUGGY_SAFARI_ITERATORS,v=l("iterator"),m="keys",b="values",g="entries",_=function(){return this};e.exports=function(e,t,n,l,h,R,w){o(n,t,l);var E,O,S,P=function(e){if(e===h&&x)return x;if(!y&&e in k)return k[e];switch(e){case m:case b:case g:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",C=!1,k=e.prototype,I=k[v]||k["@@iterator"]||h&&k[h],x=!y&&I||P(h),A="Array"==t&&k.entries||I;if(A&&(E=i(A.call(new e)),d!==Object.prototype&&E.next&&(f||i(E)===d||(c?c(E,d):"function"!=typeof E[v]&&u(E,v,_)),a(E,T,!0,!0),f&&(p[T]=_))),h==b&&I&&I.name!==b&&(C=!0,x=function(){return I.call(this)}),f&&!w||k[v]===x||u(k,v,x),p[t]=x,h)if(O={values:P(b),keys:R?x:P(m),entries:P(g)},w)for(S in O)(y||C||!(S in k))&&s(k,S,O[S]);else r({target:t,proto:!0,forced:y||C},O);return O}},7235:function(e,t,n){var r=n(857),o=n(6656),i=n(6061),c=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||c(t,e,{value:i.f(e)})}},9781:function(e,t,n){var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(e,t,n){var r=n(7854),o=n(111),i=r.document,c=o(i)&&o(i.createElement);e.exports=function(e){return c?i.createElement(e):{}}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7871:function(e){e.exports="object"==typeof window},6833:function(e,t,n){var r=n(8113);e.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(r)},5268:function(e,t,n){var r=n(4326),o=n(7854);e.exports="process"==r(o.process)},1036:function(e,t,n){var r=n(8113);e.exports=/web0s(?!.*chrome)/i.test(r)},8113:function(e,t,n){var r=n(5005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,o,i=n(7854),c=n(8113),a=i.process,u=a&&a.versions,s=u&&u.v8;s?o=(r=s.split("."))[0]<4?1:r[0]+r[1]:c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,n){var r=n(7854),o=n(1236).f,i=n(8880),c=n(1320),a=n(3505),u=n(9920),s=n(4705);e.exports=function(e,t){var n,l,f,p,h,d=e.target,y=e.global,v=e.stat;if(n=y?r:v?r[d]||a(d,{}):(r[d]||{}).prototype)for(l in t){if(p=t[l],f=e.noTargetGet?(h=o(n,l))&&h.value:n[l],!s(y?l:d+(v?".":"#")+l,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(e.sham||f&&f.sham)&&i(p,"sham",!0),c(n,l,p,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,n){"use strict";n(4916);var r=n(1320),o=n(2261),i=n(7293),c=n(5112),a=n(8880),u=c("species"),s=RegExp.prototype;e.exports=function(e,t,n,l){var f=c(e),p=!i((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),h=p&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t}));if(!p||!h||n){var d=/./[f],y=t(f,""[e],(function(e,t,n,r,i){var c=t.exec;return c===o||c===s.exec?p&&!i?{done:!0,value:d.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}));r(String.prototype,e,y[0]),r(s,f,y[1])}l&&a(s[f],"sham",!0)}},6677:function(e,t,n){var r=n(7293);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},9974:function(e,t,n){var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},7065:function(e,t,n){"use strict";var r=n(3099),o=n(111),i=[].slice,c={},a=function(e,t,n){if(!(t in c)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";c[t]=Function("C,a","return new C("+r.join(",")+")")}return c[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=i.call(arguments,1),c=function(){var r=n.concat(i.call(arguments));return this instanceof c?a(t,r.length,r):t.apply(e,r)};return o(t.prototype)&&(c.prototype=t.prototype),c}},5005:function(e,t,n){var r=n(857),o=n(7854),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},1246:function(e,t,n){var r=n(648),o=n(7497),i=n(5112)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},647:function(e,t,n){var r=n(7908),o=Math.floor,i="".replace,c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,u,s,l){var f=n+e.length,p=u.length,h=a;return void 0!==s&&(s=r(s),h=c),i.call(l,h,(function(r,i){var c;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(f);case"<":c=s[i.slice(1,-1)];break;default:var a=+i;if(0===a)return r;if(a>p){var l=o(a/10);return 0===l?r:l<=p?void 0===u[l-1]?i.charAt(1):u[l-1]+i.charAt(1):r}c=u[a-1]}return void 0===c?"":c}))}},7854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:function(e,t,n){var r=n(7908),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(r(e),t)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(7854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},490:function(e,t,n){var r=n(5005);e.exports=r("document","documentElement")},4664:function(e,t,n){var r=n(9781),o=n(7293),i=n(317);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(e,t,n){var r=n(7293),o=n(4326),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},9587:function(e,t,n){var r=n(111),o=n(7674);e.exports=function(e,t,n){var i,c;return o&&"function"==typeof(i=t.constructor)&&i!==n&&r(c=i.prototype)&&c!==n.prototype&&o(e,c),e}},2788:function(e,t,n){var r=n(5465),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},2423:function(e,t,n){var r=n(3501),o=n(111),i=n(6656),c=n(3070).f,a=n(9711),u=n(6677),s=a("meta"),l=0,f=Object.isExtensible||function(){return!0},p=function(e){c(e,s,{value:{objectID:"O"+l++,weakData:{}}})},h=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,s)){if(!f(e))return"F";if(!t)return"E";p(e)}return e[s].objectID},getWeakData:function(e,t){if(!i(e,s)){if(!f(e))return!0;if(!t)return!1;p(e)}return e[s].weakData},onFreeze:function(e){return u&&h.REQUIRED&&f(e)&&!i(e,s)&&p(e),e}};r[s]=!0},9909:function(e,t,n){var r,o,i,c=n(8536),a=n(7854),u=n(111),s=n(8880),l=n(6656),f=n(5465),p=n(6200),h=n(3501),d="Object already initialized",y=a.WeakMap;if(c||f.state){var v=f.state||(f.state=new y),m=v.get,b=v.has,g=v.set;r=function(e,t){if(b.call(v,e))throw new TypeError(d);return t.facade=e,g.call(v,e,t),t},o=function(e){return m.call(v,e)||{}},i=function(e){return b.call(v,e)}}else{var _=p("state");h[_]=!0,r=function(e,t){if(l(e,_))throw new TypeError(d);return t.facade=e,s(e,_,t),t},o=function(e){return l(e,_)?e[_]:{}},i=function(e){return l(e,_)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},7659:function(e,t,n){var r=n(5112),o=n(7497),i=r("iterator"),c=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||c[i]===e)}},3157:function(e,t,n){var r=n(4326);e.exports=Array.isArray||function(e){return"Array"==r(e)}},4705:function(e,t,n){var r=n(7293),o=/#|\.prototype\./,i=function(e,t){var n=a[c(e)];return n==s||n!=u&&("function"==typeof t?r(t):!!t)},c=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=i.data={},u=i.NATIVE="N",s=i.POLYFILL="P";e.exports=i},8730:function(e,t,n){var r=n(111),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},111:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},1913:function(e){e.exports=!1},7850:function(e,t,n){var r=n(111),o=n(4326),i=n(5112)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},408:function(e,t,n){var r=n(9670),o=n(7659),i=n(7466),c=n(9974),a=n(1246),u=n(9212),s=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,f,p,h,d,y,v,m=n&&n.that,b=!(!n||!n.AS_ENTRIES),g=!(!n||!n.IS_ITERATOR),_=!(!n||!n.INTERRUPTED),R=c(t,m,1+b+_),w=function(e){return l&&u(l),new s(!0,e)},E=function(e){return b?(r(e),_?R(e[0],e[1],w):R(e[0],e[1])):_?R(e,w):R(e)};if(g)l=e;else{if("function"!=typeof(f=a(e)))throw TypeError("Target is not iterable");if(o(f)){for(p=0,h=i(e.length);h>p;p++)if((d=E(e[p]))&&d instanceof s)return d;return new s(!1)}l=f.call(e)}for(y=l.next;!(v=y.call(l)).done;){try{d=E(v.value)}catch(e){throw u(l),e}if("object"==typeof d&&d&&d instanceof s)return d}return new s(!1)}},9212:function(e,t,n){var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},3383:function(e,t,n){"use strict";var r,o,i,c=n(7293),a=n(9518),u=n(8880),s=n(6656),l=n(5112),f=n(1913),p=l("iterator"),h=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(r=o):h=!0);var d=null==r||c((function(){var e={};return r[p].call(e)!==e}));d&&(r={}),f&&!d||s(r,p)||u(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},7497:function(e){e.exports={}},5948:function(e,t,n){var r,o,i,c,a,u,s,l,f=n(7854),p=n(1236).f,h=n(261).set,d=n(6833),y=n(1036),v=n(5268),m=f.MutationObserver||f.WebKitMutationObserver,b=f.document,g=f.process,_=f.Promise,R=p(f,"queueMicrotask"),w=R&&R.value;w||(r=function(){var e,t;for(v&&(e=g.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?c():i=void 0,e}}i=void 0,e&&e.enter()},d||v||y||!m||!b?_&&_.resolve?((s=_.resolve(void 0)).constructor=_,l=s.then,c=function(){l.call(s,r)}):c=v?function(){g.nextTick(r)}:function(){h.call(f,r)}:(a=!0,u=b.createTextNode(""),new m(r).observe(u,{characterData:!0}),c=function(){u.data=a=!a})),e.exports=w||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,c()),i=t}},3366:function(e,t,n){var r=n(7854);e.exports=r.Promise},133:function(e,t,n){var r=n(7392),o=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:function(e,t,n){var r=n(7854),o=n(2788),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},8523:function(e,t,n){"use strict";var r=n(3099),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},3929:function(e,t,n){var r=n(7850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},30:function(e,t,n){var r,o=n(9670),i=n(6048),c=n(748),a=n(3501),u=n(490),s=n(317),l=n(6200)("IE_PROTO"),f=function(){},p=function(e){return"<script>"+e+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=r?function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=s("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F);for(var n=c.length;n--;)delete h.prototype[c[n]];return h()};a[l]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=o(e),n=new f,f.prototype=null,n[l]=e):n=h(),void 0===t?n:i(n,t)}},6048:function(e,t,n){var r=n(9781),o=n(3070),i=n(9670),c=n(1956);e.exports=r?Object.defineProperties:function(e,t){i(e);for(var n,r=c(t),a=r.length,u=0;a>u;)o.f(e,n=r[u++],t[n]);return e}},3070:function(e,t,n){var r=n(9781),o=n(4664),i=n(9670),c=n(7593),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=c(t,!0),i(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},1236:function(e,t,n){var r=n(9781),o=n(5296),i=n(9114),c=n(5656),a=n(7593),u=n(6656),s=n(4664),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=c(e),t=a(t,!0),s)try{return l(e,t)}catch(e){}if(u(e,t))return i(!o.f.call(e,t),e[t])}},1156:function(e,t,n){var r=n(5656),o=n(8006).f,i={}.toString,c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return c&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return c.slice()}}(e):o(r(e))}},8006:function(e,t,n){var r=n(6324),o=n(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,n){var r=n(6656),o=n(7908),i=n(6200),c=n(8544),a=i("IE_PROTO"),u=Object.prototype;e.exports=c?Object.getPrototypeOf:function(e){return e=o(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},6324:function(e,t,n){var r=n(6656),o=n(5656),i=n(1318).indexOf,c=n(3501);e.exports=function(e,t){var n,a=o(e),u=0,s=[];for(n in a)!r(c,n)&&r(a,n)&&s.push(n);for(;t.length>u;)r(a,n=t[u++])&&(~i(s,n)||s.push(n));return s}},1956:function(e,t,n){var r=n(6324),o=n(748);e.exports=Object.keys||function(e){return r(e,o)}},5296:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},7674:function(e,t,n){var r=n(9670),o=n(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return r(n),o(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},288:function(e,t,n){"use strict";var r=n(1694),o=n(648);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},3887:function(e,t,n){var r=n(5005),o=n(8006),i=n(5181),c=n(9670);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(c(e)),n=i.f;return n?t.concat(n(e)):t}},857:function(e,t,n){var r=n(7854);e.exports=r},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:function(e,t,n){var r=n(9670),o=n(111),i=n(8523);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},2248:function(e,t,n){var r=n(1320);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},1320:function(e,t,n){var r=n(7854),o=n(8880),i=n(6656),c=n(3505),a=n(2788),u=n(9909),s=u.get,l=u.enforce,f=String(String).split("String");(e.exports=function(e,t,n,a){var u,s=!!a&&!!a.unsafe,p=!!a&&!!a.enumerable,h=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof t||i(n,"name")||o(n,"name",t),(u=l(n)).source||(u.source=f.join("string"==typeof t?t:""))),e!==r?(s?!h&&e[t]&&(p=!0):delete e[t],p?e[t]=n:o(e,t,n)):p?e[t]=n:c(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||a(this)}))},7651:function(e,t,n){var r=n(4326),o=n(2261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},2261:function(e,t,n){"use strict";var r,o,i=n(7066),c=n(2999),a=n(2309),u=n(30),s=n(9909).get,l=n(9441),f=n(8173),p=RegExp.prototype.exec,h=a("native-string-replace",String.prototype.replace),d=p,y=(r=/a/,o=/b*/g,p.call(r,"a"),p.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),v=c.UNSUPPORTED_Y||c.BROKEN_CARET,m=void 0!==/()??/.exec("")[1];(y||m||v||l||f)&&(d=function(e){var t,n,r,o,c,a,l,f=this,b=s(f),g=b.raw;if(g)return g.lastIndex=f.lastIndex,t=d.call(g,e),f.lastIndex=g.lastIndex,t;var _=b.groups,R=v&&f.sticky,w=i.call(f),E=f.source,O=0,S=e;if(R&&(-1===(w=w.replace("y","")).indexOf("g")&&(w+="g"),S=String(e).slice(f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==e[f.lastIndex-1])&&(E="(?: "+E+")",S=" "+S,O++),n=new RegExp("^(?:"+E+")",w)),m&&(n=new RegExp("^"+E+"$(?!\\s)",w)),y&&(r=f.lastIndex),o=p.call(R?n:f,S),R?o?(o.input=o.input.slice(O),o[0]=o[0].slice(O),o.index=f.lastIndex,f.lastIndex+=o[0].length):f.lastIndex=0:y&&o&&(f.lastIndex=f.global?o.index+o[0].length:r),m&&o&&o.length>1&&h.call(o[0],n,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(o[c]=void 0)})),o&&_)for(o.groups=a=u(null),c=0;c<_.length;c++)a[(l=_[c])[0]]=o[l[1]];return o}),e.exports=d},7066:function(e,t,n){"use strict";var r=n(9670);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:function(e,t,n){var r=n(7293),o=function(e,t){return RegExp(e,t)};t.UNSUPPORTED_Y=r((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},9441:function(e,t,n){var r=n(7293);e.exports=r((function(){var e=RegExp(".","string".charAt(0));return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},8173:function(e,t,n){var r=n(7293);e.exports=r((function(){var e=RegExp("(?<a>b)","string".charAt(5));return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4488:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},3505:function(e,t,n){var r=n(7854),o=n(8880);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},6340:function(e,t,n){"use strict";var r=n(5005),o=n(3070),i=n(5112),c=n(9781),a=i("species");e.exports=function(e){var t=r(e),n=o.f;c&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},8003:function(e,t,n){var r=n(3070).f,o=n(6656),i=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},6200:function(e,t,n){var r=n(2309),o=n(9711),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:function(e,t,n){var r=n(7854),o=n(3505),i="__core-js_shared__",c=r[i]||o(i,{});e.exports=c},2309:function(e,t,n){var r=n(1913),o=n(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.15.2",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:function(e,t,n){var r=n(9670),o=n(3099),i=n(5112)("species");e.exports=function(e,t){var n,c=r(e).constructor;return void 0===c||null==(n=r(c)[i])?t:o(n)}},8710:function(e,t,n){var r=n(9958),o=n(4488),i=function(e){return function(t,n){var i,c,a=String(o(t)),u=r(n),s=a.length;return u<0||u>=s?e?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===s||(c=a.charCodeAt(u+1))<56320||c>57343?e?a.charAt(u):i:e?a.slice(u,u+2):c-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},3111:function(e,t,n){var r=n(4488),o="["+n(1361)+"]",i=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),a=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(c,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},261:function(e,t,n){var r,o,i,c=n(7854),a=n(7293),u=n(9974),s=n(490),l=n(317),f=n(6833),p=n(5268),h=c.location,d=c.setImmediate,y=c.clearImmediate,v=c.process,m=c.MessageChannel,b=c.Dispatch,g=0,_={},R=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},w=function(e){return function(){R(e)}},E=function(e){R(e.data)},O=function(e){c.postMessage(e+"",h.protocol+"//"+h.host)};d&&y||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _[++g]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(g),g},y=function(e){delete _[e]},p?r=function(e){v.nextTick(w(e))}:b&&b.now?r=function(e){b.now(w(e))}:m&&!f?(i=(o=new m).port2,o.port1.onmessage=E,r=u(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&h&&"file:"!==h.protocol&&!a(O)?(r=O,c.addEventListener("message",E,!1)):r="onreadystatechange"in l("script")?function(e){s.appendChild(l("script")).onreadystatechange=function(){s.removeChild(this),R(e)}}:function(e){setTimeout(w(e),0)}),e.exports={set:d,clear:y}},1400:function(e,t,n){var r=n(9958),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},5656:function(e,t,n){var r=n(8361),o=n(4488);e.exports=function(e){return r(o(e))}},9958:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},7466:function(e,t,n){var r=n(9958),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},7908:function(e,t,n){var r=n(4488);e.exports=function(e){return Object(r(e))}},7593:function(e,t,n){var r=n(111);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},1694:function(e,t,n){var r={};r[n(5112)("toStringTag")]="z",e.exports="[object z]"===String(r)},9711:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},3307:function(e,t,n){var r=n(133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:function(e,t,n){var r=n(5112);t.f=r},5112:function(e,t,n){var r=n(7854),o=n(2309),i=n(6656),c=n(9711),a=n(133),u=n(3307),s=o("wks"),l=r.Symbol,f=u?l:l&&l.withoutSetter||c;e.exports=function(e){return i(s,e)&&(a||"string"==typeof s[e])||(a&&i(l,e)?s[e]=l[e]:s[e]=f("Symbol."+e)),s[e]}},1361:function(e){e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},2222:function(e,t,n){"use strict";var r=n(2109),o=n(7293),i=n(3157),c=n(111),a=n(7908),u=n(7466),s=n(6135),l=n(5417),f=n(1194),p=n(5112),h=n(7392),d=p("isConcatSpreadable"),y=9007199254740991,v="Maximum allowed index exceeded",m=h>=51||!o((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),b=f("concat"),g=function(e){if(!c(e))return!1;var t=e[d];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,forced:!m||!b},{concat:function(e){var t,n,r,o,i,c=a(this),f=l(c,0),p=0;for(t=-1,r=arguments.length;t<r;t++)if(g(i=-1===t?c:arguments[t])){if(p+(o=u(i.length))>y)throw TypeError(v);for(n=0;n<o;n++,p++)n in i&&s(f,p,i[n])}else{if(p>=y)throw TypeError(v);s(f,p++,i)}return f.length=p,f}})},7327:function(e,t,n){"use strict";var r=n(2109),o=n(2092).filter;r({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},6699:function(e,t,n){"use strict";var r=n(2109),o=n(1318).includes,i=n(1223);r({target:"Array",proto:!0},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},2772:function(e,t,n){"use strict";var r=n(2109),o=n(1318).indexOf,i=n(9341),c=[].indexOf,a=!!c&&1/[1].indexOf(1,-0)<0,u=i("indexOf");r({target:"Array",proto:!0,forced:a||!u},{indexOf:function(e){return a?c.apply(this,arguments)||0:o(this,e,arguments.length>1?arguments[1]:void 0)}})},6992:function(e,t,n){"use strict";var r=n(5656),o=n(1223),i=n(7497),c=n(9909),a=n(654),u="Array Iterator",s=c.set,l=c.getterFor(u);e.exports=a(Array,"Array",(function(e,t){s(this,{type:u,target:r(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},9600:function(e,t,n){"use strict";var r=n(2109),o=n(8361),i=n(5656),c=n(9341),a=[].join,u=o!=Object,s=c("join",",");r({target:"Array",proto:!0,forced:u||!s},{join:function(e){return a.call(i(this),void 0===e?",":e)}})},1249:function(e,t,n){"use strict";var r=n(2109),o=n(2092).map;r({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,n){"use strict";var r=n(2109),o=n(3671).left,i=n(9341),c=n(7392),a=n(5268);r({target:"Array",proto:!0,forced:!i("reduce")||!a&&c>79&&c<83},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},7042:function(e,t,n){"use strict";var r=n(2109),o=n(111),i=n(3157),c=n(1400),a=n(7466),u=n(5656),s=n(6135),l=n(5112),f=n(1194)("slice"),p=l("species"),h=[].slice,d=Math.max;r({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var n,r,l,f=u(this),y=a(f.length),v=c(e,y),m=c(void 0===t?y:t,y);if(i(f)&&("function"!=typeof(n=f.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[p])&&(n=void 0):n=void 0,n===Array||void 0===n))return h.call(f,v,m);for(r=new(void 0===n?Array:n)(d(m-v,0)),l=0;v<m;v++,l++)v in f&&s(r,l,f[v]);return r.length=l,r}})},8309:function(e,t,n){var r=n(9781),o=n(3070).f,i=Function.prototype,c=i.toString,a=/^\s*function ([^ (]*)/,u="name";r&&!(u in i)&&o(i,u,{configurable:!0,get:function(){try{return c.call(this).match(a)[1]}catch(e){return""}}})},1532:function(e,t,n){"use strict";var r=n(7710),o=n(5631);e.exports=r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},9653:function(e,t,n){"use strict";var r=n(9781),o=n(7854),i=n(4705),c=n(1320),a=n(6656),u=n(4326),s=n(9587),l=n(7593),f=n(7293),p=n(30),h=n(8006).f,d=n(1236).f,y=n(3070).f,v=n(3111).trim,m="Number",b=o.Number,g=b.prototype,_=u(p(g))==m,R=function(e){var t,n,r,o,i,c,a,u,s=l(e,!1);if("string"==typeof s&&s.length>2)if(43===(t=(s=v(s)).charCodeAt(0))||45===t){if(88===(n=s.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(s.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+s}for(c=(i=s.slice(2)).length,a=0;a<c;a++)if((u=i.charCodeAt(a))<48||u>o)return NaN;return parseInt(i,r)}return+s};if(i(m,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var w,E=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof E&&(_?f((function(){g.valueOf.call(n)})):u(n)!=m)?s(new b(R(t)),n,E):R(t)},O=r?h(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),S=0;O.length>S;S++)a(b,w=O[S])&&!a(E,w)&&y(E,w,d(b,w));E.prototype=g,g.constructor=E,c(o,m,E)}},3161:function(e,t,n){n(2109)({target:"Number",stat:!0},{isInteger:n(8730)})},5003:function(e,t,n){var r=n(2109),o=n(7293),i=n(5656),c=n(1236).f,a=n(9781),u=o((function(){c(1)}));r({target:"Object",stat:!0,forced:!a||u,sham:!a},{getOwnPropertyDescriptor:function(e,t){return c(i(e),t)}})},9337:function(e,t,n){var r=n(2109),o=n(9781),i=n(3887),c=n(5656),a=n(1236),u=n(6135);r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,n,r=c(e),o=a.f,s=i(r),l={},f=0;s.length>f;)void 0!==(n=o(r,t=s[f++]))&&u(l,t,n);return l}})},489:function(e,t,n){var r=n(2109),o=n(7293),i=n(7908),c=n(9518),a=n(8544);r({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!a},{getPrototypeOf:function(e){return c(i(e))}})},7941:function(e,t,n){var r=n(2109),o=n(7908),i=n(1956);r({target:"Object",stat:!0,forced:n(7293)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},1539:function(e,t,n){var r=n(1694),o=n(1320),i=n(288);r||o(Object.prototype,"toString",i,{unsafe:!0})},8674:function(e,t,n){"use strict";var r,o,i,c,a=n(2109),u=n(1913),s=n(7854),l=n(5005),f=n(3366),p=n(1320),h=n(2248),d=n(7674),y=n(8003),v=n(6340),m=n(111),b=n(3099),g=n(5787),_=n(2788),R=n(408),w=n(7072),E=n(6707),O=n(261).set,S=n(5948),P=n(9478),T=n(842),C=n(8523),k=n(2534),I=n(9909),x=n(4705),A=n(5112),N=n(7871),j=n(5268),D=n(7392),M=A("species"),L="Promise",U=I.get,B=I.set,F=I.getterFor(L),V=f&&f.prototype,Y=f,G=V,H=s.TypeError,q=s.document,W=s.process,z=C.f,K=z,J=!!(q&&q.createEvent&&s.dispatchEvent),$="function"==typeof PromiseRejectionEvent,X="unhandledrejection",Q=!1,Z=x(L,(function(){var e=_(Y),t=e!==String(Y);if(!t&&66===D)return!0;if(u&&!G.finally)return!0;if(D>=51&&/native code/.test(e))return!1;var n=new Y((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[M]=r,!(Q=n.then((function(){}))instanceof r)||!t&&N&&!$})),ee=Z||!w((function(e){Y.all(e).catch((function(){}))})),te=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},ne=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;S((function(){for(var r=e.value,o=1==e.state,i=0;n.length>i;){var c,a,u,s=n[i++],l=o?s.ok:s.fail,f=s.resolve,p=s.reject,h=s.domain;try{l?(o||(2===e.rejection&&ce(e),e.rejection=1),!0===l?c=r:(h&&h.enter(),c=l(r),h&&(h.exit(),u=!0)),c===s.promise?p(H("Promise-chain cycle")):(a=te(c))?a.call(c,f,p):f(c)):p(r)}catch(e){h&&!u&&h.exit(),p(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&oe(e)}))}},re=function(e,t,n){var r,o;J?((r=q.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!$&&(o=s["on"+e])?o(r):e===X&&T("Unhandled promise rejection",n)},oe=function(e){O.call(s,(function(){var t,n=e.facade,r=e.value;if(ie(e)&&(t=k((function(){j?W.emit("unhandledRejection",r,n):re(X,n,r)})),e.rejection=j||ie(e)?2:1,t.error))throw t.value}))},ie=function(e){return 1!==e.rejection&&!e.parent},ce=function(e){O.call(s,(function(){var t=e.facade;j?W.emit("rejectionHandled",t):re("rejectionhandled",t,e.value)}))},ae=function(e,t,n){return function(r){e(t,r,n)}},ue=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,ne(e,!0))},se=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw H("Promise can't be resolved itself");var r=te(t);r?S((function(){var n={done:!1};try{r.call(t,ae(se,n,e),ae(ue,n,e))}catch(t){ue(n,t,e)}})):(e.value=t,e.state=1,ne(e,!1))}catch(t){ue({done:!1},t,e)}}};if(Z&&(G=(Y=function(e){g(this,Y,L),b(e),r.call(this);var t=U(this);try{e(ae(se,t),ae(ue,t))}catch(e){ue(t,e)}}).prototype,(r=function(e){B(this,{type:L,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=h(G,{then:function(e,t){var n=F(this),r=z(E(this,Y));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=j?W.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&ne(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=U(e);this.promise=e,this.resolve=ae(se,t),this.reject=ae(ue,t)},C.f=z=function(e){return e===Y||e===i?new o(e):K(e)},!u&&"function"==typeof f&&V!==Object.prototype)){c=V.then,Q||(p(V,"then",(function(e,t){var n=this;return new Y((function(e,t){c.call(n,e,t)})).then(e,t)}),{unsafe:!0}),p(V,"catch",G.catch,{unsafe:!0}));try{delete V.constructor}catch(e){}d&&d(V,G)}a({global:!0,wrap:!0,forced:Z},{Promise:Y}),y(Y,L,!1,!0),v(L),i=l(L),a({target:L,stat:!0,forced:Z},{reject:function(e){var t=z(this);return t.reject.call(void 0,e),t.promise}}),a({target:L,stat:!0,forced:u||Z},{resolve:function(e){return P(u&&this===i?Y:this,e)}}),a({target:L,stat:!0,forced:ee},{all:function(e){var t=this,n=z(t),r=n.resolve,o=n.reject,i=k((function(){var n=b(t.resolve),i=[],c=0,a=1;R(e,(function(e){var u=c++,s=!1;i.push(void 0),a++,n.call(t,e).then((function(e){s||(s=!0,i[u]=e,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=z(t),r=n.reject,o=k((function(){var o=b(t.resolve);R(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},2419:function(e,t,n){var r=n(2109),o=n(5005),i=n(3099),c=n(9670),a=n(111),u=n(30),s=n(7065),l=n(7293),f=o("Reflect","construct"),p=l((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),h=!l((function(){f((function(){}))})),d=p||h;r({target:"Reflect",stat:!0,forced:d,sham:d},{construct:function(e,t){i(e),c(t);var n=arguments.length<3?e:i(arguments[2]);if(h&&!p)return f(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(s.apply(e,r))}var o=n.prototype,l=u(a(o)?o:Object.prototype),d=Function.apply.call(e,l,t);return a(d)?d:l}})},4819:function(e,t,n){var r=n(2109),o=n(111),i=n(9670),c=n(6656),a=n(1236),u=n(9518);r({target:"Reflect",stat:!0},{get:function e(t,n){var r,s,l=arguments.length<3?t:arguments[2];return i(t)===l?t[n]:(r=a.f(t,n))?c(r,"value")?r.value:void 0===r.get?void 0:r.get.call(l):o(s=u(t))?e(s,n,l):void 0}})},4916:function(e,t,n){"use strict";var r=n(2109),o=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},2087:function(e,t,n){var r=n(9781),o=n(3070),i=n(7066),c=n(7293);r&&c((function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})}))&&o.f(RegExp.prototype,"flags",{configurable:!0,get:i})},9714:function(e,t,n){"use strict";var r=n(1320),o=n(9670),i=n(7293),c=n(7066),a="toString",u=RegExp.prototype,s=u.toString,l=i((function(){return"/a/b"!=s.call({source:"a",flags:"b"})})),f=s.name!=a;(l||f)&&r(RegExp.prototype,a,(function(){var e=o(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in u)?c.call(e):n)}),{unsafe:!0})},2023:function(e,t,n){"use strict";var r=n(2109),o=n(3929),i=n(4488);r({target:"String",proto:!0,forced:!n(4964)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,n){"use strict";var r=n(8710).charAt,o=n(9909),i=n(654),c="String Iterator",a=o.set,u=o.getterFor(c);i(String,"String",(function(e){a(this,{type:c,string:String(e),index:0})}),(function(){var e,t=u(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},4723:function(e,t,n){"use strict";var r=n(7007),o=n(9670),i=n(7466),c=n(4488),a=n(1530),u=n(7651);r("match",(function(e,t,n){return[function(t){var n=c(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,this,e);if(r.done)return r.value;var c=o(this),s=String(e);if(!c.global)return u(c,s);var l=c.unicode;c.lastIndex=0;for(var f,p=[],h=0;null!==(f=u(c,s));){var d=String(f[0]);p[h]=d,""===d&&(c.lastIndex=a(s,i(c.lastIndex),l)),h++}return 0===h?null:p}]}))},5306:function(e,t,n){"use strict";var r=n(7007),o=n(7293),i=n(9670),c=n(7466),a=n(9958),u=n(4488),s=n(1530),l=n(647),f=n(7651),p=n(5112)("replace"),h=Math.max,d=Math.min,y="$0"==="a".replace(/./,"$0"),v=!!/./[p]&&""===/./[p]("a","$0");r("replace",(function(e,t,n){var r=v?"$":"$0";return[function(e,n){var r=u(this),o=null==e?void 0:e[p];return void 0!==o?o.call(e,r,n):t.call(String(r),e,n)},function(e,o){if("string"==typeof o&&-1===o.indexOf(r)&&-1===o.indexOf("$<")){var u=n(t,this,e,o);if(u.done)return u.value}var p=i(this),y=String(e),v="function"==typeof o;v||(o=String(o));var m=p.global;if(m){var b=p.unicode;p.lastIndex=0}for(var g=[];;){var _=f(p,y);if(null===_)break;if(g.push(_),!m)break;""===String(_[0])&&(p.lastIndex=s(y,c(p.lastIndex),b))}for(var R,w="",E=0,O=0;O<g.length;O++){_=g[O];for(var S=String(_[0]),P=h(d(a(_.index),y.length),0),T=[],C=1;C<_.length;C++)T.push(void 0===(R=_[C])?R:String(R));var k=_.groups;if(v){var I=[S].concat(T,P,y);void 0!==k&&I.push(k);var x=String(o.apply(void 0,I))}else x=l(S,y,P,T,k,o);P>=E&&(w+=y.slice(E,P)+x,E=P+S.length)}return w+y.slice(E)}]}),!!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!y||v)},3123:function(e,t,n){"use strict";var r=n(7007),o=n(7850),i=n(9670),c=n(4488),a=n(6707),u=n(1530),s=n(7466),l=n(7651),f=n(2261),p=n(2999),h=n(7293),d=p.UNSUPPORTED_Y,y=[].push,v=Math.min,m=4294967295;r("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(c(this)),i=void 0===n?m:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!o(e))return t.call(r,e,i);for(var a,u,s,l=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,d=new RegExp(e.source,p+"g");(a=f.call(d,r))&&!((u=d.lastIndex)>h&&(l.push(r.slice(h,a.index)),a.length>1&&a.index<r.length&&y.apply(l,a.slice(1)),s=a[0].length,h=u,l.length>=i));)d.lastIndex===a.index&&d.lastIndex++;return h===r.length?!s&&d.test("")||l.push(""):l.push(r.slice(h)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var o=c(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,o,n):r.call(String(o),t,n)},function(e,o){var c=n(r,this,e,o,r!==t);if(c.done)return c.value;var f=i(this),p=String(e),h=a(f,RegExp),y=f.unicode,b=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(d?"g":"y"),g=new h(d?"^(?:"+f.source+")":f,b),_=void 0===o?m:o>>>0;if(0===_)return[];if(0===p.length)return null===l(g,p)?[p]:[];for(var R=0,w=0,E=[];w<p.length;){g.lastIndex=d?0:w;var O,S=l(g,d?p.slice(w):p);if(null===S||(O=v(s(g.lastIndex+(d?w:0)),p.length))===R)w=u(p,w,y);else{if(E.push(p.slice(R,w)),E.length===_)return E;for(var P=1;P<=S.length-1;P++)if(E.push(S[P]),E.length===_)return E;w=R=O}}return E.push(p.slice(R)),E}]}),!!h((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),d)},6755:function(e,t,n){"use strict";var r,o=n(2109),i=n(1236).f,c=n(7466),a=n(3929),u=n(4488),s=n(4964),l=n(1913),f="".startsWith,p=Math.min,h=s("startsWith");o({target:"String",proto:!0,forced:!(!l&&!h&&(r=i(String.prototype,"startsWith"),r&&!r.writable)||h)},{startsWith:function(e){var t=String(u(this));a(e);var n=c(p(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return f?f.call(t,r,n):t.slice(n,n+r.length)===r}})},1817:function(e,t,n){"use strict";var r=n(2109),o=n(9781),i=n(7854),c=n(6656),a=n(111),u=n(3070).f,s=n(9920),l=i.Symbol;if(o&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},p=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof p?new l(e):void 0===e?l():l(e);return""===e&&(f[t]=!0),t};s(p,l);var h=p.prototype=l.prototype;h.constructor=p;var d=h.toString,y="Symbol(test)"==String(l("test")),v=/^Symbol\((.*)\)[^)]+$/;u(h,"description",{configurable:!0,get:function(){var e=a(this)?this.valueOf():this,t=d.call(e);if(c(f,e))return"";var n=y?t.slice(7,-1):t.replace(v,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:p})}},2165:function(e,t,n){n(7235)("iterator")},2526:function(e,t,n){"use strict";var r=n(2109),o=n(7854),i=n(5005),c=n(1913),a=n(9781),u=n(133),s=n(3307),l=n(7293),f=n(6656),p=n(3157),h=n(111),d=n(9670),y=n(7908),v=n(5656),m=n(7593),b=n(9114),g=n(30),_=n(1956),R=n(8006),w=n(1156),E=n(5181),O=n(1236),S=n(3070),P=n(5296),T=n(8880),C=n(1320),k=n(2309),I=n(6200),x=n(3501),A=n(9711),N=n(5112),j=n(6061),D=n(7235),M=n(8003),L=n(9909),U=n(2092).forEach,B=I("hidden"),F="Symbol",V=N("toPrimitive"),Y=L.set,G=L.getterFor(F),H=Object.prototype,q=o.Symbol,W=i("JSON","stringify"),z=O.f,K=S.f,J=w.f,$=P.f,X=k("symbols"),Q=k("op-symbols"),Z=k("string-to-symbol-registry"),ee=k("symbol-to-string-registry"),te=k("wks"),ne=o.QObject,re=!ne||!ne.prototype||!ne.prototype.findChild,oe=a&&l((function(){return 7!=g(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=z(H,t);r&&delete H[t],K(e,t,n),r&&e!==H&&K(H,t,r)}:K,ie=function(e,t){var n=X[e]=g(q.prototype);return Y(n,{type:F,tag:e,description:t}),a||(n.description=t),n},ce=s?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof q},ae=function(e,t,n){e===H&&ae(Q,t,n),d(e);var r=m(t,!0);return d(n),f(X,r)?(n.enumerable?(f(e,B)&&e[B][r]&&(e[B][r]=!1),n=g(n,{enumerable:b(0,!1)})):(f(e,B)||K(e,B,b(1,{})),e[B][r]=!0),oe(e,r,n)):K(e,r,n)},ue=function(e,t){d(e);var n=v(t),r=_(n).concat(pe(n));return U(r,(function(t){a&&!se.call(n,t)||ae(e,t,n[t])})),e},se=function(e){var t=m(e,!0),n=$.call(this,t);return!(this===H&&f(X,t)&&!f(Q,t))&&(!(n||!f(this,t)||!f(X,t)||f(this,B)&&this[B][t])||n)},le=function(e,t){var n=v(e),r=m(t,!0);if(n!==H||!f(X,r)||f(Q,r)){var o=z(n,r);return!o||!f(X,r)||f(n,B)&&n[B][r]||(o.enumerable=!0),o}},fe=function(e){var t=J(v(e)),n=[];return U(t,(function(e){f(X,e)||f(x,e)||n.push(e)})),n},pe=function(e){var t=e===H,n=J(t?Q:v(e)),r=[];return U(n,(function(e){!f(X,e)||t&&!f(H,e)||r.push(X[e])})),r};u||(C((q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=A(e),n=function(e){this===H&&n.call(Q,e),f(this,B)&&f(this[B],t)&&(this[B][t]=!1),oe(this,t,b(1,e))};return a&&re&&oe(H,t,{configurable:!0,set:n}),ie(t,e)}).prototype,"toString",(function(){return G(this).tag})),C(q,"withoutSetter",(function(e){return ie(A(e),e)})),P.f=se,S.f=ae,O.f=le,R.f=w.f=fe,E.f=pe,j.f=function(e){return ie(N(e),e)},a&&(K(q.prototype,"description",{configurable:!0,get:function(){return G(this).description}}),c||C(H,"propertyIsEnumerable",se,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:q}),U(_(te),(function(e){D(e)})),r({target:F,stat:!0,forced:!u},{for:function(e){var t=String(e);if(f(Z,t))return Z[t];var n=q(t);return Z[t]=n,ee[n]=t,n},keyFor:function(e){if(!ce(e))throw TypeError(e+" is not a symbol");if(f(ee,e))return ee[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!a},{create:function(e,t){return void 0===t?g(e):ue(g(e),t)},defineProperty:ae,defineProperties:ue,getOwnPropertyDescriptor:le}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:fe,getOwnPropertySymbols:pe}),r({target:"Object",stat:!0,forced:l((function(){E.f(1)}))},{getOwnPropertySymbols:function(e){return E.f(y(e))}}),W&&r({target:"JSON",stat:!0,forced:!u||l((function(){var e=q();return"[null]"!=W([e])||"{}"!=W({a:e})||"{}"!=W(Object(e))}))},{stringify:function(e,t,n){for(var r,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(r=t,(h(t)||void 0!==e)&&!ce(e))return p(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ce(t))return t}),o[1]=t,W.apply(null,o)}}),q.prototype[V]||T(q.prototype,V,q.prototype.valueOf),M(q,F),x[B]=!0},4747:function(e,t,n){var r=n(7854),o=n(8324),i=n(8533),c=n(8880);for(var a in o){var u=r[a],s=u&&u.prototype;if(s&&s.forEach!==i)try{c(s,"forEach",i)}catch(e){s.forEach=i}}},3948:function(e,t,n){var r=n(7854),o=n(8324),i=n(6992),c=n(8880),a=n(5112),u=a("iterator"),s=a("toStringTag"),l=i.values;for(var f in o){var p=r[f],h=p&&p.prototype;if(h){if(h[u]!==l)try{c(h,u,l)}catch(e){h[u]=l}if(h[s]||c(h,s,f),o[f])for(var d in i)if(h[d]!==i[d])try{c(h,d,i[d])}catch(e){h[d]=i[d]}}}},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),c=new T(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var a=O(c,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=s(e,t,n);if("normal"===u.type){if(r=n.done?h:f,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,c),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",p="executing",h="completed",d={};function y(){}function v(){}function m(){}var b={};b[i]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(C([])));_&&_!==n&&r.call(_,i)&&(b=_);var R=m.prototype=y.prototype=Object.create(b);function w(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function E(e,t){function n(o,i,c,a){var u=s(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,c,a)}),(function(e){n("throw",e,c,a)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,a)}))}a(u.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=s(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,c=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return c.next=c}}return{next:k}}function k(){return{value:t,done:!0}}return v.prototype=R.constructor=m,m.constructor=v,m[a]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(R),e},e.awrap=function(e){return{__await:e}},w(E.prototype),E.prototype[c]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var c=new E(u(t,n,r,o),i);return e.isGeneratorFunction(n)?c:c.next().then((function(e){return e.done?e.value:c.next()}))},w(R),R[a]="Generator",R[i]=function(){return this},R.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,T.prototype={constructor:T,reset:function(e){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(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var u=r.call(c,"catchLoc"),s=r.call(c,"finallyLoc");if(u&&s){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=e,c.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(c)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(2362)}();