@bootpay/client-js 5.2.0-beta.4 → 5.2.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -861,7 +861,7 @@ class Ms extends Ls {
861
861
  }
862
862
  }
863
863
  }
864
- const Be = new Ms(), qs = "@bootpay/client-js", Ws = "5.2.0-beta.4", zs = "dist/index.es.js", js = "dist/src/index.d.ts", Ks = "dist/index.css", Gs = {
864
+ const Be = new Ms(), qs = "@bootpay/client-js", Ws = "5.2.0-beta.5", zs = "dist/index.es.js", js = "dist/src/index.d.ts", Ks = "dist/index.css", Gs = {
865
865
  test: 'echo "Error: no test specified" && exit 1',
866
866
  build: "rm -rf ./dist && vite build",
867
867
  deploy: "NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"
@@ -3806,6 +3806,7 @@ const W = new vn(), Se = class Se extends qe {
3806
3806
  widget: e.widget,
3807
3807
  widget_key: e.widget_key,
3808
3808
  widget_sandbox: e.widget_sandbox,
3809
+ subscribe_brandpay_type: e.subscribe_brandpay_type,
3809
3810
  platform_type: this.platformType,
3810
3811
  ver: D.packageVersion,
3811
3812
  sdk_version: D.sdkVersion,
@@ -7556,6 +7557,7 @@ const q = {
7556
7557
  this.encrypt({
7557
7558
  order_name: this.data.order_name,
7558
7559
  use_only_brandpay: this.data.use_only_brandpay,
7560
+ subscribe_brandpay_type: this.data.subscribe_brandpay_type,
7559
7561
  user_token: this.data.user_token,
7560
7562
  sandbox: this.data.sandbox,
7561
7563
  use_terms: this.data.use_terms,
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;left:0;right:0;top:0;bottom:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;left:0;right:0;bottom:0;top:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:transparent}@media (min-width: 600px){body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:#000000b3}}body.bootpay-open .bootpay-payment-background{position:fixed;left:0;right:0;top:0;bottom:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert{padding:1rem}body.bootpay-open .bootpay-payment-background.__alert:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{position:absolute;max-width:400px;width:100%;background-color:#fff;border-radius:12px;left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;box-shadow:0 0 10px #0000001a}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-in{animation:__bootpay-fade-in .1s linear}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-out{animation:__bootpay-fade-out .1s linear}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{left:1rem;right:1rem;width:auto;top:50%;transform:translateY(-50%)}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header{padding:1rem;text-align:left;font-size:20px;font-weight:600;position:relative}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{top:40%;transform:translateY(-50%);padding:0;right:1rem}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{right:8px;top:50%;transform:translateY(-55%)}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after{background-color:#333;width:1px}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-body{padding:1.5rem 1rem;text-align:center;font-size:16px;color:#333;line-height:1.5}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer{display:flex;justify-content:flex-end;border-top:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close{flex:0 1 50%;padding:1rem;background-color:#fff;color:#333;font-size:16px;cursor:pointer;border:0;outline:none}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.border-right{border-right:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close:hover{background-color:#e0e0e0}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary{color:#507cf3;font-weight:600}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary:hover{color:#3f6be2}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;left:0;right:0;top:0;bottom:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;left:0;top:0;bottom:0;right:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;left:0;right:0;top:50px;bottom:72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center;line-height:normal}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:transparent;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translateY(0);opacity:1}to{transform:translateY(150%);opacity:0}}@keyframes __bootpay-fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes __bootpay-fade-out{0%{opacity:1;scale:1}to{opacity:0;scale:.9}}.__bootpay-store-el-fullscreen{position:absolute;left:0;right:0;top:0;bottom:0;height:100%}.bootpay-store-iframe-container{width:100%;height:100%}.bootpay-store-iframe-container>iframe{width:100%;border:0;outline:none;overflow:scroll}.bootpay-store-iframe-container>.bootpay-store-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#000000b3;z-index:100000;text-align:center;display:none}.bootpay-store-iframe-container>.bootpay-store-overlay.fade-in{animation:fadeIn .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay.fade-out{animation:fadeOut .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay:before{display:inline-block;vertical-align:middle;height:100%;content:" "}@media (max-width: 600px){.bootpay-store-iframe-container>.bootpay-store-overlay:before{display:block;height:inherit;vertical-align:inherit}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-overlay-iframe-container{display:inline-block;vertical-align:middle}@media (max-width: 600px){.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-overlay-iframe-container{width:100%!important;height:100%!important}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container{display:inline-block;background-color:#fff;vertical-align:middle;max-width:450px;width:100%;text-align:left;border-radius:12px;overflow:hidden}@media (max-width: 768px){.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container{margin:1rem}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container.zoom-in{animation:zoomIn .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container.zoom-out{animation:zoomOut .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header{position:relative;padding:1rem 1.5rem;font-size:18px}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn{position:absolute;box-shadow:none;background-color:transparent;outline:0;z-index:10001;right:1rem;top:50%;transform:translateY(-50%);height:21px;width:21px;border:0!important;outline:none!important}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn.active,.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:before,.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:after{position:absolute;left:8px;top:0;content:" ";height:24px;width:1px;background-color:#888}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:after{transform:rotate(-45deg)}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-body{padding:1rem 1.5rem 2rem}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer>.bootpay-store-alert-button-grid{display:flex;width:100%}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer>.bootpay-store-alert-button-grid>.bootpay-store-cols{flex:0 50%}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn{display:block;box-shadow:none;background-color:transparent;border:0!important;outline:none!important;width:100%;padding:1rem 0}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-cancel-button{background-color:#f1f1f1;color:#333;font-size:18px;font-weight:500}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-cancel-button:hover{opacity:.8}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-confirm-button{background-color:#507cf3;color:#fff;font-size:18px;font-weight:500}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-confirm-button:hover{opacity:.8}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes zoomIn{0%{transform:scale(.9)}to{transform:scale(1)}}@keyframes zoomOut{0%{transform:scale(1)}to{transform:scale(.9)}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(he,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(he=typeof globalThis<"u"?globalThis:he||self,Z(he.Bootpay={}))})(this,function(he){"use strict";const Z={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX(r){return`__bootpay_track_${r}__`}},Rr=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)}),re=r=>{let e=!1;return typeof r=="string"||Array.isArray(r)?e=r.length===0:e=r==null||je(r,"object")&&r.constructor===Object&&Object.keys(r).length===0,e},L=r=>!re(r),je=(r,e)=>typeof r===e,$s=(r,e=void 0)=>{if(L(e)){const t=typeof e!="string"?new URLSearchParams(JSON.parse(JSON.stringify(e))).toString():e;return/\?/.test(r)?`${r}&${t}`:`${r}?${t}`}else return r},mt=(r,e)=>{for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r};var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ue(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Es(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var Or={exports:{}};function ks(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gt={exports:{}};const Ss=Es(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ur;function z(){return Ur||(Ur=1,function(r,e){(function(t,s){r.exports=s()})(N,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof N<"u"&&N.crypto&&(n=N.crypto),!n&&typeof ks=="function")try{n=Ss}catch{}var x=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||function(){function l(){}return function(h){var m;return l.prototype=h,m=new l,l.prototype=null,m}}(),p={},a=p.lib={},c=a.Base=function(){return{extend:function(l){var h=d(this);return l&&h.mixIn(l),(!h.hasOwnProperty("init")||this.init===h.init)&&(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var l=this.extend();return l.init.apply(l,arguments),l},init:function(){},mixIn:function(l){for(var h in l)l.hasOwnProperty(h)&&(this[h]=l[h]);l.hasOwnProperty("toString")&&(this.toString=l.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),y=a.WordArray=c.extend({init:function(l,h){l=this.words=l||[],h!=i?this.sigBytes=h:this.sigBytes=l.length*4},toString:function(l){return(l||u).stringify(this)},concat:function(l){var h=this.words,m=l.words,b=this.sigBytes,E=l.sigBytes;if(this.clamp(),b%4)for(var k=0;k<E;k++){var S=m[k>>>2]>>>24-k%4*8&255;h[b+k>>>2]|=S<<24-(b+k)%4*8}else for(var R=0;R<E;R+=4)h[b+R>>>2]=m[R>>>2];return this.sigBytes+=E,this},clamp:function(){var l=this.words,h=this.sigBytes;l[h>>>2]&=4294967295<<32-h%4*8,l.length=s.ceil(h/4)},clone:function(){var l=c.clone.call(this);return l.words=this.words.slice(0),l},random:function(l){for(var h=[],m=0;m<l;m+=4)h.push(x());return new y.init(h,l)}}),o=p.enc={},u=o.Hex={stringify:function(l){for(var h=l.words,m=l.sigBytes,b=[],E=0;E<m;E++){var k=h[E>>>2]>>>24-E%4*8&255;b.push((k>>>4).toString(16)),b.push((k&15).toString(16))}return b.join("")},parse:function(l){for(var h=l.length,m=[],b=0;b<h;b+=2)m[b>>>3]|=parseInt(l.substr(b,2),16)<<24-b%8*4;return new y.init(m,h/2)}},f=o.Latin1={stringify:function(l){for(var h=l.words,m=l.sigBytes,b=[],E=0;E<m;E++){var k=h[E>>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(k))}return b.join("")},parse:function(l){for(var h=l.length,m=[],b=0;b<h;b++)m[b>>>2]|=(l.charCodeAt(b)&255)<<24-b%4*8;return new y.init(m,h)}},v=o.Utf8={stringify:function(l){try{return decodeURIComponent(escape(f.stringify(l)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(l){return f.parse(unescape(encodeURIComponent(l)))}},g=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(l){typeof l=="string"&&(l=v.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},_process:function(l){var h,m=this._data,b=m.words,E=m.sigBytes,k=this.blockSize,S=k*4,R=E/S;l?R=s.ceil(R):R=s.max((R|0)-this._minBufferSize,0);var _=R*k,w=s.min(_*4,E);if(_){for(var B=0;B<_;B+=k)this._doProcessBlock(b,B);h=b.splice(0,_),m.sigBytes-=w}return new y.init(h,w)},clone:function(){var l=c.clone.call(this);return l._data=this._data.clone(),l},_minBufferSize:0});a.Hasher=g.extend({cfg:c.extend(),init:function(l){this.cfg=this.cfg.extend(l),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(l){return this._append(l),this._process(),this},finalize:function(l){l&&this._append(l);var h=this._doFinalize();return h},blockSize:16,_createHelper:function(l){return function(h,m){return new l.init(m).finalize(h)}},_createHmacHelper:function(l){return function(h,m){return new $.HMAC.init(l,m).finalize(h)}}});var $=p.algo={};return p}(Math);return t})}(gt)),gt.exports}(function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return t.enc.Utf8})})(Or);var Bs=Or.exports;const Dr=Ue(Bs);var bt={exports:{}},Fr;function Be(){return Fr||(Fr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,x=s.enc;x.Base64={stringify:function(p){var a=p.words,c=p.sigBytes,y=this._map;p.clamp();for(var o=[],u=0;u<c;u+=3)for(var f=a[u>>>2]>>>24-u%4*8&255,v=a[u+1>>>2]>>>24-(u+1)%4*8&255,g=a[u+2>>>2]>>>24-(u+2)%4*8&255,$=f<<16|v<<8|g,l=0;l<4&&u+l*.75<c;l++)o.push(y.charAt($>>>6*(3-l)&63));var h=y.charAt(64);if(h)for(;o.length%4;)o.push(h);return o.join("")},parse:function(p){var a=p.length,c=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var o=0;o<c.length;o++)y[c.charCodeAt(o)]=o}var u=c.charAt(64);if(u){var f=p.indexOf(u);f!==-1&&(a=f)}return d(p,a,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function d(p,a,c){for(var y=[],o=0,u=0;u<a;u++)if(u%4){var f=c[p.charCodeAt(u-1)]<<u%4*2,v=c[p.charCodeAt(u)]>>>6-u%4*2,g=f|v;y[o>>>2]|=g<<24-o%4*8,o++}return n.create(y,o)}}(),t.enc.Base64})}(bt)),bt.exports}var Ps=Be();const Pe=Ue(Ps);class De{$blank(e){return re(e)}$present(e){return!this.$blank(e)}$type(e,t){return je(e,t)}$uuid(){return Rr()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),Pe.stringify(Dr.parse(e))}$decrypt(e){return Dr.stringify(Pe.parse(e))}getUserAgent(){return window.navigator.userAgent}}const Ke={debug:1,info:2,warning:3,error:4},F={level:Ke.warning,setLogLevel(r){this.level=r},messageStringify(r,e){try{return e=`${r}: ${je(e,"object")?JSON.stringify(e):e}`}catch(t){console.error(`log parse error: ${t}`)}},debug(r,e){this.level<=Ke.debug&&console.log(this.messageStringify(r,e))},info(r,e){this.level<=Ke.info&&console.info(this.messageStringify(r,e))},warn(r,e){this.level<=Ke.warning&&console.warn(this.messageStringify(r,e))},error(r,e){this.level<=Ke.error&&console.error(this.messageStringify(r,e))}};class Is extends De{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch{t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch{this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=Z.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=Z.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch{return JSON.parse(e.replace(/\\\"/g,'"'))}}}class Cs extends Is{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round(new Date().getTime()/1e3),t=Z.STORAGE_PREFIX("session"),s=this.getToJSON(t);return this.$blank(s)||s.time+1800<e?this.setToJSON(t,{time:e,term:this.$blank(s)?-1:e-s.time,uuid:`${this.$uuid()}-${e}`}).uuid:s.uuid}currentTimeTerm(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round(new Date().getTime()/1e3),s=Z.STORAGE_PREFIX("session"),i=this.getToJSON(s),n=this.$blank(i)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:i;n.time=e,this.setToJSON(s,n)}generateKey(){return`${this.$uuid()}-${new Date().getTime()}`}setUser(e){return this.set(Z.STORAGE_PREFIX("user"),e===void 0?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(Z.STORAGE_PREFIX("user")))}catch(e){F.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`);return}}}const Ie=new Cs,_e={name:"@bootpay/client-js",version:"5.2.0-beta.4",main:"dist/index.es.js",types:"dist/src/index.d.ts",styles:"dist/index.css",scripts:{test:'echo "Error: no test specified" && exit 1',build:"rm -rf ./dist && vite build",deploy:"NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"},dependencies:{typescript:"^5.5.4"},devDependencies:{"@types/ws":"^8.5.5","@types/node":"^18.15.3","@webpack-cli/serve":"^2.0.5","webpack-dev-server":"^4.15.1",webpack:"^5.87.0","webpack-cli":"^5.1.4",axios:"^0.27.2","crypto-js":"^4.1.1","@types/crypto-js":"^4.1.1","@babel/core":"^7.22.5","@babel/plugin-transform-regenerator":"^7.22.5","@babel/plugin-transform-runtime":"^7.22.5","@babel/plugin-transform-object-assign":"^7.22.5","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-destructuring":"^7.24.8","@babel/preset-env":"^7.22.5","@babel/preset-typescript":"^7.22.5","@babel/runtime-corejs3":"^7.22.5","@babel/plugin-transform-classes":"^7.22.5","core-js":"^3.31.0","babel-loader":"^9.1.2","css-loader":"^6.8.1",sass:"^1.63.4","sass-loader":"^13.3.2","style-loader":"^3.3.3",vite:"^5.4.3","vite-plugin-dts":"^3.6.4","vite-plugin-tsconfig":"^1.0.4","vite-plugin-css-injected-by-js":"^3.3.0"},resolutions:{"@webpack-cli/serve":"^1.3.1"},keywords:[],author:"",license:"ISC",description:""},U={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:_e.version,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(r){this.mode=r},setApplicationId(r){return this.applicationId=r,this.currentApplicationId(void 0)},setLocale(r){this.locale=r,this.isSetLocale=!0},currentApplicationId(r=void 0){return r===void 0?this.applicationId:r},setDevelopmentHost(r){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,r)},setVersion(r,e,t=void 0){this.sdkName=this.sdkNames[e]===void 0?0:this.sdkNames[e],this.sdkVersion=r,this.packageVersion=t===void 0||t===""?_e.version:t},toApi(r){return[this.API_URL[this.mode],r].join("/")},toDoor(r){return[this.DOOR_URL[this.mode],r].join("/")},toWidget(r){return[this.WIDGET_URL[this.mode],r].join("/")},isMobile(){if(typeof window>"u")return!1;const r=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(r)},isMobileSafari(){if(typeof window>"u")return!1;const r=window.navigator.userAgent;return(r.match(/iPad/i)||r.match(/iPhone/i))&&!r.match(/CriOS/i)},toAnalytics(r){return[this.ANALYTICS_URL[this.mode],r].join("/")}};class ue extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const Ce={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||(typeof window<"u"&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof document<"u"&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof Element<"u"&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),this.isBind=!0)},on(r,e,t=void 0){return re(Ce.__BOOTPAY_NAMESPACE)&&(Ce.__BOOTPAY_NAMESPACE={}),this.addEventListener(r.split(".")[0],e,t||!1),Ce.__BOOTPAY_NAMESPACE[r]=e,this},off(r){return L(Ce.__BOOTPAY_NAMESPACE)&&L(Ce.__BOOTPAY_NAMESPACE[r])&&this.removeEventListener(r.split(".")[0],Ce.__BOOTPAY_NAMESPACE[r]),this}};class nt extends De{constructor(e){super(),this.$resolve=null,this.$reject=null,this.$messageEventName=(e==null?void 0:e.messageEventName)??"message.BootpayEvent",this.$eventHooks=(e==null?void 0:e.messageEventHooks)??{},this.afterBind=e==null?void 0:e.afterBind,Ce.initialize()}bind(e,t){this.$messageEventName&&window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(F.debug("event received",JSON.stringify(i)),L(i)&&L(i.event)){const n=this.hookFunction(i.hook);if(L(n)&&L(n[i.event]))return n[i.event](i.data,this);F.debug("event",`${this.$messageEventName}: ${i.event} is not defined`)}}),this.afterBind&&this.afterBind(),this.setCallbackFunction(e,t)}hookFunction(e){return this.$eventHooks[e]}reject(e){L(this.$reject)&&this.$reject(e)}resolve(e){L(this.$resolve)&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(s){F.info("json parsing failed",`data: ${e}, message: ${Ge(s)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}else return null}}const Ge=r=>typeof r=="string"?r.toUpperCase():r instanceof Error?r.message:r;class we extends De{constructor(e={}){super();const{iframeId:t="bootpay-iframe",template:s=this.defaultIframeHtml(),el:i=void 0}=e;this.el=i,this.$windowId=t,this.$template=s}defaultIframeHtml(){return`
2
+ (function(he,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(he=typeof globalThis<"u"?globalThis:he||self,Z(he.Bootpay={}))})(this,function(he){"use strict";const Z={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX(r){return`__bootpay_track_${r}__`}},Rr=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)}),re=r=>{let e=!1;return typeof r=="string"||Array.isArray(r)?e=r.length===0:e=r==null||je(r,"object")&&r.constructor===Object&&Object.keys(r).length===0,e},L=r=>!re(r),je=(r,e)=>typeof r===e,$s=(r,e=void 0)=>{if(L(e)){const t=typeof e!="string"?new URLSearchParams(JSON.parse(JSON.stringify(e))).toString():e;return/\?/.test(r)?`${r}&${t}`:`${r}?${t}`}else return r},mt=(r,e)=>{for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r};var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ue(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Es(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var Or={exports:{}};function ks(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gt={exports:{}};const Ss=Es(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ur;function z(){return Ur||(Ur=1,function(r,e){(function(t,s){r.exports=s()})(N,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof N<"u"&&N.crypto&&(n=N.crypto),!n&&typeof ks=="function")try{n=Ss}catch{}var x=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||function(){function l(){}return function(h){var m;return l.prototype=h,m=new l,l.prototype=null,m}}(),p={},a=p.lib={},c=a.Base=function(){return{extend:function(l){var h=d(this);return l&&h.mixIn(l),(!h.hasOwnProperty("init")||this.init===h.init)&&(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var l=this.extend();return l.init.apply(l,arguments),l},init:function(){},mixIn:function(l){for(var h in l)l.hasOwnProperty(h)&&(this[h]=l[h]);l.hasOwnProperty("toString")&&(this.toString=l.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),y=a.WordArray=c.extend({init:function(l,h){l=this.words=l||[],h!=i?this.sigBytes=h:this.sigBytes=l.length*4},toString:function(l){return(l||u).stringify(this)},concat:function(l){var h=this.words,m=l.words,b=this.sigBytes,E=l.sigBytes;if(this.clamp(),b%4)for(var k=0;k<E;k++){var S=m[k>>>2]>>>24-k%4*8&255;h[b+k>>>2]|=S<<24-(b+k)%4*8}else for(var R=0;R<E;R+=4)h[b+R>>>2]=m[R>>>2];return this.sigBytes+=E,this},clamp:function(){var l=this.words,h=this.sigBytes;l[h>>>2]&=4294967295<<32-h%4*8,l.length=s.ceil(h/4)},clone:function(){var l=c.clone.call(this);return l.words=this.words.slice(0),l},random:function(l){for(var h=[],m=0;m<l;m+=4)h.push(x());return new y.init(h,l)}}),o=p.enc={},u=o.Hex={stringify:function(l){for(var h=l.words,m=l.sigBytes,b=[],E=0;E<m;E++){var k=h[E>>>2]>>>24-E%4*8&255;b.push((k>>>4).toString(16)),b.push((k&15).toString(16))}return b.join("")},parse:function(l){for(var h=l.length,m=[],b=0;b<h;b+=2)m[b>>>3]|=parseInt(l.substr(b,2),16)<<24-b%8*4;return new y.init(m,h/2)}},f=o.Latin1={stringify:function(l){for(var h=l.words,m=l.sigBytes,b=[],E=0;E<m;E++){var k=h[E>>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(k))}return b.join("")},parse:function(l){for(var h=l.length,m=[],b=0;b<h;b++)m[b>>>2]|=(l.charCodeAt(b)&255)<<24-b%4*8;return new y.init(m,h)}},v=o.Utf8={stringify:function(l){try{return decodeURIComponent(escape(f.stringify(l)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(l){return f.parse(unescape(encodeURIComponent(l)))}},g=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(l){typeof l=="string"&&(l=v.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},_process:function(l){var h,m=this._data,b=m.words,E=m.sigBytes,k=this.blockSize,S=k*4,R=E/S;l?R=s.ceil(R):R=s.max((R|0)-this._minBufferSize,0);var _=R*k,w=s.min(_*4,E);if(_){for(var B=0;B<_;B+=k)this._doProcessBlock(b,B);h=b.splice(0,_),m.sigBytes-=w}return new y.init(h,w)},clone:function(){var l=c.clone.call(this);return l._data=this._data.clone(),l},_minBufferSize:0});a.Hasher=g.extend({cfg:c.extend(),init:function(l){this.cfg=this.cfg.extend(l),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(l){return this._append(l),this._process(),this},finalize:function(l){l&&this._append(l);var h=this._doFinalize();return h},blockSize:16,_createHelper:function(l){return function(h,m){return new l.init(m).finalize(h)}},_createHmacHelper:function(l){return function(h,m){return new $.HMAC.init(l,m).finalize(h)}}});var $=p.algo={};return p}(Math);return t})}(gt)),gt.exports}(function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return t.enc.Utf8})})(Or);var Bs=Or.exports;const Dr=Ue(Bs);var bt={exports:{}},Fr;function Be(){return Fr||(Fr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,x=s.enc;x.Base64={stringify:function(p){var a=p.words,c=p.sigBytes,y=this._map;p.clamp();for(var o=[],u=0;u<c;u+=3)for(var f=a[u>>>2]>>>24-u%4*8&255,v=a[u+1>>>2]>>>24-(u+1)%4*8&255,g=a[u+2>>>2]>>>24-(u+2)%4*8&255,$=f<<16|v<<8|g,l=0;l<4&&u+l*.75<c;l++)o.push(y.charAt($>>>6*(3-l)&63));var h=y.charAt(64);if(h)for(;o.length%4;)o.push(h);return o.join("")},parse:function(p){var a=p.length,c=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var o=0;o<c.length;o++)y[c.charCodeAt(o)]=o}var u=c.charAt(64);if(u){var f=p.indexOf(u);f!==-1&&(a=f)}return d(p,a,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function d(p,a,c){for(var y=[],o=0,u=0;u<a;u++)if(u%4){var f=c[p.charCodeAt(u-1)]<<u%4*2,v=c[p.charCodeAt(u)]>>>6-u%4*2,g=f|v;y[o>>>2]|=g<<24-o%4*8,o++}return n.create(y,o)}}(),t.enc.Base64})}(bt)),bt.exports}var Ps=Be();const Pe=Ue(Ps);class De{$blank(e){return re(e)}$present(e){return!this.$blank(e)}$type(e,t){return je(e,t)}$uuid(){return Rr()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),Pe.stringify(Dr.parse(e))}$decrypt(e){return Dr.stringify(Pe.parse(e))}getUserAgent(){return window.navigator.userAgent}}const Ke={debug:1,info:2,warning:3,error:4},F={level:Ke.warning,setLogLevel(r){this.level=r},messageStringify(r,e){try{return e=`${r}: ${je(e,"object")?JSON.stringify(e):e}`}catch(t){console.error(`log parse error: ${t}`)}},debug(r,e){this.level<=Ke.debug&&console.log(this.messageStringify(r,e))},info(r,e){this.level<=Ke.info&&console.info(this.messageStringify(r,e))},warn(r,e){this.level<=Ke.warning&&console.warn(this.messageStringify(r,e))},error(r,e){this.level<=Ke.error&&console.error(this.messageStringify(r,e))}};class Is extends De{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch{t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch{this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=Z.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=Z.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch{return JSON.parse(e.replace(/\\\"/g,'"'))}}}class Cs extends Is{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round(new Date().getTime()/1e3),t=Z.STORAGE_PREFIX("session"),s=this.getToJSON(t);return this.$blank(s)||s.time+1800<e?this.setToJSON(t,{time:e,term:this.$blank(s)?-1:e-s.time,uuid:`${this.$uuid()}-${e}`}).uuid:s.uuid}currentTimeTerm(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round(new Date().getTime()/1e3),s=Z.STORAGE_PREFIX("session"),i=this.getToJSON(s),n=this.$blank(i)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:i;n.time=e,this.setToJSON(s,n)}generateKey(){return`${this.$uuid()}-${new Date().getTime()}`}setUser(e){return this.set(Z.STORAGE_PREFIX("user"),e===void 0?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(Z.STORAGE_PREFIX("user")))}catch(e){F.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`);return}}}const Ie=new Cs,_e={name:"@bootpay/client-js",version:"5.2.0-beta.5",main:"dist/index.es.js",types:"dist/src/index.d.ts",styles:"dist/index.css",scripts:{test:'echo "Error: no test specified" && exit 1',build:"rm -rf ./dist && vite build",deploy:"NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"},dependencies:{typescript:"^5.5.4"},devDependencies:{"@types/ws":"^8.5.5","@types/node":"^18.15.3","@webpack-cli/serve":"^2.0.5","webpack-dev-server":"^4.15.1",webpack:"^5.87.0","webpack-cli":"^5.1.4",axios:"^0.27.2","crypto-js":"^4.1.1","@types/crypto-js":"^4.1.1","@babel/core":"^7.22.5","@babel/plugin-transform-regenerator":"^7.22.5","@babel/plugin-transform-runtime":"^7.22.5","@babel/plugin-transform-object-assign":"^7.22.5","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-destructuring":"^7.24.8","@babel/preset-env":"^7.22.5","@babel/preset-typescript":"^7.22.5","@babel/runtime-corejs3":"^7.22.5","@babel/plugin-transform-classes":"^7.22.5","core-js":"^3.31.0","babel-loader":"^9.1.2","css-loader":"^6.8.1",sass:"^1.63.4","sass-loader":"^13.3.2","style-loader":"^3.3.3",vite:"^5.4.3","vite-plugin-dts":"^3.6.4","vite-plugin-tsconfig":"^1.0.4","vite-plugin-css-injected-by-js":"^3.3.0"},resolutions:{"@webpack-cli/serve":"^1.3.1"},keywords:[],author:"",license:"ISC",description:""},U={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:_e.version,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(r){this.mode=r},setApplicationId(r){return this.applicationId=r,this.currentApplicationId(void 0)},setLocale(r){this.locale=r,this.isSetLocale=!0},currentApplicationId(r=void 0){return r===void 0?this.applicationId:r},setDevelopmentHost(r){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,r)},setVersion(r,e,t=void 0){this.sdkName=this.sdkNames[e]===void 0?0:this.sdkNames[e],this.sdkVersion=r,this.packageVersion=t===void 0||t===""?_e.version:t},toApi(r){return[this.API_URL[this.mode],r].join("/")},toDoor(r){return[this.DOOR_URL[this.mode],r].join("/")},toWidget(r){return[this.WIDGET_URL[this.mode],r].join("/")},isMobile(){if(typeof window>"u")return!1;const r=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(r)},isMobileSafari(){if(typeof window>"u")return!1;const r=window.navigator.userAgent;return(r.match(/iPad/i)||r.match(/iPhone/i))&&!r.match(/CriOS/i)},toAnalytics(r){return[this.ANALYTICS_URL[this.mode],r].join("/")}};class ue extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const Ce={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||(typeof window<"u"&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof document<"u"&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof Element<"u"&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),this.isBind=!0)},on(r,e,t=void 0){return re(Ce.__BOOTPAY_NAMESPACE)&&(Ce.__BOOTPAY_NAMESPACE={}),this.addEventListener(r.split(".")[0],e,t||!1),Ce.__BOOTPAY_NAMESPACE[r]=e,this},off(r){return L(Ce.__BOOTPAY_NAMESPACE)&&L(Ce.__BOOTPAY_NAMESPACE[r])&&this.removeEventListener(r.split(".")[0],Ce.__BOOTPAY_NAMESPACE[r]),this}};class nt extends De{constructor(e){super(),this.$resolve=null,this.$reject=null,this.$messageEventName=(e==null?void 0:e.messageEventName)??"message.BootpayEvent",this.$eventHooks=(e==null?void 0:e.messageEventHooks)??{},this.afterBind=e==null?void 0:e.afterBind,Ce.initialize()}bind(e,t){this.$messageEventName&&window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(F.debug("event received",JSON.stringify(i)),L(i)&&L(i.event)){const n=this.hookFunction(i.hook);if(L(n)&&L(n[i.event]))return n[i.event](i.data,this);F.debug("event",`${this.$messageEventName}: ${i.event} is not defined`)}}),this.afterBind&&this.afterBind(),this.setCallbackFunction(e,t)}hookFunction(e){return this.$eventHooks[e]}reject(e){L(this.$reject)&&this.$reject(e)}resolve(e){L(this.$resolve)&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(s){F.info("json parsing failed",`data: ${e}, message: ${Ge(s)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}else return null}}const Ge=r=>typeof r=="string"?r.toUpperCase():r instanceof Error?r.message:r;class we extends De{constructor(e={}){super();const{iframeId:t="bootpay-iframe",template:s=this.defaultIframeHtml(),el:i=void 0}=e;this.el=i,this.$windowId=t,this.$template=s}defaultIframeHtml(){return`
3
3
  <iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe>
4
4
  `}byId(e){return document.getElementById(e)}createTemplateHtml(){this.byId(this.$windowId)===null&&document.body.insertAdjacentHTML("beforeend",this.$template)}bodyOpen(e=void 0){const t=document.querySelector("body");this.$present(t.className)?t.className=`${t.className} bootpay-open`:t.className="bootpay-open",this.$present(e)&&(t.className=`${t.className} ${e}`)}bodyClose(){const e=document.querySelector("body");e.className=e.className.replace("bootpay-open","")}templateResize(e,t){const s=this.byId(e);if(s!==void 0)for(let i in Object.keys(t)){let n=Object.keys(t)[i],x=t[n];this.$present(x)&&!String(x).match(/%/)&&!String(x).match(/vh/)&&(n.match(/width/)||n.match(/Width/)||n.match(/height/)||n.match(/Height/))&&(x=`${String(t[n]).replace(/px/gi,"")}px`),s.style.setProperty(n,x)}}isRendered(){const e=document.getElementById(this.$iFrameId);return F.debug("isRendered",`iFrameElement: ${e}`),e!==null&&e.src!==null&&e.src!==""}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}defaultRender(e){this.el=String(el).replace(/#/g,"");const t=document.getElementById(this.el);if(this.$blank(el)||t===null)throw new Error("렌더링할 DOM Element ID를 입력해주세요.");t.style.setProperty("height","0"),t.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",e)}}class Ts extends we{constructor(){super(),this.$alfredId="bootpay-alfred-progress-id",this.$alfredTextId="__alfred-text-message__"}template(e){return`
5
5
  <div class="bootpay-progress-background" id="${this.$alfredId}" style="display: none;">
@@ -46,7 +46,7 @@
46
46
  `}templateReload(){F.debug("template reload","template reload!"),this.$template=this.template()}async start(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(e.application_id,e.tk),this.createTemplateHtml(),this.bodyOpen(),pe.showProgress(this.message("startProgress"));const n=ve.encryptParams(ve.objectKeyToUnderscore(e)),x=this.byId(this.$formId);x.innerHTML=`
47
47
  <input type="hidden" name="payload" value="${n.payload}" />
48
48
  <input type="hidden" name="token" value="${n.token}" />
49
- `,x.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,x.target=this.$iFrameId,x.submit()})}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),s=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),s.target=this.$confirmIFrame,s.action=e}setConfirmRedirect(e){const t=this.byId(this.$confirmFormId);t.target="_self",t.action=e}confirm(){return new Promise((e,t)=>{ne.bind(e,t);const s=this.byId(this.$confirmFormId);if(this.$blank(s.action))throw new ue({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});s.submit()})}async startPaymentUrl(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(null,null),pe.showProgress(this.message("startProgress")),this.createTemplateHtml(),this.bodyOpen();const n=this.byId(this.$formId);n.method="GET",n.action=e,n.target=this.$iFrameId,n.submit()})}createPopupButton(e){pe.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,Ye.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();const t="width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no";this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance",t),this.$popupWatcher=setInterval(async()=>{if(this.$popup===void 0||this.$popup.closed){try{clearInterval(this.$popupWatcher),await Ye.sendCloseEvent()}catch(s){F.debug("popup",Ge(s))}return this.$popupUrl=void 0,ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}},500),this.bindParentEventOnPopup()}closePopup(){if(this.$popupWatcher!==void 0)try{clearInterval(this.$popupWatcher),F.debug("close popup","clear popup interval")}catch(e){F.info("clear popup watcher",Ge(e))}if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close(),F.debug("close popup","close popup instance")}catch(e){F.info("popup destroy",Ge(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";U.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,()=>{if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close()}catch(t){F.info("popup destroy",Ge(t))}})}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),s=this.byId(this.$closeButton);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&e&&s.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),s=this.byId(this.$popupItemNameId),i=this.byId(this.$popupPriceId);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&(s.innerText=e.name),i!==void 0&&(parseFloat(e.price)>0?i.innerText=String(e.price).replace(/\B(?=(\d{3})+(?!\d))/g,","):i.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(e=!0){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),pe.hideProgress(),this.closePopup(),ne.allClearEvent(),Ye.clearInstance(),e&&setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(i,n)}}iFrameSetStyle(e){F.debug("change style",e);const t=this.byId(this.$iFrameId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{F.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){F.warn("iframe style",n==null?void 0:n.message)}}}windowStyle(e){F.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{F.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){F.warn("iframe style",n==null?void 0:n.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);e!==void 0&&e.style.setProperty("display","none"),t!==void 0&&t.style.setProperty("display","none")}message(e){return Qt.getLocaleMessage(`${e}.${this.mode}`,U.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:U.isMobile()?"100%":400,height:U.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}}const q=new ji,Oe=class Oe extends De{constructor(){super(),this.$session=Ie,this.$logger=F,this.$event=Ye,this.platformType=Z.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}async requestPayment(e){var t;((t=e.extra)==null?void 0:t.locale)!==void 0&&!U.isSetLocale&&U.setLocale(e.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),e.application_id=U.currentApplicationId(e.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:e}),e.sdk=!0,e.platform_type=this.platformType,e.ver=U.packageVersion,e.sdk_version=U.sdkVersion,e.sdk_type=U.sdkName,e.locale=U.locale,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),e.deposit_price=parseFloat(String(e.deposit_price)),Oe.invalidRequestParamsData(e),Oe.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=this.$transactionKey,e.env=this.getUserDeviceEnvironment(),e.extra=this.openTypeFilter(e.extra),this.extra=e.extra;try{const s=await q.start(e);return F.debug("confirm ready",s),q.hidePaymentiFrame(),q.closePopup(),["done","issued"].indexOf(s.event)===-1&&this.$event.send({step:s.event,msg:"",request:e,response:s}),q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`),Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async confirm(){try{const e=await q.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}eventDone(e,t=!0){var s;this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:e.event==="done"?"결제완료":"가상계좌발급완료",request:{},response:e}),pe.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t&&((s=e.data)==null?void 0:s.receipt_id)!==void 0?this.displayResultView(e.data.receipt_id):q.destroy()}eventError(e){pe.hideProgress(),q.closePopup(),this.isDisplayErrorResult()&&e.event==="error"?this.displayResultErrorView(e):q.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch{return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${new Date().getTime()*1e3}`,this.$transactionKey}async requestSubscription(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,wallet_id:e.wallet_id,widget:e.widget,widget_key:e.widget_key,widget_sandbox:e.widget_sandbox,platform_type:this.platformType,ver:U.packageVersion,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await q.start(t,"CARD_SUBSCRIPTION");switch(F.debug("subscription success",s),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:s}),q.hidePaymentiFrame(),q.closePopup(),s.event){case"done":case"issued":break;case"confirm":q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestAuthentication(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:_e.version,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await q.start(t,"AUTH");switch(F.debug("authentication success",s),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:s}),q.hidePaymentiFrame(),q.closePopup(),s.event){case"done":case"issued":break;case"confirm":q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestPaymentUrl(e){try{const t=await q.startPaymentUrl(e.url);return["done","issued"].indexOf(t.event)===-1&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),q.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return this.extra!==void 0&&this.extra.display_success_result!==void 0&&this.extra.display_success_result}isDisplayErrorResult(){return this.extra!==void 0&&this.extra.display_error_result!==void 0&&this.extra.display_error_result}displayResultView(e){q.moveToUrl(U.toDoor(`result/${e}`))}displayResultErrorView(e){q.moveToUrl(U.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&e.browser_open_type!==void 0){const t=this.getUserAgent();for(let s in e.browser_open_type){const i=e.browser_open_type[s],n=this.$present(this.browserBootpayFilter[i.browser])?this.browserBootpayFilter[i.browser]:new RegExp(`${i.browser}`);if(t.match(n)){e.open_type=i.open_type;break}}}return e}static invalidRequestParamsData(e){if(re(e))throw new ue({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(Oe.invalidRequestParams).forEach(t=>{const s=e[t];if(re(s))throw new ue({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:Oe.invalidRequestParams[t]})})}static invalidRequestItemsData(e,t){if(e!==void 0&&L(e)){let s=0;if(e.forEach((i,n)=>{if(re(i.id))throw new ue({event:"error",error_code:"NEED_ITEM_ID",message:`${n+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(re(i.name))throw new ue({event:"error",error_code:"NEED_ITEM_NAME",message:`${n+1}번째 상품명을 입력해주세요. [ key: name ]`});if(re(i.qty))throw new ue({event:"error",error_code:"NEED_ITEM_QTY",message:`${n+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(re(i.price))throw new ue({event:"error",error_code:"NEED_ITEM_PRICE",message:`${n+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[n].price=parseFloat(String(e[n].price)),e[n].qty=parseFloat(String(e[n].qty)),s+=e[n].price*e[n].qty}),s!==t)throw new ue({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${s} ${typeof s} ]`})}}};Oe.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let Je=Oe;const Ki=new Je;class Gi extends ve{constructor(){super(),this.$session=Ie}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}async send(e){const t=document.URL;if(t!==void 0&&t.search(/bootapi.co.kr/)===-1){const s=this.$session.getUser();e.application_id=U.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=document.referrer!==void 0&&L(document.referrer)&&document.referrer.search(new RegExp(window.location.hostname))==-1?document.referrer:"",e.user_id=s===void 0||re(s)?void 0:s.id,e.items=this.generateItemKeyToVersion1(e.items);try{const i=await this.$http.post(U.toAnalytics(`call?ver=${_e.version}`),e);return i.data.status===200?(F.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(F.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(i.data)}`),Promise.reject())}catch(i){return F.error("Analytics Common Error",`데이터 전송 실패: ${i.message}`),Promise.reject()}}}async login(e){if(e.application_id=U.currentApplicationId(e.application_id),re(e.application_id))return F.error("Analytics Params","application_id 값을 입력해주세요.");if(re(e.id))return F.error("Analytics Params","id 값을 입력해주세요.");try{const t=await this.$http.post(U.toAnalytics(`login?ver=${_e.version}`),e),{user_id:s}=t.data.data;return this.$session.setUser({id:s,time:new Date().getTime()}),Promise.resolve()}catch(t){return F.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){if(e!==void 0)return e.map(t=>({cat1:t.cat1,cat2:t.cat2,cat3:t.cat3,item_img:t.img,item_name:t.name,unique:t.id,price:t.price}))}}const Xi=new Gi;(function(){if(typeof window>"u"||typeof window.CustomEvent=="function")return!1;function r(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}r.prototype=window.Event.prototype,window.CustomEvent=r})();const be={$payment:Ki,$analytics:Xi,$environment:U,async requestPayment(r){return new Promise(async(e,t)=>{try{r.extra!==void 0&&r.extra.override_global_event===!0&&(F.debug("override global event","override global event!"),be.overrideGlobalInstance());const s=await this.$payment.requestPayment(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},async confirm(){return new Promise(async(r,e)=>{try{const t=await this.$payment.confirm();setTimeout(()=>{r(t),this.$payment.eventDone(t)},100)}catch(t){setTimeout(()=>e(this.errorHandler(t)),100)}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestSubscription(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestAuthentication(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestAuthentication(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestPaymentUrl(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestPaymentUrl(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},setEnvironmentMode(r,e=void 0){this.$environment.set(r),e!==void 0&&this.$environment.setDevelopmentHost(e)},setApplicationId(r){return this.$environment.setApplicationId(r)},setVersion(r,e,t){return this.$environment.setVersion(r,e,t)},setDevice(r){switch(r){case"IOS":this.$payment.platformType=Z.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=Z.PLATFORM.ANDROID;break;default:this.$payment.platformType=Z.PLATFORM.JS}return this.$payment.platformType},errorHandler(r){let e;switch(pe.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(L(r.event))e=r;else throw r}return e},readyToPopup(){q.readyToPopup()},setLogLevel(r){F.setLogLevel(r)},setUUID(r){return Ie.setUUID(r)},send(r=void 0){return this.$analytics.send(r!==void 0?r:{})},login(r){return this.$analytics.login(r)},logout(){return this.$analytics.logout()},setLocale(r){U.setLocale(r),q.templateReload()},async dismiss(r=!1){if(r)try{await Ye.sendCloseEvent()}catch(e){F.debug("error",e.message)}ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})},getCurrentUUID(){return Ie.currentUserUUID()},destroy(){q.destroy()},overrideGlobalInstance(){window.Bootpay=be}};typeof window<"u"&&(window.Bootpay=be);class Vi extends nt{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(L(i))switch(F.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"data":return this.resolve(i.data);case"confirmPasswordToken":return this.resolve(i.token);case"confirmAddCard":return this.resolve(i);case"resize":C0.iFrameResize(i.resizeData);break;default:return}})}}class Yi extends we{constructor(){super(),this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new Vi,this.$session=Ie,this.deviceType=Z.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`
49
+ `,x.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,x.target=this.$iFrameId,x.submit()})}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),s=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),s.target=this.$confirmIFrame,s.action=e}setConfirmRedirect(e){const t=this.byId(this.$confirmFormId);t.target="_self",t.action=e}confirm(){return new Promise((e,t)=>{ne.bind(e,t);const s=this.byId(this.$confirmFormId);if(this.$blank(s.action))throw new ue({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});s.submit()})}async startPaymentUrl(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(null,null),pe.showProgress(this.message("startProgress")),this.createTemplateHtml(),this.bodyOpen();const n=this.byId(this.$formId);n.method="GET",n.action=e,n.target=this.$iFrameId,n.submit()})}createPopupButton(e){pe.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,Ye.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();const t="width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no";this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance",t),this.$popupWatcher=setInterval(async()=>{if(this.$popup===void 0||this.$popup.closed){try{clearInterval(this.$popupWatcher),await Ye.sendCloseEvent()}catch(s){F.debug("popup",Ge(s))}return this.$popupUrl=void 0,ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}},500),this.bindParentEventOnPopup()}closePopup(){if(this.$popupWatcher!==void 0)try{clearInterval(this.$popupWatcher),F.debug("close popup","clear popup interval")}catch(e){F.info("clear popup watcher",Ge(e))}if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close(),F.debug("close popup","close popup instance")}catch(e){F.info("popup destroy",Ge(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";U.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,()=>{if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close()}catch(t){F.info("popup destroy",Ge(t))}})}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),s=this.byId(this.$closeButton);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&e&&s.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),s=this.byId(this.$popupItemNameId),i=this.byId(this.$popupPriceId);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&(s.innerText=e.name),i!==void 0&&(parseFloat(e.price)>0?i.innerText=String(e.price).replace(/\B(?=(\d{3})+(?!\d))/g,","):i.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(e=!0){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),pe.hideProgress(),this.closePopup(),ne.allClearEvent(),Ye.clearInstance(),e&&setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(i,n)}}iFrameSetStyle(e){F.debug("change style",e);const t=this.byId(this.$iFrameId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{F.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){F.warn("iframe style",n==null?void 0:n.message)}}}windowStyle(e){F.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{F.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){F.warn("iframe style",n==null?void 0:n.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);e!==void 0&&e.style.setProperty("display","none"),t!==void 0&&t.style.setProperty("display","none")}message(e){return Qt.getLocaleMessage(`${e}.${this.mode}`,U.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:U.isMobile()?"100%":400,height:U.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}}const q=new ji,Oe=class Oe extends De{constructor(){super(),this.$session=Ie,this.$logger=F,this.$event=Ye,this.platformType=Z.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}async requestPayment(e){var t;((t=e.extra)==null?void 0:t.locale)!==void 0&&!U.isSetLocale&&U.setLocale(e.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),e.application_id=U.currentApplicationId(e.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:e}),e.sdk=!0,e.platform_type=this.platformType,e.ver=U.packageVersion,e.sdk_version=U.sdkVersion,e.sdk_type=U.sdkName,e.locale=U.locale,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),e.deposit_price=parseFloat(String(e.deposit_price)),Oe.invalidRequestParamsData(e),Oe.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=this.$transactionKey,e.env=this.getUserDeviceEnvironment(),e.extra=this.openTypeFilter(e.extra),this.extra=e.extra;try{const s=await q.start(e);return F.debug("confirm ready",s),q.hidePaymentiFrame(),q.closePopup(),["done","issued"].indexOf(s.event)===-1&&this.$event.send({step:s.event,msg:"",request:e,response:s}),q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`),Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async confirm(){try{const e=await q.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}eventDone(e,t=!0){var s;this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:e.event==="done"?"결제완료":"가상계좌발급완료",request:{},response:e}),pe.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t&&((s=e.data)==null?void 0:s.receipt_id)!==void 0?this.displayResultView(e.data.receipt_id):q.destroy()}eventError(e){pe.hideProgress(),q.closePopup(),this.isDisplayErrorResult()&&e.event==="error"?this.displayResultErrorView(e):q.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch{return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${new Date().getTime()*1e3}`,this.$transactionKey}async requestSubscription(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,wallet_id:e.wallet_id,widget:e.widget,widget_key:e.widget_key,widget_sandbox:e.widget_sandbox,subscribe_brandpay_type:e.subscribe_brandpay_type,platform_type:this.platformType,ver:U.packageVersion,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await q.start(t,"CARD_SUBSCRIPTION");switch(F.debug("subscription success",s),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:s}),q.hidePaymentiFrame(),q.closePopup(),s.event){case"done":case"issued":break;case"confirm":q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestAuthentication(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:_e.version,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await q.start(t,"AUTH");switch(F.debug("authentication success",s),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:s}),q.hidePaymentiFrame(),q.closePopup(),s.event){case"done":case"issued":break;case"confirm":q.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestPaymentUrl(e){try{const t=await q.startPaymentUrl(e.url);return["done","issued"].indexOf(t.event)===-1&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),q.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return this.extra!==void 0&&this.extra.display_success_result!==void 0&&this.extra.display_success_result}isDisplayErrorResult(){return this.extra!==void 0&&this.extra.display_error_result!==void 0&&this.extra.display_error_result}displayResultView(e){q.moveToUrl(U.toDoor(`result/${e}`))}displayResultErrorView(e){q.moveToUrl(U.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&e.browser_open_type!==void 0){const t=this.getUserAgent();for(let s in e.browser_open_type){const i=e.browser_open_type[s],n=this.$present(this.browserBootpayFilter[i.browser])?this.browserBootpayFilter[i.browser]:new RegExp(`${i.browser}`);if(t.match(n)){e.open_type=i.open_type;break}}}return e}static invalidRequestParamsData(e){if(re(e))throw new ue({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(Oe.invalidRequestParams).forEach(t=>{const s=e[t];if(re(s))throw new ue({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:Oe.invalidRequestParams[t]})})}static invalidRequestItemsData(e,t){if(e!==void 0&&L(e)){let s=0;if(e.forEach((i,n)=>{if(re(i.id))throw new ue({event:"error",error_code:"NEED_ITEM_ID",message:`${n+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(re(i.name))throw new ue({event:"error",error_code:"NEED_ITEM_NAME",message:`${n+1}번째 상품명을 입력해주세요. [ key: name ]`});if(re(i.qty))throw new ue({event:"error",error_code:"NEED_ITEM_QTY",message:`${n+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(re(i.price))throw new ue({event:"error",error_code:"NEED_ITEM_PRICE",message:`${n+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[n].price=parseFloat(String(e[n].price)),e[n].qty=parseFloat(String(e[n].qty)),s+=e[n].price*e[n].qty}),s!==t)throw new ue({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${s} ${typeof s} ]`})}}};Oe.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let Je=Oe;const Ki=new Je;class Gi extends ve{constructor(){super(),this.$session=Ie}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}async send(e){const t=document.URL;if(t!==void 0&&t.search(/bootapi.co.kr/)===-1){const s=this.$session.getUser();e.application_id=U.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=document.referrer!==void 0&&L(document.referrer)&&document.referrer.search(new RegExp(window.location.hostname))==-1?document.referrer:"",e.user_id=s===void 0||re(s)?void 0:s.id,e.items=this.generateItemKeyToVersion1(e.items);try{const i=await this.$http.post(U.toAnalytics(`call?ver=${_e.version}`),e);return i.data.status===200?(F.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(F.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(i.data)}`),Promise.reject())}catch(i){return F.error("Analytics Common Error",`데이터 전송 실패: ${i.message}`),Promise.reject()}}}async login(e){if(e.application_id=U.currentApplicationId(e.application_id),re(e.application_id))return F.error("Analytics Params","application_id 값을 입력해주세요.");if(re(e.id))return F.error("Analytics Params","id 값을 입력해주세요.");try{const t=await this.$http.post(U.toAnalytics(`login?ver=${_e.version}`),e),{user_id:s}=t.data.data;return this.$session.setUser({id:s,time:new Date().getTime()}),Promise.resolve()}catch(t){return F.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){if(e!==void 0)return e.map(t=>({cat1:t.cat1,cat2:t.cat2,cat3:t.cat3,item_img:t.img,item_name:t.name,unique:t.id,price:t.price}))}}const Xi=new Gi;(function(){if(typeof window>"u"||typeof window.CustomEvent=="function")return!1;function r(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}r.prototype=window.Event.prototype,window.CustomEvent=r})();const be={$payment:Ki,$analytics:Xi,$environment:U,async requestPayment(r){return new Promise(async(e,t)=>{try{r.extra!==void 0&&r.extra.override_global_event===!0&&(F.debug("override global event","override global event!"),be.overrideGlobalInstance());const s=await this.$payment.requestPayment(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},async confirm(){return new Promise(async(r,e)=>{try{const t=await this.$payment.confirm();setTimeout(()=>{r(t),this.$payment.eventDone(t)},100)}catch(t){setTimeout(()=>e(this.errorHandler(t)),100)}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestSubscription(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestAuthentication(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestAuthentication(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestPaymentUrl(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestPaymentUrl(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},setEnvironmentMode(r,e=void 0){this.$environment.set(r),e!==void 0&&this.$environment.setDevelopmentHost(e)},setApplicationId(r){return this.$environment.setApplicationId(r)},setVersion(r,e,t){return this.$environment.setVersion(r,e,t)},setDevice(r){switch(r){case"IOS":this.$payment.platformType=Z.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=Z.PLATFORM.ANDROID;break;default:this.$payment.platformType=Z.PLATFORM.JS}return this.$payment.platformType},errorHandler(r){let e;switch(pe.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(L(r.event))e=r;else throw r}return e},readyToPopup(){q.readyToPopup()},setLogLevel(r){F.setLogLevel(r)},setUUID(r){return Ie.setUUID(r)},send(r=void 0){return this.$analytics.send(r!==void 0?r:{})},login(r){return this.$analytics.login(r)},logout(){return this.$analytics.logout()},setLocale(r){U.setLocale(r),q.templateReload()},async dismiss(r=!1){if(r)try{await Ye.sendCloseEvent()}catch(e){F.debug("error",e.message)}ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})},getCurrentUUID(){return Ie.currentUserUUID()},destroy(){q.destroy()},overrideGlobalInstance(){window.Bootpay=be}};typeof window<"u"&&(window.Bootpay=be);class Vi extends nt{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(L(i))switch(F.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"data":return this.resolve(i.data);case"confirmPasswordToken":return this.resolve(i.token);case"confirmAddCard":return this.resolve(i);case"resize":C0.iFrameResize(i.resizeData);break;default:return}})}}class Yi extends we{constructor(){super(),this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new Vi,this.$session=Ie,this.deviceType=Z.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`
50
50
  <div id="${this.$windowId}" class="bootpay-payment-background">
51
51
  <div class="bootpay-payment-window" id="${this.$userWindowId}">
52
52
  <iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
@@ -106,7 +106,7 @@
106
106
  </div>
107
107
  </div>
108
108
  </div>
109
- `}shopUrl(){const e=Object.fromEntries(new URLSearchParams(location.search));return L(e.__b_u)?Pr.toExShopUrl(e.__b_u):Pr.toExShopUrl(`em/${this.$exStore.data.client_key}/${this.$exStore.encryptParameters()}?${this.$exStore.currentBootpayStoreParameters()}`)}}const ge=new kn,cs={hooks:{},setHooks(r){this.hooks=r},callHook(r,e){this.hooks[r]&&this.hooks[r](e)}},Sn={resize:r=>{ge.resize(r)},showAlert({message:r,title:e,options:t}){ge.showAlert(r,e,t)},hideAlert(){ge.hideAlert()},showOverlayiFrame({url:r,options:e}){ge.showOverlayiFrameToUrl(r,e)},hideOverlayiFrame(){ge.hideOverlayiFrame()},responseOverlayiFrame({event:r,data:e}){ge.postMessage(r,e),this.hideOverlayiFrame()},addFavicon({url:r}){const e=document.querySelector("link[rel~='icon']");if(e)e.href=r;else{const t=document.createElement("link");t.rel="icon",t.href=r,document.head.appendChild(t)}},hookOnReady(r=null){cs.callHook("onReady",r)}};class Bn extends nt{constructor(){super({messageEventName:"message.BootpayStoreEvent",messageEventHooks:{StoreWindowEvent:Sn,StoreWindowRouter:er},afterBind:()=>{window.resetBootpayEventListener("popstate.BootpayStoreEvent",e=>{const t=Object.fromEntries(new URLSearchParams(location.search));L(t.__b_u)&&ge.postMessage("BootpayRouterChange",{url:`/${t.__b_u}`})})}})}}const Pn=new Bn;class In extends De{constructor(){super()}initialize(){Br.setExData(void 0,{client_key:void 0,categories:[],extra:{}})}render(e,t){if(this.$blank(t.client_key))throw new Error("client_key가 입력되지 않았습니다.");this.initialize(),Br.setExData(e,t),cs.setHooks(t.hooks),Pn.bind(),ge.render()}hideAlert(e="confirm"){ge.hideAlert(e)}sendEvent(e,t){ge.postMessage(e,t)}}const Ir=new In,ds={render(r,e){Ir.render(r,e)},setEnvironmentMode(r){Pr.set(r)},hideAlert(r="confirm"){Ir.hideAlert(r)},sendEvent(r,e){Ir.sendEvent(r,e)}};typeof window<"u"&&(window.BootpayStore=ds);const W={el:void 0,data:void 0,termsPassed:!1,widgetExtra:{card_quota:[]},widgetType:1,hooks:{},setWidgetData(r,e){this.hooks=e.hooks??{},this.el=String(r).replace(/#/gi,""),this.data=e,this.termsPassed=!1,this.data.terms=this.data.terms??[],this.widgetType=1,this.data.widget=1,this.data.use_terms=this.data.use_terms??!0},setPayment(r,e,t,s=!1,i,n){this.data.pg=r,this.data.method=e,this.data.wallet_id=t,this.termsPassed=s,this.data.terms=i,this.widgetExtra=n},updateOnProcessing(r){L(r.price)&&(this.data.price=r.price),L(r.tax_free)&&(this.data.tax_free=r.tax_free),L(r.currency)&&(this.data.currency=r.currency),r.user_token!==void 0&&(this.data.user_token=r.user_token),L(r.use_terms)&&(this.data.use_terms=r.use_terms!==!1),L(r.sandbox)&&(this.data.sandbox=r.sandbox===!0),L(r.widget_key)&&(this.data.widget_key=r.widget_key),L(r.widget_type)&&(this.widgetType=r.widget_type),r.external_terms!==void 0&&(this.data.external_terms=r.external_terms),r.use_bootpay_inapp_sdk!==void 0&&(this.data.use_bootpay_inapp_sdk=r.use_bootpay_inapp_sdk),r.widget_key!==void 0&&(this.data.widget_key=r.widget_key)},encryptParameters(){return encodeURIComponent(this.encrypt({order_name:this.data.order_name,use_only_brandpay:this.data.use_only_brandpay,user_token:this.data.user_token,sandbox:this.data.sandbox,use_terms:this.data.use_terms,external_terms:this.data.external_terms,key:this.data.widget_key,use_bootpay_inapp_sdk:this.data.use_bootpay_inapp_sdk,extra:this.data.extra,log_level:F.level}))},encrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const e=typeof r=="string"?r:JSON.stringify(r),t=Ve.encrypt(e,oe.enc.Utf8.parse(this.data.application_id.substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7});return Pe.stringify(t.ciphertext)},decrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const t=Ve.decrypt(r,oe.enc.Utf8.parse(this.data.application_id.substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7}).toString(oe.enc.Utf8);try{return JSON.parse(t)}catch{return t}},getExtra(r=void 0){return mt(r??{},mt(this.widgetExtra??{},this.data.extra??{}))},getRequestPaymentData(r=void 0){return this.data.widget_sandbox=this.data.sandbox,this.data.extra=this.getExtra(r.extra),mt(r,this.data)},callHook(r,e){this.data.hooks&&this.data.hooks[r]&&typeof this.data.hooks[r]=="function"&&this.data.hooks[r](e)}};class Cn extends we{constructor(){super(),this.$iFrameId="bootpay-widget-iframe",this.$widgetStore=W,this.$template=this.defaultIframeHtml()}render(){const e=document.getElementById(this.$widgetStore.el);if(this.$blank(this.$widgetStore.el)||e===null)throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){const e=document.getElementById(this.$widgetStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",U.toWidget(`p/${this.$widgetStore.data.application_id}/${this.$widgetStore.encryptParameters()}`))}resize(e){this.templateResize(this.$widgetStore.el,e)}rerender(){this.postMessage("bootpayWidgetRerender")}destroy(){const e=document.getElementById(this.$widgetStore.el);e.innerHTML=""}}const G=new Cn;class Tn extends we{constructor(){super(),this.$brandpayWindowId="__bootpay-card-easy-window",this.$iFrameId="__bootpay-card-easy-iframe",this.$windowId="__bootpay-card-easy-container-window",this.$additionalClass=U.isMobile()?"transparent":"rounded-iframe transparent",this.$template=this.template(),this.$widgetStore=W}template(){return`
109
+ `}shopUrl(){const e=Object.fromEntries(new URLSearchParams(location.search));return L(e.__b_u)?Pr.toExShopUrl(e.__b_u):Pr.toExShopUrl(`em/${this.$exStore.data.client_key}/${this.$exStore.encryptParameters()}?${this.$exStore.currentBootpayStoreParameters()}`)}}const ge=new kn,cs={hooks:{},setHooks(r){this.hooks=r},callHook(r,e){this.hooks[r]&&this.hooks[r](e)}},Sn={resize:r=>{ge.resize(r)},showAlert({message:r,title:e,options:t}){ge.showAlert(r,e,t)},hideAlert(){ge.hideAlert()},showOverlayiFrame({url:r,options:e}){ge.showOverlayiFrameToUrl(r,e)},hideOverlayiFrame(){ge.hideOverlayiFrame()},responseOverlayiFrame({event:r,data:e}){ge.postMessage(r,e),this.hideOverlayiFrame()},addFavicon({url:r}){const e=document.querySelector("link[rel~='icon']");if(e)e.href=r;else{const t=document.createElement("link");t.rel="icon",t.href=r,document.head.appendChild(t)}},hookOnReady(r=null){cs.callHook("onReady",r)}};class Bn extends nt{constructor(){super({messageEventName:"message.BootpayStoreEvent",messageEventHooks:{StoreWindowEvent:Sn,StoreWindowRouter:er},afterBind:()=>{window.resetBootpayEventListener("popstate.BootpayStoreEvent",e=>{const t=Object.fromEntries(new URLSearchParams(location.search));L(t.__b_u)&&ge.postMessage("BootpayRouterChange",{url:`/${t.__b_u}`})})}})}}const Pn=new Bn;class In extends De{constructor(){super()}initialize(){Br.setExData(void 0,{client_key:void 0,categories:[],extra:{}})}render(e,t){if(this.$blank(t.client_key))throw new Error("client_key가 입력되지 않았습니다.");this.initialize(),Br.setExData(e,t),cs.setHooks(t.hooks),Pn.bind(),ge.render()}hideAlert(e="confirm"){ge.hideAlert(e)}sendEvent(e,t){ge.postMessage(e,t)}}const Ir=new In,ds={render(r,e){Ir.render(r,e)},setEnvironmentMode(r){Pr.set(r)},hideAlert(r="confirm"){Ir.hideAlert(r)},sendEvent(r,e){Ir.sendEvent(r,e)}};typeof window<"u"&&(window.BootpayStore=ds);const W={el:void 0,data:void 0,termsPassed:!1,widgetExtra:{card_quota:[]},widgetType:1,hooks:{},setWidgetData(r,e){this.hooks=e.hooks??{},this.el=String(r).replace(/#/gi,""),this.data=e,this.termsPassed=!1,this.data.terms=this.data.terms??[],this.widgetType=1,this.data.widget=1,this.data.use_terms=this.data.use_terms??!0},setPayment(r,e,t,s=!1,i,n){this.data.pg=r,this.data.method=e,this.data.wallet_id=t,this.termsPassed=s,this.data.terms=i,this.widgetExtra=n},updateOnProcessing(r){L(r.price)&&(this.data.price=r.price),L(r.tax_free)&&(this.data.tax_free=r.tax_free),L(r.currency)&&(this.data.currency=r.currency),r.user_token!==void 0&&(this.data.user_token=r.user_token),L(r.use_terms)&&(this.data.use_terms=r.use_terms!==!1),L(r.sandbox)&&(this.data.sandbox=r.sandbox===!0),L(r.widget_key)&&(this.data.widget_key=r.widget_key),L(r.widget_type)&&(this.widgetType=r.widget_type),r.external_terms!==void 0&&(this.data.external_terms=r.external_terms),r.use_bootpay_inapp_sdk!==void 0&&(this.data.use_bootpay_inapp_sdk=r.use_bootpay_inapp_sdk),r.widget_key!==void 0&&(this.data.widget_key=r.widget_key)},encryptParameters(){return encodeURIComponent(this.encrypt({order_name:this.data.order_name,use_only_brandpay:this.data.use_only_brandpay,subscribe_brandpay_type:this.data.subscribe_brandpay_type,user_token:this.data.user_token,sandbox:this.data.sandbox,use_terms:this.data.use_terms,external_terms:this.data.external_terms,key:this.data.widget_key,use_bootpay_inapp_sdk:this.data.use_bootpay_inapp_sdk,extra:this.data.extra,log_level:F.level}))},encrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const e=typeof r=="string"?r:JSON.stringify(r),t=Ve.encrypt(e,oe.enc.Utf8.parse(this.data.application_id.substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7});return Pe.stringify(t.ciphertext)},decrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const t=Ve.decrypt(r,oe.enc.Utf8.parse(this.data.application_id.substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7}).toString(oe.enc.Utf8);try{return JSON.parse(t)}catch{return t}},getExtra(r=void 0){return mt(r??{},mt(this.widgetExtra??{},this.data.extra??{}))},getRequestPaymentData(r=void 0){return this.data.widget_sandbox=this.data.sandbox,this.data.extra=this.getExtra(r.extra),mt(r,this.data)},callHook(r,e){this.data.hooks&&this.data.hooks[r]&&typeof this.data.hooks[r]=="function"&&this.data.hooks[r](e)}};class Cn extends we{constructor(){super(),this.$iFrameId="bootpay-widget-iframe",this.$widgetStore=W,this.$template=this.defaultIframeHtml()}render(){const e=document.getElementById(this.$widgetStore.el);if(this.$blank(this.$widgetStore.el)||e===null)throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){const e=document.getElementById(this.$widgetStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",U.toWidget(`p/${this.$widgetStore.data.application_id}/${this.$widgetStore.encryptParameters()}`))}resize(e){this.templateResize(this.$widgetStore.el,e)}rerender(){this.postMessage("bootpayWidgetRerender")}destroy(){const e=document.getElementById(this.$widgetStore.el);e.innerHTML=""}}const G=new Cn;class Tn extends we{constructor(){super(),this.$brandpayWindowId="__bootpay-card-easy-window",this.$iFrameId="__bootpay-card-easy-iframe",this.$windowId="__bootpay-card-easy-container-window",this.$additionalClass=U.isMobile()?"transparent":"rounded-iframe transparent",this.$template=this.template(),this.$widgetStore=W}template(){return`
110
110
  <div id="${this.$windowId}" class="bootpay-payment-background">
111
111
  <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$brandpayWindowId}">
112
112
  <iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@bootpay/client-js",
3
- "version": "5.2.0-beta.4",
3
+ "version": "5.2.0-beta.5",
4
4
  "main": "dist/index.es.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "styles": "dist/index.css",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bootpay/client-js",
3
- "version": "5.2.0-beta.4",
3
+ "version": "5.2.0-beta.5",
4
4
  "main": "dist/index.es.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "styles": "dist/index.css",