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AC/BuB,SAAAA,CACA,EACA,EAAGY,EACH,EA4RAqH,EAjCA,CACAC,OAAA,SACAC,MAAA,QACAC,SAAA,WACAC,KAAA,OACAC,OAAA,SACAC,SAAA,WACAC,KAAA,OACAC,MAAA,QACAC,KAAA,OACAC,WAAA,aACAC,QAAA,UACAC,OAAA,SACAC,IAAA,MACAC,OAAA,SACAC,IAAA,MACAC,aAAA,eACAC,KAAA,OACAC,KAAA,OACAC,QAAA,UACAC,QAAA,UACAC,OAAA,SACAC,KAAA,OACAC,OAAA,SACAC,eAAA,iBACAC,UAAA,YACAC,YAAA,cACAC,WAAA,YACA","sources":["webpack://_N_E/../../node_modules/@paypal/react-paypal-js/dist/esm/react-paypal-js.js"],"sourcesContent":["/*!\n * react-paypal-js v7.8.3 (2023-03-27T21:19:05.517Z)\n * Copyright 2020-present, PayPal, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { createContext, useContext, useRef, useState, useEffect, useReducer } from 'react';\n/**\n * Enum for the SDK script resolve status,\n *\n * @enum {string}\n */\n\nvar SCRIPT_LOADING_STATE;\n\n(function (SCRIPT_LOADING_STATE) {\n  SCRIPT_LOADING_STATE[\"INITIAL\"] = \"initial\";\n  SCRIPT_LOADING_STATE[\"PENDING\"] = \"pending\";\n  SCRIPT_LOADING_STATE[\"REJECTED\"] = \"rejected\";\n  SCRIPT_LOADING_STATE[\"RESOLVED\"] = \"resolved\";\n})(SCRIPT_LOADING_STATE || (SCRIPT_LOADING_STATE = {}));\n/**\n * Enum for the PayPalScriptProvider context dispatch actions\n *\n * @enum {string}\n */\n\n\nvar DISPATCH_ACTION;\n\n(function (DISPATCH_ACTION) {\n  DISPATCH_ACTION[\"LOADING_STATUS\"] = \"setLoadingStatus\";\n  DISPATCH_ACTION[\"RESET_OPTIONS\"] = \"resetOptions\";\n  DISPATCH_ACTION[\"SET_BRAINTREE_INSTANCE\"] = \"braintreeInstance\";\n})(DISPATCH_ACTION || (DISPATCH_ACTION = {}));\n/**\n * Enum for all the available hosted fields\n *\n * @enum {string}\n */\n\n\nvar PAYPAL_HOSTED_FIELDS_TYPES;\n\n(function (PAYPAL_HOSTED_FIELDS_TYPES) {\n  PAYPAL_HOSTED_FIELDS_TYPES[\"NUMBER\"] = \"number\";\n  PAYPAL_HOSTED_FIELDS_TYPES[\"CVV\"] = \"cvv\";\n  PAYPAL_HOSTED_FIELDS_TYPES[\"EXPIRATION_DATE\"] = \"expirationDate\";\n  PAYPAL_HOSTED_FIELDS_TYPES[\"EXPIRATION_MONTH\"] = \"expirationMonth\";\n  PAYPAL_HOSTED_FIELDS_TYPES[\"EXPIRATION_YEAR\"] = \"expirationYear\";\n  PAYPAL_HOSTED_FIELDS_TYPES[\"POSTAL_CODE\"] = \"postalCode\";\n})(PAYPAL_HOSTED_FIELDS_TYPES || (PAYPAL_HOSTED_FIELDS_TYPES = {}));\n/*********************************************\n * Common reference to the script identifier *\n *********************************************/\n\n\nvar SCRIPT_ID = \"data-react-paypal-script-id\";\nvar SDK_SETTINGS = {\n  DATA_CLIENT_TOKEN: \"data-client-token\",\n  DATA_USER_ID_TOKEN: \"data-user-id-token\",\n  DATA_SDK_INTEGRATION_SOURCE: \"data-sdk-integration-source\",\n  DATA_SDK_INTEGRATION_SOURCE_VALUE: \"react-paypal-js\",\n  DATA_NAMESPACE: \"data-namespace\"\n};\nvar LOAD_SCRIPT_ERROR = \"Failed to load the PayPal JS SDK script.\";\n/****************************\n * Braintree error messages *\n ****************************/\n\nvar EMPTY_BRAINTREE_AUTHORIZATION_ERROR_MESSAGE = \"Invalid authorization data. Use data-client-token or data-user-id-token to authorize.\";\nvar braintreeVersion = \"3.84.0\";\nvar BRAINTREE_SOURCE = \"https://js.braintreegateway.com/web/\".concat(braintreeVersion, \"/js/client.min.js\");\nvar BRAINTREE_PAYPAL_CHECKOUT_SOURCE = \"https://js.braintreegateway.com/web/\".concat(braintreeVersion, \"/js/paypal-checkout.min.js\");\n/*********************\n * PayPal namespaces *\n *********************/\n\nvar DEFAULT_PAYPAL_NAMESPACE = \"paypal\";\nvar DEFAULT_BRAINTREE_NAMESPACE = \"braintree\";\n/*****************\n * Hosted Fields *\n *****************/\n\nvar HOSTED_FIELDS_CHILDREN_ERROR = \"To use HostedFields you must use it with at least 3 children with types: [number, cvv, expirationDate] includes\";\nvar HOSTED_FIELDS_DUPLICATE_CHILDREN_ERROR = \"Cannot use duplicate HostedFields as children\";\n/*******************\n * Script Provider *\n *******************/\n\nvar SCRIPT_PROVIDER_REDUCER_ERROR = \"usePayPalScriptReducer must be used within a PayPalScriptProvider\";\n\nvar __assign = function () {\n  __assign = Object.assign || function __assign(t) {\n    for (var s, i = 1, n = arguments.length; i < n; i++) {\n      s = arguments[i];\n\n      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n    }\n\n    return t;\n  };\n\n  return __assign.apply(this, arguments);\n};\n\nfunction __rest(s, e) {\n  var t = {};\n\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n}\n\nfunction __spreadArray(to, from, pack) {\n  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n    if (ar || !(i in from)) {\n      if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n      ar[i] = from[i];\n    }\n  }\n  return to.concat(ar || Array.prototype.slice.call(from));\n}\n/**\n * Get the namespace from the window in the browser\n * this is useful to get the paypal object from window\n * after load PayPal SDK script\n *\n * @param namespace the name space to return\n * @returns the namespace if exists or undefined otherwise\n */\n\n\nfunction getPayPalWindowNamespace$1(namespace) {\n  if (namespace === void 0) {\n    namespace = DEFAULT_PAYPAL_NAMESPACE;\n  } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n  return window[namespace];\n}\n/**\n * Get a namespace from the window in the browser\n * this is useful to get the braintree from window\n * after load Braintree script\n *\n * @param namespace the name space to return\n * @returns the namespace if exists or undefined otherwise\n */\n\n\nfunction getBraintreeWindowNamespace(namespace) {\n  if (namespace === void 0) {\n    namespace = DEFAULT_BRAINTREE_NAMESPACE;\n  } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n  return window[namespace];\n}\n/**\n * Creates a string hash code based on the string argument\n *\n * @param str the source input string to hash\n * @returns string hash code\n */\n\n\nfunction hashStr(str) {\n  var hash = \"\";\n\n  for (var i = 0; i < str.length; i++) {\n    var total = str[i].charCodeAt(0) * i;\n\n    if (str[i + 1]) {\n      total += str[i + 1].charCodeAt(0) * (i - 1);\n    }\n\n    hash += String.fromCharCode(97 + Math.abs(total) % 26);\n  }\n\n  return hash;\n}\n\nfunction generateErrorMessage(_a) {\n  var reactComponentName = _a.reactComponentName,\n      sdkComponentKey = _a.sdkComponentKey,\n      _b = _a.sdkRequestedComponents,\n      sdkRequestedComponents = _b === void 0 ? \"\" : _b,\n      _c = _a.sdkDataNamespace,\n      sdkDataNamespace = _c === void 0 ? DEFAULT_PAYPAL_NAMESPACE : _c;\n  var requiredOptionCapitalized = sdkComponentKey.charAt(0).toUpperCase().concat(sdkComponentKey.substring(1));\n  var errorMessage = \"Unable to render <\".concat(reactComponentName, \" /> because window.\").concat(sdkDataNamespace, \".\").concat(requiredOptionCapitalized, \" is undefined.\"); // The JS SDK only loads the buttons component by default.\n  // All other components like messages and marks must be requested using the \"components\" query parameter\n\n  if (!sdkRequestedComponents.includes(sdkComponentKey)) {\n    var expectedComponents = [sdkRequestedComponents, sdkComponentKey].filter(Boolean).join();\n    errorMessage += \"\\nTo fix the issue, add '\".concat(sdkComponentKey, \"' to the list of components passed to the parent PayPalScriptProvider:\") + \"\\n`<PayPalScriptProvider options={{ components: '\".concat(expectedComponents, \"'}}>`.\");\n  }\n\n  return errorMessage;\n}\n/**\n * Generate a new random identifier for react-paypal-js\n *\n * @returns the {@code string} containing the random library name\n */\n\n\nfunction getScriptID(options) {\n  return \"react-paypal-js-\".concat(hashStr(JSON.stringify(options)));\n}\n/**\n * Destroy the PayPal SDK from the document page\n *\n * @param reactPayPalScriptID the script identifier\n */\n\n\nfunction destroySDKScript(reactPayPalScriptID) {\n  var scriptNode = self.document.querySelector(\"script[\".concat(SCRIPT_ID, \"=\\\"\").concat(reactPayPalScriptID, \"\\\"]\"));\n\n  if (scriptNode === null || scriptNode === void 0 ? void 0 : scriptNode.parentNode) {\n    scriptNode.parentNode.removeChild(scriptNode);\n  }\n}\n/**\n * Reducer function to handle complex state changes on the context\n *\n * @param state  the current state on the context object\n * @param action the action to be executed on the previous state\n * @returns a the same state if the action wasn't found, or a new state otherwise\n */\n\n\nfunction scriptReducer(state, action) {\n  var _a;\n\n  switch (action.type) {\n    case DISPATCH_ACTION.LOADING_STATUS:\n      return __assign(__assign({}, state), {\n        loadingStatus: action.value\n      });\n\n    case DISPATCH_ACTION.RESET_OPTIONS:\n      // destroy existing script to make sure only one script loads at a time\n      destroySDKScript(state.options[SCRIPT_ID]); // exclude the old data-react-paypal-script-id value from the hash generated by getScriptID()\n\n      delete action.value[SCRIPT_ID];\n      return __assign(__assign({}, state), {\n        loadingStatus: SCRIPT_LOADING_STATE.PENDING,\n        options: __assign(__assign({}, action.value), (_a = {}, _a[SCRIPT_ID] = \"\".concat(getScriptID(action.value)), _a[SDK_SETTINGS.DATA_SDK_INTEGRATION_SOURCE] = SDK_SETTINGS.DATA_SDK_INTEGRATION_SOURCE_VALUE, _a))\n      });\n\n    case DISPATCH_ACTION.SET_BRAINTREE_INSTANCE:\n      return __assign(__assign({}, state), {\n        braintreePayPalCheckoutInstance: action.value\n      });\n\n    default:\n      {\n        return state;\n      }\n  }\n} // Create the React context to use in the script provider component\n\n\nvar ScriptContext = createContext(null);\n/**\n * Check if the context is valid and ready to dispatch actions.\n *\n * @param scriptContext the result of connecting to the context provider\n * @returns strict context avoiding null values in the type\n */\n\nfunction validateReducer(scriptContext) {\n  if (typeof (scriptContext === null || scriptContext === void 0 ? void 0 : scriptContext.dispatch) === \"function\" && scriptContext.dispatch.length !== 0) {\n    return scriptContext;\n  }\n\n  throw new Error(SCRIPT_PROVIDER_REDUCER_ERROR);\n}\n/**\n * Check if the data-client-token or the data-user-id-token are\n * set in the options of the context.\n * @type data-client-token is use to pass a client token\n * @type data-user-id-token is use to pass a client tokenization key\n *\n * @param scriptContext the result of connecting to the context provider\n * @throws an {@link Error} if both data-client-token and the data-user-id-token keys are null or undefine\n * @returns strict context if one of the keys are defined\n */\n\n\nvar validateBraintreeAuthorizationData = function (scriptContext) {\n  var _a, _b;\n\n  if (!((_a = scriptContext === null || scriptContext === void 0 ? void 0 : scriptContext.options) === null || _a === void 0 ? void 0 : _a[SDK_SETTINGS.DATA_CLIENT_TOKEN]) && !((_b = scriptContext === null || scriptContext === void 0 ? void 0 : scriptContext.options) === null || _b === void 0 ? void 0 : _b[SDK_SETTINGS.DATA_USER_ID_TOKEN])) {\n    throw new Error(EMPTY_BRAINTREE_AUTHORIZATION_ERROR_MESSAGE);\n  }\n\n  return scriptContext;\n};\n/**\n * Custom hook to get access to the Script context and\n * dispatch actions to modify the state on the {@link ScriptProvider} component\n *\n * @returns a tuple containing the state of the context and\n * a dispatch function to modify the state\n */\n\n\nfunction usePayPalScriptReducer() {\n  var scriptContext = validateReducer(useContext(ScriptContext));\n\n  var derivedStatusContext = __assign(__assign({}, scriptContext), {\n    isInitial: scriptContext.loadingStatus === SCRIPT_LOADING_STATE.INITIAL,\n    isPending: scriptContext.loadingStatus === SCRIPT_LOADING_STATE.PENDING,\n    isResolved: scriptContext.loadingStatus === SCRIPT_LOADING_STATE.RESOLVED,\n    isRejected: scriptContext.loadingStatus === SCRIPT_LOADING_STATE.REJECTED\n  });\n\n  return [derivedStatusContext, scriptContext.dispatch];\n}\n/**\n * Custom hook to get access to the ScriptProvider context\n *\n * @returns the latest state of the context\n */\n\n\nfunction useScriptProviderContext() {\n  var scriptContext = validateBraintreeAuthorizationData(validateReducer(useContext(ScriptContext)));\n  return [scriptContext, scriptContext.dispatch];\n} // Create the React context to use in the PayPal hosted fields provider\n\n\nvar PayPalHostedFieldsContext = createContext({});\n/**\n * Custom hook to get access to the PayPal Hosted Fields instance.\n * The instance represent the returned object after the render process\n * With this object a user can submit the fields and dynamically modify the cards\n *\n * @returns the hosted fields instance if is available in the component\n */\n\nfunction usePayPalHostedFields() {\n  return useContext(PayPalHostedFieldsContext);\n}\n/**\nThis `<PayPalButtons />` component supports rendering [buttons](https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/#buttons) for PayPal, Venmo, and alternative payment methods.\nIt relies on the `<PayPalScriptProvider />` parent component for managing state related to loading the JS SDK script.\n*/\n\n\nvar PayPalButtons = function (_a) {\n  var _b = _a.className,\n      className = _b === void 0 ? \"\" : _b,\n      _c = _a.disabled,\n      disabled = _c === void 0 ? false : _c,\n      children = _a.children,\n      _d = _a.forceReRender,\n      forceReRender = _d === void 0 ? [] : _d,\n      buttonProps = __rest(_a, [\"className\", \"disabled\", \"children\", \"forceReRender\"]);\n\n  var isDisabledStyle = disabled ? {\n    opacity: 0.38\n  } : {};\n  var classNames = \"\".concat(className, \" \").concat(disabled ? \"paypal-buttons-disabled\" : \"\").trim();\n  var buttonsContainerRef = useRef(null);\n  var buttons = useRef(null);\n  var _e = usePayPalScriptReducer()[0],\n      isResolved = _e.isResolved,\n      options = _e.options;\n\n  var _f = useState(null),\n      initActions = _f[0],\n      setInitActions = _f[1];\n\n  var _g = useState(true),\n      isEligible = _g[0],\n      setIsEligible = _g[1];\n\n  var _h = useState(null),\n      setErrorState = _h[1];\n\n  function closeButtonsComponent() {\n    if (buttons.current !== null) {\n      buttons.current.close().catch(function () {// ignore errors when closing the component\n      });\n    }\n  } // useEffect hook for rendering the buttons\n\n\n  useEffect(function () {\n    // verify the sdk script has successfully loaded\n    if (isResolved === false) {\n      return closeButtonsComponent;\n    }\n\n    var paypalWindowNamespace = getPayPalWindowNamespace$1(options[SDK_SETTINGS.DATA_NAMESPACE]); // verify dependency on window object\n\n    if (paypalWindowNamespace === undefined || paypalWindowNamespace.Buttons === undefined) {\n      setErrorState(function () {\n        throw new Error(generateErrorMessage({\n          reactComponentName: PayPalButtons.displayName,\n          sdkComponentKey: \"buttons\",\n          sdkRequestedComponents: options.components,\n          sdkDataNamespace: options[SDK_SETTINGS.DATA_NAMESPACE]\n        }));\n      });\n      return closeButtonsComponent;\n    }\n\n    var decoratedOnInit = function (data, actions) {\n      setInitActions(actions);\n\n      if (typeof buttonProps.onInit === \"function\") {\n        buttonProps.onInit(data, actions);\n      }\n    };\n\n    try {\n      buttons.current = paypalWindowNamespace.Buttons(__assign(__assign({}, buttonProps), {\n        onInit: decoratedOnInit\n      }));\n    } catch (err) {\n      return setErrorState(function () {\n        throw new Error(\"Failed to render <PayPalButtons /> component. Failed to initialize:  \".concat(err));\n      });\n    } // only render the button when eligible\n\n\n    if (buttons.current.isEligible() === false) {\n      setIsEligible(false);\n      return closeButtonsComponent;\n    }\n\n    if (!buttonsContainerRef.current) {\n      return closeButtonsComponent;\n    }\n\n    buttons.current.render(buttonsContainerRef.current).catch(function (err) {\n      // component failed to render, possibly because it was closed or destroyed.\n      if (buttonsContainerRef.current === null || buttonsContainerRef.current.children.length === 0) {\n        // paypal buttons container is no longer in the DOM, we can safely ignore the error\n        return;\n      } // paypal buttons container is still in the DOM\n\n\n      setErrorState(function () {\n        throw new Error(\"Failed to render <PayPalButtons /> component. \".concat(err));\n      });\n    });\n    return closeButtonsComponent; // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, __spreadArray(__spreadArray([isResolved], forceReRender, true), [buttonProps.fundingSource], false)); // useEffect hook for managing disabled state\n\n  useEffect(function () {\n    if (initActions === null) {\n      return;\n    }\n\n    if (disabled === true) {\n      initActions.disable().catch(function () {// ignore errors when disabling the component\n      });\n    } else {\n      initActions.enable().catch(function () {// ignore errors when enabling the component\n      });\n    }\n  }, [disabled, initActions]);\n  return React.createElement(React.Fragment, null, isEligible ? React.createElement(\"div\", {\n    ref: buttonsContainerRef,\n    style: isDisabledStyle,\n    className: classNames\n  }) : children);\n};\n\nPayPalButtons.displayName = \"PayPalButtons\";\n\nfunction findScript(url, attributes) {\n  var currentScript = document.querySelector(\"script[src=\\\"\".concat(url, \"\\\"]\"));\n  if (currentScript === null) return null;\n  var nextScript = createScriptElement(url, attributes);\n  var currentScriptClone = currentScript.cloneNode();\n  delete currentScriptClone.dataset.uidAuto;\n\n  if (Object.keys(currentScriptClone.dataset).length !== Object.keys(nextScript.dataset).length) {\n    return null;\n  }\n\n  var isExactMatch = true;\n  Object.keys(currentScriptClone.dataset).forEach(function (key) {\n    if (currentScriptClone.dataset[key] !== nextScript.dataset[key]) {\n      isExactMatch = false;\n    }\n  });\n  return isExactMatch ? currentScript : null;\n}\n\nfunction insertScriptElement(_a) {\n  var url = _a.url,\n      attributes = _a.attributes,\n      onSuccess = _a.onSuccess,\n      onError = _a.onError;\n  var newScript = createScriptElement(url, attributes);\n  newScript.onerror = onError;\n  newScript.onload = onSuccess;\n  document.head.insertBefore(newScript, document.head.firstElementChild);\n}\n\nfunction processOptions(options) {\n  var sdkBaseURL = \"https://www.paypal.com/sdk/js\";\n\n  if (options.sdkBaseURL) {\n    sdkBaseURL = options.sdkBaseURL;\n    delete options.sdkBaseURL;\n  }\n\n  processMerchantID(options);\n\n  var _a = Object.keys(options).filter(function (key) {\n    return typeof options[key] !== \"undefined\" && options[key] !== null && options[key] !== \"\";\n  }).reduce(function (accumulator, key) {\n    var value = options[key].toString();\n\n    if (key.substring(0, 5) === \"data-\") {\n      accumulator.dataAttributes[key] = value;\n    } else {\n      accumulator.queryParams[key] = value;\n    }\n\n    return accumulator;\n  }, {\n    queryParams: {},\n    dataAttributes: {}\n  }),\n      queryParams = _a.queryParams,\n      dataAttributes = _a.dataAttributes;\n\n  return {\n    url: \"\".concat(sdkBaseURL, \"?\").concat(objectToQueryString(queryParams)),\n    dataAttributes: dataAttributes\n  };\n}\n\nfunction objectToQueryString(params) {\n  var queryString = \"\";\n  Object.keys(params).forEach(function (key) {\n    if (queryString.length !== 0) queryString += \"&\";\n    queryString += key + \"=\" + params[key];\n  });\n  return queryString;\n}\n\nfunction parseErrorMessage(message) {\n  var originalErrorText = message.split(\"/* Original Error:\")[1];\n  return originalErrorText ? originalErrorText.replace(/\\n/g, \"\").replace(\"*/\", \"\").trim() : message;\n}\n\nfunction createScriptElement(url, attributes) {\n  if (attributes === void 0) {\n    attributes = {};\n  }\n\n  var newScript = document.createElement(\"script\");\n  newScript.src = url;\n  Object.keys(attributes).forEach(function (key) {\n    newScript.setAttribute(key, attributes[key]);\n\n    if (key === \"data-csp-nonce\") {\n      newScript.setAttribute(\"nonce\", attributes[\"data-csp-nonce\"]);\n    }\n  });\n  return newScript;\n}\n\nfunction processMerchantID(options) {\n  var merchantID = options[\"merchant-id\"],\n      dataMerchantID = options[\"data-merchant-id\"];\n  var newMerchantID = \"\";\n  var newDataMerchantID = \"\";\n\n  if (Array.isArray(merchantID)) {\n    if (merchantID.length > 1) {\n      newMerchantID = \"*\";\n      newDataMerchantID = merchantID.toString();\n    } else {\n      newMerchantID = merchantID.toString();\n    }\n  } else if (typeof merchantID === \"string\" && merchantID.length > 0) {\n    newMerchantID = merchantID;\n  } else if (typeof dataMerchantID === \"string\" && dataMerchantID.length > 0) {\n    newMerchantID = \"*\";\n    newDataMerchantID = dataMerchantID;\n  }\n\n  options[\"merchant-id\"] = newMerchantID;\n  options[\"data-merchant-id\"] = newDataMerchantID;\n  return options;\n}\n\nfunction loadScript(options, PromisePonyfill) {\n  if (PromisePonyfill === void 0) {\n    PromisePonyfill = getDefaultPromiseImplementation();\n  }\n\n  validateArguments(options, PromisePonyfill);\n  if (typeof document === \"undefined\") return PromisePonyfill.resolve(null);\n\n  var _a = processOptions(options),\n      url = _a.url,\n      dataAttributes = _a.dataAttributes;\n\n  var namespace = dataAttributes[\"data-namespace\"] || \"paypal\";\n  var existingWindowNamespace = getPayPalWindowNamespace(namespace);\n\n  if (findScript(url, dataAttributes) && existingWindowNamespace) {\n    return PromisePonyfill.resolve(existingWindowNamespace);\n  }\n\n  return loadCustomScript({\n    url: url,\n    attributes: dataAttributes\n  }, PromisePonyfill).then(function () {\n    var newWindowNamespace = getPayPalWindowNamespace(namespace);\n\n    if (newWindowNamespace) {\n      return newWindowNamespace;\n    }\n\n    throw new Error(\"The window.\".concat(namespace, \" global variable is not available.\"));\n  });\n}\n\nfunction loadCustomScript(options, PromisePonyfill) {\n  if (PromisePonyfill === void 0) {\n    PromisePonyfill = getDefaultPromiseImplementation();\n  }\n\n  validateArguments(options, PromisePonyfill);\n  var url = options.url,\n      attributes = options.attributes;\n\n  if (typeof url !== \"string\" || url.length === 0) {\n    throw new Error(\"Invalid url.\");\n  }\n\n  if (typeof attributes !== \"undefined\" && typeof attributes !== \"object\") {\n    throw new Error(\"Expected attributes to be an object.\");\n  }\n\n  return new PromisePonyfill(function (resolve, reject) {\n    if (typeof document === \"undefined\") return resolve();\n    insertScriptElement({\n      url: url,\n      attributes: attributes,\n      onSuccess: function () {\n        return resolve();\n      },\n      onError: function () {\n        var defaultError = new Error(\"The script \\\"\".concat(url, \"\\\" failed to load.\"));\n\n        if (!window.fetch) {\n          return reject(defaultError);\n        }\n\n        return fetch(url).then(function (response) {\n          if (response.status === 200) {\n            reject(defaultError);\n          }\n\n          return response.text();\n        }).then(function (message) {\n          var parseMessage = parseErrorMessage(message);\n          reject(new Error(parseMessage));\n        }).catch(function (err) {\n          reject(err);\n        });\n      }\n    });\n  });\n}\n\nfunction getDefaultPromiseImplementation() {\n  if (typeof Promise === \"undefined\") {\n    throw new Error(\"Promise is undefined. To resolve the issue, use a Promise polyfill.\");\n  }\n\n  return Promise;\n}\n\nfunction getPayPalWindowNamespace(namespace) {\n  return window[namespace];\n}\n\nfunction validateArguments(options, PromisePonyfill) {\n  if (typeof options !== \"object\" || options === null) {\n    throw new Error(\"Expected an options object.\");\n  }\n\n  if (typeof PromisePonyfill !== \"undefined\" && typeof PromisePonyfill !== \"function\") {\n    throw new Error(\"Expected PromisePonyfill to be a function.\");\n  }\n}\n/**\n * Simple check to determine if the Braintree is a valid namespace.\n *\n * @param braintreeSource the source {@link BraintreeNamespace}\n * @returns a boolean representing if the namespace is valid.\n */\n\n\nvar isValidBraintreeNamespace = function (braintreeSource) {\n  var _a, _b;\n\n  if (typeof ((_a = braintreeSource === null || braintreeSource === void 0 ? void 0 : braintreeSource.client) === null || _a === void 0 ? void 0 : _a.create) !== \"function\" && typeof ((_b = braintreeSource === null || braintreeSource === void 0 ? void 0 : braintreeSource.paypalCheckout) === null || _b === void 0 ? void 0 : _b.create) !== \"function\") {\n    throw new Error(\"The braintreeNamespace property is not a valid BraintreeNamespace type.\");\n  }\n\n  return true;\n};\n/**\n * Use `actions.braintree` to provide an interface for the paypalCheckoutInstance\n * through the createOrder, createBillingAgreement and onApprove callbacks\n *\n * @param braintreeButtonProps the component button options\n * @returns a new copy of the component button options casted as {@link PayPalButtonsComponentProps}\n */\n\n\nvar decorateActions = function (buttonProps, payPalCheckoutInstance) {\n  var createOrderRef = buttonProps.createOrder;\n  var createBillingAgreementRef = buttonProps.createBillingAgreement;\n  var onApproveRef = buttonProps.onApprove;\n\n  if (typeof createOrderRef === \"function\") {\n    buttonProps.createOrder = function (data, actions) {\n      return createOrderRef(data, __assign(__assign({}, actions), {\n        braintree: payPalCheckoutInstance\n      }));\n    };\n  }\n\n  if (typeof createBillingAgreementRef === \"function\") {\n    buttonProps.createBillingAgreement = function (data, actions) {\n      return createBillingAgreementRef(data, __assign(__assign({}, actions), {\n        braintree: payPalCheckoutInstance\n      }));\n    };\n  }\n\n  if (typeof onApproveRef === \"function\") {\n    buttonProps.onApprove = function (data, actions) {\n      return onApproveRef(data, __assign(__assign({}, actions), {\n        braintree: payPalCheckoutInstance\n      }));\n    };\n  }\n\n  return __assign({}, buttonProps);\n};\n/**\n * Get the Braintree namespace from the component props.\n * If the prop `braintreeNamespace` is undefined will try to load it from the CDN.\n * This function allows users to set the braintree manually on the `BraintreePayPalButtons` component.\n *\n * Use case can be for example legacy sites using AMD/UMD modules,\n * trying to integrate the `BraintreePayPalButtons` component.\n * If we attempt to load the Braintree from the CDN won't define the braintree namespace.\n * This happens because the braintree script is an UMD module.\n * After detecting the AMD on the global scope will create an anonymous module using `define`\n * and the `BraintreePayPalButtons` won't be able to get access to the `window.braintree` namespace\n * from the global context.\n *\n * @param braintreeSource the source {@link BraintreeNamespace}\n * @returns the {@link BraintreeNamespace}\n */\n\n\nvar getBraintreeNamespace = function (braintreeSource) {\n  if (braintreeSource && isValidBraintreeNamespace(braintreeSource)) {\n    return Promise.resolve(braintreeSource);\n  }\n\n  return Promise.all([loadCustomScript({\n    url: BRAINTREE_SOURCE\n  }), loadCustomScript({\n    url: BRAINTREE_PAYPAL_CHECKOUT_SOURCE\n  })]).then(function () {\n    return getBraintreeWindowNamespace();\n  });\n};\n/**\nThis `<BraintreePayPalButtons />` component renders the [Braintree PayPal Buttons](https://developer.paypal.com/braintree/docs/guides/paypal/overview) for Braintree Merchants.\nIt relies on the `<PayPalScriptProvider />` parent component for managing state related to loading the JS SDK script.\n\nNote: You are able to make your integration using the client token or using the tokenization key.\n\n- To use the client token integration set the key `data-client-token` in the `PayPayScriptProvider` component's options.\n- To use the tokenization key integration set the key `data-user-id-token` in the `PayPayScriptProvider` component's options.\n*/\n\n\nvar BraintreePayPalButtons = function (_a) {\n  var _b = _a.className,\n      className = _b === void 0 ? \"\" : _b,\n      _c = _a.disabled,\n      disabled = _c === void 0 ? false : _c,\n      children = _a.children,\n      _d = _a.forceReRender,\n      forceReRender = _d === void 0 ? [] : _d,\n      braintreeNamespace = _a.braintreeNamespace,\n      merchantAccountId = _a.merchantAccountId,\n      buttonProps = __rest(_a, [\"className\", \"disabled\", \"children\", \"forceReRender\", \"braintreeNamespace\", \"merchantAccountId\"]);\n\n  var _e = useState(null),\n      setErrorState = _e[1];\n\n  var _f = useScriptProviderContext(),\n      providerContext = _f[0],\n      dispatch = _f[1];\n\n  useEffect(function () {\n    getBraintreeNamespace(braintreeNamespace).then(function (braintree) {\n      var clientTokenizationKey = providerContext.options[SDK_SETTINGS.DATA_USER_ID_TOKEN];\n      var clientToken = providerContext.options[SDK_SETTINGS.DATA_CLIENT_TOKEN];\n      return braintree.client.create({\n        authorization: clientTokenizationKey || clientToken\n      }).then(function (clientInstance) {\n        var merchantProp = merchantAccountId ? {\n          merchantAccountId: merchantAccountId\n        } : {};\n        return braintree.paypalCheckout.create(__assign(__assign({}, merchantProp), {\n          client: clientInstance\n        }));\n      }).then(function (paypalCheckoutInstance) {\n        dispatch({\n          type: DISPATCH_ACTION.SET_BRAINTREE_INSTANCE,\n          value: paypalCheckoutInstance\n        });\n      });\n    }).catch(function (err) {\n      setErrorState(function () {\n        throw new Error(\"\".concat(LOAD_SCRIPT_ERROR, \" \").concat(err));\n      });\n    }); // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [providerContext.options]);\n  return React.createElement(React.Fragment, null, providerContext.braintreePayPalCheckoutInstance && React.createElement(PayPalButtons, __assign({\n    className: className,\n    disabled: disabled,\n    forceReRender: forceReRender\n  }, decorateActions(buttonProps, providerContext.braintreePayPalCheckoutInstance)), children));\n};\n/**\nThe `<PayPalMarks />` component is used for conditionally rendering different payment options using radio buttons.\nThe [Display PayPal Buttons with other Payment Methods guide](https://developer.paypal.com/docs/business/checkout/add-capabilities/buyer-experience/#display-paypal-buttons-with-other-payment-methods) describes this style of integration in detail.\nIt relies on the `<PayPalScriptProvider />` parent component for managing state related to loading the JS SDK script.\n\nThis component can also be configured to use a single funding source similar to the [standalone buttons](https://developer.paypal.com/docs/business/checkout/configure-payments/standalone-buttons/) approach.\nA `FUNDING` object is exported by this library which has a key for every available funding source option.\n*/\n\n\nvar PayPalMarks = function (_a) {\n  var _b = _a.className,\n      className = _b === void 0 ? \"\" : _b,\n      children = _a.children,\n      markProps = __rest(_a, [\"className\", \"children\"]);\n\n  var _c = usePayPalScriptReducer()[0],\n      isResolved = _c.isResolved,\n      options = _c.options;\n  var markContainerRef = useRef(null);\n\n  var _d = useState(true),\n      isEligible = _d[0],\n      setIsEligible = _d[1];\n\n  var _e = useState(null),\n      setErrorState = _e[1];\n  /**\n   * Render PayPal Mark into the DOM\n   */\n\n\n  var renderPayPalMark = function (mark) {\n    var current = markContainerRef.current; // only render the mark when eligible\n\n    if (!current || !mark.isEligible()) {\n      return setIsEligible(false);\n    } // Remove any children before render it again\n\n\n    if (current.firstChild) {\n      current.removeChild(current.firstChild);\n    }\n\n    mark.render(current).catch(function (err) {\n      // component failed to render, possibly because it was closed or destroyed.\n      if (current === null || current.children.length === 0) {\n        // paypal marks container is no longer in the DOM, we can safely ignore the error\n        return;\n      } // paypal marks container is still in the DOM\n\n\n      setErrorState(function () {\n        throw new Error(\"Failed to render <PayPalMarks /> component. \".concat(err));\n      });\n    });\n  };\n\n  useEffect(function () {\n    // verify the sdk script has successfully loaded\n    if (isResolved === false) {\n      return;\n    }\n\n    var paypalWindowNamespace = getPayPalWindowNamespace$1(options[SDK_SETTINGS.DATA_NAMESPACE]); // verify dependency on window object\n\n    if (paypalWindowNamespace === undefined || paypalWindowNamespace.Marks === undefined) {\n      return setErrorState(function () {\n        throw new Error(generateErrorMessage({\n          reactComponentName: PayPalMarks.displayName,\n          sdkComponentKey: \"marks\",\n          sdkRequestedComponents: options.components,\n          sdkDataNamespace: options[SDK_SETTINGS.DATA_NAMESPACE]\n        }));\n      });\n    }\n\n    renderPayPalMark(paypalWindowNamespace.Marks(__assign({}, markProps))); // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [isResolved, markProps.fundingSource]);\n  return React.createElement(React.Fragment, null, isEligible ? React.createElement(\"div\", {\n    ref: markContainerRef,\n    className: className\n  }) : children);\n};\n\nPayPalMarks.displayName = \"PayPalMarks\";\n/**\nThis `<PayPalMessages />` messages component renders a credit messaging on upstream merchant sites.\nIt relies on the `<PayPalScriptProvider />` parent component for managing state related to loading the JS SDK script.\n*/\n\nvar PayPalMessages = function (_a) {\n  var _b = _a.className,\n      className = _b === void 0 ? \"\" : _b,\n      _c = _a.forceReRender,\n      forceReRender = _c === void 0 ? [] : _c,\n      messageProps = __rest(_a, [\"className\", \"forceReRender\"]);\n\n  var _d = usePayPalScriptReducer()[0],\n      isResolved = _d.isResolved,\n      options = _d.options;\n  var messagesContainerRef = useRef(null);\n  var messages = useRef(null);\n\n  var _e = useState(null),\n      setErrorState = _e[1];\n\n  useEffect(function () {\n    // verify the sdk script has successfully loaded\n    if (isResolved === false) {\n      return;\n    }\n\n    var paypalWindowNamespace = getPayPalWindowNamespace$1(options[SDK_SETTINGS.DATA_NAMESPACE]); // verify dependency on window object\n\n    if (paypalWindowNamespace === undefined || paypalWindowNamespace.Messages === undefined) {\n      return setErrorState(function () {\n        throw new Error(generateErrorMessage({\n          reactComponentName: PayPalMessages.displayName,\n          sdkComponentKey: \"messages\",\n          sdkRequestedComponents: options.components,\n          sdkDataNamespace: options[SDK_SETTINGS.DATA_NAMESPACE]\n        }));\n      });\n    }\n\n    messages.current = paypalWindowNamespace.Messages(__assign({}, messageProps));\n    messages.current.render(messagesContainerRef.current).catch(function (err) {\n      // component failed to render, possibly because it was closed or destroyed.\n      if (messagesContainerRef.current === null || messagesContainerRef.current.children.length === 0) {\n        // paypal messages container is no longer in the DOM, we can safely ignore the error\n        return;\n      } // paypal messages container is still in the DOM\n\n\n      setErrorState(function () {\n        throw new Error(\"Failed to render <PayPalMessages /> component. \".concat(err));\n      });\n    }); // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, __spreadArray([isResolved], forceReRender, true));\n  return React.createElement(\"div\", {\n    ref: messagesContainerRef,\n    className: className\n  });\n};\n\nPayPalMessages.displayName = \"PayPalMessages\";\n/**\nThis `<PayPalScriptProvider />` component takes care of loading the JS SDK `<script>`.\nIt manages state for script loading so children components like `<PayPalButtons />` know when it's safe to use the `window.paypal` global namespace.\n\nNote: You always should use this component as a wrapper for  `PayPalButtons`, `PayPalMarks`, `PayPalMessages` and `BraintreePayPalButtons` components.\n */\n\nvar PayPalScriptProvider = function (_a) {\n  var _b;\n\n  var _c = _a.options,\n      options = _c === void 0 ? {\n    \"client-id\": \"test\"\n  } : _c,\n      children = _a.children,\n      _d = _a.deferLoading,\n      deferLoading = _d === void 0 ? false : _d;\n\n  var _e = useReducer(scriptReducer, {\n    options: __assign(__assign({}, options), (_b = {}, _b[SCRIPT_ID] = \"\".concat(getScriptID(options)), _b[SDK_SETTINGS.DATA_SDK_INTEGRATION_SOURCE] = SDK_SETTINGS.DATA_SDK_INTEGRATION_SOURCE_VALUE, _b)),\n    loadingStatus: deferLoading ? SCRIPT_LOADING_STATE.INITIAL : SCRIPT_LOADING_STATE.PENDING\n  }),\n      state = _e[0],\n      dispatch = _e[1];\n\n  useEffect(function () {\n    if (deferLoading === false && state.loadingStatus === SCRIPT_LOADING_STATE.INITIAL) {\n      return dispatch({\n        type: DISPATCH_ACTION.LOADING_STATUS,\n        value: SCRIPT_LOADING_STATE.PENDING\n      });\n    }\n\n    if (state.loadingStatus !== SCRIPT_LOADING_STATE.PENDING) {\n      return;\n    }\n\n    var isSubscribed = true;\n    loadScript(state.options).then(function () {\n      if (isSubscribed) {\n        dispatch({\n          type: DISPATCH_ACTION.LOADING_STATUS,\n          value: SCRIPT_LOADING_STATE.RESOLVED\n        });\n      }\n    }).catch(function (err) {\n      console.error(\"\".concat(LOAD_SCRIPT_ERROR, \" \").concat(err));\n\n      if (isSubscribed) {\n        dispatch({\n          type: DISPATCH_ACTION.LOADING_STATUS,\n          value: SCRIPT_LOADING_STATE.REJECTED\n        });\n      }\n    });\n    return function () {\n      isSubscribed = false;\n    };\n  }, [state.options, deferLoading, state.loadingStatus]);\n  return React.createElement(ScriptContext.Provider, {\n    value: __assign(__assign({}, state), {\n      dispatch: dispatch\n    })\n  }, children);\n};\n/**\n * Custom hook to store registered hosted fields children\n * Each `PayPalHostedField` component should be registered on the parent provider\n *\n * @param initialValue the initially registered components\n * @returns at first, an {@link Object} containing the registered hosted fields,\n * and at the second a function handler to register the hosted fields components\n */\n\n\nvar useHostedFieldsRegister = function (initialValue) {\n  if (initialValue === void 0) {\n    initialValue = {};\n  }\n\n  var registeredFields = useRef(initialValue);\n\n  var registerHostedField = function (component) {\n    registeredFields.current = __assign(__assign({}, registeredFields.current), component);\n  };\n\n  return [registeredFields, registerHostedField];\n};\n/**\n * Throw an exception if the HostedFields is not found in the paypal namespace\n * Probably cause for this problem is not sending the hosted-fields string\n * as part of the components props in options\n * {@code <PayPalScriptProvider options={{ components: 'hosted-fields'}}>}\n *\n * @param param0 and object containing the components and namespace defined in options\n * @throws {@code Error}\n *\n */\n\n\nvar generateMissingHostedFieldsError = function (_a) {\n  var _b = _a.components,\n      components = _b === void 0 ? \"\" : _b,\n      _c = SDK_SETTINGS.DATA_NAMESPACE,\n      _d = _a[_c],\n      dataNamespace = _d === void 0 ? DEFAULT_PAYPAL_NAMESPACE : _d;\n  var expectedComponents = components ? \"\".concat(components, \",hosted-fields\") : \"hosted-fields\";\n  var errorMessage = \"Unable to render <PayPalHostedFieldsProvider /> because window.\".concat(dataNamespace, \".HostedFields is undefined.\");\n\n  if (!components.includes(\"hosted-fields\")) {\n    errorMessage += \"\\nTo fix the issue, add 'hosted-fields' to the list of components passed to the parent PayPalScriptProvider: <PayPalScriptProvider options={{ components: '\".concat(expectedComponents, \"'}}>\");\n  }\n\n  return errorMessage;\n};\n/**\n * Validate the expiration date component. Valid combinations are:\n * 1- Only the `expirationDate` field exists.\n * 2- Only the `expirationMonth` and `expirationYear` fields exist. Cannot be used with the `expirationDate` field.\n *\n * @param registerTypes\n * @returns @type {true} when the children are valid\n */\n\n\nvar validateExpirationDate = function (registerTypes) {\n  return !registerTypes.includes(PAYPAL_HOSTED_FIELDS_TYPES.EXPIRATION_DATE) && !registerTypes.includes(PAYPAL_HOSTED_FIELDS_TYPES.EXPIRATION_MONTH) && !registerTypes.includes(PAYPAL_HOSTED_FIELDS_TYPES.EXPIRATION_YEAR);\n};\n/**\n * Check if we find the [number, expiration, cvv] in children\n *\n * @param requiredChildren the list with required children [number, expiration, cvv]\n * @param registerTypes    the list of all the children types pass to the parent\n * @throw an @type {Error} when not find the default children\n */\n\n\nvar hasDefaultChildren = function (registerTypes) {\n  if (!registerTypes.includes(PAYPAL_HOSTED_FIELDS_TYPES.NUMBER) || !registerTypes.includes(PAYPAL_HOSTED_FIELDS_TYPES.CVV) || validateExpirationDate(registerTypes)) {\n    throw new Error(HOSTED_FIELDS_CHILDREN_ERROR);\n  }\n};\n/**\n * Check if we don't have duplicate children types\n *\n * @param registerTypes the list of all the children types pass to the parent\n * @throw an @type {Error} when duplicate types was found\n */\n\n\nvar noDuplicateChildren = function (registerTypes) {\n  if (registerTypes.length !== new Set(registerTypes).size) {\n    throw new Error(HOSTED_FIELDS_DUPLICATE_CHILDREN_ERROR);\n  }\n};\n/**\n * Validate the hosted field children in the PayPalHostedFieldsProvider component.\n * These are the rules:\n * 1- We need to find 3 default children for number, expiration, cvv\n * 2- No duplicate children are allowed\n * 3- No invalid combinations of `expirationDate`, `expirationMonth`, and `expirationYear`\n *\n * @param childrenList     the list of children\n * @param requiredChildren the list with required children [number, expiration, cvv]\n */\n\n\nvar validateHostedFieldChildren = function (registeredFields) {\n  hasDefaultChildren(registeredFields);\n  noDuplicateChildren(registeredFields);\n};\n/**\nThis `<PayPalHostedFieldsProvider />` provider component wraps the form field elements and accepts props like `createOrder()`.\n\nThis provider component is designed to be used with the `<PayPalHostedField />` component.\n\nWarning: If you don't see anything in the screen probably your client is ineligible.\nTo handle this problem make sure to use the prop `notEligibleError` and pass a component with a custom message.\nTake a look to this link if that is the case: https://developer.paypal.com/docs/checkout/advanced/integrate/\n*/\n\n\nvar PayPalHostedFieldsProvider = function (_a) {\n  var styles = _a.styles,\n      createOrder = _a.createOrder,\n      notEligibleError = _a.notEligibleError,\n      children = _a.children,\n      installments = _a.installments;\n  var _b = useScriptProviderContext()[0],\n      options = _b.options,\n      loadingStatus = _b.loadingStatus;\n\n  var _c = useState(true),\n      isEligible = _c[0],\n      setIsEligible = _c[1];\n\n  var _d = useState(),\n      cardFields = _d[0],\n      setCardFields = _d[1];\n\n  var _e = useState(null),\n      setErrorState = _e[1];\n\n  var hostedFieldsContainerRef = useRef(null);\n  var hostedFields = useRef();\n\n  var _f = useHostedFieldsRegister(),\n      registeredFields = _f[0],\n      registerHostedField = _f[1];\n\n  useEffect(function () {\n    var _a;\n\n    validateHostedFieldChildren(Object.keys(registeredFields.current)); // Only render the hosted fields when script is loaded and hostedFields is eligible\n\n    if (!(loadingStatus === SCRIPT_LOADING_STATE.RESOLVED)) {\n      return;\n    } // Get the hosted fields from the [window.paypal.HostedFields] SDK\n\n\n    hostedFields.current = getPayPalWindowNamespace$1(options[SDK_SETTINGS.DATA_NAMESPACE]).HostedFields;\n\n    if (!hostedFields.current) {\n      throw new Error(generateMissingHostedFieldsError((_a = {\n        components: options.components\n      }, _a[SDK_SETTINGS.DATA_NAMESPACE] = options[SDK_SETTINGS.DATA_NAMESPACE], _a)));\n    }\n\n    if (!hostedFields.current.isEligible()) {\n      return setIsEligible(false);\n    } // Clean all the fields before the rerender\n\n\n    if (cardFields) {\n      cardFields.teardown();\n    }\n\n    hostedFields.current.render({\n      // Call your server to set up the transaction\n      createOrder: createOrder,\n      fields: registeredFields.current,\n      installments: installments,\n      styles: styles\n    }).then(function (cardFieldsInstance) {\n      if (hostedFieldsContainerRef.current) {\n        setCardFields(cardFieldsInstance);\n      }\n    }).catch(function (err) {\n      setErrorState(function () {\n        throw new Error(\"Failed to render <PayPalHostedFieldsProvider /> component. \".concat(err));\n      });\n    });\n  }, [loadingStatus, styles]); // eslint-disable-line react-hooks/exhaustive-deps\n\n  return React.createElement(\"div\", {\n    ref: hostedFieldsContainerRef\n  }, isEligible ? React.createElement(PayPalHostedFieldsContext.Provider, {\n    value: {\n      cardFields: cardFields,\n      registerHostedField: registerHostedField\n    }\n  }, children) : notEligibleError);\n};\n/**\nThis `<PayPalHostedField />` component renders individual fields for [Hosted Fields](https://developer.paypal.com/docs/business/checkout/advanced-card-payments/integrate#3-add-javascript-sdk-and-card-form) integrations.\nIt relies on the `<PayPalHostedFieldsProvider />` parent component for managing state related to loading the JS SDK script\nand execute some validations before the rendering the fields.\n\nTo use the PayPal hosted fields you need to define at least three fields:\n\n- A card number field\n- The CVV code from the client card\n- The expiration date\n\nYou can define the expiration date as a single field similar to the example below,\nor you are able to define it in [two separate fields](https://paypal.github.io/react-paypal-js//?path=/docs/paypal-paypalhostedfields--expiration-date). One for the month and second for year.\n\nNote: Take care when using multiple instances of the PayPal Hosted Fields on the same page.\nThe component will fail to render when any of the selectors return more than one element.\n*/\n\n\nvar PayPalHostedField = function (_a) {\n  var hostedFieldType = _a.hostedFieldType,\n      // eslint-disable-line @typescript-eslint/no-unused-vars\n  options = _a.options,\n      // eslint-disable-line @typescript-eslint/no-unused-vars\n  props = __rest(_a, [\"hostedFieldType\", \"options\"]);\n\n  var hostedFieldContext = useContext(PayPalHostedFieldsContext);\n  useEffect(function () {\n    var _a;\n\n    if (!(hostedFieldContext === null || hostedFieldContext === void 0 ? void 0 : hostedFieldContext.registerHostedField)) {\n      throw new Error(\"The HostedField cannot be register in the PayPalHostedFieldsProvider parent component\");\n    } // Register in the parent provider\n\n\n    hostedFieldContext.registerHostedField((_a = {}, _a[hostedFieldType] = {\n      selector: options.selector,\n      placeholder: options.placeholder,\n      type: options.type,\n      formatInput: options.formatInput,\n      maskInput: options.maskInput,\n      select: options.select,\n      maxlength: options.maxlength,\n      minlength: options.minlength,\n      prefill: options.prefill,\n      rejectUnsupportedCards: options.rejectUnsupportedCards\n    }, _a));\n  }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n  return React.createElement(\"div\", __assign({}, props));\n};\n\nvar FUNDING$1 = {\n  PAYPAL: 'paypal',\n  VENMO: 'venmo',\n  APPLEPAY: 'applepay',\n  ITAU: 'itau',\n  CREDIT: 'credit',\n  PAYLATER: 'paylater',\n  CARD: 'card',\n  IDEAL: 'ideal',\n  SEPA: 'sepa',\n  BANCONTACT: 'bancontact',\n  GIROPAY: 'giropay',\n  SOFORT: 'sofort',\n  EPS: 'eps',\n  MYBANK: 'mybank',\n  P24: 'p24',\n  VERKKOPANKKI: 'verkkopankki',\n  PAYU: 'payu',\n  BLIK: 'blik',\n  TRUSTLY: 'trustly',\n  ZIMPLER: 'zimpler',\n  MAXIMA: 'maxima',\n  OXXO: 'oxxo',\n  BOLETO: 'boleto',\n  BOLETOBANCARIO: 'boletobancario',\n  WECHATPAY: 'wechatpay',\n  MERCADOPAGO: 'mercadopago',\n  MULTIBANCO: 'multibanco'\n}; // We do not re-export `FUNDING` from the `sdk-constants` module\n// directly because it has no type definitions.\n//\n// See https://github.com/paypal/react-paypal-js/issues/125\n\nvar FUNDING = FUNDING$1;\nexport { BraintreePayPalButtons, DISPATCH_ACTION, FUNDING, PAYPAL_HOSTED_FIELDS_TYPES, PayPalButtons, PayPalHostedField, PayPalHostedFieldsProvider, PayPalMarks, PayPalMessages, PayPalScriptProvider, SCRIPT_LOADING_STATE, ScriptContext, destroySDKScript, getScriptID, scriptReducer, usePayPalHostedFields, usePayPalScriptReducer, useScriptProviderContext };\n"],"names":["SCRIPT_LOADING_STATE","DISPATCH_ACTION","PAYPAL_HOSTED_FIELDS_TYPES","SCRIPT_ID","SDK_SETTINGS","DATA_SDK_INTEGRATION_SOURCE","DATA_SDK_INTEGRATION_SOURCE_VALUE","DATA_NAMESPACE","DEFAULT_PAYPAL_NAMESPACE","__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__spreadArray","to","from","pack","ar","l","Array","slice","concat","getPayPalWindowNamespace$1","namespace","window","generateErrorMessage","_a","reactComponentName","sdkComponentKey","_b","sdkRequestedComponents","_c","sdkDataNamespace","requiredOptionCapitalized","charAt","toUpperCase","substring","errorMessage","includes","expectedComponents","filter","Boolean","join","getScriptID","options","hashStr","str","hash","total","charCodeAt","String","fromCharCode","Math","abs","JSON","stringify","scriptReducer","state","action","reactPayPalScriptID","scriptNode","type","LOADING_STATUS","loadingStatus","value","RESET_OPTIONS","self","document","querySelector","parentNode","removeChild","PENDING","SET_BRAINTREE_INSTANCE","braintreePayPalCheckoutInstance","ScriptContext","react__WEBPACK_IMPORTED_MODULE_0__","createContext","usePayPalScriptReducer","scriptContext","validateReducer","dispatch","useContext","isInitial","INITIAL","isPending","isResolved","RESOLVED","isRejected","REJECTED","PayPalButtons","className","disabled","children","_d","forceReRender","buttonProps","classNames","trim","buttonsContainerRef","useRef","buttons","_e","_f","useState","initActions","setInitActions","_g","isEligible","setIsEligible","setErrorState","_h","closeButtonsComponent","current","close","catch","useEffect","paypalWindowNamespace","undefined","Buttons","displayName","components","onInit","data","actions","err","render","fundingSource","disable","enable","createElement","Fragment","ref","style","opacity","createScriptElement","url","attributes","newScript","src","keys","forEach","key","setAttribute","getDefaultPromiseImplementation","Promise","validateArguments","PromisePonyfill","PayPalMarks","markProps","markContainerRef","renderPayPalMark","mark","firstChild","Marks","PayPalMessages","messageProps","messagesContainerRef","messages","Messages","PayPalScriptProvider","deferLoading","useReducer","isSubscribed","loadScript","resolve","merchantID","dataMerchantID","newMerchantID","newDataMerchantID","queryString","sdkBaseURL","queryParams","dataAttributes","isArray","toString","reduce","accumulator","params","existingWindowNamespace","currentScript","nextScript","currentScriptClone","cloneNode","dataset","uidAuto","isExactMatch","loadCustomScript","reject","onSuccess","onError","defaultError","fetch","then","response","status","text","message","originalErrorText","split","replace","onerror","onload","head","insertBefore","firstElementChild","newWindowNamespace","console","error","Provider","FUNDING","PAYPAL","VENMO","APPLEPAY","ITAU","CREDIT","PAYLATER","CARD","IDEAL","SEPA","BANCONTACT","GIROPAY","SOFORT","EPS","MYBANK","P24","VERKKOPANKKI","PAYU","BLIK","TRUSTLY","ZIMPLER","MAXIMA","OXXO","BOLETO","BOLETOBANCARIO","WECHATPAY","MERCADOPAGO","MULTIBANCO"],"sourceRoot":""}