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,KAAK,KAAM,8CAA8C,OAAO,EAAK,OAC/E,KAAO,wBACP,CACT,CAEA,OAAO,CACT,CAhByC,GAkBrC,WAAa,gDAEjB,SAAS,kBAAkB,EAAW,EAAa,GACjD,IACI,GADc,UAAU,OAAS,QAAsB,IAAjB,UAAU,GAAmB,UAAU,GAAK,CAAC,GACpD,IAC/B,OAA2B,IAArB,EAA8B,WAAa,EAErD,MAAsB,oBAAX,OAEF,QAAQ,QAAQ,CAAC,GAInB,WAAW,EAAK,iBAAiB,MAAK,SAAU,GACrD,OAAO,EAAc,EAAW,EAAa,EAC/C,GACF,CAEA,SAAS,qBACP,IAAI,EAEA,EAAS,SAAS,cAAc,eAAgB,OAAO,WAAY,OACvE,SAAmG,QAAlD,EAAwB,EAAO,qBAAqD,IAA1B,GAA4C,EAAsB,YAAY,GACzL,OAAO,mBAAgB,CACzB,CAEA,IAAI,UAAY,cAEhB,QAAQ,UAAY,UACpB,QAAQ,mBAAqB,mBAC7B,QAAQ,kBAAoB","file":"/npm/@tosspayments/payment-widget-sdk@0.12.1/dist/index.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@tosspayments/payment-widget-sdk@0.12.1/dist/index.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\nfunction _inherits(subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function\");\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n    return o.__proto__ || Object.getPrototypeOf(o);\n  };\n  return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n\n  return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n  if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n  if (Reflect.construct.sham) return false;\n  if (typeof Proxy === \"function\") return true;\n\n  try {\n    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\nfunction _construct(Parent, args, Class) {\n  if (_isNativeReflectConstruct()) {\n    _construct = Reflect.construct;\n  } else {\n    _construct = function _construct(Parent, args, Class) {\n      var a = [null];\n      a.push.apply(a, args);\n      var Constructor = Function.bind.apply(Parent, a);\n      var instance = new Constructor();\n      if (Class) _setPrototypeOf(instance, Class.prototype);\n      return instance;\n    };\n  }\n\n  return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n  return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n  var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n  _wrapNativeSuper = function _wrapNativeSuper(Class) {\n    if (Class === null || !_isNativeFunction(Class)) return Class;\n\n    if (typeof Class !== \"function\") {\n      throw new TypeError(\"Super expression must either be null or a function\");\n    }\n\n    if (typeof _cache !== \"undefined\") {\n      if (_cache.has(Class)) return _cache.get(Class);\n\n      _cache.set(Class, Wrapper);\n    }\n\n    function Wrapper() {\n      return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n    }\n\n    Wrapper.prototype = Object.create(Class.prototype, {\n      constructor: {\n        value: Wrapper,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n    return _setPrototypeOf(Wrapper, Class);\n  };\n\n  return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n  if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n    return call;\n  } else if (call !== void 0) {\n    throw new TypeError(\"Derived constructors may only return object or undefined\");\n  }\n\n  return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n  var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n  return function _createSuperInternal() {\n    var Super = _getPrototypeOf(Derived),\n        result;\n\n    if (hasNativeReflectConstruct) {\n      var NewTarget = _getPrototypeOf(this).constructor;\n\n      result = Reflect.construct(Super, arguments, NewTarget);\n    } else {\n      result = Super.apply(this, arguments);\n    }\n\n    return _possibleConstructorReturn(this, result);\n  };\n}\n\nvar cachedPromise = null;\nfunction loadScript(src, namespace) {\n  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n  // Return the cached Promise if it exists\n  if (cachedPromise != null) {\n    return cachedPromise;\n  }\n\n  var promise = new Promise(function (resolve, reject) {\n    try {\n      var onLoad = function onLoad() {\n        if (getNamespace(namespace) != null) {\n          resolve(getNamespace(namespace));\n        } else {\n          reject(new NamespaceNotAvailableError(namespace));\n        }\n      };\n\n      var onError = function onError() {\n        reject(new ScriptLoadFailedError(src));\n      };\n\n      // Handle SSR\n      if (typeof window === 'undefined' || typeof document === 'undefined') {\n        return resolve(null);\n      } // If the SDK instance already exists in the global namespace, resolve with it\n\n\n      if (getNamespace(namespace) != null) {\n        return resolve(getNamespace(namespace));\n      } // if script exists, but we are reloading due to an error,\n      // reload script to trigger 'load' event\n\n\n      var existingScript = document.querySelector(\"script[src=\\\"\".concat(src, \"\\\"]\"));\n\n      if (existingScript != null) {\n        var _existingScript$paren;\n\n        existingScript.removeEventListener('load', onLoad);\n        existingScript.removeEventListener('error', onError);\n        (_existingScript$paren = existingScript.parentElement) === null || _existingScript$paren === void 0 ? void 0 : _existingScript$paren.removeChild(existingScript);\n      }\n\n      var script = document.createElement('script');\n      script.src = src;\n      script.addEventListener('load', onLoad);\n      script.addEventListener('error', onError);\n\n      if (options.priority != null) {\n        script.fetchPriority = options.priority;\n      }\n\n      document.head.appendChild(script);\n    } catch (error) {\n      reject(error);\n      return;\n    }\n  }); // Reset the cache if the Promise is rejected\n\n  cachedPromise = promise[\"catch\"](function (error) {\n    cachedPromise = null;\n    return Promise.reject(error);\n  });\n  return cachedPromise;\n}\n\nfunction getNamespace(name) {\n  return window[name];\n}\n\nvar NamespaceNotAvailableError = /*#__PURE__*/function (_Error) {\n  _inherits(NamespaceNotAvailableError, _Error);\n\n  var _super = _createSuper(NamespaceNotAvailableError);\n\n  function NamespaceNotAvailableError(namespace) {\n    var _this;\n\n    _classCallCheck(this, NamespaceNotAvailableError);\n\n    _this = _super.call(this, \"[TossPayments SDK] \".concat(namespace, \" is not available\"));\n    _this.name = 'NamespaceNotAvailableError';\n    return _this;\n  }\n\n  return NamespaceNotAvailableError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nvar ScriptLoadFailedError = /*#__PURE__*/function (_Error2) {\n  _inherits(ScriptLoadFailedError, _Error2);\n\n  var _super2 = _createSuper(ScriptLoadFailedError);\n\n  function ScriptLoadFailedError(src) {\n    var _this2;\n\n    _classCallCheck(this, ScriptLoadFailedError);\n\n    _this2 = _super2.call(this, \"[TossPayments SDK] Failed to load script: [\".concat(src, \"]\"));\n    _this2.name = 'ScriptLoadFailedError';\n    return _this2;\n  }\n\n  return ScriptLoadFailedError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nvar SCRIPT_URL = 'https://js.tosspayments.com/v1/payment-widget';\n\nfunction loadPaymentWidget(clientKey, customerKey, options) {\n  var loadOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var _loadOptions$src = loadOptions.src,\n      src = _loadOptions$src === void 0 ? SCRIPT_URL : _loadOptions$src;\n\n  if (typeof window === 'undefined') {\n    // XXX(@HyunSeob): SSR할 때 생성자가 사용되는 경우 에러를 발생시키지 않는대신 정상적인 인스턴스를 반환하지 않는다.\n    return Promise.resolve({});\n  } // regenerator-runtime 의존성을 없애기 위해 `async` 키워드를 사용하지 않는다\n\n\n  return loadScript(src, 'PaymentWidget').then(function (PaymentWidget) {\n    return PaymentWidget(clientKey, customerKey, options);\n  });\n}\n\nfunction clearPaymentWidget() {\n  var _script$parentElement;\n\n  var script = document.querySelector(\"script[src=\\\"\".concat(SCRIPT_URL, \"\\\"]\"));\n  script === null || script === void 0 ? void 0 : (_script$parentElement = script.parentElement) === null || _script$parentElement === void 0 ? void 0 : _script$parentElement.removeChild(script);\n  window.PaymentWidget = undefined;\n}\n\nvar ANONYMOUS = '@@ANONYMOUS';\n\nexports.ANONYMOUS = ANONYMOUS;\nexports.clearPaymentWidget = clearPaymentWidget;\nexports.loadPaymentWidget = loadPaymentWidget;\n"]}