1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0f23b-3050-0000-9f5a-10c1aad2e1b6";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="0092a68e-bb60-53cf-97ef-8e792cfb1d81")}catch(e){}}();import{r as h,c as Wn,g as Ro,P as ao,R as xe,a as Ut,b as Ot,d as Re,e as Gt,i as Dr,f as kt,h as ue,p as wr,C as Pl,k as Cr,l as nf,m as Po,n as Um,o as af,q as Bl,_ as kc,s as jm,t as Hm,v as zm,w as Km,x as Gm,y as $t,z as Vc,A as of,B as As,D as sf,T as Fc,U as qm,E as pa,F as Nt,G as Uc,H as ta,I as ra,J as Wm,K as Ym,L as Xm,M as Qm,N as Ll,Q as ha,S as Zm,V as qt,W as lf,X as Ns,Y as Ml,Z as ma,$ as Et,a0 as Xe,a1 as Tt,a2 as cf,a3 as Ln,a4 as Mn,a5 as Bo,a6 as Pr,a7 as _t,a8 as Rt,a9 as uf,aa as Jm,ab as In,ac as kr,ad as df,ae as Dl,af as Ar,ag as Lo,ah as na,ai as Dn,aj as tr,ak as an,al as Vr,am as Mo,an as ff,ao as Qt,ap as $l,aq as eg,ar as Vt,as as tg,at as $r,au as pf,av as rg,aw as Ol,ax as hf,ay as
1ng,az as ag,aA as Do,aB as Rs,aC as Ps,aD as jc,aE as og,aF as _l,aG as mf,aH as gf,aI as ig,aJ as sg,aK as vf,aL as yf,aM as Or,aN as bf,aO as kl,aP as lg,aQ as cg,aR as ug,aS as dg,aT as Cf,aU as _r,aV as fg,aW as pg,aX as Vl,aY as Hc,aZ as hg,a_ as mg,a$ as gg,b0 as xf,b1 as vg,b2 as yg,b3 as bg,b4 as Cg,b5 as xg,b6 as Sg,b7 as Eg,b8 as wg,b9 as zc,ba as Ig,bb as Tg,bc as Sf,bd as Ag,be as Ng,bf as Bs,bg as Rg,bh as Pg,bi as Bg,bj as Lg,bk as Mg,bl as Dg,bm as $g,bn as Og,bo as _g,bp as kg,bq as Vg,br as Fg,bs as Ug,bt as jg,bu as on,bv as Hg,j as L,bw as le,bx as zg,by as ii,bz as ga,bA as Kg,bB as Gg,bC as Br,bD as qg,bE as Wg,bF as pr,bG as aa,bH as Yg,bI as Xg,bJ as Qg,bK as Zg,bL as Jg,bM as e2,bN as Hr,bO as Kc,bP as mr,bQ as t2,bR as Ef,bS as Gc,bT as si,bU as r2,bV as qc,bW as Wc,bX as n2,bY as wf,bZ as Ls,b_ as If,b$ as a2,c0 as o2,c1 as Yc,c2 as i2,c3 as Xc,c4 as Na,c5 as Qc,c6 as Zc,c7 as s2,c8 as l2,c9 as c2,ca as Ra,cb as u2,cc as d2}from"../jse/index-index-C-ZSJqRk.js";import{_ as Tf,u as Fl,D as f2}from"./DefaultErrorAlert-BzSaNoh8.js";import{u as Xt,R as p2,g as Ul,a as h2,b as m2,W as Af,c as Wa,d as jl,M as $o,e as Wr,f as g2,h as v2,i as Nf,j as y2,l as b2,k as C2,L as Oo,m as Rf,n as x2,o as S2,p as E2,q as va,r as _o,s as Ms,t as w2,v as I2,w as T2,x as A2,C as N2,y as R2,P as P2,U as B2,D as L2,z as M2,A as D2}from"./WechatQrCodeModal-COaixSrk.js";import{h as $2,i as O2,p as _2,a as $n,g as ko,P as gr,b as rn,c as hr,d as Hl,e as Pf,S as cr,r as zl,u as Tn,f as k2,C as Kl,m as Yt,j as Bf,k as V2,l as F2,A as U2,n as j2}from"./index-CwwgwO2L.js";import{w as Lf,i as oa,a as li,b as en,u as rt}from"./useTranslation-CkInUBVD.js";import{R as H2}from"./LockOutlined-BbPCO_WW.js";import{P as Vo}from"./common-3ulLous0.js";import{R as z2}from"./index-DXjBxyHd.js";import{R as Mf}from"./QuestionCircleOutlined-3pbo-DGF.js";var K2=function(e){var t=h.useRef(e);t.current=h.useMemo(function(){return e},[e]);var r=h.useRef(void 0);return r.current||(r.current=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return t.current.apply(this,n)}),r.current};function G2(e,t){if(e===t)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0}var q2=function(e,t){var r=h.useRef({deps:t,obj:void 0,initialized:!1}).current;return(r.initialized===!1||!G2(r.deps,t))&&(r.deps=t,r.obj=e(),r.initialized=!0),r.obj};function Gl(e){var t=h.useRef(e);return t.current=e,t}var W2=function(e){var t=Gl(e);h.useEffect(function(){return function(){t.current()}},[])},ci,Jc;function Y2(){if(Jc)return ci;Jc=1;var e=typeof Wn=="object"&&Wn&&Wn.Object===Object&&Wn;return ci=e,ci}var ui,eu;function X2(){if(eu)return ui;eu=1;var e=Y2(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return ui=r,ui}var di,tu;function Df(){if(tu)return di;tu=1;var e=X2(),t=e.Symbol;return di=t,di}var fi,ru;function Q2(){if(ru)return fi;ru=1;var e=Df(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function s(i){var a=r.call(i,o),c=i[o];try{i[o]=void 0;var l=!0}catch{}var f=n.call(i);return l&&(a?i[o]=c:delete i[o]),f}return fi=s,fi}var pi,nu;function Z2(){if(nu)return pi;nu=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return pi=r,pi}var hi,au;function J2(){if(au)return hi;au=1;var e=Df(),t=Q2(),r=Z2(),n="[object Null]",o="[object Undefined]",s=e?e.toStringTag:void 0;function i(a){return a==null?a===void 0?o:n:s&&s in Object(a)?t(a):r(a)}return hi=i,hi}var mi,ou;function e1(){if(ou)return mi;ou=1;function e(t){return t!=null&&typeof t=="object"}return mi=e,mi}var t1=function(){var e=Tf(h.useState({}),2),t=e[1];return h.useCallback(function(){return t({})},[])};function r1(e,t){var r=Tf(h.useState(e),2),n=r[0],o=r[1],s=h.useMemo(function(){var i=!e,a=function(){return o(function(y){return y===e?i:e})},c=function(y){return o(y)},l=function(){return o(e)},f=function(){return o(i)};return{toggle:a,set:c,setLeft:l,setRight:f}},[]);return[n,s]}var n1=function(e,t,r){r===void 0&&(r={});var n=K2(e),o=h.useRef(null),s=h.useCallback(function(){o.current&&clearInterval(o.current)},[]);return h.useEffect(function(){return r.immediate&&n(),o.current=setInterval(n,t),s},[t,r.immediate]),s},gi,iu;function a1(){if(iu)return gi;iu=1;function e(t,r){return function(n){return t(r(n))}}return gi=e,gi}var vi,su;function o1(){if(su)return vi;su=1;var e=a1(),t=e(Object.getPrototypeOf,Object);return vi=t,vi}var yi,lu;function i1(){if(lu)return yi;lu=1;var e=J2(),t=o1(),r=e1(),n="[object Object]",o=Function.prototype,s=Object.prototype,i=o.toString,a=s.hasOwnProperty,c=i.call(Object);function l(f){if(!r(f)||e(f)!=n)return!1;var y=t(f);if(y===null)return!0;var m=a.call(y,"constructor")&&y.constructor;return typeof m=="function"&&m instanceof m&&i.call(m)==c}return yi=l,yi}var s1=i1();const l1=Ro(s1);var cu=new WeakMap,uu=new WeakMap;function $f(e,t){var r=cu.get(e);if(r)return r;if(uu.has(e))return e;var n=new Proxy(e,{get:function(o,s,i){var a=Reflect.get(o,s,i),c=Reflect.getOwnPropertyDescriptor(o,s);return!c?.configurable&&!c?.writable?a:l1(a)||Array.isArray(a)?$f(a,t):a},set:function(o,s,i){var a=Reflect.set(o,s,i);return t(),a},deleteProperty:function(o,s){var i=Reflect.deleteProperty(o,s);return t(),i}});return cu.set(e,n),uu.set(n,e),n}function Fo(e){var t=t1(),r=h.useRef(e),n=q2(function(){return $f(r.current,function(){t()})},[]);return n}var Of=(function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(o,s){return o[0]===r?(n=s,!0):!1}),n}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];r.call(n,i[1],i[0])}},t})()})(),Ds=typeof window<"u"&&typeof document<"u"&&window.document===document,oo=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),c1=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(oo):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),u1=2;function d1(e,t){var r=!1,n=!1,o=0;function s(){r&&(r=!1,e()),n&&a()}function i(){c1(s)}function a(){var c=Date.now();if(r){if(c-o<u1)return;n=!0}else r=!0,n=!1,setTimeout(i,t);o=c}return a}var f1=20,p1=["top","right","bottom","left","width","height","size","weight"],h1=typeof MutationObserver<"u",m1=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=d1(this.refresh.bind(this),f1)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Ds||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h1?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Ds||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=p1.some(function(s){return!!~n.indexOf(s)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=ne
1w e),this.instance_},e.instance_=null,e})(),_f=(function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),An=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||oo}),kf=Uo(0,0,0,0);function io(e){return parseFloat(e)||0}function du(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,o){var s=e["border-"+o+"-width"];return n+io(s)},0)}function g1(e){for(var t=["top","right","bottom","left"],r={},n=0,o=t;n<o.length;n++){var s=o[n],i=e["padding-"+s];r[s]=io(i)}return r}function v1(e){var t=e.getBBox();return Uo(0,0,t.width,t.height)}function y1(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return kf;var n=An(e).getComputedStyle(e),o=g1(n),s=o.left+o.right,i=o.top+o.bottom,a=io(n.width),c=io(n.height);if(n.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=du(n,"left","right")+s),Math.round(c+i)!==r&&(c-=du(n,"top","bottom")+i)),!C1(e)){var l=Math.round(a+s)-t,f=Math.round(c+i)-r;Math.abs(l)!==1&&(a-=l),Math.abs(f)!==1&&(c-=f)}return Uo(o.left,o.top,a,c)}var b1=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof An(e).SVGGraphicsElement}:function(e){return e instanceof An(e).SVGElement&&typeof e.getBBox=="function"}})();function C1(e){return e===An(e).document.documentElement}function x1(e){return Ds?b1(e)?v1(e):y1(e):kf}function S1(e){var t=e.x,r=e.y,n=e.width,o=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(s.prototype);return _f(i,{x:t,y:r,width:n,height:o,top:r,right:t+n,bottom:o+r,left:t}),i}function Uo(e,t,r,n){return{x:e,y:t,width:r,height:n}}var E1=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Uo(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=x1(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),w1=(function(){function e(t,r){var n=S1(r);_f(this,{target:t,contentRect:n})}return e})(),I1=(function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new Of,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof An(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new E1(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof An(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new w1(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Vf=typeof WeakMap<"u"?new WeakMap:new Of,Ff=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=m1.getInstance(),n=new I1(t,r,this);Vf.set(this,n)}return e})();["observe","unobserve","disconnect"].forEach(function(e){Ff.prototype[e]=function(){var t;return(t=Vf.get(this))[e].apply(t,arguments)}});var T1=(function(){return typeof oo.ResizeObserver<"u"?oo.ResizeObserver:Ff})();function Uf(e,t){return ao.reduce((r,n)=>{const o=e[`${n}1`],s=e[`${n}3`],i=e[`${n}6`],a=e[`${n}7`];return{...r,...t(n,{lightColor:o,lightBorderColor:s,darkColor:i,textColor:a})}},{})}const A1=()=>xe.useReducer(e=>e+1,0),Pa=(e,t,r,n,o)=>({background:e,border:`${Re(n.lineWidth)} ${n.lineType} ${t}`,[`${o}-icon`]:{color:r}}),N1=e=>{const{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:o,fontSize:s,fontSizeLG:i,lineHeight:a,borderRadiusLG:c,motionEaseInOutCirc:l,withDescriptionIconSize:f,colorText:y,colorTextHeading:m,withDescriptionPadding:d,defaultPadding:v}=e;return{[t]:{...Ot(e),position:"relative",display:"flex",alignItems:"center",padding:v,wordWrap:"break-word",borderRadius:c,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:s,lineHeight:a},"&-title":{color:m},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${r} ${l}, opacity ${r} ${l}, 2 padding-top ${r} ${l}, padding-bottom ${r} ${l}, 3 margin-bottom ${r} ${l}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}
3},[`${t}-with-description`]:{alignItems:"flex-start",padding:d,[`${t}-icon`]:{marginInlineEnd:o,fontSize:f,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:n,color:m,fontSize:i},[`${t}-description`]:{display:"block",color:y}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},R1=e=>{const{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:o,colorWarning:s,colorWarningBorder:i,colorWarningBg:a,colorError:c,colorErrorBorder:l,colorErrorBg:f,colorInfo:y,colorInfoBorder:m,colorInfoBg:d}=e;return{[t]:{"&-success":Pa(o,n,r,e,t),"&-info":Pa(d,m,y,e,t),"&-warning":Pa(a,i,s,e,t),"&-error":{...Pa(f,l,c,e,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}},P1=e=>{const{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:o,fontSizeIcon:s,colorIcon:i,colorIconHover:a}=e;return{[t]:{"&-actions":{marginInlineStart:o},[`${t}-close-icon`]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:s,lineHeight:Re(s),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${r}-close`]:{color:i,transition:`color ${n}`,"&:hover":{color:a}}},"&-close-text":{color:i,transition:`color ${n}`,"&:hover":{color:a}}}}},B1=e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}),L1=Ut("Alert",e=>[N1(e),R1(e),P1(e)],B1),M1=e=>{const{icon:t,type:r,className:n,style:o,successIcon:s,infoIcon:i,warningIcon:a,errorIcon:c}=e,l={success:s??h.createElement(af,null),info:i??h.createElement(Um,null),error:c??h.createElement(Po,null),warning:a??h.createElement(nf,null)};return h.createElement("span",{className:n,style:o},t??l[r])},D1=e=>{const{isClosable:t,prefixCls:r,closeIcon:n,handleClose:o,ariaProps:s,className:i,style:a}=e,c=n===!0||n===void 0?h.createElement(Bl,null):n;return t?h.createElement("button",{type:"button",onClick:o,className:ue(`${r}-close-icon`,i),tabIndex:0,style:a,...s},c):null},jf=h.forwardRef((e,t)=>{const{description:r,prefixCls:n,message:o,title:s,banner:i,className:a,rootClassName:c,style:l,onMouseEnter:f,onMouseLeave:y,onClick:m,afterClose:d,showIcon:v,closable:b,closeText:S,closeIcon:u,action:C,id:x,styles:I,classNames:N,...E}=e,g=s??o,[p,T]=h.useState(!1),R=h.useRef(null);h.useImperativeHandle(t,()=>({nativeElement:R.current}));const{getPrefixCls:B,direction:P,closable:D,closeIcon:U,className:_,style:V,classNames:z,styles:q,successIcon:G,infoIcon:Y,warningIcon:ee,errorIcon:J}=Gt("alert"),te=B("alert",n),[Q,Z]=L1(te),{onClose:W,afterClose:oe}=b&&typeof b=="object"?b:{},ie=re=>{T(!0),(W??e.onClose)?.(re)},A=h.useMemo(()=>e.type!==void 0?e.type:i?"warning":"info",[e.type,i]),$=h.useMemo(()=>typeof b=="object"&&b.closeIcon||S?!0:typeof b=="boolean"?b:u!==!1&&Dr(u)?!0:!!D,[S,u,b,D]),O=i&&v===void 0?!0:v,w={...e,prefixCls:te,type:A,showIcon:O,closable:$},[M,H]=kt([z,N],[q,I],{props:w}),F=ue(te,`${te}-${A}`,{[`${te}-with-description`]:!!r,[`${te}-no-icon`]:!O,[`${te}-banner`]:!!i,[`${te}-rtl`]:P==="rtl"},_,a,c,M.root,Z,Q),X=wr(E,{aria:!0,data:!0}),ce=h.useMemo(()=>typeof b=="object"&&b.closeIcon?b.closeIcon:S||(u!==void 0?u:typeof D=="object"&&D.closeIcon?D.closeIcon:U),[u,b,D,S,U]),ae=h.useMemo(()=>{const re=b??D;return typeof re=="object"?wr(re,{data:!0,aria:!0}):{}},[b,D]);return h.createElement(Pl,{visible:!p,motionName:`${te}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:re=>({maxHeight:re.offsetHeight}),onLeaveEnd:oe??d},({className:re,style:de},Ce)=>h.createElement("div",{id:x,ref:Cr(R,Ce),"data-show":!p,className:ue(F,re),style:{...H.root,...V,...l,...de},onMouseEnter:f,onMouseLeave:y,onClick:m,role:"alert",...X},O?h.createElement(M1,{className:ue(`${te}-icon`,M.icon),style:H.icon,description:r,icon:e.icon,prefixCls:te,type:A,successIcon:G,infoIcon:Y,warningIcon:ee,errorIcon:J}):null,h.createElement("div",{className:ue(`${te}-section`,M.section),style:H.section},g?h.createElement("div",{className:ue(`${te}-title`,M.title),style:H.title},g):null,r?h.createElement("div",{className:ue(`${te}-description`,M.description),style:H.description},r):null),C?h.createElement("div",{className:ue(`${te}-actions`,M.actions),style:H.actions},C):null,h.createElement(D1,{className:M.close,style:H.close,isClosable:$,prefixCls:te,closeIcon:ce,handleClose:ie,ariaProps:ae})))});function $1(e,t,r){return t=kc(t),jm(e,Hm()?Reflect.construct(t,r||[],kc(e).constructor):t.apply(e,r))}let O1=(function(e){function t(){var r;return Gm(this,t),r=$1(this,t,arguments),r.state={error:void 0,info:{componentStack:""}},r}
3return zm(t,e),Km(t,[{key:"componentDidCatch",value:function(n,o){this.setState({error:n,info:o})}},{key:"render",value:function(){const{message:n,title:o,description:s,id:i,children:a}=this.props,{error:c,info:l}=this.state,f=o??n,y=l?.componentStack||null,m=typeof f>"u"?(c||"").toString():f,d=typeof s>"u"?y:s;return c?h.createElement(jf,{id:i,type:"error",title:m,description:h.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},d)}):a}}])})(h.Component);const ql=jf;ql.ErrorBoundary=O1;const fu=e=>typeof e=="object"&&e!=null&&e.nodeType===1,pu=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ba=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return pu(r.overflowY,t)||pu(r.overflowX,t)||(n=>{const o=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeight<n.scrollHeight||o.clientWidth<n.scrollWidth)})(e)}return!1},La=(e,t,r,n,o,s,i,a)=>s<e&&i>t||s>e&&i<t?0:s<=e&&a<=r||i>=t&&a>=r?s-e-n:i>t&&a<r||s<e&&a>r?i-t+o:0,_1=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},hu=(e,t)=>{var r,n,o,s;if(typeof document>"u")return[];const{scrollMode:i,block:a,inline:c,boundary:l,skipOverflowHiddenElements:f}=t,y=typeof l=="function"?l:V=>V!==l;if(!fu(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,d=[];let v=e;for(;fu(v)&&y(v);){if(v=_1(v),v===m){d.push(v);break}v!=null&&v===document.body&&Ba(v)&&!Ba(document.documentElement)||v!=null&&Ba(v,f)&&d.push(v)}const b=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,S=(s=(o=window.visualViewport)==null?void 0:o.height)!=null?s:innerHeight,{scrollX:u,scrollY:C}=window,{height:x,width:I,top:N,right:E,bottom:g,left:p}=e.getBoundingClientRect(),{top:T,right:R,bottom:B,left:P}=(V=>{const z=window.getComputedStyle(V);return{top:parseFloat(z.scrollMarginTop)||0,right:parseFloat(z.scrollMarginRight)||0,bottom:parseFloat(z.scrollMarginBottom)||0,left:parseFloat(z.scrollMarginLeft)||0}})(e);let D=a==="start"||a==="nearest"?N-T:a==="end"?g+B:N+x/2-T+B,U=c==="center"?p+I/2-P+R:c==="end"?E+R:p-P;const _=[];for(let V=0;V<d.length;V++){const z=d[V],{height:q,width:G,top:Y,right:ee,bottom:J,left:te}=z.getBoundingClientRect();if(i==="if-needed"&&N>=0&&p>=0&&g<=S&&E<=b&&(z===m&&!Ba(z)||N>=Y&&g<=J&&p>=te&&E<=ee))return _;const Q=getComputedStyle(z),Z=parseInt(Q.borderLeftWidth,10),W=parseInt(Q.borderTopWidth,10),oe=parseInt(Q.borderRightWidth,10),ie=parseInt(Q.borderBottomWidth,10);let A=0,$=0;const O="offsetWidth"in z?z.offsetWidth-z.clientWidth-Z-oe:0,w="offsetHeight"in z?z.offsetHeight-z.clientHeight-W-ie:0,M="offsetWidth"in z?z.offsetWidth===0?0:G/z.offsetWidth:0,H="offsetHeight"in z?z.offsetHeight===0?0:q/z.offsetHeight:0;if(m===z)A=a==="start"?D:a==="end"?D-S:a==="nearest"?La(C,C+S,S,W,ie,C+D,C+D+x,x):D-S/2,$=c==="start"?U:c==="center"?U-b/2:c==="end"?U-b:La(u,u+b,b,Z,oe,u+U,u+U+I,I),A=Math.max(0,A+C),$=Math.max(0,$+u);else{A=a==="start"?D-Y-W:a==="end"?D-J+ie+w:a==="nearest"?La(Y,J,q,W,ie+w,D,D+x,x):D-(Y+q/2)+w/2,$=c==="start"?U-te-Z:c==="center"?U-(te+G/2)+O/2:c==="end"?U-ee+oe+O:La(te,ee,G,Z,oe+O,U,U+I,I);const{scrollLeft:F,scrollTop:X}=z;A=H===0?0:Math.max(0,Math.min(X+A/H,z.scrollHeight-q/H+w)),$=M===0?0:Math.max(0,Math.min(F+$/M,z.scrollWidth-G/M+O)),D+=X-A,U+=F-$}_.push({el:z,top:A,left:$})}return _},k1=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function V1(e,t){if(!e.isConnected||!(o=>{let s=o;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const r=(o=>{const s=window.getComputedStyle(o);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(hu(e,t));const n=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:s,left:i}of hu(e,k1(t))){const a=s-r.top+r.bottom,c=i-r.left+r.right;o.scroll({top:a,left:c,behavior:n})}}function mu(e){return e?Array.isArray(e)?e:[e]:[]}function F1(e,t,r){return h.useMemo(()=>{const n=mu(t??e),o=mu(r??e),s=new Set(n),i=new Set(o);return s.has("hover")&&!s.has("click")&&s.add("touch"),i.has("hover")&&!i.has("click")&&i.add("touch"),[s,i]},[e,t,r])}function U1(e,t,r,n,o){$t(()=>{if(e&&t&&r){let y=function(){n(),o()};const s=t,i=r,a=Vc(s),c=Vc(i),l=of(i),f=new Set([l,...a,...c]);return f.forEach(m=>{m.addEventListener("scroll",y,{passive:!0})}),l.addEventListener("resize",y,{passive:!0}),n(),()=>{f.forEach(m=>{m.removeEventListener("scroll",y),l.removeEventListener("resize",y)})}}},[e,t,r])}function j1(e,t,r,n,o,s,i,a){const c=h.useRef(e);c.current=e;const l=h.useRef(!1);h.useEffect(()=>{if(t&&n&&(!o||s)){const y=()=>{l.current=!1},m=b=>{c.current&&!i(b.composedPath?.()?.[0]||b.target)&&!l.current&&a(!1)},d=of(n);d.addEventListener("pointerdown",y,!0),d.addEventListener("mousedown",m,!0),d.addEventListener("contextmenu",m,!0);const v=As(r);return v&&(v.addEventListener("mousedown",m,!0),v.addEventListener("contextmenu",m,!0)),()=>{d.removeEventListener("pointerdown",y,!0),d.removeEventListener("mousedown",m,!0),d.removeEventListener("contextmenu",m,!0),v&&(v.removeEventListener("mousedown",m,!0),v.removeEventListener("contextmenu",m,!0))}}},[t,r,n,o,s]);function f(){l.current=!0}return f}function H1(e=sf){return h.forwardRef((r,n)=>{const{prefixCls:o="rc-trigger-popup",children:s,action:i="hover",showAction:a,hideAction:c,disabled:l=!1,popupVisible:f,defaultPopupVisible:y,onOpenChange:m,afterOpenChange:d,onPopupVisibleChange:v,afterPopupVisibleChange:b,mouseEnterDelay:S,mouseLeaveDelay:u=.1,focusDelay:C,blurDelay:x,mask:I,maskClosable:N=!0,getPopupContainer:E,forceRender:g,autoDestroy:p,popup:T,popupClassName:R,uniqueContainerClassName:B,uniqueContainerStyle:P,popupStyle:D,popupPlacement:U,builtinPlacements:_={},popupAlign:V,zIndex:z,stretch:q,getPopupClassNameFromAlign:G,fresh:Y,unique:ee,alignPoint:J,onPopupClick:te,onPopupAlign:Q,arrow:Z,popupMotion:W,maskMotion:oe,mobile:ie,...A}=r,$=p||!1,O=f===void 0,w=!!ie,M=h.useRef({}),H=h.useContext(Fc),F=h.useMemo(()=>({registerSubPopup:(Be,Ze)=>{M.current[Be]=Ze,H?.registerSubPopup(Be,Ze)}}),[H]),X=h.useContext(qm),ce=pa(),[ae,re]=h.useState(null),de=h.useRef(null),Ce=Nt(Be=>{de.current=Be,Uc(Be)&&ae!==Be&&re(Be),H?.registerSubPopup(ce,Be)}),[he,ye]=h.useState(null),De=h.useRef(null),Fe=Nt(Be=>{const Ze=ta(Be);Uc(Ze)&&he!==Ze&&(ye(Ze),De.current=Ze)}),je={},Le=Nt(Be=>{const Ze=he;return Ze?.contains(Be)||As(Ze)?.host===Be||Be===Ze||ae?.contains(Be)||As(ae)?.host===Be||Be===ae||Ob
3ject.values(M.current).some(jt=>jt?.contains(Be)||Be===jt)}),_e=Z?{...Z!==!0?Z:{}}:null,[ze,Ue]=Xt(y||!1,f),be=ze||!1,Se=be&&!l,Pe=h.useMemo(()=>{const Be=typeof s=="function"?s({open:Se}):s;return h.Children.only(Be)},[s,Se]),$e=Pe?.props||{},ke=Nt(()=>Se),ct=Nt((Be=0)=>({popup:T,target:he,delay:Be,prefixCls:o,popupClassName:R,uniqueContainerClassName:B,uniqueContainerStyle:P,popupStyle:D,popupPlacement:U,builtinPlacements:_,popupAlign:V,zIndex:z,mask:I,maskClosable:N,popupMotion:W,maskMotion:oe,arrow:_e,getPopupContainer:E,getPopupClassNameFromAlign:G,id:ce,onEsc:gt}));$t(()=>{X&&ee&&he&&!O&&!H&&(Se?X.show(ct(S),ke):X.hide(u))},[Se,he]);const at=h.useRef(Se);at.current=Se;const ft=Nt(Be=>{ra.flushSync(()=>{be!==Be&&(Ue(Be),m?.(Be),v?.(Be))})}),yt=Wm(),ot=(Be,Ze=0)=>{if(f!==void 0){yt(()=>{ft(Be)},Ze);return}if(X&&ee&&O&&!H){Be?X.show(ct(Ze),ke):X.hide(Ze);return}yt(()=>{ft(Be)},Ze)};function gt({top:Be}){Be&&ot(!1)}const[bt,xt]=h.useState(!1);$t(Be=>{(!Be||Se)&&xt(!0)},[Se]);const[It,ut]=h.useState(null),[tt,We]=h.useState(null),it=Be=>{We([Be.clientX,Be.clientY])},[Ee,Ie,Oe,ve,Te,se,fe,Ae,Ke,Ye,Je]=Ym(Se,ae,J&&tt!==null?tt:he,U,_,V,Q,w),[st,Pt]=F1(i,a,c),Ge=st.has("click"),we=Pt.has("click")||Pt.has("contextMenu"),Ve=Nt(()=>{bt||Je()});U1(Se,he,ae,Ve,()=>{at.current&&J&&we&&ot(!1)}),$t(()=>{Ve()},[tt,U]),$t(()=>{Se&&!_?.[U]&&Ve()},[JSON.stringify(V)]);const Ct=h.useMemo(()=>{const Be=Xm(_,o,Ye,J);return ue(Be,G?.(Ye))},[Ye,G,_,o,J]);h.useImperativeHandle(n,()=>({nativeElement:De.current,popupElement:de.current,forceAlign:Ve}));const[St,Bt]=h.useState(0),[At,ir]=h.useState(0),un=()=>{if(q&&he){const Be=he.getBoundingClientRect();Bt(Be.width),ir(Be.height)}},Vn=()=>{un(),Ve()},oi=Be=>{xt(!1),Je(),d?.(Be),b?.(Be)},nr=()=>new Promise(Be=>{un(),ut(()=>Be)});$t(()=>{It&&(Je(),It(),ut(null))},[It]);function Ur(Be,Ze,jt,dn,fr){je[Be]=(fn,...Fm)=>{(!fr||!fr())&&(dn?.(fn),ot(Ze,jt)),$e[Be]?.(fn,...Fm)}}const Aa=st.has("touch"),Fn=Pt.has("touch"),Un=h.useRef(!1);(Aa||Fn)&&(je.onTouchStart=(...Be)=>{Un.current=!0,at.current&&Fn?ot(!1):!at.current&&Aa&&ot(!0),$e.onTouchStart?.(...Be)}),(Ge||we)&&(je.onClick=(Be,...Ze)=>{at.current&&we?ot(!1):!at.current&&Ge&&(it(Be),ot(!0)),$e.onClick?.(Be,...Ze),Un.current=!1});const k=j1(Se,we||Fn,he,ae,I,N,Le,ot),j=st.has("hover"),K=Pt.has("hover");let ne,pe;const ge=()=>Un.current;if(j){const Be=Ze=>{it(Ze)};Ur("onMouseEnter",!0,S,Be,ge),Ur("onPointerEnter",!0,S,Be,ge),ne=Ze=>{(Se||bt)&&ae?.contains(Ze.target)&&ot(!0,S)},J&&(je.onMouseMove=Ze=>{$e.onMouseMove?.(Ze)})}K&&(Ur("onMouseLeave",!1,u,void 0,ge),Ur("onPointerLeave",!1,u,void 0,ge),pe=()=>{ot(!1,u)}),st.has("focus")&&Ur("onFocus",!0,C),Pt.has("focus")&&Ur("onBlur",!1,x),st.has("contextMenu")&&(je.onContextMenu=(Be,...Ze)=>{at.current&&Pt.has("contextMenu")?ot(!1):(it(Be),ot(!0)),Be.preventDefault(),$e.onContextMenu?.(Be,...Ze)});const Me=h.useRef(!1);Me.current||=g||Se||bt;const Ne={...$e,...je},ht={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach(Be=>{A[Be]&&(ht[Be]=(...Ze)=>{Ne[Be]?.(...Ze),A[Be](...Ze)})});const Zt={x:se,y:fe};Qm(Se,he,Vn);const Wt=Ll(Fe,ha(Pe)),dr=h.cloneElement(Pe,{...Ne,...ht,ref:Wt});return h.createElement(h.Fragment,null,dr,Me.current&&(!X||!ee)&&h.createElement(Fc.Provider,{value:F},h.createElement(Zm,{portal:e,ref:Ce,prefixCls:o,popup:T,className:ue(R,!w&&Ct),style:D,target:he,onMouseEnter:ne,onMouseLeave:pe,onPointerEnter:ne,zIndex:z,open:Se,keepDom:bt,fresh:Y,onClick:te,onPointerDownCapture:k,mask:I,motion:W,maskMotion:oe,onVisibleChanged:oi,onPrepare:nr,forceRender:g,autoDestroy:$,getPopupContainer:E,onEsc:gt,align:Ye,arrow:_e,arrowPos:Zt,ready:Ee,offsetX:Ie,offsetY:Oe,offsetR:ve,offsetB:Te,onAlign:Ve,stretch:q,targetWidth:St/Ae,targetHeight:At/Ke,mobile:ie})))})}const jo=H1(sf);function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sr.apply(null,arguments)}const Hf=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, 4 opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, 5 opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),z1=new qt("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}
vendor: 1,895 bytes, lines 5-8
5,"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),K1=new qt("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),G1=new qt("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),q1=new qt("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),W1=new qt("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Y1=new qt("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),X1=new qt("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Q1=new qt("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),Z1={"move-up":{inKeyframes:X1,outKeyframes:Q1},"move-down":{inKeyframes:z1,outKeyframes:K1},"move-left":{inKeyframes:G1,outKeyframes:q1},"move-right":{inKeyframes:W1,outKeyframes:Y1}},so=(e,t)=>{const{antCls:r}=e,n=`${r}-${t}`,{inKeyframes:o,outKeyframes:s}=Z1[t];return[lf(n,o,s,e.motionDurationMid),{[` 6 ${n}-enter, 7 ${n}-appear 8 `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${n}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},Wl=new qt("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}
8,"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Yl=new qt("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Xl=new qt("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Ql=new qt("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),J1=new qt("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ev=new qt("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),tv=new qt("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),rv=new qt("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}
8}),nv={"slide-up":{inKeyframes:Wl,outKeyframes:Yl},"slide-down":{inKeyframes:Xl,outKeyframes:Ql},"slide-left":{inKeyframes:J1,outKeyframes:ev},"slide-right":{inKeyframes:tv,outKeyframes:rv}},Nn=(e,t)=>{const{antCls:r}=e,n=`${r}-${t}`,{inKeyframes:o,outKeyframes:s}=nv[t];return[lf(n,o,s,e.motionDurationMid),{[` 9 ${n}-enter, 10 ${n}-appear 11 `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${n}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},av=e=>e instanceof Ns?e:new Ns(e),ov=(e,t,r,n,o=!1,s,i)=>{const a=h.useMemo(()=>typeof r=="boolean"?{allowClear:r}:r&&typeof r=="object"?r:{allowClear:!1},[r]);return h.useMemo(()=>{const c=!o&&a.allowClear!==!1&&(t.length||s)&&!(i==="combobox"&&s==="");return{allowClear:c,clearIcon:c?a.clearIcon||n||"Ã":null}},[a,n,o,t.length,s,i])},zf=h.createContext(null);function sn(){return h.useContext(zf)}function iv(e=250){const t=h.useRef(null),r=h.useRef(null);h.useEffect(()=>()=>{window.clearTimeout(r.current)},[]);function n(o){(o||t.current===null)&&(t.current=o),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{t.current=null},e)}return[()=>t.current,n]}function Kf(e,t){return e.filter(r=>r).some(r=>r.contains(t)||r===t)}function sv(e,t,r,n){const o=Nt(s=>{if(n)return;let i=s.target;i.shadowRoot&&s.composed&&(i=s.composedPath()[0]||i),s._ori_target&&(i=s._ori_target),t&&!Kf(e(),i)&&r(!1)});h.useEffect(()=>(window.addEventListener("mousedown",o),()=>window.removeEventListener("mousedown",o)),[o])}function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$s.apply(this,arguments)}const lv=e=>{const t=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},cv=(e,t)=>{const{prefixCls:r,disabled:n,visible:o,children:s,popupElement:i,animation:a,transitionName:c,popupStyle:l,popupClassName:f,direction:y="ltr",placement:m,builtinPlacements:d,popupMatchSelectWidth:v,popupRender:b,popupAlign:S,getPopupContainer:u,empty:C,onPopupVisibleChange:x,onPopupMouseEnter:I,onPopupMouseDown:N,onPopupBlur:E,...g}=e,p=`${r}-dropdown`;let T=i;b&&(T=b(i));const R=h.useMemo(()=>d||lv(v),[d,v]),B=a?`${p}-${a}`:c,P=typeof v=="number",D=h.useMemo(()=>P?null:v===!1?"minWidth":"width",[v,P]);let U=l;P&&(U={...l,width:v});const _=h.useRef(null);return h.useImperativeHandle(t,()=>({getPopupElement:()=>_.current?.popupElement})),h.createElement(jo,$s({},g,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:m||(y==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:R,prefixCls:p,popupMotion:{motionName:B},popup:h.createElement("div",{onMouseEnter:I,onMouseDown:N,onBlur:E},T),ref:_,stretch:D,popupAlign:S,popupVisible:o,getPopupContainer:u,popupClassName:ue(f,{[`${p}-empty`]:C}),popupStyle:U,onPopupVisibleChange:x}),s)},uv=h.forwardRef(cv);function gu(e,t){const{key:r}=e;let n;return"value"in e&&({value:n}=e),r??(n!==void 0?n:`rc-index-key-${t}`)}function Os(e){return typeof e<"u"&&!Number.isNaN(e)}function Gf(e,t){const{label:r,value:n,options:o,groupLabel:s}=e||{},i=r||(t?"children":"label");return{label:i,value:n||"value",options:o||"options",groupLabel:s||i}}function dv(e,{fieldNames:t,childrenAsData:r}={}){const n=[],{label:o,value:s,options:i,groupLabel:a}=Gf(t,!1);function c(l,f){Array.isArray(l)&&l.forEach(y=>{if(f||!(i in y)){const m=y[s];n.push({key:gu(y,n.length),groupOption:f,data:y,label:y[o],value:m})}else{let m=y[a];m===void 0&&r&&(m=y.label),n.push({key:gu(y,n.length),group:!0,data:y,label:m}),c(y[i],!0)}})}return c(e,!1),n}function _s(e){const t={...e};return"props"in t||Object.defineProperty(t,"props",{get(){return Ml(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}const fv=(e,t,r)=>{if(!t||!t.length)return null;let n=!1;const o=(i,[a,...c])=>{if(!a)return[i];const l=i.split(a);return n=n||l.length>1,l.reduce((f,y)=>
11[...f,...o(y,c)],[]).filter(Boolean)},s=o(e,t);return n?typeof r<"u"?s.slice(0,r):s:null};function pv(e){const{visible:t,values:r}=e;if(!t)return null;const n=50;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},`${r.slice(0,n).map(({label:o,value:s})=>["number","string"].includes(typeof o)?o:s).join(", ")}`,r.length>n?", ...":null)}const hv=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)},Zl=(e,t=1)=>{if(t<=0){e();return}hv(()=>{Zl(e,t-1)})};function mv(e,t,r,n){const[o,s]=h.useState(!1);h.useEffect(()=>{s(!0)},[]);const[i,a]=Xt(e,t),[c,l]=h.useState(!1),y=n(o?i:!1),m=h.useRef(0),d=Nt(b=>{r&&y!==b&&r(b),a(b)}),v=Nt((b,S={})=>{const{cancelFun:u}=S;m.current+=1;const C=m.current,x=typeof b=="boolean"?b:!y;l(!x);function I(){C===m.current&&!u?.()&&(d(x),l(!1))}x?I():Zl(()=>{I()})});return[y,v,c]}function bi(e){const{children:t,...r}=e;return t?h.createElement("div",r,t):null}const qf=h.createContext(null);function ya(){return h.useContext(qf)}const Wf=h.forwardRef((e,t)=>{const{onChange:r,onKeyDown:n,onBlur:o,style:s,syncWidth:i,value:a,className:c,autoComplete:l,...f}=e,{prefixCls:y,mode:m,onSearch:d,onSearchSubmit:v,onInputBlur:b,autoFocus:S,tokenWithEnter:u,placeholder:C,components:{input:x="input"}}=ya(),{id:I,classNames:N,styles:E,open:g,activeDescendantId:p,role:T,disabled:R}=sn()||{},B=ue(`${y}-input`,N?.input,c),P=h.useRef(!1),D=h.useRef(null),U=h.useRef(null);h.useImperativeHandle(t,()=>U.current);const _=Z=>{let{value:W}=Z.target;if(u&&D.current&&/[\r\n]/.test(D.current)){const oe=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");W=W.replace(oe,D.current)}D.current=null,d&&d(W,!0,P.current),r?.(Z)},V=Z=>{const{key:W}=Z,{value:oe}=Z.currentTarget;W==="Enter"&&m==="tags"&&!P.current&&v&&v(oe),n?.(Z)},z=Z=>{b?.(),o?.(Z)},q=()=>{P.current=!0},G=Z=>
11{if(P.current=!1,m!=="combobox"){const{value:W}=Z.currentTarget;d?.(W,!0,!1)}},Y=Z=>{const{clipboardData:W}=Z,oe=W?.getData("text");D.current=oe||""},[ee,J]=h.useState(void 0);$t(()=>{const Z=U.current;if(i&&Z){Z.style.width="0px";const W=Z.scrollWidth;J(W),Z.style.width=""}},[i,a]);const te={id:I,type:m==="combobox"?"text":"search",...f,ref:U,style:{...E?.input,...s,"--select-input-width":ee},autoFocus:S,autoComplete:l||"off",className:B,disabled:R,value:a||"",onChange:_,onKeyDown:V,onBlur:z,onPaste:Y,onCompositionStart:q,onCompositionEnd:G,role:T||"combobox","aria-expanded":g||!1,"aria-haspopup":"listbox","aria-owns":g?`${I}_list`:void 0,"aria-autocomplete":"list","aria-controls":g?`${I}_list`:void 0,"aria-activedescendant":g?p:void 0};if(h.isValidElement(x)){const Z=x.props||{},W={placeholder:e.placeholder||C,...te,...Z};return Object.keys(Z).forEach(oe=>{const ie=Z[oe];typeof ie=="function"&&(W[oe]=(...A)=>{ie(...A),te[oe]?.(...A)})}),W.ref=Cr(x.ref,te.ref),h.cloneElement(x,W)}const Q=x;return h.createElement(Q,te)});function Yf(e){const{prefixCls:t,placeholder:r,displayValues:n}=ya(),{classNames:o,styles:s}=sn(),{show:i=!0}=e;return n.length?null:h.createElement("div",{className:ue(`${t}-placeholder`,o?.placeholder),style:{visibility:i?"visible":"hidden",...s?.placeholder}},r)}const Jl=h.createContext(null);function Xf(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function gv(e){return e!=null}function vv(e){return!e&&e!==0}function vu(e){return["string","number"].includes(typeof e)}function ks(e){let t;return e&&(vu(e.title)?t=e.title.toString():vu(e.label)&&(t=e.label.toString())),t}function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}const yv=h.forwardRef(({inputProps:e},t)=>{const{prefixCls:r,searchValue:n,activeValue:o,displayValues:s,maxLength:i,mode:a}=ya(),{triggerOpen:c,title:l,showSearch:f,classNames:y,styles:m}=sn(),d=h.useContext(Jl),[v,b]=h.useState(!1),S=a==="combobox",u=s[0],C=h.useMemo(()=>S&&o&&!v&&c?o:f?n:"",[S,o,v,c,n,f]),x=h.useMemo(()=>{const I={className:`${r}-content-value`,style:C?{visibility:"hidden"}:{}};if(u&&d?.flattenOptions){const N=d.flattenOptions.find(E=>E.value===u.value);if(N?.data){const{className:E,style:g}=N.data;Object.assign(I,{title:ks(N.data),className:ue(I.className,E),style:{...I.style,...g}})}}return u&&!I.title&&(I.title=ks(u)),l!==void 0&&(I.title=l),I},[u,d?.flattenOptions,r,C,l]);return h.useEffect(()=>{S&&b(!1)},[S,o]),h.createElement("div",{className:ue(`${r}-content`,y?.content),style:m?.content},u?h.createElement("div",x,u.label):h.createElement(Yf,{show:!C}),h.createElement(Wf,Vs({ref:t},e,{value:C,maxLength:a==="combobox"?i:void 0,onChange:I=>{b(!0),e.onChange?.(I)}})))}),pn=void 0;function bv(e,t){const{prefixCls:r,invalidate:n,item:o,renderItem:s,responsive:i,responsiveDisabled:a,registerSize:c,itemKey:l,className:f,style:y,children:m,display:d,order:v,component:b="div",...S}=e,u=i&&!d;function C(g){c(l,g)}h.useEffect(()=>()=>{C(null)},[]);const x=s&&o!==pn?s(o,{index:v}):m;let I;n||(I={opacity:u?0:1,height:u?0:pn,overflowY:u?"hidden":pn,order:i?v:pn,pointerEvents:u?"none":pn,position:u?"absolute":pn});const N={};u&&(N["aria-hidden"]=!0);let E=h.createElement(b,Sr({className:ue(!n&&r,f),style:{...I,...y}},N,S,{ref:t}),x);return i&&(E=h.createElement(ma,{onResize:({offsetWidth:g})=>{C(g)},disabled:a},E)),E}const Yn=h.forwardRef(bv);function Cv(e){if(typeof MessageChannel>"u")Et(e);else{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(void 0)}}function xv(){const e=h.useRef(null);return r=>{e.current||(e.current=[],Cv(()=>{ra.unstable_batchedUpdates(()=>{e.current.forEach(n=>{n()}),e.current=null})})),e.current.push(r)}}function hn(e,t){const[r,n]=h.useState(t),o=Nt(s=>{e(()=>{n(s)})});return[r,o]}const lo=xe.createContext(null),Sv=(e,t)=>{const r=h.useContext(lo);if(!r){const{component:a="div",...c}=e;return h.createElement(a,Sr({},c,{ref:t}))}const{className:n,...o}=r,{className:s,...i}=e;return h.createElement(lo.Provider,{value:null},h.createElement(Yn,Sr({ref:t,className:ue(n,s)},o,i)))},Ev=h.forwardRef(Sv),Qf="responsive",Zf="invalidate";function wv(e){return`+ ${e.length} ...`}function Iv(e,t){const{prefixCls:r="rc-overflow",data:n=[],renderItem:o,renderRawItem:s,itemKey:i,itemWidth:a=10,ssr:c,style:l,className:f,maxCount:y,renderRest:m,renderRawRest:d,prefix:v,suffix:b,component:S="div",itemComponent:u,onVisibleChange:C,...x}=e,I=c==="full",N=xv(),[E,g]=hn(N,null),p=E||0,[T,R]=hn(N,new Map),[B,P]=hn(N,0),[D,U]=hn(N,0),[_,V]=hn(N,0),[z,q]=hn(N,0),[G,Y]=h.useState(null),[ee,J]=h.useState(null),te=h.useMemo(()=>
11ee===null&&I?Number.MAX_SAFE_INTEGER:ee||0,[ee,E]),[Q,Z]=h.useState(!1),W=`${r}-item`,oe=Math.max(B,D),ie=y===Qf,A=n.length&&ie,$=y===Zf,O=A||typeof y=="number"&&n.length>y,w=h.useMemo(()=>{let be=n;return A?E===null&&I?be=n:be=n.slice(0,Math.min(n.length,p/a)):typeof y=="number"&&(be=n.slice(0,y)),be},[n,a,E,y,A]),M=h.useMemo(()=>A?n.slice(te+1):n.slice(w.length),[n,w,A,te]),H=h.useCallback((be,Se)=>typeof i=="function"?i(be):(i&&be?.[i])??Se,[i]),F=h.useCallback(o||(be=>be),[o]);function X(be,Se,Pe){ee===be&&(Se===void 0||Se===G)||(J(be),Pe||(Z(be<n.length-1),C?.(be)),Se!==void 0&&Y(Se))}function ce(be,Se){g(Se.clientWidth)}function ae(be,Se){R(Pe=>{const $e=new Map(Pe);return Se===null?$e.delete(be):$e.set(be,Se),$e})}function re(be,Se){U(Se),P(D)}function de(be,Se){V(Se)}function Ce(be,Se){q(Se)}function he(be){return T.get(H(w[be],be))}$t(()=>{if(p&&typeof oe=="number"&&w){let be=_+z;const Se=w.length,Pe=Se-1;if(!Se){X(0,null);return}for(let $e=0;$e<Se;$e+=1){let ke=he($e);if(I&&(ke=ke||0),ke===void 0){X($e-1,void 0,!0);break}if(be+=ke,Pe===0&&be<=p||$e===Pe-1&&be+he(Pe)<=p){X(Pe,null);break}else if(be+oe>p){X($e-1,be-ke-z+D);break}}b&&he(0)+z>p&&Y(null)}},[p,T,D,_,z,H,w]);const ye=Q&&!!M.length;let De={};G!==null&&A&&(De={position:"absolute",top:0,insetInlineStart:G});const Fe={prefixCls:W,responsive:A,component:u,invalidate:$},je=s?(be,Se)=>{const Pe=H(be,Se);return h.createElement(lo.Provider,{key:Pe,value:{...Fe,order:Se,item:be,itemKey:Pe,registerSize:ae,display:Se<=te}},s(be,Se))}:(be,Se)=>{const Pe=H(be,Se);return h.createElement(Yn,Sr({},Fe,{order:Se,key:Pe,item:be,renderItem:F,itemKey:Pe,registerSize:ae,display:Se<=te}))},Le={order:ye?te:Number.MAX_SAFE_INTEGER,className:`${W}-rest`,registerSize:re,display:ye},_e=m||wv,ze=d?h.createElement(lo.Provider,{value:{...Fe,...Le}},d(M)):h.createElement(Yn,Sr({},Fe,Le),typeof _e=="function"?_e(M):_e),Ue=h.createElement(S,Sr({className:ue(!$&&r,f),style:l,ref:t},x),v&&h.createElement(Yn,Sr({},Fe,{responsive:ie,responsiveDisabled:!A,order:-1,className:`${W}-prefix`,registerSize:de,display:!0}),v),w.map(je),O?ze:null,b&&h.createElement(Yn,Sr({},Fe,{responsive:ie,responsiveDisabled:!A,order:te,className:`${W}-suffix`,registerSize:Ce,display:!0,style:De}),b));return ie?h.createElement(ma,{onResize:ce,disabled:!A},Ue):Ue}const Lr=h.forwardRef(Iv);Lr.Item=Ev;Lr.RESPONSIVE=Qf;Lr.INVALIDATE=Zf;const Jf=e=>{const{className:t,style:r,customizeIcon:n,customizeIconProps:o,children:s,onMouseDown:i,onClick:a}=e,c=typeof n=="function"?n(o):n;return h.createElement("span",{className:t,onMouseDown:l=>{l.preventDefault(),i?.(l)},style:{userSelect:"none",WebkitUserSelect:"none",...r},unselectable:"on",onClick:a,"aria-hidden":!0},c!==void 0?c:h.createElement("span",{className:ue(t.split(/\s+/).map(l=>`${l}-icon`))},s))};function Fs(){return Fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fs.apply(this,arguments)}function Tv(e){return e.key??e.value}const yu=e=>{e.preventDefault(),e.stopPropagation()},Av=h.forwardRef(function({inputProps:t},r){const{prefixCls:n,displayValues:o,searchValue:s,mode:i,onSelectorRemove:a,removeIcon:c}=ya(),{disabled:l,showSearch:f,triggerOpen:y,toggleOpen:m,autoClearSearchValue:d,tagRender:v,maxTagPlaceholder:b,maxTagTextLength:S,maxTagCount:u,classNames:C,styles:x}=sn(),I=`${n}-selection-item`;let N=s;!y&&i==="multiple"&&d!==!1&&(N="");const E=f&&N||"",g=f&&!l,p=c??"Ã",T=b??(z=>`+ ${z.length} ...`),R=v,B=z=>{m(z)},P=z=>{a?.(z)},D=(z,q,G,Y,ee)=>h.createElement("span",{title:ks(z),className:ue(I,{[`${I}-disabled`]:G},C?.item),style:x?.item},h.createElement("span",{className:ue(`${I}-content`,C?.itemContent),style:x?.itemContent},q),Y&&h.createElement(Jf,{className:ue(`${I}-remove`,C?.itemRemove),style:x?.itemRemove,onMouseDown:yu,onClick:ee,customizeIcon:p},"Ã")),U=(z,q,G,Y,ee,J,te)=>{const Q=Z=>{yu(Z),B(!y)};return h.createElement("span",{onMouseDown:Q},R({label:q,value:z,index:te?.index,disabled:G,closable:Y,onClose:ee,isMaxTag:!!J}))},_=(z,q)=>{const{disabled:G,label:Y,value:ee}=z,J=!l&&!G;let te=Y;if(typeof S=="number"&&(typeof Y=="string"||typeof Y=="number")){const Z=String(te);Z.length>S&&(te=`${Z.slice(0,S)}...`)}const Q=Z=>{Z&&Z.stopPropagation(),P(z)};return typeof R=="function"?U(ee,te,G,J,Q,void 0,q):D(z,te,G,J,Q)},V=z=>{if(!o.length)return null;const q=typeof T=="function"?T(z):T;return typeof R=="function"?U(void 0,q,!1,!1,void 0,!0):D({title:q},q,!1)};return h.createElement(Lr,{prefixCls:`${n}-content`,className:C?.content,style:x?.content,prefix:!o.length&&!E&&h.createElement(Yf,null),data:o,renderItem:_,renderRest:V,suffix:h.createElement(Wf,Fs({ref:r,disabled:l,readOnly:!g},t,{value:E||"",syncWidth:!0})),itemKey:Tv,maxCount:u})}),Nv=h.forwardRef(function(t,r){const{multiple:n,onInputKeyDown:o,tabIndex:s}=ya(),i=sn(),{showSearch:a}=i,l={...wr(i,{aria:!0}),onKeyDown:o,readOnly:!a,tabIndex:s};return n?h.createElement(Av,{ref:r,inputProps:l}):h.createElement(yv,{ref:r,inputProps:l})});function Rv(e){return e&&![Xe.ESC,Xe.SHIFT,Xe.BACKSPACE,Xe.TAB,Xe.WIN_KEY,Xe.ALT,Xe.META,Xe.WIN_KEY_RIGHT,Xe.CTRL,Xe.SEMICOLON,Xe.EQUALS,Xe.CAPS_LOCK,Xe.CONTEXT_MENU,Xe.UP,Xe.LEFT,Xe.RIGHT,Xe.F1,Xe.F2,Xe.F3,Xe.F4,Xe.F5,Xe.F6,Xe.F7,Xe.F8,Xe.F9,Xe.F10,Xe.F11,Xe.F12].includes(e)}function co(){return co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
11for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},co.apply(this,arguments)}const Pv=["value","onChange","removeIcon","placeholder","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex","activeValue","onSelectorRemove","focused"],Bv=h.forwardRef(function(t,r){const{prefixCls:n,className:o,style:s,prefix:i,suffix:a,clearIcon:c,children:l,multiple:f,displayValues:y,placeholder:m,mode:d,searchValue:v,onSearch:b,onSearchSubmit:S,onInputBlur:u,maxLength:C,autoFocus:x,onMouseDown:I,onClearMouseDown:N,onInputKeyDown:E,onSelectorRemove:g,tokenWithEnter:p,components:T,...R}=t,{triggerOpen:B,toggleOpen:P,showSearch:D,disabled:U,loading:_,classNames:V,styles:z}=sn(),q=h.useRef(null),G=h.useRef(null),Y=Nt(oe=>{const{which:ie}=oe,A=G.current instanceof HTMLTextAreaElement;if(!A&&B&&(ie===Xe.UP||ie===Xe.DOWN)&&oe.preventDefault(),E&&E(oe),A&&!B&&~[Xe.UP,Xe.DOWN,Xe.LEFT,Xe.RIGHT].indexOf(ie))return;!(oe.ctrlKey||oe.altKey||oe.metaKey)&&Rv(ie)&&P(!0)});h.useImperativeHandle(r,()=>({focus:oe=>{(G.current||q.current).focus?.(oe)},blur:()=>{(G.current||q.current).blur?.()},nativeElement:q.current}));const ee=Nt(oe=>{if(!U){const ie=ta(G.current);oe.nativeEvent._ori_target=ie,ie&&oe.target!==ie&&!ie.contains(oe.target)&&oe.preventDefault();const A=B&&!f&&(d==="combobox"||D);oe.nativeEvent._select_lazy?B&&P(!1):(G.current?.focus(),A||P())}I?.(oe)}),{root:J}=T,te=Tt(R,Pv),Q=wr(te,{aria:!0}),Z=Object.keys(Q),W={...t,onInputKeyDown:Y};return J?h.isValidElement(J)?h.cloneElement(J,{...te,ref:Cr(J.ref,q)}):h.createElement(J,co({},te,{ref:q})):h.createElement(qf.Provider,{value:W},h.createElement("div",co({},Tt(te,Z),{ref:q,className:o,style:s,onMouseDown:ee}),h.createElement(bi,{className:ue(`${n}-prefix`,V?.prefix),style:z?.prefix},i),h.createElement(Nv,{ref:G}),h.createElement(bi,{className:ue(`${n}-suffix`,{[`${n}-suffix-loading`]:_},V?.suffix),style:z?.suffix},a),c&&h.createElement(bi,{className:ue(`${n}-clear`,V?.clear),style:z?.clear,onMouseDown:oe=>{oe.nativeEvent._select_lazy=!0,N?.(oe)}},c),l))});function Lv(e,t,r){return h.useMemo(()=>{let{root:n,input:o}=e||{};return r&&(n=r()),t&&(o=t()),{root:n,input:o}},[e,t,r])}function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Us.apply(this,arguments)}const js=e=>e==="tags"||e==="multiple",Mv=h.forwardRef((e,t)=>{const{id:r,prefixCls:n,className:o,styles:s,classNames:i,showSearch:a,tagRender:c,showScrollBar:l="optional",direction:f,omitDomProps:y,displayValues:m,onDisplayValuesChange:d,emptyOptions:v,notFoundContent:b="Not Found",onClear:S,maxCount:u,placeholder:C,mode:x,disabled:I,loading:N,getInputElement:E,getRawInputElement:g,open:p,defaultOpen:T,onPopupVisibleChange:R,activeValue:B,onActiveValueChange:P,activeDescendantId:D,searchValue:U,autoClearSearchValue:_,onSearch:V,onSearchSplit:z,tokenSeparators:q,allowClear:G,prefix:Y,suffix:ee,suffixIcon:J,clearIcon:te,OptionList:Q,animation:Z,transitionName:W,popupStyle:oe,popupClassName:ie,popupMatchSelectWidth:A,popupRender:$,popupAlign:O,placement:w,builtinPlacements:M,getPopupContainer:H,showAction:F=[],onFocus:X,onBlur:ce,onKeyUp:ae,onKeyDown:re,onMouseDown:de,components:Ce,...he}=e,ye=js(x),De=h.useRef(null),Fe=h.useRef(null),je=h.useRef(null),[Le,_e]=h.useState(!1);h.useImperativeHandle(t,()=>({focus:De.current?.focus,blur:De.current?.blur,scrollTo:we=>je.current?.scrollTo(we),nativeElement:ta(De.current)}));const ze=Lv(Ce,E,g),Ue=h.useMemo(()=>{if(x!=="combobox")return U;const we=m[0]?.value;return typeof we=="string"||typeof we=="number"?String(we):""},[U,x,m]),be=x==="combobox"&&typeof E=="function"&&E()||null,Se=!b&&v,[Pe,$e,ke]=mv(T||!1,p,R,we=>I||Se?!1:we),ct=h.useMemo(()=>(q||[]).some(we=>[` 12`,`\r 13`].includes(we)),[q]),at=(we,Ve,dt)=>{if(ye&&Os(u)&&m.length>=u)return;let Ct=!0,St=we;P?.(null);const Bt=fv(we,q,Os(u)?u-m.length:void 0),At=dt?null:Bt;return x!=="combobox"&&At&&(St="",z?.(At),$e(!1),Ct=!1),V&&Ue!==St&&V(St,{source:Ve?"typing":"effect"}),we&&Ve&&Ct&&$e(!0),Ct},ft=we=>{!we||!we.trim()||V(we,{source:"submit"})};h.useEffect(()=>{!Pe&&!ye&&x!=="combobox"&&at("",!1,!1)},[Pe]),h.useEffect(()=>{I&&($e(!1),_e(!1))},[I,Pe]);const[yt,ot]=iv(),gt=h.useRef(!1),bt=we=>{const Ve=yt(),{key:dt}=we,Ct=dt==="Enter";if(Ct&&(x!=="combobox"&&we.preventDefault(),Pe||$e(!0)),ot(!!Ue),dt==="Backspace"&&!Ve&&ye&&!Ue&&m.length){const St=[...m];let Bt=null;for(let At=St.length-1;At>=0;At-=1){const ir=St[At];if(!ir.disabled){St.splice(At,1),Bt=ir;break}}Bt&&d(St,{type:"remove",values:[Bt]})}Pe&&(!Ct||!gt.current)&&(Ct&&(gt.current=!0),je.current?.onKeyDown(we)),re?.(we)},xt=(we,...Ve)=>{Pe&&je.current?.onKeyUp(we,...Ve),we.key==="Enter"&&(gt.current=!1),ae?.(we,...Ve)},It=Nt(we=>{const Ve=m.filter(dt=>dt!==we);d(Ve,{type:"remove",values:[we]})}),ut=()=>{gt.current=!1},tt=()=>[ta(De.current),Fe.current?.getPopupElement()];sv(tt,Pe,$e,!!ze.root);const We=h.useRef(!1),it=we=>{_e(!0),I||(F.includes("focus")&&$e(!0),X?.(we))},Ee=()=>{Pe&&!We.current&&$e(!1,{cancelFun:()=>Kf(tt(),document.activeElement)})},Ie=we=>{_e(!1),Ue&&(x==="tags"?V(Ue,{source:"submit"}):x==="multiple"&&V("",{source:"blur"}
13)),Ee(),I||ce?.(we)},Oe=(we,...Ve)=>{const{target:dt}=we;Fe.current?.getPopupElement()?.contains(dt)&&$e&&$e(!0),de?.(we,...Ve),We.current=!0,Zl(()=>{We.current=!1})},[,ve]=h.useState({});function Te(){ve({})}let se;ze.root&&(se=we=>{$e(we)});const fe=h.useMemo(()=>({...e,notFoundContent:b,open:Pe,triggerOpen:Pe,id:r,showSearch:a,multiple:ye,toggleOpen:$e,showScrollBar:l,styles:s,classNames:i,lockOptions:ke}),[e,b,$e,r,a,ye,Pe,l,s,i,ke]),Ae=h.useMemo(()=>{const we=ee??J;return typeof we=="function"?we({searchValue:Ue,open:Pe,focused:Le,showSearch:a,loading:N}):we},[ee,J,Ue,Pe,Le,a,N]),Ke=()=>{S?.(),De.current?.focus(),d([],{type:"clear",values:m}),at("",!1,!1)},{allowClear:Ye,clearIcon:Je}=ov(n,m,G,te,I,Ue,x),st=h.createElement(Q,{ref:je}),Pt=ue(n,o,{[`${n}-focused`]:Le,[`${n}-multiple`]:ye,[`${n}-single`]:!ye,[`${n}-allow-clear`]:Ye,[`${n}-show-arrow`]:Ae!=null,[`${n}-disabled`]:I,[`${n}-loading`]:N,[`${n}-open`]:Pe,[`${n}-customize-input`]:be,[`${n}-show-search`]:a});let Ge=h.createElement(Bv,Us({},he,{ref:De,prefixCls:n,className:Pt,focused:Le,prefix:Y,suffix:Ae,clearIcon:Je,multiple:ye,mode:x,displayValues:m,placeholder:C,searchValue:Ue,activeValue:B,onSearch:at,onSearchSubmit:ft,onInputBlur:ut,onFocus:it,onBlur:Ie,onClearMouseDown:Ke,onKeyDown:bt,onKeyUp:xt,onSelectorRemove:It,tokenWithEnter:ct,onMouseDown:Oe,components:ze}));return Ge=h.createElement(uv,{ref:Fe,disabled:I,prefixCls:n,visible:Pe,popupElement:st,animation:Z,transitionName:W,popupStyle:oe,popupClassName:ie,direction:f,popupMatchSelectWidth:A,popupRender:$,popupAlign:O,placement:w,builtinPlacements:M,getPopupContainer:H,empty:v,onPopupVisibleChange:se,onPopupMouseEnter:Te,onPopupMouseDown:Oe,onPopupBlur:Ee},Ge),h.createElement(zf.Provider,{value:fe},h.createElement(pv,{visible:Le&&!Pe,values:m}),Ge)}),ec=()=>null;ec.isSelectOptGroup=!0;const tc=()=>null;tc.isSelectOption=!0;function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hs.apply(this,arguments)}const ep=h.forwardRef(({height:e,offsetY:t,offsetX:r,children:n,prefixCls:o,onInnerResize:s,innerProps:i,rtl:a,extra:c},l)=>{let f={},y={display:"flex",flexDirection:"column"};return t!==void 0&&(f={height:e,position:"relative",overflow:"hidden"},y={...y,transform:`translateY(${t}px)`,[a?"marginRight":"marginLeft"]:-r||0,position:"absolute",left:0,right:0,top:0}),h.createElement("div",{style:f},h.createElement(ma,{onResize:({offsetHeight:m})=>{m&&s&&s()}},h.createElement("div",Hs({style:y,className:ue({[`${o}-holder-inner`]:o}),ref:l},i),n,c)))});ep.displayName="Filler";function Dv({children:e,setRef:t}){const r=h.useCallback(n=>{t(n)},[t]);return h.cloneElement(e,{ref:r})}function $v(e,t,r,n,o,s,i,{getKey:a}){return e.slice(t,r+1).map((c,l)=>{const f=t+l,y=i(c,f,{style:{width:n},offsetX:o}),m=a(c);return h.createElement(Dv,{key:m,setRef:d=>s(c,d)},y)})}function Ov(e,t,r){const n=e.length,o=t.length;let s,i;if(n===0&&o===0)return null;n<o?(s=e,i=t):(s=t,i=e);const a={__EMPTY_ITEM__:!0};function c(y){return y!==void 0?r(y):a}let l=null,f=Math.abs(n-o)!==1;for(let y=0;y<i.length;y+=1){const m=c(s[y]),d=c(i[y]);if(m!==d){l=y,f=f||m!==c(i[y+1]);break}}return l===null?null:{index:l,multiple:f}}function _v(e,t,r){const[n,o]=h.useState(e),[s,i]=h.useState(null);return h.useEffect(()=>{const a=Ov(n||[],e||[],t);a?.index!==void 0&&i(e[a.index]),o(e)},[e]),[s]}const bu=typeof navigator=="object"&&/Firefox/i.test(navigator.userAgent),tp=((e,t,r,n)=>{const o=h.useRef(!1),s=h.useRef(null);function i(){clearTimeout(s.current),o.current=!0,s.current=setTimeout(()=>{o.current=!1},50)}const a=h.useRef({top:e,bottom:t,left:r,right:n});return a.current.top=e,a.current.bottom=t,a.current.left=r,a.current.right=n,(c,l,f=!1)=>{const y=c?l<0&&a.current.left||l>0&&a.current.right:l<0&&a.current.top||l>0&&a.current.bottom;return f&&y?(clearTimeout(s.current),o.current=!1):(!y||o.current)&&i(),!o.current&&y}});function kv(e,t,r,n,o,s,i){const a=h.useRef(0),c=h.useRef(null),l=h.useRef(null),f=h.useRef(!1),y=tp(t,r,n,o);function m(C,x){if(Et.cancel(c.current),y(!1,x))return;const I=C;if(!I._virtualHandled)I._virtualHandled=!0;else return;a.current+=x,l.current=x,bu||I.preventDefault(),c.current=Et(()=>{const N=f.current?10:1;i(a.current*N,!1),a.current=0})}function d(C,x){i(x,!0),bu||C.preventDefault()}const v=h.useRef(null),b=h.useRef(null);function S(C){if(!e)return;Et.cancel(b.current),b.current=Et(()=>{v.current=null},2);const{deltaX:x,deltaY:I,shiftKey:N}=C;let E=x,g=I;(v.current==="sx"||!v.current&&N&&I&&!x)&&(E=I,g=0,v.current="sx");const p=Math.abs(E),T=Math.abs(g);v.current===null&&(v.current=s&&p>T?"x":"y"),v.current==="y"?m(C,g):d(C,E)}function u(C){e&&(f.current=C.detail===l.current)}return[S,u]}function Vv(e,t,r,n){const[o,s]=h.useMemo(()=>[new Map,[]],[e,r.id,n]);return(a,c=a)=>{let l=o.get(a),f=o.get(c);if(l===void 0||f===void 0){const y=e.length;for(let m=s.length;m<y;m+=1){const d=e[m],v=t(d);o.set(v,m);const b=r.get(v)??n;if(s[m]=(s[m-1]||0)+b,v===a&&(l=m),v===c&&(f=m),l!==void 0&&f!==void 0)break}}return{top:s[l-1]||0,bottom:s[f]}}}class Fv{maps;id=0;diffRecords=new Map;constructor(){this.maps=Object.create(null)}set(t,r){this.diffRecords.set(t,this.maps[t]),this.maps[t]=r,this.id+=1}get(t){return this.maps[t]}resetRecord(){this.diffRecords.clear()}getRecord(){return this.diffRecords}}function Cu(e){const t=parseFloat(e);return isNaN(t)?0:t}function Uv(e,t,r){const[n,o]=h.useState(0),s=h.useRef(new Map),i=h.useRef(new Fv),a=h.useRef(0);function c(){a.current+=1}function l(y=!1){c();const m=()=>{let d=!1;s.current.forEach((v,b)=>{if(v&&v.offsetParent){const{offsetHeight:S}=v,{marginTop:u,marginBottom:C}=getComputedStyle(v),x=Cu(u),I=Cu(C),N=S+x+I;i.current.get(b)!==N&&(i.current.set(b,N),d=!0)}}),d&&o(v=>v+1)};if(y)m();else{a.current+=1;const d=a.current;Promise.resolve().then(()=>{d===a.current&&m()})}}function f(y,m){const d=e(y);s.current.get(d),m?(s.current.set(d,m),l()):s.current.delete(d)}return h.useEffect(()=>c,[]),[f,l,i.current,n]}const xu=14/15;function jv(e,t,r){const n=h.useRef(!1),o=h.useRef(0),s=h.useRef(0),i=h.useRef(null),a=h.useRef(null);let c;const l=m=>{if(n.current){const d=Math.ceil(m.touches[0].pageX),v=Math.ceil(m.touches[0].pageY);let b=o.current-d,S=s.current-v;const u=Math.abs(b)>Math.abs(S);u?o.current=d:s.current=v;const C=r(u,u?b:S,!1,m);C&&m.preventDefault(),clearInterval(a.current),C&&(a.current=setInterval(()=>{u?b*=xu:S*=xu;const x=Math.floor(u?b:S);(!r(u,x,!0)||Math.abs(x)<=.1)&&clearInterval(a.current)},16))}},f=()=>{n.current=!1,c()},y=m=>{c(),m.touches.length===1&&!n.current&&(n.current=!0,o.current=Math.ceil(m.touches[0].pageX),s.current=Math.ceil(m.touches[0].pageY),i.current=m.target,i.current.addEventListener("touchmove",l,{passive:!1}),i.current.addEventListener("touchend",f,{passive:!0}))};c=()=>{i.current&&(i.current.removeEventListener("touchmove",l),i.current.removeEventListener("touchend",f))},$t(()=>(e&&t.current.addEventListener("touchstart",y,{passive:!0}),()=>{t.current?.removeEventListener("touchstart",y),c(),clearInterval(a.current)}),[e])}function Su(e){return Math.floor(e**.5)}function Ya(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}function Hv(e){let t=e;for(;t;){if(t.draggable)return!0;t=t.parentElement}return!1}function zv(e,t,r){h.useEffect(()=>{const n=t.current;if(e&&n){let o=!1,s,i;const a=()=>{Et.cancel(s)},c=()=>{a(),s=Et(()=>{r(i),c()})},l=()=>{o=!1,a()},f=m=>{if(Hv(m.target)||m.button!==0)return;const d=m;d._virtualHandled||(d._virtualHandled=!0,o=!0)},y=m=>{if(o){const d=Ya(m,!1),{top:v,bottom:b}=n.getBoundingClientRect();if(d<=v){const S=v-d;i=-Su(S),c()}else if(d>=b){const S=d-b;i=Su(S),c()}else a()}};return n.addEventListener("mousedown",f),n.ownerDocument.addEventListener("mouseup",l),n.ownerDocument.addEventListener("mousemove",y),n.ownerDocument.addEventListener("dragend",l),()=>{n.removeEventListener("mousedown",f),n.ownerDocument.removeEventListener("mouseup",l),n.ownerDocument.removeEventListener("mousemove",y),n.ownerDocument.removeEventListener("dragend",l),a()}}},[e])}const Kv=10;function Gv(e,t){const r=typeof e=="function"?e(t):e;return Number.isFinite(r)?r:0}function qv(e,t,r,n,o,s,i,a,c){const l=h.useRef(void 0),[f,y]=h.useState(null);return $t(()=>{if(f&&f.times<Kv){if(!e.current){y(E=>({...E}));return}i();const{targetAlign:m,originAlign:d,offset:v}=f,b=f.index>=0?f.index:t.findIndex(E=>o(E)===f.key),S=m||d,u=Gv(v,{getSize:s,align:S}),C=e.current.clientHeight;let x=b<0,I=m,N=null;if(C&&b>=0){let E=0,g=0,p=0;const T=Math.min(t.length-1,b);for(let B=0;B<=T;B+=1){const P=o(t[B]);g=E;const D=r.get(P);p=g+(D===void 0?n:D),E=p}let R=S==="top"?u:C-u;for(let B=T;B>=0;B-=1){const P=o(t[B]),D=r.get(P);if(D===void 0){x=!0;break}if(R-=D,R<=0)break}switch(S){case"top":N=g-u;break;case"bottom":N=p-C+u;break;default:{const{scrollTop:B}=e.current,P=B+C;g<B?I="top":p>P&&(I="bottom")}}N!==null&&a(N),N!==f.lastTop&&(x=!0)}x&&y(E=>({...E,times:E.times+1,index:b,targetAlign:I,lastTop:N}))}},[f,e.current]),m=>{if(m==null){c();return}
13if(Et.cancel(l.current),typeof m=="number")a(m);else if(m&&typeof m=="object"){let d,v;const{align:b}=m;"index"in m?{index:d}=m:(v=m.key,d=t.findIndex(u=>o(u)===v));const{offset:S=0}=m;y({times:0,index:d,key:v,offset:S,originAlign:b})}}}function Eu(e,t,r){if(t<=0||r<=0)return 0;const o=Math.max(Math.min(e,r),0)/r;let s=Math.ceil(o*t);return s=Math.max(s,0),s=Math.min(s,t),s}const wu=h.forwardRef((e,t)=>{const{prefixCls:r,rtl:n,scrollOffset:o,scrollRange:s,onStartMove:i,onStopMove:a,onScroll:c,horizontal:l,spinSize:f,containerSize:y,style:m,thumbStyle:d,showScrollBar:v}=e,[b,S]=h.useState(!1),[u,C]=h.useState(null),[x,I]=h.useState(null),N=!n,E=h.useRef(null),g=h.useRef(null),[p,T]=h.useState(v),R=h.useRef(void 0),B=()=>{v===!0||v===!1||(clearTimeout(R.current),T(!0),R.current=setTimeout(()=>{T(!1)},3e3))},P=s-y||0,D=y-f||0,U=h.useMemo(()=>o===0||P===0?0:o/P*D,[o,P,D]),_=Z=>!!Z&&g.current?.contains(Z),V=Z=>{const W=E.current;if(!W)return;const oe=W.getBoundingClientRect(),ie=Ya(Z,l);let A;if(Number.isFinite(ie)){if(l){const $=N?oe.left:oe.right;if(!Number.isFinite($))return;A=(N?ie-$:$-ie)-f/2}else{if(!Number.isFinite(oe.top))return;A=ie-oe.top-f/2}c(Eu(A,P,D),l)}},z=Z=>{Z.stopPropagation(),Z.preventDefault(),!(Z.button!==0||_(Z.target))&&V(Z)},q=h.useRef({top:U,dragging:b,pageY:u,startTop:x});q.current={top:U,dragging:b,pageY:u,startTop:x};const G=Nt(Z=>{S(!0),C(Ya(Z,l)),I(q.current.top),i(),Z.stopPropagation(),Z.preventDefault()});h.useEffect(()=>{const Z=ie=>{ie.preventDefault()},W=E.current,oe=g.current;return W.addEventListener("touchstart",Z,{passive:!1}),oe.addEventListener("touchstart",G,{passive:!1}),()=>{W.removeEventListener("touchstart",Z),oe.removeEventListener("touchstart",G)}},[G]);const Y=h.useRef(void 0);Y.current=P;const ee=h.useRef(void 0);ee.current=D,h.useEffect(()=>{if(b){let Z;const W=ie=>{const{dragging:A,pageY:$,startTop:O}=q.current;Et.cancel(Z);const w=E.current.getBoundingClientRect(),M=y/(l?w.width:w.height);if(A){const H=(Ya(ie,l)-$)*M;let F=O;!N&&l?F-=H:F+=H;const X=Y.current,ce=ee.current,ae=Eu(F,X,ce);Z=Et(()=>{c(ae,l)})}},oe=()=>{S(!1),a()};return window.addEventListener("mousemove",W,{passive:!0}),window.addEventListener("touchmove",W,{passive:!0}),window.addEventListener("mouseup",oe,{passive:!0}),window.addEventListener("touchend",oe,{passive:!0}),()=>{window.removeEventListener("mousemove",W),window.removeEventListener("touchmove",W),window.removeEventListener("mouseup",oe),window.removeEventListener("touchend",oe),Et.cancel(Z)}}},[b]),h.useEffect(()=>(B(),()=>{clearTimeout(R.current)}),[o]),h.useImperativeHandle(t,()=>({delayHidden:B}));const J=`${r}-scrollbar`,te={position:"absolute",visibility:p?null:"hidden"},Q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return l?(Object.assign(te,{height:8,left:0,right:0,bottom:0}),Object.assign(Q,{height:"100%",width:f,[N?"left":"right"]:U})):(Object.assign(te,{width:8,top:0,bottom:0,[N?"right":"left"]:0}),Object.assign(Q,{width:"100%",height:f,top:U})),h.createElement("div",{ref:E,className:ue(J,{[`${J}-horizontal`]:l,[`${J}-vertical`]:!l,[`${J}-visible`]:p}),style:{...te,...m},onMouseDown:z,onMouseMove:B},h.createElement("div",{ref:g,className:ue(`${J}-thumb`,{[`${J}-thumb-moving`]:b}),style:{...Q,...d},onMouseDown:G}))}),Wv=20;function Iu(e=0,t=0){let r=e/t*e;return isNaN(r)&&(r=0),r=Math.max(r,Wv),Math.floor(r)}function zs(){return zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zs.apply(this,arguments)}const Yv=[],Xv={overflowY:"auto",overflowAnchor:"none"};function rp(e,t){const{prefixCls:r="rc-virtual-list",className:n,height:o,itemHeight:s,fullHeight:i=!0,style:a,data:c,children:l,itemKey:f,virtual:y,direction:m,scrollWidth:d,component:v="div",onScroll:b,onVirtualScroll:S,onVisibleChange:u,innerProps:C,extraRender:x,styles:I,showScrollBar:N="optional",...E}=e,g=h.useCallback(Ee=>typeof f=="function"?f(Ee):Ee?.[f],[f]),[p,T,R,B]=Uv(g),P=!!(y!==!1&&o&&s),D=h.useMemo(()=>Object.values(R.maps).reduce((Ee,Ie)=>Ee+Ie,0),[R.id,R.maps]),U=P&&c&&(Math.max(s*c.length,D)>o||!!d),_=m==="rtl",V=ue(r,{[`${r}-rtl`]:_},n),z=c||Yv,q=h.useRef(null),G=h.useRef(null),Y=h.useRef(null),[ee,J]=h.useState(0),[te,Q]=h.useState(0),[Z,W]=h.useState(!1),oe=()=>{W(!0)},ie=()=>{W(!1)},A={getKey:g};function $(Ee){J(Ie=>{let Oe;typeof Ee=="function"?Oe=Ee(Ie):Oe=Ee;const ve=Le(Oe);return q.current.scrollTop=ve,ve})}const O=h.useRef({start:0,end:z.length}),w=h.useRef(void 0),[M]=_v(z,g);w.current=M;const{scrollHeight:H,start:F,end:X,offset:ce}=h.useMemo(()=>
13{if(!P)return{scrollHeight:void 0,start:0,end:z.length-1,offset:void 0};if(!U)return{scrollHeight:G.current?.offsetHeight||0,start:0,end:z.length-1,offset:void 0};let Ee=0,Ie,Oe,ve;const Te=z.length;for(let se=0;se<Te;se+=1){const fe=z[se],Ae=g(fe),Ke=R.get(Ae),Ye=Ee+(Ke===void 0?s:Ke);Ye>=ee&&Ie===void 0&&(Ie=se,Oe=Ee),Ye>ee+o&&ve===void 0&&(ve=se),Ee=Ye}return Ie===void 0&&(Ie=0,Oe=0,ve=Math.ceil(o/s)),ve===void 0&&(ve=z.length-1),ve=Math.min(ve+1,z.length-1),{scrollHeight:Ee,start:Ie,end:ve,offset:Oe}},[U,P,ee,z,B,o]);O.current.start=F,O.current.end=X,h.useLayoutEffect(()=>{const Ee=R.getRecord();if(Ee.size===1){const Ie=Array.from(Ee.keys())[0],Oe=Ee.get(Ie),ve=z[F];if(ve&&Oe===void 0&&g(ve)===Ie){const fe=R.get(Ie)-s;$(Ae=>Ae+fe)}}R.resetRecord()},[H]);const[ae,re]=h.useState({width:0,height:o}),de=Ee=>{re({width:Ee.offsetWidth,height:Ee.offsetHeight})},Ce=h.useRef(null),he=h.useRef(null),ye=h.useMemo(()=>Iu(ae.width,d),[ae.width,d]),De=h.useMemo(()=>Iu(ae.height,H),[ae.height,H]),Fe=H-o,je=h.useRef(Fe);je.current=Fe;function Le(Ee){let Ie=Ee;return Number.isNaN(je.current)||(Ie=Math.min(Ie,je.current)),Ie=Math.max(Ie,0),Ie}const _e=ee<=0,ze=ee>=Fe,Ue=te<=0,be=te>=d,Se=tp(_e,ze,Ue,be),Pe=()=>({x:_?-te:te,y:ee}),$e=h.useRef(Pe()),ke=Nt(Ee=>
13{if(S){const Ie={...Pe(),...Ee};($e.current.x!==Ie.x||$e.current.y!==Ie.y)&&(S(Ie),$e.current=Ie)}});function ct(Ee,Ie){const Oe=Ee;Ie?(ra.flushSync(()=>{Q(Oe)}),ke()):$(Oe)}function at(Ee){const{scrollTop:Ie}=Ee.currentTarget;Ie!==ee&&$(Ie),b?.(Ee),ke()}const ft=Ee=>{let Ie=Ee;const Oe=d?d-ae.width:0;return Ie=Math.max(Ie,0),Ie=Math.min(Ie,Oe),Ie},yt=Nt((Ee,Ie)=>{Ie?(ra.flushSync(()=>{Q(Oe=>{const ve=Oe+(_?-Ee:Ee);return ft(ve)})}),ke()):$(Oe=>Oe+Ee)}),[ot,gt]=kv(P,_e,ze,Ue,be,!!d,yt);jv(P,q,(Ee,Ie,Oe,ve)=>{const Te=ve;return Se(Ee,Ie,Oe)?!1:!Te||!Te._virtualHandled?(Te&&(Te._virtualHandled=!0),ot({preventDefault(){},deltaX:Ee?Ie:0,deltaY:Ee?0:Ie}),!0):!1}),zv(U,q,Ee=>{$(Ie=>Ie+Ee)}),$t(()=>{function Ee(Oe){const ve=_e&&Oe.detail<0,Te=ze&&Oe.detail>0;P&&!ve&&!Te&&Oe.preventDefault()}const Ie=q.current;return Ie.addEventListener("wheel",ot,{passive:!1}),Ie.addEventListener("DOMMouseScroll",gt,{passive:!0}),Ie.addEventListener("MozMousePixelScroll",Ee,{passive:!1}),()=>{Ie.removeEventListener("wheel",ot),Ie.removeEventListener("DOMMouseScroll",gt),Ie.removeEventListener("MozMousePixelScroll",Ee)}},[P,_e,ze]),$t(()=>{if(d){const Ee=ft(te);Q(Ee),ke({x:Ee})}},[ae.width,d]);const bt=()=>{Ce.current?.delayHidden(),he.current?.delayHidden()},xt=Vv(z,g,R,s),It=qv(q,z,R,s,g,xt,()=>T(!0),$,bt);h.useImperativeHandle(t,()=>({nativeElement:Y.current,getScrollInfo:Pe,scrollTo:Ee=>{function Ie(Oe){return Oe&&typeof Oe=="object"&&("left"in Oe||"top"in Oe)}Ie(Ee)?(Ee.left!==void 0&&Q(ft(Ee.left)),It(Ee.top)):It(Ee)}})),$t(()=>{if(u){const Ee=z.slice(F,X+1);u(Ee,z)}},[F,X,z]);const ut=x?.({start:F,end:X,virtual:U,offsetX:te,scrollTop:ee,offsetY:ce,rtl:_,getSize:xt}),tt=$v(z,F,X,d,te,p,l,A);let We=null;o&&(We={[i?"height":"maxHeight"]:o,...Xv},P&&(We.overflowY="hidden",d&&(We.overflowX="hidden"),Z&&(We.pointerEvents="none")));const it={};
13return _&&(it.dir="rtl"),h.createElement("div",zs({ref:Y,style:{...a,position:"relative"},className:V},it,E),h.createElement(ma,{onResize:de},h.createElement(v,{className:`${r}-holder`,style:We,ref:q,onScroll:at,onMouseEnter:bt},h.createElement(ep,{prefixCls:r,height:H,offsetX:te,offsetY:ce,scrollWidth:d,onInnerResize:T,ref:G,innerProps:C,rtl:_,extra:ut},tt))),U&&H>o&&h.createElement(wu,{ref:Ce,prefixCls:r,scrollOffset:ee,scrollRange:H,rtl:_,onScroll:ct,onStartMove:oe,onStopMove:ie,spinSize:De,containerSize:ae.height,style:I?.verticalScrollBar,thumbStyle:I?.verticalScrollBarThumb,showScrollBar:N}),U&&d>ae.width&&h.createElement(wu,{ref:he,prefixCls:r,scrollOffset:te,scrollRange:d,rtl:_,onScroll:ct,onStartMove:oe,onStopMove:ie,spinSize:ye,containerSize:ae.width,horizontal:!0,style:I?.horizontalScrollBar,thumbStyle:I?.horizontalScrollBarThumb,showScrollBar:N}))}const np=h.forwardRef(rp);np.displayName="List";const Qv=h.forwardRef((e,t)=>rp({...e,virtual:!1},t));Qv.displayName="List";function Zv(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}function Jn(){return Jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jn.apply(this,arguments)}function Tu(e){return typeof e=="string"||typeof e=="number"}const Jv=(e,t)=>
13{const{prefixCls:r,id:n,open:o,multiple:s,mode:i,searchValue:a,toggleOpen:c,notFoundContent:l,onPopupScroll:f,showScrollBar:y,lockOptions:m}=sn(),{maxCount:d,flattenOptions:v,onActiveValue:b,defaultActiveFirstOption:S,onSelect:u,menuItemSelectedIcon:C,rawValues:x,fieldNames:I,virtual:N,direction:E,listHeight:g,listItemHeight:p,optionRender:T,classNames:R,styles:B}=h.useContext(Jl),P=`${r}-item`,D=cf(()=>v,[o,m],($,O)=>O[0]&&!O[1]),U=h.useRef(null),_=h.useMemo(()=>s&&Os(d)&&x?.size>=d,[s,d,x?.size]),V=$=>{$.preventDefault()},z=$=>{U.current?.scrollTo(typeof $=="number"?{index:$}:$)},q=h.useCallback($=>i==="combobox"?!1:x.has($),[i,[...x].toString(),x.size]),G=($,O=1)=>{const w=D.length;for(let M=0;M<w;M+=1){const H=($+M*O+w)%w,{group:F,data:X}=D[H]||{};if(!F&&!X?.disabled&&(q(X.value)||!_))return H}return-1},[Y,ee]=h.useState(()=>G(0)),J=($,O=!1)=>{ee($);const w={source:O?"keyboard":"mouse"},M=D[$];if(!M){b(null,-1,w);return}b(M.value,$,w)};h.useEffect(()=>{J(S!==!1?G(0):-1)},[D.length,a]);const te=h.useCallback($=>i==="combobox"?String($).toLowerCase()===a.toLowerCase():x.has($),[i,a,[...x].toString(),x.size]);h.useEffect(()=>{let $;if(!s&&o&&x.size===1){const O=Array.from(x)[0],w=D.findIndex(({data:M})=>a?String(M.value).startsWith(a):M.value===O);w!==-1&&(J(w),$=setTimeout(()=>{z(w)}))}return o&&U.current?.scrollTo(void 0),()=>clearTimeout($)},[o,a]);const Q=$=>{$!==void 0&&u($,{selected:!x.has($)}),s||c(!1)};if(h.useImperativeHandle(t,()=>({onKeyDown:$=>{const{which:O,ctrlKey:w}=$;switch(O){case Xe.N:case Xe.P:case Xe.UP:case Xe.DOWN:{let M=0;if(O===Xe.UP?M=-1:O===Xe.DOWN?M=1:Zv()&&w&&(O===Xe.N?M=1:O===Xe.P&&(M=-1)),M!==0){const H=G(Y+M,M);z(H),J(H,!0)}break}case Xe.TAB:case Xe.ENTER:{const M=D[Y];if(!M||M.data.disabled)return Q(void 0);!_||x.has(M.value)?Q(M.value):Q(void 0),o&&$.preventDefault();break}case Xe.ESC:c(!1),o&&$.stopPropagation()}},onKeyUp:()=>{},scrollTo:$=>{z($)}})),D.length===0)return h.createElement("div",{role:"listbox",id:`${n}_list`,className:`${P}-empty`,onMouseDown:V},l);const Z=Object.keys(I).map($=>I[$]),W=$=>$.label;function oe($,O){const{group:w}=$;return{role:w?"presentation":"option",id:`${n}_list_${O}`}}const ie=$=>{const O=D[$];if(!O)return null;const w=O.data||{},{value:M}=w,{group:H}=O,F=wr(w,!0),X=W(O);return O?h.createElement("div",Jn({"aria-label":typeof X=="string"&&!H?X:null},F,{key:$},oe(O,$),{"aria-selected":te(M)}),M):null},A={role:"listbox",id:`${n}_list`};return h.createElement(h.Fragment,null,N&&h.createElement("div",Jn({},A,{style:{height:0,width:0,overflow:"hidden"}}),ie(Y-1),ie(Y),ie(Y+1)),h.createElement(np,{itemKey:"key",ref:U,data:D,height:g,itemHeight:p,fullHeight:!1,onMouseDown:V,onScroll:f,virtual:N,direction:E,innerProps:N?null:A,showScrollBar:y,className:R?.popup?.list,style:B?.popup?.list},($,O)=>{const{group:w,groupOption:M,data:H,label:F,value:X}=$,{key:ce}=H;if(w){const Pe=H.title??(Tu(F)?F.toString():void 0);return h.createElement("div",{className:ue(P,`${P}-group`,H.className),title:Pe},F!==void 0?F:ce)}const{disabled:ae,title:re,children:de,style:Ce,className:he,...ye}=H,De=Tt(ye,Z),Fe=q(X),je=ae||!Fe&&_,Le=`${P}-option`,_e=ue(P,Le,he,R?.popup?.listItem,{[`${Le}-grouped`]:M,[`${Le}-active`]:Y===O&&!je,[`${Le}-disabled`]:je,[`${Le}-selected`]:Fe}),ze=W($),Ue=!C||typeof C=="function"||Fe,be=typeof ze=="number"?ze:ze||X;let Se=Tu(be)?be.toString():void 0;return re!==void 0&&(Se=re),h.createElement("div",Jn({},wr(De),N?{}:oe($,O),{"aria-selected":N?void 0:te(X),className:_e,title:Se,onMouseMove:()=>{Y===O||je||J(O)},onClick:()=>{je||Q(X)},style:{...B?.popup?.listItem,...Ce}}),h.createElement("div",{className:`${Le}-content`},typeof T=="function"?T($,{index:O}):be),h.isValidElement(C)||Fe,Ue&&h.createElement(Jf,{className:`${P}-option-state`,customizeIcon:C,customizeIconProps:{value:X,disabled:je,isSelected:Fe}},Fe?"â":null))}))},ey=h.forwardRef(Jv),ty=((e,t)=>{const r=h.useRef({values:new Map,options:new Map}),n=h.useMemo(()=>{const{values:s,options:i}=r.current,a=e.map(f=>f.label===void 0?{...f,label:s.get(f.value)?.label}:f),c=new Map,l=new Map;return a.forEach(f=>{c.set(f.value,f),l.set(f.value,t.get(f.value)||i.get(f.value))}),r.current.values=c,r.current.options=l,a},[e,t]),o=h.useCallback(s=>t.get(s)||r.current.options.get(s),[t]);return[n,o]});function Ci(e,t){return Xf(e).join("").toUpperCase().includes(t)}const ry=((e,t,r,n,o)=>h.useMemo(()=>
13{if(!r||n===!1)return e;const{options:s,label:i,value:a}=t,c=[],l=typeof n=="function",f=r.toUpperCase(),y=l?n:(d,v)=>o&&o.length?o.some(b=>Ci(v[b],f)):v[s]?Ci(v[i!=="children"?i:"label"],f):Ci(v[a],f),m=l?d=>_s(d):d=>d;return e.forEach(d=>{if(d[s]){if(y(r,m(d)))c.push(d);else{const b=d[s].filter(S=>y(r,m(S)));b.length&&c.push({...d,[s]:b})}return}y(r,m(d))&&c.push(d)}),c},[e,n,o,r,t]));function ny(e){const{key:t,props:{children:r,value:n,...o}}=e;return{key:t,value:n!==void 0?n:t,children:r,...o}}function ap(e,t=!1){return Ln(e).map((r,n)=>{if(!h.isValidElement(r)||!r.type)return null;const{type:{isSelectOptGroup:o},key:s,props:{children:i,...a}}=r;return t||!o?ny(r):{key:`__RC_SELECT_GRP__${s===null?n:s}__`,label:s,...a,options:ap(i)}}).filter(r=>r)}const ay=(e,t,r,n,o)=>h.useMemo(()=>{let s=e;!e&&(s=ap(t));const a=new Map,c=new Map,l=(y,m,d)=>{d&&typeof d=="string"&&y.set(m[d],m)},f=(y,m=!1)=>{for(let d=0;d<y.length;d+=1){const v=y[d];!v[r.options]||m?(a.set(v[r.value],v),l(c,v,r.label),n.forEach(b=>{l(c,v,b)}),l(c,v,o)):f(v[r.options],!0)}};return f(s),{options:s,valueOptions:a,labelOptions:c}},[e,t,r,n,o]);function Au(e){const t=h.useRef();return t.current=e,h.useCallback((...n)=>t.current(...n),[])}function oy(e,t,r){const{filterOption:n,searchValue:o,optionFilterProp:s,filterSort:i,onSearch:a,autoClearSearchValue:c}=t;return h.useMemo(()=>{const l=typeof e=="object",f={filterOption:n,searchValue:o,optionFilterProp:s,filterSort:i,onSearch:a,autoClearSearchValue:c,...l?e:{}};return[l||r==="combobox"||r==="tags"||r==="multiple"&&e===void 0?!0:e,f]},[r,e,n,o,s,i,a,c])}function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ks.apply(this,arguments)}const iy=["inputValue"];function sy(e){return!e||typeof e!="object"}const ly=h.forwardRef((e,t)=>{const{id:r,mode:n,prefixCls:o="rc-select",backfill:s,fieldNames:i,showSearch:a,searchValue:c,onSearch:l,autoClearSearchValue:f,filterOption:y,optionFilterProp:m,filterSort:d,onSelect:v,onDeselect:b,onActive:S,popupMatchSelectWidth:u=!0,optionLabelProp:C,options:x,optionRender:I,children:N,defaultActiveFirstOption:E,menuItemSelectedIcon:g,virtual:p,direction:T,listHeight:R=200,listItemHeight:B=20,labelRender:P,value:D,defaultValue:U,labelInValue:_,onChange:V,maxCount:z,classNames:q,styles:G,...Y}=e,ee={searchValue:c,onSearch:l,autoClearSearchValue:f,filterOption:y,optionFilterProp:m,filterSort:d},[J,te]=oy(a,ee,n),{filterOption:Q,searchValue:Z,optionFilterProp:W,filterSort:oe,onSearch:ie,autoClearSearchValue:A=!0}=te,$=h.useMemo(()=>W?Array.isArray(W)?W:[W]:[],[W]),O=pa(r),w=js(n),M=!!(!x&&N),H=h.useMemo(()=>Q===void 0&&n==="combobox"?!1:Q,[Q,n]),F=h.useMemo(()=>Gf(i,M),[JSON.stringify(i),M]),[X,ce]=Xt("",Z),ae=X||"",re=ay(x,N,F,$,C),{valueOptions:de,labelOptions:Ce,options:he}=re,ye=h.useCallback(ve=>Xf(ve).map(se=>{let fe,Ae,Ke,Ye;sy(se)?fe=se:(Ae=se.label,fe=se.value);const Je=de.get(fe);return Je&&(Ae===void 0&&(Ae=Je?.[C||F.label]),Ke=Je?.disabled,Ye=Je?.title),{label:Ae,value:fe,key:fe,disabled:Ke,title:Ye}}),[F,C,de]),[De,Fe]=Xt(U,D),je=h.useMemo(()=>{const Te=ye(w&&De===null?[]:De);return n==="combobox"&&vv(Te[0]?.value)?[]:Te},[De,ye,n,w]),[Le,_e]=ty(je,de),ze=h.useMemo(()=>{if(!n&&Le.length===1){const ve=Le[0];if(ve.value===null&&(ve.label===null||ve.label===void 0))return[]}return Le.map(ve=>({...ve,label:(typeof P=="function"?P(ve):ve.label)??ve.value}))},[n,Le,P]),Ue=h.useMemo(()=>new Set(Le.map(ve=>ve.value)),[Le]);h.useEffect(()=>{if(n==="combobox"){const ve=Le[0]?.value;ce(gv(ve)?String(ve):"")}},[Le]);const be=Au((ve,Te)=>{const se=Te??ve;return{[F.value]:ve,[F.label]:se}}),Se=h.useMemo(()=>{if(n!=="tags")return he;const ve=[...he],Te=se=>de.has(se);return[...Le].sort((se,fe)=>se.value<fe.value?-1:1).forEach(se=>{const fe=se.value;Te(fe)||ve.push(be(fe,se.label))}),ve},[be,he,de,Le,n]),Pe=ry(Se,F,ae,H,$),$e=h.useMemo(()=>{const ve=Te=>$.length?$.some(se=>Te?.[se]===ae):Te?.value===ae;return n!=="tags"||!ae||Pe.some(Te=>ve(Te))||Pe.some(Te=>Te[F.value]===ae)?Pe:[be(ae),...Pe]},[be,$,n,Pe,ae,F]),ke=ve=>[...ve].sort((se,fe)=>oe(se,fe,{searchValue:ae})).map(se=>Array.isArray(se.options)?{...se,options:se.options.length>0?ke(se.options):se.options}:se),ct=h.useMemo(()=>oe?ke($e):$e,[$e,oe,ae]),at=h.useMemo(()=>dv(ct,{fieldNames:F,childrenAsData:M}),[ct,F,M]),ft=ve=>{const Te=ye(ve);
13if(Fe(Te),V&&(Te.length!==Le.length||Te.some((se,fe)=>Le[fe]?.value!==se?.value))){const se=_?Te.map(({label:Ae,value:Ke})=>({label:Ae,value:Ke})):Te.map(Ae=>Ae.value),fe=Te.map(Ae=>_s(_e(Ae.value)));V(w?se:se[0],w?fe:fe[0])}},[yt,ot]=h.useState(null),[gt,bt]=h.useState(0),xt=E!==void 0?E:n!=="combobox",It=h.useRef(),ut=h.useCallback((ve,Te,{source:se="keyboard"}={})=>{bt(Te),s&&n==="combobox"&&ve!==null&&se==="keyboard"&&ot(String(ve));const fe=Promise.resolve().then(()=>{It.current===fe&&S?.(ve)});It.current=fe},[s,n,S]),tt=(ve,Te,se)=>{const fe=()=>{const Ae=_e(ve);return[_?{label:Ae?.[F.label],value:ve}:ve,_s(Ae)]};if(Te&&v){const[Ae,Ke]=fe();v(Ae,Ke)}else if(!Te&&b&&se!=="clear"){const[Ae,Ke]=fe();b(Ae,Ke)}},We=Au((ve,Te)=>{let se;const fe=w?Te.selected:!0;fe?se=w?[...Le,ve]:[ve]:se=Le.filter(Ae=>Ae.value!==ve),ft(se),tt(ve,fe),n==="combobox"?ot(""):(!js||A)&&(ce(""),ot(""))}),it=(ve,Te)=>{ft(ve);const{type:se,values:fe}=Te;(se==="remove"||se==="clear")&&fe.forEach(Ae=>{tt(Ae.value,!1,se)})},Ee=(ve,Te)=>{if(ce(ve),ot(null),Te.source==="submit"){const se=(ve||"").trim();if(se){const fe=Array.from(new Set([...Ue,se]));ft(fe),tt(se,!0),ce("")}return}Te.source!=="blur"&&(n==="combobox"&&ft(ve),ie?.(ve))},Ie=ve=>{let Te=ve;n!=="tags"&&(Te=ve.map(fe=>Ce.get(fe)?.value).filter(fe=>fe!==void 0));const se=Array.from(new Set([...Ue,...Te]));ft(se),se.forEach(fe=>{tt(fe,!0)})},Oe=h.useMemo(()=>({...re,flattenOptions:at,onActiveValue:ut,defaultActiveFirstOption:xt,onSelect:We,menuItemSelectedIcon:g,rawValues:Ue,fieldNames:F,virtual:p!==!1&&u!==!1,direction:T,listHeight:R,listItemHeight:B,childrenAsData:M,maxCount:z,optionRender:I,classNames:q,styles:G}),[z,re,at,ut,xt,We,g,Ue,F,p,u,T,R,B,M,I,q,G]);return h.createElement(Jl.Provider,{value:Oe},h.createElement(Mv,Ks({},Y,{id:O,prefixCls:o,ref:t,omitDomProps:iy,mode:n,classNames:q,styles:G,displayValues:ze,onDisplayValuesChange:it,maxCount:z,direction:T,showSearch:J,searchValue:ae,onSearch:Ee,autoClearSearchValue:A,onSearchSplit:Ie,popupMatchSelectWidth:u,OptionList:ey,emptyOptions:!at.length,activeValue:yt,activeDescendantId:`${O}_list_${gt}`})))}),rc=ly;rc.Option=tc;rc.OptGroup=ec;const ia=(e,t,r)=>ue({[`${e}-status-success`]:t==="success",[`${e}-status-warning`]:t==="warning",[`${e}-status-error`]:t==="error",[`${e}-status-validating`]:t==="validating",[`${e}-has-feedback`]:r}),Ho=(e,t)=>t||e,cy=()=>{const[,e]=Mn(),[t]=Bo("Empty"),n=new Pr(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return h.createElement("svg",{style:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},h.createElement("title",null,t?.description||"Empty"),h.createElement("g",{fill:"none",fillRule:"evenodd"},h.createElement("g",{transform:"translate(24 31.7)"},h.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.8",cy:"106.9",rx:"67.8",ry:"12.7"}),h.createElement("path",{fill:"#aeb8c2",d:"M122 69.7 98.1 40.2a6 6 0 0 0-4.6-2.2H42.1a6 6 0 0 0-4.6 2.2l-24 29.5V85H122z"}),h.createElement("path",{fill:"#f5f5f7",d:"M33.8 0h68a4 4 0 0 1 4 4v93.3a4 4 0 0 1-4 4h-68a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4"}),h.createElement("path",{fill:"#dce0e6",d:"M42.7 10h50.2a2 2 0 0 1 2 2v25a2 2 0 0 1-2 2H42.7a2 2 0 0 1-2-2V12a2 2 0 0 1 2-2m.2 39.8h49.8a2.3 2.3 0 1 1 0 4.5H42.9a2.3 2.3 0 0 1 0-4.5m0 11.7h49.8a2.3 2.3 0 1 1 0 4.6H42.9a2.3 2.3 0 0 1 0-4.6m79 43.5a7 7 0 0 1-6.8 5.4H20.5a7 7 0 0 1-6.7-5.4l-.2-1.8V69.7h26.3c2.9 0 5.2 2.4 5.2 5.4s2.4 5.4 5.3 5.4h34.8c2.9 0 5.3-2.4 5.3-5.4s2.3-5.4 5.2-5.4H122v33.5q0 1-.2 1.8"})),h.createElement("path",{fill:"#dce0e6",d:"m149.1 33.3-6.8 2.6a1 1 0 0 1-1.3-1.2l2-6.2q-4.1-4.5-4.2-10.4c0-10 10.1-18.1 22.6-18.1S184 8.1 184 18.1s-10.1 18-22.6 18q-6.8 0-12.3-2.8"}),h.createElement("g",{fill:"#fff",transform:"translate(149.7 15.4)"},h.createElement("circle",{cx:"20.7",cy:"3.2",r:"2.8"}),h.createElement("path",{d:"M5.7 5.6H0L2.9.7zM9.3.7h5v5h-5z"}))))},uy=()=>{const[,e]=Mn(),[t]=Bo("Empty"),{colorFill:r,colorFillTertiary:n,colorFillQuaternary:o,colorBgContainer:s}=e,{borderColor:i,shadowColor:a,contentColor:c}=h.useMemo(()=>({borderColor:new Pr(r).onBackground(s).toHexString(),shadowColor:new Pr(n).onBackgroun
13d(s).toHexString(),contentColor:new Pr(o).onBackground(s).toHexString()}),[r,n,o,s]);return h.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},h.createElement("title",null,t?.description||"Empty"),h.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},h.createElement("ellipse",{fill:a,cx:"32",cy:"33",rx:"32",ry:"7"}),h.createElement("g",{fillRule:"nonzero",stroke:i},h.createElement("path",{d:"M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"}),h.createElement("path",{d:"M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3",fill:c}))))},dy=e=>{const{componentCls:t,margin:r,marginXS:n,marginXL:o,fontSize:s,lineHeight:i}=e;return{[t]:{marginInline:n,fontSize:s,lineHeight:i,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:n,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:r},"&-normal":{marginBlock:o,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:n,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}},fy=Ut("Empty",e=>{const{componentCls:t,controlHeightLG:r,calc:n}=e,o=_t(e,{emptyImgCls:`${t}-img`,emptyImgHeight:n(r).mul(2.5).equal(),emptyImgHeightMD:r,emptyImgHeightSM:n(r).mul(.875).equal()});return dy(o)}),op=h.createElement(cy,null),ip=h.createElement(uy,null),Qr=e=>{const{className:t,rootClassName:r,prefixCls:n,image:o,description:s,children:i,imageStyle:a,style:c,classNames:l,styles:f,...y}=e,{getPrefixCls:m,direction:d,className:v,style:b,classNames:S,styles:u,image:C}=Gt("empty"),x=m("empty",n),[I,N]=fy(x),[E,g]=kt([S,l],[u,f],{props:e}),[p]=Bo("Empty"),T=typeof s<"u"?s:p?.description,R=typeof T=="string"?T:"empty",B=o??C??op;let P=null;return typeof B=="string"?P=h.createElement("img",{draggable:!1,alt:R,src:B}):P=B,h.createElement("div",{className:ue(I,N,x,v,{[`${x}-normal`]:B===ip,[`${x}-rtl`]:d==="rtl"},t,r,E.root),style:{...g.root,...b,...c},...y},h.createElement("div",{className:ue(`${x}-image`,E.image),style:{...a,...g.image}},P),T&&h.createElement("div",{className:ue(`${x}-description`,E.description),style:g.description},T),i&&h.createElement("div",{className:ue(`${x}-footer`,E.footer),style:g.footer},i))};Qr.PRESENTED_IMAGE_DEFAULT=op;Qr.PRESENTED_IMAGE_SIMPLE=ip;const py=e=>{const{componentName:t}=e,{getPrefixCls:r}=h.useContext(Rt),n=r("empty");switch(t){case"Table":case"List":return xe.createElement(Qr,{image:Qr.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return xe.createElement(Qr,{image:Qr.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});case"Table.filter":return null;default:return xe.createElement(Qr,null)}},nc=(e,t,r)=>{const{variant:n,[e]:o}=h.useContext(Rt),s=h.useContext(uf),i=o?.variant;let a;typeof t<"u"?a=t:r===!1?a="borderless":a=s??i??n??"outlined";const c=Jm.includes(a);return[a,c]},hy=e=>{const r={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:e==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:{...r,points:["tl","bl"],offset:[0,4]},bottomRight:{...r,points:["tr","br"],offset:[0,4]},topLeft:{...r,points:["bl","tl"],offset:[0,-4]},topRight:{...r,points:["br","tr"],offset:[0,-4]}}};function my(e,t){return e||hy(t)}const Nu=e=>{const{optionHeight:t,optionFontSize:r,optionLineHeight:n,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:r,lineHeight:n,boxSizing:"border-box"}},gy=e=>{const{antCls:t,componentCls:r}=e,n=`${r}-item`,o=`&${t}-slide-up-enter${t}-slide-up-enter-active`,s=`&${t}-slide-up-appear${t}-slide-up-appear-active`,i=`&${t}-slide-up-leave${t}-slide-up-leave-active`,a=`${r}-dropdown-placement-`,c=`${n}-option-selected`;return[{[`${r}-dropdown`]:{...Ot(e),position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[` 14 ${o}${a}bottomLeft, 15 ${s}${a}bottomLeft 16 `]:{animationName:Wl},[` 17 ${o}${a}topLeft, 18 ${s}${a}topLeft, 19 ${o}${a}topRight, 20 ${s}${a}topRight 21 `]:{animationName:Xl},[`${i}${a}bottomLeft`]:{animationName:Yl},[` 22 ${i}${a}topLeft, 23 ${i}${a}topRight 24 `]:{animationName:Ql},"&-hidden":{display:"none"},[n]:{...Nu(e),cursor:"pointer",transition:`background-color ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":{flex:"auto",...In},"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${n}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${n}
24-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":{...Nu(e),color:e.colorTextDisabled}},[`${c}:has(+ ${c})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${c}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}}},Nn(e,"slide-up"),Nn(e,"slide-down"),so(e,"move-up"),so(e,"move-down")]},vy=e=>{const{componentCls:t}=e;return{[`&${t}-customize`]:{border:0,padding:0,fontSize:"inherit",lineHeight:"inherit",[`${t}-placeholder`]:{display:"none"},[`${t}-content`]:{margin:0,padding:0,"&-value":{display:"none"}}}}},Ru=4,yy=e=>{const{componentCls:t,calc:r,iconCls:n,paddingXS:o,paddingXXS:s,INTERNAL_FIXED_ITEM_MARGIN:i,lineWidth:a,colorIcon:c,colorIconHover:l,inputPaddingHorizontalBase:f,antCls:y}=e,[m,d]=kr(y,"select");return{"&-multiple":{[m("multi-item-background")]:e.multipleItemBg,[m("multi-item-border-color")]:"transparent",[m("multi-item-border-radius")]:e.borderRadiusSM,[m("multi-item-height")]:e.multipleItemHeight,[m("multi-padding-base")]:`calc((${d("height")} - ${d("multi-item-height")}) / 2)`,[m("multi-padding-vertical")]:`calc(${d("multi-padding-base")} - ${i} - ${a})`,[m("multi-item-padding-horizontal")]:`calc(${f} - ${d("multi-padding-vertical")} - ${a} * 2)`,paddingBlock:d("multi-padding-vertical"),paddingInlineStart:`calc(${d("multi-padding-base")} - ${a})`,[`${t}-prefix`]:{marginInlineStart:d("multi-item-padding-horizontal")},[`${t}-prefix + ${t}-content`]:{[`${t}-placeholder`]:{insetInlineStart:0},[`${t}-content-item${t}-content-item-suffix`]:{marginInlineStart:0}},[`${t}-placeholder`]:{position:"absolute",lineHeight:d("line-height"),insetInlineStart:d("multi-item-padding-horizontal"),width:`calc(100% - ${d("multi-item-padding-horizontal")})`,top:"50%",transform:"translateY(-50%)"},[`${t}-content`]:{flexWrap:"wrap",alignItems:"center",lineHeight:1,"&-item-prefix":{height:d("font-size")},"&-item":{lineHeight:1,maxWidth:`calc(100% - ${Ru}px)`},[`${t}-content-item-prefix + ${t}-content-item-suffix, 25 ${t}-content-item-suffix:first-child`]:{marginInlineStart:d("multi-item-padding-horizontal")},[`${t}-selection-item`]:{lineHeight:`calc(${d("multi-item-height")} - ${a} * 2)`,border:`${a} solid ${d("multi-item-border-color")}`,display:"flex",marginBlock:i,marginInlineEnd:r(i).mul(2).equal(),background:d("multi-item-background"),borderRadius:d("multi-item-border-radius"),paddingInlineStart:o,paddingInlineEnd:s,transition:["height","line-height","padding"].map(v=>`${v} ${e.motionDurationSlow}`).join(","),"&-content":{...In,marginInlineEnd:s},"&-remove":{...df(),display:"inline-flex",alignItems:"center",color:c,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:l}}},[`${t}-input`]:{lineHeight:r(i).mul(2).add(d("multi-item-height")).equal(),width:"calc(var(--select-input-width, 0) * 1px)",minWidth:Ru,maxWidth:"100%",transition:`line-height ${e.motionDurationSlow}`}},[`&${t}-sm`]:{[m("multi-item-height")]:e.multipleItemHeightSM,[m("multi-item-border-radius")]:e.borderRadiusXS},[`&${t}-lg`]:{[m("multi-item-height")]:e.multipleItemHeightLG,[m("multi-item-border-radius")]:e.borderRadius},[`&${t}-filled`]:{[m("multi-item-border-color")]:e.colorSplit,[m("multi-item-background")]:e.colorBgContainer,[`&${t}-disabled`]:{[m("multi-item-border-color")]:"transparent"}}}}},xi=(e,t)=>{const{componentCls:r,antCls:n}=e,[o]=kr(n,"select"),{border:s,borderHover:i,borderActive:a,borderOutline:c}=t,l=t.background||e.selectorBg||e.colorBgContainer;return{[o("border-color")]:s,[o("background-color")]:l,[o("color")]:t.color||e.colorText,[`&:not(${r}-disabled)`]:{"&:hover":{[o("border-color")]:i,[o("background-color")]:t.backgroundHover||l},[`&${r}-focused`]:{[o("border-color")]:a,[o("background-color")]:t.backgroundActive||l,boxShadow:`0 0 0 ${Re(e.controlOutlineWidth)} ${c}`}},[`&${r}-disabled`]:{[o("border-color")]:t.borderDisabled||t.border,[o("background-color")]:t.backgroundDisabled||t.background}}},Ma=(e,t,r,n={},o={},s)=>{const{componentCls:i}=e;return{[`&${i}-${t}`]:[xi(e,r),{[`&${i}-status-error`]:xi(e,{...r,color:n.color||e.colorError,...n}),[`&${i}-status-warning`]:xi(e,{...r,color:o.color||e.colorWarning,...o})},s]}},by=e=>{const{componentCls:t,fontHeight:r,controlHeight:n,iconCls:o,antCls:s,calc:i}=e,[a,c]=kr(s,"select");return{[t]:[{[a("border-radius")]:e.borderRadius,[a("border-color")]:"#000",[a("border-size")]:e.lineWidth,[a("background-color")]:e.colorBg
vendor: 3,978 bytes, line 25
25Container,[a("font-size")]:e.fontSize,[a("line-height")]:e.lineHeight,[a("font-height")]:r,[a("color")]:e.colorText,[a("height")]:n,[a("padding-horizontal")]:i(e.paddingSM).sub(e.lineWidth).equal(),[a("padding-vertical")]:`calc((${c("height")} - ${c("font-height")}) / 2 - ${c("border-size")})`,...Ot(e,!0),display:"inline-flex",flexWrap:"nowrap",position:"relative",transition:`all ${e.motionDurationSlow}`,alignItems:"flex-start",outline:0,cursor:"pointer",borderRadius:c("border-radius"),borderWidth:c("border-size"),borderStyle:e.lineType,borderColor:c("border-color"),background:c("background-color"),fontSize:c("font-size"),lineHeight:c("line-height"),color:c("color"),paddingInline:c("padding-horizontal"),paddingBlock:c("padding-vertical"),[`${t}-prefix`]:{flex:"none",lineHeight:1},[`${t}-placeholder`]:{...In,color:e.colorTextPlaceholder,pointerEvents:"none",zIndex:1},[`${t}-content`]:{flex:"auto",minWidth:0,position:"relative",display:"flex",marginInlineEnd:i(e.paddingXXS).mul(1.5).equal(),"&:before":{content:'"\\a0"',width:0,overflow:"hidden"},"&-value":{...In,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,zIndex:1},"input[readonly]":{cursor:"inherit",caretColor:"transparent"}},[`&-open ${t}-content-value`]:{color:e.colorTextPlaceholder},[`${t}-suffix`]:{flex:"none",color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,"> :not(:last-child)":{marginInlineEnd:e.marginXS}},[`${t}-prefix, ${t}-suffix`]:{alignSelf:"center",[o]:{verticalAlign:"top"}},"&-disabled":{background:e.colorBgContainerDisabled,color:e.colorTextDisabled,cursor:"not-allowed",input:{cursor:"not-allowed"}},"&-sm":{[a("height")]:e.controlHeightSM,[a("padding-horizontal")]:i(e.paddingXS).sub(e.lineWidth).equal(),[a("border-radius")]:e.borderRadiusSM,[`${t}-clear`]:{insetInlineEnd:c("padding-horizontal")}},"&-lg":{[a("height")]:e.controlHeightLG,[a("font-size")]:e.fontSizeLG,[a("line-height")]:e.lineHeightLG,[a("font-height")]:e.fontHeightLG,[a("border-radius")]:e.borderRadiusLG}},{[`&:not(${t}-customize)`]:{[`${t}-input`]:{outline:"none",background:"transparent",appearance:"none",border:0,margin:0,padding:0,color:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},{[`&-single:not(${t}-customize)`]:{[`${t}-input`]:{position:"absolute",insetInline:0,insetBlock:`calc(${c("padding-vertical")} * -1)`,lineHeight:`calc(${c("font-height")} + ${c("padding-vertical")} * 2)`},[`${t}-content`]:{alignSelf:"center"}}},{[`&-show-search:not(${t}-customize-input):not(${t}-disabled)`]:{cursor:"text"}},yy(e),Ma(e,"outlined",{border:e.colorBorder,borderHover:e.hoverBorderColor,borderActive:e.activeBorderColor,borderOutline:e.activeOutlineColor,borderDisabled:e.colorBorderDisabled},{border:e.colorError,borderHover:e.colorErrorHover,borderActive:e.colorError,borderOutline:e.colorErrorOutline},{border:e.colorWarning,borderHover:e.colorWarningHover,borderActive:e.colorWarning,borderOutline:e.colorWarningOutline}),Ma(e,"filled",{border:"transparent",borderHover:"transparent",borderActive:e.activeBorderColor,borderOutline:"transparent",borderDisabled:e.colorBorderDisabled,background:e.colorFillTertiary,backgroundHover:e.colorFillSecondary,backgroundActive:e.colorBgContainer},{background:e.colorErrorBg,backgroundHover:e.colorErrorBgHover,borderActive:e.colorError},{background:e.colorWarningBg,backgroundHover:e.colorWarningBgHover,borderActive:e.colorWarning}),Ma(e,"borderless",{border:"transparent",borderHover:"transparent",borderActive:"transparent",borderOutline:"transparent",background:"transparent"}),Ma(e,"underlined",{border:e.colorBorder,borderHover:e.hoverBorderColor,borderActive:e.activeBorderColor,borderOutline:"transparent"},{border:e.colorError,borderHover:e.colorErrorHover,borderActive:e.colorError},{border:e.colorWarning,borderHover:e.colorWarningHover,borderActive:e.colorWarning},{borderRadius:0,borderTopColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}),vy(e)]}},Cy=e=>
25{const{fontSize:t,lineHeight:r,lineWidth:n,controlHeight:o,controlHeightSM:s,controlHeightLG:i,paddingXXS:a,controlPaddingHorizontal:c,zIndexPopupBase:l,colorText:f,fontWeightStrong:y,controlItemBgActive:m,controlItemBgHover:d,colorBgContainer:v,colorFillSecondary:b,colorBgContainerDisabled:S,colorTextDisabled:u,colorPrimaryHover:C,colorPrimary:x,controlOutline:I}=e,N=a*2,E=n*2,g=Math.min(o-N,o-E),p=Math.min(s-N,s-E),T=Math.min(i-N,i-E);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(a/2),zIndexPopup:l+50,optionSelectedColor:f,optionSelectedFontWeight:y,optionSelectedBg:m,optionActiveBg:d,optionPadding:`${(o-t*r)/2}px ${c}px`,optionFontSize:t,optionLineHeight:r,optionHeight:o,selectorBg:v,clearBg:v,singleItemHeightLG:i,multipleItemBg:b,multipleItemBorderColor:"transparent",multipleItemHeight:g,multipleItemHeightSM:p,multipleItemHeightLG:T,multipleSelectorBgDisabled:S,multipleItemColorDisabled:u,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:C,activeBorderColor:x,activeOutlineColor:I,selectAffixPadding:a}},xy=e=>{const{antCls:t,componentCls:r,inputPaddingHorizontalBase:n}=e,o={[`${r}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[r]:{...Ot(e),[`${r}-selection-item`]:{flex:1,fontWeight:"normal",position:"relative",userSelect:"none",...In,[`> ${t}-typography`]:{display:"inline"}},[`${r}-prefix`]:{flex:"none",marginInlineEnd:e.selectAffixPadding},[`${r}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":o,"&:hover":o},[`${r}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${r}-has-feedback`]:{[`${r}-clear`]:{insetInlineEnd:e.calc(n).add(e.fontSize).add(e.paddingXS).equal()}}}}}},Sy=e=>{const{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:"100%"}}},xy(e),gy(e),{[`${t}-rtl`]:{direction:"rtl"}},Dl(e,{focusElCls:`${t}-focused`})]},Ey=Ut("Select",(e,{rootPrefixCls:t})=>{const r=_t(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(e.lineWidth).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[Sy(r),by(r)]},Cy,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var wy={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gs.apply(this,arguments)}const Iy=(e,t)=>h.createElement(Ar,Gs({},e,{ref:t,icon:wy})),ba=h.forwardRef(Iy);var Ty={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
25for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qs.apply(this,arguments)}const Ay=(e,t)=>h.createElement(Ar,qs({},e,{ref:t,icon:Ty})),sp=h.forwardRef(Ay);function Ny({suffixIcon:e,clearIcon:t,menuItemSelectedIcon:r,removeIcon:n,loading:o,multiple:s,hasFeedback:i,showSuffixIcon:a,feedbackIcon:c,showArrow:l,componentName:f}){const y=t??h.createElement(Po,null),m=S=>e===null&&!i&&!l?null:h.createElement(h.Fragment,null,a!==!1&&S,i&&c);let d=null;e!==void 0?d=m(e):o?d=m(h.createElement(Lo,{spin:!0})):d=({open:S,showSearch:u})=>m(S&&u?h.createElement(sp,null):h.createElement(ba,null));let v=null;r!==void 0?v=r:s?v=h.createElement(p2,null):v=null;let b=null;return n!==void 0?b=n:b=h.createElement(Bl,null),{clearIcon:y,suffixIcon:d,itemIcon:v,removeIcon:b}}function Ry(e){return xe.useMemo(()=>{if(e)return(...t)=>xe.createElement(na,{space:!0},e.apply(void 0,t))},[e])}function Py(e,t){return t!==void 0?t:e!==null}const lp="SECRET_COMBOBOX_MODE_DO_NOT_USE",By=(e,t)=>{const{prefixCls:r,bordered:n,className:o,rootClassName:s,getPopupContainer:i,popupClassName:a,dropdownClassName:c,listHeight:l=256,placement:f,listItemHeight:y,size:m,disabled:d,notFoundContent:v,status:b,builtinPlacements:S,dropdownMatchSelectWidth:u,popupMatchSelectWidth:C,direction:x,style:I,allowClear:N,variant:E,popupStyle:g,dropdownStyle:p,transitionName:T,tagRender:R,maxCount:B,prefix:P,dropdownRender:D,popupRender:U,onDropdownVisibleChange:_,onOpenChange:V,styles:z,classNames:q,...G}=e,{getPopupContainer:Y,getPrefixCls:ee,renderEmpty:J,direction:te,virtual:Q,popupMatchSelectWidth:Z,popupOverflow:W}=h.useContext(Rt),{showSearch:oe,style:ie,styles:A,className:$,classNames:O}=Gt("select"),[,w]=Mn(),M=y??w?.controlHeight,H=ee("select",r),F=ee(),X=x??te,{compactSize:ce,compactItemClassnames:ae}=Dn(H,X),[re,de]=nc("select",E,n),Ce=Qt(H),[he,ye]=Ey(H,Ce),De=h.useMemo(()=>{const{mode:Te}=e;if(Te!=="combobox")return Te===lp?"combobox":Te},[e.mode]),Fe=De==="multiple"||De==="tags",je=Py(e.suffixIcon,e.showArrow),Le=C??u??Z,_e=Ry(U||D),ze=V||_,{status:Ue,hasFeedback:be,isFormItemInput:Se,feedbackIcon:Pe}=h.useContext(tr),$e=Ho(Ue,b);let ke;v!==void 0?ke=v:De==="combobox"?ke=null:ke=J?.("Select")||h.createElement(py,{componentName:"Select"});const{suffixIcon:ct,itemIcon:at,removeIcon:ft,clearIcon:yt}=Ny({...G,multiple:Fe,hasFeedback:be,feedbackIcon:Pe,showSuffixIcon:je,componentName:"Select"}),ot=N===!0?{clearIcon:yt}:N,gt=Tt(G,["suffixIcon","itemIcon"]),bt=an(Te=>m??ce??Te),xt=h.useContext(Vr),It=d??xt,ut={...e,variant:re,status:$e,disabled:It,size:bt},[tt,We]=kt([O,q],[A,z],{props:ut},{popup:{_default:"root"}}),it=ue(tt.popup?.root,a,c,{[`${H}-dropdown-${X}`]:X==="rtl"},s,ye,Ce,he),Ee={...We.popup?.root,...g??p},Ie=ue({[`${H}-lg`]:bt==="large",[`${H}-sm`]:bt==="small",[`${H}-rtl`]:X==="rtl",[`${H}-${re}`]:de,[`${H}-in-form-item`]:Se},ia(H,$e,be),ae,$,o,tt.root,s,ye,Ce,he),Oe=h.useMemo(()=>f!==void 0?f:X==="rtl"?"bottomRight":"bottomLeft",[f,X]),[ve]=Mo("SelectLike",We.popup?.root?.zIndex??Ee?.zIndex);return h.createElement(rc,{ref:t,virtual:Q,classNames:tt,styles:We,showSearch:oe,...gt,style:{...We.root,...ie,...I},popupMatchSelectWidth:Le,transitionName:ff(F,"slide-up",T),builtinPlacements:my(S,W),listHeight:l,listItemHeight:M,mode:De,prefixCls:H,placement:Oe,direction:X,prefix:P,suffixIcon:ct,menuItemSelectedIcon:at,removeIcon:ft,allowClear:ot,notFoundContent:ke,className:Ie,getPopupContainer:i||Y,popupClassName:it,disabled:It,popupStyle:{...We.popup?.root,...Ee,zIndex:ve},maxCount:Fe?B:void 0,tagRender:Fe?R:void 0,popupRender:_e,onPopupVisibleChange:ze})},ur=h.forwardRef(By),Ly=Ul(ur,"popupAlign");ur.SECRET_COMBOBOX_MODE_DO_NOT_USE=lp;ur.Option=tc;ur.OptGroup=ec;ur._InternalPanelDoNotUseOrYouWillBeFired=Ly;const{Option:Pu}=ur;function Bu(e){return e?.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const My=(e,t)=>{const{prefixCls:r,className:n,style:o,popupClassName:s,dropdownClassName:i,children:a,dataSource:c,rootClassName:l,dropdownStyle:f,dropdownRender:y,popupRender:m,onDropdownVisibleChange:d,onOpenChange:v,styles:b,classNames:S}=e,u=Ln(a),C=m||y,x=v||d;let I;u.length===1&&h.isValidElement(u[0])&&!Bu(u[0])&&([I]=u);const N=I?()=>I:void 0;let E;u.length&&Bu(u[0])?E=a:E=c?c.map(U=>{if(h.isValidElement(U))return U;switch(typeof U){case"string":return h.createElement(Pu,{key:U,value:U},U);case"object":{const{value:_}=U;return h.createElement(Pu,{key:_,value:_},U.text)}default:return}}):[];const{getPrefixCls:g}=h.useContext(Rt),p=g("select",r),T={...e,dataSource:c,status:e.status,popupMatchSelectWidth:e.popupMatchSelectWidth||e.dropdownMatchSelectWidth,popupRender:C,onOpenChange:x},[R,B]=kt([S],[b],{props:T},{popup:{_default:"root"}}),P=h.useMemo(()=>({root:ue(`${p}-auto-complete`,n,l,R.root,{[`${p}-customize`]:I}
25),prefix:R.prefix,input:R.input,placeholder:R.placeholder,content:R.content,popup:{root:ue(s,i,R.popup?.root),list:R.popup?.list,listItem:R.popup?.listItem}}),[p,n,l,R,s,i]),D=h.useMemo(()=>({root:{...B.root,...o},input:B.input,prefix:B.prefix,placeholder:B.placeholder,content:B.content,popup:{root:{...f,...B.popup?.root},list:B.popup?.list,listItem:B.popup?.listItem}}),[B,o,f]);return h.createElement(ur,{ref:t,suffixIcon:null,...Tt(e,["dataSource","dropdownClassName","popupClassName"]),prefixCls:p,classNames:P,styles:D,mode:ur.SECRET_COMBOBOX_MODE_DO_NOT_USE,popupRender:C,onPopupVisibleChange:x,getInputElement:N},E)},cp=h.forwardRef(My),{Option:Dy}=ur,$y=Ul(cp,"popupAlign",e=>Tt(e,["visible"])),ac=cp;ac.Option=Dy;ac._InternalPanelDoNotUseOrYouWillBeFired=$y;const sa=["xxl","xl","lg","md","sm","xs"],Oy=e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`}),_y=e=>{const t=e,r=[].concat(sa).reverse();return r.forEach((n,o)=>{const s=n.toUpperCase(),i=`screen${s}Min`,a=`screen${s}`;if(!(t[i]<=t[a]))throw new Error(`${i}<=${a} fails : !(${t[i]}<=${t[a]})`);if(o<r.length-1){const c=`screen${s}Max`;if(!(t[a]<=t[c]))throw new Error(`${a}<=${c} fails : !(${t[a]}<=${t[c]})`);const f=`screen${r[o+1].toUpperCase()}Min`;if(!(t[c]<=t[f]))throw new Error(`${c}<=${f} fails : !(${t[c]}<=${t[f]})`)}}),e},ky=()=>{const[,e]=Mn(),t=Oy(_y(e));return xe.useMemo(()=>{const r=new Map;let n=-1,o={};return{responsiveMap:t,matchHandlers:{},dispatch(s){return o=s,r.forEach(i=>i(o)),r.size>=1},subscribe(s){return r.size||this.register(),n+=1,r.set(n,s),s(o),n},unsubscribe(s){r.delete(s),r.size||this.unregister()},register(){Object.entries(t).forEach(([s,i])=>{const a=({matches:l})=>{this.dispatch({...o,[s]:l})},c=window.matchMedia(i);typeof c?.addEventListener=="function"&&c.addEventListener("change",a),this.matchHandlers[i]={mql:c,listener:a},a(c)})},unregister(){Object.values(t).forEach(s=>{const i=this.matchHandlers[s];typeof i?.mql?.removeEventListener=="function"&&i.mql.removeEventListener("change",i?.listener)}),r.clear()}}},[t])};function Vy(e=!0,t={}){const r=h.useRef(t),[,n]=A1(),o=ky();return $t(()=>{const s=o.subscribe(i=>{r.current=i,e&&n()});return()=>o.unsubscribe(s)},[]),r.current}const up=e=>{const{children:t,prefixCls:r,id:n,classNames:o,styles:s,className:i,style:a}=e;return h.createElement("div",{id:n,className:ue(`${r}-container`,o?.container,i),style:{...s?.container,...a},role:"tooltip"},typeof t=="function"?t():t)},mn={shiftX:64,adjustY:1},gn={adjustX:1,shiftY:!0},sr=[0,0],Fy={left:{points:["cr","cl"],overflow:gn,offset:[-4,0],targetOffset:sr},right:{points:["cl","cr"],overflow:gn,offset:[4,0],targetOffset:sr},top:{points:["bc","tc"],overflow:mn,offset:[0,-4],targetOffset:sr},bottom:{points:["tc","bc"],overflow:mn,offset:[0,4],targetOffset:sr},topLeft:{points:["bl","tl"],overflow:mn,offset:[0,-4],targetOffset:sr},leftTop:{points:["tr","tl"],overflow:gn,offset:[-4,0],targetOffset:sr},topRight:{points:["br","tr"],overflow:mn,offset:[0,-4],targetOffset:sr},rightTop:{points:["tl","tr"],overflow:gn,offset:[4,0],targetOffset:sr},bottomRight:{points:["tr","br"],overflow:mn,offset:[0,4],targetOffset:sr},rightBottom:{points:["bl","br"],overflow:gn,offset:[4,0],targetOffset:sr},bottomLeft:{points:["tl","bl"],overflow:mn,offset:[0,4],targetOffset:sr},leftBottom:{points:["br","bl"],overflow:gn,offset:[-4,0],targetOffset:sr}};function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ws.apply(this,arguments)}const Uy=h.forwardRef((e,t)=>{const{trigger:r=["hover"],mouseEnterDelay:n=0,mouseLeaveDelay:o=.1,prefixCls:s="rc-tooltip",children:i,onVisibleChange:a,afterVisibleChange:c,motion:l,placement:f="right",align:y={},destroyOnHidden:m=!1,defaultVisible:d,getTooltipContainer:v,arrowContent:b,overlay:S,id:u,showArrow:C=!0,classNames:x,styles:I,...N}=e,E=pa(u),g=h.useRef(null);h.useImperativeHandle(t,()=>g.current);const p={...N};"visible"in e&&(p.popupVisible=e.visible);const T=h.useMemo(()=>
25{if(!C)return!1;const B=C===!0?{}:C;return{...B,className:ue(B.className,x?.arrow),style:{...B.style,...I?.arrow},content:B.content??b}},[C,x?.arrow,I?.arrow,b]),R=({open:B})=>{const P=h.Children.only(i),D={"aria-describedby":S&&B?E:void 0};return h.cloneElement(P,D)};return h.createElement(jo,Ws({popupClassName:x?.root,prefixCls:s,popup:h.createElement(up,{key:"content",prefixCls:s,id:E,classNames:x,styles:I},S),action:r,builtinPlacements:Fy,popupPlacement:f,ref:g,popupAlign:y,getPopupContainer:v,onOpenChange:a,afterOpenChange:c,popupMotion:l,defaultPopupVisible:d,autoDestroy:m,mouseLeaveDelay:o,popupStyle:I?.root,mouseEnterDelay:n,arrow:T,uniqueContainerClassName:x?.uniqueContainer,uniqueContainerStyle:I?.uniqueContainer},p),R)});function dp(e){const{sizePopupArrow:t,borderRadiusXS:r,borderRadiusOuter:n}=e,o=t/2,s=0,i=o,a=n*1/Math.sqrt(2),c=o-n*(1-1/Math.sqrt(2)),l=o-r*(1/Math.sqrt(2)),f=n*(Math.sqrt(2)-1)+r*(1/Math.sqrt(2)),y=2*o-l,m=f,d=2*o-a,v=c,b=2*o-s,S=i,u=o*Math.sqrt(2)+n*(Math.sqrt(2)-2),C=n*(Math.sqrt(2)-1),x=`polygon(${C}px 100%, 50% ${C}px, ${2*o-C}px 100%, ${C}px 100%)`,I=`path('M ${s} ${i} A ${n} ${n} 0 0 0 ${a} ${c} L ${l} ${f} A ${r} ${r} 0 0 1 ${y} ${m} L ${d} ${v} A ${n} ${n} 0 0 0 ${b} ${S} Z')`;return{arrowShadowWidth:u,arrowPath:I,arrowPolygon:x}}const jy=(e,t,r)=>{const{sizePopupArrow:n,arrowPolygon:o,arrowPath:s,arrowShadowWidth:i,borderRadiusXS:a,calc:c}=e;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:c(n).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[o,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:i,height:i,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Re(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},fp=8;function oc(e){const{contentRadius:t,limitVerticalRadius:r}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:r?fp:n}}function Da(e,t){return e?t:{}}const pp=(e,t,r)=>{const{componentCls:n,boxShadowPopoverArrow:o,arrowOffsetVertical:s,arrowOffsetHorizontal:i,antCls:a}=e,[c]=kr(a,"tooltip"),{arrowDistance:l=0,arrowPlacement:f={left:!0,right:!0,top:!0,bottom:!0}}=r||{};return{[n]:{[`${n}-arrow`]:[{position:"absolute",zIndex:1,display:"block",...jy(e,t,o),"&:before":{background:t}}],...Da(!!f.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:l,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{[c("arrow-offset-horizontal")]:i,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:i}}},"&-placement-topRight":{[c("arrow-offset-horizontal")]:`calc(100% - ${Re(i)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:i}}}}),...Da(!!f.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:l,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{[c("arrow-offset-horizontal")]:i,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:i}}},"&-placement-bottomRight":{[c("arrow-offset-horizontal")]:`calc(100% - ${Re(i)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:i}}}}),...Da(!!f.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:l},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:s},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:s}}),...Da(!!f.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:l},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:s},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:s}})}}};function Hy(e,t,r,n){if(n===!1)return{adjustX:!1,adjustY:!1};const o=n&&typeof n=="object"?n:{},s={};switch(e){case"top":case"bottom":s.shiftX=t.arrowOffsetHorizontal*2+r,s.shiftY=!0,s.adju
25stY=!0;break;case"left":case"right":s.shiftY=t.arrowOffsetVertical*2+r,s.shiftX=!0,s.adjustX=!0;break}const i={...s,...o};return i.shiftX||(i.adjustX=!0),i.shiftY||(i.adjustY=!0),i}const Lu={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},zy={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Ky=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function hp(e){const{arrowWidth:t,autoAdjustOverflow:r,arrowPointAtCenter:n,offset:o,borderRadius:s,visibleFirst:i}=e,a=t/2,c={},l=oc({contentRadius:s,limitVerticalRadius:!0});return Object.keys(Lu).forEach(f=>{const m={...n&&zy[f]||Lu[f],offset:[0,0],dynamicInset:!0};switch(c[f]=m,Ky.has(f)&&(m.autoArrow=!1),f){case"top":case"topLeft":case"topRight":m.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":m.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":m.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":m.offset[0]=a+o;break}if(n)switch(f){case"topLeft":case"bottomLeft":m.offset[0]=-l.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":m.offset[0]=l.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":m.offset[1]=-l.arrowOffsetHorizontal*2+a;break;case"leftBottom":case"rightBottom":m.offset[1]=l.arrowOffsetHorizontal*2-a;break}m.overflow=Hy(f,l,t,r),i&&(m.htmlRegion="visibleFirst")}),c}const Gy=(e,t)=>{const r=n=>typeof n=="boolean"?{show:n}:n||{};return xe.useMemo(()=>{const n=r(e),o=r(t);return{...o,...n,show:n.show??o.show??!0}},[e,t])},Mu="50%",qy=e=>{const{calc:t,componentCls:r,tooltipMaxWidth:n,tooltipColor:o,tooltipBg:s,tooltipBorderRadius:i,zIndexPopup:a,controlHeight:c,boxShadowSecondary:l,paddingSM:f,paddingXS:y,arrowOffsetHorizontal:m,sizePopupArrow:d,antCls:v}=e,[b,S]=kr(v,"tooltip"),u=t(i).add(d).add(m).equal(),x={minWidth:t(i).mul(2).add(d).equal(),minHeight:c,padding:`${Re(e.calc(f).div(2).equal())} ${Re(y)}`,color:S("overlay-color",o),textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:s,borderRadius:i,boxShadow:l,boxSizing:"border-box"},I={[b("valid-offset-x")]:S("arrow-offset-horizontal","var(--arrow-x)"),transformOrigin:[S("valid-offset-x",Mu),`var(--arrow-y, ${Mu})`].join(" ")};return[{[r]:{...Ot(e),position:"absolute",zIndex:a,display:"block",width:"max-content",maxWidth:n,visibility:"visible",...I,"&-hidden":{display:"none"},[b("arrow-background-color")]:s,[`${r}-container`]:[x,eg(e,!0)],[`&:has(~ ${r}-unique-container)`]:{[`${r}-container`]:{border:"none",background:"transparent",boxShadow:"none"}},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:u},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${r}-inner`]:{borderRadius:e.min(i,fp)}},[`${r}-content`]:{position:"relative"},...Uf(e,(N,{darkColor:E})=>({[`&${r}-${N}`]:{[`${r}-container`]:{backgroundColor:E},[`${r}-arrow`]:{[b("arrow-background-color")]:E}}})),"&-rtl":{direction:"rtl"}}},pp(e,S("arrow-background-color")),{[`${r}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}},{[`${r}-unique-container`]:{...x,...I,position:"absolute",zIndex:t(a).sub(1).equal(),"&-hidden":{display:"none"},"&-visible":{transition:`all ${e.motionDurationSlow}`}}}]},Wy=e=>({zIndexPopup:e.zIndexPopupBase+70,maxWidth:250,...oc({contentRadius:e.borderRadius,limitVerticalRadius:!0}),...dp(_t(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))}),mp=(e,t,r=!0)=>Ut("Tooltip",o=>{const{borderRadius:s,colorTextLightSolid:i,colorBgSpotlight:a,maxWidth:c}=o,l=_t(o,{tooltipMaxWidth:c,tooltipColor:i,tooltipBorderRadius:s,tooltipBg:a});return[qy(l),$l(o,"zoom-big-fast")]},Wy,{resetStyle:!1,injectStyle:r})(e,t),Yy=ao.map(e=>`${e}-inverse`),Xy=["success","processing","error","default","warning"];function gp(e,t=!0){return t?[].concat(Vt(Yy),Vt(ao)).includes(e):ao.includes(e)}function Qy(e){return Xy.includes(e)}const vp=(e,t,r)=>{const n=gp(r),[o]=kr(e,"tooltip"),s=ue({[`${t}-${r}`]:r&&n}),i={},a={},c=av(r).toRgb(),f=(.299*c.r+.587*c.g+.114*c.b)/255<.5?"#FFF":"#000";return r&&!n&&(i.background=r,i[o("overlay-color")]=f,a[o("arrow-background-color")]=r),{className:s,overlayStyle:i,arrowStyle:a}},Zy=e=>{const{prefixCls:t,className:r,placement:n="top",title:o,color:s,overlayInnerStyle:i,classNames:a,styles:c}=e,{getPrefixCls:l}=h.useContext(Rt),f=l("tooltip",t),y=l(),m=Qt(f),[d,v]=mp(f,m),b=vp(y,f,s),S=b.arrowStyle,u=h.useMemo(()=>({container:{...i,...b.overlayStyle}}),[i,b.overlayStyle]),C={...e,placement:n},[x,I]=kt([a],[u,c],{props:C}),N=ue(m,d,v,f,`${f}-pure`,`${f}-placement-${n}`,r,b.className);return h.createElement("div",{className:N,style:S},h.createElement("div",{className:`${f}-arrow`}),h.createElement(up,{...e,className:d,prefixCls:f,classNames:x,styles:I},o))},Jy=h.forwardRef((e,t)=>
25{const{prefixCls:r,openClassName:n,getTooltipContainer:o,color:s,children:i,afterOpenChange:a,arrow:c,destroyTooltipOnHide:l,destroyOnHidden:f,title:y,overlay:m,trigger:d,builtinPlacements:v,autoAdjustOverflow:b=!0,motion:S,getPopupContainer:u,placement:C="top",mouseEnterDelay:x=.1,mouseLeaveDelay:I=.1,rootClassName:N,styles:E,classNames:g,onOpenChange:p,overlayInnerStyle:T,overlayStyle:R,overlayClassName:B,...P}=e,[,D]=Mn(),{getPopupContainer:U,getPrefixCls:_,direction:V,className:z,style:q,classNames:G,styles:Y,arrow:ee,trigger:J}=Gt("tooltip"),te=Gy(c,ee),Q=te.show,Z=d||J||"hover",W=h.useRef(null),oe=()=>{W.current?.forceAlign()};h.useImperativeHandle(t,()=>({forceAlign:oe,nativeElement:W.current?.nativeElement,popupElement:W.current?.popupElement}));const[ie,A]=Xt(e.defaultOpen??!1,e.open),$=!y&&!m&&y!==0,O=ct=>{A($?!1:ct),!$&&p&&p(ct)},w=h.useMemo(()=>v||hp({arrowPointAtCenter:te?.pointAtCenter??!1,autoAdjustOverflow:b,arrowWidth:Q?D.sizePopupArrow:0,borderRadius:D.borderRadius,offset:D.marginXXS,visibleFirst:!0}),[te,v,D,Q,b]),M=h.useMemo(()=>y===0?y:m||y||"",[m,y]),H=h.createElement(na,{space:!0,form:!0},typeof M=="function"?M():M),F={...e,trigger:Z,color:s,placement:C,builtinPlacements:v,openClassName:n,arrow:c,autoAdjustOverflow:b,getPopupContainer:u,children:i,destroyTooltipOnHide:l,destroyOnHidden:f},[X,ce]=kt([G,g],[Y,E],{props:F}),ae=_("tooltip",r),re=_(),de=e["data-popover-inject"];let Ce=ie;!("open"in e)&&$&&(Ce=!1);const he=h.isValidElement(i)&&!tg(i)?i:h.createElement("span",null,i),ye=he.props,De=!ye.className||typeof ye.className=="string"?ue(ye.className,n||`${ae}-open`):ye.className,Fe=Qt(ae),[je,Le]=mp(ae,Fe,!de),_e=vp(re,ae,s),ze=_e.arrowStyle,Ue=ue(Fe,je,Le),be=ue(B,{[`${ae}-rtl`]:V==="rtl"},_e.className,N,Ue,z,X.root),[Se,Pe]=Mo("Tooltip",P.zIndex),$e={...ce.container,...T,..._e.overlayStyle},ke=h.createElement(Uy,{unique:!0,...P,trigger:Z,zIndex:Se,showArrow:Q,placement:C,mouseEnterDelay:x,mouseLeaveDelay:I,prefixCls:ae,classNames:{root:be,container:X.container,arrow:X.arrow,uniqueContainer:ue(Ue,X.container)},styles:{root:{...ze,...ce.root,...q,...R},container:$e,uniqueContainer:$e,arrow:ce.arrow},getTooltipContainer:u||o||U,ref:W,builtinPlacements:w,overlay:H,visible:Ce,onVisibleChange:O,afterVisibleChange:a,arrowContent:h.createElement("span",{className:`${ae}-arrow-content`}),motion:{motionName:ff(re,"zoom-big-fast",typeof S?.motionName=="string"?S?.motionName:void 0),motionDeadline:1e3},destroyOnHidden:f??!!l},Ce?$r(he,{className:De}):he);return h.createElement(pf.Provider,{value:Pe},ke)}),On=Jy;On._InternalPanelDoNotUseOrYouWillBeFired=Zy;On.UniqueProvider=rg;const{ESC:eb,TAB:tb}=Xe;function rb({visible:e,triggerRef:t,onVisibleChange:r,autoFocus:n,overlayRef:o}){const s=h.useRef(!1),i=()=>{e&&(t.current?.focus?.(),r?.(!1))},a=()=>o.current?.focus?(o.current.focus(),s.current=!0,!0):!1,c=l=>{switch(l.keyCode){case eb:i();break;case tb:{let f=!1;s.current||(f=a()),f?l.preventDefault():i();break}}};h.useEffect(()=>e?(window.addEventListener("keydown",c),n&&Et(a,3),()=>{window.removeEventListener("keydown",c),s.current=!1}):()=>{s.current=!1},[e])}const nb=h.forwardRef((e,t)=>{const{overlay:r,arrow:n,prefixCls:o}=e,s=h.useMemo(()=>{let a;return typeof r=="function"?a=r():a=r,a},[r]),i=Cr(t,ha(s));return xe.createElement(xe.Fragment,null,n&&xe.createElement("div",{className:`${o}-arrow`}),xe.cloneElement(s,{ref:Ol(s)?i:void 0}))}),vn={adjustX:1,adjustY:1},yn=[0,0],ab={topLeft:{points:["bl","tl"],overflow:vn,offset:[0,-4],targetOffset:yn},top:{points:["bc","tc"],overflow:vn,offset:[0,-4],targetOffset:yn},topRight:{points:["br","tr"],overflow:vn,offset:[0,-4],targetOffset:yn},bottomLeft:{points:["tl","bl"],overflow:vn,offset:[0,4],targetOffset:yn},bottom:{points:["tc","bc"],overflow:vn,offset:[0,4],targetOffset:yn},bottomRight:{points:["tr","br"],overflow:vn,offset:[0,4],targetOffset:yn}};function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ys.apply(this,arguments)}const ob=xe.forwardRef((e,t)=>
25{const{arrow:r=!1,prefixCls:n="rc-dropdown",transitionName:o,animation:s,align:i,placement:a="bottomLeft",placements:c=ab,getPopupContainer:l,showAction:f,hideAction:y,overlayClassName:m,overlayStyle:d,visible:v,trigger:b=["hover"],autoFocus:S,overlay:u,children:C,onVisibleChange:x,disabled:I,...N}=e,[E,g]=xe.useState(),p="visible"in e?v:E,T=s?`${n}-${s}`:o,R=xe.useRef(null),B=xe.useRef(null),P=xe.useRef(null);xe.useImperativeHandle(t,()=>R.current);const D=Q=>{g(Q),x?.(Q)};rb({visible:p,triggerRef:P,onVisibleChange:D,autoFocus:S,overlayRef:B});const U=Q=>{const{onOverlayClick:Z}=e;g(!1),Z&&Z(Q)},_=()=>xe.createElement(nb,{ref:B,overlay:u,prefixCls:n,arrow:r}),V=()=>typeof u=="function"?_:_(),z=()=>{const{minOverlayWidthMatchTrigger:Q,alignPoint:Z}=e;return"minOverlayWidthMatchTrigger"in e?Q:!Z},q=()=>{const{openClassName:Q}=e;return Q!==void 0?Q:`${n}-open`},G=C,Y=ue(G.props?.className,p&&q()),ee={className:Y,ref:Cr(P,ha(G))},J=Ol(G)?xe.cloneElement(G,ee):xe.createElement("span",{className:Y,ref:P},xe.cloneElement(G,{className:Y}));let te=y;return!te&&b.indexOf("contextMenu")!==-1&&(te=["click"]),xe.createElement(jo,Ys({builtinPlacements:c},N,{prefixCls:n,ref:R,popupClassName:ue(m,{[`${n}-show-arrow`]:r}),popupStyle:d,action:b,showAction:f,hideAction:te,popupPlacement:a,popupAlign:i,popupMotion:{motionName:T},popupVisible:p,stretch:z()?"minWidth":"",popup:V(),onOpenChange:D,onPopupClick:U,getPopupContainer:l}),J)}),ib=e=>typeof e!="object"&&typeof e!="function"||e===null,yp=h.createContext(null);function bp(e,t){return`${e}-${t}`}function Cp(e){const t=h.useContext(yp);return bp(t,e)}const br=h.createContext(null);function sb(e,t){const r={...e};return Object.keys(t).forEach(n=>{const o=t[n];o!==void 0&&(r[n]=o)}),r}function la({children:e,locked:t,...r}){const n=h.useContext(br),o=cf(()=>sb(n,r),[n,r],(s,i)=>!t&&(s[0]!==i[0]||!hf(s[1],i[1],!0)));return h.createElement(br.Provider,{value:o},e)}const lb=[],xp=h.createContext(null);function zo(){return h.useContext(xp)}const Sp=h.createContext(lb);function _n(e){const t=h.useContext(Sp);return h.useMemo(()=>e!==void 0?[...t,e]:t,[t,e])}const Ep=h.createContext(null),ic=h.createContext({}),{LEFT:Xs,RIGHT:Qs,UP:Zs,DOWN:Xa,ENTER:Qa,ESC:wp,HOME:jn,END:Hn}=Xe,Du=[Zs,Xa,Xs,Qs];function cb(e,t,r,n){const o="prev",s="next",i="children",a="parent";if(e==="inline"&&n===Qa)return{inlineTrigger:!0};const c={[Zs]:o,[Xa]:s},l={[Xs]:r?s:o,[Qs]:r?o:s,[Xa]:i,[Qa]:i},f={[Zs]:o,[Xa]:s,[Qa]:i,[wp]:a,[Xs]:r?i:a,[Qs]:r?a:i};switch({inline:c,horizontal:l,vertical:f,inlineSub:c,horizontalSub:f,verticalSub:f}[`${e}${t?"":"Sub"}`]?.[n]){case o:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case a:return{offset:-1,sibling:!1};case i:return{offset:1,sibling:!1};default:return null}}function ub(e){let t=e;for(;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function db(e,t){let r=e||document.activeElement;for(;r;){if(t.has(r))return r;r=r.parentElement}return null}function sc(e,t){return ng(e,!0).filter(n=>t.has(n))}function $u(e,t,r,n=1){if(!e)return null;const o=sc(e,t),s=o.length;let i=o.findIndex(a=>r===a);return n<0?i===-1?i=s-1:i-=1:n>0&&(i+=1),i=(i+s)%s,o[i]}const uo=(e,t)=>{const r=new Set,n=new Map,o=new Map;return e.forEach(s=>{const i=document.querySelector(`[data-menu-id='${bp(t,s)}']`);i&&(r.add(i),o.set(i,s),n.set(s,i))}),{elements:r,key2element:n,element2key:o}};function fb(e,t,r,n,o,s,i,a,c,l){const f=h.useRef(),y=h.useRef();y.current=t;const m=()=>{Et.cancel(f.current)};return h.useEffect(()=>()=>{m()},[]),d=>{const{which:v}=d;if([...Du,Qa,wp,jn,Hn].includes(v)){const b=s();let S=uo(b,n);const{elements:u,key2element:C,element2key:x}=S,I=C.get(t),N=db(I,u),E=x.get(N),g=cb(e,i(E,!0).length===1,r,v);if(!g&&v!==jn&&v!==Hn)return;(Du.includes(v)||[jn,Hn].includes(v))&&d.preventDefault();const p=T=>{if(T){let R=T;const B=T.querySelector("a");B?.getAttribute("href")&&(R=B);const P=x.get(T);a(P),m(),f.current=Et(()=>{y.current===P&&R.focus()})}};if([jn,Hn].includes(v)||g.sibling||!N){let T;!N||e==="inline"?T=o.current:T=ub(N);let R;const B=sc(T,u);v===jn?R=B[0]:v===Hn?R=B[B.length-1]:R=$u(T,u,N,g.offset),p(R)}else if(g.inlineTrigger)c(E);else if(g.offset>0)c(E,!0),m(),f.current=Et(()=>{S=uo(b,n);const T=N.getAttribute("aria-controls"),R=document.getElementById(T),B=$u(R,S.elements);p(B)},5);else if(g.offset<0){const T=i(E,!0),R=T[T.length-2],B=C.get(R);c(R,!1),p(B)}}l?.(d)}}function pb(e){Promise.resolve().then(e)}const lc="__RC_UTIL_PATH_SPLIT__",Ou=e=>e.join(lc),hb=e=>e.split(lc),Js="rc-menu-more";function mb(){const[,e]=h.useState({}),t=h.useRef(new Map),r=h.useRef(new Map),[n,o]=h.useState([]),s=h.useRef(0),i=h.useRef(!1),a=()=>{i.current||e({})},c=h.useCallback((b,S)=>{const u=Ou(S);r.current.set(u,b),t.current.set(b,u),s.current+=1;const C=s.current;pb(()=>{C===s.current&&a()})},[]),l=h.useCallback((b,S)=>{const u=Ou(S);r.current.delete(u),t.current.delete(b)},[]),f=h.useCallback(b=>{o(b)},[]),y=h.useCallback((b,S)=>{const u=t.current.get(b)||"",C=hb(u);return S&&n.includes(C[0])&&C.unshift(Js),C},[n]),m=h.useCallback((b,S)=>b.filter(u=>u!==void 0).some(u=>y(u,!0).includes(S)),[y]),d=()=>{const b=[...t.current.keys()];return n.length&&b.push(Js),b},v=h.useCallback(b=>{const S=`${t.current.get(b)}${lc}`,u=new Set;
25return[...r.current.keys()].forEach(C=>{C.startsWith(S)&&u.add(r.current.get(C))}),u},[]);return h.useEffect(()=>()=>{i.current=!0},[]),{registerPath:c,unregisterPath:l,refreshOverflowKeys:f,isSubPathKey:m,getKeyPath:y,getKeys:d,getSubPathKeys:v}}function Xn(e){const t=h.useRef(e);t.current=e;const r=h.useCallback((...n)=>t.current?.(...n),[]);return e?r:void 0}function Ip(e,t,r,n){const{activeKey:o,onActive:s,onInactive:i}=h.useContext(br),a={active:o===e};return t||(a.onMouseEnter=c=>{r?.({key:e,domEvent:c}),s(e)},a.onMouseLeave=c=>{n?.({key:e,domEvent:c}),i(e)}),a}function Tp(e){const{mode:t,rtl:r,inlineIndent:n}=h.useContext(br);if(t!=="inline")return null;const o=e;return r?{paddingRight:o*n}:{paddingLeft:o*n}}function Ap({icon:e,props:t,children:r}){let n;return e===null||e===!1?null:(typeof e=="function"?n=h.createElement(e,{...t}):typeof e!="boolean"&&(n=e),n||r||null)}function fo({item:e,...t}){return Object.defineProperty(t,"item",{get:()=>(Ml(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),e)}),t}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ca.apply(this,arguments)}class gb extends h.Component{render(){const{title:t,attribute:r,elementRef:n,...o}=this.props,s=Tt(o,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Ml(!r,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),h.createElement(Lr.Item,ca({},r,{title:typeof t=="string"?t:void 0},s,{ref:n}))}}const vb=h.forwardRef((e,t)=>{const{style:r,className:n,eventKey:o,warnKey:s,disabled:i,itemIcon:a,children:c,role:l,onMouseEnter:f,onMouseLeave:y,onClick:m,onKeyDown:d,onFocus:v,...b}=e,S=Cp(o),{prefixCls:u,onItemClick:C,disabled:x,overflowDisabled:I,itemIcon:N,selectedKeys:E,onActive:g}=h.useContext(br),{_internalRenderMenuItem:p}=h.useContext(ic),T=`${u}-item`,R=h.useRef(),B=h.useRef(),P=x||i,D=Ll(t,B),U=_n(o),_=W=>({key:o,keyPath:[...U].reverse(),item:R.current,domEvent:W}),V=a||N,{active:z,...q}=Ip(o,P,f,y),G=E.includes(o),Y=Tp(U.length),ee=W=>{if(P)return;const oe=_(W);m?.(fo(oe)),C(oe)},J=W=>{if(d?.(W),W.which===Xe.ENTER){const oe=_(W);m?.(fo(oe)),C(oe)}},te=W=>{g(o),v?.(W)},Q={};e.role==="option"&&(Q["aria-selected"]=G);let Z=h.createElement(gb,ca({ref:R,elementRef:D,role:l===null?"none":l||"menuitem",tabIndex:i?null:-1,"data-menu-id":I&&S?null:S},Tt(b,["extra"]),q,Q,{component:"li","aria-disabled":i,style:{...Y,...r},className:ue(T,{[`${T}-active`]:z,[`${T}-selected`]:G,[`${T}-disabled`]:P},n),onClick:ee,onKeyDown:J,onFocus:te}),c,h.createElement(Ap,{props:{...e,isSelected:G},icon:V}));return p&&(Z=p(Z,e,{selected:G})),Z});function yb(e,t){const{eventKey:r}=e,n=zo(),o=_n(r);return h.useEffect(()=>{if(n)return n.registerPath(r,o),()=>{n.unregisterPath(r,o)}},[o]),n?null:h.createElement(vb,ca({},e,{ref:t}))}const Ko=h.forwardRef(yb);function el(){return el=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},el.apply(this,arguments)}const bb=({className:e,children:t,...r},n)=>{const{prefixCls:o,mode:s,rtl:i}=h.useContext(br);return h.createElement("ul",el({className:ue(o,i&&`${o}-rtl`,`${o}-sub`,`${o}-${s==="inline"?"inline":"vertical"}`,e),role:"menu"},r,{"data-menu-list":!0,ref:n}),t)},Np=h.forwardRef(bb);function cc(e,t){return Ln(e).map((r,n)=>{if(h.isValidElement(r)){const{key:o}=r;let s=r.props?.eventKey??o;s==null&&(s=`tmp_key-${[...t,n].join("-")}`);const a={key:s,eventKey:s};return h.cloneElement(r,a)}return r})}const Ht={adjustX:1,adjustY:1},Cb={topLeft:{points:["bl","tl"],overflow:Ht},topRight:{points:["br","tr"],overflow:Ht},bottomLeft:{points:["tl","bl"],overflow:Ht},bottomRight:{points:["tr","br"],overflow:Ht},leftTop:{points:["tr","tl"],overflow:Ht},leftBottom:{points:["br","bl"],overflow:Ht},rightTop:{points:["tl","tr"],overflow:Ht},rightBottom:{points:["bl","br"],overflow:Ht}},xb={topLeft:{points:["bl","tl"],overflow:Ht},topRight:{points:["br","tr"],overflow:Ht},bottomLeft:{points:["tl","bl"],overflow:Ht},bottomRight:{points:["tr","br"],overflow:Ht},rightTop:{points:["tr","tl"],overflow:Ht},rightBottom:{points:["br","bl"],overflow:Ht},leftTop:{points:["tl","tr"],overflow:Ht},leftBottom:{points:["bl","br"],overflow:Ht}};function Rp(e,t,r){if(t)return t;if(r)return r[e]||r.other}const Sb={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"r
25ightTop","vertical-right":"leftTop"};function Eb({prefixCls:e,visible:t,children:r,popup:n,popupStyle:o,popupClassName:s,popupOffset:i,disabled:a,mode:c,onVisibleChange:l}){const{getPopupContainer:f,rtl:y,subMenuOpenDelay:m,subMenuCloseDelay:d,builtinPlacements:v,triggerSubMenuAction:b,forceSubMenuRender:S,rootClassName:u,motion:C,defaultMotions:x}=h.useContext(br),[I,N]=h.useState(!1),E=y?{...xb,...v}:{...Cb,...v},g=Sb[c],p=Rp(c,C,x),T=h.useRef(p);c!=="inline"&&(T.current=p);const R={...T.current,leavedClassName:`${e}-hidden`,removeOnLeave:!1,motionAppear:!0},B=h.useRef();return h.useEffect(()=>(B.current=Et(()=>{N(t)}),()=>{Et.cancel(B.current)}),[t]),h.createElement(jo,{prefixCls:e,popupClassName:ue(`${e}-popup`,{[`${e}-rtl`]:y},s,u),stretch:c==="horizontal"?"minWidth":null,getPopupContainer:f,builtinPlacements:E,popupPlacement:g,popupVisible:I,popup:n,popupStyle:o,popupAlign:i&&{offset:i},action:a?[]:[b],mouseEnterDelay:m,mouseLeaveDelay:d,onPopupVisibleChange:l,forceRender:S,popupMotion:R,fresh:!0},r)}function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tl.apply(this,arguments)}function wb({id:e,open:t,keyPath:r,children:n}){const o="inline",{prefixCls:s,forceSubMenuRender:i,motion:a,defaultMotions:c,mode:l}=h.useContext(br),f=h.useRef(!1);f.current=l===o;const[y,m]=h.useState(!f.current),d=f.current?t:!1;h.useEffect(()=>{f.current&&m(!1)},[l]);const v={...Rp(o,a,c)};r.length>1&&(v.motionAppear=!1);const b=v.onVisibleChanged;return v.onVisibleChanged=S=>(!f.current&&!S&&m(!0),b?.(S)),y?null:h.createElement(la,{mode:o,locked:!f.current},h.createElement(Pl,tl({visible:d},v,{forceRender:i,removeOnLeave:!1,leavedClassName:`${s}-hidden`}),({className:S,style:u})=>h.createElement(Np,{id:e,className:S,style:u},n)))}function ua(){return ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ua.apply(this,arguments)}const Ib=h.forwardRef((e,t)=>{const{style:r,className:n,styles:o,classNames:s,title:i,eventKey:a,warnKey:c,disabled:l,internalPopupClose:f,children:y,itemIcon:m,expandIcon:d,popupClassName:v,popupOffset:b,popupStyle:S,onClick:u,onMouseEnter:C,onMouseLeave:x,onTitleClick:I,onTitleMouseEnter:N,onTitleMouseLeave:E,popupRender:g,...p}=e,T=Cp(a),{prefixCls:R,mode:B,openKeys:P,disabled:D,overflowDisabled:U,activeKey:_,selectedKeys:V,itemIcon:z,expandIcon:q,onItemClick:G,onOpenChange:Y,onActive:ee,popupRender:J}=h.useContext(br),{_internalRenderSubMenuItem:te}=h.useContext(ic),{isSubPathKey:Q}=h.useContext(Ep),Z=_n(),W=`${R}-submenu`,oe=D||l,ie=h.useRef(),A=h.useRef(),$=m??z,O=d??q,w=P.includes(a),M=!U&&w,H=Q(V,a),{active:F,...X}=Ip(a,oe,N,E),[ce,ae]=h.useState(!1),re=ke=>{oe||ae(ke)},de=ke=>{re(!0),C?.({key:a,domEvent:ke})},Ce=ke=>{re(!1),x?.({key:a,domEvent:ke})},he=h.useMemo(()=>F||(B!=="inline"?ce||Q([_],a):!1),[B,F,_,ce,a,Q]),ye=Tp(Z.length),De=ke=>{oe||(I?.({key:a,domEvent:ke}),B==="inline"&&Y(a,!w))},Fe=Xn(ke=>{u?.(fo(ke)),G(ke)}),je=ke=>{B!=="inline"&&Y(a,ke)},Le=()=>{ee(a)},_e=T&&`${T}-popup`,ze=h.useMemo(()=>h.createElement(Ap,{icon:B!=="horizontal"?O:void 0,props:{...e,isOpen:M,isSubMenu:!0}},h.createElement("i",{className:`${W}-arrow`})),[B,O,e,M,W]);let Ue=h.createElement("div",ua({role:"menuitem",style:ye,className:`${W}-title`,tabIndex:oe?null:-1,ref:ie,title:typeof i=="string"?i:null,"data-menu-id":U&&T?null:T,"aria-expanded":M,"aria-haspopup":!0,"aria-controls":_e,"aria-disabled":oe,onClick:De,onFocus:Le},X),i,ze);const be=h.useRef(B);B!=="inline"&&Z.length>1?be.current="vertical":be.current=B;const Se=be.current,Pe=h.useMemo(()=>{const ke=h.createElement(la,{classNames:s,styles:o,mode:Se==="horizontal"?"vertical":Se},h.createElement(Np,{id:_e,ref:A},y)),ct=g||J;return ct?ct(ke,{item:e,keys:Z}):ke},[g,J,Z,_e,y,e,Se]);if(!U){const ke=be.current;Ue=h.createElement(Eb,{mode:ke,prefixCls:W,visible:!f&&M&&B!=="inline",popupClassName:v,popupOffset:b,popupStyle:S,popup:Pe,disabled:oe,onVisibleChange:je},Ue)}let $e=h.createElement(Lr.Item,ua({ref:t,role:"none"},p,{component:"li",style:r,className:ue(W,`${W}-${B}`,n,{[`${W}-open`]:M,[`${W}-active`]:he,[`${W}-selected`]:H,[`${W}-disabled`]:oe}),onMouseEnter:de,onMouseLeave:Ce}),Ue,!U&&h.createElement(wb,{id:_e,open:M,keyPath:Z},y));return te&&($e=te($e,e,{selected:H,active:he,open:M,disabled:oe})),h.createElement(la,{classNames:s,styles:o,onItemClick:Fe,mode:B==="horizontal"?"vertical":B,itemIcon:$,expandIcon:O},$e)}),Go=h.forwardRef((e,t)=>
25{const{eventKey:r,children:n}=e,o=_n(r),s=cc(n,o),i=zo();h.useEffect(()=>{if(i)return i.registerPath(r,o),()=>{i.unregisterPath(r,o)}},[o]);let a;return i?a=s:a=h.createElement(Ib,ua({ref:t},e),s),h.createElement(Sp.Provider,{value:o},a)});function uc({className:e,style:t}){const{prefixCls:r}=h.useContext(br);return zo()?null:h.createElement("li",{role:"separator",className:ue(`${r}-item-divider`,e),style:t})}function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po.apply(this,arguments)}const Tb=h.forwardRef((e,t)=>{const{className:r,title:n,eventKey:o,children:s,...i}=e,{prefixCls:a,classNames:c,styles:l}=h.useContext(br),f=`${a}-item-group`;return h.createElement("li",po({ref:t,role:"presentation"},i,{onClick:y=>y.stopPropagation(),className:ue(f,r)}),h.createElement("div",{role:"presentation",className:ue(`${f}-title`,c?.listTitle),style:l?.listTitle,title:typeof n=="string"?n:void 0},n),h.createElement("ul",{role:"group",className:ue(`${f}-list`,c?.list),style:l?.list},s))}),dc=h.forwardRef((e,t)=>{const{eventKey:r,children:n}=e,o=_n(r),s=cc(n,o);return zo()?s:h.createElement(Tb,po({ref:t},Tt(e,["warnKey"])),s)});function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cn.apply(this,arguments)}function rl(e,t,r){const{item:n,group:o,submenu:s,divider:i}=t;return(e||[]).map((a,c)=>{if(a&&typeof a=="object"){const{label:l,children:f,key:y,type:m,extra:d,...v}=a,b=y??`tmp-${c}`;return f||m==="group"?m==="group"?h.createElement(o,Cn({key:b},v,{title:l}),rl(f,t,r)):h.createElement(s,Cn({key:b},v,{title:l}),rl(f,t,r)):m==="divider"?h.createElement(i,Cn({key:b},v)):h.createElement(n,Cn({key:b},v,{extra:d}),l,(!!d||d===0)&&h.createElement("span",{className:`${r}-item-extra`},d))}return null}).filter(a=>a)}function _u(e,t,r,n,o){let s=e;const i={divider:uc,item:Ko,group:dc,submenu:Go,...n};return t&&(s=rl(t,i,o)),cc(s,r)}function nl(){return nl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nl.apply(this,arguments)}const Xr=[],Ab=h.forwardRef((e,t)=>{const{prefixCls:r="rc-menu",rootClassName:n,style:o,className:s,styles:i,classNames:a,tabIndex:c=0,items:l,children:f,direction:y,id:m,mode:d="vertical",inlineCollapsed:v,disabled:b,disabledOverflow:S,subMenuOpenDelay:u=.1,subMenuCloseDelay:C=.1,forceSubMenuRender:x,defaultOpenKeys:I,openKeys:N,activeKey:E,defaultActiveFirst:g,selectable:p=!0,multiple:T=!1,defaultSelectedKeys:R,selectedKeys:B,onSelect:P,onDeselect:D,inlineIndent:U=24,motion:_,defaultMotions:V,triggerSubMenuAction:z="hover",builtinPlacements:q,itemIcon:G,expandIcon:Y,overflowedIndicator:ee="...",overflowedIndicatorPopupClassName:J,getPopupContainer:te,onClick:Q,onOpenChange:Z,onKeyDown:W,openAnimation:oe,openTransitionName:ie,_internalRenderMenuItem:A,_internalRenderSubMenuItem:$,_internalComponents:O,popupRender:w,...M}=e,[H,F]=h.useMemo(()=>[_u(f,l,Xr,O,r),_u(f,l,Xr,{},r)],[f,l,O]),[X,ce]=h.useState(!1),ae=h.useRef(),re=pa(m?`rc-menu-uuid-${m}`:"rc-menu-uuid"),de=y==="rtl",[Ce,he]=Xt(I,N),ye=Ce||Xr,De=(Ge,we=!1)=>{function Ve(){he(Ge),Z?.(Ge)}we?ra.flushSync(Ve):Ve()},[Fe,je]=h.useState(ye),Le=h.useRef(!1),[_e,ze]=h.useMemo(()=>(d==="inline"||d==="vertical")&&v?["vertical",v]:[d,!1],[d,v]),Ue=_e==="inline",[be,Se]=h.useState(_e),[Pe,$e]=h.useState(ze);h.useEffect(()=>{Se(_e),$e(ze),Le.current&&(Ue?he(Fe):De(Xr))},[_e,ze]);const[ke,ct]=h.useState(0),at=ke>=H.length-1||be!=="horizontal"||S;h.useEffect(()=>{Ue&&je(ye)},[ye]),h.useEffect(()=>(Le.current=!0,()=>{Le.current=!1}),[]);const{registerPath:ft,unregisterPath:yt,refreshOverflowKeys:ot,isSubPathKey:gt,getKeyPath:bt,getKeys:xt,getSubPathKeys:It}=mb(),ut=h.useMemo(()=>({registerPath:ft,unregisterPath:yt}),[ft,yt]),tt=h.useMemo(()=>({isSubPathKey:gt}),[gt]);h.useEffect(()=>{ot(at?Xr:H.slice(ke+1).map(Ge=>Ge.key))},[ke,at]);const[We,it]=Xt(E||g&&H[0]?.key,E),Ee=Xn(Ge=>{it(Ge)}),Ie=Xn(()=>{it(void 0)});h.useImperativeHandle(t,()=>({list:ae.current,focus:Ge=>{const we=xt(),{elements:Ve,key2element:dt,element2key:Ct}=uo(we,re),St=sc(ae.current,Ve);let Bt;We&&we.includes(We)?Bt=We:Bt=St[0]?Ct.get(St[0]):H.find(ir=>!ir.props.disabled)?.key;const At=dt.get(Bt);Bt&&At&&At?.focus?.(Ge)},findItem:({key:Ge})=>{const we=xt(),{key2element:Ve}=uo(we,re);return Ve.get(Ge)||null}}));const[Oe,ve]=Xt(R||[],B),Te=h.useMemo(()=>Array.isArray(Oe)?Oe:Oe==null?Xr:[Oe],[Oe]),se=Ge=>{if(p){const{key:we}=Ge,Ve=Te.includes(we);let dt;T?Ve?dt=Te.filter(St=>St!==we):dt=[...Te,we]:dt=[we],ve(dt);const Ct={...Ge,selectedKeys:dt};Ve?D?.(Ct):P?.(Ct)}!T&&ye.length&&be!=="inline"&&De(Xr)},fe=Xn(Ge=>{Q?.(fo(Ge)),se(Ge)}),Ae=Xn((Ge,we)=>{let Ve=ye.filter(dt=>dt!==Ge);if(we)Ve.push(Ge);else if(be!=="inline"){const dt=It(Ge);Ve=Ve.filter(Ct=>!dt.has(Ct))}hf(ye,Ve,!0)||De(Ve,!0)}),Ye=fb(be,We,de,re,ae,xt,bt,it,(Ge,we)=>{const Ve=we??!ye.includes(Ge);Ae(Ge,Ve)},W);h.useEffect(()=>{ce(!0)},[]);const Je=h.useMemo(()=>({_internalRenderMenuItem:A,_internalRenderSubMenuItem:$}),[A,$]),st=be!=="horizontal"||S?H:H.map((Ge,we)=>h.createElement(la,{key:Ge.key,overflowDisabled:we>ke,classNames:a,styles:i}
25,Ge)),Pt=h.createElement(Lr,nl({id:m,ref:ae,prefixCls:`${r}-overflow`,component:"ul",itemComponent:Ko,className:ue(r,`${r}-root`,`${r}-${be}`,s,{[`${r}-inline-collapsed`]:Pe,[`${r}-rtl`]:de},n),dir:y,style:o,role:"menu",tabIndex:c,data:st,renderRawItem:Ge=>Ge,renderRawRest:Ge=>{const we=Ge.length,Ve=we?H.slice(-we):null;return h.createElement(Go,{eventKey:Js,title:ee,disabled:at,internalPopupClose:we===0,popupClassName:J},Ve)},maxCount:be!=="horizontal"||S?Lr.INVALIDATE:Lr.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:Ge=>{ct(Ge)},onKeyDown:Ye},M));return h.createElement(ic.Provider,{value:Je},h.createElement(yp.Provider,{value:re},h.createElement(la,{prefixCls:r,rootClassName:n,classNames:a,styles:i,mode:be,openKeys:ye,rtl:de,disabled:b,motion:X?_:null,defaultMotions:X?V:null,activeKey:We,onActive:Ee,onInactive:Ie,selectedKeys:Te,inlineIndent:U,subMenuOpenDelay:u,subMenuCloseDelay:C,forceSubMenuRender:x,builtinPlacements:q,triggerSubMenuAction:z,getPopupContainer:te,itemIcon:G,expandIcon:Y,onItemClick:fe,onOpenChange:Ae,popupRender:w},h.createElement(Ep.Provider,{value:tt},Pt),h.createElement("div",{style:{display:"none"},"aria-hidden":!0},h.createElement(xp.Provider,{value:ut},F)))))}),Ca=Ab;Ca.Item=Ko;Ca.SubMenu=Go;Ca.ItemGroup=dc;Ca.Divider=uc;const Pp=h.createContext({});var Nb={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},al.apply(this,arguments)}const Rb=(e,t)=>h.createElement(Ar,al({},e,{ref:t,icon:Nb})),Bp=h.forwardRef(Rb),ho=h.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1,styles:null,classNames:null}),Lp=e=>{const{prefixCls:t,className:r,dashed:n,...o}=e,{getPrefixCls:s}=h.useContext(Rt),i=s("menu",t),a=ue({[`${i}-item-divider-dashed`]:!!n},r);return h.createElement(uc,{className:a,...o})},Mp=e=>{const{className:t,children:r,icon:n,title:o,danger:s,extra:i}=e,{prefixCls:a,firstLevel:c,direction:l,disableMenuItemTitleTooltip:f,inlineCollapsed:y,styles:m,classNames:d}=h.useContext(ho),v=I=>{const N=r?.[0],E=h.createElement("span",{className:ue(`${a}-title-content`,c?d?.itemContent:d?.subMenu?.itemContent,{[`${a}-title-content-with-extra`]:!!i||i===0}),style:c?m?.itemContent:m?.subMenu?.itemContent},r);return(!n||h.isValidElement(r)&&r.type==="span")&&r&&I&&c&&typeof N=="string"?h.createElement("div",{className:`${a}-inline-collapsed-noicon`},N.charAt(0)):E},{siderCollapsed:b}=h.useContext(Pp);let S=o;typeof o>"u"?S=c?r:"":o===!1&&(S="");const u={title:S};!b&&!y&&(u.title=null,u.open=!1);const C=Ln(r).length;let x=h.createElement(Ko,{...Tt(e,["title","icon","danger"]),className:ue(c?d?.item:d?.subMenu?.item,{[`${a}-item-danger`]:s,[`${a}-item-only-child`]:(n?C+1:C)===1},t),style:{...c?m?.item:m?.subMenu?.item,...e.style},title:typeof o=="string"?o:void 0},$r(n,I=>({className:ue(`${a}-item-icon`,c?d?.itemIcon:d?.subMenu?.itemIcon,I.className),style:{...c?m?.itemIcon:m?.subMenu?.itemIcon,...I.style}})),v(y));return f||(x=h.createElement(On,{...u,placement:l==="rtl"?"left":"right",classNames:{root:`${a}-inline-collapsed-tooltip`}},x)),x},mo=h.createContext(null),Pb=h.forwardRef((e,t)=>{const{children:r,...n}=e,o=h.useContext(mo),s=h.useMemo(()=>({...o,...n}),[o,n.prefixCls,n.mode,n.selectable,n.rootClassName]),i=ag(r),a=Ll(t,i?ha(r):null);return h.createElement(mo.Provider,{value:s},h.createElement(na,{space:!0},i?h.cloneElement(r,{ref:a}):r))}),Bb=e=>{const{componentCls:t,motionDurationSlow:r,horizontalLineHeight:n,colorSplit:o,lineWidth:s,lineType:i,itemPaddingInline:a}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${Re(s)} ${i} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:a},[`> ${t}-item:hover, 26 > ${t}-item-active, 27 > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${r}`,`background-color ${r}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},Lb=({componentCls:e,menuArrowOffset:t,calc:r})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical, 28 ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Re(r(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Re(t)})`}}}}),ku=e=>Do(e),Vu=(e,t)=>{const{componentCls:r,itemColor:n,itemSelectedColor:o,subMenuItemSelectedColor:s,groupTitleColor:i,itemBg:a,subMenuItemBg:c,itemSelectedBg:l,activeBarHeight:f,activeBarWidth:y,activeBarBorderWidth:m,motionDurationSlow:d,motionEaseInOut:v,motionEaseOut:b,itemPaddingInline:S,motionDurationMid:u,itemHoverColor:C,lineType:x,colorSplit:I,itemDisabledColor:N,dangerItemColor:E,dangerItemHoverColor:g,dangerItemSelectedColor:p,dangerItemActiveBg:T,dangerItemSelectedBg:R,popupBg:B,itemHoverBg:P,itemActiveBg:D,menuSubMenuBg:U,horizontalItemSelectedColor:_,horizontalItemSelectedBg:V,horizontalItemBorderRadius:z,horizontalItemHoverBg:q}=e;return{[`${r}-${t}, ${r}-${t} > ${r}`]:{color:n,background:a,[`&${r}-root:focus-visible`]:{...ku(e)},[`${r}-item`]:{"&-group-title, &-extra":{color:i}},[`${r}-submenu-selected > ${r}-submenu-title`]:{color:s},[`${r}-item, ${r}-submenu-title`]:{color:n,[`&:not(${r}-item-disabled):focus-visible`]:{...ku(e)}},[`${r}-item-disabled, ${r}-submenu-disabled`]:{color:`${N} !important`},[`${r}-item:not(${r}-item-selected):not(${r}-submenu-selected)`]:{[`&:hover, > ${r}-submenu-title:hover`]:{color:C}},[`&:not(${r}-horizontal)`]:{[`${r}-item:not(${r}-item-selected)`]:{"&:hover":{backgroundColor:P},"&:active":{backgroundColor:D}},[`${r}-submenu-title`]:{"&:hover":{backgroundColor:P},"&:active":{backgroundColor:D}}},[`${r}-item-danger`]:{color:E,[`&${r}-item:hover`]:{[`&:not(${r}-item-selected):not(${r}-submenu-selected)`]:{color:g}},[`&${r}-item:active`]:{background:T}},[`${r}-item a`]:{"&, &:hover":{color:"inherit"}},[`${r}-item-selected`]:{color:o,[`&${r}-item-danger`]:{color:p},"a, a:hover":{color:"inherit"}},[`& ${r}-item-selected`]:{backgroundColor:l,[`&${r}-item-danger`]:{backgroundColor:R}},[`&${r}-submenu > ${r}`]:{backgroundColor:U},[`&${r}-popup > ${r}`]:{backgroundColor:B},[`&${r}-submenu-popup > ${r}`]:{backgroundColor:B},[`&${r}-horizontal`]:{...t==="dark"?{borderBottom:0}:{},[`> ${r}-item, > ${r}-submenu`]:{top:m,marginTop:e.calc(m).mul(-1).equal(),marginBottom:0,borderRadius:z,"&::after":{position:"absolute",insetInline:S,bottom:0,borderBottom:`${Re(f)} solid transparent`,transition:`border-color ${d} ${v}`,content:'""'},"&:hover, &-active, &-open":{background:q,"&::after":{borderBottomWidth:f,borderBottomColor:_}},"&-selected":{color:_,backgroundColor:V,"&:hover":{backgroundColor:V},"&::after":{borderBottomWidth:f,borderBottomColor:_}}}},[`&${r}-root`]:{[`&${r}-inline, &${r}-vertical`]:{borderInlineEnd:`${Re(m)} ${x} ${I}`}}
vendor: 13,301 bytes, lines 28-37
28,[`&${r}-inline`]:{[`${r}-sub${r}-inline`]:{background:c},[`${r}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Re(y)} solid ${o}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${u} ${b}`,`opacity ${u} ${b}`].join(","),content:'""'},[`&${r}-item-danger`]:{"&::after":{borderInlineEndColor:p}}},[`${r}-selected, ${r}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${u} ${v}`,`opacity ${u} ${v}`].join(",")}}}}}},Fu=e=>{const{componentCls:t,itemHeight:r,itemMarginInline:n,padding:o,menuArrowSize:s,marginXS:i,itemMarginBlock:a,itemWidth:c,itemPaddingInline:l}=e,f=e.calc(s).add(o).add(i).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:r,lineHeight:Re(r),paddingInline:l,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:a,width:c},[`> ${t}-item, 29 > ${t}-submenu > ${t}-submenu-title`]:{height:r,lineHeight:Re(r)},[`${t}-item-group-list ${t}-submenu-title, 30 ${t}-submenu-title`]:{paddingInlineEnd:f}}},Mb=e=>{const{componentCls:t,iconCls:r,itemHeight:n,colorTextLightSolid:o,dropdownWidth:s,controlHeightLG:i,motionEaseOut:a,paddingXL:c,itemMarginInline:l,fontSizeLG:f,motionDurationFast:y,motionDurationSlow:m,paddingXS:d,boxShadowSecondary:v,collapsedWidth:b,collapsedIconSize:S}=e,u={height:n,lineHeight:Re(n),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":{[`&${t}-root`]:{boxShadow:"none"},...Fu(e)}},[`${t}-submenu-popup`]:{[`${t}-vertical`]:{...Fu(e),boxShadow:v}}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:s,maxHeight:`calc(100vh - ${Re(e.calc(i).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${t}-inline`]:{width:"100%",[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${m}`,`background-color ${m}`,`padding ${y} ${a}`].join(","),[`> ${t}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${t}-submenu > ${t}-submenu-title`]:u,[`& ${t}-item-group-title`]:{paddingInlineStart:c}},[`${t}-item`]:u}},{[`${t}-inline-collapsed`]:{width:b,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:f,textAlign:"center"}}},[`> ${t}-item, 31 > ${t}-item-group > ${t}-item-group-list > ${t}-item, 32 > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title, 33 > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Re(e.calc(S).div(2).equal())} - ${Re(l)})`,textOverflow:"clip",[` 34 ${t}-submenu-arrow, 35 ${t}-submenu-expand-icon 36 `]:{opacity:0},[`${t}-item-icon, ${r}`]:{margin:0,fontSize:S,lineHeight:Re(n),"+ span":{display:"inline-block",opacity:0}}},[`${t}-item-icon, ${r}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${t}-item-icon, ${r}`]:{display:"none"},"a, a:hover":{color:o}},[`${t}-item-group-title`]:{...In,paddingInline:d}}}]},Uu=e=>{const{componentCls:t,motionDurationSlow:r,motionDurationMid:n,motionEaseInOut:o,motionEaseOut:s,iconCls:i,iconSize:a,iconMarginInlineEnd:c}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${r}`,`background-color ${r}`,`padding calc(${r} + 0.1s) ${o}`].join(","),[`${t}-item-icon, ${i}`]:{minWidth:a,fontSize:a,transition:[`font-size ${n} ${s}`,`margin ${r} ${o}`,`color ${r}`].join(","),"+ span":{marginInlineStart:c,opacity:1,transition:[`opacity ${r} ${o}`,`margin ${r}`,`color ${r}`].join(",")}},[`${t}-item-icon`]:{...df()},[`&${t}-item-only-child`]:{[`> ${i}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${t}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},ju=e=>{const{componentCls:t,motionDurationSlow:r,motionEaseInOut:n,borderRadius:o,menuArrowSize:s,menuArrowOffset:i}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:s,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${r} ${n}, opacity ${r}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(s).mul(.6).equal(),height:e.calc(s).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background-color ${r} ${n}`,`transform ${r} ${n}`,`top ${r} ${n}`,`color ${r} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${Re(e.calc(i).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Re(i)})`}}}}},Db=e=>{const{antCls:t,componentCls:r,fontSize:n,motionDurationSlow:o,motionDurationMid:s,motionEaseInOut:i,paddingXS:a,padding:c,colorSplit:l,lineWidth:f,zIndexPopup:y,borderRadiusLG:m,subMenuItemBorderRadius:d,menuArrowSize:v,menuArrowOffset:b,lineType:S,groupTitleLineHeight:u,groupTitleFontSize:C}=e;return[{"":{[r]:{...Rs(),"&-hidden":{display:"none"}}},[`${r}-submenu-hidden`]:{display:"none"}},{[r]:{...Ot(e),...Rs(),marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${r}-item`]:{flex:"none"}},[`${r}-item, ${r}-submenu, ${r}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${r}-item-group-title`]:{padding:`${Re(a)} ${Re(c)}`,fontSize:C,lineHeight:u,transition:`all ${o}`},[`&-horizontal ${r}-submenu`]:{transition:[`border-color ${o} ${i}`,`background-color ${o} ${i}`].join(",")},[`${r}-submenu, ${r}-submenu-inline`]:{transition:[`border-color ${o} ${i}`,`background-color ${o} ${i}`,`padding ${s} ${i}`].join(",")},[`${r}-submenu ${r}-sub`]:{cursor:"initial",transition:[`background-color ${o} ${i}`,`padding ${o} ${i}`].join(",")},[`${r}-title-content`]:{transition:`color ${o}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${t}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${r}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},[`${r}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${r}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:l,borderStyle:S,borderWidth:0,borderTopWidth:f,marginBlock:f,padding:0,"&-dashed":{borderStyle:"dashed"}},...Uu(e),[`${r}-item-group`]:{[`${r}-item-group-list`]:{margin:0,padding:0,[`${r}-item, ${r}-submenu-title`]:{paddingInline:`${Re(e.calc(n).mul(2).equal())} ${Re(c)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:y,borderRadius:m,boxShadow:"none",transformOrigin:"0 0",[`&${r}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${r}`]:{borderRadius:m,...Uu(e),...ju(e),[`${r}-item, ${r}-submenu > ${r}-submenu-title`]:{borderRadius:d},[`${r}-submenu-title::after`]:{transition:`transform ${o} ${i}`}}},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}},...ju(e),[`&-inline-collapsed ${r}-submenu-arrow, 37 &-inline ${r}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Re(b)})`},"&::after":{transform:`rotate(45deg) translateX(${Re(e.calc(b).mul(-1).equal())})`}},[`${r}-submenu-open${r}-submenu-inline > ${r}-submenu-title > ${r}-submenu-arrow`]:{transform:`translateY(${Re(e.calc(v).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Re(e.calc(b).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Re(b)})`}}}},{[`${t}-layout-header`]:{[r]:{lineHeight:"inherit"}}}]},$b=e=>{const{colorPrimary:t,colorError:r,colorTextDisabled:n,colorErrorBg:o,colorText:s,colorTextDescription:i,colorBgContainer:a,colorFillAlter:c,colorFillContent:l,lineWidth:f,lineWidthBold:y,controlItemBgActive:m,colorBgTextHover:d,controlHeightLG:v,lineHeight:b,colorBgElevated:S,marginXXS:u,padding:C,fontSize:x,controlHeightSM:I,fontSizeLG:N,colorTextLightSolid:E,colorErrorHover:g}=e,p=e.activeBarWidth??0,T=e.activeBarBorderWidth??f,R=e.itemMarginInline??e.marginXXS,B=new Pr(E).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:s,itemColor:s,colorItemTextHover:s,itemHoverColor:s,colorItemTextHoverHorizontal:t,horizontalItemHoverColor:t,colorGroupTitle:i,groupTitleColor:i,colorItemTextSelected:t,itemSelectedColor:t,subMenuItemSelectedColor:t,colorItemTextSelectedHorizontal:t,horizontalItemSelectedColor:t,colorItemBg:a,itemBg:a,colorItemBgHover:d,itemHoverBg:d,colorItemBgActive:l,itemActiveBg:m,colorSubItemBg:c,subMenuItemBg:c,colorItemBgSelected:m,itemSelectedBg:m,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:p,colorActiveBarHeight:y,activeBarHeight:y,colorActiveBarBorderSize:f,activeBarBorderWidth:T,colorItemTextDisabled:n,itemDisabledColor:n,colorDangerItemText:r,dangerItemColor:r,colorDangerItemTextHover:r,dangerItemHoverColor:r,colorDangerItemTextSelected:r,dangerItemSelectedColor:r,colorDangerItemBgActive:o,dangerItemActiveBg:o,colorDangerItemBgSelected:o,dangerItemSelectedBg:o,itemMarginInline:R,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:v,groupTitleLineHeight:b,collapsedWidth:v*2,popupBg:S,itemMarginBlock:u,itemPaddingInline:C,horizontalLineHeight:`${v*1.15}px`,iconSize:x,iconMarginInlineEnd:I-x,collapsedIconSize:N,groupTitleFontSize:x,darkItemDisabledColor:new Pr(E).setA(.25).toRgbString(),darkItemColor:B,darkDangerItemColor:r,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:E,darkItemSelectedBg:t,darkDangerItemSelectedBg:r,darkItemHoverBg:"transparent",darkGroupTitleColor:B,darkItemHoverColor:E,darkDangerItemHoverColor:g,darkDangerItemSelectedColor:E,darkDangerItemActiveBg:r,itemWidth:p?`calc(100% + ${T}px)`:`calc(100% - ${R*2}px)`}},Ob=(e,t=e,r=!0)=>Ut("Menu",o=>{const{colorBgElevated:s,controlHeightLG:i,fontSize:a,darkItemColor:c,darkDangerItemColor:l,darkItemBg:f,darkSubMenuItemBg:y,darkItemSelectedColor:m,darkItemSelectedBg:d,darkDangerItemSelectedBg:v,darkItemHoverBg:b,darkGroupTitleColor:S,darkItemHoverColor:u,darkItemDisabledColor:C,darkDangerItemHoverColor:x,darkDangerItemSelectedColor:I,darkDangerItemActiveBg:N,popupBg:E,darkPopupBg:g}=o,p=o.calc(a).div(7).mul(5).equal(),T=_t(o,{menuArrowSize:p,menuHorizontalHeight:o.calc(i).mul(1.15).equal(),menuArrowOffset:o.calc(p).mul(.25).equal(),menuSubMenuBg:s,calc:o.calc,popupBg:E}),R=_t(T,{itemColor:c,itemHoverColor:u,groupTitleColor:S,itemSelectedColor:m,subMenuItemSelectedColor:m,itemBg:f,popupBg:g,subMenuItemBg:y,itemActiveBg:"transparent",itemSelectedBg:d,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:b,itemDisabledColor:C,dangerItemColor:l,dangerItemHoverColor:x,dangerItemSelectedColor:I,dangerItemActiveBg:N,dangerItemSelectedBg:v,menuSubMenuBg:y,horizontalItemSelectedColor:m,horizontalItemSelectedBg:d});return[Db(T),Bb(T),Mb(T),Vu(T,"light"),Vu(R,"dark"),Lb(T),Hf(T),Nn(T,"slide-up"),Nn(T,"slide-down"),$l(T,"zoom-big")]},$b,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","
37itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:r,unitless:{groupTitleLineHeight:!0}})(e,t),Dp=e=>{const{popupClassName:t,icon:r,title:n,theme:o}=e,s=h.useContext(ho),{prefixCls:i,inlineCollapsed:a,theme:c,classNames:l,styles:f}=s,y=_n();let m;if(!r)m=a&&!y.length&&n&&typeof n=="string"?h.createElement("div",{className:`${i}-inline-collapsed-noicon`},n.charAt(0)):h.createElement("span",{className:`${i}-title-content`},n);else{const b=h.isValidElement(n)&&n.type==="span";m=h.createElement(h.Fragment,null,$r(r,S=>({className:ue(S.className,`${i}-item-icon`,l?.itemIcon),style:{...S.style,...f?.itemIcon}})),b?n:h.createElement("span",{className:`${i}-title-content`},n))}const d=h.useMemo(()=>({...s,firstLevel:!1}),[s]),[v]=Mo("Menu");return h.createElement(ho.Provider,{value:d},h.createElement(Go,{...Tt(e,["icon"]),title:m,classNames:{list:l?.subMenu?.list,listTitle:l?.subMenu?.itemTitle},styles:{list:f?.subMenu?.list,listTitle:f?.subMenu?.itemTitle},popupClassName:ue(i,t,l?.popup?.root,`${i}-${o||c}`),popupStyle:{zIndex:v,...e.popupStyle,...f?.popup?.root}}))};function Si(e){return e===null||e===!1}const _b={item:Mp,submenu:Dp,divider:Lp},kb=h.forwardRef((e,t)=>{const r=h.useContext(mo),n=r||{},{prefixCls:o,className:s,style:i,theme:a="light",expandIcon:c,_internalDisableMenuItemTitleTooltip:l,inlineCollapsed:f,siderCollapsed:y,rootClassName:m,mode:d,selectable:v,onClick:b,overflowedIndicatorPopupClassName:S,classNames:u,styles:C,...x}=e,{menu:I}=h.useContext(Rt),{getPrefixCls:N,getPopupContainer:E,direction:g,className:p,style:T,classNames:R,styles:B}=Gt("menu"),P=N(),D=Tt(x,["collapsedWidth"]);n.validator?.({mode:d});const U=Nt((...A)=>{b?.(...A),n.onClick?.()}),_=n.mode||d,V=v??n.selectable,z=f??y,q={...e,mode:_,inlineCollapsed:z,selectable:V,theme:a},[G,Y]=kt([R,u],[B,C],{props:q},{popup:{_default:"root"},subMenu:{_default:"item"}}),ee={horizontal:{motionName:`${P}-slide-up`},inline:Ps(P),other:{motionName:`${P}-zoom-big`}},J=N("menu",o||n.prefixCls),te=Qt(J),[Q,Z]=Ob(J,te,!r),W=ue(`${J}-${a}`,p,s),oe=h.useMemo(()=>{if(typeof c=="function"||Si(c))return c||null;if(typeof n.expandIcon=="function"||Si(n.expandIcon))return n.expandIcon||null;if(typeof I?.expandIcon=="function"||Si(I?.expandIcon))return I?.expandIcon||null;const A=c??n?.expandIcon??I?.expandIcon;return $r(A,{className:ue(`${J}-submenu-expand-icon`,h.isValidElement(A)?A.props?.className:void 0)})},[c,n?.expandIcon,I?.expandIcon,J]),ie=h.useMemo(()=>({prefixCls:J,inlineCollapsed:z||!1,direction:g,firstLevel:!0,theme:a,mode:_,disableMenuItemTitleTooltip:l,classNames:G,styles:Y}),[J,z,g,l,a,_,G,Y]);return h.createElement(mo.Provider,{value:null},h.createElement(ho.Provider,{value:ie},h.createElement(Ca,{getPopupContainer:E,overflowedIndicator:h.createElement(Bp,null),overflowedIndicatorPopupClassName:ue(J,`${J}-${a}`,S),classNames:{list:G.list,listTitle:G.itemTitle},styles:{list:Y.list,listTitle:Y.itemTitle},mode:_,selectable:V,onClick:U,...D,inlineCollapsed:z,style:{...Y.root,...T,...i},className:W,prefixCls:J,direction:g,defaultMotions:ee,expandIcon:oe,ref:t,rootClassName:ue(m,Q,n.rootClassName,Z,te,G.root),_internalComponents:_b})))}),xa=h.forwardRef((e,t)=>{const r=h.useRef(null),n=h.useContext(Pp);return h.useImperativeHandle(t,()=>({menu:r.current,focus:o=>{r.current?.focus(o)}})),h.createElement(kb,{ref:r,...e,...n})});xa.Item=Mp;xa.SubMenu=Dp;xa.Divider=Lp;xa.ItemGroup=dc;const Vb=e=>{const{componentCls:t,menuCls:r,colorError:n,colorTextLightSolid:o}=e,s=`${r}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${r} ${s}`]:{[`&${s}-danger:not(${s}-disabled)`]:{color:n,"&:hover":{color:o,backgroundColor:n}}}}}},Fb=e=>{const{componentCls:t,menuCls:r,zIndexPopup:n,dropdownArrowDistance:o,sizePopupArrow:s,antCls:i,iconCls:a,motionDurationMid:c,paddingBlock:l,fontSize:f,dropdownEdgeChildPadding:y,colorTextDisabled:m,fontSizeIcon:d,controlPaddingHorizontal:v,colorBgElevated:b}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:n,display:"block","&::before":{position:"absolute",insetBlock:e.calc(s).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${i}-btn`]:{[`& > ${a}-down, & > ${i}-btn-icon > ${a}-down`]:{fontSize:d}},[`${t}-wrap`]:{position:"relative",[`${i}-btn > ${a}-down`]:{fontSize:d},[`${a}-down::before`]:{transition:`transform ${c}`}},[`${t}-wrap-open`]:{[`${a}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottomLeft, 38 &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottomLeft, 39 &${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottom, 40 &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottom, 41 &${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottomRight, 42 &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:Wl},[`&${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-topLeft, 43 &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-topLeft, 44 &${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-top, 45 &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-top, 46 &${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-topRight, 47 &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-topRight`]:{animationName:Xl},[`&${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottomLeft, 48 &${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottom, 49 &${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:Yl},[`&${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-topLeft, 50 &${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-top, 51 &${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-topRight`]:{animationName:Ql}}},pp(e,b,{arrowPlacement:{top:!0,bottom:!0}}),{[`${t} ${r}`]:{position:"relative",margin:0},[`${r}-submenu-popup`]:{position:"absolute",zIndex:n,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:{...Ot(e),[r]:{padding:y,listStyleType:"none",backgroundColor:b,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,...jc(e),"&:empty":{padding:0,boxShadow:"none"},[`${r}-item-group-title`]:{padding:`${Re(l)} ${Re(v)}`,color:e.colorTextDescription,transition:`all ${c}`},[`${r}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${r}-item-icon`]:{minWidth:f,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${r}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${c}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${r}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${r}-item, ${r}-submenu-title`]:{display:"flex",margin:0,padding:`${Re(l)} ${Re(v)}`,color:e.colorText,fontWeight:"normal",fontSize:f,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${c}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover},...jc(e),"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}}
51,"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:b,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Re(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:d,fontStyle:"normal"}}},[`${r}-item-group-list`]:{margin:`0 ${Re(e.marginXS)}`,padding:0,listStyle:"none"},[`${r}-submenu-title`]:{paddingInlineEnd:e.calc(v).add(e.fontSizeSM).equal()},[`${r}-submenu-vertical`]:{position:"relative"},[`${r}-submenu${r}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:m,backgroundColor:b,cursor:"not-allowed"}},[`${r}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}}}},[Nn(e,"slide-up"),Nn(e,"slide-down"),so(e,"move-up"),so(e,"move-down"),$l(e,"zoom-big")]]},Ub=e=>({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2,...oc({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0}),...dp(e)}),jb=Ut("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:r,paddingXXS:n,componentCls:o}=e,s=_t(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(r).div(2).add(t).equal(),dropdownEdgeChildPadding:n});return[Fb(s),Vb(s)]},Ub,{resetStyle:!1}),qo=e=>{const{menu:t,arrow:r,prefixCls:n,children:o,trigger:s,disabled:i,dropdownRender:a,popupRender:c,getPopupContainer:l,overlayClassName:f,rootClassName:y,overlayStyle:m,open:d,onOpenChange:v,mouseEnterDelay:b=.15,mouseLeaveDelay:S=.1,autoAdjustOverflow:u=!0,placement:C="",transitionName:x,classNames:I,styles:N,destroyPopupOnHide:E,destroyOnHidden:g}=e,{getPrefixCls:p,direction:T,getPopupContainer:R,className:B,style:P,classNames:D,styles:U}=Gt("dropdown"),_={...e,mouseEnterDelay:b,mouseLeaveDelay:S,autoAdjustOverflow:u},[V,z]=kt([D,I],[U,N],{props:_}),q={...P,...m,...z.root},G=c||a,Y=h.useMemo(()=>{const Ce=p();return x!==void 0?x:C.includes("top")?`${Ce}-slide-down`:`${Ce}-slide-up`},[p,C,x]),ee=h.useMemo(()=>C?C.includes("Center")?C.slice(0,C.indexOf("Center")):C:T==="rtl"?"bottomRight":"bottomLeft",[C,T]),J=p("dropdown",n),te=Qt(J),[Q,Z]=jb(J,te),[,W]=Mn(),oe=h.Children.only(ib(o)?h.createElement("span",null,o):o),ie=$r(oe,{className:ue(`${J}-trigger`,{[`${J}-rtl`]:T==="rtl"},oe.props.className),disabled:oe.props.disabled??i}),A=i?[]:s,$=!!A?.includes("contextMenu"),[O,w]=Xt(!1,d),M=Nt(Ce=>{v?.(Ce,{source:"trigger"}),w(Ce)}),H=ue(f,y,Q,Z,te,B,V.root,{[`${J}-rtl`]:T==="rtl"}),F=hp({arrowPointAtCenter:typeof r=="object"&&r.pointAtCenter,autoAdjustOverflow:u,offset:W.marginXXS,arrowWidth:r?W.sizePopupArrow:0,borderRadius:W.borderRadius}),X=Nt(()=>{t?.selectable&&t?.multiple||(v?.(!1,{source:"menu"}),w(!1))}),ce=()=>{const Ce=Tt(V,["root"]),he=Tt(z,["root"]);let ye;return t?.items&&(ye=h.createElement(xa,{...t,classNames:{...Ce,subMenu:{...Ce}},styles:{...he,subMenu:{...he}}})),G&&(ye=G(ye)),ye=h.Children.only(typeof ye=="string"?h.createElement("span",null,ye):ye),h.createElement(Pb,{prefixCls:`${J}-menu`,rootClassName:ue(Z,te),expandIcon:h.createElement("span",{className:`${J}-menu-submenu-arrow`},T==="rtl"?h.createElement(h2,{className:`${J}-menu-submenu-arrow-icon`}):h.createElement(m2,{className:`${J}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:X,validator:({mode:De})=>{}},ye)},[ae,re]=Mo("Dropdown",q.zIndex);let de=h.createElement(ob,{alignPoint:$,...Tt(e,["rootClassName","onOpenChange"]),mouseEnterDelay:b,mouseLeaveDelay:S,visible:O,builtinPlacements:F,arrow:!!r,overlayClassName:H,prefixCls:J,getPopupContainer:l||R,transitionName:Y,trigger:A,overlay:ce,placement:ee,onVisibleChange:M,overlayStyle:{...q,zIndex:ae},autoDestroy:g??E},ie);return ae&&(de=h.createElement(pf.Provider,{value:re},de)),de},Hb=Ul(qo,"align",void 0,"dropdown",e=>e),zb=e=>h.createElement(Hb,{...e},h.createElement("span",null));qo._InternalPanelDoNotUseOrYouWillBeFired=zb;const Kb=["parentNode"],Gb="form_item";function ea(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function $p(e,t){if(!e.length)return;const r=e.join("_");return t?`${t}_${r}`:Kb.includes(r)?`${Gb}_${r}`:r}function Op(e,t,r,n,o,s){let i=n;
51return s!==void 0?i=s:r.validating?i="validating":e.length?i="error":t.length?i="warning":(r.touched||o&&r.validated)&&(i="success"),i}function ol(e){return ea(e).join("_")}function Hu(e,t){const r=t.getFieldInstance(e),n=ta(r);if(n)return n;const o=$p(ea(e),t.__INTERNAL__.name);if(o)return document.getElementById(o)}function _p(e){const[t]=og(),r=h.useRef({}),n=h.useMemo(()=>e??{...t,__INTERNAL__:{itemRef:o=>s=>{const i=ol(o);s?r.current[i]=s:delete r.current[i]}},scrollToField:(o,s={})=>{const{focus:i,...a}=s,c=Hu(o,n);c&&(V1(c,{scrollMode:"if-needed",block:"nearest",...a}),i&&n.focusField(o))},focusField:o=>{const s=n.getFieldInstance(o);typeof s?.focus=="function"?s.focus():Hu(o,n)?.focus?.()},getFieldInstance:o=>{const s=ol(o);return r.current[s]}},[e,t]);return[n]}const kp=h.createContext(void 0),qb=kp.Provider,Vp=h.createContext(void 0),Wb=Vp.Provider;function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},il.apply(this,arguments)}const Fp=h.forwardRef((e,t)=>{const{prefixCls:r="rc-checkbox",className:n,style:o,checked:s,disabled:i,defaultChecked:a=!1,type:c="checkbox",title:l,onChange:f,...y}=e,m=h.useRef(null),d=h.useRef(null),[v,b]=Xt(a,s);h.useImperativeHandle(t,()=>({focus:C=>{m.current?.focus(C)},blur:()=>{m.current?.blur()},input:m.current,nativeElement:d.current}));const S=ue(r,n,{[`${r}-checked`]:v,[`${r}-disabled`]:i}),u=C=>{i||("checked"in e||b(C.target.checked),f?.({target:{...e,type:c,checked:C.target.checked},stopPropagation(){C.stopPropagation()},preventDefault(){C.preventDefault()},nativeEvent:C.nativeEvent}))};return h.createElement("span",{className:S,title:l,style:o,ref:d},h.createElement("input",il({},y,{className:`${r}-input`,ref:m,onChange:u,disabled:i,checked:!!v,type:c})),h.createElement("span",{className:`${r}-inner`}))});function Up(e){const t=xe.useRef(null),r=()=>{Et.cancel(t.current),t.current=null};return[()=>{r(),t.current=Et(()=>{t.current=null})},s=>{t.current&&(s.stopPropagation(),r()),e?.(s)}]}const Yb=e=>{const{componentCls:t,antCls:r}=e,n=`${t}-group`;return{[n]:{...Ot(e),display:"inline-block",fontSize:0,[`&${n}-rtl`]:{direction:"rtl"},[`&${n}-block`]:{display:"flex"},[`${r}-badge ${r}-badge-count`]:{zIndex:1},[`> ${r}-badge:not(:first-child) > ${r}-button-wrapper`]:{borderInlineStart:"none"},"&-vertical":{display:"flex",flexDirection:"column",rowGap:e.marginXS}}}},Xb=e=>{const{componentCls:t,wrapperMarginInlineEnd:r,colorPrimary:n,radioSize:o,motionDurationSlow:s,motionDurationMid:i,motionEaseInOutCirc:a,colorBgContainer:c,colorBorder:l,lineWidth:f,colorBgContainerDisabled:y,colorTextDisabled:m,paddingXS:d,dotColorDisabled:v,lineType:b,radioColor:S,radioBgColor:u,calc:C}=e,x=`${t}-inner`,N=C(o).sub(C(4).mul(2)),E=C(1).mul(o).equal({unit:!0});return{[`${t}-wrapper`]:{...Ot(e),display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:r,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${t}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${t}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Re(f)} ${b} ${n}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:{...Ot(e),position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"},[`${t}-wrapper:hover &, 52 &:hover ${x}`]:{borderColor:n},[`${t}-input:focus-visible + ${x}`]:Do(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:"visible"},[`${t}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:E,height:E,marginBlockStart:C(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:C(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:S,borderBlockStart:0,borderInlineStart:0,borderRadius:E,transform:"scale(0)",opacity:0,transition:`all ${s} ${a}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:E,height:E,backgroundColor:c,borderColor:l,borderStyle:"solid",borderWidth:f,borderRadius:"50%",transition:`all ${i}`},[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0}
52,[`${t}-checked`]:{[x]:{borderColor:n,backgroundColor:u,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${s} ${a}`}}},[`${t}-disabled`]:{cursor:"not-allowed",[x]:{backgroundColor:y,borderColor:l,cursor:"not-allowed","&::after":{backgroundColor:v}},[`${t}-input`]:{cursor:"not-allowed"},[`${t}-disabled + span`]:{color:m,cursor:"not-allowed"},[`&${t}-checked`]:{[x]:{"&::after":{transform:`scale(${C(N).div(o).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:d,paddingInlineEnd:d}}}},Qb=e=>{const{buttonColor:t,controlHeight:r,componentCls:n,lineWidth:o,lineType:s,colorBorder:i,motionDurationMid:a,buttonPaddingInline:c,fontSize:l,buttonBg:f,fontSizeLG:y,controlHeightLG:m,controlHeightSM:d,paddingXS:v,borderRadius:b,borderRadiusSM:S,borderRadiusLG:u,buttonCheckedBg:C,buttonSolidCheckedColor:x,colorTextDisabled:I,colorBgContainerDisabled:N,buttonCheckedBgDisabled:E,buttonCheckedColorDisabled:g,colorPrimary:p,colorPrimaryHover:T,colorPrimaryActive:R,buttonSolidCheckedBg:B,buttonSolidCheckedHoverBg:P,buttonSolidCheckedActiveBg:D,calc:U}=e;return{[`${n}-button-wrapper`]:{position:"relative",display:"inline-block",height:r,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:l,lineHeight:Re(U(r).sub(U(o).mul(2)).equal()),background:f,border:`${Re(o)} ${s} ${i}`,borderBlockStartWidth:U(o).add(.02).equal(),borderInlineEndWidth:o,cursor:"pointer",transition:[`color ${a}`,`background-color ${a}`,`box-shadow ${a}`].join(","),a:{color:t},[`> ${n}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:U(o).mul(-1).equal()},"&:first-child":{borderInlineStart:`${Re(o)} ${s} ${i}`,borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b},"&:first-child:last-child":{borderRadius:b},[`${n}-group-large &`]:{height:m,fontSize:y,lineHeight:Re(U(m).sub(U(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:u,borderEndStartRadius:u},"&:last-child":{borderStartEndRadius:u,borderEndEndRadius:u}},[`${n}-group-small &`]:{height:d,paddingInline:U(v).sub(o).equal(),paddingBlock:0,lineHeight:Re(U(d).sub(U(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:S,borderEndStartRadius:S},"&:last-child":{borderStartEndRadius:S,borderEndEndRadius:S}},"&:hover":{position:"relative",color:p},"&:has(:focus-visible)":Do(e),[`${n}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${n}-button-wrapper-disabled)`]:{zIndex:1,color:p,background:C,borderColor:p,"&::before":{backgroundColor:p},"&:first-child":{borderColor:p},"&:hover":{color:T,borderColor:T,"&::before":{backgroundColor:T}},"&:active":{color:R,borderColor:R,"&::before":{backgroundColor:R}}},[`${n}-group-solid &-checked:not(${n}-button-wrapper-disabled)`]:{color:x,background:B,borderColor:B,"&:hover":{color:x,background:P,borderColor:P},"&:active":{color:x,background:D,borderColor:D}},"&-disabled":{color:I,backgroundColor:N,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:I,backgroundColor:N,borderColor:i}},[`&-disabled${n}-button-wrapper-checked`]:{color:g,backgroundColor:E,borderColor:i,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},Zb=e=>{const{wireframe:t,padding:r,marginXS:n,lineWidth:o,fontSizeLG:s,colorText:i,colorBgContainer:a,colorTextDisabled:c,controlItemBgActiveDisabled:l,colorTextLightSolid:f,colorPrimary:y,colorPrimaryHover:m,colorPrimaryActive:d,colorWhite:v}=e,b=4,S=s,u=t?S-b*2:S-(b+o)*2;return{radioSize:S,dotSize:u,dotColorDisabled:c,buttonSolidCheckedColor:f,buttonSolidCheckedBg:y,buttonSolidCheckedHoverBg:m,buttonSolidCheckedActiveBg:d,buttonBg:a,buttonCheckedBg:a,buttonColor:i,buttonCheckedBgDisabled:l,buttonCheckedColorDisabled:c,buttonPaddingInline:r-o,wrapperMarginInlineEnd:n,radioColor:t?y:v,radioBgColor:t?a:y}},jp=Ut("Radio",e=>{const{controlOutline:t,controlOutlineWidth:r}=e,n=`0 0 0 ${Re(r)} ${t}`,s=_t(e,{radioFocusShadow:n,radioButtonFocusShadow:n});return[Yb(s),Xb(s),Qb(s)]},Zb,{unitless:{radioSize:!0,dotSize:!0}}),Jb=(e,t)=>{const r=h.useContext(kp),n=h.useContext(Vp),{getPrefixCls:o,direction:s,className:i,style:a,classNames:c,styles:l}=Gt("radio"),f=h.useRef(null),y=Cr(t,f),{isFormItemInput:m}=h.useContext(tr),d=ee=>{e.onChange?.(ee),r?.onChange?.(ee)},{prefixCls:v,className:b,rootClassName:S,children:u,style:C,title:x,classNames:I,styles:N,...E}=e,g=o("radio",v),p=(r?.optionType||n)==="button",T=p?`${g}-button`:g,R=Qt(g),[B,P]=jp(g,R),D={...E},U=h.useContext(Vr);r&&(D.name=r.name,D.onChange=d,D.checked=e.value===r.value,D.disabled=D.disabled??r.disabled),D.disabled=D.disabled??U;const _={...e,...D},[V,z]=kt([c,I],[l,N],{props:_}),q=ue(`${T}-wrapper`,{[`${T}-wrapper-checked`]:D.checked,[`${T}-wrapper-disabled`]:D.disabled,[`${T}-wrapper-rtl`]:s==="rtl",[`${T}-wrapper-in-form-item`]:m,[`${T}-wrapper-block`]:!!r?.block},i,b,S,V.root,B,P,R),[G,Y]=Up(D.onClick);return h.createElement(_l,{component:"Radio",disabled:D.disabled},h.createElement("label",{className:q,style:{...z.root,...a,...C},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:x,onClick:G},h.createElement(Fp,{...D,className:ue(V.icon,{[mf]:!p}),style:z.icon,type:"radio",prefixCls:T,ref:y,onClick:Y}),u!==void 0?h.createElement("span",{className:ue(`${T}-label`,V.label),style:z.label},u):null))},go=h.forwardRef(Jb),eC=h.forwardRef((e,t)=>
52{const{getPrefixCls:r,direction:n}=h.useContext(Rt),{name:o}=h.useContext(tr),s=pa(ol(o)),{prefixCls:i,className:a,rootClassName:c,options:l,buttonStyle:f="outline",disabled:y,children:m,size:d,style:v,id:b,optionType:S,name:u=s,defaultValue:C,value:x,block:I=!1,onChange:N,onMouseEnter:E,onMouseLeave:g,onFocus:p,onBlur:T,orientation:R,vertical:B,role:P="radiogroup"}=e,[D,U]=Xt(C,x),_=h.useCallback(W=>{const oe=D,ie=W.target.value;"value"in e||U(ie),ie!==oe&&N?.(W)},[D,U,N]),V=r("radio",i),z=`${V}-group`,q=Qt(V),[G,Y]=jp(V,q);let ee=m;l&&l.length>0&&(ee=l.map(W=>typeof W=="string"||typeof W=="number"?h.createElement(go,{key:W.toString(),prefixCls:V,disabled:y,value:W,checked:D===W},W):h.createElement(go,{key:`radio-group-value-options-${W.value}`,prefixCls:V,disabled:W.disabled||y,value:W.value,checked:D===W.value,title:W.title,style:W.style,className:W.className,id:W.id,required:W.required},W.label)));const J=an(d),[,te]=gf(R,B),Q=ue(z,`${z}-${f}`,{[`${z}-${J}`]:J,[`${z}-rtl`]:n==="rtl",[`${z}-block`]:I},a,c,G,Y,q),Z=h.useMemo(()=>({onChange:_,value:D,disabled:y,name:u,optionType:S,block:I}),[_,D,y,u,S,I]);return h.createElement("div",{...wr(e,{aria:!0,data:!0}),role:P,className:ue(Q,{[`${V}-group-vertical`]:te}),style:v,onMouseEnter:E,onMouseLeave:g,onFocus:p,onBlur:T,id:b,ref:t},h.createElement(qb,{value:Z},ee))}),tC=h.memo(eC),rC=(e,t)=>{const{getPrefixCls:r}=h.useContext(Rt),{prefixCls:n,...o}=e,s=r("radio",n);return h.createElement(Wb,{value:"button"},h.createElement(go,{prefixCls:s,...o,type:"radio",ref:t}))},nC=h.forwardRef(rC),Ir=go;Ir.Button=nC;Ir.Group=tC;Ir.__ANT_RADIO=!0;function Wo(e){return _t(e,{inputAffixPadding:e.paddingXXS})}const Yo=e=>{const{controlHeight:t,fontSize:r,lineHeight:n,lineWidth:o,controlHeightSM:s,controlHeightLG:i,fontSizeLG:a,lineHeightLG:c,paddingSM:l,controlPaddingHorizontalSM:f,controlPaddingHorizontal:y,colorFillAlter:m,colorPrimaryHover:d,colorPrimary:v,controlOutlineWidth:b,controlOutline:S,colorErrorOutline:u,colorWarningOutline:C,colorBgContainer:x,inputFontSize:I,inputFontSizeLG:N,inputFontSizeSM:E}=e,g=I||r,p=E||g,T=N||a,R=Math.round((t-g*n)/2*10)/10-o,B=Math.round((s-p*n)/2*10)/10-o,P=Math.ceil((i-T*c)/2*10)/10-o;return{paddingBlock:Math.max(R,0),paddingBlockSM:Math.max(B,0),paddingBlockLG:Math.max(P,0),paddingInline:l-o,paddingInlineSM:f-o,paddingInlineLG:y-o,addonBg:m,activeBorderColor:v,hoverBorderColor:d,activeShadow:`0 0 0 ${b}px ${S}`,errorActiveShadow:`0 0 0 ${b}px ${u}`,warningActiveShadow:`0 0 0 ${b}px ${C}`,hoverBg:x,activeBg:x,inputFontSize:g,inputFontSizeLG:T,inputFontSizeSM:p}},aC=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),fc=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":{...aC(_t(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled}))}}),Hp=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),zu=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...Hp(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}},[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),oC=(e,t)=>({"&-outlined":{...Hp(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow}),[`&${e.componentCls}-disabled, &[disabled]`]:{...fc(e)},...zu(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError}),...zu(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning}),...t}}),Ku=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),iC=e=>({"&-outlined":{[`${e.componentCls}
52-group`]:{"&-addon":{background:e.addonBg,border:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},...Ku(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText}),...Ku(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText}),[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:{...fc(e)}}}}),sC=(e,t)=>{const{componentCls:r}=e;return{"&-borderless":{background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${r}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${r}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${r}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}},...t}}},zp=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:t?.inputColor??"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),Gu=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...zp(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}}),lC=(e,t)=>({"&-filled":{...zp(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,inputColor:e.colorText}),[`&${e.componentCls}-disabled, &[disabled]`]:{...fc(e)},...Gu(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError}),...Gu(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning}),...t}}),qu=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),cC=e=>({"&-filled":{[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}},...qu(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText}),...qu(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText}),[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}}}),Kp=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Re(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.hoverBorderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),Wu=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...Kp(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}},[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),uC=(e,t)=>({"&-underlined":{...Kp(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow}),[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"},...Wu(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError}),...Wu(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning}),...t}}),dC=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Gp=e=>{const{paddingBlockLG:t,lineHeightLG:r,borderRadiusLG:n,paddingInlineLG:o}=e;return{padding:`${Re(t)} ${Re(o)}`,fontSize:e.inputFontSizeLG,lineHeight:r,borderRadius:n}},qp=e=>({padding:`${Re(e.paddingBlockSM)} ${Re(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),Wp=(e,t={})=>({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Re(e.paddingBlock)} ${Re(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`,...dC(e.colorTextPlaceholder),"&-lg":{...Gp(e),...t.largeStyle},"&-sm":{...qp(e),...t.smallStyle},"&-rtl, &-textarea-rtl":{direction:"rtl"}}),fC=e=>{const{componentCls:t,antCls:r}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:{...Gp(e)},[`&-sm ${t}, &-sm > ${t}-group-addon`]:{...qp(e)},[`&-lg ${r}-select-single`]:{height:e.controlHeightLG},[`&-sm ${r}-select-single`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Re(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${r}-select`]:{margin:`${Re(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Re(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${r}-select-single:not(${r}-select-customize-input):not(${r}-pagination-size-changer)`]:{backgroundColor:"inherit",border:`${Re(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}},[`${r}-cascader-picker`]:{margin:`-9px ${Re(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${r}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${r}-select`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${r}-select`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0},"&:not(:first-child)":{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:{display:"block",...Rs(),[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[` 53 & > ${t}-affix-wrapper, 54 & > ${t}-number-affix-wrapper, 55 & > ${r}-picker-range 56 `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},[`& > ${r}-select, 57 & > ${r}-select-auto-complete ${t}, 58 & > ${r}-cascader-picker ${t}, 59 & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${r}-select-focused`]:{zIndex:1},[`& > ${r}-select > ${r}-select-arrow`]:{zIndex:1},[`& > *:first-child, 60 & > ${r}-select:first-child, 61 & > ${r}-select-auto-complete:first-child ${t}, 62 & > ${r}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child, 63 & > ${r}-select:last-child, 64 & > ${r}-cascader-picker:last-child ${t}, 65 & > ${r}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${r}-select-auto-complete ${t}`]:{verticalAlign:"top"},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{}}}}},pC=e=>{const{componentCls:t,controlHeightSM:r,lineWidth:n,calc:o}=e,i=o(r).sub(o(n).mul(2)).sub(16).div(2).equal();return{[t]:{...Ot(e),...Wp(e),...oC(e),...lC(e),...sC(e),...uC(e),'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:r,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}}}},hC=e=>{const{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${e.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Re(e.inputAffixPadding)}`}}}},mC=e=>{const{componentCls:t,inputAffixPadding:r,colorTextDescription:n,motionDurationSlow:o,colorIcon:s,colorIconHover:i,iconCls:a}=e,c=`${t}-affix-wrapper`,l=`${t}-affix-wrapper-disabled`;return{[c]:{...Wp(e),display:"inline-flex","&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:n,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:r},"&-suffix":{marginInlineStart:r}},...hC(e),[`${a}${t}-password-icon`]:{color:s,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:i}}},[`${t}-underlined`]:{borderRadius:0},[l]:{[`${a}${t}-password-icon`]:{color:s,cursor:"not-allowed","&:hover":{color:s}}}}},gC=e=>{const{componentCls:t,borderRadiusLG:r,borderRadiusSM:n}=e;return{[`${t}-group`]:{...Ot(e),...fC(e),"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${t}-group-addon`]:{borderRadius:r,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:n}},...iC(e),...cC(e),[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}}},vC=e=>{const{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},Yp=Ut(["Input","Shared"],e=>{const t=_t(e,Wo(e));return[pC(t),mC(t)]},Yo,{resetFont:!1}),Xp=Ut(["Input","Component"],e=>{const t=_t(e,Wo(e));return[gC(t),vC(t),Dl(t,{focus:!0,focusElCls:`${t.componentCls}-affix-wrapper-focused`})]},Yo,{resetFont:!1}
65),yC=e=>{const{checkboxCls:t}=e,r=`${t}-wrapper`;return[{[`${t}-group`]:{...Ot(e),display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}},[r]:{...Ot(e),display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${r}`]:{marginInlineStart:0},[`&${r}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}},[t]:{...Ot(e),position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:Do(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${Re(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}}},{[` 66 ${r}:not(${r}-disabled), 67 ${t}:not(${t}-disabled) 68 `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${r}:not(${r}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[` 69 ${r}-checked:not(${r}-disabled), 70 ${t}-checked:not(${t}-disabled) 71 `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${r}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function bC(e,t){const r=_t(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize});return yC(r)}const Qp=Ut("Checkbox",(e,{prefixCls:t})=>[bC(t,e)]),Zp=xe.createContext(null),CC=(e,t)=>{const{prefixCls:r,className:n,rootClassName:o,children:s,indeterminate:i=!1,style:a,onMouseEnter:c,onMouseLeave:l,skipGroup:f=!1,disabled:y,classNames:m,styles:d,...v}=e,{getPrefixCls:b,direction:S,className:u,style:C,classNames:x,styles:I}=Gt("checkbox"),N=h.useContext(Zp),{isFormItemInput:E}=h.useContext(tr),g=h.useContext(Vr),p=(N?.disabled||y)??g,T={...e,indeterminate:i,disabled:p},[R,B]=kt([x,m],[I,d],{props:T}),P=h.useRef(v.value),D=h.useRef(null),U=Cr(t,D);h.useEffect(()=>{N?.registerValue(v.value)},[]),h.useEffect(()=>{if(!f)return v.value!==P.current&&(N?.cancelValue(P.current),N?.registerValue(v.value),P.current=v.value),()=>N?.cancelValue(v.value)},[v.value]),h.useEffect(()=>{D.current?.input&&(D.current.input.indeterminate=i)},[i]);const _=b("checkbox",r),V=Qt(_),[z,q]=Qp(_,V),G={...v};N&&!f&&(G.onChange=(...Q)=>{v.onChange&&v.onChange.apply(v,Q),N.toggleOption&&N.toggleOption({label:s,value:v.value})},G.name=N.name,G.checked=N.value.includes(v.value));const Y=ue(`${_}-wrapper`,{[`${_}-rtl`]:S==="rtl",[`${_}-wrapper-checked`]:G.checked,[`${_}-wrapper-disabled`]:p,[`${_}-wrapper-in-form-item`]:E}
71,u,n,R.root,o,q,V,z),ee=ue(R.icon,{[`${_}-indeterminate`]:i},mf,z),[J,te]=Up(G.onClick);return h.createElement(_l,{component:"Checkbox",disabled:p},h.createElement("label",{className:Y,style:{...B.root,...C,...a},onMouseEnter:c,onMouseLeave:l,onClick:J},h.createElement(Fp,{...G,onClick:te,prefixCls:_,className:ee,style:B.icon,disabled:p,ref:U}),Dr(s)&&h.createElement("span",{className:ue(`${_}-label`,R.label),style:B.label},s)))},Jp=h.forwardRef(CC),xC=h.forwardRef((e,t)=>{const{defaultValue:r,children:n,options:o=[],prefixCls:s,className:i,rootClassName:a,style:c,onChange:l,role:f="group",...y}=e,{getPrefixCls:m,direction:d}=h.useContext(Rt),[v,b]=h.useState(y.value||r||[]),[S,u]=h.useState([]);h.useEffect(()=>{"value"in y&&b(y.value||[])},[y.value]);const C=h.useMemo(()=>o.map(_=>typeof _=="string"||typeof _=="number"?{label:_,value:_}:_),[o]),x=_=>{u(V=>V.filter(z=>z!==_))},I=_=>{u(V=>[].concat(Vt(V),[_]))},N=_=>{const V=v.indexOf(_.value),z=Vt(v);V===-1?z.push(_.value):z.splice(V,1),"value"in y||b(z),l?.(z.filter(q=>S.includes(q)).sort((q,G)=>{const Y=C.findIndex(J=>J.value===q),ee=C.findIndex(J=>J.value===G);return Y-ee}))},E=m("checkbox",s),g=`${E}-group`,p=Qt(E),[T,R]=Qp(E,p),B=Tt(y,["value","disabled"]),P=o.length?C.map(_=>h.createElement(Jp,{prefixCls:E,key:_.value.toString(),disabled:"disabled"in _?_.disabled:y.disabled,value:_.value,checked:v.includes(_.value),onChange:_.onChange,className:ue(`${g}-item`,_.className),style:_.style,title:_.title,id:_.id,required:_.required},_.label)):n,D=h.useMemo(()=>({toggleOption:N,value:v,disabled:y.disabled,name:y.name,registerValue:I,cancelValue:x}),[N,v,y.disabled,y.name,I,x]),U=ue(g,{[`${g}-rtl`]:d==="rtl"},i,a,R,p,T);return h.createElement("div",{className:U,style:c,role:f,...B,ref:t},h.createElement(Zp.Provider,{value:D},P))}),pc=Jp;pc.Group=xC;pc.__ANT_CHECKBOX=!0;const eh=h.createContext({}),SC=e=>typeof e=="number"&&!Number.isNaN(e);function Yu(e){return e==="auto"?"1 1 auto":SC(e)?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}const EC=["xs","sm","md","lg","xl","xxl"],th=h.forwardRef((e,t)=>{const{getPrefixCls:r,direction:n}=h.useContext(Rt),{gutter:o,wrap:s}=h.useContext(eh),{prefixCls:i,span:a,order:c,offset:l,push:f,pull:y,className:m,children:d,flex:v,style:b,...S}=e,u=r("col",i),C=r(),[x,I]=ig(u),[N]=kr(C,"col"),E={};let g={};EC.forEach(R=>{let B={};const P=e[R];typeof P=="number"?B.span=P:typeof P=="object"&&(B=P||{}),delete S[R],g={...g,[`${u}-${R}-${B.span}`]:B.span!==void 0,[`${u}-${R}-order-${B.order}`]:B.order||B.order===0,[`${u}-${R}-offset-${B.offset}`]:B.offset||B.offset===0,[`${u}-${R}-push-${B.push}`]:B.push||B.push===0,[`${u}-${R}-pull-${B.pull}`]:B.pull||B.pull===0,[`${u}-rtl`]:n==="rtl"},B.flex&&(g[`${u}-${R}-flex`]=!0,E[N(`${R}-flex`)]=Yu(B.flex))});const p=ue(u,{[`${u}-${a}`]:a!==void 0,[`${u}-order-${c}`]:c,[`${u}-offset-${l}`]:l,[`${u}-push-${f}`]:f,[`${u}-pull-${y}`]:y},m,g,x,I),T={};if(o?.[0]){const R=typeof o[0]=="number"?`${o[0]/2}px`:`calc(${o[0]} / 2)`;T.paddingInline=R}return v&&(T.flex=Yu(v),s===!1&&!T.minWidth&&(T.minWidth=0)),h.createElement("div",{...S,style:{...T,...b,...E},className:p,ref:t},d)});function wC(e,t){const r=[void 0,void 0],n=Array.isArray(e)?e:[e,void 0],o=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return n.forEach((s,i)=>{if(typeof s=="object"&&s!==null)for(let a=0;a<sa.length;a++){const c=sa[a];if(o[c]&&s[c]!==void 0){r[i]=s[c];break}}else r[i]=s}),r}function Xu(e,t){const[r,n]=h.useState(typeof e=="string"?e:""),o=()=>{if(typeof e=="string"&&n(e),typeof e=="object")for(let s=0;s<sa.length;s++){const i=sa[s];if(!t||!t[i])continue;const a=e[i];if(a!==void 0){n(a);return}}};return h.useEffect(()=>{o()},[JSON.stringify(e),t]),r}const IC=h.forwardRef((e,t)=>{const{prefixCls:r,justify:n,align:o,className:s,style:i,children:a,gutter:c=0,wrap:l,...f}=e,{getPrefixCls:y,direction:m}=h.useContext(Rt),d=Vy(!0,null),v=Xu(o,d),b=Xu(n,d),S=y("row",r),[u,C]=sg(S),x=wC(c,d),I=ue(S,{[`${S}-no-wrap`]:l===!1,[`${S}-${b}`]:b,[`${S}-${v}`]:v,[`${S}-rtl`]:m==="rtl"},s,u,C),N={};if(x?.[0]){const T=typeof x[0]=="number"?`${x[0]/-2}px`:`calc(${x[0]} / -2)`;N.marginInline=T}const[E,g]=x;N.rowGap=g;const p=h.useMemo(()=>({gutter:[E,g],wrap:l}),[E,g,l]);return h.createElement(eh.Provider,{value:p},h.createElement("div",{...f,className:I,style:{...N,...i},ref:t},a))}),TC=e=>{const{componentCls:t,borderRadius:r,paddingSM:n,colorBorder:o,paddingXS:s,fontSizeLG:i,fontSizeSM:a,borderRadiusLG:c,borderRadiusSM:l,colorBg
71ContainerDisabled:f,lineWidth:y,antCls:m}=e,[d,v]=kr(m,"space");return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:n,margin:0,borderWidth:y,borderStyle:"solid",borderRadius:r,"&:hover":{zIndex:0},[`&${t}-disabled`]:{color:e.colorTextDisabled},"&-large":{fontSize:i,borderRadius:c},"&-small":{paddingInline:s,borderRadius:l,fontSize:a},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0},"&-compact-item:not(:first-child)":{borderInlineStartWidth:0}},{[d("addon-border-color")]:o,[d("addon-background")]:f,[d("addon-border-color-outlined")]:o,[d("addon-background-filled")]:f,borderColor:v("addon-border-color"),background:v("addon-background"),"&-variant-outlined":{[d("addon-border-color")]:v("addon-border-color-outlined")},"&-variant-filled":{[d("addon-border-color")]:"transparent",[d("addon-background")]:v("addon-background-filled"),[`&${t}-disabled`]:{[d("addon-border-color")]:o,[d("addon-background")]:f}},"&-variant-borderless":{border:"none",background:"transparent"},"&-variant-underlined":{border:"none",background:"transparent"}},{"&-status-error":{[d("addon-border-color-outlined")]:e.colorError,[d("addon-background-filled")]:e.colorErrorBg,color:e.colorError},"&-status-warning":{[d("addon-border-color-outlined")]:e.colorWarning,[d("addon-background-filled")]:e.colorWarningBg,color:e.colorWarning}}]}},AC=Ut(["Space","Addon"],e=>[TC(e),Dl(e,{focus:!1})]),NC=xe.forwardRef((e,t)=>{const{className:r,children:n,style:o,prefixCls:s,variant:i="outlined",disabled:a,status:c,...l}=e,{getPrefixCls:f,direction:y}=xe.useContext(Rt),m=f("space-addon",s),[d,v]=AC(m),{compactItemClassnames:b,compactSize:S}=Dn(m,y),u=ia(m,c),C=ue(m,d,b,v,`${m}-variant-${i}`,u,{[`${m}-${S}`]:S,[`${m}-disabled`]:a},r);return xe.createElement("div",{ref:t,className:C,style:o,...l},n)});function RC(e){return!!(e.addonBefore||e.addonAfter)}function PC(e){return!!(e.prefix||e.suffix||e.allowClear)}function Qu(e,t,r){const n=t.cloneNode(!0),o=Object.create(e,{target:{value:n},currentTarget:{value:n}});return n.value=r,typeof t.selectionStart=="number"&&typeof t.selectionEnd=="number"&&(n.selectionStart=t.selectionStart,n.selectionEnd=t.selectionEnd),n.setSelectionRange=(...s)=>{t.setSelectionRange(...s)},o}function vo(e,t,r,n){if(!r)return;let o=t;if(t.type==="click"){o=Qu(t,e,""),r(o);return}if(e.type!=="file"&&n!==void 0){o=Qu(t,e,n),r(o);return}r(o)}function sl(){return sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sl.apply(this,arguments)}const rh=xe.forwardRef((e,t)=>{const{inputElement:r,children:n,prefixCls:o,prefix:s,suffix:i,addonBefore:a,addonAfter:c,className:l,style:f,disabled:y,readOnly:m,focused:d,triggerFocus:v,allowClear:b,value:S,handleReset:u,hidden:C,classes:x,classNames:I,dataAttrs:N,styles:E,components:g,onClear:p}=e,T=n??r,R=g?.affixWrapper||"span",B=g?.groupWrapper||"span",P=g?.wrapper||"span",D=g?.groupAddon||"span",U=h.useRef(null),_=G=>{U.current?.contains(G.target)&&v?.()},V=PC(e);let z=h.cloneElement(T,{value:S,className:ue(T.props?.className,!V&&I?.variant)||null});const q=h.useRef(null);if(xe.useImperativeHandle(t,()=>({nativeElement:q.current||U.current})),V){let G=null;if(b){const te=!y&&!m&&S,Q=`${o}-clear-icon`,Z=typeof b=="object"&&b?.clearIcon?b.clearIcon:"â";G=xe.createElement("button",{type:"button",tabIndex:-1,onClick:W=>{u?.(W),p?.()},onMouseDown:W=>W.preventDefault(),className:ue(Q,{[`${Q}-hidden`]:!te,[`${Q}-has-suffix`]:!!i})},Z)}const Y=`${o}-affix-wrapper`,ee=ue(Y,{[`${o}-disabled`]:y,[`${Y}-disabled`]:y,[`${Y}-focused`]:d,[`${Y}-readonly`]:m,[`${Y}-input-with-clear-btn`]:i&&b&&S},x?.affixWrapper,I?.affixWrapper,I?.variant),J=(i||b)&&xe.createElement("span",{className:ue(`${o}-suffix`,I?.suffix),style:E?.suffix},G,i);z=xe.createElement(R,sl({className:ee,style:E?.affixWrapper,onClick:_},N?.affixWrapper,{ref:U}),s&&xe.createElement("span",{className:ue(`${o}-prefix`,I?.prefix),style:E?.prefix},s),z,J)}if(RC(e)){const G=`${o}-group`,Y=`${G}-addon`,ee=`${G}-wrapper`,J=ue(`${o}-wrapper`,G,x?.wrapper,I?.wrapper),te=ue(ee,{[`${ee}-disabled`]:y},x?.group,I?.groupWrapper);z=xe.createElement(B,{className:te,ref:q},xe.createElement(P,{className:J},a&&xe.createElement(D,{className:Y},a),z,c&&xe.createElement(D,{className:Y},c)))}return xe.cloneElement(z,{className:ue(z.props?.className,l)||null,style:{...z.props?.style,...f},hidden:C})});function nh(e,t){return h.useMemo(()=>{let r={};t&&(r.show=typeof t=="object"&&t.formatter?t.formatter:!!t),r={...r,...e};const{show:n,...o}=r;return{...o,show:!!n,showFormatter:typeof n=="function"?n:void 0,strategy:o.strategy||(s=>s.length)}},[e,t])}function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
71for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yo.apply(this,arguments)}const BC=h.forwardRef((e,t)=>{const{autoComplete:r,onChange:n,onFocus:o,onBlur:s,onPressEnter:i,onKeyDown:a,onKeyUp:c,prefixCls:l="rc-input",disabled:f,htmlSize:y,className:m,maxLength:d,suffix:v,showCount:b,count:S,type:u="text",classes:C,classNames:x,styles:I,onCompositionStart:N,onCompositionEnd:E,...g}=e,[p,T]=h.useState(!1),R=h.useRef(!1),B=h.useRef(!1),P=h.useRef(null),D=h.useRef(null),U=F=>{P.current&&vf(P.current,F)},[_,V]=Xt(e.defaultValue,e.value),z=_==null?"":String(_),[q,G]=h.useState(null),Y=nh(S,b),ee=Y.max||d,J=Y.strategy(z),te=!!ee&&J>ee;h.useImperativeHandle(t,()=>({focus:U,blur:()=>{P.current?.blur()},setSelectionRange:(F,X,ce)=>{P.current?.setSelectionRange(F,X,ce)},select:()=>{P.current?.select()},input:P.current,nativeElement:D.current?.nativeElement||P.current})),h.useEffect(()=>{B.current&&(B.current=!1),T(F=>F&&f?!1:F)},[f]);const Q=(F,X,ce)=>{let ae=X;if(!R.current&&Y.exceedFormatter&&Y.max&&Y.strategy(X)>Y.max)ae=Y.exceedFormatter(X,{max:Y.max}),X!==ae&&G([P.current?.selectionStart||0,P.current?.selectionEnd||0]);else if(ce.source==="compositionEnd")return;V(ae),P.current&&vo(P.current,F,n,ae)};h.useEffect(()=>{q&&P.current?.setSelectionRange(...q)},[q]);const Z=F=>{Q(F,F.target.value,{source:"change"})},W=F=>{R.current=!1,Q(F,F.currentTarget.value,{source:"compositionEnd"}),E?.(F)},oe=F=>{i&&F.key==="Enter"&&!B.current&&!F.nativeEvent.isComposing&&(B.current=!0,i(F)),a?.(F)},ie=F=>{F.key==="Enter"&&(B.current=!1),c?.(F)},A=F=>{T(!0),o?.(F)},$=F=>{B.current&&(B.current=!1),T(!1),s?.(F)},O=F=>{V(""),U(),P.current&&vo(P.current,F,n)},w=te&&`${l}-out-of-range`,M=()=>{const F=Tt(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return xe.createElement("input",yo({autoComplete:r},F,{onChange:Z,onFocus:A,onBlur:$,onKeyDown:oe,onKeyUp:ie,className:ue(l,{[`${l}-disabled`]:f},x?.input),style:I?.input,ref:P,size:y,type:u,onCompositionStart:X=>{R.current=!0,N?.(X)},onCompositionEnd:W}))},H=()=>{const F=Number(ee)>0;if(v||Y.show){const X=Y.showFormatter?Y.showFormatter({value:z,count:J,maxLength:ee}):`${J}${F?` / ${ee}`:""}`;return xe.createElement(xe.Fragment,null,Y.show&&xe.createElement("span",{className:ue(`${l}-show-count-suffix`,{[`${l}-show-count-has-suffix`]:!!v},x?.count),style:{...I?.count}},X),v)}return null};return xe.createElement(rh,yo({},g,{prefixCls:l,className:ue(m,w),handleReset:O,value:z,focused:p,triggerFocus:U,suffix:H(),disabled:f,classes:C,classNames:x,styles:I,ref:D}),M())}),ah=e=>{let t;return typeof e=="object"&&e?.clearIcon?t=e:e&&(t={clearIcon:xe.createElement(Po,null)}),t};function oh(e,t){const r=h.useRef([]),n=()=>{r.current.push(setTimeout(()=>{e.current?.input&&e.current?.input.getAttribute("type")==="password"&&e.current?.input.hasAttribute("value")&&e.current?.input.removeAttribute("value")}))};return h.useEffect(()=>(t&&n(),()=>r.current.forEach(o=>{o&&clearTimeout(o)})),[]),n}function LC(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}const Xo=h.forwardRef((e,t)=>{const{prefixCls:r,bordered:n=!0,status:o,size:s,disabled:i,onBlur:a,onFocus:c,suffix:l,allowClear:f,addonAfter:y,addonBefore:m,className:d,style:v,styles:b,rootClassName:S,onChange:u,classNames:C,variant:x,...I}=e,{getPrefixCls:N,direction:E,allowClear:g,autoComplete:p,className:T,style:R,classNames:B,styles:P}=Gt("input"),D=N("input",r),U=h.useRef(null),_=Qt(D),[V,z]=Yp(D,S);Xp(D,_);const{compactSize:q,compactItemClassnames:G}=Dn(D,E),Y=an(re=>s??q??re),ee=xe.useContext(Vr),J=i??ee,te={...e,size:Y,disabled:J},[Q,Z]=kt([B,C],[P,b],{props:te}),{status:W,hasFeedback:oe,feedbackIcon:ie}=h.useContext(tr),A=Ho(W,o),$=LC(e)||!!oe;h.useRef($);const O=oh(U,!0),w=re=>{O(),a?.(re)},M=re=>{O(),c?.(re)},H=re=>{O(),u?.(re)},F=(oe||l)&&xe.createElement(xe.Fragment,null,l,oe&&ie),X=ah(f??g),[ce,ae]=nc("input",x,n);return xe.createElement(BC,{ref:Cr(t,U),prefixCls:D,autoComplete:p,...I,disabled:J,onBlur:w,onFocus:M,style:{...Z.root,...R,...v}
71,styles:Z,suffix:F,allowClear:X,className:ue(d,S,z,_,G,T,Q.root),onChange:H,addonBefore:m&&xe.createElement(na,{form:!0,space:!0},m),addonAfter:y&&xe.createElement(na,{form:!0,space:!0},y),classNames:{...Q,input:ue({[`${D}-sm`]:Y==="small",[`${D}-lg`]:Y==="large",[`${D}-rtl`]:E==="rtl"},Q.input,V),variant:ue({[`${D}-${ce}`]:ae},ia(D,A)),affixWrapper:ue({[`${D}-affix-wrapper-sm`]:Y==="small",[`${D}-affix-wrapper-lg`]:Y==="large",[`${D}-affix-wrapper-rtl`]:E==="rtl"},V),wrapper:ue({[`${D}-group-rtl`]:E==="rtl"},V),groupWrapper:ue({[`${D}-group-wrapper-sm`]:Y==="small",[`${D}-group-wrapper-lg`]:Y==="large",[`${D}-group-wrapper-rtl`]:E==="rtl",[`${D}-group-wrapper-${ce}`]:ae},ia(`${D}-group-wrapper`,A,oe),V)}})});var MC={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"};function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ll.apply(this,arguments)}const DC=(e,t)=>h.createElement(Ar,ll({},e,{ref:t,icon:MC})),$C=h.forwardRef(DC);function Zu(e){return["small","middle","large"].includes(e)}function Ju(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const ih=xe.createContext({latestIndex:0}),OC=ih.Provider,_C=e=>{const{className:t,prefix:r,index:n,children:o,separator:s,style:i,classNames:a,styles:c}=e,{latestIndex:l}=h.useContext(ih);return Dr(o)?h.createElement(h.Fragment,null,h.createElement("div",{className:t,style:i},o),n<l&&s&&h.createElement("span",{className:ue(`${r}-item-separator`,a?.separator),style:c?.separator},s)):null},kC=e=>{const{componentCls:t,antCls:r}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${r}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},VC=e=>{const{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}},FC=Ut("Space",e=>{const t=_t(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[kC(t),VC(t)]},()=>({}),{resetStyle:!1}),UC=h.forwardRef((e,t)=>{const{getPrefixCls:r,direction:n,size:o,className:s,style:i,classNames:a,styles:c}=Gt("space"),{size:l=o??"small",align:f,className:y,rootClassName:m,children:d,direction:v,orientation:b,prefixCls:S,split:u,separator:C,style:x,vertical:I,wrap:N=!1,classNames:E,styles:g,...p}=e,[T,R]=Array.isArray(l)?l:[l,l],B=Zu(R),P=Zu(T),D=Ju(R),U=Ju(T),_=Ln(d,{keepEmpty:!0}),[V,z]=gf(b,I,v),q=f===void 0&&!z?"center":f,G=C??u,Y=r("space",S),[ee,J]=FC(Y),te={...e,size:l,orientation:V,align:q},[Q,Z]=kt([a,E],[c,g],{props:te}),W=ue(Y,s,ee,`${Y}-${V}`,{[`${Y}-rtl`]:n==="rtl",[`${Y}-align-${q}`]:q,[`${Y}-gap-row-${R}`]:B,[`${Y}-gap-col-${T}`]:P},y,m,J,Q.root),oe=ue(`${Y}-item`,Q.item),ie=_.map((O,w)=>{const M=O?.key||`${oe}-${w}`;return h.createElement(_C,{prefix:Y,classNames:Q,styles:Z,className:oe,key:M,index:w,separator:G,style:Z.item},O)}),A=h.useMemo(()=>({latestIndex:_.reduce((w,M,H)=>Dr(M)?H:w,0)}),[_]);if(_.length===0)return null;const $={};return N&&($.flexWrap="wrap"),!P&&U&&($.columnGap=T),!B&&D&&($.rowGap=R),h.createElement("div",{ref:t,className:W,style:{...$,...Z.root,...i,...x},...p},h.createElement(OC,{value:A},ie))}),Qo=UC;Qo.Compact=yf;Qo.Addon=NC;const sh=e=>{const{getPopupContainer:t,getPrefixCls:r,direction:n}=h.useContext(Rt),{prefixCls:o,type:s="default",danger:i,disabled:a,loading:c,onClick:l,htmlType:f,children:y,className:m,menu:d,arrow:v,autoFocus:b,trigger:S,align:u,open:C,onOpenChange:x,placement:I,getPopupContainer:N,href:E,icon:g=h.createElement(Bp,null),title:p,buttonsRender:T=$=>$,mouseEnterDelay:R,mouseLeaveDelay:B,overlayClassName:P,overlayStyle:D,destroyOnHidden:U,destroyPopupOnHide:_,dropdownRender:V,popupRender:z,...q}=e,G=r("dropdown",o),Y=`${G}-button`,J={menu:d,arrow:v,autoFocus:b,align:u,disabled:a,trigger:a?[]:S,onOpenChange:x,getPopupContainer:N||t,mouseEnterDelay:R,mouseLeaveDelay:B,classNames:{root:P},styles:{root:D},destroyOnHidden:U,popupRender:z||V},{compactSize:te,compactItemClassnames:Q}=Dn(G,n),Z=ue(Y,Q,m);"destroyPopupOnHide"in e&&(J.destroyPopupOnHide=_),"open"in e&&(J.open=C),"placement"in e?J.placement=I:J.placement=n==="rtl"?"bottomLeft":"bottomRight";const W=h.createElement(Or,{type:s,danger:i,disabled:a,loading:c,onClick:l,htmlType:f,href:E,title:p},y),oe=h.createElement(Or,{type:s,danger:i,icon:g}),[ie,A]=T([W,oe]);return h.createElement(Qo.Compact,{className:Z,size:te,block:!0,...q},ie,h.createElement(qo,{...J},A))};sh.__ANT_BUTTON=!0;const lh=qo;lh.Button=sh;const jC=e=>Dr(e)?typeof e=="object"&&!h.isValidElement(e)?e:{title:e}:null;function bo(e){const[t,r]=h.useState(e);return h.useEffect(()=>{const n=setTimeout(()=>{r(e)},e.length?0:10);return()=>{clearTimeout(n)}},[e]),t}const HC=e=>{const{componentCls:t}=e,r=`${t}-show-help`,n=`${t}-show-help-item`;return{[r]:{transition:`opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}
71},[n]:{overflow:"hidden",transition:`height ${e.motionDurationFast} ${e.motionEaseInOut}, 72 opacity ${e.motionDurationFast} ${e.motionEaseInOut}, 73 transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${n}-appear, &${n}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${n}-leave-active`]:{transform:"translateY(-5px)"}}}}},zC=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Re(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),ed=(e,t)=>{const{formItemCls:r}=e;return{[r]:{[`${r}-label > label`]:{height:t},[`${r}-control-input`]:{minHeight:t}}}},KC=e=>{const{componentCls:t}=e;return{[e.componentCls]:{...Ot(e),...zC(e),[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":{...ed(e,e.controlHeightSM)},"&-large":{...ed(e,e.controlHeightLG)}}}},GC=e=>{const{formItemCls:t,iconCls:r,rootPrefixCls:n,antCls:o,labelRequiredMarkColor:s,labelColor:i,labelFontSize:a,labelHeight:c,labelColonMarginInlineStart:l,labelColonMarginInlineEnd:f,itemMarginBottom:y}=e,[m]=kr(o,"grid");return{[t]:{...Ot(e),marginBottom:y,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, 74 &-hidden${o}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset","> label":{verticalAlign:"middle",textWrap:"balance"}},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:c,color:i,fontSize:a,[`> ${r}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required`]:{"&::before":{display:"inline-block",marginInlineEnd:e.marginXXS,color:s,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"'},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:"none"}}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:l,marginInlineEnd:f},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{[m("display")]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${n}-col-'"]):not([class*="' ${n}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",[`&:has(> ${o}-switch:only-child, > ${o}-rate:only-child)`]:{display:"flex",alignItems:"center"}}}},[t]:{"&-additional":{display:"flex",flexDirection:"column"},"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:bf,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}}}},Zr=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),qC=e=>
74{const{antCls:t,formItemCls:r}=e;return{[`${r}-horizontal`]:{[`${r}-label`]:{flexGrow:0},[`${r}-control`]:{flex:"1 1 0",minWidth:0},[`${r}-label[class$='-24'], ${r}-label[class*='-24 ']`]:{[`& + ${r}-control`]:{minWidth:"unset"}},[`${t}-col-24${r}-label, 75 ${t}-col-xl-24${r}-label`]:Zr(e)}}},WC=e=>{const{componentCls:t,formItemCls:r,inlineItemMarginBottom:n}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[`${r}-inline`]:{flex:"none",marginInlineEnd:e.margin,marginBottom:n,"&-row":{flexWrap:"nowrap"},[`> ${r}-label, 76 > ${r}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${r}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${r}-has-feedback`]:{display:"inline-block"}}}}},YC=e=>{const{componentCls:t,formItemCls:r,rootPrefixCls:n}=e;return{[`${r} ${r}-label`]:Zr(e),[`${t}:not(${t}-inline)`]:{[r]:{flexWrap:"wrap",[`${r}-label, ${r}-control`]:{[`&:not([class*=" ${n}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},XC=e=>{const{componentCls:t,formItemCls:r,antCls:n}=e;return{[`${r}-vertical`]:{[`${r}-row`]:{flexDirection:"column"},[`${r}-label > label`]:{height:"auto"},[`${r}-control`]:{width:"100%"},[`${r}-label, 77 ${n}-col-24${r}-label, 78 ${n}-col-xl-24${r}-label`]:Zr(e)},[`@media (max-width: ${Re(e.screenXSMax)})`]:[YC(e),{[t]:{[`${r}:not(${r}-horizontal)`]:{[`${n}-col-xs-24${r}-label`]:Zr(e)}}}],[`@media (max-width: ${Re(e.screenSMMax)})`]:{[t]:{[`${r}:not(${r}-horizontal)`]:{[`${n}-col-sm-24${r}-label`]:Zr(e)}}},[`@media (max-width: ${Re(e.screenMDMax)})`]:{[t]:{[`${r}:not(${r}-horizontal)`]:{[`${n}-col-md-24${r}-label`]:Zr(e)}}},[`@media (max-width: ${Re(e.screenLGMax)})`]:{[t]:{[`${r}:not(${r}-horizontal)`]:{[`${n}-col-lg-24${r}-label`]:Zr(e)}}}}},QC=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),ch=(e,t)=>_t(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),hc=Ut("Form",(e,{rootPrefixCls:t})=>{const r=ch(e,t);return[KC(r),GC(r),HC(r),qC(r),WC(r),XC(r),Hf(r),bf]},QC,{order:-1e3}),td=[];function Ei(e,t,r,n=0){return{key:typeof e=="string"?e:`${t}-${n}`,error:e,errorStatus:r}}const uh=({help:e,helpStatus:t,errors:r=td,warnings:n=td,className:o,fieldId:s,onVisibleChanged:i})=>{const{prefixCls:a}=h.useContext(kl),c=`${a}-item-explain`,l=Qt(a),[f,y]=hc(a,l),m=h.useMemo(()=>Ps(a),[a]),d=bo(r),v=bo(n),b=h.useMemo(()=>Dr(e)?[Ei(e,"help",t)]:[].concat(Vt(d.map((C,x)=>Ei(C,"error","error",x))),Vt(v.map((C,x)=>Ei(C,"warning","warning",x)))),[e,t,d,v]),S=h.useMemo(()=>{const C={};return b.forEach(({key:x})=>{C[x]=(C[x]||0)+1}),b.map((x,I)=>({...x,key:C[x.key]>1?`${x.key}-fallback-${I}`:x.key}))},[b]),u={};return s&&(u.id=`${s}_help`),h.createElement(Pl,{motionDeadline:m.motionDeadline,motionName:`${a}-show-help`,visible:!!S.length,onVisibleChanged:i},C=>{const{className:x,style:I}=C;return h.createElement("div",{...u,className:ue(c,x,y,l,o,f),style:I},h.createElement(lg,{keys:S,...Ps(a),motionName:`${a}-show-help-item`,component:!1},N=>{const{key:E,error:g,errorStatus:p,className:T,style:R}=N;return h.createElement("div",{key:E,className:ue(T,{[`${c}-${p}`]:p}),style:R},g)}))})},ZC=(e,t)=>{const r=h.useContext(Vr),{getPrefixCls:n,direction:o,requiredMark:s,colon:i,scrollToFirstError:a,className:c,style:l,styles:f,classNames:y}=Gt("form"),{prefixCls:m,className:d,rootClassName:v,size:b,disabled:S=r,form:u,colon:C,labelAlign:x,labelWrap:I,labelCol:N,wrapperCol:E,layout:g="horizontal",scrollToFirstError:p,requiredMark:T,onFinishFailed:R,name:B,style:P,feedbackIcons:D,variant:U,classNames:_,styles:V,...z}=e,q=an(b),G=h.useContext(cg),Y=h.useMemo(()=>T!==void 0?T:s!==void 0?s:!0,[T,s]),ee=C??i,J=n("form",m),te=Qt(J),[Q,Z]=hc(J,te),W={...e,size:q,disabled:S,layout:g,colon:ee,requiredMark:Y},[oe,ie]=kt([y,_],[f,V],{props:W}),A=ue(J,`${J}-${g}`,{[`${J}-hide-required-mark`]:Y===!1,[`${J}-rtl`]:o==="rtl",[`${J}-${q}`]:q},Z,te,Q,c,d,v,oe.root),[$]=_p(u),{__INTERNAL__:O}=$;O.name=B;const w=h.useMemo(()=>({name:B,labelAlign:x,labelCol:N,labelWrap:I,wrapperCol:E,layout:g,colon:ee,requiredMark:Y,itemRef:O.itemRef,form:$,feedbackIcons:D,classNames:oe,styles:ie}),[B,x,N,E,g,ee,Y,$,D,oe,ie]),M=h.useRef(null);h.useImperativeHandle(t,()=>({...$,nativeElement:M.current?.nativeElement}));const H=(X,ce)=>{if(X){let ae={block:"nearest"};typeof X=="object"&&(ae={...ae,...X}),$.scrollToField(ce,ae)}},F=X=>{if(R?.(X),X.errorFields.length){const ce=X.errorFields[0].name;if(p!==void 0){H(p,ce);return}a!==void 0&&H(a,ce)}};return h.createElement(uf.Provider,{value:U},h.createElement(ug,{disabled:S},h.createElement(dg.Provider,{value:q},h.createElement(Cf,{validateMessages:G}
78,h.createElement(_r.Provider,{value:w},h.createElement(fg,{status:!0},h.createElement(pg,{id:B,...z,name:B,onFinishFailed:F,form:$,ref:M,style:{...ie?.root,...l,...P},className:A})))))))},JC=h.forwardRef(ZC);function ex(e){if(typeof e=="function")return e;const t=Ln(e);return t.length<=1?t[0]:t}const dh=()=>{const{status:e,errors:t=[],warnings:r=[]}=h.useContext(tr);return{status:e,errors:t,warnings:r}};dh.Context=tr;function tx(e){const[t,r]=h.useState(e),n=h.useRef(null),o=h.useRef([]),s=h.useRef(!1);h.useEffect(()=>(s.current=!1,()=>{s.current=!0,Et.cancel(n.current),n.current=null}),[]);function i(a){s.current||(n.current===null&&(o.current=[],n.current=Et(()=>{n.current=null,r(c=>{let l=c;return o.current.forEach(f=>{l=f(l)}),l})})),o.current.push(a))}return[t,i]}function rx(){const{itemRef:e}=h.useContext(_r),t=h.useRef({});function r(n,o){const s=o&&typeof o=="object"&&ha(o),i=n.join("_");return(t.current.name!==i||t.current.originRef!==s)&&(t.current.name=i,t.current.originRef=s,t.current.ref=Cr(e(n),s)),t.current.ref}return r}const nx=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}},ax=Vl(["Form","item-item"],(e,{rootPrefixCls:t})=>{const r=ch(e,t);return nx(r)}),ox=24,ix=e=>{const{prefixCls:t,status:r,labelCol:n,wrapperCol:o,children:s,errors:i,warnings:a,_internalItemRender:c,extra:l,help:f,fieldId:y,marginBottom:m,onErrorVisibleChanged:d,label:v}=e,b=`${t}-item`,S=h.useContext(_r),{classNames:u,styles:C}=S,x=h.useMemo(()=>{let V={...o||S.wrapperCol||{}};return v===null&&!n&&!o&&S.labelCol&&[void 0,"xs","sm","md","lg","xl","xxl"].forEach(q=>{const G=q?[q]:[],Y=Hc(S.labelCol,G),ee=typeof Y=="object"?Y:{},J=Hc(V,G),te=typeof J=="object"?J:{};"span"in ee&&!("offset"in te)&&ee.span<ox&&(V=hg(V,[].concat(G,["offset"]),ee.span))}),V},[o,S.wrapperCol,S.labelCol,v,n]),I=ue(`${b}-control`,x.className),N=h.useMemo(()=>{const{labelCol:V,wrapperCol:z,...q}=S;return q},[S]),E=h.useRef(null),[g,p]=h.useState(0);$t(()=>{l&&E.current?p(E.current.clientHeight):p(0)},[l]);const T=h.createElement("div",{className:`${b}-control-input`},h.createElement("div",{className:ue(`${b}-control-input-content`,u?.content),style:C?.content},s)),R=h.useMemo(()=>({prefixCls:t,status:r}),[t,r]),B=m!==null||i.length||a.length?h.createElement(kl.Provider,{value:R},h.createElement(uh,{fieldId:y,errors:i,warnings:a,help:f,helpStatus:r,className:`${b}-explain-connected`,onVisibleChanged:d})):null,P={};y&&(P.id=`${y}_extra`);const D=l?h.createElement("div",{...P,className:`${b}-extra`,ref:E},l):null,U=B||D?h.createElement("div",{className:`${b}-additional`,style:m?{minHeight:m+g}:{}},B,D):null,_=c&&c.mark==="pro_table_render"&&c.render?c.render(e,{input:T,errorList:B,extra:D}):h.createElement(h.Fragment,null,T,U);return h.createElement(_r.Provider,{value:N},h.createElement(th,{...x,className:I},_),h.createElement(ax,{prefixCls:t}))},sx=({prefixCls:e,label:t,htmlFor:r,labelCol:n,labelAlign:o,colon:s,required:i,requiredMark:a,tooltip:c,vertical:l})=>{const[f]=Bo("Form"),{labelAlign:y,labelCol:m,labelWrap:d,colon:v,classNames:b,styles:S}=h.useContext(_r);if(!t)return null;const u=n||m||{},C=o||y,x=`${e}-item-label`,I=ue(x,C==="left"&&`${x}-left`,u.className,{[`${x}-wrap`]:!!d});let N=t;const E=s===!0||v!==!1&&s!==!1;E&&!l&&typeof t=="string"&&t.trim()&&(N=t.replace(/[:|ï¼]\s*$/,""));const p=jC(c);if(p){const{icon:U=h.createElement(Mf,null),..._}=p,V=h.createElement(On,{..._},h.cloneElement(U,{className:`${e}-item-tooltip`,title:"",onClick:z=>{z.preventDefault()},tabIndex:null}));N=h.createElement(h.Fragment,null,N,V)}const T=a==="optional",R=typeof a=="function",B=a===!1;R?N=a(N,{required:!!i}):T&&!i&&(N=h.createElement(h.Fragment,null,N,h.createElement("span",{className:`${e}-item-optional`,title:""},f?.optional||mg.Form?.optional)));let P;B?P="hidden":(T||R)&&(P="optional");const D=ue(b?.label,{[`${e}-item-required`]:i,[`${e}-item-required-mark-${P}`]:P,[`${e}-item-no-colon`]:!E});return h.createElement(th,{...u,className:I},h.createElement("label",{htmlFor:r,className:D,style:S?.label,title:typeof t=="string"?t:""},N))},lx={success:af,warning:nf,error:Po,validating:Lo};function fh({children:e,errors:t,warnings:r,hasFeedback:n,validateStatus:o,prefixCls:s,meta:i,noStyle:a,name:c}){const l=`${s}-item`,{feedbackIcons:f}=h.useContext(_r),y=Op(t,r,i,null,!!n,o),{isFormItemInput:m,status:d,hasFeedback:v,feedbackIcon:b,name:S}=h.useContext(tr),u=h.useMemo(()=>{let C;if(n){const I=n!==!0&&n.icons||f,N=y&&I?.({status:y,errors:t,warnings:r})?.[y],E=y?lx[y]:null;C=N!==!1&&E?h.createElement("span",{className:ue(`${l}-feedback-icon`,`${l}-feedback-icon-${y}`)},N||h.createElement(E,null)):null}const x={status:y||"",errors:t,warnings:r,hasFeedback:!!n,feedbackIcon:C,isFormItemInput:!0,name:c};return a&&(x.status=(y??d)||"",x.isFormItemInput=m,x.hasFeedback=!!(n??v),x.feedbackIcon=n!==void 0?x.feedbackIcon:b,x.name=c??S),x},[y,n,a,m,d]);return h.createElement(tr.Provider,{value:u},e)}function cx(e){const{prefixCls:t,className:r,rootClassName:n,style:o,help:s,errors:i,warnings:a,validateStatus:c,meta:l,hasFeedback:f,hidden:y,children:m,fieldId:d,required:v,isRequired:b,onSubItemMetaChange:S,layout:u,name:C,...x}=e,I=`${t}-item`,{requiredMark:N,layout:E}=h.useContext(_r),g=u||E,p=g==="vertical",T=h.useRef(null),R=bo(i),B=bo(a),P=Dr(s),D=!!(P||i.length||a.length),U=!!T.current&&gg(T.current),[_,V]=h.useState(null);$t(()=>{if(D&&T.current){const ee=getComputedStyle(T.current);V(Number.parseInt(ee.marginBottom,10))}},[D,U]);const z=ee=>{ee||V(null)},G=((ee=!1)=>{const J=ee?R:l.errors,te=ee?B:l.warnings;return Op(J,te,l,"",!!f,c)})(),Y=ue(I,r,n,{[`${I}-with-help`]:P||R.length||B.length,[`${I}-has-feedback`]:G&&f,[`${I}-has-success`]:G==="success",[`${I}-has-warning`]:G==="warning",[`${I}-has-error`]:G==="error",[`${I}-is-validating`]:G==="validating",[`${I}-hidden`]:y,[`${I}-${g}`]:g});return h.createElement("div",{className:Y,style:o,ref:T},h.createElement(IC,{className:`${I}-row`,...Tt(x,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])},h.createElement(sx,{htmlFor:d,...e,requiredMark:N,required:v??b,prefixCls:t,vertical:p}),h.createElement(ix,{...e,...l,errors:R,warnings:B,prefixCls:t,status:G,help:s,marginBottom:_,onErrorVisibleChanged:z},h.createElement(xf.Provider,{value:S},h.createElement(fh,{prefixCls:t,meta:l,errors:l.errors,warnings:l.warnings,hasFeedback:f,validateStatus:G,name:C},m)))),!!_&&h.createElement("div",{className:`${I}-margin-offset`,style:{marginBottom:-_}}))}const ux="__SPLIT__";function dx(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(o=>{const s=e[o],i=t[o];
78return s===i||typeof s=="function"||typeof i=="function"})}const fx=h.memo(e=>e.children,(e,t)=>dx(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((r,n)=>r===t.childProps[n]));function rd(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function px(e){const{name:t,noStyle:r,className:n,dependencies:o,prefixCls:s,shouldUpdate:i,rules:a,children:c,required:l,label:f,messageVariables:y,trigger:m="onChange",validateTrigger:d,hidden:v,help:b,layout:S}=e,{getPrefixCls:u}=h.useContext(Rt),{name:C}=h.useContext(_r),x=ex(c),I=typeof x=="function",N=h.useContext(xf),{validateTrigger:E}=h.useContext(vg),g=Dr(d)?d:E,p=Dr(t),T=u("form",s),R=Qt(T),[B,P]=hc(T,R),D=h.useContext(yg),U=h.useRef(null),[_,V]=tx({}),[z,q]=bg(()=>rd()),G=W=>{const oe=D?.getKey(W.name);if(q(W.destroy?rd():W,!0),r&&b!==!1&&N){let ie=W.name;if(W.destroy)ie=U.current||ie;else if(oe!==void 0){const[A,$]=oe;ie=[A].concat(Vt($)),U.current=ie}N(W,ie)}},Y=(W,oe)=>{V(ie=>{const A={...ie},O=[].concat(Vt(W.name.slice(0,-1)),Vt(oe)).join(ux);return W.destroy?delete A[O]:A[O]=W,A})},[ee,J]=h.useMemo(()=>{const W=Vt(z.errors),oe=Vt(z.warnings);return Object.values(_).forEach(ie=>{W.push.apply(W,Vt(ie.errors||[])),oe.push.apply(oe,Vt(ie.warnings||[]))}),[W,oe]},[_,z.errors,z.warnings]),te=rx();function Q(W,oe,ie){return r&&!v?h.createElement(fh,{prefixCls:T,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:z,errors:ee,warnings:J,noStyle:!0,name:t},W):h.createElement(cx,{key:"row",...e,className:ue(n,P,R,B),prefixCls:T,fieldId:oe,isRequired:ie,errors:ee,warnings:J,meta:z,onSubItemMetaChange:Y,layout:S,name:t},W)}if(!p&&!I&&!o)return Q(x);let Z={};return typeof f=="string"?Z.label=f:t&&(Z.label=String(t)),y&&(Z={...Z,...y}),h.createElement(Cg,{...e,messageVariables:Z,trigger:m,validateTrigger:g,onMetaChange:G},(W,oe,ie)=>{const A=ea(t).length&&oe?oe.name:[],$=$p(A,C),O=l!==void 0?l:!!a?.some(H=>
78{if(H&&typeof H=="object"&&H.required&&!H.warningOnly)return!0;if(typeof H=="function"){const F=H(ie);return F?.required&&!F?.warningOnly}return!1}),w={...W};let M=null;if(Array.isArray(x)&&p)M=x;else if(!(I&&(!(i||o)||p))){if(!(o&&!I&&!p))if(h.isValidElement(x)){const H={...x.props,...w};if(H.id||(H.id=$),b||ee.length>0||J.length>0||e.extra){const ce=[];(b||ee.length>0)&&ce.push(`${$}_help`),e.extra&&ce.push(`${$}_extra`),H["aria-describedby"]=ce.join(" ")}ee.length>0&&(H["aria-invalid"]="true"),O&&(H["aria-required"]="true"),Ol(x)&&(H.ref=te(A,x)),new Set([].concat(Vt(ea(m)),Vt(ea(g)))).forEach(ce=>{H[ce]=(...ae)=>{w[ce]?.(...ae),x.props[ce]?.(...ae)}});const X=[H["aria-required"],H["aria-invalid"],H["aria-describedby"]];M=h.createElement(fx,{control:w,update:x,childProps:X},$r(x,H))}else I&&(i||o)&&!p?M=x(ie):M=x}return Q(M,$,O)})}const ph=px;ph.useStatus=dh;const hx=({prefixCls:e,children:t,...r})=>{const{getPrefixCls:n}=h.useContext(Rt),o=n("form",e),s=h.useMemo(()=>({prefixCls:o,status:"error"}),[o]);return h.createElement(xg,{...r},(i,a,c)=>h.createElement(kl.Provider,{value:s},t(i.map(l=>({...l,fieldKey:l.key})),a,{errors:c.errors,warnings:c.warnings})))};function mx(){const{form:e}=h.useContext(_r);return e}const et=JC;et.Item=ph;et.List=hx;et.ErrorList=uh;et.useForm=_p;et.useFormInstance=mx;et.useWatch=Sg;et.Provider=Cf;const gx=e=>{const{getPrefixCls:t,direction:r}=h.useContext(Rt),{prefixCls:n,className:o}=e,s=t("input-group",n),i=t("input"),[a,c]=Xp(i),l=ue(s,c,{[`${s}-lg`]:e.size==="large",[`${s}-sm`]:e.size==="small",[`${s}-compact`]:e.compact,[`${s}-rtl`]:r==="rtl"},a,o),f=h.useContext(tr),y=h.useMemo(()=>({...f,isFormItemInput:!1}),[f]);return h.createElement(tr.Provider,{value:y},h.createElement(Qo.Compact,{className:l,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},e.children))},vx=e=>{const{componentCls:t,paddingXS:r}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:r,[`${t}-input-wrapper`]:{position:"relative",[`${t}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${t}-mask-input`]:{color:"transparent",caretColor:e.colorText},[`${t}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${t}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${t}-input`]:{textAlign:"center",paddingInline:e.paddingXXS},[`&${t}-sm ${t}-input`]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},[`&${t}-lg ${t}-input`]:{paddingInline:e.paddingXS}}}},yx=Ut(["Input","OTP"],e=>{const t=_t(e,Wo(e));return vx(t)},Yo),bx=h.forwardRef((e,t)=>{const{className:r,value:n,onChange:o,onActiveChange:s,index:i,mask:a,onFocus:c,...l}=e,{getPrefixCls:f}=h.useContext(Rt),y=f("otp"),m=typeof a=="string"?a:n,d=h.useRef(null);h.useImperativeHandle(t,()=>d.current);const v=C=>{o(i,C.target.value)},b=()=>{Et(()=>{const C=d.current?.input;document.activeElement===C&&C&&C.select()})},S=C=>{c?.(C),b()},u=C=>{const{key:x,ctrlKey:I,metaKey:N}=C;x==="ArrowLeft"?s(i-1):x==="ArrowRight"?s(i+1):x==="z"&&(I||N)?C.preventDefault():x==="Backspace"&&!n&&s(i-1),b()};return h.createElement("span",{className:`${y}-input-wrapper`,role:"presentation"},a&&n!==""&&n!==void 0&&h.createElement("span",{className:`${y}-mask-icon`,"aria-hidden":"true"},m),h.createElement(Xo,{"aria-label":`OTP Input ${i+1}`,type:a===!0?"password":"text",...l,ref:d,value:n,onInput:v,onFocus:S,onKeyDown:u,onMouseDown:b,onMouseUp:b,className:ue(r,{[`${y}-mask-input`]:a})}))});function $a(e){return(e||"").split("")}const Cx=e=>{const{index:t,prefixCls:r,separator:n,className:o,style:s}=e,i=typeof n=="function"?n(t):n;return i?h.createElement("span",{className:ue(`${r}-separator`,o),style:s},i):null},xx=h.forwardRef((e,t)=>{const{prefixCls:r,length:n=6,size:o,defaultValue:s,value:i,onChange:a,formatter:c,separator:l,variant:f,disabled:y,status:m,autoFocus:d,mask:v,type:b,onInput:S,onFocus:u,inputMode:C,classNames:x,styles:I,className:N,style:E,...g}=e,{classNames:p,styles:T,getPrefixCls:R,direction:B,style:P,className:D}=Gt("otp"),U=R("otp",r),_={...e,length:n},[V,z]=kt([p,x],[T,I],{props:_}),q=wr(g,{aria:!0,data:!0,attr:!0}),[G,Y]=yx(U),ee=an(X=>o??X),J=h.useContext(tr),te=Ho(J.status,m),Q=h.useMemo(()=>({...J,status:te,hasFeedback:!1,feedbackIcon:null}),[J,te]),Z=h.useRef(null),W=h.useRef({});h.useImperativeHandle(t,()=>({focus:()=>
78{W.current[0]?.focus()},blur:()=>{for(let X=0;X<n;X+=1)W.current[X]?.blur()},nativeElement:Z.current}));const oe=X=>c?c(X):X,[ie,A]=h.useState(()=>$a(oe(s||"")));h.useEffect(()=>{i!==void 0&&A($a(i))},[i]);const $=Nt(X=>{A(X),S&&S(X),a&&X.length===n&&X.every(ce=>ce)&&X.some((ce,ae)=>ie[ae]!==ce)&&a(X.join(""))}),O=Nt((X,ce)=>{let ae=Vt(ie);for(let de=0;de<X;de+=1)ae[de]||(ae[de]="");ce.length<=1?ae[X]=ce:ae=ae.slice(0,X).concat($a(ce)),ae=ae.slice(0,n);for(let de=ae.length-1;de>=0&&!ae[de];de-=1)ae.pop();const re=oe(ae.map(de=>de||" ").join(""));return ae=$a(re).map((de,Ce)=>de===" "&&!ae[Ce]?ae[Ce]:de),ae}),w=(X,ce)=>{const ae=O(X,ce),re=Math.min(X+ce.length,n-1);re!==X&&ae[X]!==void 0&&W.current[re]?.focus(),$(ae)},M=X=>{W.current[X]?.focus()},H=(X,ce)=>{for(let ae=0;ae<ce;ae+=1)if(!W.current[ae]?.input?.value){W.current[ae]?.focus();break}u?.(X)},F={variant:f,disabled:y,status:te,mask:v,type:b,inputMode:C};return h.createElement("div",{...q,ref:Z,className:ue(N,U,{[`${U}-sm`]:ee==="small",[`${U}-lg`]:ee==="large",[`${U}-rtl`]:B==="rtl"},Y,G,D,V.root),style:{...z.root,...P,...E},role:"group"},h.createElement(tr.Provider,{value:Q},Array.from({length:n}).map((X,ce)=>{const ae=`otp-${ce}`,re=ie[ce]||"";return h.createElement(h.Fragment,{key:ae},h.createElement(bx,{ref:de=>{W.current[ce]=de},index:ce,size:ee,htmlSize:1,className:ue(V.input,`${U}-input`),style:z.input,onChange:w,value:re,onActiveChange:M,autoFocus:ce===0&&d,onFocus:de=>H(de,ce),...F}),ce<n-1&&h.createElement(Cx,{separator:l,index:ce,prefixCls:U,className:ue(V.separator),style:z.separator}))})))});var Sx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cl.apply(this,arguments)}const Ex=(e,t)=>h.createElement(Ar,cl({},e,{ref:t,icon:Sx})),wx=h.forwardRef(Ex);var Ix={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ul.apply(this,arguments)}const Tx=(e,t)=>h.createElement(Ar,ul({},e,{ref:t,icon:Ix})),Ax=h.forwardRef(Tx),Nx=e=>e?h.createElement(Ax,null):h.createElement(wx,null),Rx={click:"onClick",hover:"onMouseOver"},Px=h.forwardRef((e,t)=>{const{disabled:r,action:n="click",visibilityToggle:o=!0,iconRender:s=Nx,suffix:i}=e,a=h.useContext(Vr),c=r??a,l=typeof o=="object"&&o.visible!==void 0,[f,y]=h.useState(()=>l?o.visible:!1),m=h.useRef(null);h.useEffect(()=>{l&&y(o.visible)},[l,o]);const d=oh(m),v=()=>{if(c)return;f&&d();const B=!f;y(B),typeof o=="object"&&o.onVisibleChange?.(B)},b=B=>{const P=Rx[n]||"",D=s(f),U={[P]:v,className:`${B}-icon`,key:"passwordIcon",onMouseDown:_=>{_.preventDefault()},onMouseUp:_=>{_.preventDefault()}};return h.cloneElement(h.isValidElement(D)?D:h.createElement("span",null,D),U)},{className:S,prefixCls:u,inputPrefixCls:C,size:x,...I}=e,{getPrefixCls:N}=h.useContext(Rt),E=N("input",C),g=N("input-password",u),p=o&&b(g),T=ue(g,S,{[`${g}-${x}`]:!!x}),R={...Tt(I,["suffix","iconRender","visibilityToggle"]),type:f?"text":"password",className:T,prefixCls:E,suffix:h.createElement(h.Fragment,null,p,i)};return x&&(R.size=x),h.createElement(Xo,{ref:Cr(t,m),...R})}),Bx=e=>{const{componentCls:t}=e,r=`${t}-btn`;return{[t]:{width:"100%",[r]:{"&-filled":{background:e.colorFillTertiary,"&:not(:disabled)":{"&:hover":{background:e.colorFillSecondary},"&:active":{background:e.colorFill}}}}}}},Lx=Ut(["Input","Search"],e=>[Bx(e)]),Mx=h.forwardRef((e,t)=>
78{const{prefixCls:r,inputPrefixCls:n,className:o,size:s,style:i,enterButton:a=!1,addonAfter:c,loading:l,disabled:f,onSearch:y,onChange:m,onCompositionStart:d,onCompositionEnd:v,variant:b,onPressEnter:S,classNames:u,styles:C,hidden:x,...I}=e,{direction:N,getPrefixCls:E,classNames:g,styles:p}=Gt("inputSearch"),T={...e,enterButton:a},[R,B]=kt([g,u],[p,C],{props:T},{button:{_default:"root"}}),P=h.useRef(!1),D=E("input-search",r),U=E("input",n),[_,V]=Lx(D),{compactSize:z}=Dn(D,N),q=an(F=>s??z??F),G=h.useRef(null),Y=F=>{F?.target&&F.type==="click"&&y&&y(F.target.value,F,{source:"clear"}),m?.(F)},ee=F=>{document.activeElement===G.current?.input&&F.preventDefault()},J=F=>{y&&y(G.current?.input?.value,F,{source:"input"})},te=F=>{P.current||l||(S?.(F),J(F))},Q=typeof a=="boolean"?h.createElement(sp,null):null,Z=`${D}-btn`,W=ue(Z,{[`${Z}-${b}`]:b});let oe;const ie=a||{},A=ie.type&&ie.type.__ANT_BUTTON===!0;A||ie.type==="button"?oe=$r(ie,{onMouseDown:ee,onClick:F=>{ie?.props?.onClick?.(F),J(F)},key:"enterButton",...A?{className:W,size:q}:{}}):oe=h.createElement(Or,{classNames:R.button,styles:B.button,className:W,color:a?"primary":"default",size:q,disabled:f,key:"enterButton",onMouseDown:ee,onClick:J,loading:l,icon:Q,variant:b==="borderless"||b==="filled"||b==="underlined"?"text":a?"solid":void 0},a),c&&(oe=[oe,$r(c,{key:"addonAfter"})]);const $=ue(D,V,{[`${D}-rtl`]:N==="rtl",[`${D}-${q}`]:!!q,[`${D}-with-button`]:!!a},o,_,R.root),O=F=>{P.current=!0,d?.(F)},w=F=>{P.current=!1,v?.(F)},M=wr(I,{data:!0}),H=Tt({...I,classNames:Tt(R,["button","root"]),styles:Tt(B,["button","root"]),prefixCls:U,type:"search",size:q,variant:b,onPressEnter:te,onCompositionStart:O,onCompositionEnd:w,onChange:Y,disabled:f},Object.keys(M));return h.createElement(yf,{className:$,style:{...i,...B.root},...M,hidden:x},h.createElement(Xo,{ref:Cr(G,t),...H}),oe)}),Dx=` 79 min-height:0 !important; 80 max-height:none !important; 81 height:0 !important; 82 visibility:hidden !important; 83 overflow:hidden !important; 84 position:absolute !important; 85 z-index:-1000 !important; 86 top:0 !important; 87 right:0 !important; 88 pointer-events: none !important; 89`,$x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],wi={};let ar;function Ox(e,t=!1){const r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&wi[r])return wi[r];const n=window.getComputedStyle(e),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),s=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),i=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),c={sizingStyle:$x.map(l=>`${l}:${n.getPropertyValue(l)}`).join(";"),paddingSize:s,borderSize:i,boxSizing:o};return t&&r&&(wi[r]=c),c}function _x(e,t=!1,r=null,n=null){ar||(ar=document.createElement("textarea"),ar.setAttribute("tab-index","-1"),ar.setAttribute("aria-hidden","true"),ar.setAttribute("name","hiddenTextarea"),document.body.appendChild(ar)),e.getAttribute("wrap")?ar.setAttribute("wrap",e.getAttribute("wrap")):ar.removeAttribute("wrap");const{paddingSize:o,borderSize:s,boxSizing:i,sizingStyle:a}=Ox(e,t);ar.setAttribute("style",`${a};${Dx}`),ar.value=e.value||e.placeholder||"";let c,l,f,y=ar.scrollHeight;if(i==="border-box"?y+=s:i==="content-box"&&(y-=o),r!==null||n!==null){ar.value=" ";const d=ar.scrollHeight-o;r!==null&&(c=d*r,i==="border-box"&&(c=c+o+s),y=Math.max(c,y)),n!==null&&(l=d*n,i==="border-box"&&(l=l+o+s),f=y>l?"":"hidden",y=Math.min(l,y))}const m={height:y,overflowY:f,resize:"none"};return c&&(m.minHeight=c),l&&(m.maxHeight=l),m}function dl(){return dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dl.apply(this,arguments)}const Ii=0,Ti=1,Ai=2,kx=h.forwardRef((e,t)=>
89{const{prefixCls:r,defaultValue:n,value:o,autoSize:s,onResize:i,className:a,style:c,disabled:l,onChange:f,onInternalAutoSize:y,...m}=e,[d,v]=Xt(n,o),b=d??"",S=_=>{v(_.target.value),f?.(_)},u=h.useRef();h.useImperativeHandle(t,()=>({textArea:u.current}));const[C,x]=h.useMemo(()=>s&&typeof s=="object"?[s.minRows,s.maxRows]:[],[s]),I=!!s,[N,E]=h.useState(Ai),[g,p]=h.useState(),T=()=>{E(Ii)};$t(()=>{I&&T()},[o,C,x,I]),$t(()=>{if(N===Ii)E(Ti);else if(N===Ti){const _=_x(u.current,!1,C,x);E(Ai),p(_)}},[N]);const R=h.useRef(),B=()=>{Et.cancel(R.current)},P=_=>{N===Ai&&(i?.(_),s&&(B(),R.current=Et(()=>{T()})))};h.useEffect(()=>B,[]);const U={...c,...I?g:null};return(N===Ii||N===Ti)&&(U.overflowY="hidden",U.overflowX="hidden"),h.createElement(ma,{onResize:P,disabled:!(s||i)},h.createElement("textarea",dl({},m,{ref:u,style:U,className:ue(r,a,{[`${r}-disabled`]:l}),disabled:l,value:b,onChange:S})))});function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fl.apply(this,arguments)}const Vx=xe.forwardRef(({defaultValue:e,value:t,onFocus:r,onBlur:n,onChange:o,allowClear:s,maxLength:i,onCompositionStart:a,onCompositionEnd:c,suffix:l,prefixCls:f="rc-textarea",showCount:y,count:m,className:d,style:v,disabled:b,hidden:S,classNames:u,styles:C,onResize:x,onClear:I,onPressEnter:N,readOnly:E,autoSize:g,onKeyDown:p,...T},R)=>{const[B,P]=Xt(e,t),D=B==null?"":String(B),[U,_]=xe.useState(!1),V=xe.useRef(!1),[z,q]=xe.useState(null),G=h.useRef(null),Y=h.useRef(null),ee=()=>Y.current?.textArea,J=()=>{ee().focus()};h.useImperativeHandle(R,()=>({resizableTextArea:Y.current,focus:J,blur:()=>{ee().blur()},nativeElement:G.current?.nativeElement||ee()})),h.useEffect(()=>{_(he=>!b&&he)},[b]);const[te,Q]=xe.useState(null);xe.useEffect(()=>{te&&ee().setSelectionRange(...te)},[te]);const Z=nh(m,y),W=Z.max??i,oe=Number(W)>0,ie=Z.strategy(D),A=!!W&&ie>W,$=(he,ye)=>{let De=ye;!V.current&&Z.exceedFormatter&&Z.max&&Z.strategy(ye)>Z.max&&(De=Z.exceedFormatter(ye,{max:Z.max}),ye!==De&&Q([ee().selectionStart||0,ee().selectionEnd||0])),P(De),vo(he.currentTarget,he,o,De)},O=he=>{V.current=!0,a?.(he)},w=he=>{V.current=!1,$(he,he.currentTarget.value),c?.(he)},M=he=>{$(he,he.target.value)},H=he=>{he.key==="Enter"&&N&&!he.nativeEvent.isComposing&&N(he),p?.(he)},F=he=>{_(!0),r?.(he)},X=he=>{_(!1),n?.(he)},ce=he=>{P(""),J(),vo(ee(),he,o)};let ae=l,re;Z.show&&(Z.showFormatter?re=Z.showFormatter({value:D,count:ie,maxLength:W}):re=`${ie}${oe?` / ${W}`:""}`,ae=xe.createElement(xe.Fragment,null,ae,xe.createElement("span",{className:ue(`${f}-data-count`,u?.count),style:C?.count},re)));const de=he=>{x?.(he),ee()?.style.height&&q(!0)},Ce=!g&&!y&&!s;return xe.createElement(rh,{ref:G,value:D,allowClear:s,handleReset:ce,suffix:ae,prefixCls:f,classNames:{...u,affixWrapper:ue(u?.affixWrapper,{[`${f}-show-count`]:y,[`${f}-textarea-allow-clear`]:s})},disabled:b,focused:U,className:ue(d,A&&`${f}-out-of-range`),style:{...v,...z&&!Ce?{height:"auto"}:{}},dataAttrs:{affixWrapper:{"data-count":typeof re=="string"?re:void 0}},hidden:S,readOnly:E,onClear:I},xe.createElement(kx,fl({},T,{autoSize:g,maxLength:i,onKeyDown:H,onChange:M,onFocus:F,onBlur:X,onCompositionStart:O,onCompositionEnd:w,className:ue(u?.textarea),style:{resize:v?.resize,...C?.textarea},disabled:b,prefixCls:f,onResize:de,ref:Y,readOnly:E})))}),Fx=e=>{const{componentCls:t,paddingLG:r}=e,n=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[n]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[` 90 &-allow-clear > ${t}, 91 &-affix-wrapper${n}-has-feedback ${t} 92 `]:{paddingInlineEnd:r},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},Ux=Ut(["Input","TextArea"],e=>{const t=_t(e,Wo(e));return Fx(t)},Yo,{resetFont:!1}),jx=h.forwardRef((e,t)=>
92{const{prefixCls:r,bordered:n=!0,size:o,disabled:s,status:i,allowClear:a,classNames:c,rootClassName:l,className:f,style:y,styles:m,variant:d,showCount:v,onMouseDown:b,onResize:S,...u}=e,{getPrefixCls:C,direction:x,allowClear:I,autoComplete:N,className:E,style:g,classNames:p,styles:T}=Gt("textArea"),R=h.useContext(Vr),B=s??R,{status:P,hasFeedback:D,feedbackIcon:U}=h.useContext(tr),_=Ho(P,i),[V,z]=kt([p,c],[T,m],{props:e}),q=h.useRef(null);h.useImperativeHandle(t,()=>({resizableTextArea:q.current?.resizableTextArea,focus:F=>{vf(q.current?.resizableTextArea?.textArea,F)},blur:()=>q.current?.blur(),nativeElement:q.current?.nativeElement||null}));const G=C("input",r),Y=Qt(G),[ee,J]=Yp(G,l);Ux(G,Y);const{compactSize:te,compactItemClassnames:Q}=Dn(G,x),Z=an(F=>o??te??F),[W,oe]=nc("textArea",d,n),ie=ah(a??I),[A,$]=h.useState(!1),[O,w]=h.useState(!1),M=F=>{$(!0),b?.(F);const X=()=>{$(!1),document.removeEventListener("mouseup",X)};document.addEventListener("mouseup",X)},H=F=>{if(S?.(F),A&&typeof getComputedStyle=="function"){const X=q.current?.nativeElement?.querySelector("textarea");X&&getComputedStyle(X).resize==="both"&&w(!0)}};return h.createElement(Vx,{autoComplete:N,...u,style:{...z.root,...g,...y},styles:z,disabled:B,allowClear:ie,className:ue(J,Y,f,l,Q,E,V.root,{[`${G}-textarea-affix-wrapper-resize-dirty`]:O}),classNames:{...V,textarea:ue({[`${G}-sm`]:Z==="small",[`${G}-lg`]:Z==="large"},ee,V.textarea,A&&`${G}-mouse-active`),variant:ue({[`${G}-${W}`]:oe},ia(G,_)),affixWrapper:ue(`${G}-textarea-affix-wrapper`,{[`${G}-affix-wrapper-rtl`]:x==="rtl",[`${G}-affix-wrapper-sm`]:Z==="small",[`${G}-affix-wrapper-lg`]:Z==="large",[`${G}-textarea-show-count`]:v||e.count?.show},ee)},prefixCls:G,suffix:D&&h.createElement("span",{className:`${G}-textarea-suffix`},U),showCount:v,ref:q,onResize:H,onMouseDown:M})}),Dt=Xo;Dt.Group=gx;Dt.Search=Mx;Dt.TextArea=jx;Dt.Password=Px;Dt.OTP=xx;const Hx=e=>{const{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:s}=e,i=s(n).sub(r).equal(),a=s(t).sub(r).equal();return{[o]:{...Ot(e),display:"inline-block",height:"auto",paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:a,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${o}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${o}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${o}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${o}-default`]:{color:e.solidTextColor}},[`${o}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${o}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${o}-solid, &${o}-filled`]:{color:e.colorTextDisabled,[`${o}-close-icon`]:{color:e.colorTextDisabled}},[`${o}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},mc=e=>{const{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return _t(e,{tagFontSize:o,tagLineHeight:Re(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},gc=e=>{const t=Eg(new Ns(e.colorBgSolid),"#fff")?"#000":"#fff";
92return{defaultBg:new Pr(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:t}},vc=Ut("Tag",e=>{const t=mc(e);return Hx(t)},gc),hh=h.forwardRef((e,t)=>{const{prefixCls:r,style:n,className:o,checked:s,children:i,icon:a,onChange:c,onClick:l,disabled:f,...y}=e,{getPrefixCls:m,tag:d}=h.useContext(Rt),v=h.useContext(Vr),b=f??v,S=N=>{b||(c?.(!s),l?.(N))},u=m("tag",r),[C,x]=vc(u),I=ue(u,`${u}-checkable`,{[`${u}-checkable-checked`]:s,[`${u}-checkable-disabled`]:b},d?.className,o,C,x);return h.createElement("span",{...y,ref:t,style:{...n,...d?.style},className:I,onClick:S},a,h.createElement("span",null,i))});function zx(e,t){const{id:r,prefixCls:n,rootClassName:o,className:s,style:i,classNames:a,styles:c,disabled:l,options:f,value:y,defaultValue:m,onChange:d,multiple:v,...b}=e,{getPrefixCls:S,direction:u,className:C,style:x,classNames:I,styles:N}=Gt("tag"),E=S("tag",n),g=`${E}-checkable-group`,p=Qt(E),[T,R]=vc(E,p),[B,P]=kt([I,a],[N,c],{props:e}),D=h.useMemo(()=>(f||[]).map(G=>G&&typeof G=="object"?G:{value:G,label:G}),[f]),[U,_]=Xt(m,y),V=(G,Y)=>{let ee=null;if(v){const J=U||[];ee=G?[].concat(Vt(J),[Y.value]):J.filter(te=>te!==Y.value)}else ee=G?Y.value:null;_(ee),d?.(ee)},z=xe.useRef(null);h.useImperativeHandle(t,()=>({nativeElement:z.current}));const q=wr(b,{aria:!0,data:!0});return xe.createElement("div",{...q,className:ue(g,C,o,{[`${g}-disabled`]:l,[`${g}-rtl`]:u==="rtl"},T,R,s,B.root),style:{...x,...P.root,...i},id:r,ref:z},D.map(G=>xe.createElement(hh,{key:G.value,className:ue(`${g}-item`,B.item),style:P.item,checked:v?(U||[]).includes(G.value):U===G.value,onChange:Y=>V(Y,G),disabled:l},G.label)))}const Kx=xe.forwardRef(zx);function Gx(e,t){const{color:r,variant:n,bordered:o}=e;return h.useMemo(()=>{const s=r?.endsWith("-inverse");let i;n?i=n:s?i="solid":o===!1?i="filled":i=t||"filled";const a=s?r?.replace("-inverse",""):r,c=gp(r),l=Qy(r),f={};if(!c&&!l&&a)if(i==="solid")f.backgroundColor=r;else{const y=new Pr(a).toHsl();y.l=.95,f.backgroundColor=new Pr(y).toHexString(),f.color=r,i==="outlined"&&(f.borderColor=r)}return[i,a,c,l,f]},[r,n,o,t])}const qx=e=>Uf(e,(t,{textColor:r,lightBorderColor:n,lightColor:o,darkColor:s})=>({[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:o,borderColor:n,color:r},[`&${e.componentCls}-solid`]:{backgroundColor:s,borderColor:s,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:o,color:r}}})),Wx=Vl(["Tag","preset"],e=>{const t=mc(e);return qx(t)},gc);function Yx(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const Oa=(e,t,r)=>{const n=Yx(r);return{[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${n}Bg`],borderColor:e[`color${n}Border`],color:e[`color${r}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${r}`],borderColor:e[`color${r}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${n}Bg`],color:e[`color${r}`]}}}},Xx=Vl(["Tag","status"],e=>{const t=mc(e);return[Oa(t,"success","Success"),Oa(t,"processing","Info"),Oa(t,"error","Error"),Oa(t,"warning","Warning")]},gc),Qx=h.forwardRef((e,t)=>{const{prefixCls:r,className:n,rootClassName:o,style:s,children:i,icon:a,color:c,variant:l,onClose:f,bordered:y,disabled:m,href:d,target:v,styles:b,classNames:S,...u}=e,{getPrefixCls:C,direction:x,className:I,variant:N,style:E,classNames:g,styles:p}=Gt("tag"),[T,R,B,P,D]=Gx(e,N),U=B||P,_=h.useContext(Vr),V=m??_,{tag:z}=h.useContext(Rt),[q,G]=h.useState(!0),Y=Tt(u,["closeIcon","closable"]),ee={...e,color:R,variant:T,disabled:V,href:d,target:v,icon:a},[J,te]=kt([g,S],[p,b],{props:ee}),Q=h.useMemo(()=>{let X={...te.root,...E,...s};return V||(X={...D,...X}),X},[te.root,E,s,D,V]),Z=C("tag",r),[W,oe]=vc(Z),ie=ue(Z,I,J.root,`${Z}-${T}`,{[`${Z}-${R}`]:U,[`${Z}-hidden`]:!q,[`${Z}-rtl`]:x==="rtl",[`${Z}-disabled`]:V},n,o,W,oe),A=X=>{V||(X.stopPropagation(),f?.(X),!X.defaultPrevented&&G(!1))},[,$]=wg(zc(e),zc(z),{closable:!1,closeIconRender:X=>{const ce=h.createElement("span",{className:`${Z}-close-icon`,onClick:A},X);return Ig(X,ce,ae=>({onClick:re=>{ae?.onClick?.(re),A(re)},className:ue(ae?.className,`${Z}-close-icon`)}))}}),O=typeof u.onClick=="function"||i&&i.type==="a",w=$r(a,{className:ue(h.isValidElement(a)?a.props?.className:"",J.icon),style:te.icon}),M=w?h.createElement(h.Fragment,null,w,i&&h.createElement("span",{className:J.content,style:te.content},i)):i,H=d?"a":"span",F=h.createElement(H,{...Y,ref:t,className:ie,style:Q,href:V?void 0:d,target:v,onClick:V?void 0:Y.onClick,...d&&V?{"aria-disabled":!0}:{}},M,$,B&&h.createElement(Wx,{key:"preset",prefixCls:Z}),P&&h.createElement(Xx,{key:"status",prefixCls:Z}));return O?h.createElement(_l,{component:"Tag"},F):F}),yc=Qx;yc.CheckableTag=hh;yc.CheckableTagGroup=Kx;var Ni,nd;function Zx(){return nd||(nd=1,Ni={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Ni}var Jx=Zx();const e3=Ro(Jx);var t3=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function ad(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(t.name=r[1],(e3[r[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("-->");return{type:"comment",comment:n!==-1?e.slice(4,n):""}}for(var o=new RegExp(t3),s=null;(s=o.exec(e))!==null;)if(s[0].trim())if(s[1]){var i=s[1].trim(),a=[i,""];i.indexOf("=")>-1&&(a=i.split("=")),t.attrs[a[0]]=a[1],o.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var r3=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,n3=/^\s*$/,a3=Object.create(null);function mh(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(r){var n=[];for(var o in r)n.push(o+'="'+r[o]+'"');return n.length?" "+n.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(mh,"")+"</"+t.name+">";
92case"comment":return e+"<!--"+t.comment+"-->"}}var o3={parse:function(e,t){t||(t={}),t.components||(t.components=a3);var r,n=[],o=[],s=-1,i=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");n.push({type:"text",content:a===-1?e:e.substring(0,a)})}for(var c,l=[];c=r3.exec(e);)l.push(c);return l.forEach(function(f,y){var m=f[0];if(m&&!m.startsWith("<!--")){for(var d=0,v=0,b=-1,S=null,u=0;u<m.length;u++){var C=m.charAt(u);S?C===S&&(S=null):C==='"'||C==="'"?S=C:C==="<"?++d==2&&(b=u):C===">"&&v++}var x=b>-1&&/[a-zA-Z0-9\-!/]/.test(m.charAt(b+1));if(d>v&&x){var I=m.substring(0,b),N=m.substring(I.length);l[y][0]=N,l[y].index+=I.length}}}),l.forEach(function(f,y){var m=f[0];if(m){var d=f.index;if(i){if(m!=="</"+r.name+">")return;i=!1}var v,b,S=m.charAt(1)!=="/",u=m.startsWith("<!--"),C=d+m.length,x=e.charAt(C),I=l[y+1];if(x==="<"&&I){var N=e.substring(C,I.index);v=N.split("<").length>N.split(">").length}if(u){var E=ad(m);if(s<0)return n.push(E),n;(b=o[s]).children.push(E);var g=e.slice(C,I?I.index:void 0);return g.length>0&&b.children.push({type:"text",content:g}),n}if(S&&(s++,(r=ad(m)).type==="tag"&&t.components[r.name]&&(r.type="component",i=!0),r.voidElement||i||!x||x==="<"||r.children.push({type:"text",content:e.slice(C,I?I.index:void 0)}),s===0&&n.push(r),(b=o[s-1])&&b.children.push(r),o[s]=r),(!S||r.voidElement)&&(s>-1&&(r.voidElement||r.name===m.slice(2,-1))&&(s--,r=s===-1?n:o[s]),!i&&(x!=="<"||v)&&x)){b=s===-1?n:o[s].children;var p=I?I.index:-1,T=e.slice(C,p===-1?void 0:p);n3.test(T)&&(T=" "),(p>-1&&s+b.length>=0||T!==" ")&&b.push({type:"text",content:T})}}}),n},stringify:function(e){return e.reduce(function(t,r){return t+mh("",r)},"")}};const Ri=(e,t)=>{if(!e)return!1;const r=e.props?.children??e.children;return t?r.length>0:!!r},Pi=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?xn(t):t},i3=e=>Array.isArray(e)&&e.every(h.isValidElement),xn=e=>Array.isArray(e)?e:[e],s3=(e,t)=>{const r={...t};return r.props=Object.assign(e.props,t.props),r},gh=(e,t,r,n)=>{if(!e)return"";let o="";const s=xn(e),i=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((a,c)=>{if(oa(a)){o+=`${a}`;return}if(h.isValidElement(a)){const{props:l,type:f}=a,y=Object.keys(l).length,m=i.indexOf(f)>-1,d=l.children;if(!d&&m&&!y){o+=`<${f}/>`;return}if(!d&&(!m||y)||l.i18nIsDynamicList){o+=`<${c}></${c}>`;return}if(m&&y===1&&oa(d)){o+=`<${f}>${d}</${f}>`;return}const v=gh(d,t,r,n);o+=`<${c}>${v}</${c}>`;return}if(a===null){li(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(en(a)){const{format:l,...f}=a,y=Object.keys(f);if(y.length===1){const m=l?`${y[0]}, ${l}`:y[0];o+=`{{${m}}}`;return}li(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:a});return}li(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:a})}),o},l3=(e,t,r,n,o,s,i)=>{if(r==="")return[];const a=o.transKeepBasicHtmlNodesFor||[],c=r&&new RegExp(a.map(u=>`<${u}`).join("|")).test(r);if(!e&&!t&&!c&&!i)return[r];const l=t??{},f=u=>{xn(u).forEach(x=>{oa(x)||(Ri(x)?f(Pi(x)):en(x)&&!h.isValidElement(x)&&Object.assign(l,x))})};f(e);const y=o3.parse(`<0>${r}</0>`),m={...l,...s},d=(u,C,x)=>{const I=Pi(u),N=b(I,C.children,x);return i3(I)&&N.length===0||u.props?.i18nIsDynamicList?I:N},v=(u,C,x,I,N)=>{u.dummy?(u.children=C,x.push(h.cloneElement(u,{key:I},N?void 0:C))):x.push(...h.Children.map([u],E=>{const g={...E.props};return delete g.i18nIsDynamicList,h.createElement(E.type,{...g,key:I,ref:E.props.ref??E.ref},N?null:C)}))},b=(u,C,x)=>{const I=xn(u);return xn(C).reduce((E,g,p)=>{const T=g.children?.[0]?.content&&n.services.interpolator.interpolate(g.children[0].content,m,n.language);if(g.type==="tag"){let R=I[parseInt(g.name,10)];!R&&t&&(R=t[g.name]),x.length===1&&!R&&(R=x[0][g.name]),R||(R={});const B=Object.keys(g.attrs).length!==0?s3({props:g.attrs},R):R,P=h.isValidElement(B),D=P&&Ri(g,!0)&&!g.voidElement,U=c&&en(B)&&B.dummy&&!P,_=en(t)&&Object.hasOwnProperty.call(t,g.name);if(oa(B)){const V=n.services.interpolator.interpolate(B,m,n.language);E.push(V)}else if(Ri(B)||D){const V=d(B,g,x);v(B,V,E,p)}else if(U){const V=b(I,g.children,x);v(B,V,E,p)}else if(Number.isNaN(parseFloat(g.name)))if(_){const V=d(B,g,x);v(B,V,E,p,g.voidElement)}else if(o.transSupportBasicHtmlNodes&&a.indexOf(g.name)>-1)if(g.voidElement)E.push(h.createElement(g.name,{key:`${g.name}-${p}`}));else{const V=b(I,g.children,x);E.push(h.createElement(g.name,{key:`${g.name}-${p}`},V))}else if(g.voidElement)E.push(`<${g.name} />`);else{const V=b(I,g.children,x);E.push(`<${g.name}>${V}</${g.name}>`)}else if(en(B)&&!P){const V=g.children[0]?T:null;V&&E.push(V)}else v(B,T,E,p,g.children.length!==1||!T)}else if(g.type==="text"){const R=o.transWrapTextNodes,B=i?o.unescape(n.services.interpolator.interpolate(g.content,m,n.language)):n.services.interpolator.interpolate(g.content,m,n.language);R?E.push(h.createElement(R,{key:`${g.name}-${p}`},B)):E.push(B)}return E},[])},S=b([{dummy:!0,children:e||[]}],y,xn(e||[]));return Pi(S[0])},vh=(e,t,r)=>{const n=e.key||t,o=h.cloneElement(e,{key:n});if(!o.props||!o.props.children||r.indexOf(`${t}/>`)<0&&r.indexOf(`${t} />`)<0)return o;function s(){return h.createElement(h.Fragment,null,o)}return h.createElement(s,{key:n})},c3=(e,t)=>e.map((r,n)=>vh(r,n,t)),u3=(e,t)=>
92{const r={};return Object.keys(e).forEach(n=>{Object.assign(r,{[n]:vh(e[n],n,t)})}),r},d3=(e,t,r,n)=>e?Array.isArray(e)?c3(e,t):en(e)?u3(e,t):(Lf(r,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null,f3=e=>!en(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,r)=>t&&Number.isNaN(Number.parseFloat(r)),!0);function p3({children:e,count:t,parent:r,i18nKey:n,context:o,tOptions:s={},values:i,defaults:a,components:c,ns:l,i18n:f,t:y,shouldUnescape:m,...d}){const v=f||Sf();if(!v)return Lf(v,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:n}),e;const b=y||v.t.bind(v)||(U=>U),S={...Tg(),...v.options?.react};let u=l||b.ns||v.options?.defaultNS;u=oa(u)?[u]:u||["translation"];const C=gh(e,S,v,n),x=a||C||S.transEmptyNodeValue||n,{hashTransKey:I}=S,N=n||(I?I(C||x):C||x);v.options?.interpolation?.defaultVariables&&(i=i&&Object.keys(i).length>0?{...i,...v.options.interpolation.defaultVariables}:{...v.options.interpolation.defaultVariables});const E=i||t!==void 0&&!v.options?.interpolation?.alwaysFormat||!e?s.interpolation:{interpolation:{...s.interpolation,prefix:"#$?",suffix:"?$#"}},g={...s,context:o||s.context,count:t,...i,...E,defaultValue:x,ns:u},p=N?b(N,g):x,T=d3(c,p,v,n);let R=T||e,B=null;f3(T)&&(B=T,R=e);const P=l3(R,B,p,v,S,g,m),D=r??S.defaultTransParent;return D?h.createElement(D,d,P):P}function Za({children:e,count:t,parent:r,i18nKey:n,context:o,tOptions:s={},values:i,defaults:a,components:c,ns:l,i18n:f,t:y,shouldUnescape:m,...d}){const{i18n:v,defaultNS:b}=h.useContext(Ag)||{},S=f||v||Sf(),u=y||S?.t.bind(S);return p3({children:e,count:t,parent:r,i18nKey:n,context:o,tOptions:s,values:i,defaults:a,components:c,ns:l||u?.ns||b||S?.options?.defaultNS,i18n:S,t:y,shouldUnescape:m,...d})}var h3=/\s/;function m3(e){for(var t=e.length;t--&&h3.test(e.charAt(t)););return t}var g3=/^\s+/;function v3(e){return e&&e.slice(0,m3(e)+1).replace(g3,"")}var od=NaN,y3=/^[-+]0x[0-9a-f]+$/i,b3=/^0b[01]+$/i,C3=/^0o[0-7]+$/i,x3=parseInt;function id(e){if(typeof e=="number")return e;if(Ng(e))return od;if(Bs(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bs(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=v3(e);var r=b3.test(e);return r||C3.test(e)?x3(e.slice(2),r?2:8):y3.test(e)?od:+e}var Bi=function(){return Rg.Date.now()},S3="Expected a function",E3=Math.max,w3=Math.min;function Co(e,t,r){var n,o,s,i,a,c,l=0,f=!1,y=!1,m=!0;if(typeof e!="function")throw new TypeError(S3);t=id(t)||0,Bs(r)&&(f=!!r.leading,y="maxWait"in r,s=y?E3(id(r.maxWait)||0,t):s,m="trailing"in r?!!r.trailing:m);function d(E){var g=n,p=o;return n=o=void 0,l=E,i=e.apply(p,g),i}function v(E){return l=E,a=setTimeout(u,t),f?d(E):i}function b(E){var g=E-c,p=E-l,T=t-g;return y?w3(T,s-p):T}function S(E){var g=E-c,p=E-l;return c===void 0||g>=t||g<0||y&&p>=s}function u(){var E=Bi();if(S(E))return C(E);a=setTimeout(u,b(E))}function C(E){return a=void 0,m&&n?d(E):(n=o=void 0,i)}function x(){a!==void 0&&clearTimeout(a),l=0,n=c=o=a=void 0}function I(){return a===void 0?i:C(Bi())}function N(){var E=Bi(),g=S(E);if(n=arguments,o=this,c=E,g){if(a===void 0)return v(c);if(y)return clearTimeout(a),a=setTimeout(u,t),d(c)}return a===void 0&&(a=setTimeout(u,t)),i}return N.cancel=x,N.flush=I,N}var I3="[object Map]",T3="[object Set]",A3=Object.prototype,N3=A3.hasOwnProperty;function xo(e){if(e==null)return!0;if(Pg(e)&&(Bg(e)||typeof e=="string"||typeof e.splice=="function"||Lg(e)||Mg(e)||Dg(e)))return!e.length;var t=$g(e);if(t==I3||t==T3)return!e.size;if(Og(e))return!_g(e).length;for(var r in e)if(N3.call(e,r))return!1;return!0}function R3(e,t){return kg(e,t)}function P3(e,t){return Vg(e,t,function(r,n){return Fg(e,n)})}var yh=Ug(function(e,t){return e==null?{}:P3(e,t)}),B3=0;function L3(e){var t=++B3;return jg(e)+t}function M3(){!$2.current&&O2();const[e]=h.useState(_2.current);return e}function Ja(){return $n.Get("/wallet/kms/public-key",{meta:{errorMessageMode:"none"}})}function D3(e){return $n.Post("/wallet/paymentInstrument/add",e,{meta:{errorMessageMode:"none"}})}function $3(e){return $n.Post("/wallet/paymentInstrument/add",e,{meta:{errorMessageMode:"none"}})}function O3(e){return $n.Post("/wallet/paymentInstrument/card-bin/support/check",e,{meta:{errorMessageMode:"none"}})}const pl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='71'%20height='44.28125'%20viewBox='0%200%2071%2044.28125'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_7
925_15615'%3e%3crect%20x='52.4375'%20y='4.828125'%20width='34.625'%20height='34.625'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%3e%3cg%3e%3cpath%20d='M64.875,43.7812L6.125,43.7812C3.01875,43.7812,0.5,41.2625,0.5,38.1562L0.5,6.125C0.5,3.01875,3.01875,0.5,6.125,0.5L64.875,0.5C67.9812,0.5,70.5,3.01875,70.5,6.125L70.5,38.1562C70.5,41.2625,67.9812,43.7812,64.875,43.7812Z'%20fill='%23FFFFFF'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3cpath%20d='M69.2059,42.4872Q71,40.693,71,38.1562L71,6.125Q71,3.58822,69.2059,1.7941Q67.4118,0,64.875,0L6.125,0Q3.5882,0,1.7941,1.7941Q0,3.58821,0,6.125L0,38.1562Q0,40.6931,1.7941,42.4872Q3.5882,44.2812,6.125,44.2812L64.875,44.2812Q67.4118,44.2812,69.2059,42.4872ZM70,6.125L70,38.1562Q70,40.2788,68.4988,41.78Q66.9976,43.2812,64.875,43.2812L6.125,43.2812Q4.002409999999999,43.2812,2.50121,41.78Q1,40.2788,1,38.1562L1,6.125Q1,4.00242,2.50121,2.50121Q4.00242,1,6.125,1L64.875,1Q66.9976,1,68.4988,2.50121Q70,4.00242,70,6.125Z'%20fill-rule='evenodd'%20fill='%23F5F6F9'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(-1,0,0,1,104.875,0)'%20clip-path='url(%23master_svg0_7
925_15615)'%3e%3cg%3e%3cpath%20d='M83.455103125,33.683609375L56.042913125,33.683609375C54.449343125,33.683609375,53.158203125,32.390409375000004,53.158203125,30.796809375L53.158203125,16.371149375L86.339803125,16.371149375L86.339803125,30.796809375C86.339803125,32.390409375000004,85.048603125,33.683609375,83.455103125,33.683609375ZM71.914103125,27.912109375C71.117303125,27.912109375,70.470703125,28.558709375,70.470703125,29.355509375C70.470703125,30.152309375,71.117303125,30.796809375,71.914103125,30.796809375C72.710903125,30.796809375,73.355403125,30.152309375,73.355403125,29.355509375C73.355403125,28.558709375,72.710903125,27.912109375,71.914103125,27.912109375ZM76.962903125,27.912109375C76.166103125,27.912109375,75.519503125,28.558709375,75.519503125,29.355509375C75.519503125,30.152309375,76.166103125,30.796809375,76.962903125,30.796809375C77.759703125,30.796809375,78.406303125,30.152309375,78.406303125,29.355509375C78.406303125,28.558709375,77.759703125,27.912109375,76.962903125,27.912109375ZM82.011703125,27.912109375C81.214903125,27.912109375,80.570403125,28.558709375,80.570403125,29.355509375C80.570403125,30.152309375,81.214903125,30.796809375,82.011703125,30.796809375C82.808403125,30.796809375,83.455103125,30.152309375,83.455103125,29.355509375C83.455103125,28.558709375,82.808403125,27.912109375,82.011703125,27.912109375ZM53.158203125,13.484319375C53.158202867024,11.890749375,54.449343125,10.599608972557,56.042913125,10.599609632976L83.455103125,10.599609375C85.048603125,10.59960871458,86.339803125,11.890749375,86.339803125,13.484319375L86.339803125,14.927729375L53.158203125,14.927729375L53.158203125,13.484319375Z'%20fill='%23A7B2C2'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var _3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};function hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hl.apply(this,arguments)}const k3=(e,t)=>h.createElement(Ar,hl({},e,{ref:t,icon:_3})),V3=h.forwardRef(k3);var F3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 000 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM459.7 834.7L189.3 564.3 589 164.6 836 188l23.4 247-399.7 399.7zM680 256c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm0 120c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]},name:"tag",theme:"outlined"};function ml(){return ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ml.apply(this,arguments)}const U3=(e,t)=>h.createElement(Ar,ml({},e,{ref:t,icon:F3})),j3=h.forwardRef(U3);var H3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}},{tag:"path",attrs:{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4a8.42 8.42 0 00-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}}]},name:"translation",theme:"outlined"};function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
92for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gl.apply(this,arguments)}const z3=(e,t)=>h.createElement(Ar,gl({},e,{ref:t,icon:H3})),K3=h.forwardRef(z3);var G3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"};function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vl.apply(this,arguments)}const q3=(e,t)=>h.createElement(Ar,vl({},e,{ref:t,icon:G3})),W3=h.forwardRef(q3);function Y3(e){const{className:t}=e,{currentLocale:r,setCurrentLocale:n}=on(),{i18n:o}=rt();function s(a){n(a),o.changeLanguage(a)}const i=Hg.map(a=>({key:a.value,label:a.label,onClick:()=>s(a.value)}));return L.jsx(lh,{menu:{items:i,selectedKeys:[r],style:{maxHeight:200,overflowY:"auto"}},trigger:["click"],placement:"bottomRight",classNames:{root:le("w-[100px]","locale-picker-dropdown")},children:L.jsx(K3,{className:le("cursor-pointer text-[22px]",t)})})}const X3="/static/png/amex-Bdto07GM.png",Q3="/static/png/discover-CeRJZPyG.png",Z3="/static/png/jcb-BUF11zxq.png",J3="/static/png/mastercard-BUvzn5t7.png",eS="/static/png/pci-VObtUIcs.png",tS="/static/png/visa-BrgYJWaS.png",rS=[{src:eS,alt:"PCI DSS"},{src:tS,alt:"Visa Secure"},{src:J3,alt:"Mastercard ID Check"},{src:X3,alt:"American Express SafeKey"},{src:Q3,alt:"Discover ProtectBuy"},{src:Z3,alt:"JCB J/Secure"}];function nS({src:e,alt:t}){const[r,n]=h.useState(!1);return L.jsx("div",{className:le("relative w-full aspect-[8/5] overflow-hidden",!r&&"bg-ant-fill-quaternary animate-pulse"),children:L.jsx("img",{src:e,alt:t,decoding:"async",onLoad:()=>n(!0),className:le("w-full h-full object-contain transition-opacity duration-300",r?"opacity-100":"opacity-0")})})}function aS(e){const{t}=rt();return L.jsxs("div",{className:le("flex flex-col items-center gap-[12px]",e.className),children:[L.jsxs("div",{className:le("flex items-center gap-[6px]","text-ant-text-secondary text-[13px] leading-[15px]"),children:[L.jsx(H2,{className:"text-success"}),L.jsx("span",{children:t("payment.securePayment")})]}),L.jsx("div",{className:"grid grid-cols-6 gap-[6px] w-full",children:rS.map(r=>L.jsx(nS,{src:r.src,alt:r.alt},r.alt))})]})}const oS=`<div 93 id="clinkpay-skeleton-root" 94 class="tw-relative tw-flex tw-justify-center tw-items-center tw-box-border tw-w-screen lg:tw-p-0 tw-p-[20px]" 95> 96 <div 97 class="skeleton-payment-container tw-h-full tw-w-full tw-flex lg:tw-justify-between lg:tw-flex-row tw-flex-col lg:tw-mt-[48px]" 98 > 99 <div class="animation-scale lg:tw-max-w-[380px] lg:tw-block tw-hidden"> 100 <div 101 class="tw-rounded-full tw-size-[24px] skeleton-shimmer tw-bg-black/5" 102 ></div> 103 <div class="tw-mt-[32px] tw-flex tw-flex-col tw-gap-[16px]"> 104 <div 105 class="tw-w-[86px] tw-h-[16px] tw-rounded-full tw-bg-black/5 skeleton-shimmer" 106 ></div> 107 <div 108 class="tw-w-[124px] tw-h-[28px] tw-rounded-full tw-bg-black/5 skeleton-shimmer" 109 ></div> 110 </div> 111 <div 112 class="tw-mt-[64px] tw-size-[188px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 113 ></div> 114 </div> 115 116 <div class="animation-scale lg:tw-hidden tw-max-w-[380px]"> 117 <div 118 class="tw-rounded-full tw-size-[24px] skeleton-shimmer tw-bg-black/5" 119 ></div> 120 <div 121 class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-mt-[32px] tw-mb-[12px]" 122 > 123 <div 124 class="tw-size-[160px] tw-rounded-[8px] skeleton-shimmer tw-bg-black/5 tw-mb-[20px]" 125 ></div> 126 <div 127 class="tw-w-[86px] tw-h-[16px] tw-rounded-full skeleton-shimmer tw-bg-black/5" 128 ></div> 129 <div 130 class="tw-w-[124px] tw-h-[28px] tw-rounded-full skeleton-shimmer tw-bg-black/5 tw-mt-[8px] tw-mb-[32px]" 131 ></div> 132 </div> 133 </div> 134 135 <div 136 class="animation-right-section lg:tw-max-w-[380px] tw-w-full skeleton-payment-right-section" 137 > 138 <div 139 class="tw-mb-[40px] tw-h-[28px] lg:tw-w-[160px] tw-rounded-[20px] tw-bg-black/5 skeleton-shimmer" 140 ></div> 141 <div 142 class="tw-mb-[40px] tw-h-[40px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 143 ></div> 144 <div 145 class="tw-mb-[40px] tw-h-[72px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 146 ></div> 147 <div 148 class="tw-mb-[40px] tw-h-[40px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 149 ></div> 150 <div 151 class="tw-mb-[40px] tw-h-[72px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 152 ></div> 153 <div 154 class="tw-h-[108px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 155 ></div> 156 <div 157 class="tw-mt-[56px] tw-h-[44px] lg:tw-w-[380px] tw-rounded-[8px] tw-bg-black/5 skeleton-shimmer" 158 ></div> 159 </div> 160 </div> 161</div> 162 163<script>
164 // Do not display skeleton screen on callback page and third-part-qrcode-elements page 165 if ( 166 window.location.href.includes('/pay/callback') || 167 window.location.href.includes('/hosted/third-part-qrcode-elements') 168 ) { 169 document.getElementById('clinkpay-skeleton-root').style.display = 'none'; 170 const loaderStyle = document.createElement('style'); 171 loaderStyle.textContent = \` 172 .hosted-loader-container { 173 display: flex; 174 justify-content: center; 175 align-items: center; 176 overflow: hidden; 177 width: 100vw; 178 height: 100vh; 179 } 180 181 .hosted-loader-container > .hosted-loader { 182 width: 48px; 183 height: 48px; 184 border: 5px solid #eee; 185 border-bottom-color: #ff3d00; 186 border-radius: 50%; 187 display: inline-block; 188 box-sizing: border-box; 189 animation: rotation 1s linear infinite; 190 } 191 192 @keyframes rotation { 193 0% { 194 transform: rotate(0deg); 195 } 196 100% { 197 transform: rotate(360deg); 198 } 199 } 200 \`; 201 // Create dedicated loading elements 202 // before react mounted 203 const doNotNeedSkeletonContainer = document.createElement('div'); 204 doNotNeedSkeletonContainer.className = 'hosted-loader-container'; 205 // loader 206 const threeDsLoadingElement = document.createElement('div'); 207 threeDsLoadingElement.className = 'hosted-loader'; 208 // append 209 doNotNeedSkeletonContainer.appendChild(threeDsLoadingElement); 210 doNotNeedSkeletonContainer.appendChild(loaderStyle); 211 document.querySelector('div#root').appendChild(doNotNeedSkeletonContainer); 212 } 213<\/script> 214`;function iS(){const e=oS.replaceAll("animation-right-section","").replaceAll("animation-scale","");return L.jsx("div",{dangerouslySetInnerHTML:{__html:e}})}const sd={SUCCESS:1,CHANEL_PENDING:2},tn=["US","GB","CA","AU","NZ"],sS=["card_declined"],ld="data:image/svg+xml,%3csvg%20width='40'%20height='26'%20viewBox='0%200%2040%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='40'%20height='26'%20fill='%23016FD0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.4185%2021.886V12.5698L39.9999%2012.5847V15.1581L38.0834%2017.2062L39.9999%2019.273V21.901H36.94L35.3138%2020.1066L33.6992%2021.908L23.4185%2021.886Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.5261%2020.8646V13.5951H30.6901V15.2696H26.5219V16.4064H30.5907V18.0533H26.5219V19.1699H30.6901V20.8646H24.5261Z'%20fill='%23016FD0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.6594%2020.8646L34.0702%2017.2257L30.6594%2013.5952H33.2993L35.3835%2015.8992L37.4736%2013.5952H40V13.6524L36.6619%2017.2257L40%2020.7615V20.8646H37.4481L35.327%2018.5375L33.2276%2020.8646H30.6594Z'%20fill='%23016FD0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.192%204.30077H28.1889L29.5928%207.48849V4.30077H34.5272L35.3782%206.68914L36.232%204.30077H39.9999V13.6169H20.0869L24.192%204.30077Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.9487%205.31293L21.7231%2012.5764H23.9354L24.544%2011.1219H27.8413L28.4495%2012.5764H30.7168L27.5046%205.31293H24.9487ZM25.2259%209.49182L26.1932%207.17957L27.1599%209.49182H25.2259Z'%20fill='%23016FD0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.6865%2012.5751V5.31177L33.7963%205.32246L35.3964%209.78779L37.0069%205.31177H39.9998V12.5753L38.0739%2012.5922V7.60279L36.256%2012.5753H34.4981L32.6424%207.58589V12.5753L30.6865%2012.5751Z'%20fill='%23016FD0'/%3e%3c/svg%3e",_a="/static/svg/diners-v7ICzi3-.svg",cd="/static/svg/discover-CXGtiw9R.svg",ud="/static/svg/jcb-D27Qfiuw.svg",dd="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='40'%20height='26'%20viewBox='0%200%2040%2026'%3e%3cpath%20fill='%23fff'%20d='M0%200h40v26H0z'/%3e%3cpath%20fill='%23F06022'%20d='M16.13%2019.29h7.74V6.7h-7.74v12.58z'/%3e%3cpath%20fill='%23EA1D25'%20d='M16.93%2013A7.93%207.93%200%200%201%2020%206.71a8.02%208.02%200%200%200-10.65.65%207.96%207.96%200%200%200%200%2011.28%208.02%208.02%200%200%200%2010.65.65A8.02%208.02%200%200%201%2016.93%2013'/%3e%3cpath%20fill='%23F79D1D'%20d='M33%2013c0%202.12-.84%204.15-2.34%205.65a8.1%208.1%200%200%201-10.66.64A8.05%208.05%200%200%200%2023.07%2013%207.96%207.96%200%200%200%2020%206.71a8.02%208.02%200%200%201%2010.66.64A7.93%207.93%200%200%201%2033%2013'/%3e%3c/svg%3e",Li="/static/svg/visa-DNrb3egH.svg",fd="/static/svg/aura-CKb-w_Ps.svg",pd="/static/webp/cabal-C4aJOuUl.webp",hd="/static/png/carnet-BgYMg45N.png",md="/static/png/cb-B-st3wRa.png",gd="/static/png/credimas-DcxfVKWW.png",vd="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='40'%20height='26'%20fill='none'%20viewBox='0%200%2040%2026'%3e%3cpath%20fill='%231F0038'%20d='M0%200h40v26H0V0Z'/%3e%3cpath%20fill='url(%23a)'%20d='M10.1%208.76c-1.51.69-2.54%202.02-2.54%203.54%200%201.92%201.77%203.48%203.96%203.48%201%200%201.7-.23%202.53-.73.09-.05.19-.09.25%200%20.04.04.02.1%200%20.15a5.5%205.5%200%201%201-8.23-6.99c.93-.76%203.3-.86%204.03.55Z'/%3e%3cpath%20fill='%23fff'%20d='M14.23%2010.89c0%201.82-1.75%203.3-3.9%203.3a4.8%204.8%200%200%201-1.77-.32c-.17-.08-.15-.18-.03-.23.27-.11%202.44-.53%202.44-2.75%200-2.23-2.3-3.85-4.91-2.68A5.48%205.48%200%200%201%209.5%207c2.56%200%204.73%201.74%204.73%203.89Zm3.92.12c-1.19%200-1.82.72-1.82%201.64v.03c0%20.93.5%201.53%201.76%201.53.92%200%201.53-.29%201.8-.98H19c-.13.22-.38.35-.85.35-.64%200-.96-.24-1.05-.67h2.83v-.32c0-.91-.
21462-1.58-1.78-1.58Zm-1.04%201.3c.1-.42.45-.67%201.05-.67.58%200%20.88.22.96.67h-2Zm6.38-2.01h-.69c0%20.13%200%20.35-.03.49-.04.25-.1.3-.33.32-.14.02-.3.02-.45.02h-.54V11c0-.46.09-.54.49-.54h.26V9.8h-.35c-.87%200-1.17.3-1.17%201.16v.16h-.7v.68h.7v2.31h.77V11.8h1.27v.94c0%201.02.27%201.37%201.28%201.37h.57v-.71h-.37c-.61%200-.71-.1-.71-.8v-.8h1.08v-.69h-1.08v-.83Zm3.48.72c-.6%200-1.04.25-1.27.66l-.07-.55h-.69v4.06h.8v-1.54c.2.35.6.55%201.2.55.85%200%201.56-.51%201.56-1.54v-.03c0-1.04-.59-1.6-1.53-1.6Zm.7%201.63c0%20.57-.3.89-.98.89-.64%200-.97-.32-.97-.9v-.02c0-.59.37-.94.98-.94.65%200%20.97.33.97.95v.02Zm2.94-1.64c-1.07%200-1.8.6-1.8%201.61v.04c0%20.98.54%201.55%201.79%201.55%201.2%200%201.82-.6%201.82-1.55v-.04c0-1.01-.71-1.6-1.8-1.6Zm.99%201.64c0%20.57-.3.89-.99.89-.66%200-.98-.31-.98-.89v-.03c0-.61.36-.94%201-.94s.97.34.97.94v.03Zm2.91-.36c-.78-.05-1-.1-1-.33%200-.18.16-.34.72-.34.49%200%20.8.12.86.42h.86c-.16-.68-.7-1.03-1.71-1.03-1.02%200-1.51.43-1.51%201.02%200%20.62.52.82%201.45.87.78.04%201.02.1%201.02.32s-.19.35-.75.35c-.59%200-.85-.12-.93-.44h-.91c.13.72.7%201.08%201.8%201.08%201.06%200%201.59-.43%201.59-1.02%200-.65-.45-.84-1.49-.9Zm1.83-.62a.35.35%200%200%201-.24-.08.3.3%200%200%201-.1-.24v-.01a.37.37%200%200%201%20.05-.18.3.3%200%200%201%20.12-.11.3.3%200%200%201%20.17-.04.4.4%200%200%201%20.16.04.3.3%200%200%201%20.12.1c.03.06.05.12.05.19v.01l-.01.1-.04.08a.28.28%200%200%201-.12.1.36.36%200%200%201-.16.04Zm0-.05c.08%200%20.14-.02.2-.07a.3.3%200%200%200%20.07-.2v-.01a.26.26%200%200%200-.08-.2.27.27%200%200%200-.2-.08.26.26%200%200%200-.19.08.27.27%200%200%200-.07.2c0%20.1.02.16.07.2.05.05.12.08.2.08Zm0-.24h-.07v.13h-.06v-.34h.14c.05%200%20.08%200%20.1.02a.1.1%200%200%201%20.03.08c0%20.02%200%20.04-.02.05a.1.1%200%200%201-.05.03c.02%200%20.04.02.05.03l.01.06v.07h-.05v-.07l-.02-.05-.06-.01Zm0-.05.07-.01.01-.05c0-.02%200-.03-.02-.04a.1.1%200%200%200-.05-.01h-.08v.11h.07Z'/%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='9.21'%20x2='7.11'%20y1='14.31'%20y2='3.48'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.14'%20stop-color='%23fff'/%3e%3cstop%20offset='.75'%20stop-color='%23fff'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",yd="data:image/svg+xml,%3csvg%20width='40'%20height='26'%20viewBox='0%200%2040%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='40'%20height='26'%20fill='%23003933'/%3e%3cpath%20d='M4%2012.1032H6.36391C6.78754%209.85391%208.74383%208.04431%2011.238%208.04431C14.0744%208.04431%2016.0632%2010.0659%2016.0632%2013.114C16.0632%2013.4398%2016.0307%2013.7007%2015.9978%2013.9292H8.36868C8.72739%2015.3148%209.86846%2016.13%2011.2376%2016.13C12.4111%2016.13%2013.2917%2015.6735%2013.9926%2014.8747L15.3946%2016.1624C14.4656%2017.2222%2013.0796%2017.9556%2011.238%2017.9556C8.74383%2017.9556%206.78754%2016.1789%206.36391%2013.9292H4V12.1032ZM14.0415%2012.1032C13.9438%2011.5328%2013.6828%2011.011%2013.3081%2010.6363C12.8191%2010.1473%2012.1017%209.83747%2011.238%209.83747C10.3743%209.83747%209.67287%2010.1309%209.15145%2010.6527C8.79273%2011.0114%208.49935%2011.5004%208.35266%2012.1036H14.042L14.0415%2012.1032ZM17.4812%208.10965H19.5353V15.9344H23.2518V17.8907H19.5677C18.2146%2017.8907%2017.4812%2017.1572%2017.4812%2015.8041V8.10965ZM23.6434%2012.9997C23.6434%2010.3429%2025.8113%208.04431%2028.6807%208.04431C31.2237%208.04431%2033.2125%209.83747%2033.6361%2012.1032H36V13.9292H33.6361C33.196%2016.1789%2031.2073%2017.9556%2028.6807%2017.9556C25.7953%2017.9556%2023.6434%2015.6735%2023.6434%2013.0002V12.9997ZM28.6802%2016.0322C30.3916%2016.0322%2031.6634%2014.728%2031.6634%2013.0166C31.6634%2011.3052%2030.3592%209.96815%2028.6802%209.96815C27.0013%209.96815%2025.6971%2011.2723%2025.6971%2013.0002C25.6971%2014.728%2027.0013%2016.0322%2028.6802%2016.0322Z'%20fill='white'/%3e%3c/svg%3e",bd="/static/webp/girocard-CanwT7NU.webp",Cd="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1564363669684'%20class='icon'%20viewBox='0%200%204096%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3555'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='800'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e%3c/style%3e%3c/defs%3e%3cpath%20d='M524.8%2026.88C259.84%2026.88%2044.8%20241.92%2044.8%20506.88S259.84%20985.6%20524.8%20985.6s480-215.04%20480-480S789.76%2026.88%20524.8%2026.88z%20m126.72%20583.68c-32%200-111.36%201.28-111.36%201.28l-35.84%20138.24H355.84L390.4%20614.4H158.72l37.12-111.36s403.2%201.28%20436.48%200c33.28-1.28%2084.48-8.96%2085.76-75.52%201.28-90.88-138.24-85.76-149.76-5.12-7.68%2051.2-7.68%2064-7.68%2064H428.8l25.6-120.32H240.64l32-112.64s313.6%201.28%20372.48%201.28%20216.32%2015.36%20216.32%20160c0%20158.72-152.32%20195.84-209.92%20195.84z'%20fill='%231A72FE'%20p-id='3556'%3e%3c/path%3e%3cpath%20d='M1393.92%20359.68h113.92l-40.96%20147.2h125.44l40.96-147.2h110.08l-106.24%20385.28h-103.68l35.84-149.76h-128l-43.52%20149.76h-108.8zM1743.36%20450.56h106.24l5.12%20172.8%2099.84-172.8h107.52l-171.52%20271.36s-56.32%20101.12-140.8%20104.96c-38.4%200-57.6-6.4-76.8-21.76%2011.52-17.92%2033.28-60.16%2033.28-60.16s23.04%2020.48%2057.6%207.68c20.48-7.68%2014.08-39.68%2014.08-39.68l-34.56-262.4z'%20fill='%230E1523'%20p-id='3557'%3e%3c/path%3e%3cpath%20d='M3733.76%20450.56h106.24l5.12%20172.8%2099.84-172.8h107.52l-171.52%20271.36s-56.32%20101.12-140.8%20104.96c-38.4%200-57.6-6.4-76.8-21.76%2011.52-17.92%2033.28-60.16%2033.28-60.16s23.04%2020.48%2057.6%207.68c20.48-7.68%2014.08-39.68%2014.08-39.68l-34.56-262.4z'%20fill='%231A72FE'%20p-id='3558'%3e%3c/path%3e%3cpath%20d='M2301.44%20450.56c-53.76-20.48-99.84%205.12-122.88%2035.84%205.12-21.76%206.4-35.84%206.4-35.84h-93.44l-102.4%20376.32h102.4l34.56-131.84s26.88%2044.8%2075.52%2048.64c0%200%2088.32%2011.52%20133.12-69.12%2043.52-78.08%2051.2-192-33.28-224z%20m-47.36%20167.68c-15.36%2035.84-52.48%2053.76-81.92%2040.96-29.44-12.8-39.68
214-52.48-24.32-88.32%2015.36-35.84%2052.48-53.76%2081.92-40.96%2029.44%2014.08%2040.96%2053.76%2024.32%2088.32zM2562.56%20450.56c-111.36-3.84-179.2%2085.76-179.2%20174.08s115.2%20181.76%20252.16%2080.64c-24.32-33.28-46.08-55.04-46.08-55.04-37.12%2037.12-124.16%2033.28-119.04-32h195.84c-1.28%200%2061.44-160-103.68-167.68z%20m35.84%20126.72h-120.32c11.52-79.36%20130.56-90.88%20120.32%200zM2741.76%20450.56l-74.24%20286.72h96s20.48-131.84%2061.44-161.28%2072.96-26.88%2088.32-25.6c6.4-37.12%2026.88-106.24%2026.88-106.24-26.88-5.12-74.24%205.12-112.64%2056.32%207.68-25.6%2014.08-49.92%2014.08-49.92h-99.84z'%20fill='%230E1523'%20p-id='3559'%3e%3c/path%3e%3cpath%20d='M2996.48%20360.96l-24.32%2085.76h161.28l-19.2%2090.88h99.84s0-10.24%206.4-48.64c8.96-61.44%20115.2-65.28%20113.92%203.84-1.28%2051.2-39.68%2056.32-65.28%2057.6-25.6%201.28-330.24%200-330.24%200l-28.16%2084.48h175.36l-25.6%20102.4h112.64l26.88-104.96s60.16-1.28%2084.48-1.28c43.52%200%20158.72-28.16%20158.72-148.48%200-108.8-119.04-120.32-163.84-120.32-46.08%200-282.88-1.28-282.88-1.28z'%20fill='%231A72FE'%20p-id='3560'%3e%3c/path%3e%3cpath%20d='M3637.76%20458.24c-66.56-8.96-108.8-5.12-168.96%206.4l8.96%2066.56s76.8-12.8%20112.64-2.56c26.88%207.68%2015.36%2044.8%2015.36%2044.8s-61.44-24.32-129.28%200c-52.48%2019.2-104.96%2092.16-48.64%20157.44%2028.16%2025.6%2080.64%2028.16%20133.12-12.8-1.28%2010.24-6.4%2029.44-6.4%2029.44h99.84s43.52-152.32%2048.64-172.8c2.56-21.76%2026.88-103.68-65.28-116.48z%20m-62.72%202
21406.08c-16.64%2020.48-38.4%2024.32-51.2%2016.64-15.36-8.96-23.04-32-8.96-51.2%2011.52-15.36%2055.04-16.64%2072.96-15.36%2010.24%203.84%202.56%2030.72-12.8%2049.92z'%20fill='%231A72FE'%20p-id='3561'%3e%3c/path%3e%3c/svg%3e",xd="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2040%2026'%3e%3cmask%20id='a'%20width='41.38'%20height='26.1'%20x='-.69'%20y='0'%20maskUnits='userSpaceOnUse'%3e%3crect%20width='41.38'%20height='26.1'%20x='-.69'%20fill='%23fff'%20rx='2.55'/%3e%3c/mask%3e%3cmask%20id='b'%20width='3.86'%20height='6.24'%20x='31.37'%20y='10.3'%20maskUnits='userSpaceOnUse'%3e%3cpath%20fill='%23fff'%20d='M35.23%2016.53V10.3h-3.86v6.24h3.86z'/%3e%3c/mask%3e%3cmask%20id='c'%20width='1.99'%20height='1.95'%20x='14.98'%20y='7.79'%20maskUnits='userSpaceOnUse'%3e%3cpath%20fill='%23fff'%20d='M16.97%207.79h-1.98v1.95h1.98z'/%3e%3c/mask%3e%3cpath%20fill='%23d26528'%20d='M0%200h40v26H0z'/%3e%3cg%20mask='url(%23a)'%3e%3cpath%20fill='%23fff'%20d='M12.08%208.13v3.23H8.9V8.13H6.95v8.4H8.9v-3.52h3.2v3.52H14v-8.4h-1.93zm14.64%204.66a1.25%201.25%200%200%201%201.2-1.23A1.1%201.1%200%200%201%2029%2012.79zm4.01%201.3a4.43%204.43%200%200%200%20.07-.75c0-1.51-.76-3.04-2.77-3.04a3.08%203.08%200%200%200-3.14%203.25c0%201.91%201.2%203.1%203.32%203.1a6.23%206.23%200%200%200%202.24-.37L30.2%2015a5.56%205.56%200%200%201-1.71.25c-.9%200-1.7-.38-1.76-1.16z'/%3e%3cg%20mask='url(%23b)'%3e%3cpath%20fill='%23fff'%20d='M31.42%2016.53h1.93v-3.1a2.19%202.19%200%200%201%20.03-.42%201.24%201.24%200%200%201%201.33-.96%202.8%202.8%200%200%201%20.52.05v-1.78a2.03%202.03%200%200%200-.41-.02%201.82%201.82%200%200%200-1.68%201.26h-.05l-.06-1.13h-1.66c.02.53.05%201.11.05%202.01z'/%3e%3c/g%3e%3cg%20mask='url(%23c)'%3e%3cpath%20fill='%23fde600'%20d='M15.98%207.79a.97.97%200%201%201-1%20.97.98.98%200%200%201%201-.97'/%3e%3c/g%3e%3cpath%20fill='%23fff'%20d='M14.98%2010.42h1.99v3.44a1.14%201.14%200%200%200%201.16%201.25c0-1.55%200-3.14-.06-4.69h1.66l.1.9c.78-1.54%203.25-1.2%204.08.1.86%201.34%201.15%205.18-2.89%205.18h-.94l.01%202.34h-1.98V16.6c-2.14%200-3.13-1.34-3.13-2.74zm5.07%204.7h.97a1.26%201.26%200%200%200%201.42-1.26c0-.64-.05-2.08-1.25-2.08-1.38%200-1.16%201.8-1.15%202.73l.01.6z'/%3e%3c/g%3e%3c/svg%3e",Sd="/static/svg/interac-tG16YEfj.svg",Ed="/static/svg/mada-BNJhhFkh.svg",wd="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768270032032'%20class='icon'%20viewBox='0%200%201621%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8061'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='405.25'%20height='256'%3e%3cpath%20d='M1493.333333%200H128C55.466667%200%200%2055.466667%200%20128v768c0%2072.533333%2059.733333%20128%20128%20128h1365.333333c72.533333%200%20128-55.466667%20128-128V128c0-72.533333-59.733333-128-128-128z'%20fill='%23E9E9EA'%20p-id='8062'%3e%3c/path%3e%3cpath%20d='M1493.333333%2042.666667c46.933333%200%2085.333333%2038.4%2085.333334%2085.333333v768c0%2046.933333-38.4%2085.333333-85.333334%2085.333333H128c-46.933333%200-85.333333-38.4-85.333333-85.333333V128c0-46.933333%2038.4-85.333333%2085.333333-85.333333h1365.333333z'%20fill='%23FFFFFF'%20p-id='8063'%3e%3c/path%3e%3cpath%20d='M640%20810.666667a298.666667%20298.666667%200%201%200%200-597.333334%20298.666667%20298.666667%200%200%200%200%20597.333334z'%20fill='%23EB001B'%20p-id='8064'%3e%3c/path%3e%3cpath%20d='M981.333333%20810.666667a298.666667%20298.666667%200%201%200%200-597.333334%20298.666667%20298.666667%200%200%200%200%20597.333334z'%20fill='%2300A2E5'%20p-id='8065'%3e%3c/path%3e%3cpath%20d='M938.666667%20512c0-102.4-51.2-192-128-243.2-76.8%2055.466667-128%20145.066667-128%20243.2%200%2098.133333%2051.2%20192%20128%20243.2%2076.8-51.2%20128-140.8%20128-243.2z'%20fill='%237375CF'%20p-id='8066'%3e%3c/path%3e%3c/svg%3e",Id="/static/png/magna-Dk0TWfyU.png",Td="data:image/svg+xml,%3csvg%20viewBox='0%200%20400%20120'%20xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient%20id='a'%20x1='370'%20x2='290'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F5CD7'/%3e%3cstop%20stop-color='%2302AEFF'%20offset='1'/%3e%3c/linearGradient%3e%3cpath%20d='m31%2013h33c3%200%2012-1%2016%2013%203%209%207%2023%2013%2044h2c6-22%2011-37%2013-44%204-14%2014-13%2018-13h31v96h-32v-57h-2l-17%2057h-24l-17-57h-3v57h-31m139-96h32v57h3l21-47c4-9%2013-10%2013-10h30v96h-32v-57h-2l-21%2047c-4%209-14%2010-14%2010h-30m142-29v29h-30v-50h98c-4%2012-18%2021-34%2021'%20fill='%230f754e'/%3e%3cpath%20d='m382%2053c4-18-8-40-34-40h-68c2%2021%2020%2040%2039%2040'%20fill='url(%23a)'/%3e%3c/svg%3e",Ad="/static/svg/naranja-DczLwyfj.svg",Nd="/static/svg/rupay-D4NV_QGp.svg",Rd="data:image/webp;base64,UklGRvwHAABXRUJQVlA4WAoAAAAQAAAAKwEAxwAAQUxQSOMFAAABoEbbtqk52l8xdsoVo+3u2LZt20mhbds2C7Ft27ZtJ+fHe2+f27r1/n0RMQEI+j/o/6D/g/4P+l8Zvv+i67nNX0T7H6WFPFHQ92jGyBDf40Xqbd/jD2q077GJauR35L9DlfY7ygl7KtTv6E3NgN/5PvXsP6FQfKGALn98QiDLUzXTeYJal+k6oQSAiml/OdO+G1HIK6L9L9uu3dnIBWq9MW3Pldu7A0AgMYSKHveXd9ofb5ZWhXb7Nu0vz7SfregzMV8QwHvife4Rl5CUQ+JcALL4a/vEdQUALN+flI+IFP52BUXl3cJb0Xhz6wBgEiHLHVV2iPtbXoHXb4nnZwBCL4icGeaFDznZz5UU5Vor2mzuZ8du5nwIMFy8e3tU3S5kXwClxLmwlEcDhSRQUzSP21CeG+ZGAMh/mzkawGtCVnDrJ3Q5AE1d5Ho9t9y3FDWYRFHOgg1XEfONATwp7DwMFfJqDpcxQt8pAOBFN5GWLpilGMR8oiljRb3/hnsA9KY6xAu7Cc5ewm8GgD+9pIrLCMWnRNgVRTqs+ANzZ8MBfMzcbreU+tPxoCj/cKwmbuRxlFZMJvqLMsGONphbCgDTmAtbhU52HNW8DCD8AiHzHdjJ7SMOKr6EHR+4cePG9cvc9RvOm+8BCDnO3BG+BYCXRdsFwONCt3V8xEmMRwPhb+WwpLjoqKjCKVRa4ShnTASAEmK+BJD3rupRAN25o44WivIeCxSvwabfogaCrWfuNoCXRJk5OATAd5y0AJDjJtfDrazwV8Otah7VkBpk4Mq4pHqPPVSpChA4yU2+B64VVnMLAWA2967bL4rBsOmI81Qc9Y3q1stR8K4k9Gcgp1ESDWA4N9Ylv/CnYdVlhd0PeoVmTSmwz1BzQR+gugIoza11eVrR0a5aULOo0HOKReAnU9FcDepdANhFnQt3nOL2wq5fpj6nHhT+SECxjZkO5Q4mw/ENJfcDaCt8Y8tKowZQ7RVPgg89zgzSfMUsdDTnWgFYw62HZa+lKlAvcuOhzHWeaaF5nlnjyHmTGg08IfwTlhV5iblbkJrA3avJcY5ppXmJWe3AdOoHYBK3EJb9hLDbQO+kNkIbOMykaH5j5rgkUStQUPiyttWV+o3Kd4t6RYX1zHrNCeY3l4eoE0jm/oJtv049Tz0hdDPdH4yU4wYK+7ILDjGn4vZysdY1g0qlenHxukHUwTCmyE2qiduXzOlpQn8F695NraY+og5Bfy8ly3N7lTwi7I3sbk0ZbW7ryn6eks+YqdQsA9hOyZGaLvlGXRc6De45rpl6C9YddZOTnW92rFG5LIDAMeotE904GQCg+LhzonzcA3MNXQ63r/zXFK7PASgqdHcTOM2VAdB
214DtKvhnWpoGOw75JiJagDqceWNtKUuRAB4RfUo8YCZM7DxRSaiAKRSV7IbwTxmDQBM1nwM9qCRLlY2xsBOAPiFWg+zOS8SPzr2KLaA/tLEHlh5PgPpjqVUhiE8QgwHEHWHO1WAa2+igZ0hSfc6gJAz1GumUN2rEYC6Qh8vCT7fbd162HqmqieA+4VubQwPH3RLADCEWlUY2kW6CtaGnzTlALTj7jWHPL87DgDAR8z70I9ULQYflc+m0GkXdSU7gBeoi5F/A9BopcgyxwyvGeVgsJLqXqrKl8++9lUZiwI6jL/kdQwAtlM78DfXm/4ugJzieuzr8jBaTpMJts7qNg0qdJhrVUCBmqM/z5i9aNHsEY7eyUneyXX/Lve4ZQunfp9aLRKGe2uKMpHzYsu/+8qDJSzrP36j4luwjX/AS80G/QEfcbjwd/NQnT9H/zWzc/oI3UX5Jui4+RjQLqm6b/DU76K8Gs5h9ORHgH6/Zu06TFu1csWKFStW7hf1aGhf+yo56ethWbo6Yv4E9Ikd2uZCln7T31DFQJY/Tsx/Av+xkbmV8CGHGjuQ3Y/42tSBaPiRSw0tyQ8/MnDCzLvwJxPF5PJq8CkbG5jaHL7lkIvsuf0rfh1YCkH/B/0f9H/Q/0H//1MBAFZQOCDyAQAA0BoAnQEqLAHIAD5tNplJJCMioSGRWSiADYlnbuFz8QJfn8gHKAGEDrOfQA6WP9ncrIEL2j6sKKXtH1YUUvaPqwope0fVhRS9o+rCil7R9WFFL2j6sKKXsRWD/rUAx83y95B0uwkqkTuZMTVj4zs1+MAly3zopwjOoxYkrvcbm0pfrD9XIYtAheHnHXWWlXV473ES1+y7nRpR4VTfr6pKwL36ipxgTxbvAUXhHJUy7WcQ7qbyn+6L1Q+9Lw0fVhRTZsW9QDR9WFFL2j6sKKXtH1YUUvaPqwope0fVhRSoAAD+/40IAAAAAAbv/4ASv/wAaKi22d3tufxUxEWyXw4Q3OcC7/Fc///fPfqaJ6+qC7r99S5/b1+/9acgWquJ/x637yRyd6Nz1Jk5kql/0Hu9DTSU1zXT0iWJG8Z9ZoRXEFXDk80O1sJ7iq5fY4cOs7S6o/bGby2Am6pElfU895uRsF/F1W7fe0HH81/hxCQoGq7dqP7/e8GZOZo7nZeTEBPISqq2sSe3+WQeRWvyJpn3leUGxmDgaaxC0H6IEnOg6ZD6mstQV2cT7h3jJ+JMf9rjC4tW2Zxue/P5tc/0Kiye9uN9bgiXX/qguP4yV9yg7YhEtcWtBs/Hw2HYJFjZekxaQnIPDUoT77BFAAAAAAAAAAAA",Qn="/static/svg/union-pay-DL7VisEi.svg",lS="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20version='1.1'%20id='svg2'%20width='90.706665'%20height='98.26667'%20viewBox='0%200%2090.706665%2098.26667'%20sodipodi:docname='vpay_blu_2021.eps'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs6'%20/%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20/%3e%3cg%20id='g8'%20inkscape:groupmode='layer'%20inkscape:label='ink_ext_XXXXXX'%20transform='matrix(1.3333333,0,0,-1.3333333,0,98.266667)'%3e%3cg%20id='g10'%20transform='scale(0.1)'%3e%3cpath%20d='M%20680.316,737.016%20H%200%20V%200%20h%20680.316%20v%20737.016'%20style='fill:%232251aa;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path12'%20/%3e%3cpath%20d='M%20663.324,258.398%20H%2017.0508%20V%20720.016%20H%20663.324%20V%20258.398'%20style='fill:%23ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path14'%20/%3e%3cpath%20d='M%20503.637,636.246%20376.82,333.555%20h%20-82.808%20l%20-62.43,241.586%20c%20-3.769,14.843%20-7.09,20.285%20-18.555,26.632%20-18.906,10.165%20-49.961,19.766%20-77.304,25.711%20l%201.836,8.762%20h%20133.25%20c%2016.964,0%2032.257,-11.308%2036.132,-30.832%20l%2032.981,-175.117%2081.488,205.949%20h%2082.227'%20style='fill:%232251aa;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path16'%20/%3e%3cpath%20d='m%20217.168,185.676%20h%20-22.754%20v%20-50.688%20h%2022.754%20c%209.246,0%2016.309,1.875%2021.18,5.649%204.875,3.758%207.304,10.32%207.304,19.695%200,9.492%20-2.429,16.094%20-7.304,19.797%20-4.871,3.699%20-11.934,5.547%20-21.18,5.547%20z%20M%20169.438,64.6875%20V%20205.281%20h%2051.429%20c%2010.11,0%2018.996,-1.57%2026.641,-4.715%207.648,-3.144%2013.594,-8.015%2017.851,-14.609%204.258,-6.602%206.379,-15.019%206.379,-25.254%200,-10.234%20-2.121,-18.625%20-6.379,-25.156%20-4.257,-6.543%20-10.203,-11.387%20-17.851,-14.531%20-7.645,-3.145%20-16.531,-4.715%20-26.641,-4.715%20H%20194.414%20V%2064.6875%20h%20-24.976'%20style='fill:%23ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path18'%20/%3e%3cpath%20d='m%20315.684,122.039%20h%2041.254%20l%20-20.348,56.789%20h%20-0.371%20z%20M%20295.703,64.6875%20H%20272.762%20L%20324.93,205.281%20h%2026.453%20L%20403.559,64.6875%20H%20376.918%20L%20363.227,103.164%20H%20309.395%20L%20295.703,64.6875'%20style='fill:%23ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path20'%20/%3e%3cpath%20d='m%20447.496,64.6875%20v%2060.8715%20l%20-49.582,79.722%20h%2027.559%20l%2036.816,-61.043%20h%200.559%20l%2036.445,61.043%20h%2022.566%20L%20472.281,125.742%20V%2064.6875%20h%20-24.785'%20style='fill:%23ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none'%20id='path22'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Pd="/static/svg/vr-vale-refeicao-DCVF3Du0.svg",mt="w-[32px] h-[20px] pointer-events-none box-border",ka={VISA:{name:"Visa",node:L.jsx("img",{src:Li,className:mt,alt:"Visa"}),imgSource:Li},MASTERCARD:{name:"Mastercard",node:L.jsx("img",{src:dd,className:mt,alt:"Mastercard"}),imgSource:dd},"UNION PAY":{name:"Union Pay",node:L.jsx("img",{src:Qn,className:mt,alt:"Union Pay"}),imgSource:Qn},UNIONPAY:{name:"Union Pay",node:L.jsx("img",{src:Qn,className:mt,alt:"Union Pay"}),imgSource:Qn},JCB:{name:"Jcb",node:L.jsx("img",{src:ud,className:mt,alt:"JCB"}),imgSource:ud},"DINERS CLUB":{name:"Diners",node:L.jsx("img",{src:_a,className:mt,alt:"Diners Club"}),imgSource:_a},DINERS:{name:"Diners",node:L.jsx("img",{src:_a,className:mt,alt:"Diners Club"}),imgSource:_a},DISCOVER:{name:"Discover",node:L.jsx("img",{src:cd,className:mt,alt:"Discover"}),imgSource:cd},AMEX:{name:"Amex",node:L.jsx("img",{src:ld,className:mt,alt:"Amex"}),imgSource:ld},RUPAY:{name:"RuPay",node:L.jsx("img",{src:Nd,className:mt,alt:"RuPay"}),imgSource:Nd},HIPERCARD:{name:"HiperCard",node:L.jsx("img",{src:xd,className:mt,alt:"HiperCard"}),imgSource:xd},MAESTRO:{name:"Maestro",node:L.jsx("img",{src:wd,className:mt,alt:"Maestro"}),imgSource:wd},ELO:{name:"Elo Serviços",node:L.jsx("img",{src:yd,className:mt,alt:"Elo"}),imgSource:yd},CB:{name:"CB",node:L.jsx("img",{src:md,className:mt,alt:"Default Card"}),imgSource:md},VPAY:{name:"Visa V Pay",node:L.jsx("img",{src:Li,className:mt,alt:"VPay"}),imgSource:lS},INTERAC:{name:"Interac",node:L.jsx("img",{src:Sd,className:mt,alt:"Interac"}),imgSource:Sd},EFTPOS:{name:"EFTPOS",node:L.jsx("img",{src:vd,className:mt,alt:"EFTPOS"}),imgSource:vd},MIR:{name:"MIR",node:L.jsx("img",{src:Td,className:mt,alt:"MIR"}),imgSource:Td},CABAL:{name:"Cabal",node:L.jsx("img",{src:pd,className:mt,alt:"Cabal"}),imgSource:pd},CARNET:{name:"Carnet",node:L.jsx("img",{src:hd,className:mt,alt:"Carnet"}),imgSource:hd},GIROCARD:{name:"Girocard",node:L.jsx("img",{src:bd,className:mt,alt:"Girocard"}),imgSource:bd},HIPER:{name:"Hiper",node:L.jsx("img",{src:Cd,className:mt,alt:"Hiper"}),imgSource:Cd},MADA:{name:"Mada",node:L.jsx("img",{src:Ed,className:mt,alt:"Mada"}),imgSource:Ed},NARANJA:{name:"Naranja",node:L.jsx("img",{src:Ad,className:mt,alt:"Naranja"}),imgSource:Ad},TROY:{name:"Troy",node:L.jsx("img",{src:Rd,className:mt,alt:"Troy"}),imgSource:Rd}
214,AURA:{name:"Aura",node:L.jsx("img",{src:fd,className:mt,alt:"Aura"}),imgSource:fd},CREDIMAS:{name:"Credimas",node:L.jsx("img",{src:gd,className:mt,alt:"Credimas"}),imgSource:gd},MAGNA:{name:"Magna",node:L.jsx("img",{src:Id,className:mt,alt:"Magna"}),imgSource:Id},"VALE REFEIÃÃO":{name:"VR",node:L.jsx("img",{src:Pd,className:mt,alt:"Vale Refeição"}),imgSource:Pd},default:{name:"unknown",node:L.jsx("img",{src:pl,className:mt,alt:"Default Card"}),imgSource:pl}};function yl(e){const t=Object.keys(ka).find(n=>String(n??"").toUpperCase()===String(e??"").toUpperCase());if(!t)return ka.default;const r=String(t??"").toUpperCase();return ka[r]??ka.default}function cS(e){return yl(e)?.imgSource}var Sn=9e15,Yr=1e9,bl="0123456789abcdef",So="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Eo="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Cl={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Sn,maxE:Sn,crypto:!1},bh,Rr,Qe=!0,Zo="[DecimalError] ",Gr=Zo+"Invalid argument: ",Ch=Zo+"Precision limit exceeded",xh=Zo+"crypto unavailable",Sh="[object Decimal]",Kt=Math.floor,Mt=Math.pow,uS=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,dS=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fS=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Eh=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,vr=1e7,qe=7,pS=9007199254740991,hS=So.length-1,xl=Eo.length-1,me={toStringTag:Sh};me.absoluteValue=me.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),He(e)};me.ceil=function(){return He(new this.constructor(this),this.e+1,2)};me.clampedTo=me.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(Gr+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};me.comparedTo=me.cmp=function(e){var t,r,n,o,s=this,i=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!i||!a)return!c||!l?NaN:c!==l?c:i===a?0:!i^c<0?1:-1;if(!i[0]||!a[0])return i[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(n=i.length,o=a.length,t=0,r=n<o?n:o;t<r;++t)if(i[t]!==a[t])return i[t]>a[t]^c<0?1:-1;return n===o?0:n>o^c<0?1:-1};me.cosine=me.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+qe,n.rounding=1,r=mS(n,Nh(n,r)),n.precision=e,n.rounding=t,He(Rr==2||Rr==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};
vendor: 4,116 bytes, line 214
214me.cubeRoot=me.cbrt=function(){var e,t,r,n,o,s,i,a,c,l,f=this,y=f.constructor;if(!f.isFinite()||f.isZero())return new y(f);for(Qe=!1,s=f.s*Mt(f.s*f,1/3),!s||Math.abs(s)==1/0?(r=Ft(f.d),e=f.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=Mt(r,1/3),e=Kt((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new y(r),n.s=f.s):n=new y(s.toString()),i=(e=y.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(f),n=vt(l.plus(f).times(a),l.plus(c),i+2,1),Ft(a.d).slice(0,i)===(r=Ft(n.d)).slice(0,i))if(r=r.slice(i-3,i+1),r=="9999"||!o&&r=="4999"){if(!o&&(He(a,e+1,0),a.times(a).times(a).eq(f))){n=a;break}i+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(He(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return Qe=!0,He(n,e,y.rounding,t)};me.decimalPlaces=me.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Kt(this.e/qe))*qe,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};me.dividedBy=me.div=function(e){return vt(this,new this.constructor(e))};me.dividedToIntegerBy=me.divToInt=function(e){var t=this,r=t.constructor;return He(vt(t,new r(e),0,1,1),r.precision,r.rounding)};me.equals=me.eq=function(e){return this.cmp(e)===0};me.floor=function(){return He(new this.constructor(this),this.e+1,3)};me.greaterThan=me.gt=function(e){return this.cmp(e)>0};me.greaterThanOrEqualTo=me.gte=function(e){var t=this.cmp(e);return t==1||t===0};me.hyperbolicCosine=me.cosh=function(){var e,t,r,n,o,s=this,i=s.constructor,a=new i(1);if(!s.isFinite())return new i(s.s?1/0:NaN);if(s.isZero())return a;r=i.precision,n=i.rounding,i.precision=r+Math.max(s.e,s.sd())+4,i.rounding=1,o=s.d.length,o<32?(e=Math.ceil(o/3),t=(1/ei(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=Rn(i,1,s.times(t),new i(1),!0);for(var c,l=e,f=new i(8);l--;)c=s.times(s),s=a.minus(c.times(f.minus(c.times(f))));return He(s,i.precision=r,i.rounding=n,!0)};me.hyperbolicSine=me.sinh=function(){var e,t,r,n,o=this,s=o.constructor;if(!o.isFinite()||o.isZero())return new s(o);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,n=o.d.length,n<3)o=Rn(s,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/ei(5,e)),o=Rn(s,2,o,o,!0);for(var i,a=new s(5),c=new s(16),l=new s(20);e--;)i=o.times(o),o=o.times(a.plus(i.times(c.times(i).plus(l))))}return s.precision=t,s.rounding=r,He(o,t,r,!0)};me.hyperbolicTangent=me.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,vt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};me.inverseCosine=me.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,o=t.rounding;return r!==-1?r===0?e.isNeg()?Er(t,n,o):new t(0):new t(NaN):e.isZero()?Er(t,n+4,o).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=o,e.times(2))};me.inverseHyperbolicCosine=me.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Qe=!1,r=r.times(r).minus(1).sqrt().plus(r),Qe=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};me.inverseHyperbolicSine=me.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Qe=!1,r=r.times(r).plus(1).sqrt().plus(r),Qe=!0,n.precision=e,n.rounding=t,r.ln())};me.inverseHyperbolicTangent=me.atanh=function(){var e,t,r,n,o=this,s=o.constructor;return o.isFinite()?o.e>=0?new s(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=s.precision,t=s.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?He(new s(o),e,t,!0):(s.precision=r=n-o.e,o=vt(o.plus(1),new s(1).minus(o),r+e,1),s.precision=e+4,s.rounding=1,o=o.ln(),s.precision=e,s.rounding=t,o.times(.5))):new s(NaN)};me.inverseSine=me.asin=function(){var e,t,r,n,o=this,s=o.constructor;return o.isZero()?new s(o):(t=o.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=Er(s,r+4,n).times(.5),e.s=o.s,e):new s(NaN):(s.precision=r+6,s.roun
vendor: 5,276 bytes, line 214
214ding=1,o=o.div(new s(1).minus(o.times(o)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,o.times(2)))};me.inverseTangent=me.atan=function(){var e,t,r,n,o,s,i,a,c,l=this,f=l.constructor,y=f.precision,m=f.rounding;if(l.isFinite()){if(l.isZero())return new f(l);if(l.abs().eq(1)&&y+4<=xl)return i=Er(f,y+4,m).times(.25),i.s=l.s,i}else{if(!l.s)return new f(NaN);if(y+4<=xl)return i=Er(f,y+4,m).times(.5),i.s=l.s,i}for(f.precision=a=y+10,f.rounding=1,r=Math.min(28,a/qe+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Qe=!1,t=Math.ceil(a/qe),n=1,c=l.times(l),i=new f(l),o=l;e!==-1;)if(o=o.times(c),s=i.minus(o.div(n+=2)),o=o.times(c),i=s.plus(o.div(n+=2)),i.d[t]!==void 0)for(e=t;i.d[e]===s.d[e]&&e--;);return r&&(i=i.times(2<<r-1)),Qe=!0,He(i,f.precision=y,f.rounding=m,!0)};me.isFinite=function(){return!!this.d};me.isInteger=me.isInt=function(){return!!this.d&&Kt(this.e/qe)>this.d.length-2};me.isNaN=function(){return!this.s};me.isNegative=me.isNeg=function(){return this.s<0};me.isPositive=me.isPos=function(){return this.s>0};me.isZero=function(){return!!this.d&&this.d[0]===0};me.lessThan=me.lt=function(e){return this.cmp(e)<0};me.lessThanOrEqualTo=me.lte=function(e){return this.cmp(e)<1};me.logarithm=me.log=function(e){var t,r,n,o,s,i,a,c,l=this,f=l.constructor,y=f.precision,m=f.rounding,d=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new f(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)s=!0;else{for(o=r[0];o%10===0;)o/=10;s=o!==1}if(Qe=!1,a=y+d,i=zr(l,a),n=t?wo(f,a+10):zr(e,a),c=vt(i,n,a,1),da(c.d,o=y,m))do if(a+=10,i=zr(l,a),n=t?wo(f,a+10):zr(e,a),c=vt(i,n,a,1),!s){+Ft(c.d).slice(o+1,o+15)+1==1e14&&(c=He(c,y+1,0));break}while(da(c.d,o+=10,m));return Qe=!0,He(c,y,m)};me.minus=me.sub=function(e){var t,r,n,o,s,i,a,c,l,f,y,m,d=this,v=d.constructor;if(e=new v(e),!d.d||!e.d)return!d.s||!e.s?e=new v(NaN):d.d?e.s=-e.s:e=new v(e.d||d.s!==e.s?d:NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(l=d.d,m=e.d,a=v.precision,c=v.rounding,!l[0]||!m[0]){if(m[0])e.s=-e.s;else if(l[0])e=new v(d);else return new v(c===3?-0:0);return Qe?He(e,a,c):e}if(r=Kt(e.e/qe),f=Kt(d.e/qe),l=l.slice(),s=f-r,s){for(y=s<0,y?(t=l,s=-s,i=m.length):(t=m,r=f,i=l.length),n=Math.max(Math.ceil(a/qe),i)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=l.length,i=m.length,y=n<i,y&&(i=n),n=0;n<i;n++)if(l[n]!=m[n]){y=l[n]<m[n];break}s=0}for(y&&(t=l,l=m,m=t,e.s=-e.s),i=l.length,n=m.length-i;n>0;--n)l[i++]=0;for(n=m.length;n>s;){if(l[--n]<m[n]){for(o=n;o&&l[--o]===0;)l[o]=vr-1;--l[o],l[n]+=vr}l[n]-=m[n]}for(;l[--i]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Jo(l,r),Qe?He(e,a,c):e):new v(c===3?-0:0)};me.modulo=me.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?He(new n(r),n.precision,n.rounding):(Qe=!1,n.modulo==9?(t=vt(r,e.abs(),0,3,1),t.s*=e.s):t=vt(r,e,0,n.modulo,1),t=t.times(e),Qe=!0,r.minus(t))};me.naturalExponential=me.exp=function(){return Sl(this)};me.naturalLogarithm=me.ln=function(){return zr(this)};me.negated=me.neg=function(){var e=new this.constructor(this);return e.s=-e.s,He(e)};me.plus=me.add=function(e){var t,r,n,o,s,i,a,c,l,f,y=this,m=y.constructor;if(e=new m(e),!y.d||!e.d)return!y.s||!e.s?e=new m(NaN):y.d||(e=new m(e.d||y.s===e.s?y:NaN)),e;if(y.s!=e.s)return e.s=-e.s,y.minus(e);if(l=y.d,f=e.d,a=m.precision,c=m.rounding,!l[0]||!f[0])return f[0]||(e=new m(y)),Qe?He(e,a,c):e;if(s=Kt(y.e/qe),n=Kt(e.e/qe),l=l.slice(),o=s-n,o){for(o<0?(r=l,o=-o,i=f.length):(r=f,n=s,i=l.length),s=Math.ceil(a/qe),i=s>i?s+1:i+1,o>i&&(o=i,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(i=l.length,o=f.length,i-o<0&&(o=i,r=f,f=l,l=r),t=0;o;)t=(l[--o]=l[o]+f[o]+t)/vr|0,l[o]%=vr;for(t&&(l.unshift(t),++n),i=l.length;l[--i]==0;)l.pop();return e.d=l,e.e=Jo(l,n),Qe?He(e,a,c):e};me.precision=me.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Gr+e);return r.d?(t=wh(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};me.round=function(){var e=this,t=e.constructor;return He(new t(e),e.e+1,t.rounding)};me.sine=me.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+qe,n.rounding=1,r=vS(n,Nh(n,r)),n.precision=e,n.rounding=t,He(Rr>2?r.neg():r,e,t,!0)):new n(NaN)};me.squareRoot=me.sqrt=function(){var e,t,r,n,o,s,i=this,a=i.d,c=i.e,l=i.s,f=i.constructor;if(l!==1||!a||!a[0])return new f(!l||l<0&&(!a||a[0])?NaN:a?i:1/0);for(Qe=!1,l=Math.sqrt(+i),l==0||l==1/0?(t=Ft(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Kt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new f(t)):n=new f(l.toString()),r=(c=f.precision)+3;;)if(s=n,n=s.plus(vt(i,s,r+2,1)).times(.5),Ft(s.d).slice(0,r)===(t=Ft(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(He(s,c+1,0),s.times(s).eq(i))){n=s;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(He(n,c+1,1),e=!n.times(n).eq(i));break}return Qe=!0,He(n,c,f.rounding,e)};me.tangent=me.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.roun
vendor: 9,335 bytes, line 214
214ding=1,r=r.sin(),r.s=1,r=vt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,He(Rr==2||Rr==4?r.neg():r,e,t,!0)):new n(NaN)};me.times=me.mul=function(e){var t,r,n,o,s,i,a,c,l,f=this,y=f.constructor,m=f.d,d=(e=new y(e)).d;if(e.s*=f.s,!m||!m[0]||!d||!d[0])return new y(!e.s||m&&!m[0]&&!d||d&&!d[0]&&!m?NaN:!m||!d?e.s/0:e.s*0);for(r=Kt(f.e/qe)+Kt(e.e/qe),c=m.length,l=d.length,c<l&&(s=m,m=d,d=s,i=c,c=l,l=i),s=[],i=c+l,n=i;n--;)s.push(0);for(n=l;--n>=0;){for(t=0,o=c+n;o>n;)a=s[o]+d[n]*m[o-n-1]+t,s[o--]=a%vr|0,t=a/vr|0;s[o]=(s[o]+t)%vr|0}for(;!s[--i];)s.pop();return t?++r:s.shift(),e.d=s,e.e=Jo(s,r),Qe?He(e,y.precision,y.rounding):e};me.toBinary=function(e,t){return bc(this,2,e,t)};me.toDecimalPlaces=me.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(rr(e,0,Yr),t===void 0?t=n.rounding:rr(t,0,8),He(r,e+r.e+1,t))};me.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Tr(n,!0):(rr(e,0,Yr),t===void 0?t=o.rounding:rr(t,0,8),n=He(new o(n),e+1,t),r=Tr(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};me.toFixed=function(e,t){var r,n,o=this,s=o.constructor;return e===void 0?r=Tr(o):(rr(e,0,Yr),t===void 0?t=s.rounding:rr(t,0,8),n=He(new s(o),e+o.e+1,t),r=Tr(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};me.toFraction=function(e){var t,r,n,o,s,i,a,c,l,f,y,m,d=this,v=d.d,b=d.constructor;if(!v)return new b(d);if(l=r=new b(1),n=c=new b(0),t=new b(n),s=t.e=wh(v)-d.e-1,i=s%qe,t.d[0]=Mt(10,i<0?qe+i:i),e==null)e=s>0?t:l;else{if(a=new b(e),!a.isInt()||a.lt(l))throw Error(Gr+a);e=a.gt(t)?s>0?t:l:a}for(Qe=!1,a=new b(Ft(v)),f=b.precision,b.precision=s=v.length*qe*2;y=vt(a,t,0,1,1),o=r.plus(y.times(n)),o.cmp(e)!=1;)r=n,n=o,o=l,l=c.plus(y.times(o)),c=o,o=t,t=a.minus(y.times(o)),a=o;return o=vt(e.minus(r),n,0,1,1),c=c.plus(o.times(l)),r=r.plus(o.times(n)),c.s=l.s=d.s,m=vt(l,n,s,1).minus(d).abs().cmp(vt(c,r,s,1).minus(d).abs())<1?[l,n]:[c,r],b.precision=f,Qe=!0,m};me.toHexadecimal=me.toHex=function(e,t){return bc(this,16,e,t)};me.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:rr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Qe=!1,r=vt(r,e,0,t,1).times(e),Qe=!0,He(r)):(e.s=r.s,r=e),r};me.toNumber=function(){return+this};me.toOctal=function(e,t){return bc(this,8,e,t)};me.toPower=me.pow=function(e){var t,r,n,o,s,i,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(Mt(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,s=c.rounding,e.eq(1))return He(a,n,s);if(t=Kt(e.e/qe),t>=e.d.length-1&&(r=l<0?-l:l)<=pS)return o=Ih(c,a,r,n),e.s<0?new c(1).div(o):He(o,n,s);if(i=a.s,i<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(i=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=i,a}return r=Mt(+a,l),t=r==0||!isFinite(r)?Kt(l*(Math.log("0."+Ft(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?i/0:0):(Qe=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),o=Sl(e.times(zr(a,n+r)),n),o.d&&(o=He(o,n+5,1),da(o.d,n,s)&&(t=n+10,o=He(Sl(e.times(zr(a,t+r)),t),t+5,1),+Ft(o.d).slice(n+1,n+15)+1==1e14&&(o=He(o,n+1,0)))),o.s=i,Qe=!0,c.rounding=s,He(o,n,s))};me.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Tr(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(rr(e,1,Yr),t===void 0?t=o.rounding:rr(t,0,8),n=He(new o(n),e,t),r=Tr(n,e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};me.toSignificantDigits=me.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(rr(e,1,Yr),t===void 0?t=n.rounding:rr(t,0,8)),He(new n(r),e,t)};me.toString=function(){var e=this,t=e.constructor,r=Tr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};me.truncated=me.trunc=function(){return He(new this.constructor(this),this.e+1,1)};me.valueOf=me.toJSON=function(){var e=this,t=e.constructor,r=Tr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Ft(e){var t,r,n,o=e.length-1,s="",i=e[0];if(o>0){for(s+=i,t=1;t<o;t++)n=e[t]+"",r=qe-n.length,r&&(s+=jr(r)),s+=n;i=e[t],n=i+"",r=qe-n.length,r&&(s+=jr(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return s+i}function rr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Gr+e)}function da(e,t,r,n){var o,s,i,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=qe,o=0):(o=Math.ceil((t+1)/qe),t%=qe),s=Mt(10,qe-t),a=e[o]%s|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),i=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):i=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[o+1]/s/100|0)==Mt(10,t-2)-1||(a==s/2||a==0)&&(e[o+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),i=(n||r<4)&&a==9999||!n&&r>3&&a==4999):i=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[o+1]/s/1e3|0)==Mt(10,t-3)-1,i}function eo(e,t,r){for(var n,o=[0],s,i=0,a=e.length;i<a;){for(s=o.length;s--;)o[s]*=t;for(o[0]+=bl.indexOf(e.charAt(i++)),n=0;n<o.length;n++)o[n]>r-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function mS(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/ei(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=Rn(e,1,t.times(o),new e(1));for(var s=r;s--;){var i=t.times(t);t=i.times(i).minus(i).times(8).plus(1)}return e.precision-=r,t}var vt=(function(){function e(n,o,s){var i,a=0,c=n.length;for(n=n.slice();c--;)i=n[c]*o+a,n[c]=i%s|0,a=i/s|0;return a&&n.unshift(a),n}function t(n,o,s,i){var a,c;if(s!=i)c=s>i?1:-1;else for(a=c=0;a<s;a++)if(n[a]!=o[a]){c=n[a]>o[a]?1:-1;break}return c}function r(n,o,s,i){for(var a=0;s--;)n[s]-=a,a=n[s]<o[s]?1:0,n[s]=a*i+n[s]-o[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,s,i,a,c){var l,f,y,m,d,v,b,S,u,C,x,I,N,E,g,p,T,R,B,P,D=n.constructor,U=n.s==o.s?1:-1,_=n.d,V=o.d;if(!_||!_[0]||!V||!V[0])return new D(!n.s||!o.s||(_?V&&_[0]==V[0]:!V)?NaN:_&&_[0]==0||!V?U*0:U/0);for(c?(d=1,f=n.e-o.e):(c=vr,d=qe,f=Kt(n.e/d)-Kt(o.e/d)),B=V.length,T=_.length,u=new D(U),C=u.d=[],y=0;V[y]==(_[y]||0);y++);if(V[y]>(_[y]||0)&&f--,s==null?(E=s=D.precision,i=D.rounding):a?E=s+(n.e-o.e)+1:E=s,E<0)C.push(1),v=!0;else{if(E=E/d+2|0,y=0,B==1){for(m=0,V=V[0],E++;(y<T||m)&&E--;y++)g=m*c+(_[y]||0),C[y]=g/V|0,m=g%V|0;v=m||y<T}else{for(m=c/(V[0]+1)|0,m>1&&(V=e(V,m,c),_=e(_,m,c),B=V.length,T=_.length),p=B,x=_.slice(0,B),I=x.length;I<B;)x[I++]=0;P=V.slice(),P.unshift(0),R=V[0],V[1]>=c/2&&++R;do m=0,l=t(V,x,B,I),l<0?(N=x[0],B!=I&&(N=N*c+(x[1]||0)),m=N/R|0,m>1?(m>=c&&(m=c-1),b=e(V,m,c),S=b.length,I=x.length,l=t(b,x,S,I),l==1&&(m--,r(b,B<S?P:V,S,c))):(m==0&&(l=m=1),b=V.slice()),S=b.length,S<I&&b.unshift(0),r(x,b,I,c),l==-1&&(I=x.length,l=t(V,x,B,I),l<1&&(m++,r(x,B<I?P:V,I,c))),I=x.length):l===0&&(m++,x=[0]),C[y++]=m,l&&x[0]?x[I++]=_[p]||0:(x=[_[p]],I=1);while((p++<T||x[0]!==void 0)&&E--);v=x[0]!==void 0}C[0]||C.shift()}if(d==1)u.e=f,bh=v;else{for(y=1,m=C[0];m>=10;m/=10)y++;u.e=y+f*d-1,He(u,a?s+u.e+1:s,i,v)}return u}})();function He(e,t,r,n){var o,s,i,a,c,l,f,y,m,d=e.constructor;e:if(t!=null){if(y=e.d,!y)return e;for(o=1,a=y[0];a>=10;a/=10)o++;if(s=t-o,s<0)s+=qe,i=t,f=y[m=0],c=f/Mt(10,o-i-1)%10|0;else if(m=Math.ceil((s+1)/qe),a=y.length,m>=a)if(n){for(;a++<=m;)y.push(0);f=c=0,o=1,s%=qe,i=s-qe+1}else break e;else{for(f=a=y[m],o=1;a>=10;a/=10)o++;s%=qe,i=s-qe+o,c=i<0?0:f/Mt(10,o-i-1)%10|0}if(n=n||t<0||y[m+1]!==void 0||(i<0?f:f%Mt(10,o-i-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(s>0?i>0?f/Mt(10,o-i):0:y[m-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,l?(t-=e.e+1,y[0]=Mt(10,(qe-t%qe)%qe),e.e=-t||0):y[0]=e.e=0,e;if(s==0?(y.length=m,a=1,m--):(y.length=m+1,a=Mt(10,qe-s),y[m]=i>0?(f/Mt(10,o-i)%Mt(10,i)|0)*a:0),l)for(;;)if(m==0){for(s=1,i=y[0];i>=10;i/=10)s++;for(i=y[0]+=a,a=1;i>=10;i/=10)a++;s!=a&&(e.e++,y[0]==vr&&(y[0]=1));break}else{if(y[m]+=a,y[m]!=vr)break;y[m--]=0,a=1}for(s=y.length;y[--s]===0;)y.pop()}return Qe&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function Tr(e,t,r){if(!e.isFinite())return Ah(e);var n,o=e.e,s=Ft(e.d),i=s.length;return t?(r&&(n=r-i)>0?s=s.charAt(0)+"."+s.slice(1)+jr(n):i>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):o<0?(s="0."+jr(-o-1)+s,r&&(n=r-i)>0&&(s+=jr(n))):o>=i?(s+=jr(o+1-i),r&&(n=r-o-1)>0&&(s=s+"."+jr(n))):((n=o+1)<i&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-i)>0&&(o+1===i&&(s+="."),s+=jr(n))),s}function Jo(e,t){var r=e[0];for(t*=qe;r>=10;r/=10)t++;return t}function wo(e,t,r){if(t>hS)throw Qe=!0,r&&(e.precision=r),Error(Ch);return He(new e(So),t,1,!0)}function Er(e,t,r){if(t>xl)throw Error(Ch);return He(new e(Eo),t,r,!0)}function wh(e){var t=e.length-1,r=t*qe+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function jr(e){for(var t="";e--;)t+="0";return t}function Ih(e,t,r,n){var o,s=new e(1),i=Math.ceil(n/qe+4);for(Qe=!1;;){if(r%2&&(s=s.times(t),Ld(s.d,i)&&(o=!0)),r=Kt(r/2),r===0){r=s.d.length-1,o&&s.d[r]===0&&++s.d[r];break}t=t.times(t),Ld(t.d,i)}return Qe=!0,s}function Bd(e){return e.d[e.d.length-1]&1}function Th(e,t,r){for(var n,o,s=new e(t[0]),i=0;++i<t.length;){if(o=new e(t[i]),!o.s){s=o;break}n=s.cmp(o),(n===r||n===0&&s.s===r)&&(s=o)}return s}function Sl(e,t){var r,n,o,s,i,a,c,l=0,f=0,y=0,m=e.constructor,d=m.rounding,v=m.precision;if(!e.d||!e.d[0]||e.e>17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Qe=!1,c=v):c=t,a=new m(.03125);e.e>-2;)e=e.times(a),y+=5;
vendor: 5,432 bytes, line 214
214for(n=Math.log(Mt(2,y))/Math.LN10*2+5|0,c+=n,r=s=i=new m(1),m.precision=c;;){if(s=He(s.times(e),c,1),r=r.times(++f),a=i.plus(vt(s,r,c,1)),Ft(a.d).slice(0,c)===Ft(i.d).slice(0,c)){for(o=y;o--;)i=He(i.times(i),c,1);if(t==null)if(l<3&&da(i.d,c-n,d,l))m.precision=c+=10,r=s=a=new m(1),f=0,l++;else return He(i,m.precision=v,d,Qe=!0);else return m.precision=v,i}i=a}}function zr(e,t){var r,n,o,s,i,a,c,l,f,y,m,d=1,v=10,b=e,S=b.d,u=b.constructor,C=u.rounding,x=u.precision;if(b.s<0||!S||!S[0]||!b.e&&S[0]==1&&S.length==1)return new u(S&&!S[0]?-1/0:b.s!=1?NaN:S?0:b);if(t==null?(Qe=!1,f=x):f=t,u.precision=f+=v,r=Ft(S),n=r.charAt(0),Math.abs(s=b.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Ft(b.d),n=r.charAt(0),d++;s=b.e,n>1?(b=new u("0."+r),s++):b=new u(n+"."+r.slice(1))}else return l=wo(u,f+2,x).times(s+""),b=zr(new u(n+"."+r.slice(1)),f-v).plus(l),u.precision=x,t==null?He(b,x,C,Qe=!0):b;for(y=b,c=i=b=vt(b.minus(1),b.plus(1),f,1),m=He(b.times(b),f,1),o=3;;){if(i=He(i.times(m),f,1),l=c.plus(vt(i,new u(o),f,1)),Ft(l.d).slice(0,f)===Ft(c.d).slice(0,f))if(c=c.times(2),s!==0&&(c=c.plus(wo(u,f+2,x).times(s+""))),c=vt(c,new u(d),f,1),t==null)if(da(c.d,f-v,C,a))u.precision=f+=v,l=i=b=vt(y.minus(1),y.plus(1),f,1),m=He(b.times(b),f,1),o=a=1;else return He(c,u.precision=x,C,Qe=!0);else return u.precision=x,c;c=l,o+=2}}function Ah(e){return String(e.s*e.s/0)}function to(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%qe,r<0&&(n+=qe),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=qe;n<o;)e.d.push(+t.slice(n,n+=qe));t=t.slice(n),n=qe-t.length}else n-=o;for(;n--;)t+="0";e.d.push(+t),Qe&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function gS(e,t){var r,n,o,s,i,a,c,l,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Eh.test(t))return to(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(dS.test(t))r=16,t=t.toLowerCase();else if(uS.test(t))r=2;else if(fS.test(t))r=8;else throw Error(Gr+t);for(s=t.search(/p/i),s>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),i=s>=0,n=e.constructor,i&&(t=t.replace(".",""),a=t.length,s=a-s,o=Ih(n,new n(r),s,s*2)),l=eo(t,r,vr),f=l.length-1,s=f;l[s]===0;--s)l.pop();return s<0?new n(e.s*0):(e.e=Jo(l,f),e.d=l,Qe=!1,i&&(e=vt(e,o,a*4)),c&&(e=e.times(Math.abs(c)<54?Mt(2,c):Pn.pow(2,c))),Qe=!0,e)}function vS(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Rn(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/ei(5,r)),t=Rn(e,2,t,t);for(var o,s=new e(5),i=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(s.plus(o.times(i.times(o).minus(a))));return t}function Rn(e,t,r,n,o){var s,i,a,c,l=e.precision,f=Math.ceil(l/qe);for(Qe=!1,c=r.times(r),a=new e(n);;){if(i=vt(a.times(c),new e(t++*t++),l,1),a=o?n.plus(i):n.minus(i),n=vt(i.times(c),new e(t++*t++),l,1),i=a.plus(n),i.d[f]!==void 0){for(s=f;i.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=n,n=i,i=s}return Qe=!0,i.d.length=f+1,i}function ei(e,t){for(var r=e;--t;)r*=e;return r}function Nh(e,t){var r,n=t.s<0,o=Er(e,e.precision,1),s=o.times(.5);if(t=t.abs(),t.lte(s))return Rr=n?4:1,t;if(r=t.divToInt(o),r.isZero())Rr=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(s))return Rr=Bd(r)?n?2:3:n?4:1,t;Rr=Bd(r)?n?1:4:n?3:2}return t.minus(o).abs()}function bc(e,t,r,n){var o,s,i,a,c,l,f,y,m,d=e.constructor,v=r!==void 0;if(v?(rr(r,1,Yr),n===void 0?n=d.rounding:rr(n,0,8)):(r=d.precision,n=d.rounding),!e.isFinite())f=Ah(e);else{for(f=Tr(e),i=f.indexOf("."),v?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,i>=0&&(f=f.replace(".",""),m=new d(1),m.e=f.length-i,m.d=eo(Tr(m),10,o),m.e=m.d.length),y=eo(f,10,o),s=c=y.length;y[--c]==0;)y.pop();if(!y[0])f=v?"0p+0":"0";else{if(i<0?s--:(e=new d(e),e.d=y,e.e=s,e=vt(e,m,r,n,0,o),y=e.d,s=e.e,l=bh),i=y[r],a=o/2,l=l||y[r+1]!==void 0,l=n<4?(i!==void 0||l)&&(n===0||n===(e.s<0?3:2)):i>a||i===a&&(n===4||l||n===6&&y[r-1]&1||n===(e.s<0?8:7)),y.length=r,l)for(;++y[--r]>o-1;)y[r]=0,r||(++s,y.unshift(1));for(c=y.length;!y[c-1];--c);for(i=0,f="";i<c;i++)f+=bl.charAt(y[i]);if(v){if(c>1)if(t==16||t==8){for(i=t==16?4:3,--c;c%i;c++)f+="0";for(y=eo(f,o,t),c=y.length;!y[c-1];--c);for(i=1,f="1.";i<c;i++)f+=bl.charAt(y[i])}else f=f.charAt(0)+"."+f.slice(1);f=f+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)f="0"+f;f="0."+f}else if(++s>c)for(s-=c;s--;)f+="0";else s<c&&(f=f.slice(0,s)+"."+f.slice(s))}f=(t==16?"0x":t==2?"0b":t==8?"0o":"")+f}return e.s<0?"-"+f:f}function Ld(e,t){if(e.length>t)return e.length=t,!0}function yS(e){return new this(e).abs()}function bS(e){return new this(e).acos()}function CS(e){return new this(e).acosh()}function xS(e,t){return new this(e).plus(t)}function SS(e){return new this(e).asin()}function ES(e){return new this(e).asinh()}function wS(e){return new this(e).atan()}function IS(e){return new this(e).atanh()}function TS(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Er(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Er(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Er(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(vt(e,t,s,1)),t=Er(this,s,1),this.precision=n,this.rounding=o,r=e.s<0?r.minu
vendor: 4,832 bytes, line 214
214s(t):r.plus(t)):r=this.atan(vt(e,t,s,1)),r}function AS(e){return new this(e).cbrt()}function NS(e){return He(e=new this(e),e.e+1,2)}function RS(e,t,r){return new this(e).clamp(t,r)}function PS(e){if(!e||typeof e!="object")throw Error(Zo+"Object expected");var t,r,n,o=e.defaults===!0,s=["precision",1,Yr,"rounding",0,8,"toExpNeg",-Sn,0,"toExpPos",0,Sn,"maxE",0,Sn,"minE",-Sn,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],o&&(this[r]=Cl[r]),(n=e[r])!==void 0)if(Kt(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Gr+r+": "+n);if(r="crypto",o&&(this[r]=Cl[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(xh);else this[r]=!1;else throw Error(Gr+r+": "+n);return this}function BS(e){return new this(e).cos()}function LS(e){return new this(e).cosh()}function Rh(e){var t,r,n;function o(s){var i,a,c,l=this;if(!(l instanceof o))return new o(s);if(l.constructor=o,Md(s)){l.s=s.s,Qe?!s.d||s.e>o.maxE?(l.e=NaN,l.d=null):s.e<o.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(i=0,a=s;a>=10;a/=10)i++;Qe?i>o.maxE?(l.e=NaN,l.d=null):i<o.minE?(l.e=0,l.d=[0]):(l.e=i,l.d=[s]):(l.e=i,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return to(l,s.toString())}if(c==="string")return(a=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(a===43&&(s=s.slice(1)),l.s=1),Eh.test(s)?to(l,s):gS(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,to(l,s.toString());throw Error(Gr+s)}if(o.prototype=me,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=PS,o.clone=Rh,o.isDecimal=Md,o.abs=yS,o.acos=bS,o.acosh=CS,o.add=xS,o.asin=SS,o.asinh=ES,o.atan=wS,o.atanh=IS,o.atan2=TS,o.cbrt=AS,o.ceil=NS,o.clamp=RS,o.cos=BS,o.cosh=LS,o.div=MS,o.exp=DS,o.floor=$S,o.hypot=OS,o.ln=_S,o.log=kS,o.log10=FS,o.log2=VS,o.max=US,o.min=jS,o.mod=HS,o.mul=zS,o.pow=KS,o.random=GS,o.round=qS,o.sign=WS,o.sin=YS,o.sinh=XS,o.sqrt=QS,o.sub=ZS,o.sum=JS,o.tan=eE,o.tanh=tE,o.trunc=rE,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return o.config(e),o}function MS(e,t){return new this(e).div(t)}function DS(e){return new this(e).exp()}function $S(e){return He(e=new this(e),e.e+1,3)}function OS(){var e,t,r=new this(0);for(Qe=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Qe=!0,new this(1/0);r=t}return Qe=!0,r.sqrt()}function Md(e){return e instanceof Pn||e&&e.toStringTag===Sh||!1}function _S(e){return new this(e).ln()}function kS(e,t){return new this(e).log(t)}function VS(e){return new this(e).log(2)}function FS(e){return new this(e).log(10)}function US(){return Th(this,arguments,-1)}function jS(){return Th(this,arguments,1)}function HS(e,t){return new this(e).mod(t)}function zS(e,t){return new this(e).mul(t)}function KS(e,t){return new this(e).pow(t)}function GS(e){var t,r,n,o,s=0,i=new this(1),a=[];if(e===void 0?e=this.precision:rr(e,1,Yr),n=Math.ceil(e/qe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)o=t[s],o>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)o=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(o%1e7),s+=4);s=n/4}else throw Error(xh);else for(;s<n;)a[s++]=Math.random()*1e7|0;for(n=a[--s],e%=qe,n&&e&&(o=Mt(10,qe-e),a[s]=(n/o|0)*o);a[s]===0;s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=qe)a.shift();for(n=1,o=a[0];o>=10;o/=10)n++;n<qe&&(r-=qe-n)}return i.e=r,i.d=a,i}function qS(e){return He(e=new this(e),e.e+1,this.rounding)}function WS(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function YS(e){return new this(e).sin()}function XS(e){return new this(e).sinh()}function QS(e){return new this(e).sqrt()}function ZS(e,t){return new this(e).sub(t)}function JS(){var e=0,t=arguments,r=new this(t[e]);for(Qe=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Qe=!0,He(r,this.precision,this.rounding)}function eE(e){return new this(e).tan()}function tE(e){return new this(e).tanh()}function rE(e){return He(e=new this(e),e.e+1,1)}me[Symbol.for("nodejs.util.inspect.custom")]=me.toString;me[Symbol.toStringTag]="Decimal";var Pn=me.constructor=Rh(Cl);So=new Pn(So);Eo=new Pn(Eo);const nE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-ae'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%2300732f'%20
214d='M0%200h640v160H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20160h640v160H0z'/%3e%3cpath%20fill='%23000001'%20d='M0%20320h640v160H0z'/%3e%3cpath%20fill='red'%20d='M0%200h220v480H0z'/%3e%3c/svg%3e",aE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-au'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%2300008B'%20d='M0%200h640v480H0z'/%3e%3cpath%20fill='%23fff'%20d='m37.5%200%20122%2090.5L281%200h39v31l-120%2089.5%20120%2089V240h-40l-120-89.5L40.5%20240H0v-30l119.5-89L0%2032V0z'/%3e%3cpath%20fill='red'%20d='M212%20140.5%20320%20220v20l-135.5-99.5zm-92%2010%203%2017.5-96%2072H0zM320%200v1.5l-124.5%2094%201-22L295%200zM0%200l119.5%2088h-30L0%2021z'/%3e%3cpath%20fill='%23fff'%20d='M120.5%200v240h80V0zM0%2080v80h320V80z'/%3e%3cpath%20fill='red'%20d='M0%2096.5v48h320v-48zM136.5%200v240h48V0z'/%3e%3cpath%20fill='%23fff'%20d='m527%20396.7-20.5%202.6%202.2%2020.5-14.8-14.4-14.7%2014.5%202-20.5-20.5-2.4%2017.3-11.2-10.9-17.5%2019.6%206.5%206.9-19.5%207.1%2019.4%2019.5-6.7-10.7%2017.6zm-3.7-117.2%202.7-13-9.8-9%2013.2-1.5%205.5-12.1%205.5%2012.1%2013.2%201.5-9.8%209%202.7%2013-11.6-6.6zm-104.1-60-20.3%202.2%201.8%2020.3-14.4-14.5-14.8%2014.1%202.4-20.3-20.2-2.7%2017.3-10.8-10.5-17.5%2019.3%206.8L387%20178l6.7%2019.3%2019.4-6.3-10.9%2017.3%2017.1%2011.2ZM623%20186.7l-20.9%202.7%202.3%2020.9-15.1-14.7-15%2014.8%202.1-21-20.9-2.4%2017.7-11.5-11.1-17.9%2020%206.7%207-19.8%207.2%2019.8%2019.9-6.9-11%2018zm-96.1-83.5-20.7%202.3%201.9%2020.8-14.7-14.8-15.1%2014.4%202.4-20.7-20.7-2.8%2017.7-11L467%2073.5l19.7%206.9%207.3-19.5%206.8%2019.7%2019.8-6.5-11.1%2017.6zM234%20385.7l-45.8%205.4%204.6%2045.9-32.8-32.4-33%2032.2%204.9-45.9-45.8-5.8%2038.9-24.8-24-39.4%2043.6%2015%2015.8-43.4%2015.5%2043.5%2043.7-14.7-24.3%2039.2%2038.8%2025.1Z'/%3e%3c/svg%3e",oE="/static/svg/br-REPataop.svg",iE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-ca'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%23fff'%20d='M150.1%200h339.7v480H150z'/%3e%3cpath%20fill='%23d52b1e'%20d='M-19.7%200h169.8v480H-19.7zm509.5%200h169.8v480H489.9zM201%20232l-13.3%204.4%2061.4%2054c4.7%2013.7-1.6%2017.8-5.6%2025l66.6-8.4-1.6%2067%2013.9-.3-3.1-66.6%2066.7%208c-4.1-8.7-7.8-13.3-4-27.2l61.3-51-10.7-4c-8.8-6.8%203.8-32.6%205.6-48.9%200%200-35.7%2012.3-38%205.8l-9.2-17.5-32.6%2035.8c-3.5.9-5-.5-5.9-3.5l15-74.8-23.8%2013.4q-3.2%201.3-5.2-2.2l-23-46-23.6%2047.8q-2.8%202.5-5%20.7L264%2
2140130.8l13.7%2074.1c-1.1%203-3.7%203.8-6.7%202.2l-31.2-35.3c-4%206.5-6.8%2017.1-12.2%2019.5s-23.5-4.5-35.6-7c4.2%2014.8%2017%2039.6%209%2047.7'/%3e%3c/svg%3e",Dd="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20id='flag-icons-cn'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cpath%20id='cn-a'%20fill='%23ff0'%20d='M-.6.8%200-1%20.6.8-1-.3h2z'/%3e%3c/defs%3e%3cpath%20fill='%23ee1c25'%20d='M0%200h640v480H0z'/%3e%3cuse%20xlink:href='%23cn-a'%20width='30'%20height='20'%20transform='matrix(71.9991%200%200%2072%20120%20120)'/%3e%3cuse%20xlink:href='%23cn-a'%20width='30'%20height='20'%20transform='matrix(-12.33562%20-20.5871%2020.58684%20-12.33577%20240.3%2048)'/%3e%3cuse%20xlink:href='%23cn-a'%20width='30'%20height='20'%20transform='matrix(-3.38573%20-23.75998%2023.75968%20-3.38578%20288%2095.8)'/%3e%3cuse%20xlink:href='%23cn-a'%20width='30'%20height='20'%20transform='matrix(6.5991%20-23.0749%2023.0746%206.59919%20288%20168)'/%3e%3cuse%20xlink:href='%23cn-a'%20width='30'%20height='20'%20transform='matrix(14.9991%20-18.73557%2018.73533%2014.99929%20240%20216)'/%3e%3c/svg%3e",sE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20id='flag-icons-eu'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cg%20id='eu-d'%3e%3cg%20id='eu-b'%3e%3cpath%20id='eu-a'%20d='m0-1-.3%201%20.5.1z'/%3e%3cuse%20xlink:href='%23eu-a'%20transform='scale(-1%201)'/%3e%3c/g%3e%3cg%20id='eu-c'%3e%3cuse%20xlink:href='%23eu-b'%20transform='rotate(72)'/%3e%3cuse%20xlink:href='%23eu-b'%20transform='rotate(144)'/%3e%3c/g%3e%3cuse%20xlink:href='%23eu-c'%20transform='scale(-1%201)'/%3e%3c/g%3e%3c/defs%3e%3cpath%20fill='%23039'%20d='M0%200h640v480H0z'/%3e%3cg%20fill='%23fc0'%20transform='translate(320%20242.3)scale(23.7037)'%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20y='-6'/%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20y='6'/%3e%3cg%20id='eu-e'%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20x='-6'/%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20transform='rotate(-144%20-2.3%20-2.1)'/%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20transform='rotate(144%20-2.1%20-2.3)'/%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20transform='rotate(72%20-4.7%20-2)'/%3e%3cuse%20xlink:href='%23eu-d'%20width='100%25'%20height='100%25'%20transform='rotate(72%20-5%20.5)'/%3e%3c/g%3e%3cuse%20xlink:href='%23eu-e'%20width='100%25'%20height='100%25'%20transform='scale(-1%201)'/%3e%3c/g%3e%3c/svg%3e",lE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-gb'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%23012169'%20d='M0%200h640v480H0z'/%3e%3cpath%20fill='%23FFF'%20d='m75%200%20244%20181L562%200h78v62L400%20241l240%20178v61h-80L320%20301%2081%20480H0v-60l239-178L0%2064V0z'/%3e%3cpath%20fill='%23C8102E'%20d='m424%20281%20216%20159v40L369%20281zm-184%2020%206%2035L54%20480H0zM640%200v3L391%20191l2-44L590%200zM0%200l239%20176h-60L0%2042z'/%3e%3cpath%20fill='%23FFF'%20d='M241%200v480h160V0zM0%20160v160h640V160z'/%3e%3cpath%20fill='%23C8102E'%20d='M0%20193v96h640v-96zM273%200v480h96V0z'/%3e%3c/svg%3e",cE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20id='flag-icons-hk'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%23EC1B2E'%20d='M0%200h640v480H0'/%3e%3cpath%20id='hk-a'%20fill='%23fff'%20d='M346.3%20103.1C267%2098%20230.6%20201.9%20305.6%20240.3c-26-22.4-20.6-55.3-10.1-72.4l1.9%201.1c-13.8%2023.5-11.2%2052.7%2011.1%2071-12.7-12.3-9.5-39%2012.1-48.9s23.6-39.3%2016.4-49.1q-14.7-25.6%209.3-38.9M307.9%20164l-4.7%207.4-1.8-8.6-8.6-2.3%207.8-4.3-.6-8.9%206.5%206.1%208.3-3.3-3.7%208.1%205.6%206.8z'/%3e%3cuse%20xlink:href='%23hk-a'%20transform='rotate(72%20312.5%20243.5)'/%3e%3cuse%20xlink:href='%23hk-a'%20transform='rotate(144%20312.5%20243.5)'/%3e%3cuse%20xlink:href='%23hk-a'%20transform='rotate(216%20312.5%20243.5)'/%3e%3cuse%20xlink:href='%23hk-a'%20transform='rotate(288%20312.5%20243.5)'/%3e%3c/svg%3e",uE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-id'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%23e70011'%20d='M0%200h640v240H0Z'/%3e%3cpath%20fill='%23fff'%20d='M0%20240h64
2140v240H0Z'/%3e%3c/svg%3e",dE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20900%20600'%3e%3cpath%20fill='%23f93'%20d='M0%200h900v200H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20200h900v200H0z'/%3e%3cpath%20fill='%23128807'%20d='M0%20400h900v200H0z'/%3e%3cg%20transform='translate(450%20300)'%3e%3ccircle%20r='92.5'%20fill='%23008'/%3e%3ccircle%20r='80'%20fill='%23fff'/%3e%3ccircle%20r='16'%20fill='%23008'/%3e%3cg%20id='d'%3e%3cg%20id='c'%3e%3cg%20id='b'%3e%3cg%20id='a'%20fill='%23008'%3e%3ccircle%20r='3.5'%20transform='rotate(7.5%20-40%20610.282)'/%3e%3cpath%20d='m0%2080%203-48-2-16.031V15h-2v.969L-3%2032l3%2048z'/%3e%3c/g%3e%3cuse%20xlink:href='%23a'%20transform='rotate(15)'/%3e%3c/g%3e%3cuse%20xlink:href='%23b'%20transform='rotate(30)'/%3e%3c/g%3e%3cuse%20xlink:href='%23c'%20transform='rotate(60)'/%3e%3c/g%3e%3cuse%20xlink:href='%23d'%20transform='rotate(120)'/%3e%3cuse%20xlink:href='%23d'%20transform='rotate(-120)'/%3e%3c/g%3e%3c/svg%3e",fE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-jp'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cclipPath%20id='jp-a'%3e%3cpath%20fill-opacity='.7'%20d='M-88%2032h640v480H-88z'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20fill-rule='evenodd'%20stroke-width='1pt'%20clip-path='url(%23jp-a)'%20transform='translate(88%20-32)'%3e%3cpath%20fill='%23fff'%20d='M-128%2032h720v480h-720z'/%3e%3ccircle%20cx='523.1'%20cy='344.1'%20r='194.9'%20fill='%23bc002d'%20transform='translate(-168.4%208.6)scale(.76554)'/%3e%3c/g%3e%3c/svg%3e",pE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20id='flag-icons-kr'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cclipPath%20id='kr-a'%3e%3cpath%20fill-opacity='.7'%20d='M-95.8-.4h682.7v512H-95.8z'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20fill-rule='evenodd'%20clip-path='url(%23kr-a)'%20transform='translate(89.8%20.4)scale(.9375)'%3e%3cpath%20fill='%23fff'%20d='M-95.8-.4H587v512H-95.8Z'/%3e%3cg%20transform='rotate(-56.3%20361.6%20-101.3)scale(10.66667)'%3e%3cg%20id='kr-c'%3e%3cpath%20id='kr-b'%20fill='%23000001'%20d='M-6-26H6v2H-6Zm0%203H6v2H-6Zm0%203H6v2H-6Z'/%3e%3cuse%20xlink:href='%23kr-b'%20width='100%25'%20height='100%25'%20y='44'/%3e%3c/g%3e%3cpath%20stroke='%23fff'%20d='M0%2017v10'/%3e%3cpath%20fill='%23cd2e3a'%20d='M0-12a12%2012%200%200%201%200%2024Z'/%3e%3cpath%20fill='%230047a0'%20d='M0-12a12%2012%200%200%200%200%2024A6%206%200%200%200%200%200Z'/%3e%3ccircle%20cy='-6'%20r='6'%20fill='%23cd2e3a'/%3e%3c/g%3e%3cg%20transform='rotate(-123.7%20191.2%2062.2)scale(10.66667)'%3e%3cuse%20xlink:href='%23kr-c'%20width='100%25'%20height='100%25'/%3e%3cpath%20stroke='%23fff'%20d='M0-23.5v3M0%2017v3.5m0%203v3'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",hE="/static/svg/mx-BuKnwk5v.svg",mE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013440%206720'%3e%3cg%20transform='scale(480)'%3e%3cpath%20fill='%23fff'%20d='m0%200h28v14H0z'/%3e%3cpath%20stroke='%23c00'%20d='m1%20.5h27m0%202H1m0%202h27m0%202H1'/%3e%3cpath%20fill='%23006'%20d='m0%200h14v8.5H0z'/%3e%3cpath%20stroke='%23c00'%20d='m0%208.5h28m0%202H0m0%202h28'/%3e%3c/g%3e%3cpath%20fill='%23fc0'%20d='m4200%20720%20107%20732%20414-613-222%20706%20639-373-506%20540%20738-59-690%20267%20690%20267-738-59%20506%20540-639-373%20222%20706-414-613-107%20732-107-732-414%20613%20222-706-639%20373%20506-540-738%2059%20690-267-690-267%20738%2059-506-540%20639%20373-222-706%20414%20613zm-600%2030a1280%201280%200%201%200%200%202340%201440%201440%200%201%201%200-2340z'/%3e%3c/svg%3e",gE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20180%2090'%3e%3cpath%20fill='%230038a8'%20d='M0%200h180v90H0z'/%3e%3cpath%20fill='%23ce1126'%20d='M0%2045h180v45H0z'/%3e%3cpath%20d='M77.942%2045L0%2090V0'%20fill='%23fff'/%3e%3cg%20transform='translate(28%2045)'%20fill='%23fcd116'%3e%3ccircle%20r='9'/%3e%3cg%20id='d'%3e%3cg%20id='c'%3e%3cg%20id='b'%3e%3cpath%20d='M-1%200l.062.062L0%200l-.938-.062z'%20transform='scale(19)'/%3e%3cpath%20id='a'%20d='M-.884.116l.05.05L0%200z'%20transform='scale(19.2381
214)'/%3e%3cuse%20xlink:href='%23a'%20transform='scale(1%20-1)'/%3e%3c/g%3e%3cuse%20xlink:href='%23b'%20transform='rotate(45)'/%3e%3c/g%3e%3cuse%20xlink:href='%23c'%20transform='rotate(90)'/%3e%3c/g%3e%3cuse%20xlink:href='%23d'%20transform='rotate(180)'/%3e%3cg%20transform='translate(-2.02)'%3e%3cg%20id='f'%20transform='translate(37.962)'%3e%3cpath%20id='e'%20d='M5%200L1.618%201.176l-.073%203.58-2.163-2.854-3.427%201.037L-2%200z'/%3e%3cuse%20xlink:href='%23e'%20transform='scale(1%20-1)'/%3e%3c/g%3e%3cuse%20xlink:href='%23f'%20transform='rotate(120)'/%3e%3cuse%20xlink:href='%23f'%20transform='rotate(-120)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",vE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2010'%3e%3cpath%20fill='%23fff'%20d='M0%200h16v10H0z'/%3e%3cpath%20fill='%23dc143c'%20d='M0%205h16v5H0z'/%3e%3c/svg%3e",yE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-sg'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cclipPath%20id='sg-a'%3e%3cpath%20fill-opacity='.7'%20d='M0%200h640v480H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20fill-rule='evenodd'%20clip-path='url(%23sg-a)'%3e%3cpath%20fill='%23fff'%20d='M-20%200h720v480H-20z'/%3e%3cpath%20fill='%23df0000'%20d='M-20%200h720v240H-20z'/%3e%3cpath%20fill='%23fff'%20d='M146%2040.2a84.4%2084.4%200%200%200%20.8%20165.2%2086%2086%200%200%201-106.6-59%2086%2086%200%200%201%2059-106c16-4.6%2030.8-4.7%2046.9-.2z'/%3e%3cpath%20fill='%23fff'%20d='m133%20110%204.9%2015-13-9.2-12.8%209.4%204.7-15.2-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.5%2052%205%2015.1-13-9.2-12.9%209.3%204.8-15.1-12.8-9.4%2015.9-.1%204.9-15.1%205%2015h16zm58.5-.4%204.9%2015.2-13-9.3-12.8%209.3%204.7-15.1-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.4-51.6%204.9%2015.1-13-9.2-12.8%209.3%204.8-15.1-12.9-9.4%2016-.1%204.8-15.1%205%2015h16zm-46.3-34.3%205%2015.2-13-9.3-12.9%209.4%204.8-15.2-12.8-9.4%2015.8-.1%205-15.1%205%2015h16z'/%3e%3c/g%3e%3c/svg%3e",bE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%209%206'%3e%3cpath%20fill='%23A51931'%20d='M0%200h9v6H0z'/%3e%3cpath%20fill='%23F4F5F8'%20d='M0%201h9v4H0z'/%3e%3cpath%20fill='%232D2A4A'%20d='M0%202h9v2H0z'/%3e%3c/svg%3e",CE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%208'%3e%3cpath%20fill='%23E30A17'%20d='M0%200h12v8H0z'/%3e%3ccircle%20cx='4.25'%20cy='4'%20r='2'%20fill='%23fff'/%3e%3ccircle%20cx='4.75'%20cy='4'%20r='1.6'%20fill='%23e30a17'/%3e%3cpath%20fill='%23fff'%20d='M5.83334%204l1.80901%20.58779-1.11804-1.53885v1.90212l1.11804-1.53885z'/%3e%3c/svg%3e",xE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-us'%20viewBox='0%200%20640%20480'%3e%3cpath%20fill='%23bd3d44'%20d='M0%200h640v480H0'/%3e%3cpath%20stroke='%23fff'%20stroke-width='37'%20d='M0%2055.3h640M0%20129h640M0%20203h640M0%20277h640M0%20351h640M0%20425h640'/%3e%3cpath%20fill='%23192f5d'%20d='M0%200h364.8v258.5H0'/%3e%3cmarker%20id='us-a'%20markerHeight='30'%20markerWidth='30'%3e%3cpath%20fill='%23fff'%20d='m14%200%209%2027L0%2010h28L5%2027z'/%3e%3c/marker%3e%3cpath%20fill='none'%20marker-mid='url(%23us-a)'%20d='m0%200%2016%2011h61%2061%2061%2061%2060L47%2037h61%2061%2060%2061L16%2063h61%2061%2061%2061%2060L47%2089h61%2061%2060%2061L16%20115h61%2061%2061%2061%2060L47%20141h61%2061%2060%2061L16%20166h61%2061%2061%2061%2060L47%20192h61%2061%2060%2061L16%20218h61%2061%2061%2061%2060z'/%3e%3c/svg%3e",SE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-15%20-10%2030%2020'%3e%3cpath%20fill='%23DA251d'%20d='M-20-15h40v30h-40z'/%3e%3cg%20id='b'%20transform='translate(0%20-6)'%3e%3cpath%20id='a'%20fill='%23FF0'%20transform='rotate(18)'%20d='M0%200v6h4'/%3e%3cuse%20xlink:href='%23a'%20transform='scale(-1%201)'/%3e%3c/g%3e%3cg%20id='c'%20transform='rotate(72)'%3e%3cuse%20xlink:href='%23b'/%3e%3cuse%20xlink:href='%23b'%20transform='rotate(72)'/%3e%3c/g%3e%3cuse%20xlink:href='%23c'%20transform='scale(-1%201)'/%3e%3c/svg%3e",Bn=[{label:"USD",value:"USD",minUnit:2,symbol:"$",logo:xE},{label:"EUR",value:"EUR",minUnit:2,symbol:"â¬",logo:sE},{label:"JPY",value:"JPY",minUnit:0,symbol:"Â¥",logo:fE},{label:"GBP",value:"GBP",minUnit:2,symbol:"£",logo:lE},{label:"AUD",value:"AUD",minUnit:2,symbol:"A$",logo:aE},{label:"CAD",value:"CAD",minUnit:2,symbol:"C$",logo:iE},{label:"CNY",value:"CNY",minUnit:2,symbol:"Â¥",logo:Dd},{label:"HKD",value:"HKD",minUnit:2,symbol:"HK$",logo:cE},{label:"SGD",value:"SGD",minUnit:2,symbol:"S$",logo:yE},{label:"KRW",value:"KRW",minUnit:0,symbol:"â©",logo:pE},{label:"AED",value:"AED",minUnit:2,symbol:"د.Ø¥",logo:nE},{label:"BRL",value:"BRL",minUnit:2,symbol:"R$",logo:oE},{label:"INR",value:"INR",minUnit:2,symbol:"â¹",logo:dE},{label:"IDR",value:"IDR",minUnit:0,symbol:"Rp",logo:uE},{label:"PHP",value:"PHP",minUnit:2,symbol:"â±",logo:gE},{label:"THB",value:"THB",minUnit:2,symbol:"฿",logo:bE},{label:"MYR",value:"MYR",minUnit:2,symbol:"RM",logo:mE},{label:"MXN",value:"MXN",minUnit:2,symbol:"MX$",logo:hE},{label:"TRY",value:"TRY",minUnit:2,symbol:"âº",logo:CE},{label:"TWD",value:"TWD",minUnit:2,symbol:"NT$",logo:Dd},{label:"VND",value:"VND",minUnit:0,symbol:"â«",logo:SE},{label:"PLN",value:"PLN",minUnit:2,symbol:"zÅ",logo:vE}];function zt(e,t,r){if(typeof e!="number")return e;let n=2;const o=Bn.find(a=>a.value===t);o&&(n=o.minUnit);const s=new Pn(e).toDecimalPlaces(n,Pn.ROUND_DOWN).toFixed(n),{addSeparator:i=!0}={};return i?Cc(s):s}function Cc(e){const t=e.startsWith("-"),[r,n]=(t?e.slice(1):e).split(".");if(!r)return e;const o=r.replaceAll(/\B(?=(\d{3})+(?!\d))/g,",")||"0";return(t?"-":"")+o+(n?`.${n}`:"")}const Mr={NORMAL:0,PAID:1,INVALID:2},Kr={NORMAL:0,LOCKED:1,CHANEL_PENDING:2};function EE(e){const{sessionId:t,onPaymentSuccessDetected:r,immediate:n=!1}=e,o=Gl(r);h.useEffect(()=>{let s,i,a=!0;async function c(){try{i=ko(t,{errorMessageMode:"none"});const l=await i;a&&l.status===Mr.PAID&&await o.current()}catch{}finally{i=void 0,a&&(s=setTimeout(c,2e3))}}return n?c():s=setTimeout(c,2e3),()=>{a=!1,s&&clearTimeout(s),i?.abort()}},[n,o,t])}function wE(e){const{session:t,onPaymentSuccessDetected:r}=e;EE({sessionId:t.sessionId,onPaymentSuccessDetected:r,immediate:!0});const n=Fo({loading:!0,isSubscription:!1,subscriptionCycle:"",isFreeSubscription:!1,amount:""});Fl(async()=>{try{n.loading=!0;const y=t;if(y.priceType===gr){if(n.isSubscription=!0,!y.remotePriceSnapshotVo)return;const m=y.remotePriceSnapshotVo.recurringDetailsObject;if(n.subscriptionCycle=m.interval,Number(m.trial_period_days)>0){const d=y.sessionCurrencyPriceVoList[0];n.amount=`${d.symbol}0`,n.isFreeSubscription=!0}
214else{const{currentOrder:d}=y;if(d){const v=zt(d.paymentAmount,d.paymentCurrency);n.amount=`${d.paymentCurrencySymbol}${v} ${d.paymentCurrency}`}n.isFreeSubscription=!1}}if(y.priceType===rn){n.isSubscription=!1,n.isFreeSubscription=!1,n.subscriptionCycle="";const{currentOrder:m}=y;if(m){const d=zt(m.paymentAmount,m.paymentCurrency);n.amount=`${m.paymentCurrencySymbol}${d} ${m.paymentCurrency}`}}}catch{}finally{n.loading=!1}},[]);const o=t.currentOrder?.paymentMethodType!==hr,s=t.currentOrder?.paymentMethodType==="BLIK",{t:i}=rt(),a=t?.sessionContext?.cancelUrl??"",c=Hl(a)?a:"",l=t?.remoteMerchantVo?.merchantName,f=l?i("payment.backToMerchantName",{merchant:l}):i("payment.backToMerchant");return L.jsxs("div",{className:le("py-[30px] max-lg:p-10 flex flex-col flex-1","pay-pending"),children:[L.jsxs("div",{className:"flex flex-col justify-center items-center",style:{animation:"slide-up 0.8s ease-in-out"},children:[L.jsxs("div",{className:"loader lg:my-[60px] my-[40px]",children:[L.jsx("span",{className:"hour"}),L.jsx("span",{className:"min"}),L.jsx("span",{className:"circle"})]}),L.jsx("div",{className:le("text-ant-lg leading-[26px] text-ant-text-secondary","text-center flex flex-wrap justify-center"),children:L.jsx(Af,{condition:o,match:L.jsx(Za,{i18nKey:n.isFreeSubscription?i("payment.pending.tip1WithFree"):i("payment.pending.tip1"),values:{card:"",amount:n.amount},components:{1:L.jsx(TE,{type:t.currentOrder?.paymentMethodType})}}),fallback:L.jsx(Za,{i18nKey:n.isFreeSubscription?i("payment.pending.tip1WithFree"):i("payment.pending.tip1"),values:{card:`â¢â¢â¢â¢ ${t.currentCardLastFour}`,amount:n.amount},components:{1:L.jsx(IE,{cardType:t.currentCardScheme})}})})}),s&&L.jsx("div",{className:"text-ant-lg leading-[26px] text-ant-text-secondary mt-4 text-center",children:i("payment.blik.pendingConfirmation")}),L.jsx("div",{className:"text-ant-lg leading-[26px] text-ant-text-secondary mt-4 text-center",children:L.jsx(Za,{i18nKey:i("payment.pending.tip2"),values:{merchant:t.remoteMerchantVo.merchantName},components:{1:L.jsx("span",{className:"font-bold"},"merchant")}})})]}),c&&L.jsx(Or,{className:"mt-6",href:c,size:"large",children:f}),L.jsx("div",{className:"mt-[100px]",style:{animation:"slide-down 0.8s ease-in-out"},children:L.jsx(Vo,{})})]})}function IE(e){const t=cS(e.cardType??"");return L.jsxs("span",{className:"font-medium flex w-fit items-center",children:[L.jsx("img",{className:le("w-[32px] h-[20px] select-none pointer-events-none","rounded-[4px]","ml-1 border border-ant-border-secondary"),src:t,alt:e.cardType}),L.jsx("span",{className:"mx-1",children:e.children})]})}function TE(e){const{i18n:t}=rt(),r=Wa(e.type??"",t);return L.jsxs("span",{className:"font-medium flex w-fit items-center gap-1",children:[L.jsx("img",{className:le("size-[20px] select-none pointer-events-none","rounded-[4px]","ml-1 border border-ant-border-secondary"),src:r?.img,alt:r?.name}),L.jsx("span",{children:r?.name}),L.jsx("span",{children:e.children})]})}function AE(e){const{t}=rt();return L.jsx("div",{className:"flex flex-col",children:L.jsx(z2,{icon:null,title:L.jsx("span",{className:"text-white",children:t("payment.paying.orderProcessing")}),subTitle:L.jsx("span",{className:"text-[white]/65",children:t("payment.paying.orderProcessingSubtitle")}),extra:[L.jsx(Or,{loading:e.loading,disabled:e.loading,type:"primary",onClick:e.onClick,children:t("payment.paying.reload")},"console")]})})}function Ph(e){const{isRetrying:t=!1}=e??{},r=zg(),{paymentLoading:n}=jl(),{t:o}=rt(),[s,i]=h.useState(!1);async function a(c){const{status:l,payStatus:f=0,sessionId:y,tokenValue:m}=c;async function d(){try{i(!0);const{sessionId:b,tokenValue:S}=c,u=await Pf(`${b}#${S}`);await a(u)}catch{}finally{i(!1)}}const v=!0;switch(l){case Mr.NORMAL:{if(f===Kr.NORMAL)return n(!1),await r(`${ii}/${y}%23${m}`,{replace:v}),!0;if(f===Kr.CHANEL_PENDING){n(!1),await r(`${ii}/${y}%23${m}`,{replace:v});return}if(f===Kr.LOCKED){if(t)return"retrying";n(!0,{message:o("payment.paying.orderProcessingSubtitle"),node:h.createElement(AE,{onClick:d,loading:s})})}break}case Mr.PAID:case Mr.INVALID:{n(!1),await r(`${ii}/${y}%23${m}`,{replace:v});break}}}return{dispatch:a}}const NE=3e3;function RE(e){const{session:t}=e,r=h.useMemo(()=>{const{remoteMerchantVo:i}=t;if(!i)return t.currentOrder?.descriptor??"CLINK";const{contractType:a,merchantName:c}=i;return a==="Billing"?c:`CLINK*${c}`},[t]);Fl(async()=>{try{setTimeout(()=>{const i=JSON.parse(t.content||"{}");
214if(i.successUrl&&Hl(i.successUrl)){const a=i.successUrl,c=a.includes("?")?`${a}&sessionId=${t.sessionId}`:`${a}?sessionId=${t.sessionId}`;window.location.href=c}},NE)}catch{}},[t]);const{t:n}=rt(),[o,s]=h.useState(!1);return L.jsxs("div",{className:le("py-[30px] max-lg:p-10 flex flex-col flex-1","pay-success"),children:[L.jsxs("div",{className:"flex flex-col items-center mt-[50px] max-lg:mt-[10px]",style:{animation:"slide-up 0.8s ease-in-out"},onAnimationEnd:()=>{s(!0)},children:[L.jsx("div",{className:"select-none pointer-events-none relative size-[100px]",children:L.jsx("div",{className:"absolute top-[-150%] left-[-150%]",children:o&&L.jsxs("svg",{className:le("scale-[0.15]","max-lg:scale-[0.12]"),width:"400",height:"400",children:[L.jsx("circle",{fill:"none",stroke:"#24b47e",strokeWidth:"20",cx:"200",cy:"200",r:"190",className:"circle",strokeLinecap:"round",transform:"rotate(-90 200 200) "}),L.jsx("polyline",{fill:"none",stroke:"#24b47e",strokeWidth:"24",points:"88,214 173,284 304,138",strokeLinecap:"round",strokeLinejoin:"round",className:"tick"})]})})}),L.jsx("span",{className:le("text-ant-text font-semibold","text-ant-xl leading-[26px] mt-[45px]","max-lg:mt-[25px] max-lg:text-[25px] max-lg:leading-[37px]","text-center"),children:n("payment.success.title")}),L.jsx("span",{className:le("text-ant-text-tertiary text-ant leading-[22px] mt-[16px]","max-lg:text-ant-sm max-lg:leading-[18px] text-center"),children:L.jsx(Za,{i18nKey:n("payment.success.subTitle"),values:{descriptor:r},components:{1:L.jsx("span",{className:"font-semibold text-black/65"})}})})]}),L.jsx("div",{className:"mt-[16px]",style:{animation:"slide-down 0.8s ease-in-out"},children:L.jsx(Vo,{})})]})}function PE(e){const{ref:t}=e,[r,n]=h.useState(null),o=h.useRef(null);h.useImperativeHandle(t,()=>({open(a){n(a),i.open=!0},close(){i.open=!1,n(null)},iframeRef:o}));function s(){i.open=!1,n(null),e?.onCancel?.()}const i=Fo({open:!1});return L.jsx($o,{styles:{container:{"--ant-box-shadow":"none","--ant-modal-content-padding":"0"},body:{"--ant-modal-body-padding":"0",overflow:"hidden",isolation:"isolate",borderRadius:"var(--ant-border-radius-lg)"}},open:i.open,centered:!0,footer:null,onCancel:s,width:800,maskClosable:!1,destroyOnHidden:!0,children:r&&L.jsx("iframe",{ref:o,className:"w-full h-[600px] border-none",src:r})})}function BE(e){const{ref:t}=e,r=h.useRef(null),[n,o]=h.useState(!1),[s,i]=h.useState(!0),a=h.useRef({url:""});h.useImperativeHandle(t,()=>({open(f,y){a.current={url:f,extraData:y},i(!0),o(!0)},close(){o(!1),i(!1)},iframeRef:r}));function c(){o(!1),i(!1),e?.onCancel?.()}function l(f){if(!f)return;const{url:y,extraData:m}=a.current,d=document.createElement("form");d.action=y,d.method="post",d.target="formIframe",m&&Object.entries(m).forEach(([v,b])=>{const S=document.createElement("input");S.type="hidden",S.name=v,S.value=b,d.appendChild(S)}),document.body.appendChild(d),d.submit(),document.body.removeChild(d)}return L.jsx($o,{open:n,centered:!0,footer:null,onCancel:c,width:600,maskClosable:!1,afterOpenChange:l,destroyOnHidden:!0,style:{"--ant-modal-content-padding":"12px 0"},children:L.jsx(cr,{size:"large",spinning:s,children:L.jsx("iframe",{ref:r,className:"w-full h-[660px] border-none",name:"formIframe",id:"formIframe",onLoad:()=>{i(!1)}})})})}const Io=ga(e=>({cardholderName:void 0,setCardholderName:t=>e({cardholderName:t})})),wt=ga(e=>({currentCheckedCurrency:"",setCurrentCheckedCurrency:t=>e({currentCheckedCurrency:t}),sessionCurrencyList:[],updateSessionCurrencyList:t=>e({sessionCurrencyList:t}),initialSessionCurrencyList:[],setInitialSessionCurrencyList:t=>e({initialSessionCurrencyList:t})})),nn=ga(e=>({pricingSchedule:null,setPricingSchedule:t=>e({pricingSchedule:t}),billingSchedule:null,setBillingSchedule:t=>e({billingSchedule:t})})),lr=ga(e=>({info:{},setInfo:t=>e({info:t}),requiresTaxCalculation:!1,setRequiresTaxCalculation:t=>e({requiresTaxCalculation:t})})),Bh=h.createContext(null);function El(e){return e?.country?tn.includes(e.country)?{country:e.country,line1:e.line1,...e.line2?{line2:e.line2}:{},city:e.city,postalCode:e.postalCode,region:e.region}:{country:e.country}:{}}function LE(e){const{country:t,line1:r,line2:n,city:o,postalCode:s,region:i}=lr.getState().info;e.setFieldsValue({country:t,line1:r,line2:n,city:o,postalCode:s,region:i})}function ME(e){return!e||!e.country?!1:tn.includes(e.country)?["line1","postalCode","region","city"].every(r=>!!e[r]):!0}var Mi,$d;function nt(){return $d||($d=1,Mi={options:{usePureJavaScript:!1}}),Mi}var Di={exports:{}},$i,Od;function DE(){if(Od)return $i;Od=1;var e={};$i=e;var t={};
214e.encode=function(n,o,s){if(typeof o!="string")throw new TypeError('"alphabet" must be a string.');if(s!==void 0&&typeof s!="number")throw new TypeError('"maxline" must be a number.');var i="";if(!(n instanceof Uint8Array))i=r(n,o);else{var a=0,c=o.length,l=o.charAt(0),f=[0];for(a=0;a<n.length;++a){for(var y=0,m=n[a];y<f.length;++y)m+=f[y]<<8,f[y]=m%c,m=m/c|0;for(;m>0;)f.push(m%c),m=m/c|0}for(a=0;n[a]===0&&a<n.length-1;++a)i+=l;for(a=f.length-1;a>=0;--a)i+=o[f[a]]}if(s){var d=new RegExp(".{1,"+s+"}","g");i=i.match(d).join(`\r 215`)}return i},e.decode=function(n,o){if(typeof n!="string")throw new TypeError('"input" must be a string.');if(typeof o!="string")throw new TypeError('"alphabet" must be a string.');var s=t[o];if(!s){s=t[o]=[];for(var i=0;i<o.length;++i)s[o.charCodeAt(i)]=i}n=n.replace(/\s/g,"");for(var a=o.length,c=o.charAt(0),l=[0],i=0;i<n.length;i++){var f=s[n.charCodeAt(i)];if(f===void 0)return;for(var y=0,m=f;y<l.length;++y)m+=l[y]*a,l[y]=m&255,m>>=8;for(;m>0;)l.push(m&255),m>>=8}for(var d=0;n[d]===c&&d<n.length-1;++d)l.push(0);return typeof Buffer<"u"?Buffer.from(l.reverse()):new Uint8Array(l.reverse())};function r(n,o){var s=0,i=o.length,a=o.charAt(0),c=[0];for(s=0;s<n.length();++s){for(var l=0,f=n.at(s);l<c.length;++l)f+=c[l]<<8,c[l]=f%i,f=f/i|0;for(;f>0;)c.push(f%i),f=f/i|0}var y="";for(s=0;n.at(s)===0&&s<n.length()-1;++s)y+=a;for(s=c.length-1;s>=0;--s)y+=o[c[s]];return y}return $i}var _d;function pt(){if(_d)return Di.exports;_d=1;var e=nt(),t=DE(),r=Di.exports=e.util=e.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){r.nextTick=process.nextTick,typeof setImmediate=="function"?r.setImmediate=setImmediate:r.setImmediate=r.nextTick;return}if(typeof setImmediate=="function"){r.setImmediate=function(){return setImmediate.apply(void 0,arguments)},r.nextTick=function(g){return setImmediate(g)};return}if(r.setImmediate=function(g){setTimeout(g,0)},typeof window<"u"&&typeof window.postMessage=="function"){let g=function(p){if(p.source===window&&p.data===u){p.stopPropagation();var T=C.slice();C.length=0,T.forEach(function(R){R()})}};var u="forge.setImmediate",C=[];r.setImmediate=function(p){C.push(p),C.length===1&&window.postMessage(u,"*")},window.addEventListener("message",g,!0)}if(typeof MutationObserver<"u"){var x=Date.now(),I=!0,N=document.createElement("div"),C=[];new MutationObserver(function(){var p=C.slice();C.length=0,p.forEach(function(T){T()})}).observe(N,{attributes:!0});var E=r.setImmediate;r.setImmediate=function(p){Date.now()-x>15?(x=Date.now(),E(p)):(C.push(p),C.length===1&&N.setAttribute("a",I=!I))}}r.nextTick=r.setImmediate})(),r.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,r.globalScope=(function(){return r.isNodejs?Wn:typeof self>"u"?window:self})(),r.isArray=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},r.isArrayBuffer=function(u){return typeof ArrayBuffer<"u"&&u instanceof ArrayBuffer},r.isArrayBufferView=function(u){return u&&r.isArrayBuffer(u.buffer)&&u.byteLength!==void 0};function n(u){if(!(u===8||u===16||u===24||u===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+u)}r.ByteBuffer=o;function o(u){if(this.data="",this.read=0,typeof u=="string")this.data=u;else if(r.isArrayBuffer(u)||r.isArrayBufferView(u))if(typeof Buffer<"u"&&u instanceof Buffer)this.data=u.toString("binary");else{var C=new Uint8Array(u);try{this.data=String.fromCharCode.apply(null,C)}catch{for(var x=0;x<C.length;++x)this.putByte(C[x])}}else(u instanceof o||typeof u=="object"&&typeof u.data=="string"&&typeof u.read=="number")&&(this.data=u.data,this.read=u.read);this._constructedStringLength=0}r.ByteStringBuffer=o;var s=4096;r.ByteStringBuffer.prototype._optimizeConstructedString=function(u){this._constructedStringLength+=u,this._constructedStringLength>s&&(this.data.substr(0,1),this._constructedStringLength=0)},r.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},r.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},r.ByteStringBuffer.prototype.putByte=function(u){return this.putBytes(String.fromCharCode(u))},r.ByteStringBuffer.prototype.fillWithByte=function(u,C){u=String.fromCharCode(u);for(var x=this.data;C>0;)C&1&&(x+=u),C>>>=1,C>0&&(u+=u);return this.data=x,this._optimizeConstructedString(C),this},r.ByteStringBuffer.prototype.putBytes=function(u){return this.data+=u,this._optimizeConstructedString(u.length),this},r.ByteStringBuffer.prototype.putString=function(u){return this.putBytes(r.encodeUtf8(u))},r.ByteStringBuffer.prototype.putInt16=function(u){return this.putBytes(String.fromCharCode(u>>8&255)+String.fromCharCode(u&255))},r.ByteStringBuffer.prototype.putInt24=function(u){return this.putBytes(String.fromCharCode(u>>16&255)+String.fromCharCode(u>>8&255)+String.fromCharCode(u&255))},r.ByteStringBuffer.prototype.putInt32=function(u){return this.putBytes(String.fromCharCode(u>>24&255)+String.fromCharCode(u>>16&255)+String.fromCharCode(u>>8&255)+String.fromCharCode(u&255))},r.ByteStringBuffer.prototype.putInt16Le=function(u){return this.putBytes(String.fromCharCode(u&255)+String.fromCharCode(u>>8&255))},r.ByteStringBuffer.prototype.putInt24Le=function(u){return this.putBytes(String.fromCharCode(u&255)+String.fromCharCode(u>>8&255)+String.fromCharCode(u>>16&255))},r.ByteStringBuffer.prototype.putInt32Le=function(u){return this.putBytes(String.fromCharCode(u&255)+String.fromCharCode(u>>8&255)+String.fromCharCode(u>>16&255)+String.fromCharCode(u>>24&255))},r.ByteStringBuffer.prototype.putInt=function(u,C){n(C);var x="";do C-=8,x+=String.fromCharCode(u>>C&255);while(C>0);return this.putBytes(x)},r.ByteStringBuffer.prototype.putSignedInt=function(u,C){return u<0&&(u+=2<<C-1),this.putInt(u,C)},r.ByteStringBuffer.prototype.putBuffer=function(u){return this.putBytes(u.getBytes())},r.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},r.ByteStringBuffer.prototype.getInt16=function(){var u=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,u},r.ByteStringBuffer.prototype.getInt24=function(){var u=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,u},r.ByteStringBuffer.prototype.getInt32=function(){var u=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,u},r.ByteStringBuffer.prototype.getInt16Le=function(){var u=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,u},r.ByteStringBuffer.prototype.getInt24Le=function(){var u=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,u},r.ByteStringBuffer.prototype.getInt32Le=function(){var u=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,u},r.ByteStringBuffer.prototype.getInt=function(u){n(u);var C=0;do C=(C<<8)+this.data.charCodeAt(this.read++),u-=8;while(u>0);return C}
215,r.ByteStringBuffer.prototype.getSignedInt=function(u){var C=this.getInt(u),x=2<<u-2;return C>=x&&(C-=x<<1),C},r.ByteStringBuffer.prototype.getBytes=function(u){var C;return u?(u=Math.min(this.length(),u),C=this.data.slice(this.read,this.read+u),this.read+=u):u===0?C="":(C=this.read===0?this.data:this.data.slice(this.read),this.clear()),C},r.ByteStringBuffer.prototype.bytes=function(u){return typeof u>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+u)},r.ByteStringBuffer.prototype.at=function(u){return this.data.charCodeAt(this.read+u)},r.ByteStringBuffer.prototype.setAt=function(u,C){return this.data=this.data.substr(0,this.read+u)+String.fromCharCode(C)+this.data.substr(this.read+u+1),this},r.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},r.ByteStringBuffer.prototype.copy=function(){var u=r.createBuffer(this.data);return u.read=this.read,u},r.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},r.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},r.ByteStringBuffer.prototype.truncate=function(u){var C=Math.max(0,this.length()-u);return this.data=this.data.substr(this.read,C),this.read=0,this},r.ByteStringBuffer.prototype.toHex=function(){for(var u="",C=this.read;C<this.data.length;++C){var x=this.data.charCodeAt(C);x<16&&(u+="0"),u+=x.toString(16)}return u},r.ByteStringBuffer.prototype.toString=function(){return r.decodeUtf8(this.bytes())};function i(u,C){C=C||{},this.read=C.readOffset||0,this.growSize=C.growSize||1024;var x=r.isArrayBuffer(u),I=r.isArrayBufferView(u);if(x||I){x?this.data=new DataView(u):this.data=new DataView(u.buffer,u.byteOffset,u.byteLength),this.write="writeOffset"in C?C.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,u!=null&&this.putBytes(u),"writeOffset"in C&&(this.write=C.writeOffset)}r.DataBuffer=i,r.DataBuffer.prototype.length=function(){return this.write-this.read},r.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},r.DataBuffer.prototype.accommodate=function(u,C){if(this.length()>=u)return this;C=Math.max(C||this.growSize,u);var x=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),I=new Uint8Array(this.length()+C);return I.set(x),this.data=new DataView(I.buffer),this},r.DataBuffer.prototype.putByte=function(u){return this.accommodate(1),this.data.setUint8(this.write++,u),this},r.DataBuffer.prototype.fillWithByte=function(u,C){this.accommodate(C);for(var x=0;x<C;++x)this.data.setUint8(u);return this},r.DataBuffer.prototype.putBytes=function(u,C){if(r.isArrayBufferView(u)){var x=new Uint8Array(u.buffer,u.byteOffset,u.byteLength),I=x.byteLength-x.byteOffset;this.accommodate(I);var N=new Uint8Array(this.data.buffer,this.write);return N.set(x),this.write+=I,this}if(r.isArrayBuffer(u)){var x=new Uint8Array(u);this.accommodate(x.byteLength);var N=new Uint8Array(this.data.buffer);return N.set(x,this.write),this.write+=x.byteLength,this}if(u instanceof r.DataBuffer||typeof u=="object"&&typeof u.read=="number"&&typeof u.write=="number"&&r.isArrayBufferView(u.data)){var x=new Uint8Array(u.data.byteLength,u.read,u.length());this.accommodate(x.byteLength);var N=new Uint8Array(u.data.byteLength,this.write);return N.set(x),this.write+=x.byteLength,this}if(u instanceof r.ByteStringBuffer&&(u=u.data,C="binary"),C=C||"binary",typeof u=="string"){var E;if(C==="hex")return this.accommodate(Math.ceil(u.length/2)),E=new Uint8Array(this.data.buffer,this.write),this.write+=r.binary.hex.decode(u,E,this.write),this;if(C==="base64")return this.accommodate(Math.ceil(u.length/4)*3),E=new Uint8Array(this.data.buffer,this.write),this.write+=r.binary.base64.decode(u,E,this.write),this;if(C==="utf8"&&(u=r.encodeUtf8(u),C="binary"),C==="binary"||C==="raw")return this.accommodate(u.length),E=new Uint8Array(this.data.buffer,this.write),this.write+=r.binary.raw.decode(E),this;if(C==="utf16")return this.accommodate(u.length*2),E=new Uint16Array(this.data.buffer,this.write),this.write+=r.text.utf16.encode(E),this;throw new Error("Invalid encoding: "+C)}throw Error("Invalid parameter: "+u)},r.DataBuffer.prototype.putBuffer=function(u){return this.putBytes(u),u.clear(),this},r.DataBuffer.prototype.putString=function(u){return this.putBytes(u,"utf16")},r.DataBuffer.prototype.putInt16=function(u){return this.accommodate(2),this.data.setInt16(this.write,u),this.write+=2,this},r.DataBuffer.prototype.putInt24=function(u){return this.accommodate(3),this.data.setInt16(this.write,u>>8&65535),this.data.setInt8(this.write,u>>16&255),this.write+=3,this},r.DataBuffer.prototype.putInt32=function(u){return this.accommodate(4),this.data.setInt32(this.write,u),this.write+=4,this},r.DataBuffer.prototype.putInt16Le=function(u){return this.accommodate(2),this.data.setInt16(this.write,u,!0),this.write+=2,this},r.DataBuffer.prototype.putInt24Le=function(u){return this.accommodate(3),this.data.setInt8(this.write,u>>16&255),this.data.setInt16(this.write,u>>8&65535,!0),this.write+=3,this},r.DataBuffer.prototype.putInt32Le=function(u){return this.accommodate(4),this.data.setInt32(this.write,u,!0),this.write+=4,this},r.DataBuffer.prototype.putInt=function(u,C){n(C),this.accommodate(C/8);do C-=8,this.data.setInt8(this.write++,u>>
215C&255);while(C>0);return this},r.DataBuffer.prototype.putSignedInt=function(u,C){return n(C),this.accommodate(C/8),u<0&&(u+=2<<C-1),this.putInt(u,C)},r.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},r.DataBuffer.prototype.getInt16=function(){var u=this.data.getInt16(this.read);return this.read+=2,u},r.DataBuffer.prototype.getInt24=function(){var u=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,u},r.DataBuffer.prototype.getInt32=function(){var u=this.data.getInt32(this.read);return this.read+=4,u},r.DataBuffer.prototype.getInt16Le=function(){var u=this.data.getInt16(this.read,!0);return this.read+=2,u},r.DataBuffer.prototype.getInt24Le=function(){var u=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,u},r.DataBuffer.prototype.getInt32Le=function(){var u=this.data.getInt32(this.read,!0);return this.read+=4,u},r.DataBuffer.prototype.getInt=function(u){n(u);var C=0;do C=(C<<8)+this.data.getInt8(this.read++),u-=8;while(u>0);return C},r.DataBuffer.prototype.getSignedInt=function(u){var C=this.getInt(u),x=2<<u-2;return C>=x&&(C-=x<<1),C},r.DataBuffer.prototype.getBytes=function(u){var C;return u?(u=Math.min(this.length(),u),C=this.data.slice(this.read,this.read+u),this.read+=u):u===0?C="":(C=this.read===0?this.data:this.data.slice(this.read),this.clear()),C},r.DataBuffer.prototype.bytes=function(u){return typeof u>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+u)},r.DataBuffer.prototype.at=function(u){return this.data.getUint8(this.read+u)},r.DataBuffer.prototype.setAt=function(u,C){return this.data.setUint8(u,C),this},r.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},r.DataBuffer.prototype.copy=function(){return new r.DataBuffer(this)},r.DataBuffer.prototype.compact=function(){if(this.read>0){var u=new Uint8Array(this.data.buffer,this.read),C=new Uint8Array(u.byteLength);C.set(u),this.data=new DataView(C),this.write-=this.read,this.read=0}return this},r.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},r.DataBuffer.prototype.truncate=function(u){return this.write=Math.max(0,this.length()-u),this.read=Math.min(this.read,this.write),this},r.DataBuffer.prototype.toHex=function(){for(var u="",C=this.read;C<this.data.byteLength;++C){var x=this.data.getUint8(C);x<16&&(u+="0"),u+=x.toString(16)}return u},r.DataBuffer.prototype.toString=function(u){var C=new Uint8Array(this.data,this.read,this.length());if(u=u||"utf8",u==="binary"||u==="raw")return r.binary.raw.encode(C);if(u==="hex")return r.binary.hex.encode(C);if(u==="base64")return r.binary.base64.encode(C);if(u==="utf8")return r.text.utf8.decode(C);if(u==="utf16")return r.text.utf16.decode(C);throw new Error("Invalid encoding: "+u)},r.createBuffer=function(u,C){return C=C||"raw",u!==void 0&&C==="utf8"&&(u=r.encodeUtf8(u)),new r.ByteBuffer(u)},r.fillString=function(u,C){for(var x="";C>0;)C&1&&(x+=u),C>>>=1,C>0&&(u+=u);return x},r.xorBytes=function(u,C,x){for(var I="",N="",E="",g=0,p=0;x>0;--x,++g)N=u.charCodeAt(g)^C.charCodeAt(g),p>=10&&(I+=E,E="",p=0),E+=String.fromCharCode(N),++p;return I+=E,I},r.hexToBytes=function(u){var C="",x=0;for(u.length&!0&&(x=1,C+=String.fromCharCode(parseInt(u[0],16)));x<u.length;x+=2)C+=String.fromCharCode(parseInt(u.substr(x,2),16));return C},r.bytesToHex=function(u){return r.createBuffer(u).toHex()},r.int32ToBytes=function(u){return String.fromCharCode(u>>24&255)+String.fromCharCode(u>>16&255)+String.fromCharCode(u>>8&255)+String.fromCharCode(u&255)};var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";r.encode64=function(u,C){for(var x="",I="",N,E,g,p=0;p<u.length;)N=u.charCodeAt(p++),E=u.charCodeAt(p++),g=u.charCodeAt(p++),x+=a.charAt(N>>2),x+=a.charAt((N&3)<<4|E>>4),isNaN(E)?x+="==":(x+=a.charAt((E&15)<<2|g>>6),x+=isNaN(g)?"=":a.charAt(g&63)),C&&x.length>C&&(I+=x.substr(0,C)+`\r 216`,x=x.substr(C));return I+=x,I},r.decode64=function(u){u=u.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var C="",x,I,N,E,g=0;g<u.length;)x=c[u.charCodeAt(g++)-43],I=c[u.charCodeAt(g++)-43],N=c[u.charCodeAt(g++)-43],E=c[u.charCodeAt(g++)-43],C+=String.fromCharCode(x<<2|I>>4),N!==64&&(C+=String.fromCharCode((I&15)<<4|N>>2),E!==64&&(C+=String.fromCharCode((N&3)<<6|E)));return C},r.encodeUtf8=function(u){return unescape(encodeURIComponent(u))},r.decodeUtf8=function(u){return decodeURIComponent(escape(u))},r.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:t.encode,decode:t.decode}},r.binary.raw.encode=function(u){return String.fromCharCode.apply(null,u)},r.binary.raw.decode=function(u,C,x){var I=C;I||(I=new Uint8Array(u.length)),x=x||0;for(var N=x,E=0;E<u.length;++E)I[N++]=u.charCodeAt(E);return C?N-x:I},r.binary.hex.encode=r.bytesToHex,r.binary.hex.decode=function(u,C,x){var I=C;I||(I=new Uint8Array(Math.ceil(u.length/2))),x=x||0;var N=0,E=x;for(u.length&1&&(N=1,I[E++]=parseInt(u[0],16));N<u.length;N+=2)I[E++]=parseInt(u.substr(N,2),16);return C?E-x:I},r.binary.base64.encode=function(u,C){for(var x="",I="",N,E,g,p=0;p<u.byteLength;)N=u[p++],E=u[p++],g=u[p++],x+=a.charAt(N>>2),x+=a.charAt((N&3)<<4|E>>4),isNaN(E)?x+="==":(x+=a.charAt((E&15)<<2|g>>6),x+=isNaN(g)?"=":a.charAt(g&63)),C&&x.length>C&&(I+=x.substr(0,C)+`\r 217`,x=x.substr(C));return I+=x,I},r.binary.base64.decode=function(u,C,x){var I=C;I||(I=new Uint8Array(Math.ceil(u.length/4)*3)),u=u.replace(/[^A-Za-z0-9\+\/\=]/g,""),x=x||0;for(var N,E,g,p,T=0,R=x;T<u.length;)N=c[u.charCodeAt(T++)-43],E=c[u.charCodeAt(T++)-43],g=c[u.charCodeAt(T++)-43],p=c[u.charCodeAt(T++)-43],I[R++]=N<<2|E>>4,g!==64&&(I[R++]=(E&15)<<4|g>>2,p!==64&&(I[R++]=(g&3)<<6|p));return C?R-x:I.subarray(0,R)},r.binary.base58.encode=function(u,C){return r.binary.baseN.encode(u,l,C)},r.binary.base58.decode=function(u,C){return r.binary.baseN.decode(u,l,C)},r.text={utf8:{},utf16:{}},r.text.utf8.encode=function(u,C,x){u=r.encodeUtf8(u);var I=C;I||(I=new Uint8Array(u.length)),x=x||0;for(var N=x,E=0;E<u.length;++E)I[N++]=u.charCodeAt(E);return C?N-x:I},r.text.utf8.decode=function(u){return r.decodeUtf8(String.fromCharCode.apply(null,u))},r.text.utf16.encode=function(u,C,x){var I=C;I||(I=new Uint8Array(u.length*2));var N=new Uint16Array(I.buffer);x=x||0;for(var E=x,g=x,p=0;p<u.length;++p)N[g++]=u.charCodeAt(p),E+=2;return C?E-x:I},r.text.utf16.decode=function(u){return String.fromCharCode.apply(null,new Uint16Array(u.buffer))},r.deflate=function(u,C,x){if(C=r.decode64(u.deflate(r.encode64(C)).rval),x){var I=2,N=C.charCodeAt(1);N&32&&(I=6),C=C.substring(I,C.length-4)}return C},r.inflate=function(u,C,x){var I=u.inflate(r.encode64(C)).rval;return I===null?null:r.decode64(I)};var f=function(u,C,x){if(!u)throw new Error("WebStorage not available.");var I;if(x===null?I=u.removeItem(C):(x=r.encode64(JSON.stringify(x)),I=u.setItem(C,x)),typeof I<"u"&&I.rval!==!0){var N=new Error(I.error.message);
217throw N.id=I.error.id,N.name=I.error.name,N}},y=function(u,C){if(!u)throw new Error("WebStorage not available.");var x=u.getItem(C);if(u.init)if(x.rval===null){if(x.error){var I=new Error(x.error.message);throw I.id=x.error.id,I.name=x.error.name,I}x=null}else x=x.rval;return x!==null&&(x=JSON.parse(r.decode64(x))),x},m=function(u,C,x,I){var N=y(u,C);N===null&&(N={}),N[x]=I,f(u,C,N)},d=function(u,C,x){var I=y(u,C);return I!==null&&(I=x in I?I[x]:null),I},v=function(u,C,x){var I=y(u,C);if(I!==null&&x in I){delete I[x];var N=!0;for(var E in I){N=!1;break}N&&(I=null),f(u,C,I)}},b=function(u,C){f(u,C,null)},S=function(u,C,x){var I=null;typeof x>"u"&&(x=["web","flash"]);var N,E=!1,g=null;for(var p in x){N=x[p];try{if(N==="flash"||N==="both"){if(C[0]===null)throw new Error("Flash local storage not available.");I=u.apply(this,C),E=N==="flash"}(N==="web"||N==="both")&&(C[0]=localStorage,I=u.apply(this,C),E=!0)}catch(T){g=T}if(E)break}if(!E)throw g;return I};return r.setItem=function(u,C,x,I,N){S(m,arguments,N)},r.getItem=function(u,C,x,I){return S(d,arguments,I)},r.removeItem=function(u,C,x,I){S(v,arguments,I)},r.clearItems=function(u,C,x){S(b,arguments,x)},r.isEmpty=function(u){for(var C in u)if(u.hasOwnProperty(C))return!1;return!0},r.format=function(u){for(var C=/%./g,x,I,N=0,E=[],g=0;x=C.exec(u);){I=u.substring(g,C.lastIndex-2),I.length>0&&E.push(I),g=C.lastIndex;var p=x[0][1];switch(p){case"s":case"o":N<arguments.length?E.push(arguments[N+++1]):E.push("<?>");break;case"%":E.push("%");break;default:E.push("<%"+p+"?>")}}return E.push(u.substring(g)),E.join("")},r.formatNumber=function(u,C,x,I){var N=u,E=isNaN(C=Math.abs(C))?2:C,g=x===void 0?",":x,p=I===void 0?".":I,T=N<0?"-":"",R=parseInt(N=Math.abs(+N||0).toFixed(E),10)+"",B=R.length>3?R.length%3:0;return T+(B?R.substr(0,B)+p:"")+R.substr(B).replace(/(\d{3})(?=\d)/g,"$1"+p)+(E?g+Math.abs(N-R).toFixed(E).slice(2):"")},r.formatSize=function(u){return u>=1073741824?u=r.formatNumber(u/1073741824,2,".","")+" GiB":u>=1048576?u=r.formatNumber(u/1048576,2,".","")+" MiB":u>=1024?u=r.formatNumber(u/1024,0)+" KiB":u=r.formatNumber(u,0)+" bytes",u},r.bytesFromIP=function(u){return u.indexOf(".")!==-1?r.bytesFromIPv4(u):u.indexOf(":")!==-1?r.bytesFromIPv6(u):null},r.bytesFromIPv4=function(u){if(u=u.split("."),u.length!==4)return null;for(var C=r.createBuffer(),x=0;x<u.length;++x){var I=parseInt(u[x],10);if(isNaN(I))return null;C.putByte(I)}return C.getBytes()},r.bytesFromIPv6=function(u){var C=0;u=u.split(":").filter(function(g){return g.length===0&&++C,!0});for(var x=(8-u.length+C)*2,I=r.createBuffer(),N=0;N<8;++N){if(!u[N]||u[N].length===0){I.fillWithByte(0,x),x=0;continue}var E=r.hexToBytes(u[N]);E.length<2&&I.putByte(0),I.putBytes(E)}return I.getBytes()},r.bytesToIP=function(u){return u.length===4?r.bytesToIPv4(u):u.length===16?r.bytesToIPv6(u):null},r.bytesToIPv4=function(u){if(u.length!==4)return null;for(var C=[],x=0;x<u.length;++x)C.push(u.charCodeAt(x));return C.join(".")},r.bytesToIPv6=function(u){if(u.length!==16)return null;for(var C=[],x=[],I=0,N=0;N<u.length;N+=2){for(var E=r.bytesToHex(u[N]+u[N+1]);E[0]==="0"&&E!=="0";)E=E.substr(1);if(E==="0"){var g=x[x.length-1],p=C.length;!g||p!==g.end+1?x.push({start:p,end:p}):(g.end=p,g.end-g.start>x[I].end-x[I].start&&(I=x.length-1))}C.push(E)}if(x.length>0){var T=x[I];T.end-T.start>0&&(C.splice(T.start,T.end-T.start+1,""),T.start===0&&C.unshift(""),T.end===7&&C.push(""))}return C.join(":")},r.estimateCores=function(u,C){if(typeof u=="function"&&(C=u,u={}),u=u||{},"cores"in r&&!u.update)return C(null,r.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return r.cores=navigator.hardwareConcurrency,C(null,r.cores);if(typeof Worker>"u")return r.cores=1,C(null,r.cores);if(typeof Blob>"u")return r.cores=2,C(null,r.cores);var x=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(g){var p=Date.now(),T=p+4;self.postMessage({st:p,et:T})})}).toString(),")()"],{type:"application/javascript"}));I([],5,16);function I(g,p,T){if(p===0){var R=Math.floor(g.reduce(function(B,P){return B+P},0)/g.length);return r.cores=Math.max(1,R),URL.revokeObjectURL(x),C(null,r.cores)}N(T,function(B,P){g.push(E(T,P)),I(g,p-1,T)})}function N(g,p){for(var T=[],R=[],B=0;B<g;++B){var P=new Worker(x);P.addEventListener("message",function(D){if(R.push(D.data),R.length===g){for(var U=0;U<g;++U)T[U].terminate();p(null,R)}}),T.push(P)}for(var B=0;B<g;++B)T[B].postMessage(B)}function E(g,p){for(var T=[],R=0;R<g;++R)for(var B=p[R],P=T[R]=[],D=0;D<g;++D)if(R!==D){var U=p[D];(B.st>U.st&&B.st<U.et||U.st>
217B.st&&U.st<B.et)&&P.push(D)}return T.reduce(function(_,V){return Math.max(_,V.length)},0)}},Di.exports}var Oi,kd;function xc(){if(kd)return Oi;kd=1;var e=nt();pt(),Oi=e.cipher=e.cipher||{},e.cipher.algorithms=e.cipher.algorithms||{},e.cipher.createCipher=function(r,n){var o=r;if(typeof o=="string"&&(o=e.cipher.getAlgorithm(o),o&&(o=o())),!o)throw new Error("Unsupported algorithm: "+r);return new e.cipher.BlockCipher({algorithm:o,key:n,decrypt:!1})},e.cipher.createDecipher=function(r,n){var o=r;if(typeof o=="string"&&(o=e.cipher.getAlgorithm(o),o&&(o=o())),!o)throw new Error("Unsupported algorithm: "+r);return new e.cipher.BlockCipher({algorithm:o,key:n,decrypt:!0})},e.cipher.registerAlgorithm=function(r,n){r=r.toUpperCase(),e.cipher.algorithms[r]=n},e.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in e.cipher.algorithms?e.cipher.algorithms[r]:null};var t=e.cipher.BlockCipher=function(r){this.algorithm=r.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=r.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=r.decrypt,this.algorithm.initialize(r)};return t.prototype.start=function(r){r=r||{};var n={};for(var o in r)n[o]=r[o];n.decrypt=this._decrypt,this._finish=!1,this._input=e.util.createBuffer(),this.output=r.output||e.util.createBuffer(),this.mode.start(n)},t.prototype.update=function(r){for(r&&this._input.putBuffer(r);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},t.prototype.finish=function(r){r&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(o){return r(this.blockSize,o,!1)},this.mode.unpad=function(o){return r(this.blockSize,o,!0)});var n={};return n.decrypt=this._decrypt,n.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,n)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,n))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,n))},Oi}var _i={exports:{}},Vd;function Lh(){if(Vd)return _i.exports;Vd=1;var e=nt();pt(),e.cipher=e.cipher||{};var t=_i.exports=e.cipher.modes=e.cipher.modes||{};t.ecb=function(s){s=s||{},this.name="ECB",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(s){},t.ecb.prototype.encrypt=function(s,i,a){if(s.length()<this.blockSize&&!(a&&s.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=s.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)i.putInt32(this._outBlock[c])},t.ecb.prototype.decrypt=function(s,i,a){if(s.length()<this.blockSize&&!(a&&s.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=s.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)i.putInt32(this._outBlock[c])},t.ecb.prototype.pad=function(s,i){var a=s.length()===this.blockSize?this.blockSize:this.blockSize-s.length();return s.fillWithByte(a,a),!0},t.ecb.prototype.unpad=function(s,i){if(i.overflow>0)return!1;var a=s.length(),c=s.at(a-1);return c>this.blockSize<<2?!1:(s.truncate(c),!0)},t.cbc=function(s){s=s||{},this.name="CBC",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(s){if(s.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in s)this._iv=r(s.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},t.cbc.prototype.encrypt=function(s,i,a){if(s.length()<this.blockSize&&!(a&&s.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=this._prev[c]^s.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)i.putInt32(this._outBlock[c]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(s,i,a){if(s.length()<this.blockSize&&!(a&&s.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=s.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)i.putInt32(this._prev[c]^this._outBlock[c]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(s,i){var a=s.length()===this.blockSize?this.blockSize:this.blockSize-s.length();return s.fillWithByte(a,a),!0}
217,t.cbc.prototype.unpad=function(s,i){if(i.overflow>0)return!1;var a=s.length(),c=s.at(a-1);return c>this.blockSize<<2?!1:(s.truncate(c),!0)},t.cfb=function(s){s=s||{},this.name="CFB",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(s){if(!("iv"in s))throw new Error("Invalid IV parameter.");this._iv=r(s.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(s,i,a){var c=s.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)this._inBlock[l]=s.getInt32()^this._outBlock[l],i.putInt32(this._inBlock[l]);return}var f=(this.blockSize-c)%this.blockSize;f>0&&(f=this.blockSize-f),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialBlock[l]=s.getInt32()^this._outBlock[l],this._partialOutput.putInt32(this._partialBlock[l]);if(f>0)s.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._partialBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),f>0&&!a)return i.putBytes(this._partialOutput.getBytes(f-this._partialBytes)),this._partialBytes=f,!0;i.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},t.cfb.prototype.decrypt=function(s,i,a){var c=s.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)this._inBlock[l]=s.getInt32(),i.putInt32(this._inBlock[l]^this._outBlock[l]);return}var f=(this.blockSize-c)%this.blockSize;f>0&&(f=this.blockSize-f),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialBlock[l]=s.getInt32(),this._partialOutput.putInt32(this._partialBlock[l]^this._outBlock[l]);if(f>0)s.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._partialBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),f>0&&!a)return i.putBytes(this._partialOutput.getBytes(f-this._partialBytes)),this._partialBytes=f,!0;i.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},t.ofb=function(s){s=s||{},this.name="OFB",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(s){if(!("iv"in s))throw new Error("Invalid IV parameter.");this._iv=r(s.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(s,i,a){var c=s.length();if(s.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)i.putInt32(s.getInt32()^this._outBlock[l]),this._inBlock[l]=this._outBlock[l];return}var f=(this.blockSize-c)%this.blockSize;f>0&&(f=this.blockSize-f),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(s.getInt32()^this._outBlock[l]);if(f>0)s.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._outBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),f>0&&!a)return i.putBytes(this._partialOutput.getBytes(f-this._partialBytes)),this._partialBytes=f,!0;i.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(s){s=s||{},this.name="CTR",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(s){if(!("iv"in s))throw new Error("Invalid IV parameter.");this._iv=r(s.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(s,i,a){var c=s.length();if(c===0)return!0;
217if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize)for(var l=0;l<this._ints;++l)i.putInt32(s.getInt32()^this._outBlock[l]);else{var f=(this.blockSize-c)%this.blockSize;f>0&&(f=this.blockSize-f),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(s.getInt32()^this._outBlock[l]);if(f>0&&(s.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),f>0&&!a)return i.putBytes(this._partialOutput.getBytes(f-this._partialBytes)),this._partialBytes=f,!0;i.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0}n(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(s){s=s||{},this.name="GCM",this.cipher=s.cipher,this.blockSize=s.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(s){if(!("iv"in s))throw new Error("Invalid IV parameter.");var i=e.util.createBuffer(s.iv);this._cipherLength=0;var a;if("additionalData"in s?a=e.util.createBuffer(s.additionalData):a=e.util.createBuffer(),"tagLength"in s?this._tagLength=s.tagLength:this._tagLength=128,this._tag=null,s.decrypt&&(this._tag=e.util.createBuffer(s.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var c=i.length();if(c===12)this._j0=[i.getInt32(),i.getInt32(),i.getInt32(),1];else{for(this._j0=[0,0,0,0];i.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[i.getInt32(),i.getInt32(),i.getInt32(),i.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(c*8)))}this._inBlock=this._j0.slice(0),n(this._inBlock),this._partialBytes=0,a=e.util.createBuffer(a),this._aDataLength=o(a.length()*8);var l=a.length()%this.blockSize;for(l&&a.fillWithByte(0,this.blockSize-l),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])},t.gcm.prototype.encrypt=function(s,i,a){var c=s.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)i.putInt32(this._outBlock[l]^=s.getInt32());this._cipherLength+=this.blockSize}else{var f=(this.blockSize-c)%this.blockSize;f>0&&(f=this.blockSize-f),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(s.getInt32()^this._outBlock[l]);if(f<=0||a){if(a){var y=c%this.blockSize;this._cipherLength+=y,this._partialOutput.truncate(this.blockSize-y)}else this._cipherLength+=this.blockSize;for(var l=0;l<this._ints;++l)this._outBlock[l]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),f>0&&!a)return s.read-=this.blockSize,i.putBytes(this._partialOutput.getBytes(f-this._partialBytes)),this._partialBytes=f,!0;i.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),n(this._inBlock)},t.gcm.prototype.decrypt=function(s,i,a){var c=s.length();if(c<this.blockSize&&!(a&&c>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),n(this._inBlock),this._hashBlock[0]=s.getInt32(),this._hashBlock[1]=s.getInt32(),this._hashBlock[2]=s.getInt32(),this._hashBlock[3]=s.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var l=0;l<this._ints;++l)i.putInt32(this._outBlock[l]^this._hashBlock[l]);c<this.blockSize?this._cipherLength+=c%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(s,i){var a=!0;i.decrypt&&i.overflow&&s.truncate(this.blockSize-i.overflow),this.tag=e.util.createBuffer();var c=this._aDataLength.concat(o(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,c);var l=[];this.cipher.encrypt(this._j0,l);for(var f=0;f<this._ints;++f)this.tag.putInt32(this._s[f]^l[f]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),i.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a},t.gcm.prototype.multiply=function(s,i){for(var a=[0,0,0,0],c=i.slice(0),l=0;l<128;++l){var f=s[l/32|0]&1<<31-l%32;f&&(a[0]^=c[0],a[1]^=c[1],a[2]^=c[2],a[3]^=c[3]),this.pow(c,c)}return a},t.gcm.prototype.pow=function(s,i){for(var a=s[3]&1,c=3;c>0;--c)i[c]=s[c]>>>1|(s[c-1]&1)<<31;i[0]=s[0]>>>1,a&&(i[0]^=this._R)},t.gcm.prototype.tableMultiply=function(s){for(var i=[0,0,0,0],a=0;a<32;++a){var c=a/8|0,l=s[c]>>>(7-a%8)*4&15,f=this._m[a][l];i[0]^=f[0],i[1]^=f[1],i[2]^=f[2],i[3]^=f[3]}return i},t.gcm.prototype.ghash=function(s,i,a){return i[0]^=a[0],i[1]^=a[1],i[2]^=a[2],i[3]^=a[3],this.tableMultiply(i)},t.gcm.prototype.generateHashTable=function(s,i){for(var a=8/i,c=4*a,l=16*a,f=new Array(l),y=0;y<l;++y){var m=[0,0,0,0],d=y/c|0,v=(c-1-y%c)*i;m[d]=1<<i-1<<v,f[y]=this.generateSubHashTable(this.multiply(m,s),i)}return f},t.gcm.prototype.generateSubHashTable=function(s,i){var a=1<<i,c=a>>>1,l=new Array(a);l[c]=s.slice(0);for(var f=c>>>1;f>0;)this.pow(l[2*f],l[f]=[]),f>>=1;for(f=2;f<c;){for(var y=1;y<f;++y){var m=l[f],d=l[y];l[f+y]=[m[0]^d[0],m[1]^d[1],m[2]^d[2],m[3]^d[3]]}f*=2}for(l[0]=[0,0,0,0],f=c+1;f<a;++f){var v=l[f^c];l[f]=[s[0]^v[0],s[1]^v[1],s[2]^v[2],s[3]^v[3]]}return l};function r(s,i){if(typeof s=="string"&&(s=e.util.createBuffer(s)),e.util.isArray(s)&&s.length>4){var a=s;s=e.util.createBuffer();for(var c=0;c<a.length;++c)s.putByte(a[c])}if(s.length()<i)throw new Error("Invalid IV length;
217 got "+s.length()+" bytes and expected "+i+" bytes.");if(!e.util.isArray(s)){for(var l=[],f=i/4,c=0;c<f;++c)l.push(s.getInt32());s=l}return s}function n(s){s[s.length-1]=s[s.length-1]+1&4294967295}function o(s){return[s/4294967296|0,s&4294967295]}return _i.exports}var ki,Fd;function ln(){if(Fd)return ki;Fd=1;var e=nt();xc(),Lh(),pt(),ki=e.aes=e.aes||{},e.aes.startEncrypting=function(d,v,b,S){var u=m({key:d,output:b,decrypt:!1,mode:S});return u.start(v),u},e.aes.createEncryptionCipher=function(d,v){return m({key:d,output:null,decrypt:!1,mode:v})},e.aes.startDecrypting=function(d,v,b,S){var u=m({key:d,output:b,decrypt:!0,mode:S});return u.start(v),u},e.aes.createDecryptionCipher=function(d,v){return m({key:d,output:null,decrypt:!0,mode:v})},e.aes.Algorithm=function(d,v){r||l();var b=this;b.name=d,b.mode=new v({blockSize:16,cipher:{encrypt:function(S,u){return y(b._w,S,u,!1)},decrypt:function(S,u){return y(b._w,S,u,!0)}}}),b._init=!1},e.aes.Algorithm.prototype.initialize=function(d){if(!this._init){var v=d.key,b;if(typeof v=="string"&&(v.length===16||v.length===24||v.length===32))v=e.util.createBuffer(v);else if(e.util.isArray(v)&&(v.length===16||v.length===24||v.length===32)){b=v,v=e.util.createBuffer();for(var S=0;S<b.length;++S)v.putByte(b[S])}if(!e.util.isArray(v)){b=v,v=[];var u=b.length();if(u===16||u===24||u===32){u=u>>>2;for(var S=0;S<u;++S)v.push(b.getInt32())}}if(!e.util.isArray(v)||!(v.length===4||v.length===6||v.length===8))throw new Error("Invalid key parameter.");var C=this.mode.name,x=["CFB","OFB","CTR","GCM"].indexOf(C)!==-1;this._w=f(v,d.decrypt&&!x),this._init=!0}},e.aes._expandKey=function(d,v){return r||l(),f(d,v)},e.aes._updateBlock=y,t("AES-ECB",e.cipher.modes.ecb),t("AES-CBC",e.cipher.modes.cbc),t("AES-CFB",e.cipher.modes.cfb),t("AES-OFB",e.cipher.modes.ofb),t("AES-CTR",e.cipher.modes.ctr),t("AES-GCM",e.cipher.modes.gcm);function t(d,v){var b=function(){return new e.aes.Algorithm(d,v)};e.cipher.registerAlgorithm(d,b)}var r=!1,n=4,o,s,i,a,c;function l(){r=!0,i=[0,1,2,4,8,16,32,64,128,27,54];for(var d=new Array(256),v=0;v<128;++v)d[v]=v<<1,d[v+128]=v+128<<1^283;o=new Array(256),s=new Array(256),a=new Array(4),c=new Array(4);for(var v=0;v<4;++v)a[v]=new Array(256),c[v]=new Array(256);for(var b=0,S=0,u,C,x,I,N,E,g,v=0;v<256;++v){I=S^S<<1^S<<2^S<<3^S<<4,I=I>>8^I&255^99,o[b]=I,s[I]=b,N=d[I],u=d[b],C=d[u],x=d[C],E=N<<24^I<<16^I<<8^(I^N),g=(u^C^x)<<24^(b^x)<<16^(b^C^x)<<8^(b^u^x);for(var p=0;p<4;++p)a[p][b]=E,c[p][I]=g,E=E<<24|E>>>8,g=g<<24|g>>>8;b===0?b=S=1:(b=u^d[d[d[u^x]]],S^=d[d[S]])}}function f(d,v){for(var b=d.slice(0),S,u=1,C=b.length,x=C+6+1,I=n*x,N=C;N<I;++N)S=b[N-1],N%C===0?(S=o[S>>>16&255]<<24^o[S>>>8&255]<<16^o[S&255]<<8^o[S>>>24]^i[u]<<24,u++):C>6&&N%C===4&&(S=o[S>>>24]<<24^o[S>>>16&255]<<16^o[S>>>8&255]<<8^o[S&255]),b[N]=b[N-C]^S;if(v){var E,g=c[0],p=c[1],T=c[2],R=c[3],B=b.slice(0);I=b.length;for(var N=0,P=I-n;N<I;N+=n,P-=n)if(N===0||N===I-n)B[N]=b[P],B[N+1]=b[P+3],B[N+2]=b[P+2],B[N+3]=b[P+1];else for(var D=0;D<n;++D)E=b[P+D],B[N+(3&-D)]=g[o[E>>>24]]^p[o[E>>>16&255]]^T[o[E>>>8&255]]^R[o[E&255]];b=B}return b}function y(d,v,b,S){var u=d.length/4-1,C,x,I,N,E;S?(C=c[0],x=c[1],I=c[2],N=c[3],E=s):(C=a[0],x=a[1],I=a[2],N=a[3],E=o);var g,p,T,R,B,P,D;g=v[0]^d[0],p=v[S?3:1]^d[1],T=v[2]^d[2],R=v[S?1:3]^d[3];for(var U=3,_=1;_<u;++_)B=C[g>>>24]^x[p>>>16&255]^I[T>>>8&255]^N[R&255]^d[++U],P=C[p>>>24]^x[T>>>16&255]^I[R>>>8&255]^N[g&255]^d[++U],D=C[T>>>24]^x[R>>>16&255]^I[g>>>8&255]^N[p&255]^d[++U],R=C[R>>>24]^x[g>>>16&255]^I[p>>>8&255]^N[T&255]^d[++U],g=B,p=P,T=D;b[0]=E[g>>>24]<<24^E[p>>>16&255]<<16^E[T>>>8&255]<<8^E[R&255]^d[++U],b[S?3:1]=E[p>>>24]<<24^E[T>>>16&255]<<16^E[R>>>8&255]<<8^E[g&255]^d[++U],b[2]=E[T>>>24]<<24^E[R>>>16&255]<<16^E[g>>>8&255]<<8^E[p&255]^d[++U],b[S?1:3]=E[R>>>24]<<24^E[g>>>16&255]<<16^E[p>>>8&255]<<8^E[T&255]^d[++U]}function m(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),b="AES-"+v,S;d.decrypt?S=e.cipher.createDecipher(b,d.key):S=e.cipher.createCipher(b,d.key);var u=S.start;return S.start=function(C,x){var I=null;x instanceof e.util.ByteBuffer&&(I=x,x={}),x=x||{},x.output=I,x.iv=C,u.call(S,x)},S}return ki}var Vi={exports:{}},Fi={exports:{}},Ui={exports:{}},Ud;function cn(){if(Ud)return Ui.exports;Ud=1;var e=nt();e.pki=e.pki||{};var t=Ui.exports=e.pki.oids=e.oids=e.oids||{};function r(o,s){t[o]=s,t[s]=o}function n(o,s){t[o]=s}
217return r("1.2.840.113549.1.1.1","rsaEncryption"),r("1.2.840.113549.1.1.4","md5WithRSAEncryption"),r("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),r("1.2.840.113549.1.1.7","RSAES-OAEP"),r("1.2.840.113549.1.1.8","mgf1"),r("1.2.840.113549.1.1.9","pSpecified"),r("1.2.840.113549.1.1.10","RSASSA-PSS"),r("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),r("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),r("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),r("1.3.101.112","EdDSA25519"),r("1.2.840.10040.4.3","dsa-with-sha1"),r("1.3.14.3.2.7","desCBC"),r("1.3.14.3.2.26","sha1"),r("1.3.14.3.2.29","sha1WithRSASignature"),r("2.16.840.1.101.3.4.2.1","sha256"),r("2.16.840.1.101.3.4.2.2","sha384"),r("2.16.840.1.101.3.4.2.3","sha512"),r("2.16.840.1.101.3.4.2.4","sha224"),r("2.16.840.1.101.3.4.2.5","sha512-224"),r("2.16.840.1.101.3.4.2.6","sha512-256"),r("1.2.840.113549.2.2","md2"),r("1.2.840.113549.2.5","md5"),r("1.2.840.113549.1.7.1","data"),r("1.2.840.113549.1.7.2","signedData"),r("1.2.840.113549.1.7.3","envelopedData"),r("1.2.840.113549.1.7.4","signedAndEnvelopedData"),r("1.2.840.113549.1.7.5","digestedData"),r("1.2.840.113549.1.7.6","encryptedData"),r("1.2.840.113549.1.9.1","emailAddress"),r("1.2.840.113549.1.9.2","unstructuredName"),r("1.2.840.113549.1.9.3","contentType"),r("1.2.840.113549.1.9.4","messageDigest"),r("1.2.840.113549.1.9.5","signingTime"),r("1.2.840.113549.1.9.6","counterSignature"),r("1.2.840.113549.1.9.7","challengePassword"),r("1.2.840.113549.1.9.8","unstructuredAddress"),r("1.2.840.113549.1.9.14","extensionRequest"),r("1.2.840.113549.1.9.20","friendlyName"),r("1.2.840.113549.1.9.21","localKeyId"),r("1.2.840.113549.1.9.22.1","x509Certificate"),r("1.2.840.113549.1.12.10.1.1","keyBag"),r("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),r("1.2.840.113549.1.12.10.1.3","certBag"),r("1.2.840.113549.1.12.10.1.4","crlBag"),r("1.2.840.113549.1.12.10.1.5","secretBag"),r("1.2.840.113549.1.12.10.1.6","safeContentsBag"),r("1.2.840.113549.1.5.13","pkcs5PBES2"),r("1.2.840.113549.1.5.12","pkcs5PBKDF2"),r("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),r("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),r("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),r("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),r("1.2.840.113549.2.7","hmacWithSHA1"),r("1.2.840.113549.2.8","hmacWithSHA224"),r("1.2.840.113549.2.9","hmacWithSHA256"),r("1.2.840.113549.2.10","hmacWithSHA384"),r("1.2.840.113549.2.11","hmacWithSHA512"),r("1.2.840.113549.3.7","des-EDE3-CBC"),r("2.16.840.1.101.3.4.1.2","aes128-CBC"),r("2.16.840.1.101.3.4.1.22","aes192-CBC"),r("2.16.840.1.101.3.4.1.42","ae
217s256-CBC"),r("2.5.4.3","commonName"),r("2.5.4.4","surname"),r("2.5.4.5","serialNumber"),r("2.5.4.6","countryName"),r("2.5.4.7","localityName"),r("2.5.4.8","stateOrProvinceName"),r("2.5.4.9","streetAddress"),r("2.5.4.10","organizationName"),r("2.5.4.11","organizationalUnitName"),r("2.5.4.12","title"),r("2.5.4.13","description"),r("2.5.4.15","businessCategory"),r("2.5.4.17","postalCode"),r("2.5.4.42","givenName"),r("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),r("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),r("2.16.840.1.113730.1.1","nsCertType"),r("2.16.840.1.113730.1.13","nsComment"),n("2.5.29.1","authorityKeyIdentifier"),n("2.5.29.2","keyAttributes"),n("2.5.29.3","certificatePolicies"),n("2.5.29.4","keyUsageRestriction"),n("2.5.29.5","policyMapping"),n("2.5.29.6","subtreesConstraint"),n("2.5.29.7","subjectAltName"),n("2.5.29.8","issuerAltName"),n("2.5.29.9","subjectDirectoryAttributes"),n("2.5.29.10","basicConstraints"),n("2.5.29.11","nameConstraints"),n("2.5.29.12","policyConstraints"),n("2.5.29.13","basicConstraints"),r("2.5.29.14","subjectKeyIdentifier"),r("2.5.29.15","keyUsage"),n("2.5.29.16","privateKeyUsagePeriod"),r("2.5.29.17","subjectAltName"),r("2.5.29.18","issuerAltName"),r("2.5.29.19","basicConstraints"),n("2.5.29.20","cRLNumber"),n("2.5.29.21","cRLReason"),n("2.5.29.22","expirationDate"),n("2.5.29.23","instructionCode"),n("2.5.29.24","invali
217dityDate"),n("2.5.29.25","cRLDistributionPoints"),n("2.5.29.26","issuingDistributionPoint"),n("2.5.29.27","deltaCRLIndicator"),n("2.5.29.28","issuingDistributionPoint"),n("2.5.29.29","certificateIssuer"),n("2.5.29.30","nameConstraints"),r("2.5.29.31","cRLDistributionPoints"),r("2.5.29.32","certificatePolicies"),n("2.5.29.33","policyMappings"),n("2.5.29.34","policyConstraints"),r("2.5.29.35","authorityKeyIdentifier"),n("2.5.29.36","policyConstraints"),r("2.5.29.37","extKeyUsage"),n("2.5.29.46","freshestCRL"),n("2.5.29.54","inhibitAnyPolicy"),r("1.3.6.1.4.1.11129.2.4.2","timestampList"),r("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),r("1.3.6.1.5.5.7.3.1","serverAuth"),r("1.3.6.1.5.5.7.3.2","clientAuth"),r("1.3.6.1.5.5.7.3.3","codeSigning"),r("1.3.6.1.5.5.7.3.4","emailProtection"),r("1.3.6.1.5.5.7.3.8","timeStamping"),Ui.exports}var jd;function Nr(){if(jd)return Fi.exports;jd=1;var e=nt();pt(),cn();var t=Fi.exports=e.asn1=e.asn1||{};t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.maxDepth=256,t.create=function(i,a,c,l,f){if(e.util.isArray(l)){for(var y=[],m=0;m<l.length;++m)l[m]!==void 0&&y.push(l[m]);l=y}var d={tagClass:i,type:a,constructed:c,composed:c||e.util.isArray(l),value:l};return f&&"bitStringContents"in f&&(d.bitStringContents=f.bitStringContents,d.original=t.copy(d)),d},t.copy=function(i,a){var c;if(e.util.isArray(i)){c=[];for(var l=0;l<i.length;++l)c.push(t.copy(i[l],a));return c}return typeof i=="string"?i:(c={tagClass:i.tagClass,type:i.type,constructed:i.constructed,composed:i.composed,value:t.copy(i.value,a)},a&&!a.excludeBitStringContents&&(c.bitStringContents=i.bitStringContents),c)},t.equals=function(i,a,c){if(e.util.isArray(i)){if(!e.util.isArray(a)||i.length!==a.length)return!1;for(var l=0;l<i.length;++l)if(!t.equals(i[l],a[l]))return!1;return!0}if(typeof i!=typeof a)return!1;if(typeof i=="string")return i===a;var f=i.tagClass===a.tagClass&&i.type===a.type&&i.constructed===a.constructed&&i.composed===a.composed&&t.equals(i.value,a.value);return c&&c.includeBitStringContents&&(f=f&&i.bitStringContents===a.bitStringContents),f},t.getBerValueLength=function(i){var a=i.getByte();if(a!==128){var c,l=a&128;return l?c=i.getInt((a&127)<<3):c=a,c}};function r(i,a,c){if(c>a){var l=new Error("Too few bytes to parse DER.");throw l.available=i.length(),l.remaining=a,l.requested=c,l}}var n=function(i,a){var c=i.getByte();if(a--,c!==128){var l,f=c&128;if(!f)l=c;else{var y=c&127;r(i,a,y),l=i.getInt(y<<3)}if(l<0)throw new Error("Negative length: "+l);return l}};t.fromDer=function(i,a){a===void 0&&(a={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof a=="boolean"&&(a={strict:a,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in a||(a.strict=!0),"parseAllBytes"in a||(a.parseAllBytes=!0),"decodeBitStrings"in a||(a.decodeBitStrings=!0),"maxDepth"in a||(a.maxDepth=t.maxDepth),typeof i=="string"&&(i=e.util.createBuffer(i));var c=i.length(),l=o(i,i.length(),0,a);if(a.parseAllBytes&&i.length()!==0){var f=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw f.byteCount=c,f.remaining=i.length(),f}return l};function o(i,a,c,l){if(c>=l.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var f;r(i,a,2);var y=i.getByte();a--;var m=y&192,d=y&31;f=i.length();var v=n(i,a);if(a-=f-i.length(),v!==void 0&&v>a){if(l.strict){var b=new Error("Too few bytes to read ASN.1 value.");throw b.available=i.length(),b.remaining=a,b.requested=v,b}v=a}var S,u,C=(y&32)===32;if(C)if(S=[],v===void 0)for(;;){if(r(i,a,2),i.bytes(2)==="\0\0"){i.getBytes(2),a-=2;break}f=i.length(),S.push(o(i,a,c+1,l)),a-=f-i.length()}else for(;v>0;)f=i.length(),S.push(o(i,v,c+1,l)),a-=f-i.length(),v-=f-i.length();if(S===void 0&&m===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&(u=i.bytes(v)),S===void 0&&l.decodeBitStrings&&m===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&v>1){var x=i.read,I=a,N=0;if(d===t.Type.BITSTRING&&(r(i,a,1),N=i.getByte(),a--),N===0)try{f=i.length();var E={strict:!0,decodeBitStrings:!0},g=o(i,a,c+1,E),p=f-i.length();a-=p,d==t.Type.BITSTRING&&p++;var T=g.tagClass;p===v&&(T===t.Class.UNIVERSAL||T===t.Class.CONTEXT_SPECIFIC)&&(S=[g])}catch{}S===void 0&&(i.read=x,a=I)}if(S===void 0){if(v===void 0){if(l.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");v=a}if(d===t.Type.BMPSTRING)for(S="";v>0;v-=2)r(i,a,2),S+=String.fromCharCode(i.getInt16()),a-=2;else S=i.getBytes(v),a-=v}var R=u===void 0?null:{bitStringContents:u};return t.create(m,d,C,S,R)}t.toDer=function(i){var a=e.util.createBuffer(),c=i.tagClass|i.type,l=e.util.createBuffer(),f=!1;
217if("bitStringContents"in i&&(f=!0,i.original&&(f=t.equals(i,i.original))),f)l.putBytes(i.bitStringContents);else if(i.composed){i.constructed?c|=32:l.putByte(0);for(var y=0;y<i.value.length;++y)i.value[y]!==void 0&&l.putBuffer(t.toDer(i.value[y]))}else if(i.type===t.Type.BMPSTRING)for(var y=0;y<i.value.length;++y)l.putInt16(i.value.charCodeAt(y));else i.type===t.Type.INTEGER&&i.value.length>1&&(i.value.charCodeAt(0)===0&&(i.value.charCodeAt(1)&128)===0||i.value.charCodeAt(0)===255&&(i.value.charCodeAt(1)&128)===128)?l.putBytes(i.value.substr(1)):l.putBytes(i.value);if(a.putByte(c),l.length()<=127)a.putByte(l.length()&127);else{var m=l.length(),d="";do d+=String.fromCharCode(m&255),m=m>>>8;while(m>0);a.putByte(d.length|128);for(var y=d.length-1;y>=0;--y)a.putByte(d.charCodeAt(y))}return a.putBuffer(l),a},t.oidToDer=function(i){var a=i.split("."),c=e.util.createBuffer();c.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var l,f,y,m,d=2;d<a.length;++d){if(l=!0,f=[],y=parseInt(a[d],10),y>4294967295)throw new Error("OID value too large; max is 32-bits.");do m=y&127,y=y>>>7,l||(m|=128),f.push(m),l=!1;while(y>0);for(var v=f.length-1;v>=0;--v)c.putByte(f[v])}return c},t.derToOid=function(i){var a;typeof i=="string"&&(i=e.util.createBuffer(i));var c=i.getByte();a=Math.floor(c/40)+"."+c%40;for(var l=0;i.length()>0;){if(l>70368744177663)throw new Error("OID value too large; max is 53-bits.");c=i.getByte(),l=l*128,c&128?l+=c&127:(a+="."+(l+c),l=0)}return a},t.utcTimeToDate=function(i){var a=new Date,c=parseInt(i.substr(0,2),10);c=c>=50?1900+c:2e3+c;var l=parseInt(i.substr(2,2),10)-1,f=parseInt(i.substr(4,2),10),y=parseInt(i.substr(6,2),10),m=parseInt(i.substr(8,2),10),d=0;if(i.length>11){var v=i.charAt(10),b=10;v!=="+"&&v!=="-"&&(d=parseInt(i.substr(10,2),10),b+=2)}if(a.setUTCFullYear(c,l,f),a.setUTCHours(y,m,d,0),b&&(v=i.charAt(b),v==="+"||v==="-")){var S=parseInt(i.substr(b+1,2),10),u=parseInt(i.substr(b+4,2),10),C=S*60+u;C*=6e4,v==="+"?a.setTime(+a-C):a.setTime(+a+C)}return a},t.generalizedTimeToDate=function(i){var a=new Date,c=parseInt(i.substr(0,4),10),l=parseInt(i.substr(4,2),10)-1,f=parseInt(i.substr(6,2),10),y=parseInt(i.substr(8,2),10),m=parseInt(i.substr(10,2),10),d=parseInt(i.substr(12,2),10),v=0,b=0,S=!1;i.charAt(i.length-1)==="Z"&&(S=!0);var u=i.length-5,C=i.charAt(u);if(C==="+"||C==="-"){var x=parseInt(i.substr(u+1,2),10),I=parseInt(i.substr(u+4,2),10);b=x*60+I,b*=6e4,C==="+"&&(b*=-1),S=!0}return i.charAt(14)==="."&&(v=parseFloat(i.substr(14),10)*1e3),S?(a.setUTCFullYear(c,l,f),a.setUTCHours(y,m,d,v),a.setTime(+a+b)):(a.setFullYear(c,l,f),a.setHours(y,m,d,v)),a},t.dateToUtcTime=function(i){if(typeof i=="string")return i;var a="",c=[];c.push((""+i.getUTCFullYear()).substr(2)),c.push(""+(i.getUTCMonth()+1)),c.push(""+i.getUTCDate()),c.push(""+i.getUTCHours()),c.push(""+i.getUTCMinutes()),c.push(""+i.getUTCSeconds());for(var l=0;l<c.length;++l)c[l].length<2&&(a+="0"),a+=c[l];return a+="Z",a},t.dateToGeneralizedTime=function(i){if(typeof i=="string")return i;var a="",c=[];c.push(""+i.getUTCFullYear()),c.push(""+(i.getUTCMonth()+1)),c.push(""+i.getUTCDate()),c.push(""+i.getUTCHours()),c.push(""+i.getUTCMinutes()),c.push(""+i.getUTCSeconds());for(var l=0;l<c.length;++l)c[l].length<2&&(a+="0"),a+=c[l];return a+="Z",a},t.integerToDer=function(i){var a=e.util.createBuffer();if(i>=-128&&i<128)return a.putSignedInt(i,8);if(i>=-32768&&i<32768)return a.putSignedInt(i,16);if(i>=-8388608&&i<8388608)return a.putSignedInt(i,24);
217if(i>=-2147483648&&i<2147483648)return a.putSignedInt(i,32);var c=new Error("Integer too large; max is 32-bits.");throw c.integer=i,c},t.derToInteger=function(i){typeof i=="string"&&(i=e.util.createBuffer(i));var a=i.length()*8;if(a>32)throw new Error("Integer too large; max is 32-bits.");return i.getSignedInt(a)},t.validate=function(i,a,c,l){var f=!1;if((i.tagClass===a.tagClass||typeof a.tagClass>"u")&&(i.type===a.type||typeof a.type>"u"))if(i.constructed===a.constructed||typeof a.constructed>"u"){if(f=!0,a.value&&e.util.isArray(a.value))for(var y=0,m=0;f&&m<a.value.length;++m){var d=a.value[m];f=!!d.optional;var v=i.value[y];if(!v){d.optional||(f=!1,l&&l.push("["+a.name+'] Missing required element. Expected tag class "'+d.tagClass+'", type "'+d.type+'"'));continue}var b=typeof d.tagClass<"u"&&typeof d.type<"u";if(b&&(v.tagClass!==d.tagClass||v.type!==d.type))if(d.optional){f=!0;continue}else{f=!1,l&&l.push("["+a.name+"] Tag mismatch. Expected ("+d.tagClass+","+d.type+"), got ("+v.tagClass+","+v.type+")");break}var S=t.validate(v,d,c,l);if(S)++y,f=!0;else if(d.optional)f=!0;else{f=!1;break}}if(f&&c&&(a.capture&&(c[a.capture]=i.value),a.captureAsn1&&(c[a.captureAsn1]=i),a.captureBitStringContents&&"bitStringContents"in i&&(c[a.captureBitStringContents]=i.bitStringContents),a.captureBitStringValue&&"bitStringContents"in i))if(i.bitStringContents.length<2)c[a.captureBitStringValue]="";else{var u=i.bitStringContents.charCodeAt(0);if(u!==0)throw new Error("captureBitStringValue only supported for zero unused bits");
217c[a.captureBitStringValue]=i.bitStringContents.slice(1)}}else l&&l.push("["+a.name+'] Expected constructed "'+a.constructed+'", got "'+i.constructed+'"');else l&&(i.tagClass!==a.tagClass&&l.push("["+a.name+'] Expected tag class "'+a.tagClass+'", got "'+i.tagClass+'"'),i.type!==a.type&&l.push("["+a.name+'] Expected type "'+a.type+'", got "'+i.type+'"'));return f};var s=/[^\\u0000-\\u00ff]/;return t.prettyPrint=function(i,a,c){var l="";a=a||0,c=c||2,a>0&&(l+=` 218`);for(var f="",y=0;y<a*c;++y)f+=" ";switch(l+=f+"Tag: ",i.tagClass){case t.Class.UNIVERSAL:l+="Universal:";break;case t.Class.APPLICATION:l+="Application:";break;case t.Class.CONTEXT_SPECIFIC:l+="Context-Specific:";break;case t.Class.PRIVATE:l+="Private:";break}if(i.tagClass===t.Class.UNIVERSAL)switch(l+=i.type,i.type){case t.Type.NONE:l+=" (None)";break;case t.Type.BOOLEAN:l+=" (Boolean)";break;case t.Type.INTEGER:l+=" (Integer)";break;case t.Type.BITSTRING:l+=" (Bit string)";break;case t.Type.OCTETSTRING:l+=" (Octet string)";break;case t.Type.NULL:l+=" (Null)";break;case t.Type.OID:l+=" (Object Identifier)";break;case t.Type.ODESC:l+=" (Object Descriptor)";break;case t.Type.EXTERNAL:l+=" (External or Instance of)";break;case t.Type.REAL:l+=" (Real)";break;case t.Type.ENUMERATED:l+=" (Enumerated)";break;case t.Type.EMBEDDED:l+=" (Embedded PDV)";break;case t.Type.UTF8:l+=" (UTF8)";break;case t.Type.ROID:l+=" (Relative Object Identifier)";break;case t.Type.SEQUENCE:l+=" (Sequence)";break;case t.Type.SET:l+=" (Set)";break;case t.Type.PRINTABLESTRING:l+=" (Printable String)";break;case t.Type.IA5String:l+=" (IA5String (ASCII))";break;case t.Type.UTCTIME:l+=" (UTC time)";break;case t.Type.GENERALIZEDTIME:l+=" (Generalized time)";break;case t.Type.BMPSTRING:l+=" (BMP String)";break}else l+=i.type;if(l+=` 219`,l+=f+"Constructed: "+i.constructed+` 220`,i.composed){for(var m=0,d="",y=0;y<i.value.length;++y)i.value[y]!==void 0&&(m+=1,d+=t.prettyPrint(i.value[y],a+1,c),y+1<i.value.length&&(d+=","));l+=f+"Sub values: "+m+d}else{if(l+=f+"Value: ",i.type===t.Type.OID){var v=t.derToOid(i.value);l+=v,e.pki&&e.pki.oids&&v in e.pki.oids&&(l+=" ("+e.pki.oids[v]+") ")}if(i.type===t.Type.INTEGER)try{l+=t.derToInteger(i.value)}catch{l+="0x"+e.util.bytesToHex(i.value)}else if(i.type===t.Type.BITSTRING){if(i.value.length>1?l+="0x"+e.util.bytesToHex(i.value.slice(1)):l+="(none)",i.value.length>0){var b=i.value.charCodeAt(0);b==1?l+=" (1 unused bit shown)":b>1&&(l+=" ("+b+" unused bits shown)")}}else if(i.type===t.Type.OCTETSTRING)s.test(i.value)||(l+="("+i.value+") "),l+="0x"+e.util.bytesToHex(i.value);else if(i.type===t.Type.UTF8)try{l+=e.util.decodeUtf8(i.value)}catch(S){if(S.message==="URI malformed")l+="0x"+e.util.bytesToHex(i.value)+" (malformed UTF8)";else throw S}else i.type===t.Type.PRINTABLESTRING||i.type===t.Type.IA5String?l+=i.value:s.test(i.value)?l+="0x"+e.util.bytesToHex(i.value):i.value.length===0?l+="[null]":l+=i.value}return l},Fi.exports}var ji={exports:{}},Hi,Hd;function Fr(){if(Hd)return Hi;Hd=1;var e=nt();return Hi=e.md=e.md||{},e.md.algorithms=e.md.algorithms||{},Hi}var zd;function Sa(){if(zd)return ji.exports;zd=1;var e=nt();Fr(),pt();var t=ji.exports=e.hmac=e.hmac||{};return t.create=function(){var r=null,n=null,o=null,s=null,i={};return i.start=function(a,c){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in e.md.algorithms)n=e.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else n=a;if(c===null)c=r;else{if(typeof c=="string")c=e.util.createBuffer(c);else if(e.util.isArray(c)){var l=c;c=e.util.createBuffer();for(var f=0;f<l.length;++f)c.putByte(l[f])}var y=c.length();y>n.blockLength&&(n.start(),n.update(c.bytes()),c=n.digest()),o=e.util.createBuffer(),s=e.util.createBuffer(),y=c.length();for(var f=0;f<y;++f){var l=c.at(f);o.putByte(54^l),s.putByte(92^l)}if(y<n.blockLength)for(var l=n.blockLength-y,f=0;f<l;++f)o.putByte(54),s.putByte(92);r=c,o=o.bytes(),s=s.bytes()}n.start(),n.update(o)},i.update=function(a){n.update(a)},i.getMac=function(){var a=n.digest().bytes();return n.start(),n.update(s),n.update(a),n.digest()},i.digest=i.getMac,i},ji.exports}var zi={exports:{}},Kd;function Sc(){if(Kd)return zi.exports;
220Kd=1;var e=nt();Fr(),pt();var t=zi.exports=e.md5=e.md5||{};e.md.md5=e.md.algorithms.md5=t,t.create=function(){i||a();var l=null,f=e.util.createBuffer(),y=new Array(16),m={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return m.start=function(){m.messageLength=0,m.fullMessageLength=m.messageLength64=[];for(var d=m.messageLengthSize/4,v=0;v<d;++v)m.fullMessageLength.push(0);return f=e.util.createBuffer(),l={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},m},m.start(),m.update=function(d,v){v==="utf8"&&(d=e.util.encodeUtf8(d));var b=d.length;m.messageLength+=b,b=[b/4294967296>>>0,b>>>0];for(var S=m.fullMessageLength.length-1;S>=0;--S)m.fullMessageLength[S]+=b[1],b[1]=b[0]+(m.fullMessageLength[S]/4294967296>>>0),m.fullMessageLength[S]=m.fullMessageLength[S]>>>0,b[0]=b[1]/4294967296>>>0;return f.putBytes(d),c(l,y,f),(f.read>2048||f.length()===0)&&f.compact(),m},m.digest=function(){var d=e.util.createBuffer();d.putBytes(f.bytes());var v=m.fullMessageLength[m.fullMessageLength.length-1]+m.messageLengthSize,b=v&m.blockLength-1;d.putBytes(r.substr(0,m.blockLength-b));for(var S,u=0,C=m.fullMessageLength.length-1;C>=0;--C)S=m.fullMessageLength[C]*8+u,u=S/4294967296>>>0,d.putInt32Le(S>>>0);var x={h0:l.h0,h1:l.h1,h2:l.h2,h3:l.h3};c(x,y,d);var I=e.util.createBuffer();return I.putInt32Le(x.h0),I.putInt32Le(x.h1),I.putInt32Le(x.h2),I.putInt32Le(x.h3),I},m};var r=null,n=null,o=null,s=null,i=!1;function a(){r="Â",r+=e.util.fillString("\0",64),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],s=new Array(64);for(var l=0;l<64;++l)s[l]=Math.floor(Math.abs(Math.sin(l+1))*4294967296);i=!0}function c(l,f,y){for(var m,d,v,b,S,u,C,x,I=y.length();I>=64;){for(d=l.h0,v=l.h1,b=l.h2,S=l.h3,x=0;x<16;++x)f[x]=y.getInt32Le(),u=S^v&(b^S),m=d+u+s[x]+f[x],C=o[x],d=S,S=b,b=v,v+=m<<C|m>>>32-C;for(;x<32;++x)u=b^S&(v^b),m=d+u+s[x]+f[n[x]],C=o[x],d=S,S=b,b=v,v+=m<<C|m>>>32-C;for(;x<48;++x)u=v^b^S,m=d+u+s[x]+f[n[x]],C=o[x],d=S,S=b,b=v,v+=m<<C|m>>>32-C;for(;x<64;++x)u=b^(v|~S),m=d+u+s[x]+f[n[x]],C=o[x],d=S,S=b,b=v,v+=m<<C|m>>>32-C;l.h0=l.h0+d|0,l.h1=l.h1+v|0,l.h2=l.h2+b|0,l.h3=l.h3+S|0,I-=64}}return zi.exports}var Ki={exports:{}},Gd;function kn(){if(Gd)return Ki.exports;Gd=1;var e=nt();pt();var t=Ki.exports=e.pem=e.pem||{};t.encode=function(o,s){s=s||{};var i="-----BEGIN "+o.type+`-----\r 221`,a;if(o.procType&&(a={name:"Proc-Type",values:[String(o.procType.version),o.procType.type]},i+=r(a)),o.contentDomain&&(a={name:"Content-Domain",values:[o.contentDomain]},i+=r(a)),o.dekInfo&&(a={name:"DEK-Info",values:[o.dekInfo.algorithm]},o.dekInfo.parameters&&a.values.push(o.dekInfo.parameters),i+=r(a)),o.headers)for(var c=0;c<o.headers.length;++c)i+=r(o.headers[c]);return o.procType&&(i+=`\r 222`),i+=e.util.encode64(o.body,s.maxline||64)+`\r 223`,i+="-----END "+o.type+`-----\r 224`,i},t.decode=function(o){for(var s=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,c=/\r?\n/,l;l=i.exec(o),!!l;){var f=l[1];f==="NEW CERTIFICATE REQUEST"&&(f="CERTIFICATE REQUEST");var y={type:f,procType:null,contentDomain:null,dekInfo:null,headers:[],body:e.util.decode64(l[3])};if(s.push(y),!!l[2]){for(var m=l[2].split(c),d=0;l&&d<m.length;){for(var v=m[d].replace(/\s+$/,""),b=d+1;b<m.length;++b){var S=m[b];if(!/\s/.test(S[0]))break;v+=S,d=b}if(l=v.match(a),l){for(var u={name:l[1],values:[]},C=l[2].split(","),x=0;x<C.length;++x)u.values.push(n(C[x]));if(y.procType)if(!y.contentDomain&&u.name==="Content-Domain")y.contentDomain=C[0]||"";else if(!y.dekInfo&&u.name==="DEK-Info"){if(u.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');y.dekInfo={algorithm:C[0],parameters:C[1]||null}}else y.headers.push(u);else{if(u.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(u.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');y.procType={version:C[0],type:C[1]}}}++d}if(y.procType==="ENCRYPTED"&&!y.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(s.length===0)throw new Error("Invalid PEM formatted message.");return s};function r(o){for(var s=o.name+": ",i=[],a=function(m,d){return" "+d},c=0;c<o.values.length;++c)i.push(o.values[c].replace(/^(\S+\r\n)/,a));s+=i.join(",")+`\r 225`;for(var l=0,f=-1,c=0;c<s.length;++c,++l)if(l>65&&f!==-1){var y=s[f];y===","?(++f,s=s.substr(0,f)+`\r 226 `+s.substr(f)):s=s.substr(0,f)+`\r 227`+y+s.substr(f+1),l=c-f-1,f=-1,++c}else(s[c]===" "||s[c]===" "||s[c]===",")&&(f=c);return s}function n(o){return o.replace(/^\s+/,"")}return Ki.exports}var Gi={exports:{}},qi,qd;
227function ti(){if(qd)return qi;qd=1;var e=nt();xc(),Lh(),pt(),qi=e.des=e.des||{},e.des.startEncrypting=function(d,v,b,S){var u=m({key:d,output:b,decrypt:!1,mode:S||(v===null?"ECB":"CBC")});return u.start(v),u},e.des.createEncryptionCipher=function(d,v){return m({key:d,output:null,decrypt:!1,mode:v})},e.des.startDecrypting=function(d,v,b,S){var u=m({key:d,output:b,decrypt:!0,mode:S||(v===null?"ECB":"CBC")});return u.start(v),u},e.des.createDecryptionCipher=function(d,v){return m({key:d,output:null,decrypt:!0,mode:v})},e.des.Algorithm=function(d,v){var b=this;b.name=d,b.mode=new v({blockSize:8,cipher:{encrypt:function(S,u){return y(b._keys,S,u,!1)},decrypt:function(S,u){return y(b._keys,S,u,!0)}}}),b._init=!1},e.des.Algorithm.prototype.initialize=function(d){if(!this._init){var v=e.util.createBuffer(d.key);if(this.name.indexOf("3DES")===0&&v.length()!==24)throw new Error("Invalid Triple-DES key size: "+v.length()*8);this._keys=f(v),this._init=!0}},t("DES-ECB",e.cipher.modes.ecb),t("DES-CBC",e.cipher.modes.cbc),t("DES-CFB",e.cipher.modes.cfb),t("DES-OFB",e.cipher.modes.ofb),t("DES-CTR",e.cipher.modes.ctr),t("3DES-ECB",e.cipher.modes.ecb),t("3DES-CBC",e.cipher.modes.cbc),t("3DES-CFB",e.cipher.modes.cfb),t("3DES-OFB",e.cipher.modes.ofb),t("3DES-CTR",e.cipher.modes.ctr);function t(d,v){var b=function(){return new e.des.Algorithm(d,v)};e.cipher.registerAlgorithm(d,b)}var r=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],n=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],s=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],i=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],a=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,164
22700,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],c=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],l=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function f(d){for(var v=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],b=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],S=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],u=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],C=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],x=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],I=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],N=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],E=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],g=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],T=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],R=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],B=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],P=d.length()>8?3:1,D=[],U=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],_=0,V,z=0;z<P;z++){var q=d.getInt32(),G=d.getInt32();V=(q>>>4^G)&252645135,G^=V,q^=V<<4,V=(G>>>-16^q)&65535,q^=V,G^=V<<-16,V=(q>>>2^G)&858993459,G^=V,q^=V<<2,V=(G>>>-16^q)&65535,q^=V,G^=V<<-16,V=(q>>>1^G)&1431655765,G^=V,q^=V<<1,V=(G>>>8^q)&16711935,q^=V,G^=V<<8,V=(q>>>1^G)&1431655765,G^=V,q^=V<<1,V=q<<8|G>>>20&240,q=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=V;for(var Y=0;Y<U.length;++Y){U[Y]?(q=q<<2|q>>>26,G=G<<2|G>>>26):(q=q<<1|q>>>27,G=G<<1|G>>>27),q&=-15,G&=-15;var ee=v[q>>>28]|b[q>>>24&15]|S[q>>>20&15]|u[q>>>16&15]|C[q>>>12&15]|x[q>>>8&15]|I[q>>>4&15],J=N[G>>>28]|E[G>>>24&15]|g[G>>>20&15]|p[G>>>16&15]|T[G>>>12&15]|R[G>>>8&15]|B[G>>>4&15];V=(J>>>16^ee)&65535,D[_++]=ee^V,D[_++]=J^V<<16}}return D}function y(d,v,b,S){var u=d.length===32?3:9,C;u===3?C=S?[30,-2,-2]:[0,32,2]:C=S?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var x,I=v[0],N=v[1];x=(I>>>4^N)&252645135,N^=x,I^=x<<4,x=(I>>>16^N)&65535,N^=x,I^=x<<16,x=(N>>>2^I)&858993459,I^=x,N^=x<<2,x=(N>>>8^I)&16711935,I^=x,N^=x<<8,x=(I>>>1^N)&1431655765,N^=x,I^=x<<1,I=I<<1|I>>>31,N=N<<1|N>>>31;for(var E=0;E<u;E+=3){for(var g=C[E+1],p=C[E+2],T=C[E];T!=g;T+=p){var R=N^d[T],B=(N>>>4|N<<28)^d[T+1];x=I,I=N,N=x^(n[R>>>24&63]|s[R>>>16&63]|a[R>>>8&63]|l[R&63]|r[B>>>24&63]|o[B>>>16&63]|i[B>>>8&63]|c[B&63])}x=I,I=N,N=x}I=I>>>1|I<<31,N=N>>>1|N<<31,x=(I>>>1^N)&1431655765,N^=x,I^=x<<1,x=(N>>>8^I)&16711935,I^=x,N^=x<<8,x=(N>>>2^I)&858993459,I^=x,N^=x<<2,x=(I>>>16^N)&65535,N^=x,I^=x<<16,x=(I>>>4^N)&252645135,N^=x,I^=x<<4,b[0]=I,b[1]=N}function m(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),b="DES-"+v,S;d.decrypt?S=e.cipher.createDecipher(b,d.key):S=e.cipher.createCipher(b,d.key);var u=S.start;return S.start=function(C,x){var I=null;x instanceof e.util.ByteBuffer&&(I=x,x={}),x=x||{},x.output=I,x.iv=C,u.call(S,x)},S}return qi}var Wi,Wd;function Ec(){if(Wd)return Wi;Wd=1;var e=nt();Sa(),Fr(),pt();var t=e.pkcs5=e.pkcs5||{},r;return e.util.isNodejs&&!e.options.usePureJavaScript&&(r=zl),Wi=e.pbkdf2=t.pbkdf2=function(n,o,s,i,a,c){if(typeof a=="function"&&(c=a,a=null),e.util.isNodejs&&!e.options.usePureJavaScript&&r.pbkdf2&&(a===null||typeof a!="object")&&(r.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),n=Buffer.from(n,"binary"),o=Buffer.from(o,"binary"),c?r.pbkdf2Sync.length===4?r.pbkdf2(n,o,s,i,function(E,g){if(E)return c(E);c(null,g.toString("binary"))}):r.pbkdf2(n,o,s,i,a,function(E,g){if(E)return c(E);c(null,g.toString("binary"))}):r.pbkdf2Sync.length===4?r.pbkdf2Sync(n,o,s,i).toString("binary"):r.pbkdf2Sync(n,o,s,i,a).toString("binary");if((typeof a>
227"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in e.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=e.md[a].create()}var l=a.digestLength;if(i>4294967295*l){var f=new Error("Derived key is too long.");if(c)return c(f);throw f}var y=Math.ceil(i/l),m=i-(y-1)*l,d=e.hmac.create();d.start(a,n);var v="",b,S,u;if(!c){for(var C=1;C<=y;++C){d.start(null,null),d.update(o),d.update(e.util.int32ToBytes(C)),b=u=d.digest().getBytes();for(var x=2;x<=s;++x)d.start(null,null),d.update(u),S=d.digest().getBytes(),b=e.util.xorBytes(b,S,l),u=S;v+=C<y?b:b.substr(0,m)}return v}var C=1,x;function I(){if(C>y)return c(null,v);d.start(null,null),d.update(o),d.update(e.util.int32ToBytes(C)),b=u=d.digest().getBytes(),x=2,N()}function N(){if(x<=s)return d.start(null,null),d.update(u),S=d.digest().getBytes(),b=e.util.xorBytes(b,S,l),u=S,++x,e.util.setImmediate(N);v+=C<y?b:b.substr(0,m),++C,I()}I()},Wi}var Va={exports:{}},Yi={exports:{}},Yd;function Mh(){if(Yd)return Yi.exports;Yd=1;var e=nt();Fr(),pt();var t=Yi.exports=e.sha256=e.sha256||{};e.md.sha256=e.md.algorithms.sha256=t,t.create=function(){n||s();var a=null,c=e.util.createBuffer(),l=new Array(64),f={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return f.start=function(){f.messageLength=0,f.fullMessageLength=f.messageLength64=[];for(var y=f.messageLengthSize/4,m=0;m<y;++m)f.fullMessageLength.push(0);return c=e.util.createBuffer(),a={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},f},f.start(),f.update=function(y,m){m==="utf8"&&(y=e.util.encodeUtf8(y));var d=y.length;f.messageLength+=d,d=[d/4294967296>>>0,d>>>0];for(var v=f.fullMessageLength.length-1;v>=0;--v)f.fullMessageLength[v]+=d[1],d[1]=d[0]+(f.fullMessageLength[v]/4294967296>>>0),f.fullMessageLength[v]=f.fullMessageLength[v]>>>0,d[0]=d[1]/4294967296>>>0;return c.putBytes(y),i(a,l,c),(c.read>2048||c.length()===0)&&c.compact(),f},f.digest=function(){var y=e.util.createBuffer();y.putBytes(c.bytes());var m=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize,d=m&f.blockLength-1;y.putBytes(r.substr(0,f.blockLength-d));for(var v,b,S=f.fullMessageLength[0]*8,u=0;u<f.fullMessageLength.length-1;++u)v=f.fullMessageLength[u+1]*8,b=v/4294967296>>>0,S+=b,y.putInt32(S>>>0),S=v>>>0;y.putInt32(S);var C={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};i(C,l,y);var x=e.util.createBuffer();return x.putInt32(C.h0),x.putInt32(C.h1),x.putInt32(C.h2),x.putInt32(C.h3),x.putInt32(C.h4),x.putInt32(C.h5),x.putInt32(C.h6),x.putInt32(C.h7),x},f};var r=null,n=!1,o=null;function s(){r="Â",r+=e.util.fillString("\0",64),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0}function i(a,c,l){for(var f,y,m,d,v,b,S,u,C,x,I,N,E,g,p,T=l.length();T>=64;){for(S=0;S<16;++S)c[S]=l.getInt32();for(;S<64;++S)f=c[S-2],f=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,y=c[S-15],y=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3,c[S]=f+c[S-7]+y+c[S-16]|0;for(u=a.h0,C=a.h1,x=a.h2,I=a.h3,N=a.h4,E=a.h5,g=a.h6,p=a.h7,S=0;S<64;++S)d=(N>>>6|N<<26)^(N>>>11|N<<21)^(N>>>25|N<<7),v=g^N&(E^g),m=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),b=u&C|x&(u^C),f=p+d+v+o[S]+c[S],y=m+b,p=g,g=E,E=N,N=I+f>>>0,I=x,x=C,C=u,u=f+y>>>0;a.h0=a.h0+u|0,a.h1=a.h1+C|0,a.h2=a.h2+x|0,a.h3=a.h3+I|0,a.h4=a.h4+N|0,a.h5=a.h5+E|0,a.h6=a.h6+g|0,a.h7=a.h7+p|0,T-=64}}return Yi.exports}var Xi={exports:{}},Xd;function Dh(){if(Xd)return Xi.exports;Xd=1;var e=nt();pt();var t=null;e.util.isNodejs&&!e.options.usePureJavaScript&&!process.versions["node-webkit"]&&(t=zl);var r=Xi.exports=e.prng=e.prng||{};
227return r.create=function(n){for(var o={plugin:n,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},s=n.md,i=new Array(32),a=0;a<32;++a)i[a]=s.create();o.pools=i,o.pool=0,o.generate=function(m,d){if(!d)return o.generateSync(m);var v=o.plugin.cipher,b=o.plugin.increment,S=o.plugin.formatKey,u=o.plugin.formatSeed,C=e.util.createBuffer();o.key=null,x();function x(I){if(I)return d(I);if(C.length()>=m)return d(null,C.getBytes(m));if(o.generated>1048575&&(o.key=null),o.key===null)return e.util.nextTick(function(){c(x)});var N=v(o.key,o.seed);o.generated+=N.length,C.putBytes(N),o.key=S(v(o.key,b(o.seed))),o.seed=u(v(o.key,o.seed)),e.util.setImmediate(x)}},o.generateSync=function(m){var d=o.plugin.cipher,v=o.plugin.increment,b=o.plugin.formatKey,S=o.plugin.formatSeed;o.key=null;for(var u=e.util.createBuffer();u.length()<m;){o.generated>1048575&&(o.key=null),o.key===null&&l();var C=d(o.key,o.seed);o.generated+=C.length,u.putBytes(C),o.key=b(d(o.key,v(o.seed))),o.seed=S(d(o.key,o.seed))}return u.getBytes(m)};function c(m){if(o.pools[0].messageLength>=32)return f(),m();var d=32-o.pools[0].messageLength<<5;o.seedFile(d,function(v,b){if(v)return m(v);o.collect(b),f(),m()})}function l(){if(o.pools[0].messageLength>=32)return f();var m=32-o.pools[0].messageLength<<5;o.collect(o.seedFileSync(m)),f()}function f(){o.reseeds=o.reseeds===4294967295?0:o.reseeds+1;var m=o.plugin.md.create();m.update(o.keyBytes);for(var d=1,v=0;v<32;++v)o.reseeds%d===0&&(m.update(o.pools[v].digest().getBytes()),o.pools[v].start()),d=d<<1;o.keyBytes=m.digest().getBytes(),m.start(),m.update(o.keyBytes);var b=m.digest().getBytes();o.key=o.plugin.formatKey(o.keyBytes),o.seed=o.plugin.formatSeed(b),o.generated=0}function y(m){var d=null,v=e.util.globalScope,b=v.crypto||v.msCrypto;b&&b.getRandomValues&&(d=function(p){return b.getRandomValues(p)});var S=e.util.createBuffer();if(d)for(;S.length()<m;){var u=Math.max(1,Math.min(m-S.length(),65536)/4),C=new Uint32Array(Math.floor(u));try{d(C);for(var x=0;x<C.length;++x)S.putInt32(C[x])}catch(p){if(!(typeof QuotaExceededError<"u"&&p instanceof QuotaExceededError))throw p}}if(S.length()<m)for(var I,N,E,g=Math.floor(Math.random()*65536);S.length()<m;){N=16807*(g&65535),I=16807*(g>>16),N+=(I&32767)<<16,N+=I>>15,N=(N&2147483647)+(N>>31),g=N&4294967295;for(var x=0;x<3;++x)E=g>>>(x<<3),E^=Math.floor(Math.random()*256),S.putByte(E&255)}return S.getBytes(m)}return t?(o.seedFile=function(m,d){t.randomBytes(m,function(v,b){if(v)return d(v);d(null,b.toString())})},o.seedFileSync=function(m){return t.randomBytes(m).toString()}):(o.seedFile=function(m,d){try{d(null,y(m))}catch(v){d(v)}},o.seedFileSync=y),o.collect=function(m){for(var d=m.length,v=0;v<d;++v)o.pools[o.pool].update(m.substr(v,1)),o.pool=o.pool===31?0:o.pool+1},o.collectInt=function(m,d){for(var v="",b=0;b<d;b+=8)v+=String.fromCharCode(m>>b&255);o.collect(v)},o.registerWorker=function(m){if(m===self)o.seedFile=function(v,b){function S(u){var C=u.data;C.forge&&C.forge.prng&&(self.removeEventListener("message",S),b(C.forge.prng.err,C.forge.prng.bytes))}self.addEventListener("message",S),self.postMessage({forge:{prng:{needed:v}}})};else{var d=function(v){var b=v.data;b.forge&&b.forge.prng&&o.seedFile(b.forge.prng.needed,function(S,u){m.postMessage({forge:{prng:{err:S,bytes:u}}})})};m.addEventListener("message",d)}},o},Xi.exports}var Qd;function xr(){if(Qd)return Va.exports;Qd=1;var e=nt();return ln(),Mh(),Dh(),pt(),(function(){if(e.random&&e.random.getBytes){Va.exports=e.random;return}(function(t){var r={},n=new Array(4),o=e.util.createBuffer();r.formatKey=function(m){var d=e.util.createBuffer(m);return m=new Array(4),m[0]=d.getInt32(),m[1]=d.getInt32(),m[2]=d.getInt32(),m[3]=d.getInt32(),e.aes._expandKey(m,!1)},r.formatSeed=function(m){var d=e.util.createBuffer(m);return m=new Array(4),m[0]=d.getInt32(),m[1]=d.getInt32(),m[2]=d.getInt32(),m[3]=d.getInt32(),m},r.cipher=function(m,d){return e.aes._updateBlock(m,d,n,!1),o.putInt32(n[0]),o.putInt32(n[1]),o.putInt32(n[2]),o.putInt32(n[3]),o.getBytes()},r.increment=function(m){return++m[3],m},r.md=e.md.sha256;function s(){var m=e.prng.create(r);return m.getBytes=function(d,v){return m.generate(d,v)},m.getBytesSync=function(d){return m.generate(d)},m}var i=s(),a=null,c=e.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(a=function(m){return l.getRandomValues(m)}),e.options.usePureJavaScript||!e.util.isNodejs&&!a){if(i.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var y in navigator)try{typeof navigator[y]=="string"&&(f+=navigator[y])}catch{}i.collect(f),f=null}t&&(t().mousemove(function(m){i.collectInt(m.clientX,16),i.collectInt(m.clientY,16)}),t().keypress(function(m){i.collectInt(m.charCode,8)}))}if(!e.random)e.random=i;else for(var y in i)e.random[y]=i[y];e.random.createInstance=s,Va.exports=e.random})(typeof jQuery<"u"?jQuery:null)})(),Va.exports}var Qi,Zd;
227function $h(){if(Zd)return Qi;Zd=1;var e=nt();pt();var t=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],r=[1,2,3,5],n=function(i,a){return i<<a&65535|(i&65535)>>16-a},o=function(i,a){return(i&65535)>>a|i<<16-a&65535};Qi=e.rc2=e.rc2||{},e.rc2.expandKey=function(i,a){typeof i=="string"&&(i=e.util.createBuffer(i)),a=a||128;var c=i,l=i.length(),f=a,y=Math.ceil(f/8),m=255>>(f&7),d;for(d=l;d<128;d++)c.putByte(t[c.at(d-1)+c.at(d-l)&255]);for(c.setAt(128-y,t[c.at(128-y)&m]),d=127-y;d>=0;d--)c.setAt(d,t[c.at(d+1)^c.at(d+y)]);return c};var s=function(i,a,c){var l=!1,f=null,y=null,m=null,d,v,b,S,u=[];for(i=e.rc2.expandKey(i,a),b=0;b<64;b++)u.push(i.getInt16Le());c?(d=function(I){for(b=0;b<4;b++)I[b]+=u[S]+(I[(b+3)%4]&I[(b+2)%4])+(~I[(b+3)%4]&I[(b+1)%4]),I[b]=n(I[b],r[b]),S++},v=function(I){for(b=0;b<4;b++)I[b]+=u[I[(b+3)%4]&63]}):(d=function(I){for(b=3;b>=0;b--)I[b]=o(I[b],r[b]),I[b]-=u[S]+(I[(b+3)%4]&I[(b+2)%4])+(~I[(b+3)%4]&I[(b+1)%4]),S--},v=function(I){for(b=3;b>=0;b--)I[b]-=u[I[(b+3)%4]&63]});var C=function(I){var N=[];for(b=0;b<4;b++){var E=f.getInt16Le();m!==null&&(c?E^=m.getInt16Le():m.putInt16Le(E)),N.push(E&65535)}S=c?0:63;for(var g=0;g<I.length;g++)for(var p=0;p<I[g][0];p++)I[g][1](N);for(b=0;b<4;b++)m!==null&&(c?m.putInt16Le(N[b]):N[b]^=m.getInt16Le()),y.putInt16Le(N[b])},x=null;return x={start:function(I,N){I&&typeof I=="string"&&(I=e.util.createBuffer(I)),l=!1,f=e.util.createBuffer(),y=N||new e.util.createBuffer,m=I,x.output=y},update:function(I){for(l||f.putBuffer(I);f.length()>=8;)C([[5,d],[1,v],[6,d],[1,v],[5,d]])},finish:function(I){var N=!0;if(c)if(I)N=I(8,f,!c);else{var E=f.length()===8?8:8-f.length();f.fillWithByte(E,E)}if(N&&(l=!0,x.update()),!c&&(N=f.length()===0,N))if(I)N=I(8,y,!c);else{var g=y.length(),p=y.at(g-1);p>g?N=!1:y.truncate(p)}return N}},x};return e.rc2.startEncrypting=function(i,a,c){var l=e.rc2.createEncryptionCipher(i,128);return l.start(a,c),l},e.rc2.createEncryptionCipher=function(i,a){return s(i,a,!0)},e.rc2.startDecrypting=function(i,a,c){var l=e.rc2.createDecryptionCipher(i,128);return l.start(a,c),l},e.rc2.createDecryptionCipher=function(i,a){return s(i,a,!1)},Qi}var Zi,Jd;function ri(){if(Jd)return Zi;Jd=1;var e=nt();Zi=e.jsbn=e.jsbn||{};var t;function r(k,j,K){this.data=[],k!=null&&(typeof k=="number"?this.fromNumber(k,j,K):j==null&&typeof k!="string"?this.fromString(k,256):this.fromString(k,j))}e.jsbn.BigInteger=r;function n(){return new r(null)}function o(k,j,K,ne,pe,ge){for(;--ge>=0;){var Me=j*this.data[k++]+K.data[ne]+pe;pe=Math.floor(Me/67108864),K.data[ne++]=Me&67108863}return pe}function s(k,j,K,ne,pe,ge){for(var Me=j&32767,Ne=j>>15;--ge>=0;){var ht=this.data[k]&32767,Lt=this.data[k++]>>15,Zt=Ne*ht+Lt*Me;ht=Me*ht+((Zt&32767)<<15)+K.data[ne]+(pe&1073741823),pe=(ht>>>30)+(Zt>>>15)+Ne*Lt+(pe>>>30),K.data[ne++]=ht&1073741823}return pe}function i(k,j,K,ne,pe,ge){for(var Me=j&16383,Ne=j>>14;--ge>=0;){var ht=this.data[k]&16383,Lt=this.data[k++]>>14,Zt=Ne*ht+Lt*Me;ht=Me*ht+((Zt&16383)<<14)+K.data[ne]+pe,pe=(ht>>28)+(Zt>>14)+Ne*Lt,K.data[ne++]=ht&268435455}return pe}typeof navigator>"u"?(r.prototype.am=i,t=28):navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=s,t=30):navigator.appName!="Netscape"?(r.prototype.am=o,t=26):(r.prototype.am=i,t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t;var a=52;r.prototype.FV=Math.pow(2,a),r.prototype.F1=a-t,r.prototype.F2=2*t-a;var c="0123456789abcdefghijklmnopqrstuvwxyz",l=new Array,f,y;for(f=48,y=0;y<=9;++y)l[f++]=y;for(f=97,y=10;y<36;++y)l[f++]=y;for(f=65,y=10;y<36;++y)l[f++]=y;function m(k){return c.charAt(k)}
227function d(k,j){var K=l[k.charCodeAt(j)];return K??-1}function v(k){for(var j=this.t-1;j>=0;--j)k.data[j]=this.data[j];k.t=this.t,k.s=this.s}function b(k){this.t=1,this.s=k<0?-1:0,k>0?this.data[0]=k:k<-1?this.data[0]=k+this.DV:this.t=0}function S(k){var j=n();return j.fromInt(k),j}function u(k,j){var K;if(j==16)K=4;else if(j==8)K=3;else if(j==256)K=8;else if(j==2)K=1;else if(j==32)K=5;else if(j==4)K=2;else{this.fromRadix(k,j);return}this.t=0,this.s=0;for(var ne=k.length,pe=!1,ge=0;--ne>=0;){var Me=K==8?k[ne]&255:d(k,ne);if(Me<0){k.charAt(ne)=="-"&&(pe=!0);continue}pe=!1,ge==0?this.data[this.t++]=Me:ge+K>this.DB?(this.data[this.t-1]|=(Me&(1<<this.DB-ge)-1)<<ge,this.data[this.t++]=Me>>this.DB-ge):this.data[this.t-1]|=Me<<ge,ge+=K,ge>=this.DB&&(ge-=this.DB)}K==8&&(k[0]&128)!=0&&(this.s=-1,ge>0&&(this.data[this.t-1]|=(1<<this.DB-ge)-1<<ge)),this.clamp(),pe&&r.ZERO.subTo(this,this)}function C(){for(var k=this.s&this.DM;this.t>0&&this.data[this.t-1]==k;)--this.t}function x(k){if(this.s<0)return"-"+this.negate().toString(k);var j;if(k==16)j=4;else if(k==8)j=3;else if(k==2)j=1;else if(k==32)j=5;else if(k==4)j=2;else return this.toRadix(k);var K=(1<<j)-1,ne,pe=!1,ge="",Me=this.t,Ne=this.DB-Me*this.DB%j;if(Me-- >0)for(Ne<this.DB&&(ne=this.data[Me]>>Ne)>0&&(pe=!0,ge=m(ne));Me>=0;)Ne<j?(ne=(this.data[Me]&(1<<Ne)-1)<<j-Ne,ne|=this.data[--Me]>>(Ne+=this.DB-j)):(ne=this.data[Me]>>(Ne-=j)&K,Ne<=0&&(Ne+=this.DB,--Me)),ne>0&&(pe=!0),pe&&(ge+=m(ne));return pe?ge:"0"}function I(){var k=n();return r.ZERO.subTo(this,k),k}function N(){return this.s<0?this.negate():this}function E(k){var j=this.s-k.s;if(j!=0)return j;var K=this.t;if(j=K-k.t,j!=0)return this.s<0?-j:j;for(;--K>=0;)if((j=this.data[K]-k.data[K])!=0)return j;return 0}function g(k){var j=1,K;return(K=k>>>16)!=0&&(k=K,j+=16),(K=k>>8)!=0&&(k=K,j+=8),(K=k>>4)!=0&&(k=K,j+=4),(K=k>>2)!=0&&(k=K,j+=2),(K=k>>1)!=0&&(k=K,j+=1),j}function p(){return this.t<=0?0:this.DB*(this.t-1)+g(this.data[this.t-1]^this.s&this.DM)}function T(k,j){var K;for(K=this.t-1;K>=0;--K)j.data[K+k]=this.data[K];for(K=k-1;K>=0;--K)j.data[K]=0;j.t=this.t+k,j.s=this.s}function R(k,j){for(var K=k;K<this.t;++K)j.data[K-k]=this.data[K];j.t=Math.max(this.t-k,0),j.s=this.s}function B(k,j){var K=k%this.DB,ne=this.DB-K,pe=(1<<ne)-1,ge=Math.floor(k/this.DB),Me=this.s<<K&this.DM,Ne;for(Ne=this.t-1;Ne>=0;--Ne)j.data[Ne+ge+1]=this.data[Ne]>>ne|Me,Me=(this.data[Ne]&pe)<<K;for(Ne=ge-1;Ne>=0;--Ne)j.data[Ne]=0;j.data[ge]=Me,j.t=this.t+ge+1,j.s=this.s,j.clamp()}function P(k,j){j.s=this.s;var K=Math.floor(k/this.DB);if(K>=this.t){j.t=0;return}var ne=k%this.DB,pe=this.DB-ne,ge=(1<<ne)-1;j.data[0]=this.data[K]>>ne;for(var Me=K+1;Me<this.t;++Me)j.data[Me-K-1]|=(this.data[Me]&ge)<<pe,j.data[Me-K]=this.data[Me]>>ne;ne>0&&(j.data[this.t-K-1]|=(this.s&ge)<<pe),j.t=this.t-K,j.clamp()}function D(k,j){for(var K=0,ne=0,pe=Math.min(k.t,this.t);K<pe;)ne+=this.data[K]-k.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;if(k.t<this.t){for(ne-=k.s;K<this.t;)ne+=this.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;K<k.t;)ne-=k.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;ne-=k.s}j.s=ne<0?-1:0,ne<-1?j.data[K++]=this.DV+ne:ne>0&&(j.data[K++]=ne),j.t=K,j.clamp()}function U(k,j){var K=this.abs(),ne=k.abs(),pe=K.t;for(j.t=pe+ne.t;--pe>=0;)j.data[pe]=0;for(pe=0;pe<ne.t;++pe)j.data[pe+K.t]=K.am(0,ne.data[pe],j,pe,0,K.t);j.s=0,j.clamp(),this.s!=k.s&&r.ZERO.subTo(j,j)}function _(k){for(var j=this.abs(),K=k.t=2*j.t;--K>=0;)k.data[K]=0;for(K=0;K<j.t-1;++K){var ne=j.am(K,j.data[K],k,2*K,0,1);(k.data[K+j.t]+=j.am(K+1,2*j.data[K],k,2*K+1,ne,j.t-K-1))>=j.DV&&(k.data[K+j.t]-=j.DV,k.data[K+j.t+1]=1)}k.t>0&&(k.data[k.t-1]+=j.am(K,j.data[K],k,2*K,0,1)),k.s=0,k.clamp()}function V(k,j,K){var ne=k.abs();if(!(ne.t<=0)){var pe=this.abs();if(pe.t<ne.t){j?.fromInt(0),K!=null&&this.copyTo(K);return}K==null&&(K=n());var ge=n(),Me=this.s,Ne=k.s,ht=this.DB-g(ne.data[ne.t-1]);ht>0?(ne.lShiftTo(ht,ge),pe.lShiftTo(ht,K)):(ne.copyTo(ge),pe.copyTo(K));var Lt=ge.t,Zt=ge.data[Lt-1];if(Zt!=0){var Wt=Zt*(1<<this.F1)+(Lt>1?ge.data[Lt-2]>>
227this.F2:0),dr=this.FV/Wt,Be=(1<<this.F1)/Wt,Ze=1<<this.F2,jt=K.t,dn=jt-Lt,fr=j??n();for(ge.dlShiftTo(dn,fr),K.compareTo(fr)>=0&&(K.data[K.t++]=1,K.subTo(fr,K)),r.ONE.dlShiftTo(Lt,fr),fr.subTo(ge,ge);ge.t<Lt;)ge.data[ge.t++]=0;for(;--dn>=0;){var fn=K.data[--jt]==Zt?this.DM:Math.floor(K.data[jt]*dr+(K.data[jt-1]+Ze)*Be);if((K.data[jt]+=ge.am(0,fn,K,dn,0,Lt))<fn)for(ge.dlShiftTo(dn,fr),K.subTo(fr,K);K.data[jt]<--fn;)K.subTo(fr,K)}j!=null&&(K.drShiftTo(Lt,j),Me!=Ne&&r.ZERO.subTo(j,j)),K.t=Lt,K.clamp(),ht>0&&K.rShiftTo(ht,K),Me<0&&r.ZERO.subTo(K,K)}}}function z(k){var j=n();return this.abs().divRemTo(k,null,j),this.s<0&&j.compareTo(r.ZERO)>0&&k.subTo(j,j),j}function q(k){this.m=k}function G(k){return k.s<0||k.compareTo(this.m)>=0?k.mod(this.m):k}function Y(k){return k}function ee(k){k.divRemTo(this.m,null,k)}function J(k,j,K){k.multiplyTo(j,K),this.reduce(K)}function te(k,j){k.squareTo(j),this.reduce(j)}q.prototype.convert=G,q.prototype.revert=Y,q.prototype.reduce=ee,q.prototype.mulTo=J,q.prototype.sqrTo=te;function Q(){if(this.t<1)return 0;var k=this.data[0];if((k&1)==0)return 0;var j=k&3;return j=j*(2-(k&15)*j)&15,j=j*(2-(k&255)*j)&255,j=j*(2-((k&65535)*j&65535))&65535,j=j*(2-k*j%this.DV)%this.DV,j>0?this.DV-j:-j}function Z(k){this.m=k,this.mp=k.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<k.DB-15)-1,this.mt2=2*k.t}function W(k){var j=n();return k.abs().dlShiftTo(this.m.t,j),j.divRemTo(this.m,null,j),k.s<0&&j.compareTo(r.ZERO)>0&&this.m.subTo(j,j),j}function oe(k){var j=n();return k.copyTo(j),this.reduce(j),j}function ie(k){for(;k.t<=this.mt2;)k.data[k.t++]=0;for(var j=0;j<this.m.t;++j){var K=k.data[j]&32767,ne=K*this.mpl+((K*this.mph+(k.data[j]>>15)*this.mpl&this.um)<<15)&k.DM;for(K=j+this.m.t,k.data[K]+=this.m.am(0,ne,k,j,0,this.m.t);k.data[K]>=k.DV;)k.data[K]-=k.DV,k.data[++K]++}k.clamp(),k.drShiftTo(this.m.t,k),k.compareTo(this.m)>=0&&k.subTo(this.m,k)}function A(k,j){k.squareTo(j),this.reduce(j)}function $(k,j,K){k.multiplyTo(j,K),this.reduce(K)}Z.prototype.convert=W,Z.prototype.revert=oe,Z.prototype.reduce=ie,Z.prototype.mulTo=$,Z.prototype.sqrTo=A;function O(){return(this.t>0?this.data[0]&1:this.s)==0}function w(k,j){if(k>4294967295||k<1)return r.ONE;var K=n(),ne=n(),pe=j.convert(this),ge=g(k)-1;for(pe.copyTo(K);--ge>=0;)if(j.sqrTo(K,ne),(k&1<<ge)>0)j.mulTo(ne,pe,K);else{var Me=K;K=ne,ne=Me}return j.revert(K)}function M(k,j){var K;return k<256||j.isEven()?K=new q(j):K=new Z(j),this.exp(k,K)}r.prototype.copyTo=v,r.prototype.fromInt=b,r.prototype.fromString=u,r.prototype.clamp=C,r.prototype.dlShiftTo=T,r.prototype.drShiftTo=R,r.prototype.lShiftTo=B,r.prototype.rShiftTo=P,r.prototype.subTo=D,r.prototype.multiplyTo=U,r.prototype.squareTo=_,r.prototype.divRemTo=V,r.prototype.invDigit=Q,r.prototype.isEven=O,r.prototype.exp=w,r.prototype.toString=x,r.prototype.negate=I,r.prototype.abs=N,r.prototype.compareTo=E,r.prototype.bitLength=p,r.prototype.mod=z,r.prototype.modPowInt=M,r.ZERO=S(0),r.ONE=S(1);function H(){var k=n();return this.copyTo(k),k}function F(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function X(){return this.t==0?this.s:this.data[0]<<24>>24}function ce(){return this.t==0?this.s:this.data[0]<<16>>16}function ae(k){return Math.floor(Math.LN2*this.DB/Math.log(k))}function re(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function de(k){if(k==null&&(k=10),this.signum()==0||k<2||k>36)return"0";var j=this.chunkSize(k),K=Math.pow(k,j),ne=S(K),pe=n(),ge=n(),Me="";for(this.divRemTo(ne,pe,ge);pe.signum()>0;)Me=(K+ge.intValue()).toString(k).substr(1)+Me,pe.divRemTo(ne,pe,ge);return ge.intValue().toString(k)+Me}function Ce(k,j){this.fromInt(0),j==null&&(j=10);for(var K=this.chunkSize(j),ne=Math.pow(j,K),pe=!1,ge=0,Me=0,Ne=0;Ne<k.length;++Ne){var ht=d(k,Ne);if(ht<0){k.charAt(Ne)=="-"&&this.signum()==0&&(pe=!0);continue}Me=j*Me+ht,++ge>=K&&(this.dMultiply(ne),this.dAddOffset(Me,0),ge=0,Me=0)}ge>0&&(this.dMultiply(Math.pow(j,ge)),this.dAddOffset(Me,0)),pe&&r.ZERO.subTo(this,this)}
227function he(k,j,K){if(typeof j=="number")if(k<2)this.fromInt(1);else for(this.fromNumber(k,K),this.testBit(k-1)||this.bitwiseTo(r.ONE.shiftLeft(k-1),Ue,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(j);)this.dAddOffset(2,0),this.bitLength()>k&&this.subTo(r.ONE.shiftLeft(k-1),this);else{var ne=new Array,pe=k&7;ne.length=(k>>3)+1,j.nextBytes(ne),pe>0?ne[0]&=(1<<pe)-1:ne[0]=0,this.fromString(ne,256)}}function ye(){var k=this.t,j=new Array;j[0]=this.s;var K=this.DB-k*this.DB%8,ne,pe=0;if(k-- >0)for(K<this.DB&&(ne=this.data[k]>>K)!=(this.s&this.DM)>>K&&(j[pe++]=ne|this.s<<this.DB-K);k>=0;)K<8?(ne=(this.data[k]&(1<<K)-1)<<8-K,ne|=this.data[--k]>>(K+=this.DB-8)):(ne=this.data[k]>>(K-=8)&255,K<=0&&(K+=this.DB,--k)),(ne&128)!=0&&(ne|=-256),pe==0&&(this.s&128)!=(ne&128)&&++pe,(pe>0||ne!=this.s)&&(j[pe++]=ne);return j}function De(k){return this.compareTo(k)==0}function Fe(k){return this.compareTo(k)<0?this:k}function je(k){return this.compareTo(k)>0?this:k}function Le(k,j,K){var ne,pe,ge=Math.min(k.t,this.t);for(ne=0;ne<ge;++ne)K.data[ne]=j(this.data[ne],k.data[ne]);if(k.t<this.t){for(pe=k.s&this.DM,ne=ge;ne<this.t;++ne)K.data[ne]=j(this.data[ne],pe);K.t=this.t}else{for(pe=this.s&this.DM,ne=ge;ne<k.t;++ne)K.data[ne]=j(pe,k.data[ne]);K.t=k.t}K.s=j(this.s,k.s),K.clamp()}function _e(k,j){return k&j}function ze(k){var j=n();return this.bitwiseTo(k,_e,j),j}function Ue(k,j){return k|j}function be(k){var j=n();return this.bitwiseTo(k,Ue,j),j}function Se(k,j){return k^j}function Pe(k){var j=n();return this.bitwiseTo(k,Se,j),j}function $e(k,j){return k&~j}function ke(k){var j=n();return this.bitwiseTo(k,$e,j),j}function ct(){for(var k=n(),j=0;j<this.t;++j)k.data[j]=this.DM&~this.data[j];return k.t=this.t,k.s=~this.s,k}function at(k){var j=n();return k<0?this.rShiftTo(-k,j):this.lShiftTo(k,j),j}function ft(k){var j=n();return k<0?this.lShiftTo(-k,j):this.rShiftTo(k,j),j}function yt(k){if(k==0)return-1;var j=0;return(k&65535)==0&&(k>>=16,j+=16),(k&255)==0&&(k>>=8,j+=8),(k&15)==0&&(k>>=4,j+=4),(k&3)==0&&(k>>=2,j+=2),(k&1)==0&&++j,j}function ot(){for(var k=0;k<this.t;++k)if(this.data[k]!=0)return k*this.DB+yt(this.data[k]);return this.s<0?this.t*this.DB:-1}function gt(k){for(var j=0;k!=0;)k&=k-1,++j;return j}function bt(){for(var k=0,j=this.s&this.DM,K=0;K<this.t;++K)k+=gt(this.data[K]^j);return k}function xt(k){var j=Math.floor(k/this.DB);return j>=this.t?this.s!=0:(this.data[j]&1<<k%this.DB)!=0}function It(k,j){var K=r.ONE.shiftLeft(k);return this.bitwiseTo(K,j,K),K}function ut(k){return this.changeBit(k,Ue)}function tt(k){return this.changeBit(k,$e)}function We(k){return this.changeBit(k,Se)}function it(k,j){for(var K=0,ne=0,pe=Math.min(k.t,this.t);K<pe;)ne+=this.data[K]+k.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;if(k.t<this.t){for(ne+=k.s;K<this.t;)ne+=this.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;K<k.t;)ne+=k.data[K],j.data[K++]=ne&this.DM,ne>>=this.DB;ne+=k.s}j.s=ne<0?-1:0,ne>0?j.data[K++]=ne:ne<-1&&(j.data[K++]=this.DV+ne),j.t=K,j.clamp()}function Ee(k){var j=n();return this.addTo(k,j),j}function Ie(k){var j=n();return this.subTo(k,j),j}function Oe(k){var j=n();return this.multiplyTo(k,j),j}function ve(k){var j=n();return this.divRemTo(k,j,null),j}function Te(k){var j=n();return this.divRemTo(k,null,j),j}function se(k){var j=n(),K=n();return this.divRemTo(k,j,K),new Array(j,K)}function fe(k){this.data[this.t]=this.am(0,k-1,this,0,0,this.t),++this.t,this.clamp()}function Ae(k,j){if(k!=0){for(;this.t<=j;)this.data[this.t++]=0;for(this.data[j]+=k;this.data[j]>=this.DV;)this.data[j]-=this.DV,++j>=this.t&&(this.data[this.t++]=0),++this.data[j]}}function Ke(){}function Ye(k){return k}function Je(k,j,K){k.multiplyTo(j,K)}function st(k,j){k.squareTo(j)}Ke.prototype.convert=Ye,Ke.prototype.revert=Ye,Ke.prototype.mulTo=Je,Ke.prototype.sqrTo=st;function Pt(k){return this.exp(k,new Ke)}function Ge(k,j,K){var ne=Math.min(this.t+k.t,j);for(K.s=0,K.t=ne;ne>0;)K.data[--ne]=0;var pe;for(pe=K.t-this.t;ne<pe;++ne)K.data[ne+this.t]=this.am(0,k.data[ne],K,ne,0,this.t);for(pe=Math.min(k.t,j);ne<pe;++ne)this.am(0,k.data[ne],K,ne,0,j-ne);K.clamp()}function we(k,j,K){--j;var ne=K.t=this.t+k.t-j;for(K.s=0;--ne>=0;)K.data[ne]=0;for(ne=Math.max(j-this.t,0);ne<k.t;++ne)K.data[this.t+ne-j]=this.am(j-ne,k.data[ne],K,0,0,this.t+ne-j);K.clamp(),K.drShiftTo(1,K)}function Ve(k){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*k.t,this.r2),this.mu=this.r2.divide(k),this.m=k}function dt(k){if(k.s<0||k.t>2*this.m.t)return k.mod(this.m);
227if(k.compareTo(this.m)<0)return k;var j=n();return k.copyTo(j),this.reduce(j),j}function Ct(k){return k}function St(k){for(k.drShiftTo(this.m.t-1,this.r2),k.t>this.m.t+1&&(k.t=this.m.t+1,k.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);k.compareTo(this.r2)<0;)k.dAddOffset(1,this.m.t+1);for(k.subTo(this.r2,k);k.compareTo(this.m)>=0;)k.subTo(this.m,k)}function Bt(k,j){k.squareTo(j),this.reduce(j)}function At(k,j,K){k.multiplyTo(j,K),this.reduce(K)}Ve.prototype.convert=dt,Ve.prototype.revert=Ct,Ve.prototype.reduce=St,Ve.prototype.mulTo=At,Ve.prototype.sqrTo=Bt;function ir(k,j){var K=k.bitLength(),ne,pe=S(1),ge;if(K<=0)return pe;K<18?ne=1:K<48?ne=3:K<144?ne=4:K<768?ne=5:ne=6,K<8?ge=new q(j):j.isEven()?ge=new Ve(j):ge=new Z(j);var Me=new Array,Ne=3,ht=ne-1,Lt=(1<<ne)-1;if(Me[1]=ge.convert(this),ne>1){var Zt=n();for(ge.sqrTo(Me[1],Zt);Ne<=Lt;)Me[Ne]=n(),ge.mulTo(Zt,Me[Ne-2],Me[Ne]),Ne+=2}var Wt=k.t-1,dr,Be=!0,Ze=n(),jt;for(K=g(k.data[Wt])-1;Wt>=0;){for(K>=ht?dr=k.data[Wt]>>K-ht&Lt:(dr=(k.data[Wt]&(1<<K+1)-1)<<ht-K,Wt>0&&(dr|=k.data[Wt-1]>>this.DB+K-ht)),Ne=ne;(dr&1)==0;)dr>>=1,--Ne;if((K-=Ne)<0&&(K+=this.DB,--Wt),Be)Me[dr].copyTo(pe),Be=!1;else{for(;Ne>1;)ge.sqrTo(pe,Ze),ge.sqrTo(Ze,pe),Ne-=2;Ne>0?ge.sqrTo(pe,Ze):(jt=pe,pe=Ze,Ze=jt),ge.mulTo(Ze,Me[dr],pe)}for(;Wt>=0&&(k.data[Wt]&1<<K)==0;)ge.sqrTo(pe,Ze),jt=pe,pe=Ze,Ze=jt,--K<0&&(K=this.DB-1,--Wt)}return ge.revert(pe)}function un(k){var j=this.s<0?this.negate():this.clone(),K=k.s<0?k.negate():k.clone();if(j.compareTo(K)<0){var ne=j;j=K,K=ne}var pe=j.getLowestSetBit(),ge=K.getLowestSetBit();if(ge<0)return j;for(pe<ge&&(ge=pe),ge>0&&(j.rShiftTo(ge,j),K.rShiftTo(ge,K));j.signum()>0;)(pe=j.getLowestSetBit())>0&&j.rShiftTo(pe,j),(pe=K.getLowestSetBit())>0&&K.rShiftTo(pe,K),j.compareTo(K)>=0?(j.subTo(K,j),j.rShiftTo(1,j)):(K.subTo(j,K),K.rShiftTo(1,K));return ge>0&&K.lShiftTo(ge,K),K}function Vn(k){if(k<=0)return 0;var j=this.DV%k,K=this.s<0?k-1:0;if(this.t>0)if(j==0)K=this.data[0]%k;else for(var ne=this.t-1;ne>=0;--ne)K=(j*K+this.data[ne])%k;return K}function oi(k){var j=k.isEven();if(this.isEven()&&j||k.signum()==0)return r.ZERO;for(var K=k.clone(),ne=this.clone(),pe=S(1),ge=S(0),Me=S(0),Ne=S(1);K.signum()!=0;){for(;K.isEven();)K.rShiftTo(1,K),j?((!pe.isEven()||!ge.isEven())&&(pe.addTo(this,pe),ge.subTo(k,ge)),pe.rShiftTo(1,pe)):ge.isEven()||ge.subTo(k,ge),ge.rShiftTo(1,ge);for(;ne.isEven();)ne.rShiftTo(1,ne),j?((!Me.isEven()||!Ne.isEven())&&(Me.addTo(this,Me),Ne.subTo(k,Ne)),Me.rShiftTo(1,Me)):Ne.isEven()||Ne.subTo(k,Ne),Ne.rShiftTo(1,Ne);K.compareTo(ne)>=0?(K.subTo(ne,K),j&&pe.subTo(Me,pe),ge.subTo(Ne,ge)):(ne.subTo(K,ne),j&&Me.subTo(pe,Me),Ne.subTo(ge,Ne))}if(ne.compareTo(r.ONE)!=0)return r.ZERO;if(Ne.compareTo(k)>=0)return Ne.subtract(k);if(Ne.signum()<0)Ne.addTo(k,Ne);else return Ne;return Ne.signum()<0?Ne.add(k):Ne}var nr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Ur=(1<<26)/nr[nr.length-1];function Aa(k){var j,K=this.abs();if(K.t==1&&K.data[0]<=nr[nr.length-1]){for(j=0;j<nr.length;++j)if(K.data[0]==nr[j])return!0;return!1}if(K.isEven())return!1;for(j=1;j<nr.length;){for(var ne=nr[j],pe=j+1;pe<nr.length&&ne<Ur;)ne*=nr[pe++];for(ne=K.modInt(ne);j<pe;)if(ne%nr[j++]==0)return!1}return K.millerRabin(k)}function Fn(k){var j=this.subtract(r.ONE),K=j.getLowestSetBit();if(K<=0)return!1;for(var ne=j.shiftRight(K),pe=Un(),ge,Me=0;Me<k;++Me){do ge=new r(this.bitLength(),pe);while(ge.compareTo(r.ONE)<=0||ge.compareTo(j)>=0);var Ne=ge.modPow(ne,this);if(Ne.compareTo(r.ONE)!=0&&Ne.compareTo(j)!=0){for(var ht=1;ht++<K&&Ne.compareTo(j)!=0;)if(Ne=Ne.modPowInt(2,this),Ne.compareTo(r.ONE)==0)return!1;if(Ne.compareTo(j)!=0)return!1}}return!0}function Un(){return{nextBytes:function(k){for(var j=0;j<k.length;++j)k[j]=Math.floor(Math.random()*256)}}}return r.prototype.chunkSize=ae,r.prototype.toRadix=de,r.prototype.fromRadix=Ce,r.prototype.fromNumber=he,r.prototype.bitwiseTo=Le,r.prototype.changeBit=It,r.prototype.addTo=it,r.prototype.dMultiply=fe,r.prototype.dAddOffset=Ae,r.prototype.multiplyLowerTo=Ge,r.prototype.multiplyUpperTo=we,r.prototype.modInt=Vn,r.prototype.millerRabin=Fn,r.prototype.clone=H,r.prototype.intValue=F,r.prototype.byteValue=X,r.prototype.shortValue=ce,r.prototype.signum=re,r.prototype.toByteArray=ye,r.prototype.equals=De,r.prototype.min=Fe,r.prototype.max=je,r.prototype.and=ze,r.prototype.or=be,r.prototype.xor=Pe,r.prototype.andNot=ke,r.prototype.not=ct,r.prototype.shiftLeft=at,r.prototype.shiftRight=ft,r.prototype.getLowestSetBit=ot,r.prototype.bitCount=bt,r.prototype.testBit=xt,r.prototype.setBit=ut,r.prototype.clearBit=tt,r.prototype.flip
227Bit=We,r.prototype.add=Ee,r.prototype.subtract=Ie,r.prototype.multiply=Oe,r.prototype.divide=ve,r.prototype.remainder=Te,r.prototype.divideAndRemainder=se,r.prototype.modPow=ir,r.prototype.modInverse=oi,r.prototype.pow=Pt,r.prototype.gcd=un,r.prototype.isProbablePrime=Aa,Zi}var Ji={exports:{}},es={exports:{}},e0;function Ea(){if(e0)return es.exports;e0=1;var e=nt();Fr(),pt();var t=es.exports=e.sha1=e.sha1||{};e.md.sha1=e.md.algorithms.sha1=t,t.create=function(){n||o();var i=null,a=e.util.createBuffer(),c=new Array(80),l={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength64=[];for(var f=l.messageLengthSize/4,y=0;y<f;++y)l.fullMessageLength.push(0);return a=e.util.createBuffer(),i={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},l},l.start(),l.update=function(f,y){y==="utf8"&&(f=e.util.encodeUtf8(f));var m=f.length;l.messageLength+=m,m=[m/4294967296>>>0,m>>>0];for(var d=l.fullMessageLength.length-1;d>=0;--d)l.fullMessageLength[d]+=m[1],m[1]=m[0]+(l.fullMessageLength[d]/4294967296>>>0),l.fullMessageLength[d]=l.fullMessageLength[d]>>>0,m[0]=m[1]/4294967296>>>0;return a.putBytes(f),s(i,c,a),(a.read>2048||a.length()===0)&&a.compact(),l},l.digest=function(){var f=e.util.createBuffer();f.putBytes(a.bytes());var y=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,m=y&l.blockLength-1;f.putBytes(r.substr(0,l.blockLength-m));for(var d,v,b=l.fullMessageLength[0]*8,S=0;S<l.fullMessageLength.length-1;++S)d=l.fullMessageLength[S+1]*8,v=d/4294967296>>>0,b+=v,f.putInt32(b>>>0),b=d>>>0;f.putInt32(b);var u={h0:i.h0,h1:i.h1,h2:i.h2,h3:i.h3,h4:i.h4};s(u,c,f);var C=e.util.createBuffer();return C.putInt32(u.h0),C.putInt32(u.h1),C.putInt32(u.h2),C.putInt32(u.h3),C.putInt32(u.h4),C},l};var r=null,n=!1;function o(){r="Â",r+=e.util.fillString("\0",64),n=!0}function s(i,a,c){for(var l,f,y,m,d,v,b,S,u=c.length();u>=64;){for(f=i.h0,y=i.h1,m=i.h2,d=i.h3,v=i.h4,S=0;S<16;++S)l=c.getInt32(),a[S]=l,b=d^y&(m^d),l=(f<<5|f>>>27)+b+v+1518500249+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;for(;S<20;++S)l=a[S-3]^a[S-8]^a[S-14]^a[S-16],l=l<<1|l>>>31,a[S]=l,b=d^y&(m^d),l=(f<<5|f>>>27)+b+v+1518500249+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;for(;S<32;++S)l=a[S-3]^a[S-8]^a[S-14]^a[S-16],l=l<<1|l>>>31,a[S]=l,b=y^m^d,l=(f<<5|f>>>27)+b+v+1859775393+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;for(;S<40;++S)l=a[S-6]^a[S-16]^a[S-28]^a[S-32],l=l<<2|l>>>30,a[S]=l,b=y^m^d,l=(f<<5|f>>>27)+b+v+1859775393+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;for(;S<60;++S)l=a[S-6]^a[S-16]^a[S-28]^a[S-32],l=l<<2|l>>>30,a[S]=l,b=y&m|d&(y^m),l=(f<<5|f>>>27)+b+v+2400959708+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;for(;S<80;++S)l=a[S-6]^a[S-16]^a[S-28]^a[S-32],l=l<<2|l>>>30,a[S]=l,b=y^m^d,l=(f<<5|f>>>27)+b+v+3395469782+l,v=d,d=m,m=(y<<30|y>>>2)>>>0,y=f,f=l;i.h0=i.h0+f|0,i.h1=i.h1+y|0,i.h2=i.h2+m|0,i.h3=i.h3+d|0,i.h4=i.h4+v|0,u-=64}}return es.exports}var t0;function Oh(){if(t0)return Ji.exports;t0=1;var e=nt();pt(),xr(),Ea();var t=Ji.exports=e.pkcs1=e.pkcs1||{};t.encode_rsa_oaep=function(n,o,s){var i,a,c,l;typeof s=="string"?(i=s,a=arguments[3]||void 0,c=arguments[4]||void 0):s&&(i=s.label||void 0,a=s.seed||void 0,c=s.md||void 0,s.mgf1&&s.mgf1.md&&(l=s.mgf1.md)),c?c.start():c=e.md.sha1.create(),l||(l=c);var f=Math.ceil(n.n.bitLength()/8),y=f-2*c.digestLength-2;if(o.length>y){var m=new Error("RSAES-OAEP input message length is too long.");throw m.length=o.length,m.maxLength=y,m}i||(i=""),c.update(i,"raw");for(var d=c.digest(),v="",b=y-o.length,S=0;S<b;S++)v+="\0";var u=d.getBytes()+v+"�"+o;if(!a)a=e.random.getBytes(c.digestLength);else if(a.length!==c.digestLength){var m=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw m.seedLength=a.length,m.digestLength=c.digestLength,m}var C=r(a,f-c.digestLength-1,l),x=e.util.xorBytes(u,C,u.length),I=r(x,c.digestLength,l),N=e.util.xorBytes(a,I,a.length);return"\0"+N+x},t.decode_rsa_oaep=function(n,o,s){var i,a,c;typeof s=="string"?(i=s,a=arguments[3]||void 0):s&&(i=s.label||void 0,a=s.md||void 0,s.mgf1&&s.mgf1.md&&(c=s.mgf1.md));var l=Math.ceil(n.n.bitLength()/8);if(o.length!==l){var x=new Error("RSAES-OAEP encoded message length is invali
227d.");throw x.length=o.length,x.expectedLength=l,x}if(a===void 0?a=e.md.sha1.create():a.start(),c||(c=a),l<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var f=a.digest().getBytes(),y=o.charAt(0),m=o.substring(1,a.digestLength+1),d=o.substring(1+a.digestLength),v=r(d,a.digestLength,c),b=e.util.xorBytes(m,v,m.length),S=r(b,l-a.digestLength-1,c),u=e.util.xorBytes(d,S,d.length),C=u.substring(0,a.digestLength),x=y!=="\0",I=0;I<a.digestLength;++I)x|=f.charAt(I)!==C.charAt(I);for(var N=1,E=a.digestLength,g=a.digestLength;g<u.length;g++){var p=u.charCodeAt(g),T=p&1^1,R=N?65534:0;x|=p&R,N=N&T,E+=N}if(x||u.charCodeAt(E)!==1)throw new Error("Invalid RSAES-OAEP padding.");return u.substring(E+1)};function r(n,o,s){s||(s=e.md.sha1.create());for(var i="",a=Math.ceil(o/s.digestLength),c=0;c<a;++c){var l=String.fromCharCode(c>>24&255,c>>16&255,c>>8&255,c&255);s.start(),s.update(n+l),i+=s.digest().getBytes()}return i.substring(0,o)}return Ji.exports}var Fa={exports:{}},r0;function _h(){if(r0)return Fa.exports;r0=1;var e=nt();return pt(),ri(),xr(),(function(){if(e.prime){Fa.exports=e.prime;return}var t=Fa.exports=e.prime=e.prime||{},r=e.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var s=function(m,d){return m|d};t.generateProbablePrime=function(m,d,v){typeof d=="function"&&(v=d,d={}),d=d||{};var b=d.algorithm||"PRIMEINC";typeof b=="string"&&(b={name:b}),b.options=b.options||{};var S=d.prng||e.random,u={nextBytes:function(C){for(var x=S.getBytesSync(C.length),I=0;I<C.length;++I)C[I]=x.charCodeAt(I)}};if(b.name==="PRIMEINC")return i(m,u,b.options,v);throw new Error("Invalid prime generation algorithm: "+b.name)};function i(m,d,v,b){return"workers"in v?l(m,d,v,b):a(m,d,v,b)}function a(m,d,v,b){var S=f(m,d),u=0,C=y(S.bitLength());"millerRabinTests"in v&&(C=v.millerRabinTests);var x=10;"maxBlockTime"in v&&(x=v.maxBlockTime),c(S,m,d,u,C,x,b)}function c(m,d,v,b,S,u,C){var x=+new Date;do{if(m.bitLength()>d&&(m=f(d,v)),m.isProbablePrime(S))return C(null,m);m.dAddOffset(n[b++%8],0)}while(u<0||+new Date-x<u);e.util.setImmediate(function(){c(m,d,v,b,S,u,C)})}function l(m,d,v,b){if(typeof Worker>"u")return a(m,d,v,b);var S=f(m,d),u=v.workers,C=v.workLoad||100,x=C*30/8,I=v.workerScript||"forge/prime.worker.js";if(u===-1)return e.util.estimateCores(function(E,g){E&&(g=2),u=g-1,N()});N();function N(){u=Math.max(1,u);for(var E=[],g=0;g<u;++g)E[g]=new Worker(I);for(var g=0;g<u;++g)E[g].addEventListener("message",T);var p=!1;function T(R){if(!p){var B=R.data;if(B.found){for(var P=0;P<E.length;++P)E[P].terminate();return p=!0,b(null,new r(B.prime,16))}S.bitLength()>m&&(S=f(m,d));var D=S.toString(16);R.target.postMessage({hex:D,workLoad:C}),S.dAddOffset(x,0)}}}}function f(m,d){var v=new r(m,d),b=m-1;return v.testBit(b)||v.bitwiseTo(r.ONE.shiftLeft(b),s,v),v.dAddOffset(31-v.mod(o).byteValue(),0),v}function y(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}})(),Fa.exports}var ts,n0;function ni(){if(n0)return ts;n0=1;var e=nt();if(Nr(),ri(),cn(),Oh(),_h(),xr(),pt(),typeof t>"u")var t=e.jsbn.BigInteger;var r=e.util.isNodejs?zl:null,n=e.asn1,o=e.util;e.pki=e.pki||{},ts=e.pki.rsa=e.rsa=e.rsa||{};var s=e.pki,i=[6,4,2,4,2,4,6,2],a={name:"PrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},c={name:"RSAPrivateKey",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,c
227onstructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},l={name:"RSAPublicKey",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},f=e.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},y={name:"DigestInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:n.Class.UNIVERSAL,type:n.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},m=function(g){var p;if(g.algorithm in s.oids)p=s.oids[g.algorithm];else{var T=new Error("Unknown message digest algorithm.");throw T.algorithm=g.algorithm,T}var R=n.oidToDer(p).getBytes(),B=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),P=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);P.value.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,R)),P.value.push(n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,""));var D=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,g.digest().getBytes());return B.value.push(P),B.value.push(D),n.toDer(B).getBytes()},d=function(g,p,T){if(T)return g.modPow(p.e,p.n);if(!p.p||!p.q)return g.modPow(p.d,p.n);p.dP||(p.dP=p.d.mod(p.p.subtract(t.ONE))),p.dQ||(p.dQ=p.d.mod(p.q.subtract(t.ONE))),p.qInv||(p.qInv=p.q.modInverse(p.p));var R;do R=new t(e.util.bytesToHex(e.random.getBytes(p.n.bitLength()/8)),16);while(R.compareTo(p.n)>=0||!R.gcd(p.n).equals(t.ONE));g=g.multiply(R.modPow(p.e,p.n)).mod(p.n);for(var B=g.mod(p.p).modPow(p.dP,p.p),P=g.mod(p.q).modPow(p.dQ,p.q);B.compareTo(P)<0;)B=B.add(p.p);
227var D=B.subtract(P).multiply(p.qInv).mod(p.p).multiply(p.q).add(P);return D=D.multiply(R.modInverse(p.n)).mod(p.n),D};s.rsa.encrypt=function(g,p,T){var R=T,B,P=Math.ceil(p.n.bitLength()/8);T!==!1&&T!==!0?(R=T===2,B=v(g,p,T)):(B=e.util.createBuffer(),B.putBytes(g));for(var D=new t(B.toHex(),16),U=d(D,p,R),_=U.toString(16),V=e.util.createBuffer(),z=P-Math.ceil(_.length/2);z>0;)V.putByte(0),--z;return V.putBytes(e.util.hexToBytes(_)),V.getBytes()},s.rsa.decrypt=function(g,p,T,R){var B=Math.ceil(p.n.bitLength()/8);if(g.length!==B){var P=new Error("Encrypted message length is invalid.");throw P.length=g.length,P.expected=B,P}var D=new t(e.util.createBuffer(g).toHex(),16);if(D.compareTo(p.n)>=0)throw new Error("Encrypted message is invalid.");for(var U=d(D,p,T),_=U.toString(16),V=e.util.createBuffer(),z=B-Math.ceil(_.length/2);z>0;)V.putByte(0),--z;return V.putBytes(e.util.hexToBytes(_)),R!==!1?b(V.getBytes(),p,T):V.getBytes()},s.rsa.createKeyPairGenerationState=function(g,p,T){typeof g=="string"&&(g=parseInt(g,10)),g=g||2048,T=T||{};var R=T.prng||e.random,B={nextBytes:function(U){for(var _=R.getBytesSync(U.length),V=0;V<U.length;++V)U[V]=_.charCodeAt(V)}},P=T.algorithm||"PRIMEINC",D;if(P==="PRIMEINC")D={algorithm:P,state:0,bits:g,rng:B,eInt:p||65537,e:new t(null),p:null,q:null,qBits:g>>1,pBits:g-(g>>1),pqState:0,num:null,keys:null},D.e.fromInt(D.eInt);else throw new Error("Invalid key generation algorithm: "+P);return D},s.rsa.stepKeyPairGenerationState=function(g,p){"algorithm"in g||(g.algorithm="PRIMEINC");var T=new t(null);T.fromInt(30);for(var R=0,B=function(q,G){return q|G},P=+new Date,D,U=0;g.keys===null&&(p<=0||U<p);){if(g.state===0){var _=g.p===null?g.pBits:g.qBits,V=_-1;
227g.pqState===0?(g.num=new t(_,g.rng),g.num.testBit(V)||g.num.bitwiseTo(t.ONE.shiftLeft(V),B,g.num),g.num.dAddOffset(31-g.num.mod(T).byteValue(),0),R=0,++g.pqState):g.pqState===1?g.num.bitLength()>_?g.pqState=0:g.num.isProbablePrime(C(g.num.bitLength()))?++g.pqState:g.num.dAddOffset(i[R++%8],0):g.pqState===2?g.pqState=g.num.subtract(t.ONE).gcd(g.e).compareTo(t.ONE)===0?3:0:g.pqState===3&&(g.pqState=0,g.p===null?g.p=g.num:g.q=g.num,g.p!==null&&g.q!==null&&++g.state,g.num=null)}else if(g.state===1)g.p.compareTo(g.q)<0&&(g.num=g.p,g.p=g.q,g.q=g.num),++g.state;else if(g.state===2)g.p1=g.p.subtract(t.ONE),g.q1=g.q.subtract(t.ONE),g.phi=g.p1.multiply(g.q1),++g.state;else if(g.state===3)g.phi.gcd(g.e).compareTo(t.ONE)===0?++g.state:(g.p=null,g.q=null,g.state=0);else if(g.state===4)g.n=g.p.multiply(g.q),g.n.bitLength()===g.bits?++g.state:(g.q=null,g.state=0);else if(g.state===5){var z=g.e.modInverse(g.phi);g.keys={privateKey:s.rsa.setPrivateKey(g.n,g.e,z,g.p,g.q,z.mod(g.p1),z.mod(g.q1),g.q.modInverse(g.p)),publicKey:s.rsa.setPublicKey(g.n,g.e)}}D=+new Date,U+=D-P,P=D}return g.keys!==null},s.rsa.generateKeyPair=function(g,p,T,R){if(arguments.length===1?typeof g=="object"?(T=g,g=void 0):typeof g=="function"&&(R=g,g=void 0):arguments.length===2?typeof g=="number"?typeof p=="function"?(R=p,p=void 0):typeof p!="number"&&(T=p,p=void 0):(T=g,R=p,g=void 0,p=void 0):arguments.length===3&&(typeof p=="number"?typeof T=="function"&&(R=T,T=void 0):(R=T,T=p,p=void 0)),T=T||{},g===void 0&&(g=T.bits||2048),p===void 0&&(p=T.e||65537),!e.options.usePureJavaScript&&!T.prng&&g>=256&&g<=16384&&(p===65537||p===3)){if(R){if(x("generateKeyPair"))return r.generateKeyPair("rsa",{modulusLength:g,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(U,_,V){if(U)return R(U);R(null,{privateKey:s.privateKeyFromPem(V),publicKey:s.publicKeyFromPem(_)})});if(I("generateKey")&&I("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:g,publicExponent:E(p),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(U){return o.globalScope.crypto.subtle.exportKey("pkcs8",U.privateKey)}).then(void 0,function(U){R(U)}).then(function(U){if(U){var _=s.privateKeyFromAsn1(n.fromDer(e.util.createBuffer(U)));R(null,{privateKey:_,publicKey:s.setRsaPublicKey(_.n,_.e)})}});if(N("generateKey")&&N("exportKey")){var B=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:g,publicExponent:E(p),hash:{name:"SHA-256"}},!0,["sign","verify"]);B.oncomplete=function(U){var _=U.target.result,V=o.globalScope.msCrypto.subtle.exportKey("pkcs8",_.privateKey);V.oncomplete=function(z){var q=z.target.result,G=s.privateKeyFromAsn1(n.fromDer(e.util.createBuffer(q)));R(null,{privateKey:G,publicKey:s.setRsaPublicKey(G.n,G.e)})},V.onerror=function(z){R(z)}},B.onerror=function(U){R(U)};return}}else if(x("generateKeyPairSync")){var P=r.generateKeyPairSync("rsa",{modulusLength:g,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:s.privateKeyFromPem(P.privateKey),publicKey:s.publicKeyFromPem(P.publicKey)}}}var D=s.rsa.createKeyPairGenerationState(g,p,T);if(!R)return s.rsa.stepKeyPairGenerationState(D,0),D.keys;S(D,T,R)},s.setRsaPublicKey=s.rsa.setPublicKey=function(g,p){var T={n:g,e:p};return T.encrypt=function(R,B,P){if(typeof B=="string"?B=B.toUpperCase():B===void 0&&(B="RSAES-PKCS1-V1_5"),B==="RSAES-PKCS1-V1_5")B={encode:function(U,_,V){return v(U,_,2).getBytes()}};else if(B==="RSA-OAEP"||B==="RSAES-OAEP")B={encode:function(U,_){return e.pkcs1.encode_rsa_oaep(_,U,P)}};else if(["RAW","NONE","NULL",null].indexOf(B)!==-1)B={encode:function(U){return U}};else if(typeof B=="string")throw new Error('Unsupported encryption scheme: "'+B+'".');var D=B.encode(R,T,!0);return s.rsa.encrypt(D,T,!0)},T.verify=function(R,B,P,D){typeof P=="string"?P=P.toUpperCase():P===void 0&&(P="RSASSA-PKCS1-V1_5"),D===void 0&&(D={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in D||(D._parseAllDigestBytes=!0),P==="RSASSA-PKCS1-V1_5"?P={verify:function(_,V){V=b(V,T,!0);var z=n.fromDer(V,{parseAllBytes:D._parseAllDigestBytes}),q={},G=[];if(!n.validate(z,y,q,G)){var Y=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw Y.errors=G,Y}var ee=n.derToOid(q.algorithmIdentifier);if(!(ee===e.oids.md2||ee===e.oids.md5||ee===e.oids.sha1||ee===e.oids.sha224||ee===e.oids.sha256||ee===e.oids.sha384||ee===e.oids.sha512||ee===e.oids["sha512-224"]||ee===e.oids["sha512-256"])){var Y=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw Y.oid=ee,Y}if((ee===e.oids.md2||ee===e.oids.md5)&&!("parameters"in q))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return _===q.digest}}:(P==="NONE"||P==="NULL"||P===null)&&(P={verify:function(_,V){return V=b(V,T,!0),_===V}});var U=s.rsa.decrypt(B,T,!0,!1);return P.verify(R,U,T.n.bitLength())},T},s.setRsaPrivateKey=s.rsa.setPrivateKey=function(g,p,T,R,B,P,D,U){var _={n:g,e:p,d:T,p:R,q:B,dP:P,dQ:D,qInv:U};return _.decrypt=function(V,z,q){typeof z=="string"?z=z.toUpperCase():z===void 0&&(z="RSAES-PKCS1-V1_5");var G=s.rsa.decrypt(V,_,!1,!1);if(z==="RSAES-PKCS1-V1_5")z={decode:b};else if(z==="RSA-OAEP"||z==="RSAES-OAEP")z={decode:function(Y,ee){return e.pkcs1.decode_rsa_oaep(ee,Y,q)}};else if(["RAW","NONE","NULL",null].indexOf(z)!==-1)z={decode:function(Y){return Y}};else throw new Error('Unsupported encryption scheme: "'+z+'".');return z.decode(G,_,!1)},_.sign=function(V,z){var q=!1;typeof z=="string"&&(z=z.toUpperCase()),z===void 0||z==="RSASSA-PKCS1-V1_5"?(z={encode:m},q=1):(z==="NONE"||z==="NULL"||z===null)&&(z={encode:function(){return V}},q=1);var G=z.encode(V,_.n.bitLength());
227return s.rsa.encrypt(G,_,q)},_},s.wrapRsaPrivateKey=function(g){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(0).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.oids.rsaEncryption).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(g).getBytes())])},s.privateKeyFromAsn1=function(g){var p={},T=[];if(n.validate(g,a,p,T)&&(g=n.fromDer(e.util.createBuffer(p.privateKey))),p={},T=[],!n.validate(g,c,p,T)){var R=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw R.errors=T,R}var B,P,D,U,_,V,z,q;return B=e.util.createBuffer(p.privateKeyModulus).toHex(),P=e.util.createBuffer(p.privateKeyPublicExponent).toHex(),D=e.util.createBuffer(p.privateKeyPrivateExponent).toHex(),U=e.util.createBuffer(p.privateKeyPrime1).toHex(),_=e.util.createBuffer(p.privateKeyPrime2).toHex(),V=e.util.createBuffer(p.privateKeyExponent1).toHex(),z=e.util.createBuffer(p.privateKeyExponent2).toHex(),q=e.util.createBuffer(p.privateKeyCoefficient).toHex(),s.setRsaPrivateKey(new t(B,16),new t(P,16),new t(D,16),new t(U,16),new t(_,16),new t(V,16),new t(z,16),new t(q,16))},s.privateKeyToAsn1=s.privateKeyToRSAPrivateKey=function(g){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(0).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.n)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.e)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.d)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.p)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.q)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.dP)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.dQ)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.qInv))])},s.publicKeyFromAsn1=function(g){var p={},T=[];if(n.validate(g,f,p,T)){var R=n.derToOid(p.publicKeyOid);if(R!==s.oids.rsaEncryption){var B=new Error("Cannot read public key. Unknown OID.");throw B.oid=R,B}g=p.rsaPublicKey}if(T=[],!n.validate(g,l,p,T)){var B=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw B.errors=T,B}var P=e.util.createBuffer(p.publicKeyModulus).toHex(),D=e.util.createBuffer(p.publicKeyExponent).toHex();return s.setRsaPublicKey(new t(P,16),new t(D,16))},s.publicKeyToAsn1=s.publicKeyToSubjectPublicKeyInfo=function(g){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.oids.rsaEncryption).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,[s.publicKeyToRSAPublicKey(g)])])},s.publicKeyToRSAPublicKey=function(g){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.n)),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u(g.e))])};function v(g,p,T){var R=e.util.createBuffer(),B=Math.ceil(p.n.bitLength()/8);if(g.length>B-11){var P=new Error("Message is too long for PKCS#1 v1.5 padding.");throw P.length=g.length,P.max=B-11,P}R.putByte(0),R.putByte(T);var D=B-3-g.length,U;if(T===0||T===1){U=T===0?0:255;for(var _=0;_<D;++_)R.putByte(U)}else for(;D>0;){for(var V=0,z=e.random.getBytes(D),_=0;_<D;++_)U=z.charCodeAt(_),U===0?++V:R.putByte(U);D=V}return R.putByte(0),R.putBytes(g),R}function b(g,p,T,R){var B=Math.ceil(p.n.bitLength()/8),P=e.util.createBuffer(g),D=P.getByte(),U=P.getByte();if(D!==0||T&&U!==0&&U!==1||!T&&U!=2||T&&U===0&&typeof R>"u")throw new Error("Encryption block is invalid.");var _=0;if(U===0){_=B-3-R;for(var V=0;V<_;++V)if(P.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(U===1)for(_=0;P.length()>1;){if(P.getByte()!==255){--P.read;break}++_}else if(U===2)for(_=0;P.length()>1;){if(P.getByte()===0){--P.read;break}++_}var z=P.getByte();if(z!==0||_!==B-3-P.length())throw new Error("Encryption block is invalid.");return P.getBytes()}function S(g,p,T){typeof p=="function"&&(T=p,p={}),p=p||{};var R={algorithm:{name:p.algorithm||"PRIMEINC",options:{workers:p.workers||2,workLoad:p.workLoad||100,workerScript:p.workerScript}}};
227"prng"in p&&(R.prng=p.prng),B();function B(){P(g.pBits,function(U,_){if(U)return T(U);if(g.p=_,g.q!==null)return D(U,g.q);P(g.qBits,D)})}function P(U,_){e.prime.generateProbablePrime(U,R,_)}function D(U,_){if(U)return T(U);if(g.q=_,g.p.compareTo(g.q)<0){var V=g.p;g.p=g.q,g.q=V}if(g.p.subtract(t.ONE).gcd(g.e).compareTo(t.ONE)!==0){g.p=null,B();return}if(g.q.subtract(t.ONE).gcd(g.e).compareTo(t.ONE)!==0){g.q=null,P(g.qBits,D);return}if(g.p1=g.p.subtract(t.ONE),g.q1=g.q.subtract(t.ONE),g.phi=g.p1.multiply(g.q1),g.phi.gcd(g.e).compareTo(t.ONE)!==0){g.p=g.q=null,B();return}if(g.n=g.p.multiply(g.q),g.n.bitLength()!==g.bits){g.q=null,P(g.qBits,D);return}var z=g.e.modInverse(g.phi);g.keys={privateKey:s.rsa.setPrivateKey(g.n,g.e,z,g.p,g.q,z.mod(g.p1),z.mod(g.q1),g.q.modInverse(g.p)),publicKey:s.rsa.setPublicKey(g.n,g.e)},T(null,g.keys)}}function u(g){var p=g.toString(16);p[0]>="8"&&(p="00"+p);var T=e.util.hexToBytes(p);return T.length>1&&(T.charCodeAt(0)===0&&(T.charCodeAt(1)&128)===0||T.charCodeAt(0)===255&&(T.charCodeAt(1)&128)===128)?T.substr(1):T}function C(g){return g<=100?27:g<=150?18:g<=200?15:g<=250?12:g<=300?9:g<=350?8:g<=400?7:g<=500?6:g<=600?5:g<=800?4:g<=1250?3:2}function x(g){return e.util.isNodejs&&typeof r[g]=="function"}function I(g){return typeof o.globalScope<"u"&&typeof o.globalScope.crypto=="object"&&typeof o.globalScope.crypto.subtle=="object"&&typeof o.globalScope.crypto.subtle[g]=="function"}function N(g){return typeof o.globalScope<"u"&&typeof o.globalScope.msCrypto=="object"&&typeof o.globalScope.msCrypto.subtle=="object"&&typeof o.globalScope.msCrypto.subtle[g]=="function"}function E(g){for(var p=e.util.hexToBytes(g.toString(16)),T=new Uint8Array(p.length),R=0;R<p.length;++R)T[R]=p.charCodeAt(R);return T}return ts}var rs,a0;function kh(){if(a0)return rs;a0=1;var e=nt();if(ln(),Nr(),ti(),Fr(),cn(),Ec(),kn(),xr(),$h(),ni(),pt(),typeof t>"u")var t=e.jsbn.BigInteger;var r=e.asn1,n=e.pki=e.pki||{};rs=n.pbe=e.pbe=e.pbe||{};var o=n.oids,s={name:"EncryptedPrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},i={name:"PBES2Algorithms",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},a={name:"pkcs-12PbeParams",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParam
227s.salt",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"iterations"}]};n.encryptPrivateKeyInfo=function(m,d,v){v=v||{},v.saltSize=v.saltSize||8,v.count=v.count||2048,v.algorithm=v.algorithm||"aes128",v.prfAlgorithm=v.prfAlgorithm||"sha1";var b=e.random.getBytesSync(v.saltSize),S=v.count,u=r.integerToDer(S),C,x,I;if(v.algorithm.indexOf("aes")===0||v.algorithm==="des"){var N,E,g;switch(v.algorithm){case"aes128":C=16,N=16,E=o["aes128-CBC"],g=e.aes.createEncryptionCipher;break;case"aes192":C=24,N=16,E=o["aes192-CBC"],g=e.aes.createEncryptionCipher;break;case"aes256":C=32,N=16,E=o["aes256-CBC"],g=e.aes.createEncryptionCipher;break;case"des":C=8,N=8,E=o.desCBC,g=e.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=v.algorithm,p}var T="hmacWith"+v.prfAlgorithm.toUpperCase(),R=f(T),B=e.pkcs5.pbkdf2(d,b,S,C,R),P=e.random.getBytesSync(N),D=g(B);D.start(P),D.update(r.toDer(m)),D.finish(),I=D.output.getBytes();var U=y(b,u,C,T);x=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(o.pkcs5PBES2).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(o.pkcs5PBKDF2).getBytes()),U]),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(E).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,P)])])])}else if(v.algorithm==="3des"){C=24;var _=new e.util.ByteBuffer(b),B=n.pbe.generatePkcs12Key(d,_,1,S,C),P=n.pbe.generatePkcs12Key(d,_,2,S,C),D=e.des.createEncryptionCipher(B);D.start(P),D.update(r.toDer(m)),D.finish(),I=D.output.getBytes(),x=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,b),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,u.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=v.algorithm,p}var V=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[x,r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,I)]);return V},n.decryptPrivateKeyInfo=function(m,d){var v=null,b={},S=[];if(!r.validate(m,s,b,S)){var u=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=S,u}var C=r.derToOid(b.encryptionOid),x=n.pbe.getCipher(C,b.encryptionParams,d),I=e.util.createBuffer(b.encryptedData);return x.update(I),x.finish()&&(v=r.fromDer(x.output)),v},n.encryptedPrivateKeyToPem=function(m,d){var v={type:"ENCRYPTED PRIVATE KEY",body:r.toDer(m).getBytes()};return e.pem.encode(v,{maxline:d})},n.encryptedPrivateKeyFromPem=function(m){var d=e.pem.decode(m)[0];if(d.type!=="ENCRYPTED PRIVATE KEY"){var v=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw v.headerType=d.type,v}if(d.procType&&d.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return r.fromDer(d.body)},n.encryptRsaPrivateKey=function(m,d,v){if(v=v||{},!v.legacy){var b=n.wrapRsaPrivateKey(n.privateKeyToAsn1(m));return b=n.encryptPrivateKeyInfo(b,d,v),n.encryptedPrivateKeyToPem(b)}var S,u,C,x;switch(v.algorithm){case"aes128":S="AES-128-CBC",C=16,u=e.random.getBytesSync(16),x=e.aes.createEncryptionCipher;break;case"aes192":S="AES-192-CBC",C=24,u=e.random.getBytesSync(16),x=e.aes.createEncryptionCipher;break;case"aes256":S="AES-256-CBC",C=32,u=e.random.getBytesSync(16),x=e.aes.createEncryptionCipher;break;case"3des":S="DES-EDE3-CBC",C=24,u=e.random.getBytesSync(8),x=e.des.createEncryptionCipher;break;case"des":S="DES-CBC",C=8,u=e.random.getBytesSync(8),x=e.des.createEncryptionCipher;break;default:var I=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+v.algorithm+'".');throw I.algorithm=v.algorithm,I}var N=e.pbe.opensslDeriveBytes(d,u.substr(0,8),C),E=x(N);E.start(u),E.update(r.toDer(n.privateKeyToAsn1(m))),E.finish();var g={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:S,parameters:e.util.bytesToHex(u).toUpperCase()},body:E.output.getBytes()};return e.pem.encode(g)},n.decryptRsaPrivateKey=function(m,d){var v=null,b=e.pem.decode(m)[0];if(b.type!=="ENCRYPTED PRIVATE KEY"&&b.type!=="PRIVATE KEY"&&b.type!=="RSA PRIVATE KEY"){var S=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw S.headerType=S,S}if(b.procType&&b.procType.type==="ENCRYPTED"){var u,C;switch(b.dekInfo.algorithm){case"DES-CBC":u=8,C=e.des.createDecryptionCipher;break;case"DES-EDE3-CBC":u=24,C=e.des.createDecryptionCipher;break;case"AES-128-CBC":u=16,C=e.aes.createDecryptionCipher;break;case"AES-192-CBC":u=24,C=e.aes.createDecryptionCipher;break;case"AES-256-CBC":u=32,C=e.aes.createDecryptionCipher;break;case"RC2-40-CBC":u=5,C=function(g){return e.rc2.createDecryptionCipher(g,40)};break;case"RC2-64-CBC":u=8,C=function(g){return e.rc2.createDecryptionCipher(g,64)};break;case"RC2-128-CBC":u=16,C=function(g){return e.rc2.createDecryptionCipher(g,128)};break;default:var S=new Error('Could not decrypt private key; unsupported encryption algorithm "'+b.dekInfo.algorithm+'".');throw S.algorithm=b.dekInfo.algorithm,S}var x=e.util.hexToBytes(b.dekInfo.parameters),I=e.pbe.opensslDeriveBytes(d,x.substr(0,8),u),N=C(I);if(N.start(x),N.update(e.util.createBuffer(b.body)),N.finish())v=N.output.getBytes();else return v}else v=b.body;return b.type==="ENCRYPTED PRIVATE KEY"?v=n.decryptPrivateKeyInfo(r.fromDer(v),d):v=r.fromDer(v),v!==null&&(v=n.privateKeyFromAsn1(v)),v},n.pbe.generatePkcs12Key=function(m,d,v,b,S,u){var C,x;if(typeof u>"u"||u===null){if(!("sha1"in e.md))throw new Error('"sha1" hash algorithm unavailable.');u=e.md.sha1.create()}var I=u.digestLength,N=u.blockLength,E=new e.util.ByteBuffer,g=new e.util.ByteBuffer;if(m!=null){for(x=0;x<m.length;x++)g.putInt16(m.charCodeAt(x));g.putInt16(0)}var p=g.length(),T=d.length(),R=new e.util.ByteBuffer;R.fillWithByte(v,N);var B=N*Math.ceil(T/N),P=new e.util.ByteBuffer;for(x=0;x<B;x++)P.putByte(d.at(x%T));var D=N*Math.ceil(p/N),U=new e.util.ByteBuffer;for(x=0;x<D;x++)U.putByte(g.at(x%p));var _=P;_.putBuffer(U);for(var V=Math.ceil(S/I),z=1;z<=V;z++){var q=new e.util.ByteBuffer;q.putBytes(R.bytes()),q.putBytes(_.bytes());for(var G=0;G<b;G++)u.start(),u.update(q.getBytes()),q=u.digest();var Y=new e.util.ByteBuffer;for(x=0;x<N;x++)Y.putByte(q.at(x%I));var ee=Math.ceil(T/N)+Math.ceil(p/N),J=new e.util.ByteBuffer;for(C=0;C<ee;C++){var te=new e.util.ByteBuffer(_.getBytes(N)),Q=511;for(x=Y.length()-1;x>=0;x--)Q=Q>>8,Q+=Y.at(x)+te.at(x),te.setAt(x,Q&255);J.putBuffer(te)}_=J,E.putBuffer(q)}return E.truncate(E.length()-S),E},n.pbe.getCipher=function(m,d,v){switch(m){case n.oids.pkcs5PBES2:return n.pbe.getCipherForPBES2(m,d,v);case n.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case n.oids["pbewithSHAAnd40BitRC2-CBC"]:return n.pbe.getCipherForPKCS12PBE(m,d,v);default:var b=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw b.oid=m,b.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],b}},n.pbe.getCipherForPBES2=function(m,d,v){var b={},S=[];if(!r.validate(d,i,b,S)){var u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=S,u}if(m=r.derToOid(b.kdfOid),m!==n.oids.pkcs5PBKDF2){var u=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw u.oid=m,u.supportedOids=["pkcs5PBKDF2"],u}if(m=r.derToOid(b.encOid),m!==n.oids["aes128-CBC"]&&m!==n.oids["aes192-CBC"]&&m!==n.oids["aes256-CBC"]&&m!==n.oids["des-EDE3-CBC"]&&m!==n.oids.desCBC){var u=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw u.oid=m,u.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],u}var C=b.kdfSalt,x=e.util.createBuffer(b.kdfIterationCount);x=x.getInt(x.length()<<3);var I,N;switch(n.oids[m]){case"aes128-CBC":I=16,N=e.aes.createDecryptionCipher;break;case"aes192-CBC":I=24,N=e.aes.createDecryptionCipher;break;case"aes256-CBC":I=32,N=e.aes.createDecryptionCipher;break;
227case"des-EDE3-CBC":I=24,N=e.des.createDecryptionCipher;break;case"desCBC":I=8,N=e.des.createDecryptionCipher;break}var E=l(b.prfOid),g=e.pkcs5.pbkdf2(v,C,x,I,E),p=b.encIv,T=N(g);return T.start(p),T},n.pbe.getCipherForPKCS12PBE=function(m,d,v){var b={},S=[];if(!r.validate(d,a,b,S)){var u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=S,u}var C=e.util.createBuffer(b.salt),x=e.util.createBuffer(b.iterations);x=x.getInt(x.length()<<3);var I,N,E;switch(m){case n.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:I=24,N=8,E=e.des.startDecrypting;break;case n.oids["pbewithSHAAnd40BitRC2-CBC"]:I=5,N=8,E=function(B,P){var D=e.rc2.createDecryptionCipher(B,40);return D.start(P,null),D};break;default:var u=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw u.oid=m,u}var g=l(b.prfOid),p=n.pbe.generatePkcs12Key(v,C,1,x,I,g);g.start();var T=n.pbe.generatePkcs12Key(v,C,2,x,N,g);return E(p,T)},n.pbe.opensslDeriveBytes=function(m,d,v,b){if(typeof b>"u"||b===null){if(!("md5"in e.md))throw new Error('"md5" hash algorithm unavailable.');b=e.md.md5.create()}d===null&&(d="");for(var S=[c(b,m+d)],u=16,C=1;u<v;++C,u+=16)S.push(c(b,S[C-1]+m+d));return S.join("").substr(0,v)};function c(m,d){return m.start().update(d).digest().getBytes()}function l(m){var d;if(!m)d="hmacWithSHA1";else if(d=n.oids[r.derToOid(m)],!d){var v=new Error("Unsupported PRF OID.");throw v.oid=m,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}return f(d)}function f(m){var d=e.md;switch(m){case"hmacWithSHA224":d=e.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":m=m.substr(8).toLowerCase();break;default:var v=new Error("Unsupported PRF algorithm.");throw v.algorithm=m,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}if(!d||!(m in d))throw new Error("Unknown hash algorithm: "+m);return d[m].create()}function y(m,d,v,b){var S=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,m),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,d.getBytes())]);return b!=="hmacWithSHA1"&&S.value.push(r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,e.util.hexToBytes(v.toString(16))),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(n.oids[b]).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])),S}return rs}var ns={exports:{}},as={exports:{}},o0;function Vh(){if(o0)return as.exports;o0=1;var e=nt();Nr(),pt();var t=e.asn1,r=as.exports=e.pkcs7asn1=e.pkcs7asn1||{};e.pkcs7=e.pkcs7||{},e.pkcs7.asn1=r;var n={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};r.contentInfoValidator=n;var o={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};r.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},r.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,c
227onstructed:!1,capture:"version"}].concat(o)};var s={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};return r.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},n,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[s]}]},r.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]},as.exports}var os={exports:{}},is={exports:{}},i0;function Fh(){if(i0)return is.exports;i0=1;var e=nt();pt(),e.mgf=e.mgf||{};var t=is.exports=e.mgf.mgf1=e.mgf1=e.mgf1||{};return t.create=function(r){var n={generate:function(o,s){for(var i=new e.util.ByteBuffer,a=Math.ceil(s/r.digestLength),c=0;c<a;c++){var l=new e.util.ByteBuffer;l.putInt32(c),r.start(),r.update(o+l.getBytes()),i.putBuffer(r.digest())}return i.truncate(i.length()-s),i.getBytes()}};return n},is.exports}var ss,s0;function $E(){if(s0)return ss;s0=1;var e=nt();return Fh(),ss=e.mgf=e.mgf||{},e.mgf.mgf1=e.mgf1,ss}var ls={exports:{}},l0;function wc(){if(l0)return ls.exports;l0=1;var e=nt();xr(),pt();var t=ls.exports=e.pss=e.pss||{};return t.create=function(r){arguments.length===3&&(r={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var n=r.md,o=r.mgf,s=n.digestLength,i=r.salt||null;typeof i=="string"&&(i=e.util.createBuffer(i));var a;if("saltLength"in r)a=r.saltLength;else if(i!==null)a=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==a)throw new Error("Given salt length does not match length of given salt.");var c=r.prng||e.random,l={};return l.encode=function(f,y){var m,d=y-1,v=Math.ceil(d/8),b=f.digest().getBytes();if(v<s+a+2)throw new Error("Message is too long to encrypt.");var S;i===null?S=c.getBytesSync(a):S=i.bytes();var u=new e.util.ByteBuffer;u.fillWithByte(0,8),u.putBytes(b),u.putBytes(S),n.start(),n.update(u.getBytes());var C=n.digest().getBytes(),x=new e.util.ByteBuffer;x.fillWithByte(0,v-a-s-2),x.putByte(1),x.putBytes(S);var I=x.getBytes(),N=v-s-1,E=o.generate(C,N),g="";for(m=0;m<N;
227m++)g+=String.fromCharCode(I.charCodeAt(m)^E.charCodeAt(m));var p=65280>>8*v-d&255;return g=String.fromCharCode(g.charCodeAt(0)&~p)+g.substr(1),g+C+"¼"},l.verify=function(f,y,m){var d,v=m-1,b=Math.ceil(v/8);if(y=y.substr(-b),b<s+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(y.charCodeAt(b-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var S=b-s-1,u=y.substr(0,S),C=y.substr(S,s),x=65280>>8*b-v&255;if((u.charCodeAt(0)&x)!==0)throw new Error("Bits beyond keysize not zero as expected.");var I=o.generate(C,S),N="";for(d=0;d<S;d++)N+=String.fromCharCode(u.charCodeAt(d)^I.charCodeAt(d));N=String.fromCharCode(N.charCodeAt(0)&~x)+N.substr(1);var E=b-s-a-2;for(d=0;d<E;d++)if(N.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(N.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var g=N.substr(-a),p=new e.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(g),n.start(),n.update(p.getBytes());var T=n.digest().getBytes();return C===T},l},ls.exports}var c0;function Ic(){if(c0)return os.exports;c0=1;var e=nt();ln(),Nr(),ti(),Fr(),$E(),cn(),kn(),wc(),ni(),pt();var t=e.asn1,r=os.exports=e.pki=e.pki||{},n=r.oids,o={};o.CN=n.commonName,o.commonName="CN",o.C=n.countryName,o.countryName="C",o.L=n.localityName,o.localityName="L",o.ST=n.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=n.organizationName,o.organizationName="O",o.OU=n.organizationalUnitName,o.organizationalUnitName="OU",o.E=n.emailAddress,o.emailAddress="E";var s=e.pki.rsa.publicKeyValidator,i={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},s,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParam
227s"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},a={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},c={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},s,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},l={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[c,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};r.RDNAttributesAsArray=function(E,g){for(var p=[],T,R,B,P=0;P<E.value.length;++P){T=E.value[P];for(var D=0;D<T.value.length;++D)B={},R=T.value[D],B.type=t.derToOid(R.value[0].value),B.value=R.value[1].value,B.valueTagClass=R.value[1].type,B.type in n&&
227(B.name=n[B.type],B.name in o&&(B.shortName=o[B.name])),g&&(g.update(B.type),g.update(B.value)),p.push(B)}return p},r.CRIAttributesAsArray=function(E){for(var g=[],p=0;p<E.length;++p)for(var T=E[p],R=t.derToOid(T.value[0].value),B=T.value[1].value,P=0;P<B.length;++P){var D={};if(D.type=R,D.value=B[P].value,D.valueTagClass=B[P].type,D.type in n&&(D.name=n[D.type],D.name in o&&(D.shortName=o[D.name])),D.type===n.extensionRequest){D.extensions=[];for(var U=0;U<D.value.length;++U)D.extensions.push(r.certificateExtensionFromAsn1(D.value[U]))}g.push(D)}return g};function f(E,g){typeof g=="string"&&(g={shortName:g});for(var p=null,T,R=0;p===null&&R<E.attributes.length;++R)T=E.attributes[R],(g.type&&g.type===T.type||g.name&&g.name===T.name||g.shortName&&g.shortName===T.shortName)&&(p=T);return p}var y=function(E,g,p){var T={};if(E!==n["RSASSA-PSS"])return T;p&&(T={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},saltLength:20});var R={},B=[];if(!t.validate(g,a,R,B)){var P=new Error("Cannot read RSASSA-PSS parameter block.");throw P.errors=B,P}return R.hashOid!==void 0&&(T.hash=T.hash||{},T.hash.algorithmOid=t.derToOid(R.hashOid)),R.maskGenOid!==void 0&&(T.mgf=T.mgf||{},T.mgf.algorithmOid=t.derToOid(R.maskGenOid),T.mgf.hash=T.mgf.hash||{},T.mgf.hash.algorithmOid=t.derToOid(R.maskGenHashOid)),R.saltLength!==void 0&&(T.saltLength=R.saltLength.charCodeAt(0)),T},m=function(E){switch(n[E.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return e.md.sha1.create();case"md5WithRSAEncryption":return e.md.md5.create();case"sha256WithRSAEncryption":return e.md.sha256.create();case"sha384WithRSAEncryption":return e.md.sha384.create();case"sha512WithRSAEncryption":return e.md.sha512.create();case"RSASSA-PSS":return e.md.sha256.create();default:var g=new Error("Could not compute "+E.type+" digest. Unknown signature OID.");throw g.signatureOid=E.signatureOid,g}},d=function(E){var g=E.certificate,p;switch(g.signatureOid){case n.sha1WithRSAEncryption:case n.sha1WithRSASignature:break;case n["RSASSA-PSS"]:var T,R;if(T=n[g.signatureParameters.mgf.hash.algorithmOid],T===void 0||e.md[T]===void 0){var B=new Error("Unsupported MGF hash function.");throw B.oid=g.signatureParameters.mgf.hash.algorithmOid,B.name=T,B}if(R=n[g.signatureParameters.mgf.algorithmOid],R===void 0||e.mgf[R]===void 0){var B=new Error("Unsupported MGF function.");throw B.oid=g.signatureParameters.mgf.algorithmOid,B.name=R,B}if(R=e.mgf[R].create(e.md[T].create()),T=n[g.signatureParameters.hash.algorithmOid],T===void 0||e.md[T]===void 0){var B=new Error("Unsupported RSASSA-PSS hash function.");throw B.oid=g.signatureParameters.hash.algorithmOid,B.name=T,B}p=e.pss.create(e.md[T].create(),R,g.signatureParameters.saltLength);break}return g.publicKey.verify(E.md.digest().getBytes(),E.signature,p)};r.certificateFromPem=function(E,g,p){var T=e.pem.decode(E)[0];if(T.type!=="CERTIFICATE"&&T.type!=="X509 CERTIFICATE"&&T.type!=="TRUSTED CERTIFICATE"){var R=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw R.headerType=T.type,R}if(T.procType&&T.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var B=t.fromDer(T.body,p);return r.certificateFromAsn1(B,g)},r.certificateToPem=function(E,g){var p={type:"CERTIFICATE",body:t.toDer(r.certificateToAsn1(E)).getBytes()};return e.pem.encode(p,{maxline:g})},r.publicKeyFromPem=function(E){var g=e.pem.decode(E)[0];if(g.type!=="PUBLIC KEY"&&g.type!=="RSA PUBLIC KEY"){var p=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw p.headerType=g.type,p}if(g.procType&&g.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var T=t.fromDer(g.body);return r.publicKeyFromAsn1(T)},r.publicKeyToPem=function(E,g){var p={type:"PUBLIC KEY",body:t.toDer(r.publicKeyToAsn1(E)).getBytes()};return e.pem.encode(p,{maxline:g})},r.publicKeyToRSAPublicKeyPem=function(E,g){var p={type:"RSA PUBLIC KEY",body:t.toDer(r.publicKeyToRSAPublicKey(E)).getBytes()};return e.pem.encode(p,{maxline:g})},r.getPublicKeyFingerprint=function(E,g){g=g||{};var p=g.md||e.md.sha1.create(),T=g.type||"RSAPublicKey",R;switch(T){case"RSAPublicKey":R=t.toDer(r.publicKeyToRSAPublicKey(E)).getBytes();break;case"SubjectPublicKeyInfo":R=t.toDer(r.publicKeyToAsn1(E)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+g.type+'".')}p.start(),p.update(R);var B=p.digest();if(g.encoding==="hex"){var P=B.toHex();return g.delimiter?P.match(/.{2}/g).join(g.delimiter):P}else{if(g.encoding==="binary")return B.getBytes();if(g.encoding)throw new Error('Unknown encoding "'+g.encoding+'".')}return B},r.certificationRequestFromPem=function(E,g,p){var T=e.pem.decode(E)[0];if(T.type!=="CERTIFICATE REQUEST"){var R=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw R.headerType=T.type,R}if(T.procType&&T.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var B=t.fromDer(T.body,p);return r.certificationRequestFromAsn1(B,g)},r.certificationRequestToPem=function(E,g){var p={type:"CERTIFICATE REQUEST",body:t.toDer(r.certificationRequestToAsn1(E)).getBytes()};return e.pem.encode(p,{maxline:g})},r.createCertificate=function(){var E={};return E.version=2,E.serialNumber="00",E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.validity={},E.validity.notBefore=new Date,E.validity.notAfter=new Date,E.issuer={},E.issuer.getField=function(g){return f(E.issuer,g)},E.issuer.addField=function(g){b([g]),E.issuer.attributes.push(g)},E.issuer.attributes=[],E.issuer.hash=null,E.subject={},E.subject.getField=function(g){return f(E.subject,g)},E.subject.addField=function(g){b([g]),E.subject.attributes.push(g)},E.subject.attributes=[],E.subject.hash=null,E.extensions=[],E.publicKey=null,E.md=null,E.setSubject=function(g,p){b(g),E.subject.attributes=g,delete E.subject.uniqueId,p&&(E.subject.uniqueId=p),E.subject.hash=null},E.setIssuer=function(g,p){b(g),E.issuer.attributes=g,delete E.issuer.uniqueId,p&&(E.issuer.uniqueId=p),E.issuer.hash=null},E.setExtensions=function(g){for(var p=0;p<g.length;++p)S(g[p],{cert:E});E.extensions=g},E.getExtension=function(g){typeof g=="string"&&(g={name:g});for(var p=null,T,R=0;p===null&&R<E.extensions.length;++R)T=E.extensions[R],(g.id&&T.id===g.id||g.name&&T.name===g.name)&&(p=T);return p},E.sign=function(g,p){E.md=p||e.md.sha1.create();var T=n[E.md.algorithm+"WithRSAEncryption"];if(!T){var R=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw R.algorithm=E.md.algorithm,R}E.signatureOid=E.siginfo.algorithmOid=T,E.tbsCertificate=r.getTBSCertificate(E);var B=t.toDer(E.tbsCertificate);E.md.update(B.getBytes()),E.signature=g.sign(E.md)},E.verify=function(g){var p=!1;if(!E.issued(g)){var T=g.issuer,R=E.subject,B=new Error("The parent certificate did n
227ot issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw B.expectedIssuer=R.attributes,B.actualIssuer=T.attributes,B}var P=g.md;if(P===null){P=m({signatureOid:g.signatureOid,type:"certificate"});var D=g.tbsCertificate||r.getTBSCertificate(g),U=t.toDer(D);P.update(U.getBytes())}return P!==null&&(p=d({certificate:E,md:P,signature:g.signature})),p},E.isIssuer=function(g){var p=!1,T=E.issuer,R=g.subject;if(T.hash&&R.hash)p=T.hash===R.hash;else if(T.attributes.length===R.attributes.length){p=!0;for(var B,P,D=0;p&&D<T.attributes.length;++D)B=T.attributes[D],P=R.attributes[D],(B.type!==P.type||B.value!==P.value)&&(p=!1)}return p},E.issued=function(g){return g.isIssuer(E)},E.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(E.publicKey,{type:"RSAPublicKey"})},E.verifySubjectKeyIdentifier=function(){for(var g=n.subjectKeyIdentifier,p=0;p<E.extensions.length;++p){var T=E.extensions[p];if(T.id===g){var R=E.generateSubjectKeyIdentifier().getBytes();return e.util.hexToBytes(T.subjectKeyIdentifier)===R}}return!1},E},r.certificateFromAsn1=function(E,g){var p={},T=[];if(!t.validate(E,i,p,T)){var R=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw R.errors=T,R}var B=t.derToOid(p.publicKeyOid);if(B!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var P=r.createCertificate();P.version=p.certVersion?p.certVersion.charCodeAt(0):0;var D=e.util.createBuffer(p.certSerialNumber);P.serialNumber=D.toHex(),P.signatureOid=e.asn1.derToOid(p.certSignatureOid),P.signatureParameters=y(P.signatureOid,p.certSignatureParams,!0),P.siginfo.algorithmOid=e.asn1.derToOid(p.certinfoSignatureOid),P.siginfo.parameters=y(P.siginfo.algorithmOid,p.certinfoSignatureParams,!1),P.signature=p.certSignature;var U=[];if(p.certValidity1UTCTime!==void 0&&U.push(t.utcTimeToDate(p.certValidity1UTCTime)),p.certValidity2GeneralizedTime!==void 0&&U.push(t.generalizedTimeToDate(p.certValidity2GeneralizedTime)),p.certValidity3UTCTime!==void 0&&U.push(t.utcTimeToDate(p.certValidity3UTCTime)),p.certValidity4GeneralizedTime!==void 0&&U.push(t.generalizedTimeToDate(p.certValidity4GeneralizedTime)),U.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(U.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(P.validity.notBefore=U[0],P.validity.notAfter=U[1],P.tbsCertificate=p.tbsCertificate,g){P.md=m({signatureOid:P.signatureOid,type:"certificate"});var _=t.toDer(P.tbsCertificate);P.md.update(_.getBytes())}var V=e.md.sha1.create(),z=t.toDer(p.certIssuer);V.update(z.getBytes()),P.issuer.getField=function(Y){return f(P.issuer,Y)},P.issuer.addField=function(Y){b([Y]),P.issuer.attributes.push(Y)},P.issuer.attributes=r.RDNAttributesAsArray(p.certIssuer),p.certIssuerUniqueId&&(P.issuer.uniqueId=p.certIssuerUniqueId),P.issuer.hash=V.digest().toHex();var q=e.md.sha1.create(),G=t.toDer(p.certSubject);return q.update(G.getBytes()),P.subject.getField=function(Y){return f(P.subject,Y)},P.subject.addField=function(Y){b([Y]),P.subject.attributes.push(Y)},P.subject.attributes=r.RDNAttributesAsArray(p.certSubject),p.certSubjectUniqueId&&(P.subject.uniqueId=p.certSubjectUniqueId),P.subject.hash=q.digest().toHex(),p.certExtensions?P.extensions=r.certificateExtensionsFromAsn1(p.certExtensions):P.extensions=[],P.publicKey=r.publicKeyFromAsn1(p.subjectPublicKeyInfo),P},r.certificateExtensionsFromAsn1=function(E){for(var g=[],p=0;p<E.value.length;++p)for(var T=E.value[p],R=0;R<T.value.length;++R)g.push(r.certificateExtensionFromAsn1(T.value[R]));return g},r.certificateExtensionFromAsn1=function(E){var g={};if(g.id=t.derToOid(E.value[0].value),g.critical=!1,E.value[1].type===t.Type.BOOLEAN?(g.critical=E.value[1].value.charCodeAt(0)!==0,g.value=E.value[2].value):g.value=E.value[1].value,g.id in n){if(g.name=n[g.id],g.name==="keyUsage"){var p=t.fromDer(g.value),T=0,R=0;p.value.length>1&&(T=p.value.charCodeAt(1),R=p.value.length>2?p.value.charCodeAt(2):0),g.digitalSignature=(T&128)===128,g.nonRepudiation=(T&64)===64,g.keyEncipherment=(T&32)===32,g.dataEncipherment=(T&16)===16,g.keyAgreement=(T&8)===8,g.keyCertSign=(T&4)===4,g.cRLSign=(T&2)===2,g.enci
227pherOnly=(T&1)===1,g.decipherOnly=(R&128)===128}else if(g.name==="basicConstraints"){var p=t.fromDer(g.value);p.value.length>0&&p.value[0].type===t.Type.BOOLEAN?g.cA=p.value[0].value.charCodeAt(0)!==0:g.cA=!1;var B=null;p.value.length>0&&p.value[0].type===t.Type.INTEGER?B=p.value[0].value:p.value.length>1&&(B=p.value[1].value),B!==null&&(g.pathLenConstraint=t.derToInteger(B))}else if(g.name==="extKeyUsage")for(var p=t.fromDer(g.value),P=0;P<p.value.length;++P){var D=t.derToOid(p.value[P].value);D in n?g[n[D]]=!0:g[D]=!0}else if(g.name==="nsCertType"){var p=t.fromDer(g.value),T=0;p.value.length>1&&(T=p.value.charCodeAt(1)),g.client=(T&128)===128,g.server=(T&64)===64,g.email=(T&32)===32,g.objsign=(T&16)===16,g.reserved=(T&8)===8,g.sslCA=(T&4)===4,g.emailCA=(T&2)===2,g.objCA=(T&1)===1}else if(g.name==="subjectAltName"||g.name==="issuerAltName"){g.altNames=[];for(var U,p=t.fromDer(g.value),_=0;_<p.value.length;++_){U=p.value[_];var V={type:U.type,value:U.value};switch(g.altNames.push(V),U.type){case 1:case 2:case 6:break;case 7:V.ip=e.util.bytesToIP(U.value);break;case 8:V.oid=t.derToOid(U.value);break}}}else if(g.name==="subjectKeyIdentifier"){var p=t.fromDer(g.value);g.subjectKeyIdentifier=e.util.bytesToHex(p.value)}}return g},r.certificationRequestFromAsn1=function(E,g){var p={},T=[];if(!t.validate(E,l,p,T)){var R=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw R.errors=T,R}var B=t.derToOid(p.publicKeyOid);if(B!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var P=r.createCertificationRequest();if(P.version=p.csrVersion?p.csrVersion.charCodeAt(0):0,P.signatureOid=e.asn1.derToOid(p.csrSignatureOid),P.signatureParameters=y(P.signatureOid,p.csrSignatureParams,!0),P.siginfo.algorithmOid=e.asn1.derToOid(p.csrSignatureOid),P.siginfo.parameters=y(P.siginfo.algorithmOid,p.csrSignatureParams,!1),P.signature=p.csrSignature,P.certificationRequestInfo=p.certificationRequestInfo,g){P.md=m({signatureOid:P.signatureOid,type:"certification request"});var D=t.toDer(P.certificationRequestInfo);P.md.update(D.getBytes())}var U=e.md.sha1.create();return P.subject.getField=function(_){return f(P.subject,_)},P.subject.addField=function(_){b([_]),P.subject.attributes.push(_)},P.subject.attributes=r.RDNAttributesAsArray(p.certificationRequestInfoSubject,U),P.subject.hash=U.digest().toHex(),P.publicKey=r.publicKeyFromAsn1(p.subjectPublicKeyInfo),P.getAttribute=function(_){return f(P,_)},P.addAttribute=function(_){b([_]),P.attributes.push(_)},P.attributes=r.CRIAttributesAsArray(p.certificationRequestInfoAttributes||[]),P},r.createCertificationRequest=function(){var E={};return E.version=0,E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.subject={},E.subject.getField=function(g){return f(E.subject,g)},E.subject.addField=function(g){b([g]),E.subject.attributes.push(g)},E.subject.attributes=[],E.subject.hash=null,E.publicKey=null,E.attributes=[],E.getAttribute=function(g){return f(E,g)},E.addAttribute=function(g){b([g]),E.attributes.push(g)},E.md=null,E.setSubject=function(g){b(g),E.subject.attributes=g,E.subject.hash=null},E.setAttributes=function(g){b(g),E.attributes=g},E.sign=function(g,p){E.md=p||e.md.sha1.create();var T=n[E.md.algorithm+"WithRSAEncryption"];if(!T){var R=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw R.algorithm=E.md.algorithm,R}E.signatureOid=E.siginfo.algorithmOid=T,E.certificationRequestInfo=r.getCertificationRequestInfo(E);var B=t.toDer(E.certificationRequestInfo);E.md.update(B.getBytes()),E.signature=g.sign(E.md)},E.verify=function(){var g=!1,p=E.md;if(p===null){p=m({signatureOid:E.signatureOid,type:"certification request"});var T=E.certificationRequestInfo||r.getCertificationRequestInfo(E),R=t.toDer(T);p.update(R.getBytes())}return p!==null&&(g=d({certificate:E,md:p,signature:E.signature})),g},E};function v(E){for(var g=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),p,T,R=E.attributes,B=0;B<R.length;++B){p=R[B];var P=p.value,D=t.Type.PRINTABLESTRING;"valueTagClass"in p&&(D=p.valueTagClass,D===t.Type.UTF8&&(P=e.util.encodeUtf8(P))),T=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(p.type).getBytes()),t.create(t.Class.UNIVERSAL,D,!1,P)])]),g.value.push(T)}return g}function b(E){for(var g,p=0;p<E.length;++p){if(g=E[p],typeof g.name>"u"&&(g.type&&g.type in r.oids?g.name=r.oids[g.type]:g.shortName&&g.shortName in o&&(g.name=r.oids[o[g.shortName]])),typeof g.type>"u")if(g.name&&g.name in r.oids)g.type=r.oids[g.name];else{var T=new Error("Attribute type not specified.");throw T.attribute=g,T}if(typeof g.shortName>"u"&&g.name&&g.name in o&&(g.shortName=o[g.name]),g.type===n.extensionRequest&&(g.valueConstructed=!0,g.valueTagClass=t.Type.SEQUENCE,!g.value&&g.extensions)){g.value=[];for(var R=0;R<g.extensions.length;++R)g.value.push(r.certificateExtensionToAsn1(S(g.extensions[R])))}if(typeof g.value>"u"){var T=new Error("Attribute value not specified.");throw T.attribute=g,T}}}function S(E,g){if(g=g||{},typeof E.name>"u"&&E.id&&E.id in r.oids&&(E.name=r.oids[E.id]),typeof E.id>"u")if(E.name&&E.name in r.oids)E.id=r.oids[E.name];else{var p=new Error("Extension ID not specified.");throw p.extension=E,p}if(typeof E.value<"u")return E;if(E.name==="keyUsage"){var T=0,R=0,B=0;E.digitalSignature&&(R|=128,T=7),E.nonRepudiation&&(R|=64,T=6),E.keyEncipherment&&(R|=32,T=5),E.dataEncipherment&&(R|=16,T=4),E.keyAgreement&&(R|=8,T=3),E.keyCertSign&&(R|=4,T=2),E.cRLSign&&(R|=2,T=1),E.encipherOnly&&
227(R|=1,T=0),E.decipherOnly&&(B|=128,T=7);var P=String.fromCharCode(T);B!==0?P+=String.fromCharCode(R)+String.fromCharCode(B):R!==0&&(P+=String.fromCharCode(R)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,P)}else if(E.name==="basicConstraints")E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),E.cA&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in E&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.pathLenConstraint).getBytes()));else if(E.name==="extKeyUsage"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var D=E.value.value;for(var U in E)E[U]===!0&&(U in n?D.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n[U]).getBytes())):U.indexOf(".")!==-1&&D.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(U).getBytes())))}else if(E.name==="nsCertType"){var T=0,R=0;E.client&&(R|=128,T=7),E.server&&(R|=64,T=6),E.email&&(R|=32,T=5),E.objsign&&(R|=16,T=4),E.reserved&&(R|=8,T=3),E.sslCA&&(R|=4,T=2),E.emailCA&&(R|=2,T=1),E.objCA&&(R|=1,T=0);var P=String.fromCharCode(T);R!==0&&(P+=String.fromCharCode(R)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,P)}else if(E.name==="subjectAltName"||E.name==="issuerAltName"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var _,V=0;V<E.altNames.length;++V){_=E.altNames[V];var P=_.value;if(_.type===7&&_.ip){if(P=e.util.bytesFromIP(_.ip),P===null){var p=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw p.extension=E,p}}else _.type===8&&(_.oid?P=t.oidToDer(t.oidToDer(_.oid)):P=t.oidToDer(P));E.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,_.type,!1,P))}}else if(E.name==="nsComment"&&g.cert){if(!/^[\x00-\x7F]*$/.test(E.comment)||E.comment.length<1||E.comment.length>128)throw new Error('Invalid "nsComment" content.');E.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,E.comment)}else if(E.name==="subjectKeyIdentifier"&&g.cert){var z=g.cert.generateSubjectKeyIdentifier();E.subjectKeyIdentifier=z.toHex(),E.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,z.getBytes())}else if(E.name==="authorityKeyIdentifier"&&g.cert){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var D=E.value.value;if(E.keyIdentifier){var q=E.keyIdentifier===!0?g.cert.generateSubjectKeyIdentifier().getBytes():E.keyIdentifier;D.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,q))}if(E.authorityCertIssuer){var G=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[v(E.authorityCertIssuer===!0?g.cert.issuer:E.authorityCertIssuer)])];D.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,G))}if(E.serialNumber){var Y=e.util.hexToBytes(E.serialNumber===!0?g.cert.serialNumber:E.serialNumber);D.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,Y))}}else if(E.name==="cRLDistributionPoints"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var D=E.value.value,ee=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),J=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]),_,V=0;V<E.altNames.length;++V){_=E.altNames[V];var P=_.value;if(_.type===7&&_.ip){if(P=e.util.bytesFromIP(_.ip),P===null){var p=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw p.extension=E,p}}else _.type===8&&(_.oid?P=t.oidToDer(t.oidToDer(_.oid)):P=t.oidToDer(P));J.value.push(t.create(t.Class.CONTEXT_SPECIFIC,_.type,!1,P))}ee.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[J])),D.push(ee)}if(typeof E.value>"u"){var p=new Error("Extension value not specified.");throw p.extension=E,p}return E}function u(E,g){if(E===n["RSASSA-PSS"]){var p=[];return g.hash.algorithmOid!==void 0&&p.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(g.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),g.mgf.algorithmOid!==void 0&&p.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(g.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(g.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.
227NULL,!1,"")])])])),g.saltLength!==void 0&&p.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(g.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,p)}else return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}function C(E){var g=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(E.attributes.length===0)return g;for(var p=E.attributes,T=0;T<p.length;++T){var R=p[T],B=R.value,P=t.Type.UTF8;"valueTagClass"in R&&(P=R.valueTagClass),P===t.Type.UTF8&&(B=e.util.encodeUtf8(B));var D=!1;"valueConstructed"in R&&(D=R.valueConstructed);var U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(R.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,P,D,B)])]);g.value.push(U)}return g}var x=new Date("1950-01-01T00:00:00Z"),I=new Date("2050-01-01T00:00:00Z");function N(E){return E>=x&&E<I?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(E)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(E))}return r.getTBSCertificate=function(E){var g=N(E.validity.notBefore),p=N(E.validity.notAfter),T=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(E.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.siginfo.algorithmOid).getBytes()),u(E.siginfo.algorithmOid,E.siginfo.parameters)]),v(E.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[g,p]),v(E.subject),r.publicKeyToAsn1(E.publicKey)]);return E.issuer.uniqueId&&T.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.issuer.uniqueId)])),E.subject.uniqueId&&T.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.subject.uniqueId)])),E.extensions.length>0&&T.value.push(r.certificateExtensionsToAsn1(E.extensions)),T},r.getCertificationRequestInfo=function(E){var g=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes()),v(E.subject),r.publicKeyToAsn1(E.publicKey),C(E)]);return g},r.distinguishedNameToAsn1=function(E){return v(E)},r.certificateToAsn1=function(E){var g=E.tbsCertificate||r.getTBSCertificate(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[g,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),u(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},r.certificateExtensionsToAsn1=function(E){var g=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),p=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);g.value.push(p);for(var T=0;T<E.length;++T)p.value.push(r.certificateExtensionToAsn1(E[T]));return g},r.certificateExtensionToAsn1=function(E){var g=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);g.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.id).getBytes())),E.critical&&g.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ"));var p=E.value;return typeof E.value!="string"&&(p=t.toDer(p).getBytes()),g.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,p)),g},r.certificationRequestToAsn1=function(E){var g=E.certificationRequestInfo||r.getCertificationRequestInfo(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[g,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),u(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},r.createCaStore=function(E){var g={certs:{}};g.getIssuer=function(P){var D=p(P.issuer);return D},g.addCertificate=function(P){if(typeof P=="string"&&(P=e.pki.certificateFromPem(P)),T(P.subject),!g.hasCertificate(P))if(P.subject.hash in g.certs){var D=g.certs[P.subject.hash];e.util.isArray(D)||(D=[D]),D.push(P),g.certs[P.subject.hash]=D}else g.certs[P.subject.hash]=P}
227,g.hasCertificate=function(P){typeof P=="string"&&(P=e.pki.certificateFromPem(P));var D=p(P.subject);if(!D)return!1;e.util.isArray(D)||(D=[D]);for(var U=t.toDer(r.certificateToAsn1(P)).getBytes(),_=0;_<D.length;++_){var V=t.toDer(r.certificateToAsn1(D[_])).getBytes();if(U===V)return!0}return!1},g.listAllCertificates=function(){var P=[];for(var D in g.certs)if(g.certs.hasOwnProperty(D)){var U=g.certs[D];if(!e.util.isArray(U))P.push(U);else for(var _=0;_<U.length;++_)P.push(U[_])}return P},g.removeCertificate=function(P){var D;if(typeof P=="string"&&(P=e.pki.certificateFromPem(P)),T(P.subject),!g.hasCertificate(P))return null;var U=p(P.subject);if(!e.util.isArray(U))return D=g.certs[P.subject.hash],delete g.certs[P.subject.hash],D;for(var _=t.toDer(r.certificateToAsn1(P)).getBytes(),V=0;V<U.length;++V){var z=t.toDer(r.certificateToAsn1(U[V])).getBytes();_===z&&(D=U[V],U.splice(V,1))}return U.length===0&&delete g.certs[P.subject.hash],D};function p(P){return T(P),g.certs[P.hash]||null}function T(P){if(!P.hash){var D=e.md.sha1.create();P.attributes=r.RDNAttributesAsArray(v(P),D),P.hash=D.digest().toHex()}}if(E)for(var R=0;R<E.length;++R){var B=E[R];g.addCertificate(B)}return g},r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},r.verifyCertificateChain=function(E,g,p){typeof p=="function"&&(p={verify:p}),p=p||{},g=g.slice(0);var T=g.slice(0),R=p.validityCheckDate;typeof R>"u"&&(R=new Date);var B=!0,P=null,D=0;do{var U=g.shift(),_=null,V=!1;if(R&&(R<U.validity.notBefore||R>U.validity.notAfter)&&(P={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:U.validity.notBefore,notAfter:U.validity.notAfter,now:R}),P===null){if(_=g[0]||E.getIssuer(U),_===null&&U.isIssuer(U)&&(V=!0,_=U),_){var z=_;e.util.isArray(z)||(z=[z]);for(var q=!1;!q&&z.length>0;){_=z.shift();try{q=_.verify(U)}catch{}}q||(P={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}P===null&&(!_||V)&&!E.hasCertificate(U)&&(P={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}if(P===null&&_&&!U.isIssuer(_)&&(P={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate}),P===null)for(var G={keyUsage:!0,basicConstraints:!0},Y=0;P===null&&Y<U.extensions.length;++Y){var ee=U.extensions[Y];ee.critical&&!(ee.name in G)&&(P={message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}if(P===null&&(!B||g.length===0&&(!_||V))){var J=U.getExtension("basicConstraints"),te=U.getExtension("keyUsage");if(te!==null&&(!te.keyCertSign||J===null)&&(P={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate}),P===null&&J!==null&&!J.cA&&(P={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),P===null&&te!==null&&"pathLenConstraint"in J){var Q=D-1;Q>J.pathLenConstraint&&(P={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate})}}var Z=P===null?!0:P.error,W=p.verify?p.verify(Z,D,T):Z;if(W===!0)P=null;else throw Z===!0&&(P={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}),(W||W===0)&&(typeof W=="object"&&!e.util.isArray(W)?(W.message&&(P.message=W.message),W.error&&(P.error=W.error)):typeof W=="string"&&(P.error=W)),P;B=!1,++D}while(g.length>0);return!0},os.exports}var u0;function Uh(){if(u0)return ns.exports;u0=1;var e=nt();Nr(),Sa(),cn(),Vh(),kh(),xr(),ni(),Ea(),pt(),Ic();var t=e.asn1,r=e.pki,n=ns.exports=e.pkcs12=e.pkcs12||{},o={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},s={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,c
227onstructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},i={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},a={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},c={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function l(b,S,u,C){for(var x=[],I=0;I<b.length;I++)for(var N=0;N<b[I].safeBags.length;N++){var E=b[I].safeBags[N];if(!(C!==void 0&&E.type!==C)){if(S===null){x.push(E);continue}E.attributes[S]!==void 0&&E.attributes[S].indexOf(u)>=0&&x.push(E)}}return x}n.pkcs12FromAsn1=function(b,S,u){typeof S=="string"?(u=S,S=!0):S===void 0&&(S=!0);var C={},x=[];if(!t.validate(b,s,C,x)){var I=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw I.errors=I,I}var N={version:C.version.charCodeAt(0),safeContents:[],getBags:function(_){var V={},z;return"localKeyId"in _?z=_.localKeyId:"localKeyIdHex"in _&&(z=e.util.hexToBytes(_.localKeyIdHex)),z===void 0&&!("friendlyName"in _)&&"bagType"in _&&(V[_.bagType]=l(N.safeContents,null,null,_.bagType)),z!==void 0&&(V.localKeyId=l(N.safeContents,"localKeyId",z,_.bagType)),"friendlyName"in _&&(V.friendlyName=l(N.safeContents,"friendlyName",_.friendlyName,_.bagType)),V},getBagsByFriendlyName:function(_,V){return l(N.safeContents,"friendlyName",_,V)},getBagsByLocalKeyId:function(_,V){return l(N.safeContents,"localKeyId",_,V)}};if(C.version.charCodeAt(0)!==3){var I=new Error("PKCS#12 PFX of version other than 3 not supported.");throw I.version=C.version.charCodeAt(0),I}if(t.derToOid(C.contentType)!==r.oids.data){var I=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw I.oid=t.derToOid(C.contentType),I}var E=C.content.value[0];if(E.tagClass!==t.Class.UNIVERSAL||E.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(E=f(E),C.mac){var g=null,p=0,T=t.derToOid(C.macAlgorithm);switch(T){case r.oids.sha1:g=e.md.sha1.create(),p=20;break;case r.oids.sha256:g=e.md.sha256.create(),p=32;break;case r.oids.sha384:g=e.md.sha384.create(),p=48;break;case r.oids.sha512:g=e.md.sha512.create(),p=64;break;case r.oids.md5:g=e.md.md5.create(),p=16;break}if(g===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+T);var R=new e.util.ByteBuffer(C.macSalt),B="macIterations"in C?parseInt(e.util.bytesToHex(C.macIterations),16):1,P=n.generateKey(u,R,3,B,p,g),D=e.hmac.create();D.start(g,P),D.update(E.value);var U=D.getMac();if(U.getBytes()!==C.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(b.value)&&b.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not val
227idated.");return y(N,E.value,S,u),N};function f(b){if(b.composed||b.constructed){for(var S=e.util.createBuffer(),u=0;u<b.value.length;++u)S.putBytes(b.value[u].value);b.composed=b.constructed=!1,b.value=S.getBytes()}return b}function y(b,S,u,C){if(S=t.fromDer(S,u),S.tagClass!==t.Class.UNIVERSAL||S.type!==t.Type.SEQUENCE||S.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var x=0;x<S.value.length;x++){var I=S.value[x],N={},E=[];if(!t.validate(I,o,N,E)){var g=new Error("Cannot read ContentInfo.");throw g.errors=E,g}var p={encrypted:!1},T=null,R=N.content.value[0];switch(t.derToOid(N.contentType)){case r.oids.data:if(R.tagClass!==t.Class.UNIVERSAL||R.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");T=f(R).value;break;case r.oids.encryptedData:T=m(R,C),p.encrypted=!0;break;default:var g=new Error("Unsupported PKCS#12 contentType.");throw g.contentType=t.derToOid(N.contentType),g}p.safeBags=d(T,u,C),b.safeContents.push(p)}}function m(b,S){var u={},C=[];if(!t.validate(b,e.pkcs7.asn1.encryptedDataValidator,u,C)){var x=new Error("Cannot read EncryptedContentInfo.");throw x.errors=C,x}var I=t.derToOid(u.contentType);if(I!==r.oids.data){var x=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw x.oid=I,x}I=t.derToOid(u.encAlgorithm);var N=r.pbe.getCipher(I,u.encParameter,S),E=f(u.encryptedContentAsn1),g=e.util.createBuffer(E.value);if(N.update(g),!N.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return N.output.getBytes()}function d(b,S,u){if(!S&&b.length===0)return[];if(b=t.fromDer(b,S),b.tagClass!==t.Class.UNIVERSAL||b.type!==t.Type.SEQUENCE||b.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var C=[],x=0;x<b.value.length;x++){var I=b.value[x],N={},E=[];if(!t.validate(I,i,N,E)){var g=new Error("Cannot read SafeBag.");throw g.errors=E,g}var p={type:t.derToOid(N.bagId),attributes:v(N.bagAttributes)};C.push(p);var T,R,B=N.bagValue.value[0];switch(p.type){case r.oids.pkcs8ShroudedKeyBag:if(B=r.decryptPrivateKeyInfo(B,u),B===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case r.oids.keyBag:try{p.key=r.privateKeyFromAsn1(B)}catch{p.key=null,p.asn1=B}continue;case r.oids.certBag:T=c,R=function(){if(t.derToOid(N.certId)!==r.oids.x509Certificate){var D=new Error("Unsupported certificate type, only X.509 supported.");throw D.oid=t.derToOid(N.certId),D}var U=t.fromDer(N.cert,S);try{p.cert=r.certificateFromAsn1(U,!0)}catch{p.cert=null,p.asn1=U}};break;default:var g=new Error("Unsupported PKCS#12 SafeBag type.");throw g.oid=p.type,g}if(T!==void 0&&!t.validate(B,T,N,E)){var g=new Error("Cannot read PKCS#12 "+T.name);throw g.errors=E,g}R()}return C}function v(b){var S={};if(b!==void 0)for(var u=0;u<b.length;++u){var C={},x=[];if(!t.validate(b[u],a,C,x)){var I=new Error("Cannot read PKCS#12 BagAttribute.");throw I.errors=x,I}var N=t.derToOid(C.oid);if(r.oids[N]!==void 0){S[r.oids[N]]=[];for(var E=0;E<C.values.length;++E)S[r.oids[N]].push(C.values[E].value)}}return S}return n.toPkcs12Asn1=function(b,S,u,C){C=C||{},C.saltSize=C.saltSize||8,C.count=C.count||2048,C.algorithm=C.algorithm||C.encAlgorithm||"aes128","useMac"in C||(C.useMac=!0),"localKeyId"in C||(C.localKeyId=null),"generateLocalKeyId"in C||(C.generateLocalKeyId=!0);var x=C.localKeyId,I;if(x!==null)x=e.util.hexToBytes(x);else if(C.generateLocalKeyId)if(S){var N=e.util.isArray(S)?S[0]:S;typeof N=="string"&&(N=r.certificateFromPem(N));var E=e.md.sha1.create();E.update(t.toDer(r.certificateToAsn1(N)).getBytes()),x=E.digest().getBytes()}else x=e.random.getBytes(20);var g=[];x!==null&&g.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,x)])])),"friendlyName"in C&&g.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,C.friendlyName)])])),g.length>0&&(I=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,g));var p=[],T=[];S!==null&&(e.util.isArray(S)?T=S:T=[S]);for(var R=[],B=0;B<T.length;++B){S=T[B],typeof S=="string"&&(S=r.certificateFromPem(S));var P=B===0?I:void 0,D=r.certificateToAsn1(S),U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(D).getBytes())])])]),P]);R.push(U)}if(R.length>0){var _=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,R),V=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(_).getBytes())])]);p.push(V)}var z=null;if(b!==null){var q=r.wrapRsaPrivateKey(r.privateKeyToAsn1(b));u===null?z=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[q]),I]):z=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[r.encryptPrivateKeyInfo(q,u,C)]),I]);var G=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[z]),Y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(G).getBytes())])]);p.push(Y)}var ee=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,p),J;if(C.useMac){var E=e.md.sha1.create(),te=new e.util.ByteBuffer(e.random.getBytes(C.saltSize)),Q=C.count,b=n.generateKey(u,te,3,Q,20),Z=e.hmac.create();Z.start(E,b),Z.update(t.toDer(ee).getBytes());var W=Z.getMac();J=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.
227NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,W.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,te.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(Q).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(ee).getBytes())])]),J])},n.generateKey=e.pbe.generatePkcs12Key,ns.exports}var d0;function jh(){if(d0)return Gi.exports;d0=1;var e=nt();Nr(),cn(),kh(),kn(),Ec(),Uh(),wc(),ni(),pt(),Ic();var t=e.asn1,r=Gi.exports=e.pki=e.pki||{};return r.pemToDer=function(n){var o=e.pem.decode(n)[0];if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return e.util.createBuffer(o.body)},r.privateKeyFromPem=function(n){var o=e.pem.decode(n)[0];if(o.type!=="PRIVATE KEY"&&o.type!=="RSA PRIVATE KEY"){var s=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw s.headerType=o.type,s}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var i=t.fromDer(o.body);return r.privateKeyFromAsn1(i)},r.privateKeyToPem=function(n,o){var s={type:"RSA PRIVATE KEY",body:t.toDer(r.privateKeyToAsn1(n)).getBytes()};return e.pem.encode(s,{maxline:o})},r.privateKeyInfoToPem=function(n,o){var s={type:"PRIVATE KEY",body:t.toDer(n).getBytes()};return e.pem.encode(s,{maxline:o})},Gi.exports}var cs,f0;function Hh(){if(f0)return cs;f0=1;var e=nt();Nr(),Sa(),Sc(),kn(),jh(),xr(),Ea(),pt();var t=function(A,$,O,w){var M=e.util.createBuffer(),H=A.length>>1,F=H+(A.length&1),X=A.substr(0,F),ce=A.substr(H,F),ae=e.util.createBuffer(),re=e.hmac.create();O=$+O;var de=Math.ceil(w/16),Ce=Math.ceil(w/20);re.start("MD5",X);var he=e.util.createBuffer();ae.putBytes(O);for(var ye=0;ye<de;++ye)re.start(null,null),re.update(ae.getBytes()),ae.putBuffer(re.digest()),re.start(null,null),re.update(ae.bytes()+O),he.putBuffer(re.digest());re.start("SHA1",ce);var De=e.util.createBuffer();ae.clear(),ae.putBytes(O);for(var ye=0;ye<Ce;++ye)re.start(null,null),re.update(ae.getBytes()),ae.putBuffer(re.digest()),re.start(null,null),re.update(ae.bytes()+O),De.putBuffer(re.digest());return M.putBytes(e.util.xorBytes(he.getBytes(),De.getBytes(),w)),M},r=function(A,$,O){var w=e.hmac.create();w.start("SHA1",A);var M=e.util.createBuffer();return M.putInt32($[0]),M.putInt32($[1]),M.putByte(O.type),M.putByte(O.version.major),M.putByte(O.version.minor),M.putInt16(O.length),M.putBytes(O.fragment.bytes()),w.update(M.getBytes()),w.digest().getBytes()},n=function(A,$,O){var w=!1;try{var M=A.deflate($.fragment.getBytes());$.fragment=e.util.createBuffer(M),$.length=M.length,w=!0}catch{}return w},o=function(A,$,O){var w=!1;try{var M=A.inflate($.fragment.getBytes());$.fragment=e.util.createBuffer(M),$.length=M.length,w=!0}catch{}return w},s=function(A,$){var O=0;switch($){case 1:O=A.getByte();break;case 2:O=A.getInt16();break;case 3:O=A.getInt24();break;case 4:O=A.getInt32();break}return e.util.createBuffer(A.getBytes(O))},i=function(A,$,O){A.putInt(O.length(),$<<3),A.putBuffer(O)},a={};a.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},a.SupportedVersions=[a.Versions.TLS_1_1,a.Versions.TLS_1_0],a.Version=a.SupportedVersions[0],a.MaxFragment=15360,a.ConnectionEnd={server:0,client:1},a.PRFAlgorithm={tls_prf_sha256:0},a.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},a.CipherType={stream:0,block:1,aead:2},a.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},a.CompressionMethod={none:0,deflate:1},a.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},a.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},a.Alert={},a.Alert.Level={warning:1,fatal:2},a.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_de
227nied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},a.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},a.CipherSuites={},a.getCipherSuite=function(A){var $=null;for(var O in a.CipherSuites){var w=a.CipherSuites[O];if(w.id[0]===A.charCodeAt(0)&&w.id[1]===A.charCodeAt(1)){$=w;break}}return $},a.handleUnexpected=function(A,$){var O=!A.open&&A.entity===a.ConnectionEnd.client;O||A.error(A,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unexpected_message}})},a.handleHelloRequest=function(A,$,O){!A.handshaking&&A.handshakes>0&&(a.queue(A,a.createAlert(A,{level:a.Alert.Level.warning,description:a.Alert.Description.no_renegotiation})),a.flush(A)),A.process()},a.parseHelloMessage=function(A,$,O){var w=null,M=A.entity===a.ConnectionEnd.client;if(O<38)A.error(A,{message:M?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});else{var H=$.fragment,F=H.length();if(w={version:{major:H.getByte(),minor:H.getByte()},random:e.util.createBuffer(H.getBytes(32)),session_id:s(H,1),extensions:[]},M?(w.cipher_suite=H.getBytes(2),w.compression_method=H.getByte()):(w.cipher_suites=s(H,2),w.compression_methods=s(H,1)),F=O-(F-H.length()),F>0){for(var X=s(H,2);X.length()>0;)w.extensions.push({type:[X.getByte(),X.getByte()],data:s(X,2)});if(!M)for(var ce=0;ce<w.extensions.length;++ce){var ae=w.extensions[ce];if(ae.type[0]===0&&ae.type[1]===0)for(var re=s(ae.data,2);re.length()>0;){var de=re.getByte();if(de!==0)break;A.session.extensions.server_name.serverNameList.push(s(re,2).getBytes())}}}if(A.session.version&&(w.version.major!==A.session.version.major||w.version.minor!==A.session.version.minor))return A.error(A,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});if(M)A.session.cipherSuite=a.getCipherSuite(w.cipher_suite);else for(var Ce=e.util.createBuffer(w.cipher_suites.bytes());Ce.length()>0&&(A.session.cipherSuite=a.getCipherSuite(Ce.getBytes(2)),A.session.cipherSuite===null););if(A.session.cipherSuite===null)return A.error(A,{message:"No cipher suites in common.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure},cipherSuite:e.util.bytesToHex(w.cipher_suite)});M?A.session.compressionMethod=w.compression_method:A.session.compressionMethod=a.CompressionMethod.none}return w},a.createSecurityParameters=function(A,$){var O=A.entity===a.ConnectionEnd.client,w=$.random.bytes(),M=O?A.session.sp.client_random:w,H=O?w:a.createRandom().getBytes();A.session.sp={entity:A.entity,prf_algorithm:a.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:A.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:M,server_random:H}},a.handleServerHello=function(A,$,O){var w=a.parseHelloMessage(A,$,O);if(!A.fail){if(w.version.minor<=A.version.minor)A.version.minor=w.version.minor;else return A.error(A,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});A.session.version=A.version;var M=w.session_id.bytes();M.length>0&&M===A.session.id?(A.expect=d,A.session.resuming=!0,A.session.sp.server_random=w.random.bytes()):(A.expect=l,A.session.resuming=!1,a.createSecurityParameters(A,w)),A.session.id=M,A.process()}},a.handleClientHello=function(A,$,O){var w=a.parseHelloMessage(A,$,O);if(!A.fail){var M=w.session_id.bytes(),H=null;if(A.sessionCache&&(H=A.sessionCache.getSession(M),H===null?M="":(H.version.major!==w.version.major||H.version.minor>w.version.minor)&&(H=null,M="")),M.length===0&&(M=e.random.getBytes(32)),A.session.id=M,A.session.clientHelloVersion=w.version,A.session.sp={},H)A.version=A.session.version=H.version,A.session.sp=H.sp;else{for(var F,X=1;X<a.SupportedVersions.length&&(F=a.SupportedVersions[X],!(F.minor<=w.version.minor));++X);A.version={major:F.major,minor:F.minor},A.session.version=A.version}H!==null?(A.expect=N,A.session.resuming=!0,A.session.sp.client_random=w.random.bytes()):(A.expect=A.verifyClient!==!1?C:x,A.session.resuming=!1,a.createSecurityParameters(A,w)),A.open=!0,a.queue(A,a.
227createRecord(A,{type:a.ContentType.handshake,data:a.createServerHello(A)})),A.session.resuming?(a.queue(A,a.createRecord(A,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),A.state.pending=a.createConnectionState(A),A.state.current.write=A.state.pending.write,a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createFinished(A)}))):(a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createCertificate(A)})),A.fail||(a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createServerKeyExchange(A)})),A.verifyClient!==!1&&a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createCertificateRequest(A)})),a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createServerHelloDone(A)})))),a.flush(A),A.process()}},a.handleCertificate=function(A,$,O){if(O<3)return A.error(A,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var w=$.fragment,M={certificate_list:s(w,3)},H,F,X=[];try{for(;M.certificate_list.length()>0;)H=s(M.certificate_list,3),F=e.asn1.fromDer(H),H=e.pki.certificateFromAsn1(F,!0),X.push(H)}catch(ae){return A.error(A,{message:"Could not parse certificate list.",cause:ae,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}var ce=A.entity===a.ConnectionEnd.client;(ce||A.verifyClient===!0)&&X.length===0?A.error(A,{message:ce?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}}):X.length===0?A.expect=ce?f:x:(ce?A.session.serverCertificate=X[0]:A.session.clientCertificate=X[0],a.verifyCertificateChain(A,X)&&(A.expect=ce?f:x)),A.process()},a.handleServerKeyExchange=function(A,$,O){if(O>0)return A.error(A,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});A.expect=y,A.process()},a.handleClientKeyExchange=function(A,$,O){if(O<48)return A.error(A,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});var w=$.fragment,M={enc_pre_master_secret:s(w,2).getBytes()},H=null;if(A.getPrivateKey)try{H=A.getPrivateKey(A,A.session.serverCertificate),H=e.pki.privateKeyFromPem(H)}catch(ce){A.error(A,{message:"Could not get private key.",cause:ce,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}if(H===null)return A.error(A,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});try{var F=A.session.sp;F.pre_master_secret=H.decrypt(M.enc_pre_master_secret);var X=A.session.clientHelloVersion;if(X.major!==F.pre_master_secret.charCodeAt(0)||X.minor!==F.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{F.pre_master_secret=e.random.getBytes(48)}A.expect=N,A.session.clientCertificate!==null&&(A.expect=I),A.process()},a.handleCertificateRequest=function(A,$,O){if(O<3)return A.error(A,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var w=$.fragment,M={certificate_types:s(w,1),certificate_authorities:s(w,2)};A.session.certificateRequest=M,A.expect=m,A.process()},a.handleCertificateVerify=function(A,$,O){if(O<2)return A.error(A,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var w=$.fragment;w.read-=4;var M=w.bytes();w.read+=4;var H={signature:s(w,2).getBytes()},F=e.util.createBuffer();F.putBuffer(A.session.md5.digest()),F.putBuffer(A.session.sha1.digest()),F=F.getBytes();try{var X=A.session.clientCertificate;if(!X.publicKey.verify(F,H.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");A.session.md5.update(M),A.session.sha1.update(M)}catch{return A.error(A,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure}})}A.expect=N,A.process()},a.handleServerHelloDone=function(A,$,O){if(O>0)return A.error(A,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.record_overflow}});if(A.serverCertificate===null){var w={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.insufficient_security}},M=0,H=A.verify(A,w.alert.description,M,[]);if(H!==!0)return(H||H===0)&&(typeof H=="object"&&!e.util.isArray(H)?(H.message&&(w.message=H.message),H.alert&&(w.alert.description=
227H.alert)):typeof H=="number"&&(w.alert.description=H)),A.error(A,w)}A.session.certificateRequest!==null&&($=a.createRecord(A,{type:a.ContentType.handshake,data:a.createCertificate(A)}),a.queue(A,$)),$=a.createRecord(A,{type:a.ContentType.handshake,data:a.createClientKeyExchange(A)}),a.queue(A,$),A.expect=S;var F=function(X,ce){X.session.certificateRequest!==null&&X.session.clientCertificate!==null&&a.queue(X,a.createRecord(X,{type:a.ContentType.handshake,data:a.createCertificateVerify(X,ce)})),a.queue(X,a.createRecord(X,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),X.state.pending=a.createConnectionState(X),X.state.current.write=X.state.pending.write,a.queue(X,a.createRecord(X,{type:a.ContentType.handshake,data:a.createFinished(X)})),X.expect=d,a.flush(X),X.process()};if(A.session.certificateRequest===null||A.session.clientCertificate===null)return F(A,null);a.getClientSignature(A,F)},a.handleChangeCipherSpec=function(A,$){if($.fragment.getByte()!==1)return A.error(A,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var O=A.entity===a.ConnectionEnd.client;(A.session.resuming&&O||!A.session.resuming&&!O)&&(A.state.pending=a.createConnectionState(A)),A.state.current.read=A.state.pending.read,(!A.session.resuming&&O||A.session.resuming&&!O)&&(A.state.pending=null),A.expect=O?v:E,A.process()},a.handleFinished=function(A,$,O){var w=$.fragment;w.read-=4;var M=w.bytes();w.read+=4;var H=$.fragment.getBytes();w=e.util.createBuffer(),w.putBuffer(A.session.md5.digest()),w.putBuffer(A.session.sha1.digest());var F=A.entity===a.ConnectionEnd.client,X=F?"server finished":"client finished",ce=A.session.sp,ae=12,re=t;if(w=re(ce.master_secret,X,w.getBytes(),ae),w.getBytes()!==H)return A.error(A,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decrypt_error}});A.session.md5.update(M),A.session.sha1.update(M),(A.session.resuming&&F||!A.session.resuming&&!F)&&(a.queue(A,a.createRecord(A,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),A.state.current.write=A.state.pending.write,A.state.pending=null,a.queue(A,a.createRecord(A,{type:a.ContentType.handshake,data:a.createFinished(A)}))),A.expect=F?b:g,A.handshaking=!1,++A.handshakes,A.peerCertificate=F?A.session.serverCertificate:A.session.clientCertificate,a.flush(A),A.isConnected=!0,A.connected(A),A.process()},a.handleAlert=function(A,$){var O=$.fragment,w={level:O.getByte(),description:O.getByte()},M;switch(w.description){case a.Alert.Description.close_notify:M="Connection closed.";break;case a.Alert.Description.unexpected_message:M="Unexpected message.";break;case a.Alert.Description.bad_record_mac:M="Bad record MAC.";break;case a.Alert.Description.decryption_failed:M="Decryption failed.";break;case a.Alert.Description.record_overflow:M="Record overflow.";break;case a.Alert.Description.decompression_failure:M="Decompression failed.";break;case a.Alert.Description.handshake_failure:M="Handshake failure.";break;case a.Alert.Description.bad_certificate:M="Bad certificate.";break;case a.Alert.Description.unsupported_certificate:M="Unsupported certificate.";break;case a.Alert.Description.certificate_revoked:M="Certificate revoked.";break;case a.Alert.Description.certificate_expired:M="Certificate expired.";break;case a.Alert.Description.certificate_unknown:M="Certificate unknown.";break;case a.Alert.Description.illegal_parameter:M="Illegal parameter.";break;case a.Alert.Description.unknown_ca:M="Unknown certificate authority.";break;case a.Alert.Description.access_denied:M="Access denied.";break;case a.Alert.Description.decode_error:M="Decode error.";break;case a.Alert.Description.decrypt_error:M="Decrypt error.";break;case a.Alert.Description.export_restriction:M="Export restriction.";break;case a.Alert.Description.protocol_version:M="Unsupported protocol version.";break;case a.Alert.Description.insufficient_security:M="Insufficient security.";break;case a.Alert.Description.internal_error:M="Internal error.";break;case a.Alert.Description.user_canceled:M="User canceled.";break;case a.Alert.Description.no_renegotiation:M="Renegotiation not supported.";break;default:M="Unknown error.";break}if(w.description===a.Alert.Description.close_notify)return A.close();A.error(A,{message:M,send:!1,origin:A.entity===a.ConnectionEnd.client?"server"
vendor: 8,116 bytes, line 227
227:"client",alert:w}),A.process()},a.handleHandshake=function(A,$){var O=$.fragment,w=O.getByte(),M=O.getInt24();if(M>O.length())return A.fragmented=$,$.fragment=e.util.createBuffer(),O.read-=4,A.process();A.fragmented=null,O.read-=4;var H=O.bytes(M+4);O.read+=4,w in J[A.entity][A.expect]?(A.entity===a.ConnectionEnd.server&&!A.open&&!A.fail&&(A.handshaking=!0,A.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:e.md.md5.create(),sha1:e.md.sha1.create()}),w!==a.HandshakeType.hello_request&&w!==a.HandshakeType.certificate_verify&&w!==a.HandshakeType.finished&&(A.session.md5.update(H),A.session.sha1.update(H)),J[A.entity][A.expect][w](A,$,M)):a.handleUnexpected(A,$)},a.handleApplicationData=function(A,$){A.data.putBuffer($.fragment),A.dataReady(A),A.process()},a.handleHeartbeat=function(A,$){var O=$.fragment,w=O.getByte(),M=O.getInt16(),H=O.getBytes(M);if(w===a.HeartbeatMessageType.heartbeat_request){if(A.handshaking||M>H.length)return A.process();a.queue(A,a.createRecord(A,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_response,H)})),a.flush(A)}else if(w===a.HeartbeatMessageType.heartbeat_response){if(H!==A.expectedHeartbeatPayload)return A.process();A.heartbeatReceived&&A.heartbeatReceived(A,e.util.createBuffer(H))}A.process()};var c=0,l=1,f=2,y=3,m=4,d=5,v=6,b=7,S=8,u=0,C=1,x=2,I=3,N=4,E=5,g=6,p=a.handleUnexpected,T=a.handleChangeCipherSpec,R=a.handleAlert,B=a.handleHandshake,P=a.handleApplicationData,D=a.handleHeartbeat,U=[];U[a.ConnectionEnd.client]=[[p,R,B,p,D],[p,R,B,p,D],[p,R,B,p,D],[p,R,B,p,D],[p,R,B,p,D],[T,R,p,p,D],[p,R,B,p,D],[p,R,B,P,D],[p,R,B,p,D]],U[a.ConnectionEnd.server]=[[p,R,B,p,D],[p,R,B,p,D],[p,R,B,p,D],[p,R,B,p,D],[T,R,p,p,D],[p,R,B,p,D],[p,R,B,P,D],[p,R,B,p,D]];var _=a.handleHelloRequest,V=a.handleServerHello,z=a.handleCertificate,q=a.handleServerKeyExchange,G=a.handleCertificateRequest,Y=a.handleServerHelloDone,ee=a.handleFinished,J=[];J[a.ConnectionEnd.client]=[[p,p,V,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,z,q,G,Y,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,q,G,Y,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,p,G,Y,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,p,p,Y,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,ee],[_,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[_,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];var te=a.handleClientHello,Q=a.handleClientKeyExchange,Z=a.handleCertificateVerify;J[a.ConnectionEnd.server]=[[p,te,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,z,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,Q,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,Z,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,ee],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]],a.generateKeys=function(A,$){var O=t,w=$.client_random+$.server_random;A.session.resuming||($.master_secret=O($.pre_master_secret,"master secret",w,48).bytes(),$.pre_master_secret=null),w=$.server_random+$.client_random;var M=2*$.mac_key_length+2*$.enc_key_length,H=A.version.major===a.Versions.TLS_1_0.major&&A.version.minor===a.Versions.TLS_1_0.minor;H&&(M+=2*$.fixed_iv_length);var F=O($.master_secret,"key expansion",w,M),X={client_write_MAC_key:F.getBytes($.mac_key_length),server_write_MAC_key:F.getBytes($.mac_key_length),client_write_key:F.getBytes($.enc_key_length),server_write_key:F.getBytes($.enc_key_length)};return H&&(X.client_write_IV=F.getBytes($.fixed_iv_length),X.server_write_IV=F.getBytes($.fixed_iv_length)),X},a.createConnectionState=function(A){var $=A.entity===a.ConnectionEnd.client,O=function(){var H={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(F){return!0},compressionState:null,compressFunction:function(F){return!0},updateSequenceNumber:function(){H.sequenceNumber[1]===4294967295?(H.sequenceNumber[1]=0,++H.sequenceNumber[0]):++H.sequenceNumber[1]}};return H},w={read:O(),write:O()};if(w.read.update=function(H,F){return w.read.cipherFunction(F,w.read)?w.read.compressFunction(H,F,w.read)||H.error(H,{message:"Could not decompress record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decompression_failure}}):H.error(H,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_record_mac}}),!H.fail},w.write.update=function(H,F){return w.write.compressFunction(H,F,w.write)?w.write.cipherFunction(F,w.write)||H.error(H,{message:"Could not encrypt record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):H.error(H,{message:"Could not compress record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}),!H.fail},A.session){var M=A.session.sp;switch(A.session.cipherSuite.initSecurityParameters(M),M.keys=a.generateKeys(A,M),w.read.macKey=$?M.keys.server_write_MAC_key:M.keys.client_write_MAC_key,w.write.macKey=$?M.keys.client_write_MAC_key:M.keys.server_write_MAC_key,A.session.cipherSuite.initConnectionState(w,A,M),M.compression_algorithm){case a.CompressionMethod.none:break;case a.CompressionMethod.deflate:w.read.compressFunction=o,w.write.compressFunction=n;break;default:throw new Error("Unsupported compression algorithm.")}}return w},a.createRandom=function(){var A=new Date,$=+A+A.getTimezoneOffset()*6e4,O=e.util.createBuffer();return O.putInt32($),O.putBytes(e.random.getBytes(28)),O},a.createRecord=function(A,$){if(!$.data)return null;var O={type:$.type,version:{major:A.version.major,minor:A.version.minor},length:$.data.length(),fragment:$.data};return O},a.createAlert=function(A,$){var O=e.util.createBuffer();return O.putByte($.level),O.putByte($.description),a.createRecord(A,{type:a.ContentType.alert,data:O})},a.createClientHello=function(A){A.session.clientHelloVersion={major:A.version.major,minor:A.version.minor};for(var $=e.util.createBuffer(),O=0;O<A.cipherSuites.length;++O){var w=A.cipherSuites[O];$.putByte(w.id[0]),$.putByte(w.id[1])}var M=$.length(),H=e.util.createBuffer();H.putByte(a.CompressionMethod.none);var F=H.length(),X=e.util.createBuffer();if(A.virtualHost){var ce=e.util.createBuffer();ce.putByte(0),ce.putByte(0);var ae=e.util.createBuffer();ae.putByte(0),i(ae,2,e.util.createBuffer(A.virtualHost));var re=e.util.createBuffer();i(re,2,ae),i(ce,2,re),X.putBuffer(ce)}var de=X.length();de>0&&(de+=2);var Ce=A.session.id,he=Ce.length+1+2+4+28+2+M+1+F+de,ye=e.util.createBuffer();return ye.putByte(a.HandshakeType.client_hello),ye.putInt24(he),ye.putByte(A.version.major),ye.putByte(A.version.minor),ye.putBytes(A.session.sp.client_random),i(ye,1,e.util.createBuffer(Ce)),i(ye,2,$),i(ye,1,H),de>0&&i(ye,2,X),ye},a.createServerHello=function(A){var $=A.session.id,O=$.length+1+2+4+28+2+1,w=e.util.createBuffer();return w.putByte(a.HandshakeType.server_hello),w.putInt24(O),w.putByte(A.version.major),w.putByte(A.version.minor),w.putBytes(A.session.sp.server_random),i(w,1,e.util.createBuffer($)),w.putByte(A.session.cipherSuite.id[0]),w.putByte(A.session.cipherSuite.id[1]),w.putByte(A.session.compressionMethod),w},a.createCertificate=function(A){var $=A.entity===a.ConnectionEnd.client,O=null;if(A.getCertificate){var w;$?w=A.session.certificateRequest:w=A.session.extensions.server_name.serverNameList,O=A.getCertificate(A,w)}var M=e.util.createBuffer();if(O!==null)try{e.util.isArray(O)||(O=[O]);for(var H=null,F=0;F<O.length;++F){var X=e.pem.decode(O[F])[0];if(X.type!=="CERTIFICATE"&&X.type!=="X509 CERTIFICATE"&&X.type!=="TRUSTED CERTIFICATE"){var ce=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw ce.headerType=X.type,ce}if(X.procType&&X.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var ae=e.util.createBuffer(X.body);H===null&&(H=e.asn1.fromDer(ae.bytes(),!1));var re=e.util.createBuffer();i(re,3,ae),M.putBuffer(re)}
227O=e.pki.certificateFromAsn1(H),$?A.session.clientCertificate=O:A.session.serverCertificate=O}catch(he){return A.error(A,{message:"Could not send certificate list.",cause:he,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}var de=3+M.length(),Ce=e.util.createBuffer();return Ce.putByte(a.HandshakeType.certificate),Ce.putInt24(de),i(Ce,3,M),Ce},a.createClientKeyExchange=function(A){var $=e.util.createBuffer();$.putByte(A.session.clientHelloVersion.major),$.putByte(A.session.clientHelloVersion.minor),$.putBytes(e.random.getBytes(46));var O=A.session.sp;O.pre_master_secret=$.getBytes();var w=A.session.serverCertificate.publicKey;$=w.encrypt(O.pre_master_secret);var M=$.length+2,H=e.util.createBuffer();return H.putByte(a.HandshakeType.client_key_exchange),H.putInt24(M),H.putInt16($.length),H.putBytes($),H},a.createServerKeyExchange=function(A){var $=e.util.createBuffer();return $},a.getClientSignature=function(A,$){var O=e.util.createBuffer();O.putBuffer(A.session.md5.digest()),O.putBuffer(A.session.sha1.digest()),O=O.getBytes(),A.getSignature=A.getSignature||function(w,M,H){var F=null;if(w.getPrivateKey)try{F=w.getPrivateKey(w,w.session.clientCertificate),F=e.pki.privateKeyFromPem(F)}catch(X){w.error(w,{message:"Could not get private key.",cause:X,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}F===null?w.error(w,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):M=F.sign(M,null),H(w,M)},A.getSignature(A,O,$)},a.createCertificateVerify=function(A,$){var O=$.length+2,w=e.util.createBuffer();return w.putByte(a.HandshakeType.certificate_verify),w.putInt24(O),w.putInt16($.length),w.putBytes($),w},a.createCertificateRequest=function(A){var $=e.util.createBuffer();$.putByte(1);var O=e.util.createBuffer();for(var w in A.caStore.certs){var M=A.caStore.certs[w],H=e.pki.distinguishedNameToAsn1(M.subject),F=e.asn1.toDer(H);O.putInt16(F.length()),O.putBuffer(F)}var X=1+$.length()+2+O.length(),ce=e.util.createBuffer();return ce.putByte(a.HandshakeType.certificate_request),ce.putInt24(X),i(ce,1,$),i(ce,2,O),ce},a.createServerHelloDone=function(A){var $=e.util.createBuffer();return $.putByte(a.HandshakeType.server_hello_done),$.putInt24(0),$},a.createChangeCipherSpec=function(){var A=e.util.createBuffer();return A.putByte(1),A},a.createFinished=function(A){var $=e.util.createBuffer();$.putBuffer(A.session.md5.digest()),$.putBuffer(A.session.sha1.digest());var O=A.entity===a.ConnectionEnd.client,w=A.session.sp,M=12,H=t,F=O?"client finished":"server finished";$=H(w.master_secret,F,$.getBytes(),M);var X=e.util.createBuffer();return X.putByte(a.HandshakeType.finished),X.putInt24($.length()),X.putBuffer($),X},a.createHeartbeat=function(A,$,O){typeof O>"u"&&(O=$.length);var w=e.util.createBuffer();w.putByte(A),w.putInt16(O),w.putBytes($);var M=w.length(),H=Math.max(16,M-O-3);return w.putBytes(e.random.getBytes(H)),w},a.queue=function(A,$){if($&&!($.fragment.length()===0&&($.type===a.
227ContentType.handshake||$.type===a.ContentType.alert||$.type===a.ContentType.change_cipher_spec))){if($.type===a.ContentType.handshake){var O=$.fragment.bytes();A.session.md5.update(O),A.session.sha1.update(O),O=null}var w;if($.fragment.length()<=a.MaxFragment)w=[$];else{w=[];for(var M=$.fragment.bytes();M.length>a.MaxFragment;)w.push(a.createRecord(A,{type:$.type,data:e.util.createBuffer(M.slice(0,a.MaxFragment))})),M=M.slice(a.MaxFragment);M.length>0&&w.push(a.createRecord(A,{type:$.type,data:e.util.createBuffer(M)}))}for(var H=0;H<w.length&&!A.fail;++H){var F=w[H],X=A.state.current.write;X.update(A,F)&&A.records.push(F)}}},a.flush=function(A){for(var $=0;$<A.records.length;++$){var O=A.records[$];A.tlsData.putByte(O.type),A.tlsData.putByte(O.version.major),A.tlsData.putByte(O.version.minor),A.tlsData.putInt16(O.fragment.length()),A.tlsData.putBuffer(A.records[$].fragment)}return A.records=[],A.tlsDataReady(A)};var W=function(A){switch(A){case!0:return!0;case e.pki.certificateError.bad_certificate:return a.Alert.Description.bad_certificate;case e.pki.certificateError.unsupported_certificate:return a.Alert.Description.unsupported_certificate;case e.pki.certificateError.certificate_revoked:return a.Alert.Description.certificate_revoked;case e.pki.certificateError.certificate_expired:return a.Alert.Description.certificate_expired;case e.pki.certificateError.certificate_unknown:return a.Alert.Description.certificate_unknown;case e.pki.certificateError.unknown_ca:return a.Alert.Description.unknown_ca;default:return a.Alert.Description.bad_certificate}},oe=function(A){switch(A){case!0:return!0;case a.Alert.Description.bad_certificate:return e.pki.certificateError.bad_certificate;case a.Alert.Description.unsupported_certificate:return e.pki.certificateError.unsupported_certificate;case a.Alert.Description.certificate_revoked:return e.pki.certificateError.certificate_revoked;case a.Alert.Description.certificate_expired:return e.pki.certificateError.certificate_expired;case a.Alert.Description.certificate_unknown:return e.pki.certificateError.certificate_unknown;case a.Alert.Description.unknown_ca:return e.pki.certificateError.unknown_ca;default:return e.pki.certificateError.bad_certificate}};a.verifyCertificateChain=function(A,$){try{var O={};for(var w in A.verifyOptions)O[w]=A.verifyOptions[w];O.verify=function(H,F,X){var ce=W(H),ae=A.verify(A,H,F,X);if(ae!==!0){if(typeof ae=="object"&&!e.util.isArray(ae)){var re=new Error("The application rejected the certificate.");throw re.send=!0,re.alert={level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate},ae.message&&(re.message=ae.message),ae.alert&&(re.alert.description=ae.alert),re}ae!==H&&(ae=oe(ae))}return ae},e.pki.verifyCertificateChain(A.caStore,$,O)}catch(H){var M=H;(typeof M!="object"||e.util.isArray(M))&&(M={send:!0,alert:{level:a.Alert.Level.fatal,description:W(H)}}),"send"in M||(M.send=!0),"alert"in M||(M.alert={level:a.Alert.Level.fatal,description:W(M.error)}),A.error(A,M)}return!A.fail},a.createSessionCache=function(A,$){var O=null;if(A&&A.getSession&&A.setSession&&A.order)O=A;else{O={},O.cache=A||{},O.capacity=Math.max($||100,1),O.order=[];for(var w in A)O.order.length<=$?O.order.push(w):delete A[w];O.getSession=function(M){var H=null,F=null;if(M?F=e.util.bytesToHex(M):O.order.length>0&&(F=O.order[0]),F!==null&&F in O.cache){H=O.cache[F],delete O.cache[F];for(var X in O.order)if(O.order[X]===F){O.order.splice(X,1);break}}return H},O.setSession=function(M,H){if(O.order.length===O.capacity){var F=O.order.shift();delete O.cache[F]}var F=e.util.bytesToHex(M);O.order.push(F),O.cache[F]=H}}return O},a.createConnection=function(A){var $=null;A.caStore?e.util.isArray(A.caStore)?$=e.pki.createCaStore(A.caStore):$=A.caStore:$=e.pki.createCaStore();var O=A.cipherSuites||null;if(O===null){O=[];for(var w in a.CipherSuites)O.push(a.CipherSuites[w])}var M=A.server?a.ConnectionEnd.server:a.ConnectionEnd.client,H=A.sessionCache?a.createSessionCache(A.sessionCache):null,F={version:{major:a.Version.major,minor:a.Version.minor},entity:M,sessionId:A.sessionId,caStore:$,sessionCache:H,cipherSuites:O,connected:A.connected,virtualHost:A.virtualHost||null,verifyClient:A.verifyClient||!1,verify:A.verify||function(re,de,Ce,he){return de},verifyOptions:A.verifyOptions||{},getCertificate:A.getCertificate||null,getPrivateKey:A.getPrivateKey||null,getSignature:A.getSignature||null,input:e.util.createBuffer(),tlsData:e.util.createBuffer(),data:e.util.createBuffer(),tlsDataReady:A.tlsDataReady,dataReady:A.dataReady,heartbeatReceived:A.heartbeatReceived,closed:A.closed,error:function(re,de){de.origin=de.origin||(re.entity===a.ConnectionEnd.client?"client":"server"),de.send&&
227(a.queue(re,a.createAlert(re,de.alert)),a.flush(re));var Ce=de.fatal!==!1;Ce&&(re.fail=!0),A.error(re,de),Ce&&re.close(!1)},deflate:A.deflate||null,inflate:A.inflate||null};F.reset=function(re){F.version={major:a.Version.major,minor:a.Version.minor},F.record=null,F.session=null,F.peerCertificate=null,F.state={pending:null,current:null},F.expect=F.entity===a.ConnectionEnd.client?c:u,F.fragmented=null,F.records=[],F.open=!1,F.handshakes=0,F.handshaking=!1,F.isConnected=!1,F.fail=!(re||typeof re>"u"),F.input.clear(),F.tlsData.clear(),F.data.clear(),F.state.current=a.createConnectionState(F)},F.reset();var X=function(re,de){var Ce=de.type-a.ContentType.change_cipher_spec,he=U[re.entity][re.expect];Ce in he?he[Ce](re,de):a.handleUnexpected(re,de)},ce=function(re){var de=0,Ce=re.input,he=Ce.length();if(he<5)de=5-he;else{re.record={type:Ce.getByte(),version:{major:Ce.getByte(),minor:Ce.getByte()},length:Ce.getInt16(),fragment:e.util.createBuffer(),ready:!1};var ye=re.record.version.major===re.version.major;ye&&re.session&&re.session.version&&(ye=re.record.version.minor===re.version.minor),ye||re.error(re,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}})}return de},ae=function(re){var de=0,Ce=re.input,he=Ce.length();if(he<re.record.length)de=re.record.length-he;else{re.record.fragment.putBytes(Ce.getBytes(re.record.length)),Ce.compact();var ye=re.state.current.read;ye.update(re,re.record)&&(re.fragmented!==null&&(re.fragmented.type===re.record.type?(re.fragmented.fragment.putBuffer(re.record.fragment),re.record=re.fragmented):re.error(re,{message:"Invalid fragmented record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unexpected_message}})),re.record.ready=!0)}return de};return F.handshake=function(re){if(F.entity!==a.ConnectionEnd.client)F.error(F,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(F.handshaking)F.error(F,{message:"Handshake already in progress.",fatal:!1});else{F.fail&&!F.open&&F.handshakes===0&&(F.fail=!1),F.handshaking=!0,re=re||"";var de=null;re.length>0&&(F.sessionCache&&(de=F.sessionCache.getSession(re)),de===null&&(re="")),re.length===0&&F.sessionCache&&(de=F.sessionCache.getSession(),de!==null&&(re=de.id)),F.session={id:re,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:e.md.md5.create(),sha1:e.md.sha1.create()},de&&(F.version=de.version,F.session.sp=de.sp),F.session.sp.client_random=a.createRandom().getBytes(),F.open=!0,a.queue(F,a.createRecord(F,{type:a.ContentType.handshake,data:a.createClientHello(F)})),a.flush(F)}},F.process=function(re){var de=0;return re&&F.input.putBytes(re),F.fail||(F.record!==null&&F.record.ready&&F.record.fragment.isEmpty()&&(F.record=null),F.record===null&&(de=ce(F)),!F.fail&&F.record!==null&&!F.record.ready&&(de=ae(F)),!F.fail&&F.record!==null&&F.record.ready&&X(F,F.record)),de},F.prepare=function(re){return a.queue(F,a.createRecord(F,{type:a.ContentType.application_data,data:e.util.createBuffer(re)})),a.flush(F)},F.prepareHeartbeatRequest=function(re,de){return re instanceof e.util.ByteBuffer&&(re=re.bytes()),typeof de>"u"&&(de=re.length),F.expectedHeartbeatPayload=re,a.queue(F,a.createRecord(F,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_request,re,de)})),a.flush(F)},F.close=function(re){if(!F.fail&&F.sessionCache&&F.session){var de={id:F.session.id,version:F.session.version,sp:F.session.sp};de.sp.keys=null,F.sessionCache.setSession(de.id,de)}F.open&&(F.open=!1,F.input.clear(),(F.isConnected||F.handshaking)&&(F.isConnected=F.handshaking=!1,a.queue(F,a.createAlert(F,{level:a.Alert.Level.warning,description:a.Alert.Description.close_notify})),a.flush(F)),F.closed(F)),F.reset(re)},F},cs=e.tls=e.tls||{};for(var ie in a)typeof a[ie]!="function"&&(e.tls[ie]=a[ie]);return e.tls.prf_tls1=t,e.tls.hmac_sha1=r,e.tls.createSessionCache=a.createSessionCache,e.tls.createConnection=a.createConnection,cs}var p0;function OE(){if(p0)return Vi.exports;p0=1;var e=nt();ln(),Hh();var t=Vi.exports=e.tls;t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(c){c.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,c.cipher_type=t.CipherType.block,c.enc_key_length=16,c.block_length=16,c.fixed_iv_length=16,c.record_iv_length=16,c.mac_algorithm=t.MACAlgorithm.hmac_sha1,c.mac_length=20,c.mac_key_length=20}
227,initConnectionState:r},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(c){c.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,c.cipher_type=t.CipherType.block,c.enc_key_length=32,c.block_length=16,c.fixed_iv_length=16,c.record_iv_length=16,c.mac_algorithm=t.MACAlgorithm.hmac_sha1,c.mac_length=20,c.mac_key_length=20},initConnectionState:r};function r(c,l,f){var y=l.entity===e.tls.ConnectionEnd.client;c.read.cipherState={init:!1,cipher:e.cipher.createDecipher("AES-CBC",y?f.keys.server_write_key:f.keys.client_write_key),iv:y?f.keys.server_write_IV:f.keys.client_write_IV},c.write.cipherState={init:!1,cipher:e.cipher.createCipher("AES-CBC",y?f.keys.client_write_key:f.keys.server_write_key),iv:y?f.keys.client_write_IV:f.keys.server_write_IV},c.read.cipherFunction=i,c.write.cipherFunction=n,c.read.macLength=c.write.macLength=f.mac_length,c.read.macFunction=c.write.macFunction=t.hmac_sha1}function n(c,l){var f=!1,y=l.macFunction(l.macKey,l.sequenceNumber,c);c.fragment.putBytes(y),l.updateSequenceNumber();var m;c.version.minor===t.Versions.TLS_1_0.minor?m=l.cipherState.init?null:l.cipherState.iv:m=e.random.getBytesSync(16),l.cipherState.init=!0;var d=l.cipherState.cipher;return d.start({iv:m}),c.version.minor>=t.Versions.TLS_1_1.minor&&d.output.putBytes(m),d.update(c.fragment),d.finish(o)&&(c.fragment=d.output,c.length=c.fragment.length(),f=!0),f}function o(c,l,f){if(!f){var y=c-l.length()%c;l.fillWithByte(y-1,y)}return!0}function s(c,l,f){var y=!0;if(f){for(var m=l.length(),d=l.last(),v=m-1-d;v<m-1;++v)y=y&&l.at(v)==d;y&&l.truncate(d+1)}return y}function i(c,l){var f=!1,y;c.version.minor===t.Versions.TLS_1_0.minor?y=l.cipherState.init?null:l.cipherState.iv:y=c.fragment.getBytes(16),l.cipherState.init=!0;var m=l.cipherState.cipher;m.start({iv:y}),m.update(c.fragment),f=m.finish(s);var d=l.macLength,v=e.random.getBytesSync(d),b=m.output.length();b>=d?(c.fragment=m.output.getBytes(b-d),v=m.output.getBytes(d)):c.fragment=m.output.getBytes(),c.fragment=e.util.createBuffer(c.fragment),c.length=c.fragment.length();var S=l.macFunction(l.macKey,l.sequenceNumber,c);return l.updateSequenceNumber(),f=a(l.macKey,v,S)&&f,f}function a(c,l,f){var y=e.hmac.create();return y.start("SHA1",c),y.update(l),l=y.digest().getBytes(),y.start(null,null),y.update(f),f=y.digest().getBytes(),l===f}return Vi.exports}
227var us={exports:{}},h0;function zh(){if(h0)return us.exports;h0=1;var e=nt();Fr(),pt();var t=us.exports=e.sha512=e.sha512||{};e.md.sha512=e.md.algorithms.sha512=t;var r=e.sha384=e.sha512.sha384=e.sha512.sha384||{};r.create=function(){return t.create("SHA-384")},e.md.sha384=e.md.algorithms.sha384=r,e.sha512.sha256=e.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},e.md["sha512/256"]=e.md.algorithms["sha512/256"]=e.sha512.sha256,e.sha512.sha224=e.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},e.md["sha512/224"]=e.md.algorithms["sha512/224"]=e.sha512.sha224,t.create=function(l){if(o||a(),typeof l>"u"&&(l="SHA-512"),!(l in i))throw new Error("Invalid SHA-512 algorithm: "+l);for(var f=i[l],y=null,m=e.util.createBuffer(),d=new Array(80),v=0;v<80;++v)d[v]=new Array(2);var b=64;switch(l){case"SHA-384":b=48;break;case"SHA-512/256":b=32;break;case"SHA-512/224":b=28;break}var S={algorithm:l.replace("-","").toLowerCase(),blockLength:128,digestLength:b,messageLength:0,fullMessageLength:null,messageLengthSize:16};return S.start=function(){S.messageLength=0,S.fullMessageLength=S.messageLength128=[];for(var u=S.messageLengthSize/4,C=0;C<u;++C)S.fullMessageLength.push(0);m=e.util.createBuffer(),y=new Array(f.length);for(var C=0;C<f.length;++C)y[C]=f[C].slice(0);return S},S.start(),S.update=function(u,C){C==="utf8"&&(u=e.util.encodeUtf8(u));var x=u.length;S.messageLength+=x,x=[x/4294967296>>>0,x>>>0];for(var I=S.fullMessageLength.length-1;I>=0;--I)S.fullMessageLength[I]+=x[1],x[1]=x[0]+(S.fullMessageLength[I]/4294967296>>>0),S.fullMessageLength[I]=S.fullMessageLength[I]>>>0,x[0]=x[1]/4294967296>>>0;return m.putBytes(u),c(y,d,m),(m.read>2048||m.length()===0)&&m.compact(),S},S.digest=function(){var u=e.util.createBuffer();u.putBytes(m.bytes());var C=S.fullMessageLength[S.fullMessageLength.length-1]+S.messageLengthSize,x=C&S.blockLength-1;u.putBytes(n.substr(0,S.blockLength-x));for(var I,N,E=S.fullMessageLength[0]*8,g=0;g<S.fullMessageLength.length-1;++g)I=S.fullMessageLength[g+1]*8,N=I/4294967296>>>0,E+=N,u.putInt32(E>>>0),E=I>>>0;u.putInt32(E);for(var p=new Array(y.length),g=0;g<y.length;++g)p[g]=y[g].slice(0);c(p,d,u);var T=e.util.createBuffer(),R;l==="SHA-512"?R=p.length:l==="SHA-384"?R=p.length-2:R=p.length-4;for(var g=0;g<R;++g)T.putInt32(p[g][0]),(g!==R-1||l!=="SHA-512/224")&&T.putInt32(p[g][1]);return T},S};var n=null,o=!1,s=null,i=null;function a(){n="Â",n+=e.util.fillString("\0",128),s=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],i={},i["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],i["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],i["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,28279439
22707],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],i["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0}function c(l,f,y){for(var m,d,v,b,S,u,C,x,I,N,E,g,p,T,R,B,P,D,U,_,V,z,q,G,Y,ee,J,te,Q,Z,W,oe,ie,A,$,O=y.length();O>=128;){for(Q=0;Q<16;++Q)f[Q][0]=y.getInt32()>>>0,f[Q][1]=y.getInt32()>>>0;for(;Q<80;++Q)oe=f[Q-2],Z=oe[0],W=oe[1],m=((Z>>>19|W<<13)^(W>>>29|Z<<3)^Z>>>6)>>>0,d=((Z<<13|W>>>19)^(W<<3|Z>>>29)^(Z<<26|W>>>6))>>>0,A=f[Q-15],Z=A[0],W=A[1],v=((Z>>>1|W<<31)^(Z>>>8|W<<24)^Z>>>7)>>>0,b=((Z<<31|W>>>1)^(Z<<24|W>>>8)^(Z<<25|W>>>7))>>>0,ie=f[Q-7],$=f[Q-16],W=d+ie[1]+b+$[1],f[Q][0]=m+ie[0]+v+$[0]+(W/4294967296>>>0)>>>0,f[Q][1]=W>>>0;for(p=l[0][0],T=l[0][1],R=l[1][0],B=l[1][1],P=l[2][0],D=l[2][1],U=l[3][0],_=l[3][1],V=l[4][0],z=l[4][1],q=l[5][0],G=l[5][1],Y=l[6][0],ee=l[6][1],J=l[7][0],te=l[7][1],Q=0;Q<80;++Q)C=((V>>>14|z<<18)^(V>>>18|z<<14)^(z>>>9|V<<23))>>>0,x=((V<<18|z>>>14)^(V<<14|z>>>18)^(z<<23|V>>>9))>>>0,I=(Y^V&(q^Y))>>>0,N=(ee^z&(G^ee))>>>0,S=((p>>>28|T<<4)^(T>>>2|p<<30)^(T>>>7|p<<25))>>>0,u=((p<<4|T>>>28)^(T<<30|p>>>2)^(T<<25|p>>>7))>>>0,E=(p&R|P&(p^R))>>>0,g=(T&B|D&(T^B))>>>0,W=te+x+N+s[Q][1]+f[Q][1],m=J+C+I+s[Q][0]+f[Q][0]+(W/4294967296>>>0)>>>0,d=W>>>0,W=u+g,v=S+E+(W/4294967296>>>0)>>>0,b=W>>>0,J=Y,te=ee,Y=q,ee=G,q=V,G=z,W=_+d,V=U+m+(W/4294967296>>>0)>>>0,z=W>>>0,U=P,_=D,P=R,D=B,R=p,B=T,W=d+b,p=m+v+(W/4294967296>>>0)>>>0,T=W>>>0;W=l[0][1]+T,l[0][0]=l[0][0]+p+(W/4294967296>>>0)>>>0,l[0][1]=W>>>0,W=l[1][1]+B,l[1][0]=l[1][0]+R+(W/4294967296>>>0)>>>0,l[1][1]=W>>>0,W=l[2][1]+D,l[2][0]=l[2][0]+P+(W/4294967296>>>0)>>>0,l[2][1]=W>>>0,W=l[3][1]+_,l[3][0]=l[3][0]+U+(W/4294967296>>>0)>>>0,l[3][1]=W>>>0,W=l[4][1]+z,l[4][0]=l[4][0]+V+(W/4294967296>>>0)>>>0,l[4][1]=W>>>0,W=l[5][1]+G,l[5][0]=l[5][0]+q+(W/4294967296>>>0)>>>0,l[5][1]=W>>>0,W=l[6][1]+ee,l[6][0]=l[6][0]+Y+(W/4294967296>>>0)>>>0,l[6][1]=W>>>0,W=l[7][1]+te,l[7][0]=l[7][0]+J+(W/4294967296>>>0)>>>0,l[7][1]=W>>>0,O-=128}}return us.exports}var Ua={},m0;function _E(){if(m0)return Ua;m0=1;var e=nt();Nr();var t=e.asn1;return Ua.privateKeyValidator={name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Ua.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]},Ua}var ds,g0;function kE(){if(g0)return ds;g0=1;var e=nt();ri(),xr(),zh(),pt();var t=_E(),r=t.publicKeyValidator,n=t.privateKeyValidator;if(typeof o>"u")var o=e.jsbn.BigInteger;var s=e.util.ByteBuffer,i=typeof Buffer>"u"?Uint8Array:Buffer;e.pki=e.pki||{},ds=e.pki.ed25519=e.ed25519=e.ed25519||{};var a=e.ed25519;a.constants={},a.constants.PUBLIC_KEY_BYTE_LENGTH=32,a.constants.PRIVATE_KEY_BYTE_LENGTH=64,a.constants.SEED_BYTE_LENGTH=32,a.constants.SIGN_BYTE_LENGTH=64,a.constants.HASH_BYTE_LENGTH=64,a.generateKeyPair=function(A){A=A||{};var $=A.seed;if($===void 0)$=e.random.getBytesSync(a.constants.SEED_BYTE_LENGTH);else if(typeof $=="string"){if($.length!==a.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+a.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!($ instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');$=c({message:$,encoding:"binary"});for(var O=new i(a.constants.PUBLIC_KEY_BYTE_LENGTH),w=new i(a.constants.PRIVATE_KEY_BYTE_LENGTH),M=0;M<32;++M)w[M]=$[M];return C(O,w),{publicKey:O,privateKey:w}},a.privateKeyFromAsn1=function(A){var $={},O=[],w=e.asn1.validate(A,n,$,O);if(!w){var M=new Error("Invalid Key.");throw M.errors=O,M}var H=e.asn1.derToOid($.privateKeyOid),F=e.oids.EdDSA25519;if(H!==F)throw new Error('Invalid OID "'+H+'"; OID must be "'+F+'".');var X=$.privateKey,ce=c({message:e.asn1.fromDer(X).value,encoding:"binary"});return{privateKeyBytes:ce}},a.publicKeyFromAsn1=function(A){var $={},O=[],w=e.asn1.validate(A,r,$,O);if(!w){var M=new Error("Invalid Key.");throw M.errors=O,M}var H=e.asn1.derToOid($.publicKeyOid),F=e.oids.EdDSA25519;if(H!==F)throw new Error('Invalid OID "'+H+'"; OID must be "'+F+'".');var X=$.ed25519PublicKey;if(X.length!==a.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Ke
227y length is invalid.");return c({message:X,encoding:"binary"})},a.publicKeyFromPrivateKey=function(A){A=A||{};var $=c({message:A.privateKey,encoding:"binary"});if($.length!==a.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+a.constants.PRIVATE_KEY_BYTE_LENGTH);for(var O=new i(a.constants.PUBLIC_KEY_BYTE_LENGTH),w=0;w<O.length;++w)O[w]=$[32+w];return O},a.sign=function(A){A=A||{};var $=c(A),O=c({message:A.privateKey,encoding:"binary"});if(O.length===a.constants.SEED_BYTE_LENGTH){var w=a.generateKeyPair({seed:O});O=w.privateKey}else if(O.length!==a.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+a.constants.SEED_BYTE_LENGTH+" or "+a.constants.PRIVATE_KEY_BYTE_LENGTH);var M=new i(a.constants.SIGN_BYTE_LENGTH+$.length);x(M,$,$.length,O);for(var H=new i(a.constants.SIGN_BYTE_LENGTH),F=0;F<H.length;++F)H[F]=M[F];return H},a.verify=function(A){A=A||{};var $=c(A);if(A.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var O=c({message:A.signature,encoding:"binary"});if(O.length!==a.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+a.constants.SIGN_BYTE_LENGTH);var w=c({message:A.publicKey,encoding:"binary"});if(w.length!==a.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+a.constants.PUBLIC_KEY_BYTE_LENGTH);var M=new i(a.constants.SIGN_BYTE_LENGTH+$.length),H=new i(a.constants.SIGN_BYTE_LENGTH+$.length),F;for(F=0;F<a.constants.SIGN_BYTE_LENGTH;++F)M[F]=O[F];for(F=0;F<$.length;++F)M[F+a.constants.SIGN_BYTE_LENGTH]=$[F];return I(H,M,M.length,w)>=0};function c(A){var $=A.message;if($ instanceof Uint8Array||$ instanceof i)return $;var O=A.encoding;if($===void 0)if(A.md)$=A.md.digest().getBytes(),O="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof $=="string"&&!O)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof $=="string"){if(typeof Buffer<"u")return Buffer.from($,O);$=new s($,O)}else if(!($ instanceof s))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var w=new i($.length()),M=0;M<w.length;++M)w[M]=$.at(M);return w}var l=Q(),f=Q([1]),y=Q([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),m=Q([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=Q([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=Q([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),S=Q([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function u(A,$){var O=e.md.sha512.create(),w=new s(A);O.update(w.getBytes($),"binary");var M=O.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(M,"binary");for(var H=new i(a.constants.HASH_BYTE_LENGTH),F=0;F<64;++F)H[F]=M.charCodeAt(F);return H}function C(A,$){var O=[Q(),Q(),Q(),Q()],w,M=u($,32);for(M[0]&=248,M[31]&=127,M[31]|=64,G(O,M),T(A,O),w=0;w<32;++w)$[w+32]=A[w];return 0}function x(A,$,O,w){var M,H,F=new Float64Array(64),X=[Q(),Q(),Q(),Q()],ce=u(w,32);ce[0]&=248,ce[31]&=127,ce[31]|=64;var ae=O+64;for(M=0;M<O;++M)A[64+M]=$[M];for(M=0;M<32;++M)A[32+M]=ce[32+M];var re=u(A.subarray(32),O+32);for(E(re),G(X,re),T(A,X),M=32;M<64;++M)A[M]=w[M];var de=u(A,O+64);for(E(de),M=32;M<64;++M)F[M]=0;for(M=0;M<32;++M)F[M]=re[M];for(M=0;M<32;++M)for(H=0;H<32;H++)F[M+H]+=de[M]*ce[H];return N(A.subarray(32),F),ae}function I(A,$,O,w){var M,H,F=new i(32),X=[Q(),Q(),Q(),Q()],ce=[Q(),Q(),Q(),Q()];if(H=-1,O<64||B(ce,w))return-1;for(M=0;M<O;++M)A[M]=$[M];for(M=0;M<32;++M)A[M+32]=w[M];var ae=u(A,O);if(E(ae),q(X,ce,ae),G(ce,$.subarray(32)),g(X,ce),T(F,X),O-=64,_($,0,F,0)){for(M=0;M<O;++M)A[M]=0;return-1}for(M=0;M<O;++M)A[M]=$[M+64];return H=O,H}function N(A,$){var O,w,M,H;for(w=63;w>=32;--w){for(O=0,M=w-32,H=w-12;M<H;++M)$[M]+=O-16*$[w]*b[M-(w-32)],O=$[M]+128>>8,$[M]-=O*256;$[M]+=O,$[w]=0}for(O=0,M=0;M<32;++M)$[M]+=O-($[31]>>4)*b[M],O=$[M]>>8,$[M]&=255;for(M=0;M<32;++M)$[M]-=O*b[M];for(w=0;w<32;++w)$[w+1]+=$[w]>>8,A[w]=$[w]&255}function E(A){for(var $=new Float64Array(64),O=0;O<64;++O)$[O]=A[O],A[O]=0;N(A,$)}function g(A,$){var O=Q(),w=Q(),M=Q(),H=Q(),F=Q(),X=Q(),ce=Q(),ae=Q(),re=Q();W(O,A[1],A[0]),W(re,$[1],$[0]),ie(O,O,re),Z(w,A[0],A[1]),Z(re,$[0],$[1]),ie(w,w,re),ie(M,A[3],$[3]),ie(M,M,m),ie(H,A[2],$[2]),Z(H,H,H),W(F,w,O),W(X,H,M),Z(ce,H,M),Z(ae,w,O),ie(A[0],F,X),ie(A[1],ae,ce),ie(A[2],ce,X),ie(A[3],F,ae)}function p(A,$,O){for(var w=0;w<4;++w)te(A[w],$[w],O)}function T(A,$){var O=Q(),w=Q(),M=Q();ee(M,$[2]),ie(O,$[0],M),ie(w,$[1],M),R(A,w),A[31]^=z(O)<<7}function R(A,$){var O,w,M,H=Q(),F=Q();for(O=0;O<16;++O)F[O]=$[O];for(J(F),J(F),J(F),w=0;w<2;
227++w){for(H[0]=F[0]-65517,O=1;O<15;++O)H[O]=F[O]-65535-(H[O-1]>>16&1),H[O-1]&=65535;H[15]=F[15]-32767-(H[14]>>16&1),M=H[15]>>16&1,H[14]&=65535,te(F,H,1-M)}for(O=0;O<16;O++)A[2*O]=F[O]&255,A[2*O+1]=F[O]>>8}function B(A,$){var O=Q(),w=Q(),M=Q(),H=Q(),F=Q(),X=Q(),ce=Q();return Y(A[2],f),P(A[1],$),oe(M,A[1]),ie(H,M,y),W(M,M,A[2]),Z(H,A[2],H),oe(F,H),oe(X,F),ie(ce,X,F),ie(O,ce,M),ie(O,O,H),D(O,O),ie(O,O,M),ie(O,O,H),ie(O,O,H),ie(A[0],O,H),oe(w,A[0]),ie(w,w,H),U(w,M)&&ie(A[0],A[0],S),oe(w,A[0]),ie(w,w,H),U(w,M)?-1:(z(A[0])===$[31]>>7&&W(A[0],l,A[0]),ie(A[3],A[0],A[1]),0)}function P(A,$){var O;for(O=0;O<16;++O)A[O]=$[2*O]+($[2*O+1]<<8);A[15]&=32767}function D(A,$){var O=Q(),w;for(w=0;w<16;++w)O[w]=$[w];for(w=250;w>=0;--w)oe(O,O),w!==1&&ie(O,O,$);for(w=0;w<16;++w)A[w]=O[w]}function U(A,$){var O=new i(32),w=new i(32);return R(O,A),R(w,$),_(O,0,w,0)}function _(A,$,O,w){return V(A,$,O,w,32)}function V(A,$,O,w,M){var H,F=0;for(H=0;H<M;++H)F|=A[$+H]^O[w+H];return(1&F-1>>>8)-1}function z(A){var $=new i(32);return R($,A),$[0]&1}function q(A,$,O){var w,M;for(Y(A[0],l),Y(A[1],f),Y(A[2],f),Y(A[3],l),M=255;M>=0;--M)w=O[M/8|0]>>(M&7)&1,p(A,$,w),g($,A),g(A,A),p(A,$,w)}function G(A,$){var O=[Q(),Q(),Q(),Q()];Y(O[0],d),Y(O[1],v),Y(O[2],f),ie(O[3],d,v),q(A,O,$)}function Y(A,$){var O;for(O=0;O<16;O++)A[O]=$[O]|0}function ee(A,$){var O=Q(),w;for(w=0;w<16;++w)O[w]=$[w];for(w=253;w>=0;--w)oe(O,O),w!==2&&w!==4&&ie(O,O,$);for(w=0;w<16;++w)A[w]=O[w]}function J(A){var $,O,w=1;for($=0;$<16;++$)O=A[$]+w+65535,w=Math.floor(O/65536),A[$]=O-w*65536;A[0]+=w-1+37*(w-1)}function te(A,$,O){for(var w,M=~(O-1),H=0;H<16;++H)w=M&(A[H]^$[H]),A[H]^=w,$[H]^=w}function Q(A){var $,O=new Float64Array(16);if(A)for($=0;$<A.length;++$)O[$]=A[$];return O}function Z(A,$,O){for(var w=0;w<16;++w)A[w]=$[w]+O[w]}function W(A,$,O){for(var w=0;w<16;++w)A[w]=$[w]-O[w]}function oe(A,$){ie(A,$,$)}function ie(A,$,O){var w,M,H=0,F=0,X=0,ce=0,ae=0,re=0,de=0,Ce=0,he=0,ye=0,De=0,Fe=0,je=0,Le=0,_e=0,ze=0,Ue=0,be=0,Se=0,Pe=0,$e=0,ke=0,ct=0,at=0,ft=0,yt=0,ot=0,gt=0,bt=0,xt=0,It=0,ut=O[0],tt=O[1],We=O[2],it=O[3],Ee=O[4],Ie=O[5],Oe=O[6],ve=O[7],Te=O[8],se=O[9],fe=O[10],Ae=O[11],Ke=O[12],Ye=O[13],Je=O[14],st=O[15];w=$[0],H+=w*ut,F+=w*tt,X+=w*We,ce+=w*it,ae+=w*Ee,re+=w*Ie,de+=w*Oe,Ce+=w*ve,he+=w*Te,ye+=w*se,De+=w*fe,Fe+=w*Ae,je+=w*Ke,Le+=w*Ye,_e+=w*Je,ze+=w*st,w=$[1],F+=w*ut,X+=w*tt,ce+=w*We,ae+=w*it,re+=w*Ee,de+=w*Ie,Ce+=w*Oe,he+=w*ve,ye+=w*Te,De+=w*se,Fe+=w*fe,je+=w*Ae,Le+=w*Ke,_e+=w*Ye,ze+=w*Je,Ue+=w*st,w=$[2],X+=w*ut,ce+=w*tt,ae+=w*We,re+=w*it,de+=w*Ee,Ce+=w*Ie,he+=w*Oe,ye+=w*ve,De+=w*Te,Fe+=w*se,je+=w*fe,Le+=w*Ae,_e+=w*Ke,ze+=w*Ye,Ue+=w*Je,be+=w*st,w=$[3],ce+=w*ut,ae+=w*tt,re+=w*We,de+=w*it,Ce+=w*Ee,he+=w*Ie,ye+=w*Oe,De+=w*ve,Fe+=w*Te,je+=w*se,Le+=w*fe,_e+=w*Ae,ze+=w*Ke,Ue+=w*Ye,be+=w*Je,Se+=w*st,w=$[4],ae+=w*ut,re+=w*tt,de+=w*We,Ce+=w*it,he+=w*Ee,ye+=w*Ie,De+=w*Oe,Fe+=w*ve,je+=w*Te,Le+=w*se,_e+=w*fe,ze+=w*Ae,Ue+=w*Ke,be+=w*Ye,Se+=w*Je,Pe+=w*st,w=$[5],re+=w*ut,de+=w*tt,Ce+=w*We,he+=w*it,ye+=w*Ee,De+=w*Ie,Fe+=w*Oe,je+=w*ve,Le+=w*Te,_e+=w*se,ze+=w*fe,Ue+=w*Ae,be+=w*Ke,Se+=w*Ye,Pe+=w*Je,$e+=w*st,w=$[6],de+=w*ut,Ce+=w*tt,he+=w*We,ye+=w*it,De+=w*Ee,Fe+=w*Ie,je+=w*Oe,Le+=w*ve,_e+=w*Te,ze+=w*se,Ue+=w*fe,be+=w*Ae,Se+=w*Ke,Pe+=w*Ye,$e+=w*Je,ke+=w*st,w=$[7],Ce+=w*ut,he+=w*tt,ye+=w*We,De+=w*it,Fe+=w*Ee,je+=w*Ie,Le+=w*Oe,_e+=w*ve,ze+=w*Te,Ue+=w*se,be+=w*fe,Se+=w*Ae,Pe+=w*Ke,$e+=w*Ye,ke+=w*Je,ct+=w*st,w=$[8],he+=w*ut,ye+=w*tt,De+=w*We,Fe+=w*it,je+=w*Ee,Le+=w*Ie,_e+=w*Oe,ze+=w*ve,Ue+=w*Te,be+=w*se,Se+=w*fe,Pe+=w*Ae,$e+=w*Ke,ke+=w*Ye,ct+=w*Je,at+=w*st,w=$[9],ye+=w*ut,De+=w*tt,Fe+=w*We,je+=w*it,Le+=w*Ee,_e+=w*Ie,ze+=w*Oe,Ue+=w*ve,be+=w*Te,Se+=w*se,Pe+=w*fe,$e+=w*Ae,ke+=w*Ke,ct+=w*Ye,at+=w*Je,ft+=w*st,w=$[10],De+=w*ut,Fe+=w*tt,je+=w*We,Le+=w*it,_e+=w*Ee,ze+=w*Ie,Ue+=w*Oe,be+=w*ve,Se+=w*Te,Pe+=w*se,$e+=w*fe,ke+=w*Ae,ct+=w*Ke,at+=w*Ye,ft+=w*Je,yt+=w*st,w=$[11],Fe+=w*ut,je+=w*tt,Le+=w*We,_e+=w*it,ze+=w*Ee,Ue+=w*Ie,be+=w*Oe,Se+=w*ve,Pe+=w*Te,$e+=w*se,ke+=w*fe,ct+=w*Ae,at+=w*Ke,ft+=w*Ye,yt+=w*Je,ot+=w*st,w=$[12],je+=w*ut,Le+=w*tt,_e+=w*We,ze+=w*it,Ue+=w*Ee,be+=w*Ie,Se+=w*Oe,Pe+=w*ve,$e+=w*Te,ke+=w*se,ct+=w*fe,at+=w*Ae,ft+=w*Ke,yt+=w*Ye,ot+=w*Je,gt+=w*st,w=$[13],Le+=w*ut,_e+=w*tt,ze+=w*We,Ue+=w*it,be+=w*Ee,Se+=w*Ie,Pe+=w*Oe,$e+=w*ve,ke+=w*Te,ct+=w*se,at+=w*fe,ft+=w*Ae,yt+=w*Ke,ot+=w*Ye,gt+=w*Je,bt+=w*st,w=$[14],_e+=w*ut,ze+=w*tt,Ue+=w*We,be+=w*it,Se+=w*Ee,Pe+=w*Ie,$e+=w*Oe,ke+=w*ve,ct+=w*Te,at+=w*se,ft+=w*fe,yt+=w*Ae,ot+=w*Ke,gt+=w*Ye,bt+=w*Je,xt+=w*st,w=$[15],ze+=w*ut,Ue+=w*tt,be+=w*We,Se+=w*it,Pe+=w*Ee,$e+=w*Ie,ke+=w*Oe,ct+=w*ve,at+=w*Te,ft+=w*se,yt+=w*fe,ot+=w*Ae,gt+=w*Ke,bt+=w*Ye,xt+=w*Je,It+=w*st,H+=38*Ue,F+=38*be,X+=38*Se,ce+=38*Pe,ae+=38*$e,re+=38*ke,de+=38*ct,Ce+=38*at,he+=38*ft,ye+=38*yt,De+=38*ot,Fe+=38*gt,je+=38*bt,Le+=38*xt,_e+=38*It,M=1,w=H+M+65535,M=Math.floor(w/65536),H=w-M*65536,w=F+M+65535,M=Math.floor(w/65536),F=w-M*65536,w=X+M+65535,M=Math.floor(w/65536),X=w-M
227*65536,w=ce+M+65535,M=Math.floor(w/65536),ce=w-M*65536,w=ae+M+65535,M=Math.floor(w/65536),ae=w-M*65536,w=re+M+65535,M=Math.floor(w/65536),re=w-M*65536,w=de+M+65535,M=Math.floor(w/65536),de=w-M*65536,w=Ce+M+65535,M=Math.floor(w/65536),Ce=w-M*65536,w=he+M+65535,M=Math.floor(w/65536),he=w-M*65536,w=ye+M+65535,M=Math.floor(w/65536),ye=w-M*65536,w=De+M+65535,M=Math.floor(w/65536),De=w-M*65536,w=Fe+M+65535,M=Math.floor(w/65536),Fe=w-M*65536,w=je+M+65535,M=Math.floor(w/65536),je=w-M*65536,w=Le+M+65535,M=Math.floor(w/65536),Le=w-M*65536,w=_e+M+65535,M=Math.floor(w/65536),_e=w-M*65536,w=ze+M+65535,M=Math.floor(w/65536),ze=w-M*65536,H+=M-1+37*(M-1),M=1,w=H+M+65535,M=Math.floor(w/65536),H=w-M*65536,w=F+M+65535,M=Math.floor(w/65536),F=w-M*65536,w=X+M+65535,M=Math.floor(w/65536),X=w-M*65536,w=ce+M+65535,M=Math.floor(w/65536),ce=w-M*65536,w=ae+M+65535,M=Math.floor(w/65536),ae=w-M*65536,w=re+M+65535,M=Math.floor(w/65536),re=w-M*65536,w=de+M+65535,M=Math.floor(w/65536),de=w-M*65536,w=Ce+M+65535,M=Math.floor(w/65536),Ce=w-M*65536,w=he+M+65535,M=Math.floor(w/65536),he=w-M*65536,w=ye+M+65535,M=Math.floor(w/65536),ye=w-M*65536,w=De+M+65535,M=Math.floor(w/65536),De=w-M*65536,w=Fe+M+65535,M=Math.floor(w/65536),Fe=w-M*65536,w=je+M+65535,M=Math.floor(w/65536),je=w-M*65536,w=Le+M+65535,M=Math.floor(w/65536),Le=w-M*65536,w=_e+M+65535,M=Math.floor(w/65536),_e=w-M*65536,w=ze+M+65535,M=Math.floor(w/65536),ze=w-M*65536,H+=M-1+37*(M-1),A[0]=H,A[1]=F,A[2]=X,A[3]=ce,A[4]=ae,A[5]=re,A[6]=de,A[7]=Ce,A[8]=he,A[9]=ye,A[10]=De,A[11]=Fe,A[12]=je,A[13]=Le,A[14]=_e,A[15]=ze}return ds}var fs,v0;function VE(){if(v0)return fs;v0=1;var e=nt();pt(),xr(),ri(),fs=e.kem=e.kem||{};var t=e.jsbn.BigInteger;e.kem.rsa={},e.kem.rsa.create=function(n,o){o=o||{};var s=o.prng||e.random,i={};return i.encrypt=function(a,c){var l=Math.ceil(a.n.bitLength()/8),f;do f=new t(e.util.bytesToHex(s.getBytesSync(l)),16).mod(a.n);while(f.compareTo(t.ONE)<=0);f=e.util.hexToBytes(f.toString(16));var y=l-f.length;y>0&&(f=e.util.fillString("\0",y)+f);var m=a.encrypt(f,"NONE"),d=n.generate(f,c);return{encapsulation:m,key:d}},i.decrypt=function(a,c,l){var f=a.decrypt(c,"NONE");return n.generate(f,l)},i},e.kem.kdf1=function(n,o){r(this,n,0,o||n.digestLength)},e.kem.kdf2=function(n,o){r(this,n,1,o||n.digestLength)};function r(n,o,s,i){n.generate=function(a,c){for(var l=new e.util.ByteBuffer,f=Math.ceil(c/i)+s,y=new e.util.ByteBuffer,m=s;m<f;++m){y.putInt32(m),o.start(),o.update(a+y.getBytes());var d=o.digest();l.putBytes(d.getBytes(i))}return l.truncate(l.length()-c),l.getBytes()}}return fs}var ps,y0;function FE(){if(y0)return ps;y0=1;var e=nt();pt(),ps=e.log=e.log||{},e.log.levels=["none","error","warning","info","debug","verbose","max"];var t={},r=[],n=null;e.log.LEVEL_LOCKED=2,e.log.NO_LEVEL_CHECK=4,e.log.INTERPOLATE=8;for(var o=0;o<e.log.levels.length;++o){var s=e.log.levels[o];t[s]={index:o,name:s.toUpperCase()}}e.log.logMessage=function(m){for(var d=t[m.level].index,v=0;v<r.length;++v){var b=r[v];if(b.flags&e.log.NO_LEVEL_CHECK)b.f(m);else{var S=t[b.level].index;d<=S&&b.f(b,m)}}},e.log.prepareStandard=function(m){"standard"in m||(m.standard=t[m.level].name+" ["+m.category+"] "+m.message)},e.log.prepareFull=function(m){if(!("full"in m)){var d=[m.message];d=d.concat([]),m.full=e.util.format.apply(this,d)}},e.log.prepareStandardFull=function(m){"standardFull"in m||(e.log.prepareStandard(m),m.standardFull=m.standard)};for(var i=["error","warning","info","debug","verbose"],o=0;o<i.length;++o)(function(d){e.log[d]=function(v,b){var S=Array.prototype.slice.call(arguments).slice(2),u={timestamp:new Date,level:d,category:v,message:b,arguments:S};e.log.logMessage(u)}})(i[o]);if(e.log.makeLogger=function(m){var d={flags:0,f:m};return e.log.setLevel(d,"none"),d},e.log.setLevel=function(m,d){var v=!1;if(m&&!(m.flags&e.log.LEVEL_LOCKED))for(var b=0;b<e.log.levels.length;++b){var S=e.log.levels[b];if(d==S){m.level=d,v=!0;break}}return v},e.log.lock=function(m,d){typeof d>"u"||d?m.flags|=e.log.LEVEL_LOCKED:m.flags&=~e.log.LEVEL_LOCKED},e.log.addLogger=function(m){r.push(m)},typeof console<"u"&&"log"in console){var a;if(console.error&&console.warn&&console.info&&console.debug){var c={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},l=function(m,d){e.log.prepareStandard(d);var v=c[d.level],b=[d.standard];b=b.concat(d.arguments.slice()),v.apply(console,b)};a=e.log.makeLogger(l)}else{var l=function(d,v){e.log.prepareStandardFull(v)};a=e.log.makeLogger(l)}e.log.setLevel(a,"debug"),e.log.addLogger(a),n=a}else console={log:function(){}};if(n!==null&&typeof window<"u"&&window.location){var f=new URL(window.location.href).searchParams;if(f.has("console.level")&&e.log.setLevel(n,f.get("console.level").slice(-1)[0]),f.has("console.lock")){var y=f.get("console.lock").slice(-1)[0];y=="true"&&e.log.lock(n)}}return e.log.consoleLogger=n,ps}var hs,b0;function UE(){return b0||(b0=1,hs=Fr(),Sc(),Ea(),Mh(),zh()),hs}
227var ms={exports:{}},C0;function jE(){if(C0)return ms.exports;C0=1;var e=nt();ln(),Nr(),ti(),cn(),kn(),Vh(),xr(),pt(),Ic();var t=e.asn1,r=ms.exports=e.pkcs7=e.pkcs7||{};r.messageFromPem=function(d){var v=e.pem.decode(d)[0];if(v.type!=="PKCS7"){var b=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw b.headerType=v.type,b}if(v.procType&&v.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var S=t.fromDer(v.body);return r.messageFromAsn1(S)},r.messageToPem=function(d,v){var b={type:"PKCS7",body:t.toDer(d.toAsn1()).getBytes()};return e.pem.encode(b,{maxline:v})},r.messageFromAsn1=function(d){var v={},b=[];if(!t.validate(d,r.asn1.contentInfoValidator,v,b)){var S=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw S.errors=b,S}var u=t.derToOid(v.contentType),C;switch(u){case e.pki.oids.envelopedData:C=r.createEnvelopedData();break;case e.pki.oids.encryptedData:C=r.createEncryptedData();break;case e.pki.oids.signedData:C=r.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return C.fromAsn1(v.content.value[0]),C},r.createSignedData=function(){var d=null;return d={type:e.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(S){if(y(d,S,r.asn1.signedDataValidator),d.certificates=[],d.crls=[],d.digestAlgorithmIdentifiers=[],d.contentInfo=null,d.signerInfos=[],d.rawCapture.certificates)for(var u=d.rawCapture.certificates.value,C=0;C<u.length;++C)d.certificates.push(e.pki.certificateFromAsn1(u[C]))},toAsn1:function(){d.contentInfo||d.sign();for(var S=[],u=0;u<d.certificates.length;++u)S.push(e.pki.certificateToAsn1(d.certificates[u]));var C=[],x=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.digestAlgorithmIdentifiers),d.contentInfo])]);return S.length>0&&x.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,S)),C.length>0&&x.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,C)),x.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),x])},addSigner:function(S){var u=S.issuer,C=S.serialNumber;if(S.certificate){var x=S.certificate;typeof x=="string"&&(x=e.pki.certificateFromPem(x)),u=x.issuer.attributes,C=x.serialNumber}var I=S.key;if(!I)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof I=="string"&&(I=e.pki.privateKeyFromPem(I));var N=S.digestAlgorithm||e.pki.oids.sha1;switch(N){case e.pki.oids.sha1:case e.pki.oids.sha256:case e.pki.oids.sha384:case e.pki.oids.sha512:case e.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+N)}var E=S.authenticatedAttributes||[];if(E.length>0){for(var g=!1,p=!1,T=0;T<E.length;++T){var R=E[T];if(!g&&R.type===e.pki.oids.contentType){if(g=!0,p)break;continue}if(!p&&R.type===e.pki.oids.messageDigest){if(p=!0,g)break;continue}}if(!g||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}d.signers.push({key:I,version:1,issuer:u,serialNumber:C,digestAlgorithm:N,signatureAlgorithm:e.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:E,unauthenticatedAttributes:[]})},sign:function(S){if(S=S||{},(typeof d.content!="object"||d.contentInfo===null)&&(d.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes())]),"content"in d)){var u;d.content instanceof e.util.ByteBuffer?u=d.content.bytes():typeof d.content=="string"&&(u=e.util.encodeUtf8(d.content)),S.detached?d.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,u):d.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,u)]))}if(d.signers.length!==0){var C=v();b(C)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(S){typeof S=="string"&&(S=e.pki.certificateFromPem(S)),d.certificates.push(S)},addCertificateRevokationList:function(S){throw new Error("PKCS#7 CRL support not yet implemented.")}},d;function v(){for(var S={},u=0;u<d.signers.length;
227++u){var C=d.signers[u],x=C.digestAlgorithm;x in S||(S[x]=e.md[e.pki.oids[x]].create()),C.authenticatedAttributes.length===0?C.md=S[x]:C.md=e.md[e.pki.oids[x]].create()}d.digestAlgorithmIdentifiers=[];for(var x in S)d.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return S}function b(S){var u;if(d.detachedContent?u=d.detachedContent:(u=d.contentInfo.value[1],u=u.value[0]),!u)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var C=t.derToOid(d.contentInfo.value[0].value),x=t.toDer(u);x.getByte(),t.getBerValueLength(x),x=x.getBytes();for(var I in S)S[I].start().update(x);for(var N=new Date,E=0;E<d.signers.length;++E){var g=d.signers[E];if(g.authenticatedAttributes.length===0){if(C!==e.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{g.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),T=0;T<g.authenticatedAttributes.length;++T){var R=g.authenticatedAttributes[T];R.type===e.pki.oids.messageDigest?R.value=S[g.digestAlgorithm].digest():R.type===e.pki.oids.signingTime&&(R.value||(R.value=N)),p.value.push(l(R)),g.authenticatedAttributesAsn1.value.push(l(R))}x=t.toDer(p).getBytes(),g.md.start().update(x)}g.signature=g.key.sign(g.md,"RSASSA-PKCS1-V1_5")}d.signerInfos=c(d.signers)}},r.createEncryptedData=function(){var d=null;return d={type:e.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){y(d,v,r.asn1.encryptedDataValidator)},decrypt:function(v){v!==void 0&&(d.encryptedContent.key=v),m(d)}},d},r.createEnvelopedData=function(){var d=null;return d={type:e.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){var b=y(d,v,r.asn1.envelopedDataValidator);d.recipients=s(b.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,i(d.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,f(d.encryptedContent))])])])},findRecipient:function(v){for(var b=v.issuer.attributes,S=0;S<d.recipients.length;++S){var u=d.recipients[S],C=u.issuer;if(u.serialNumber===v.serialNumber&&C.length===b.length){for(var x=!0,I=0;I<b.length;++I)if(C[I].type!==b[I].type||C[I].value!==b[I].value){x=!1;break}if(x)return u}}return null},decrypt:function(v,b){if(d.encryptedContent.key===void 0&&v!==void 0&&b!==void 0)switch(v.encryptedContent.algorithm){case e.pki.oids.rsaEncryption:case e.pki.oids.desCBC:var S=b.decrypt(v.encryptedContent.content);d.encryptedContent.key=e.util.createBuffer(S);break;default:throw new Error("Unsupported asymmetric cipher, OID "+v.encryptedContent.algorithm)}m(d)},addRecipient:function(v){d.recipients.push({version:0,issuer:v.issuer.attributes,serialNumber:v.serialNumber,encryptedContent:{algorithm:e.pki.oids.rsaEncryption,key:v.publicKey}})},encrypt:function(v,b){if(d.encryptedContent.content===void 0){b=b||d.encryptedContent.algorithm,v=v||d.encryptedContent.key;var S,u,C;switch(b){case e.pki.oids["aes128-CBC"]:S=16,u=16,C=e.aes.createEncryptionCipher;break;case e.pki.oids["aes192-CBC"]:S=24,u=16,C=e.aes.createEncryptionCipher;break;case e.pki.oids["aes256-CBC"]:S=32,u=16,C=e.aes.createEncryptionCipher;break;case e.pki.oids["des-EDE3-CBC"]:S=24,u=8,C=e.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+b)}if(v===void 0)v=e.util.createBuffer(e.random.getBytes(S));else if(v.length()!=S)throw new Error("Symmetric key has wrong length; got "+v.length()+" bytes, expected "+S+".");d.encryptedContent.algorithm=b,d.encryptedContent.key=v,d.encryptedContent.parameter=e.util.createBuffer(e.random.getBytes(u));var x=C(v);if(x.start(d.encryptedContent.parameter.copy()),x.update(d.content),!x.finish())throw new Error("Symmetric encryption failed.");d.encryptedContent.content=x.output}for(var I=0;I<d.recipients.length;++I){var N=d.recipients[I];if(N.encryptedContent.content===void 0)if(N.encryptedContent.algorithm===e.pki.oids.rsaEncryption)N.encryptedContent.content=N.encryptedContent.key.encrypt
227(d.encryptedContent.key.data);else throw new Error("Unsupported asymmetric cipher, OID "+N.encryptedContent.algorithm)}}},d};function n(d){var v={},b=[];if(!t.validate(d,r.asn1.recipientInfoValidator,v,b)){var S=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw S.errors=b,S}return{version:v.version.charCodeAt(0),issuer:e.pki.RDNAttributesAsArray(v.issuer),serialNumber:e.util.createBuffer(v.serial).toHex(),encryptedContent:{algorithm:t.derToOid(v.encAlgorithm),parameter:v.encParameter?v.encParameter.value:void 0,content:v.encKey}}}function o(d){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.encryptedContent.content)])}function s(d){for(var v=[],b=0;b<d.length;++b)v.push(n(d[b]));return v}function i(d){for(var v=[],b=0;b<d.length;++b)v.push(o(d[b]));return v}function a(d){var v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(d.authenticatedAttributesAsn1&&v.value.push(d.authenticatedAttributesAsn1),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.signature)),d.unauthenticatedAttributes.length>0){for(var b=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),S=0;S<d.unauthenticatedAttributes.length;++S){var u=d.unauthenticatedAttributes[S];b.values.push(l(u))}v.value.push(b)}return v}function c(d){for(var v=[],b=0;b<d.length;++b)v.push(a(d[b]));return v}function l(d){var v;if(d.type===e.pki.oids.contentType)v=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.value).getBytes());else if(d.type===e.pki.oids.messageDigest)v=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.value.bytes());else if(d.type===e.pki.oids.signingTime){var b=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z"),u=d.value;if(typeof u=="string"){var C=Date.parse(u);isNaN(C)?u.length===13?u=t.utcTimeToDate(u):u=t.generalizedTimeToDate(u):u=new Date(C)}u>=b&&u<S?v=t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(u)):v=t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(u))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[v])])}function f(d){return[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.algorithm).getBytes()),d.parameter?t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.parameter.getBytes()):void 0]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.content.getBytes())])]}function y(d,v,b){var S={},u=[];if(!t.validate(v,b,S,u)){var C=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw C.errors=C,C}var x=t.derToOid(S.contentType);if(x!==e.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(S.encryptedContent){var I="";if(e.util.isArray(S.encryptedContent))for(var N=0;N<S.encryptedContent.length;++N){if(S.encryptedContent[N].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");I+=S.encryptedContent[N].value}else I=S.encryptedContent;d.encryptedContent={algorithm:t.derToOid(S.encAlgorithm),parameter:e.util.createBuffer(S.encParameter.value),content:e.util.createBuffer(I)}}if(S.content){var I="";if(e.util.isArray(S.content))for(var N=0;N<S.content.length;++N){if(S.content[N].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");I+=S.content[N].value}else I=S.content;d.content=e.util.createBuffer(I)}return d.version=S.version.charCodeAt(0),d.rawCapture=S,S}function m(d){if(d.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(d.content===void 0){var v;switch(d.encryptedContent.algorithm){case e.pki.oids["aes128-CBC"]:case e.pki.oids["aes192-CBC"]:case e.pki.oids["aes256-CBC"]:v=e.aes.createDecryptionCipher(d.encryptedContent.key);break;case e.pki.oids.desCBC:case e.pki.oids["des-EDE3-CBC"]:v=e.des.createDecryptionCipher(d.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+d.encryptedContent.algorithm)}if(v.start(d.encryptedContent.parameter),v.update(d.encryptedContent.content),!v.finish())throw new Error("Symmetric decryption failed.");d.content=v.output}}return ms.exports}var gs={exports:{}},x0;function HE(){if(x0)return gs.exports;x0=1;var e=nt();ln(),Sa(),Sc(),Ea(),pt();var t=gs.exports=e.ssh=e.ssh||{};t.privateKeyToPutty=function(s,i,a){a=a||"",i=i||"";var c="ssh-rsa",l=i===""?"none":"aes256-cbc",f="PuTTY-User-Key-File-2: "+c+`\r 228`;f+="Encryption: "+l+`\r 229`,f+="Comment: "+a+`\r 230`;var y=e.util.createBuffer();n(y,c),r(y,s.e),r(y,s.n);var m=e.util.encode64(y.bytes(),64),d=Math.floor(m.length/66)+1;f+="Public-Lines: "+d+`\r 231`,f+=m;var v=e.util.createBuffer();r(v,s.d),r(v,s.p),r(v,s.q),r(v,s.qInv);var b;if(!i)b=e.util.encode64(v.bytes(),64);else{var S=v.length()+16-1;S-=S%16;var u=o(v.bytes());u.truncate(u.length()-S+v.length()),v.putBuffer(u);var C=e.util.createBuffer();C.putBuffer(o("\0\0\0\0",i)),C.putBuffer(o("\0\0\0�",i));var x=e.aes.createEncryptionCipher(C.truncate(8),"CBC");x.start(e.util.createBuffer().fillWithByte(0,16)),x.update(v.copy()),x.finish();var I=x.output;
231I.truncate(16),b=e.util.encode64(I.bytes(),64)}d=Math.floor(b.length/66)+1,f+=`\r 232Private-Lines: `+d+`\r 233`,f+=b;var N=o("putty-private-key-file-mac-key",i),E=e.util.createBuffer();n(E,c),n(E,l),n(E,a),E.putInt32(y.length()),E.putBuffer(y),E.putInt32(v.length()),E.putBuffer(v);var g=e.hmac.create();return g.start("sha1",N),g.update(E.bytes()),f+=`\r 234Private-MAC: `+g.digest().toHex()+`\r 235`,f},t.publicKeyToOpenSSH=function(s,i){var a="ssh-rsa";i=i||"";var c=e.util.createBuffer();return n(c,a),r(c,s.e),r(c,s.n),a+" "+e.util.encode64(c.bytes())+" "+i},t.privateKeyToOpenSSH=function(s,i){return i?e.pki.encryptRsaPrivateKey(s,i,{legacy:!0,algorithm:"aes128"}):e.pki.privateKeyToPem(s)},t.getPublicKeyFingerprint=function(s,i){i=i||{};var a=i.md||e.md.md5.create(),c="ssh-rsa",l=e.util.createBuffer();n(l,c),r(l,s.e),r(l,s.n),a.start(),a.update(l.getBytes());var f=a.digest();if(i.encoding==="hex"){var y=f.toHex();return i.delimiter?y.match(/.{2}/g).join(i.delimiter):y}else{if(i.encoding==="binary")return f.getBytes();if(i.encoding)throw new Error('Unknown encoding "'+i.encoding+'".')}return f};function r(s,i){var a=i.toString(16);a[0]>="8"&&(a="00"+a);var c=e.util.hexToBytes(a);s.putInt32(c.length),s.putBytes(c)}function n(s,i){s.putInt32(i.length),s.putString(i)}function o(){for(var s=e.md.sha1.create(),i=arguments.length,a=0;a<i;++a)s.update(arguments[a]);return s.digest()}return gs.exports}var vs,S0;function zE(){return S0||(S0=1,vs=nt(),ln(),OE(),Nr(),xc(),ti(),kE(),Sa(),VE(),FE(),UE(),Fh(),Ec(),kn(),Oh(),Uh(),jE(),jh(),_h(),Dh(),wc(),xr(),$h(),HE(),Hh(),pt()),vs}var KE=zE();const ro=Ro(KE);let E0=null,ys=null;class Kh extends Error{constructor(t){super(t),this.name="IOSMaximumCallError"}}function GE(e){return!!(e instanceof RangeError&&e.message.includes("Maximum call stack size exceeded"))}function qE(e){if(e===E0&&ys)return ys;const t=ro.pki.publicKeyFromPem(e);return E0=e,ys=t,t}function Tc(e,t){let r;try{r=qE(e)}catch(s){const i=s instanceof Error?s.message:String(s);throw Kg({message:i,error_name:s instanceof Error?s.name:void 0,error_stack:s instanceof Error?s.stack:void 0}),GE(s)?new Kh(i):s}const n=ro.util.createBuffer(t,"utf8"),o=r.encrypt(n.bytes(),"RSA-OAEP",{md:ro.md.sha256.create(),mgf1:{md:ro.md.sha1.create()}});return btoa(o)}function wa(){return["production","staging"].includes("uat")}const WE="https://static.airwallex.com/webapp/fraud/device-fingerprint/index.js",YE="https://static-demo.airwallex.com/webapp/fraud/device-fingerprint/index.js";let w0=!1;function XE(e){if(w0)return;w0=!0;const t=wa()?WE:YE,r=`<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body> 236<script id="airwallex-fraud-api" type="text/javascript" async data-order-session-id="${e}" src="${t}"><\/script> 237</body></html>`,n=new Blob([r],{type:"text/html"}),o=URL.createObjectURL(n),s=document.createElement("iframe");s.src=o,s.style.display="none",s.sandbox.add("allow-scripts","allow-same-origin"),document.body.appendChild(s),s.addEventListener("load",()=>{URL.revokeObjectURL(o)})}function QE(){const{currentPaymentUtilInfo:e}=Wr(),t=h.useRef(!0),r=h.useRef(!1);h.useEffect(()=>{if(r.current||t.current&&(t.current=!1,e.paymentType==="CARD"))return;if(["APPLEPAY","GOOGLEPAY","CARD"].includes(e.paymentType)){const o=on.getState().awxOrderSessionId;if(!o)return;XE(o),r.current=!0}},[e])}const Gh="clinkbill",Ac="b669ea8f0d8ac01c87a0cb1061a8568c",Nc="us",I0="trustdecision-behavior-sdk",ZE="https://static.trustdecision.com/tdbh/tdbehavior.min.js",JE=15;let wl=!1,fa=!1,bn=null;function ew(){const e=(new Date().getTime()/36e5).toFixed(0);return`${ZE}?t=${e}`}function tw(){return!0}function Rc(){if(!(typeof window>"u")&&window.TDBehavior)return window.TDBehavior}function T0(){const e=Rc();if(!e)return!1;if(wl)return!0;if(typeof e.initWithOptions!="function")return!1;try{const t={partner:Gh,appKey:Ac,country:Nc,behaviorHttpTimeOut:JE};return e.initWithOptions(t),wl=!0,!0}catch{return!1}}function rw(){return typeof window>"u"||typeof document>"u"?Promise.resolve():tw()?window.TDBehavior?T0()?Promise.resolve():Promise.reject(new Error("TD_BEHAVIOR init failed")):bn||(document.getElementById(I0)?Promise.reject(new Error("TD_BEHAVIOR script exists but SDK missing")):(bn=new Promise((t,r)=>{const n=document.createElement("script"),o=ew();n.id=I0,n.type="text/javascript",n.async=!0,n.src=o,n.addEventListener("load",()=>
237{if(!T0()){bn=null,r(new Error("TD_BEHAVIOR init failed after script loaded"));return}t()},{once:!0}),n.addEventListener("error",s=>{bn=null,n.remove(),r(new Error("TD_BEHAVIOR script load failed"))},{once:!0}),document.head.appendChild(n)}),bn)):Promise.reject(new Error("TD_BEHAVIOR invalid config"))}function nw(){const e=Rc();if(!e||!wl)return!1;if(fa)return!0;if(typeof e.start!="function")return!1;try{return e.start(),fa=!0,!0}catch{return!1}}function aw(){const e=Rc();if(!e)return!1;if(!fa)return!0;if(typeof e.stop!="function")return!1;try{return e.stop(),fa=!1,!0}catch{return!1}}function ow(){let e=!1;return rw().then(()=>{e||nw()}).catch(t=>{}),()=>{e=!0,fa&&aw()}}const iw=26;let Il;function sw(e,t){if(e.length===iw)return e}function qh(e,t){const r=sw(e);if(r)return Il=r,r}function lw(){if(Il)return Il;if(!(typeof window>"u")&&window._fmOpt&&window._fmOpt.getinfo)try{const e=window._fmOpt.getinfo();if(!e)return;const t=qh(e,"getinfo");return t||void 0}catch{return}}const A0="trustdecision-finger-print-sdk",Wh=`https://static.trustdecision.com/tdfp/${Nc}/${Ac}/fm.js`;let ja=!1;function cw(){return!!Wh}function uw(e){try{if(!e||!qh(e,"success"))return}catch{}}function dw(){if(typeof window>"u"||typeof document>"u"||!cw()||document.getElementById(A0)||ja)return;ja=!0,window._fmOpt={partner:Gh,appKey:Ac,country:Nc,timeout:2e3,strictMode:!1,geolocation:!1,success:uw};const t=document.createElement("script");t.id=A0,t.type="text/javascript",t.async=!0,t.src=Wh,t.addEventListener("load",()=>{ja=!1},{once:!0}),t.addEventListener("error",r=>{ja=!1,t.remove()},{once:!0}),document.head.appendChild(t)}function fw(){h.useEffect(()=>ow(),[]),h.useEffect(()=>{dw()},[])}const N0=9;let bs=null,zn=null;function pw(e){return(e??"").replace(/\D/g,"")}async function R0(){return bs||zn||(zn=Ja().then(e=>(bs=e,e)).finally(()=>{zn=null}),zn)}function hw(){const[e,t]=h.useState(!1),[r,n]=h.useState(),o=h.useRef(0),s=h.useRef(void 0),i=h.useRef(null),a=h.useRef(void 0),c=h.useRef(null),l=h.useRef(null),f=h.useCallback(()=>{o.current+=1,l.current?.(),l.current=null,a.current=void 0,c.current=null},[]),y=h.useCallback(()=>{R0().catch(v=>{})},[]);h.useEffect(()=>()=>{f()},[f]);const m=h.useCallback(async v=>{const b=o.current;Gg();try{const S=await R0();if(b!==o.current)return null;const u=Tc(S.publicKey,JSON.stringify({cardPrefix:v})),C=O3({encryptedData:u,keyName:S.keyName,keyVersion:S.keyVersion});l.current=()=>C.abort();const x=await C;return b!==o.current?null:x}catch{return b!==o.current?null:{paymentMethodAvailable:!0}}finally{b===o.current&&(t(!1),l.current=null)}},[]),d=h.useCallback(async v=>{const b=pw(v),S=b.slice(0,N0);if(b.length<N0)return f(),s.current=void 0,i.current=null,t(!1),n(void 0),null;if(s.current===S)return a.current&&a.current!==S&&(f(),t(!1)),n(i.current?.issuingCountryCode?.trim().toUpperCase()),i.current;if(a.current===S)return c.current;f(),t(!0),n(void 0),a.current=S;const u=m(S);c.current=u;const C=await u;return C&&(s.current=S,i.current=C,n(C.issuingCountryCode?.trim().toUpperCase())),a.current===S&&(a.current=void 0,c.current=null),C},[f,m]);return{cardBinLoading:e,issuingCountryCode:r,preloadPublicKey:y,validateCardNumber:d}}function mw(){const e=Br(r=>r.paymentOptionVoList);return{showCardCpfNumberInput:h.useMemo(()=>{const r=e.find(n=>n.paymentMethod===hr)?.extraProperties;return r?!!r.cpfCollectionEnabled:!1},[e])}}function Pc(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}const yr=Pc();function Bc(e){h.useEffect(()=>(yr.on("loading",e),()=>{yr.off("loading",e)}),[e])}const qr=Pc(),Jt=ga(e=>({currentPromoCode:void 0,setCurrentPromoCode:t=>e({currentPromoCode:t}),promoCodeStatus:void 0,setPromoCodeStatus:t=>e({promoCodeStatus:t}),promoCodeHelp:void 0,setPromoCodeHelp:t=>e({promoCodeHelp:t}),setPromoCodeStatusAndHelp:(t,r)=>e({promoCodeStatus:t,promoCodeHelp:r}),isValidPromoCode:!1,setIsValidPromoCode:t=>e({isValidPromoCode:t}
237),lastValidPromoCode:void 0,setLastValidPromoCode:t=>e({lastValidPromoCode:t}),readonly:!1,setReadonly:t=>e({readonly:t}),enable:!1,setEnable:t=>e({enable:t}),showPromoName:!1,setShowPromoName:t=>e({showPromoName:t}),promoName:null,setPromoName:t=>e({promoName:t}),couponTerms:null,setCouponTerms:t=>e({couponTerms:t})})),To=new Set;function gw(){To.forEach(e=>e()),To.clear()}function vw(e){return e instanceof Kl?!0:e instanceof Error?e.name==="AbortError"||e.name==="CanceledError":!1}function ai(e){const{onSuccess:t,onError:r}=e??{},n=wt(f=>f.updateSessionCurrencyList),o=wt(f=>f.setCurrentCheckedCurrency),s=lr(f=>f.setRequiresTaxCalculation),i=nn(f=>f.setPricingSchedule),a=nn(f=>f.setBillingSchedule);async function c(f){gw();const{overrideRequestBody:y,from:m}=f??{},{sessionId:d}=Tn.getState();if(!d)throw new Error("sessionId 为空");const{currentPromoCode:v,isValidPromoCode:b}=Jt.getState(),{currentPaymentType:S,paymentOptionVoList:u}=Br.getState(),C=lr.getState().info,x={authorization:d,promotionCode:null,currency:wt.getState().currentCheckedCurrency};ME(C)&&(x.taxAddressInfo=El(C)),b&&v&&(x.promotionCode=v),y&&Object.assign(x,y);const I=x.paymentInstrumentId??S;if(I&&I.includes("_")){const{findPaymentTypeByPaymentInstrumentId:g}=qg(u),p=g(I);p?x.paymentInstrumentType=p:x.paymentInstrumentType=null,x.paymentInstrumentId=I,x.taxAddressInfo={}}else{if(I?.includes?.(":")){const[g]=I.split(":");x.paymentInstrumentType=g}else x.paymentInstrumentType=I;x.paymentInstrumentId=null}xo(x.taxAddressInfo)&&(x.taxAddressInfo=null);const N=k2(x,{errorMessageMode:"none"}),E=()=>N.abort();To.add(E);try{setTimeout(()=>{yr.emit("loading",{loading:!0,from:m})});const g=await N;return l(g),n(g.sessionCurrencyPriceVoList),s(g.requiresTaxCalculation),i(g.pricingSchedule),a(g.billingSchedule),t&&t(g),yr.emit("loading",{loading:!1,from:m}),g}catch(g){if(vw(g))return null;throw g instanceof Error&&r&&r(g),yr.emit("loading",{loading:!1,from:m}),g}finally{To.delete(E)}}function l(f){if(!R3(f.sessionCurrencyPriceVoList.map(y=>y.currency).sort(),wt.getState().initialSessionCurrencyList.map(y=>y.currency).sort())){const y=f.originalCurrency;n(f.sessionCurrencyPriceVoList),o(y)}}return{doPostSession:c}}const P0=["line1","city","postalCode","region","line2","country","cpfName","cpfNumber"];function Yh(e,t){const{skipFields:r=[]}=t??{},n=lr(d=>d.info),o=lr(d=>d.setInfo),s=lr(d=>d.requiresTaxCalculation),{doPostSession:i}=ai(),a=h.useRef(!1),c=h.useRef(!1),l=h.useMemo(()=>Co(async()=>{if(!s||a.current)return;o(yh(e.getFieldsValue(),P0));let d;try{d=await e?.validateFields(P0,{validateOnly:!0})}catch{return}const v=El(d);yr.emit("loading",{from:"taxAddress",loading:!0});try{const b=await i({overrideRequestBody:{taxAddressInfo:v},from:"taxAddress"});qr.emit("trigger",{type:"taxAddress",session:b})}catch{}finally{yr.emit("loading",{from:"taxAddress",loading:!1})}},300),[e,i,o,s]),f=h.useMemo(()=>d=>{if(s&&!r.some(v=>v in d)){if(a.current){c.current=!0;return}l()}},[l,r,s]),y=h.useCallback(d=>{if(a.current=d,d){c.current=!1,l.cancel();return}c.current&&(c.current=!1,l())},[l]),m=h.useMemo(()=>Co(()=>{if(!s||a.current)return;const d=e.getFieldsValue(),v=El(d);o(v)},300),[e,o,s]);return{handleValueChange:f,handleFieldsChange:m,taxAddressInfo:n,handleAddressResolvingChange:y,triggerTaxSession:l}}function Xh(e){const{id:t,value:r,onChange:n,className:o,placeholder:s}=e;function i(a){const c=a.target.value.replace(/\D/g,"");if(c.length>11)return;let l="";c.length>0&&(l=c.slice(0,3)),c.length>3&&(l+="."+c.slice(3,6)),c.length>6&&(l+="."+c.slice(6,9)),c.length>9&&(l+="-"+c.slice(9,11)),n?.(l)}return L.jsx(Dt,{id:t,allowClear:!0,size:"large",className:o,value:r,onChange:i,placeholder:s})}const Qh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='70'%20height='43.28125'%20viewBox='0%200%2070%2043.28125'%3e%3cg%3e%3cg%3e%3cpath%20d='M64.375,43.2812L5.625,43.2812C2.51875,43.2812,0,40.7625,0,37.6562L0,5.625C0,2.51875,2.51875,0,5.625,0L64.375,0C67.4812,0,70,2.51875,70,5.625L70,37.6562C70,40.7625,67.4812,43.2812,64.375,43.2812Z'%20fill='%23F7F9FB'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M42.677110937500004,18.540771484375L42.677110937500004,20.754831484375L46.072410937499995,20.754831484375L46.072410937499995,22.526711484375L42.677110937500004,22.526711484375L42.677110937500004,24.740771484375L46.3670109375,24.740771484375L49.1724109375,21.493121484375L46.662310937499996,18.540773868565L42.677110937500004,18.540771484375ZM16.9912109375,21.936081484375L19.7959009375,21.936081484375L18.3193309375,18.540773868565L16.9912109375,21.936081484375Z'%20fill='%230079C2'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M60.390575,14.5546875L52.714075,14.5546875L50.795275,16.9164075L48.876575,14.5546875L33.081275000000005,14.5546875L31.162475,18.8359375L29.391375,14.5546875L22.305475,14.5546875L22.305475,17.2117175L21.271875,14.5546875L15.514845000000001,14.5546875L9.609375,28.7265875L16.399995,28.7265875L17.285935000000002,26.2171875L19.499995,26.2171875L20.385975000000002,28.7265875L28.504675,28.7265875L28.504675,27.9882875L28.947675,28.7265875L48.433575,28.7265875L50.647675,26.2171875L52.861675,28.7265875L60.390575,28.7265875L54.633575,21.6406275L60.390575,14.5546875ZM38.395275,26.806987499999998L35.442975000000004,26.806987499999998L35.442975000000004,19.2781275L32.342974999999996,26.806987499999998L30.128875,26.806987499999998L26.733575,19.1304675L26.733575,26.806987499999998L21.714875,26.806987499999998L20.533575,24.2976575L16.104695,24.2976575L15.071095,26.806987499999998L12.414065,26.806987499999998L16.695315,16.4734375L19.942975,16.4734375L24.224175000000002,26.2163875L24.224175000000002,16.4742175L28.210175,16.4742175L31.162475,23.264847500000002L34.262474999999995,16.4742175L38.396074999999996,16.4742175L38.396074999999996,26.806987499999998L38.395275,26.806987499999998ZM56.404675,26.806987499999998L53.452375,26.806987499999998L50.647675,23.4117175L47.695275,26.806987499999998L40.166375,26.806987499999998L40.166375,16.4742175L48.137475,16.4742175L50.794575,19.721877499999998L53.451575,16.4742175L56.403875,16.4742175L52.271875,21.6406275L56.404675,26.806987499999998Z'%20fill='%230079C2'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Zh="/static/svg/diners-C7Kq0q-O.svg",Jh="/static/svg/discover-Ig0WDajF.svg",em="/static/svg/jcb-BwMyEy_L.svg",tm="/static/svg/master-Dg3TmGMX.svg",rm="/static/svg/visa-BjN59Xvw.svg",lt=[];
237lt.push({cardType:"masterCard",startingRules:[51,52,53,54,55,22,23,24,25,26,27],permittedLengths:[16],pattern:/^(5[1-5][0-9]{0,14}|2[2-7][0-9]{0,14})$/,securityCode:"CVC",logo:tm});lt.push({cardType:"visadankort",startingRules:[4571],permittedLengths:[16],pattern:/^(4571)[0-9]{0,12}$/});lt.push({cardType:"visa",startingRules:[4],permittedLengths:[13,16,19],pattern:/^4[0-9]{0,18}$/,securityCode:"CVV",logo:rm});lt.push({cardType:"amex",startingRules:[34,37],permittedLengths:[15],pattern:/^3[47][0-9]{0,13}$/,securityCode:"CID",logo:Qh});lt.push({cardType:"diners",startingRules:[36],permittedLengths:[14],pattern:/^(36)[0-9]{0,12}$/,logo:Zh});lt.push({cardType:"maestrouk",startingRules:[6759],permittedLengths:[16,18,19],pattern:/^(6759)[0-9]{0,15}$/});lt.push({cardType:"solo",startingRules:[6767],permittedLengths:[16,18,19],pattern:/^(6767)[0-9]{0,15}$/});lt.push({cardType:"laser",startingRules:[6304,6706,677117,677120],permittedLengths:[16,17,18,19],pattern:/^(6304|6706|6709|6771)[0-9]{0,15}$/,cvcPolicy:"optional"});lt.push({cardType:"discover",startingRules:[6011,644,645,646,647,648,649,65],permittedLengths:[16],pattern:/^(6011[0-9]{0,12}|(644|645|646|647|648|649)[0-9]{0,13}|65[0-9]{0,14})$/,logo:Jh});lt.push({cardType:"jcb",startingRules:[3528,3529,353,354,355,356,357,358],permittedLengths:[16,19],pattern:/^(352[8,9]{1}[0-9]{0,15}|35[4-8]{1}[0-9]{0,16})$/,securityCode:"CAV",logo:em});lt.push({cardType:"bcmc",startingRules:[6703,479658,606005],permittedLengths:[16,17,18,19],pattern:/^((6703)[0-9]{0,15}|(479658|606005)[0-9]{0,13})$/,cvcPolicy:"hidden"});lt.push({cardType:"bijcard",startingRules:[5100081],permittedLengths:[16],pattern:/^(5100081)[0-9]{0,9}$/});lt.push({cardType:"dankort",startingRules:[5019],permittedLengths:[16],pattern:/^(5019)[0-9]{0,12}$/});lt.push({cardType:"hipercard",startingRules:[606282],permittedLengths:[16],pattern:/^(606282)[0-9]{0,10}$/});lt.push({cardType:"cup",startingRules:[62,81],permittedLengths:[14,15,16,17,18,19],pattern:/^(62|81)[0-9]{0,17}$/,logo:Qn});lt.push({cardType:"maestro",startingRules:[50,56,57,58,6],permittedLengths:[16,17,18,19],pattern:/^(5[0|6-8][0-9]{0,17}|6[0-9]{0,18})$/,cvcPolicy:"optional"});lt.push({cardType:"elo",startingRules:[506699,50670,50671,50672,50673,50674,50675,50676,506770,506771,506772,506773,506774,506775,506776,506777,506778,401178,438935,451416,457631,457632,504175,627780,636297,636368],permittedLengths:[16],pattern:/^((((506699)|(506770)|(506771)|(506772)|(506773)|(506774)|(506775)|(506776)|(506777)|(506778)|(401178)|(438935)|(451416)|(457631)|(457632)|(504175)|(627780)|(636368)|(636297))[0-9]{0,10})|((50676)|(50675)|(50674)|(50673)|(50672)|(50671)|(50670))[0-9]{0,11})$/});lt.push({cardType:"uatp",startingRules:[1],permittedLengths:[15],pattern:/^1[0-9]{0,14}$/,cvcPolicy:"optional"});lt.push({cardType:"cartebancaire",startingRules:[4,5,6],permittedLengths:[16],pattern:/^[4-6][0-9]{0,15}$/});lt.push({cardType:"visaalphabankbonus",startingRules:[450903],permittedLengths:[16],pattern:/^(450903)[0-9]{0,10}$/});lt.push({cardType:"mcalphabankbonus",startingRules:[510099],permittedLengths:[16],pattern:/^(510099)[0-9]{0,10}$/});lt.push({cardType:"hiper",startingRules:[637095,637568,637599,637609,637612],permittedLengths:[16],pattern:/^(637095|637568|637599|637609|637612)[0-9]{0,10}$/});lt.push({cardType:"oasis",startingRules:[982616],permittedLengths:[16],pattern:/^(982616)[0-9]{0,10}$/,cvcPolicy:"optional"});lt.push({cardType:"karenmillen",startingRules:[98261465],permittedLengths:[16],pattern:/^(98261465)[0-9]{0,8}$/,cvcPolicy:"optional"});lt.push({cardType:"warehouse",startingRules:[982633],permittedLengths:[16],pattern:/^(982633)[0-9]{0,10}$/,cvcPolicy:"optional"});lt.push({cardType:"mir",startingRules:[220],permittedLengths:[16,17,18,19],pattern:/^(220)[0-9]{0,16}$/});lt.push({cardType:"codensa",startingRules:[590712],permittedLengths:[16],pattern:/^(590712)[0-9]{0,10}$/});lt.push({cardType:"naranja",startingRules:[377798,377799,402917,402918,527571,527572,589562],permittedLengths:[16,17,18,19],pattern:/^(37|40|5[28])([279])\d*$/});lt.push({cardType:"cabal",startingRules:[589657,600691,603522,6042,6043,636908],permittedLengths:[16,17,18,19],pattern:/^(58|
2376[03])([03469])\d*$/});lt.push({cardType:"shopping",startingRules:[2799,589407,603488],permittedLengths:[16,17,18,19],pattern:/^(27|58|60)([39])\d*$/});lt.push({cardType:"argencard",startingRules:[501],permittedLengths:[16,17,18,19],pattern:/^(50)(1)\d*$/});lt.push({cardType:"troy",startingRules:[9792],permittedLengths:[16],pattern:/^(97)(9)\d*$/});lt.push({cardType:"forbrugsforeningen",startingRules:[600722],permittedLengths:[16],pattern:/^(60)(0)\d*$/});lt.push({cardType:"vpay",startingRules:[401,408,413,434,435,437,439,441,442,443,444,446,447,455,458,460,461,463,466,471,479,482,483,487],permittedLengths:[13,14,15,16,17,18,19],pattern:/^(40[1,8]|413|43[4,5]|44[1,2,3,4,6,7]|45[5,8]|46[0,1,3,6]|47[1,9]|48[2,3,7])[0-9]{0,16}$/});lt.push({cardType:"rupay",startingRules:[508528],permittedLengths:[16],pattern:/^(100003|508(2|[5-9])|60(69|[7-8])|652(1[5-9]|[2-5][0-9]|8[5-9])|65300[3-4]|8172([0-1]|[3-5]|7|9)|817(3[3-8]|40[6-9]|410)|35380([0-2]|[5-6]|9))[0-9]{0,12}$/});function nm(e){if(!e)return null;for(const t of lt){const r=t.startingRules.some(o=>e.startsWith(o.toString())),n=t.pattern.test(e);if(r&&n)return t}return null}function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ao.apply(this,arguments)}function yw(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var bw=["cdnSuffix","cdnUrl","countryCode","style","svg"],Cw="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",xw="svg",Sw=127397,am=function(t){var r=t.cdnSuffix,n=r===void 0?xw:r,o=t.cdnUrl,s=o===void 0?Cw:o,i=t.countryCode,a=t.style,c=t.svg,l=c===void 0?!1:c,f=yw(t,bw);if(typeof i!="string")return null;if(l){var y=""+s+i.toLowerCase()+"."+n;return h.createElement("img",Object.assign({},f,{src:y,style:Ao({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},a)}))}var m=i.toUpperCase().replace(/./g,function(d){return String.fromCodePoint(d.charCodeAt(0)+Sw)});return h.createElement("span",Object.assign({role:"img"},f,{style:Ao({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},a)}),m)};const Lc=JSON.parse(`[{"name":"Afghanistan","alpha2":"AF","alpha3":"AFG"},{"name":"Ã
land Islands","alpha2":"AX","alpha3":"ALA"},{"name":"Albania","alpha2":"AL","alpha3":"ALB"},{"name":"Algeria","alpha2":"DZ","alpha3":"DZA"},{"name":"American Samoa","alpha2":"AS","alpha3":"ASM"},{"name":"Andorra","alpha2":"AD","alpha3":"AND"},{"name":"Angola","alpha2":"AO","alpha3":"AGO"},{"name":"Anguilla","alpha2":"AI","alpha3":"AIA"},{"name":"Antarctica","alpha2":"AQ","alpha3":"ATA"},{"name":"Antigua and Barbuda","alpha2":"AG","alpha3":"ATG"},{"name":"Argentina","alpha2":"AR","alpha3":"ARG"},{"name":"Armenia","alpha2":"AM","alpha3":"ARM"},{"name":"Aruba","alpha2":"AW","alpha3":"ABW"},{"name":"Australia","alpha2":"AU","alpha3":"AUS"},{"name":"Austria","alpha2":"AT","alpha3":"AUT"},{"name":"Azerbaijan","alpha2":"AZ","alpha3":"AZE"},{"name":"Bahamas","alpha2":"BS","alpha3":"BHS"},{"name":"Bahrain","alpha2":"BH","alpha3":"BHR"},{"name":"Bangladesh","alpha2":"BD","alpha3":"BGD"},{"name":"Barbados","alpha2":"BB","alpha3":"BRB"},{"name":"Belarus","alpha2":"BY","alpha3":"BLR"},{"name":"Belgium","alpha2":"BE","alpha3":"BEL"},{"name":"Belize","alpha2":"BZ","alpha3":"BLZ"},{"name":"Benin","alpha2":"BJ","alpha3":"BEN"},{"name":"Bermuda","alpha2":"BM","alpha3":"BMU"},{"name":"Bhutan","alpha2":"BT","alpha3":"BTN"},{"name":"Bolivia (Plurinational State of)","alpha2":"BO","alpha3":"BOL"},{"name":"Bonaire, Sint Eustatius and Saba","alpha2":"BQ","alpha3":"BES"},{"name":"Bosnia and Herzegovina","alpha2":"BA","alpha3":"BIH"},{"name":"Botswana","alpha2":"BW","alpha3":"BWA"},{"name":"Bouvet Island","alpha2":"BV","alpha3":"BVT"},{"name":"Brazil","alpha2":"BR","alpha3":"BRA"},{"name":"British Indian Ocean Territory","alpha2":"IO","alpha3":"IOT"},{"name":"Brunei Darussalam","alpha2":"BN","alpha3":"BRN"},{"name":"Bulgaria","alpha2":"BG","alpha3":"BGR"},{"name":"Burkina Faso","alpha2":"BF","alpha3":"BFA"},{"name":"Burundi","alpha2":"BI","alpha3":"BDI"},{"name":"Cabo Verde","alpha2":"CV","alpha3":"CPV"},{"name":"Cambodia","alpha2":"KH","alpha3":"KHM"},{"name":"Cameroon","alpha2":"CM","alpha3":"CMR"},{"name":"Canada","alpha2":"CA","alpha3":"CAN"},{"name":"Cayman Islands","alpha2":"KY","alpha3":"CYM"},{"name":"Central African Republic","alpha2":"CF","alpha3":"CAF"},{"name":"Chad","alpha2":"TD","alpha3":"TCD"},{"name":"Chile","alpha2":"CL","alpha3":"CHL"},{"name":"China","alpha2":"CN","alpha3":"CHN"},{"name":"Christmas Island","alpha2":"CX","alpha3":"CXR"},{"name":"Cocos (Keeling) Islands","alpha2":"CC","alpha3":"CCK"},{"name":"Colombia","alpha2":"CO","alpha3":"COL"},{"name":"Comoros","alpha2":"KM","alpha3":"COM"},{"name":"Congo","alpha2":"CG","alpha3":"COG"},{"name":"Congo, Democratic Republic of the","alpha2":"CD","alpha3":"COD"},{"name":"Cook Islands","alpha2":"CK","alpha3":"COK"},{"name":"Costa Rica","alpha2":"CR","alpha3":"CRI"},{"name":"Côte d'Ivoire","alpha2":"CI","alpha3":"CIV"},{"name":"Croatia","alpha2":"HR","alpha3":"HRV"},{"name":"Curaçao","alpha2":"CW","alpha3":"CUW"},{"name":"Cyprus","alpha2":"CY","alpha3":"CYP"},{"name":"Czechia","alpha2":"CZ","alpha3":"CZE"},{"name":"Denmark","alpha2":"DK","alpha3":"DNK"},{"name":"Djibouti","alpha2":"DJ","alpha3":"DJI"},{"name":"Dominica","alpha2":"DM","alpha3":"DMA"},{"name":"Dominican Republic","alpha2":"DO","alpha3":"DOM"},{"name":"Ecuador","alpha2":"EC","alpha3":"ECU"},{"name":"Egypt","alpha2":"EG","alpha3":"EGY"},{"name":"El Salvador","alpha2":"SV","alpha3":"SLV"},{"name":"Equatorial Guinea","alpha2":"GQ","alpha3":"GNQ"},{"name":"Eritrea","alpha2":"ER","alpha3":"ERI"},{"name":"Estonia","alpha2":"EE","alpha3":"EST"},{"name":"Eswatini","alpha2":"SZ","alpha3":"SWZ"},{"name":"Ethiopia","alpha2":"ET","alpha3":"ETH"},{"name":"Falkland Islands (Malvinas)","alpha2":"FK","alpha3":"FLK"},{"name":"Faroe Islands","alpha2":"FO","alpha3":"FRO"},{"name":"Fiji","alpha2":"FJ","alpha3":"FJI"},{"name":"Finland","alpha2":"FI","alpha3":"FIN"},{"name":"France","alpha2":"FR","alpha3":"FRA"},{"name":"French Guiana","alpha2":"GF","alpha3":"GUF"},{"name":"French Polynesia","alpha2":"PF","alpha3":"PYF"},{"name":"French Southern Territories","alpha2":"TF","alpha3":"ATF"},{"name":"Gabon","alpha2":"GA","alpha3":"GAB"},{"name":"Gambia","alpha2":"GM","alpha3":"GMB"},{"name":"Georgia","alpha2":"GE","alpha3":"GEO"},{"name":"Germany","alpha2":"DE","alpha3":"DEU"},{"name":"Ghana","alpha2":"GH","alpha3":"GHA"},{"name":"Gibraltar","alpha2":"GI","alpha3":"GIB"},{"name":"Greece","alpha2":"GR","alpha3":"GRC"},{"name":"Greenland","alpha2":"GL","alpha3":"GRL"},{"name":"Grenada","alpha2":"GD","alpha3":"GRD"},{"name":"Guadeloupe","alpha2":"GP","alpha3":"GLP"},{"name":"Guam","alpha2":"GU","alpha3":"GUM"},{"name":"Guatemala","alpha2":"GT","alpha3":"GTM"},{"name":"Guernsey","alpha2":"GG","alpha3":"GGY"},{"name":"Guinea","alpha2":"GN","alpha3":"GIN"},{"name":"Guinea-Bissau","alpha2":"GW","alpha3":"GNB"},{"name":"Guyana","alpha2":"GY","alpha3":"GUY"},{"name":"Haiti","alpha2":"HT","alpha3":"HTI"},{"name":"Heard Island and McDonald Islands","alpha2":"HM","alpha3":"HMD"},{"name":"Holy See","alpha2":"VA","alpha3":"VAT"},{"name":"Honduras","alpha2":"HN","alpha3":"HND"},{"name":"Hong Kong","alpha2":"HK","alpha3":"HKG"},{"name":"Hungary","alpha2":"HU","alpha3":"HUN"},{"name":"Iceland","alpha2":"IS","alpha3":"ISL"},{"name":"India","alpha2":"IN","alpha3":"IND"},{"name":"Indonesia","alpha2":"ID","alpha3":"IDN"},{"name":"Iraq","alpha2":"IQ","alpha3":"IRQ"},{"name":"Ireland","alpha2":"IE","alpha3":"IRL"},{"name":"Isle of Man","alpha2":"IM","alpha3":"IMN"},{"name":"Israel","alpha2":"IL","alpha3":"ISR"},{"name":"Italy","alpha2":"IT","alpha3":"ITA"},{"name":"Jamaica","alpha2":"JM","alpha3":"JAM"},{"name":"Japan","alpha2":"JP","alpha3":"JPN"},{"name":"Jersey","alpha2":"JE","alpha3":"JEY"},{"name":"Jordan","alpha2":"JO","alpha3":"JOR"},{"name":"Kazakhstan","alpha2":"KZ","alpha3":"KAZ"},{"name":"Kenya","alpha2":"KE","alpha3":"KEN"},{"name":"Kiribati","alpha2":"KI","alpha3":"KIR"},{"name":"Korea, Republic of","alpha2":"KR","alpha3":"KOR"},{"name":"Kuwait","alpha2":"KW","alpha3":"KWT"},{"name":"Kyrgyzstan","alpha2":"KG","alpha3":"KGZ"},{"name":"Lao People's Democratic Republic","alpha2":"LA","alpha3":"LAO"},{"name":"Latvia","alpha2":"LV","alpha3":"LVA"},{"name":"Lebanon","alpha2":"LB","alpha3":"LBN"},{"name":"Lesotho","alpha2":"LS","alpha3":"LSO"},{"name":"Liberia","alpha2":"LR","alpha3":"LBR"},{"name":"Libya","alpha2":"LY","alpha3":"LBY"},{"name":"Liechtenstein","alpha2":"LI","alpha3":"LIE"},{"name":"Lithuania","alpha2":"LT","alpha3":"LTU"},{"name":"Luxembourg","alpha2":"LU","alpha3":"LUX"},{"name":"Macao","alpha2":"MO","alpha3":"MAC"},{"name":"Madagascar","alpha2":"MG","alpha3":"MDG"},{"name":"Malawi","alpha2":"MW","alpha3":"MWI"},{"name":"Malaysia","alpha2":"MY","alpha3":"MYS"},{"name":"Maldives","alpha2":"MV","alpha3":"MDV"},{"name":"Mali","alpha2":"ML","alpha3":"MLI"},{"name":"Malta","alpha2":"MT","alpha3":"MLT"},{"name":"Marshall Islands","alpha2":"MH","alpha3":"MHL"},{"name":"Martinique","alpha2":"MQ","alpha3":"MTQ"},{"name":"Mauritania","alpha2":"MR","alpha3":"MRT"},{"name":"Mauritius","alpha2":"MU","alpha3":"MUS"},{"name":"Mayotte","alpha2":"YT","alpha3":"MYT"},{"name":"Mexico","alpha2":"MX","alpha3":"MEX"},{"name":"Micronesia (Federated States of)","alpha2":"FM","alpha3":"FSM"},{"name":"Moldova, Republic of","alpha2":"MD","alpha3":"MDA"},{"name":"Monaco","alpha2":"MC","alpha3":"MCO"},{"name":"Mongolia","alpha2":"MN","alpha3":"MNG"},{"name":"Montenegro","alpha2":"ME","alpha3":"MNE"},{"name":"Montserrat","alpha2":"MS","alpha3":"MSR"},{"name":"Morocco","alpha2":"MA","alpha3":"MAR"},{"name":"Mozambique","alpha2":"MZ","alpha3":"MOZ"},{"name":"Myanmar","alpha2":"MM","alpha3":"MMR"},{"name":"Namibia","alpha2":"NA","alpha3":"NAM"},{"name":"Nauru","alpha2":"NR","alpha3":"NRU"},{"name":"Nepal","alpha2":"NP","alpha3":"NPL"},{"name":"Netherlands","alpha2":"NL","alpha3":"NLD"},{"name":"New Caledonia","alpha2":"NC","alpha3":"NCL"},{"name":"New Zealand","alpha2":"NZ","alpha3":"NZL"},{"name":"Nicaragua","alpha2":"NI","alpha3":"NIC"},{"name":"Niger","alpha2":"NE","alpha3":"NER"},{"name":"Nigeria","alpha2":"NG","alpha3":"NGA"},{"name":"Niue","alpha2":"NU","alpha3":"NIU"},{"name":"Norfolk Island","alpha2":"NF","alpha3":"NFK"},{"name":"North Macedonia","alpha2":"MK","alpha3":"MKD"},{"name":"Northern Mariana Islands","alpha2":"MP","alpha3":"MNP"},{"name":"Norway","alpha2":"NO","alpha3":"NOR"},{"name":"Oman","alpha2":"OM","alpha3":"OMN"},{"name":"Pakistan","alpha2":"PK","alpha3":"PAK"},{"name":"Palau","alpha2":"PW","alpha3":"PLW"},{"name":"Palestine, State of","alpha2":"PS","alpha3":"PSE"},{"name":"Panama","alpha2":"PA","alpha3":"PAN"},{"name":"Papua New Guinea","alpha2":"PG","alpha3":"PNG"},{"name":"Paraguay","alpha2":"PY","alpha3":"PRY"},{"name":"Peru","alpha2":"PE","alpha3":"PER"},{"name":"Philippines","alpha2":"PH","alpha3":"PHL"},{"name":"Pitcairn","alpha2":"PN","alpha3":"PCN"},{"name":"Poland","alpha2":"PL","alpha3":"POL"},{"name":"Portugal","alpha2":"PT","alpha3":"PRT"},{"name":"Puerto Rico","alpha2":"PR","alpha3":"PRI"},{"name":"Qatar","alpha2":"QA","alpha3":"QAT"},{"name":"Réunion","alpha2":"RE","alpha3":"REU"},{"name":"Romania","alpha2":"RO","alpha3":"ROU"},{"name":"Rwanda","alpha2":"RW","alpha3":"RWA"},{"name":"Saint Barthélemy","alpha2":"BL","alpha3":"BLM"},{"name":"Saint Helena, Ascension and Tristan da Cunha","alpha2":"SH","alpha3":"SHN"},{"name":"Saint Kitts and Nevis","alpha2":"KN","alpha3":"KNA"},{"name":"Saint Lucia","alpha2":"LC","alpha3":"LCA"},{"name":"Saint Martin (French part)","alpha2":"MF","alpha3":"MAF"},{"name":"Saint Pierre and Miquelon","alpha2":"PM","alpha3":"SPM"},{"name":"Saint Vincent and the Grenadines","alpha2":"VC","alpha3":"VCT"},{"name":"Samoa","alpha2":"WS","alpha3":"WSM"},{"name":"San Marino","alpha2":"SM","alpha3":"SMR"},{"name":"Sao Tome and Principe","alpha2":"ST","alpha3":"STP"},{"name":"Saudi Arabia","alpha2":"SA","alpha3":"SAU"},{"name":"Senegal","alpha2":"SN","alpha3":"SEN"},{"name":"Serbia","alpha2":"RS","alpha3":"SRB"},{"name":"Seychelles","alpha2":"SC","alpha3":"SYC"},{"name":"Sierra Leone","alpha2":"SL","alpha3":"SLE"},{"name":"Singapore","alpha2":"SG","alpha3":"SGP"},{"name":"Sint Maarten (Dutch part)","alpha2":"SX","alpha3":"SXM"},{"name":"Slovakia","alpha2":"SK","alpha3":"SVK"},{"name":"Slovenia","alpha2":"SI","alpha3":"SVN"},{"name":"Solomon Islands","alpha2":"SB","alpha3":"SLB"},{"name":"Somalia","alpha2":"SO","alpha3":"SOM"},{"name":"South Africa","alpha2":"ZA","alpha3":"ZAF"},{"name":"South Georgia and the South Sandwich Islands","alpha2":"GS","alpha3":"SGS"},{"name":"South Sudan","alpha2":"SS","alpha3":"SSD"},{"name":"Spain","alpha2":"ES","alpha3":"ESP"},{"name":"Sri Lanka","alpha2":"LK","alpha3":"LKA"},{"name":"Sudan","alpha2":"SD","alpha3":"SDN"},{"name":"Suriname","alpha2":"SR","alpha3":"SUR"},{"name":"Svalbard and Jan Mayen","alpha2":"SJ","alpha3":"SJM"},{"name":"Sweden","alpha2":"SE","alpha3":"SWE"},{"name":"Switzerland","alpha2":"CH","alpha3":"CHE"},{"name":"Taiwan, Province of China","alpha2":"TW","alpha3":"TWN"},{"name":"Tajikistan","alpha2":"TJ","alpha3":"TJK"},{"name":"Tanzania, United Republic of","alpha2":"TZ","alpha3":"TZA"},{"name":"Thailand","alpha2":"TH","alpha3":"THA"},{"name":"Timor-Leste","alpha2":"TL","alpha3":"TLS"},{"name":"Togo","alpha2":"TG","alpha3":"TGO"},{"name":"Tokelau","alpha2":"TK","alpha3":"TKL"},{"name":"Tonga","alpha2":"TO","alpha3":"TON"},{"name":"Trinidad and Tobago","alpha2":"TT","alpha3":"TTO"},{"name":"Tunisia","alpha2":"TN","alpha3":"TUN"},{"name":"Turkey","alpha2":"TR","alpha3":"TUR"},{"name":"Turkmenistan","alpha2":"TM","alpha3":"TKM"},{"name":"Turks and Caicos Islands","alpha2":"TC","alpha3":"TCA"},{"name":"Tuvalu","alpha2":"TV","alpha3":"TUV"},{"name":"Uganda","alpha2":"UG","alpha3":"UGA"},{"name":"Ukraine","alpha2":"UA","alpha3":"UKR"},{"name":"United Arab Emirates","alpha2":"AE","alpha3":"ARE"},{"name":"United Kingdom of Great Britain and Northern Ireland","alpha2":"GB","alpha3":"GBR"},{"name":"United States of America","alpha2":"US","alpha3":"USA"},{"name":"United States Minor Outlying Islands","alpha2":"UM","alpha3":"UMI"},{"name":"Uruguay","alpha2":"UY","alpha3":"URY"},{"name":"Uzbekistan","alpha2":"UZ","alpha3":"UZB"},{"name":"Vanuatu","alpha2":"VU","alpha3":"VUT"},{"name":"Venezuela (Bolivarian Republic of)","alpha2":"VE","alpha3":"VEN"},{"name":"Viet Nam","alpha2":"VN","alpha3":"VNM"},{"name":"Virgin Islands (British)","alpha2":"VG","alpha3":"VGB"},{"name":"Virgin Islands (U.S.)","alpha2":"VI","alpha3":"VIR"},{"name":"Wallis and Futuna","alpha2":"WF","alpha3":"WLF"},{"name":"Western Sahara","alpha2":"EH","alpha3":"ESH"},{"name":"Yemen","alpha2":"YE","alpha3":"YEM"},{"name":"Zambia","alpha2":"ZM","alpha3":"ZMB"},{"name":"Zimbabwe","alpha2":"ZW","alpha3":"ZWE"}]`),Ew=Lc.map(e=>({label:e.name,value:e.alpha2}));Lc.map(e=>{const t=e.alpha2==="TW"?"CN":e.alpha2;return{label:e.name,value:e.alpha2,labelWithFlag:h.createElement("div",{className:"flex items-center gap-2"},h.createElement(am,{countryCode:t,svg:!0}),h.createElement("span",{},e.name))}});function om(){const{t:e}=rt();return{countryWithFlagOptions:h.useMemo(()=>Lc.map(r=>{const n=r.alpha2==="TW"?"CN":r.alpha2,o=e(`country.countries.${r.alpha2}`);return{label:o,value:r.alpha2,labelWithFlag:h.createElement("div",{className:"flex items-center gap-2"},h.createElement(am,{countryCode:n,svg:!0}),h.createElement("span",{},o))}}),[e])}}function ww(e){const t=e.replace(/\D/g,"");if(t.length<1)return!1;const r=t.split("").map(Number).reverse();let n=0;for(let o=0;o<r.length;o++){let s=r[o];o%2===1&&(s*=2,s>9&&(s-=9)),n+=s}return n%10===0}function Iw(e,t,r,n){function o(s){return s instanceof r?s:new r(function(i){i(s)})}return new(r||(r=Promise))(function(s,i){function a(f){try{l(n.next(f))}catch(y){i(y)}}function c(f){try{l(n.throw(f))}catch(y){i(y)}}function l(f){f.done?s(f.value):o(f.value).then(a,c)}l((n=n.apply(e,[])).next())})}
vendor: 5,181 bytes, line 237
237function Tw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cs,B0;function Aw(){return B0||(B0=1,Cs=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Cs}var Nw=Aw(),Rw=Tw(Nw);const L0="__googleMapsScriptId";var En;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(En||(En={}));class Jr{constructor({apiKey:t,authReferrerPolicy:r,channel:n,client:o,id:s=L0,language:i,libraries:a=[],mapIds:c,nonce:l,region:f,retries:y=3,url:m="https://maps.googleapis.com/maps/api/js",version:d}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=r,this.channel=n,this.client=o,this.id=s||L0,this.language=i,this.libraries=a,this.mapIds=c,this.nonce=l,this.region=f,this.retries=y,this.url=m,this.version=d,Jr.instance){if(!Rw(this.options,Jr.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Jr.instance.options)}`);return Jr.instance}Jr.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?En.FAILURE:this.done?En.SUCCESS:this.loading?En.LOADING:En.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`®ion=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((t,r)=>{this.loadCallback(n=>{n?r(n.error):t(window.google)})})}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,r;if(document.getElementById(this.id)){this.callback();return}const n={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(n).forEach(s=>!n[s]&&delete n[s]),!((r=(t=window?.google)===null||t===void 0?void 0:t.maps)===null||r===void 0)&&r.importLibrary||(s=>{let i,a,c,l="The Google Maps JavaScript API",f="google",y="importLibrary",m="__ib__",d=document,v=window;v=v[f]||(v[f]={});const b=v.maps||(v.maps={}),S=new Set,u=new URLSearchParams,C=()=>i||(i=new Promise((x,I)=>Iw(this,void 0,void 0,function*(){var N;yield a=d.createElement("script"),a.id=this.id,u.set("libraries",[...S]+"");for(c in s)u.set(c.replace(/[A-Z]/g,E=>"_"+E[0].toLowerCase()),s[c]);u.set("callback",f+".maps."+m),a.src=this.url+"?"+u,b[m]=x,a.onerror=()=>i=I(Error(l+" could not load.")),a.nonce=this.nonce||((N=d.querySelector("script[nonce]"))===null||N===void 0?void 0:N.nonce)||"",d.head.append(a)})));b[y]||(b[y]=(x,...I)=>S.add(x)&&C().then(()=>b[y](x,...I)))})(n);const o=this.libraries.map(s=>this.importLibrary(s));o.length||o.push(this.importLibrary("core")),Promise.all(o).then(()=>this.callback(),s=>{const i=new ErrorEvent("error",{error:s});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const r=this.errors.length*Math.pow(2,this.errors.length);setTimeout(()=>{this.deleteScript(),this.setScript()},r)}else this.onerrorEvent=t,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(t=>{t(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){this.callback();return}this.loading=!0,this.setScript()}}}function Pw(){const e=h.useRef(void 0);
237function t(){e.current=new google.maps.places.AutocompleteSessionToken}return{autoCompleteSessionToken:e,generateNewToken:t}}function Bw(e){const{country:t,value:r,onChange:n,onSelect:o,onAddressResolvingChange:s,debounceTime:i=300,ref:a,disabled:c,...l}=e,[f,y]=h.useState([]),m=h.useRef(0),d=h.useRef(!1),{autoCompleteSessionToken:v,generateNewToken:b}=Pw();function S(){m.current+=1,d.current&&(d.current=!1,s?.(!1))}async function u(I){d.current&&S(),n?.(I)}const C=h.useMemo(()=>Co(async I=>{if(xo(I)){y([]);return}if(I.endsWith(" "))return;const N={input:I,language:"en-US",includedRegionCodes:t?[t]:void 0,sessionToken:v.current},{suggestions:E}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(N),g=E.map(p=>{const T=p.placePrediction;return{label:T?.text?.text.toString()??"",value:T?.placeId??"",placePrediction:T}});y(g)},i),[v,t,i]);Wg(async()=>{await new Jr({apiKey:"AIzaSyCApjy7YL-3smT4ReTF5M6YEao85GGQaZA"}).importLibrary("places"),b()}),W2(()=>{S()});async function x(I,N){const E=m.current+1;m.current=E,n?.(" "),d.current=!0,s?.(!0);try{if(N.placePrediction){const g=N.placePrediction.toPlace();if(await g.fetchFields({fields:["displayName","formattedAddress","postalAddress","addressComponents"]}),E!==m.current)return;g.postalAddress;const p={displayName:g.displayName?.toString(),formattedAddress:g.formattedAddress?.toString(),postalAddress:g.postalAddress,addressComponents:g.addressComponents};o?.(p),b()}}finally{E===m.current&&(d.current=!1,s?.(!1))}}return h.useImperativeHandle(a,()=>({clearOptions:()=>{S(),y([])}})),L.jsx(ac,{...l,options:f,value:r,disabled:c,onChange:u,showSearch:{onSearch:C},onSelect:x,optionRender:I=>L.jsxs("div",{className:le("break-all whitespace-pre-line","flex items-center gap-2"),children:[L.jsx("span",{className:"icon-[mi--location] shrink-0"}),L.jsx("span",{children:I.label})]})})}const Lw=[{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"American Samoa",value:"AS"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District Of Columbia",value:"DC"},{label:"Federated States Of Micronesia",value:"FM"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Guam",value:"GU"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Marshall Islands",value:"MH"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Northern Mariana Islands",value:"MP"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Palau",value:"PW"},{label:"Pennsylvania",value:"PA"},{label:"Puerto Rico",value:"PR"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virgin Islands",value:"VI"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}],Mw=[{label:"Alberta",value:"AB"},{label:"British Columbia",value:"BC"},{label:"Manitoba",value:"MB"},{label:"New Brunswick",value:"NB"},{label:"Newfoundland and Labrador",value:"NL"},{label:"Northwest Territories",value:"NT"},{label:"Nova Scotia",value:"NS"},{label:"Nunavut",value:"NU"},{label:"Ontario",value:"ON"},{label:"Prince Edward Island",value:"PE"},{label:"Quebec",value:"QC"},{label:"Saskatchewan",value:"SK"},{label:"Yukon Territory",value:"YT"}],im=[{label:"Auckland",value:"AUK"},{label:"Bay of Plenty",value:"BOP"},{label:"Canterbury",value:"CAN"},{label:"Chatham Islands Territory",value:"CIT"},{label:"Gisborne",value:"GIS"},{label:"Greater Wellington",value:"WGN"},{label:"Hawke's Bay",value:"HKB"},{label:"Manawatū-Whanganui",value:"MWT"},{label:"Marlborough",value:"MBH"},{label:"Nelson",value:"NSN"},{label:"Northland",value:"NTL"},{label:"Otago",value:"OTA"},{label:"Southland",value:"STL"},{label:"Taranaki",value:"TKI"},{label:"Tasman",value:"TAS"},{label:"Waikato",value:"WKO"},{label:"West Coast",value:"WTC"}],Dw=[{label:"Australian Capital Territory",value:"ACT"},{label:"New South Wales",value:"NSW"},{label:"Northern Territory",value:"NT"},{label:"Queensland",value:"QLD"},{label:"South Australia",value:"SA"},{label:"Tasmania",value:"TAS"},{label:"Victoria",value:"VIC"},{label:"Western Australia",value:"WA"}],sm=[{label:"England",value:"ENG"},{label:"Northern Ireland",value:"NIR"},{label:"Scotland",value:"SCT"},{label:"Wales",value:"WLS"},{label:"England and Wales",value:"EAW"},{label:"Great Britain",value:"GBN"},{label:"United Kingdom",value:"UKM"},{label:"Cambridgeshire",value:"CAM"},{label:"Cumbria",value:"CMA"},{label:"Derbyshire",value:"DBY"},{label:"Devon",value:"DEV"},{label:"Dorset",value:"DOR"},{label:"East Sussex",value:"ESX"},{label:"Essex",value:"ESS"},{label:"Gloucestershire",value:"GLS"},{label:"Hampshire",value:"HAM"},{label:"Hertfordshire",value:"HRT"},{label:"Kent",value:"KEN"}
237,{label:"Lancashire",value:"LAN"},{label:"Leicestershire",value:"LEC"},{label:"Lincolnshire",value:"LIN"},{label:"Norfolk",value:"NFK"},{label:"North Yorkshire",value:"NYK"},{label:"Nottinghamshire",value:"NTT"},{label:"Oxfordshire",value:"OXF"},{label:"Somerset",value:"SOM"},{label:"Staffordshire",value:"STS"},{label:"Suffolk",value:"SFK"},{label:"Surrey",value:"SRY"},{label:"Warwickshire",value:"WAR"},{label:"West Sussex",value:"WSX"},{label:"Worcestershire",value:"WOR"},{label:"London, City of",value:"LND"},{label:"Barking and Dagenham",value:"BDG"},{label:"Barnet",value:"BNE"},{label:"Bexley",value:"BEX"},{label:"Brent",value:"BEN"},{label:"Bromley",value:"BRY"},{label:"Camden",value:"CMD"},{label:"Croydon",value:"CRY"},{label:"Ealing",value:"EAL"},{label:"Enfield",value:"ENF"},{label:"Greenwich",value:"GRE"},{label:"Hackney",value:"HCK"},{label:"Hammersmith and Fulham",value:"HMF"},{label:"Haringey",value:"HRY"},{label:"Harrow",value:"HRW"},{label:"Havering",value:"HAV"},{label:"Hillingdon",value:"HIL"},{label:"Hounslow",value:"HNS"},{label:"Islington",value:"ISL"},{label:"Kensington and Chelsea",value:"KEC"},{label:"Kingston upon Thames",value:"KTT"},{label:"Lambeth",value:"LBH"},{label:"Lewisham",value:"LEW"},{label:"Merton",value:"MRT"},{label:"Newham",value:"NWM"},{label:"Redbridge",value:"RDB"},{label:"Richmond upon Thames",value:"RIC"},{label:"Southwark",value:"SWK"},{label:"Sutton",value:"STN"},{label:"Tower Hamlets",value:"TWH"},{label:"Waltham Forest",value:"WFT"},{label:"Wandsworth",value:"WND"},{label:"Westminster",value:"WSM"},{label:"Barnsley",value:"BNS"},{label:"Birmingham",value:"BIR"},{label:"Bolton",value:"BOL"},{label:"Bradford",value:"BRD"},{label:"Bury",value:"BUR"},{label:"Calderdale",value:"CLD"},{label:"Coventry",value:"COV"},{label:"Doncaster",value:"DNC"},{label:"Dudley",value:"DUD"},{label:"Gateshead",value:"GAT"},{label:"Kirklees",value:"KIR"},{label:"Knowsley",value:"KWL"},{label:"Leeds",value:"LDS"},{label:"Liverpool",value:"LIV"},{label:"Manchester",value:"MAN"},{label:"Newcastle upon Tyne",value:"NET"},{label:"North Tyneside",value:"NTY"},{label:"Oldham",value:"OLD"},{label:"Rochdale",value:"RCH"},{label:"Rotherham",value:"ROT"},{label:"St. Helens",value:"SHN"},{label:"Salford",value:"SLF"},{label:"Sandwell",value:"SAW"},{label:"Sefton",value:"SFT"},{label:"Sheffield",value:"SHF"},{label:"Solihull",value:"SOL"},{label:"South Tyneside",value:"STY"},{label:"Stockport",value:"SKP"},{label:"Sunderland",value:"SND"},{label:"Tameside",value:"TAM"},{label:"Trafford",value:"TRF"},{label:"Wakefield",value:"WKF"},{label:"Walsall",value:"WLL"},{label:"Wigan",value:"WGN"},{label:"Wirral",value:"WRL"},{label:"Wolverhampton",value:"WLV"},{label:"Bath and North East Somerset",value:"BAS"},{label:"Bedford",value:"BDF"},{label:"Blackburn with Darwen",value:"BBD"},{label:"Blackpool",value:"BPL"},{label:"Bournemouth, Christchurch and Poole",value:"BCP"},{label:"Bracknell Forest",value:"BRC"},{label:"Brighton and Hove",value:"BNH"},{label:"Bristol, City of",value:"BST"},{label:"Buckinghamshire",value:"BKM"},{label:"Central Bedfordshire",value:"CBF"},{label:"Cheshire East",value:"CHE"},{label:"Cheshire West and Chester",value:"CHW"},{label:"Cornwall",value:"CON"},{label:"Darlington",value:"DAL"},{label:"Derby",value:"DER"},{label:"Durham, County",value:"DUR"},{label:"East Riding of Yorkshire",value:"ERY"},{label:"Halton",value:"HAL"},{label:"Hartlepool",value:"HPL"},{label:"Herefordshire",value:"HEF"},{label:"Isle of Wight",value:"IOW"},{label:"Isles of Scilly",value:"IOS"},{label:"Kingston upon Hull",value:"KHL"},{label:"Leicester",value:"LCE"},{label:"Luton",value:"LUT"},{label:"Medway",value:"MDW"},{label:"Middlesbrough",value:"MDB"},{label:"Milton Keynes",value:"MIK"},{label:"North East Lincolnshire",value:"NEL"},{label:"North Lincolnshire",value:"NLN"},{label:"North Northamptonshire",value:"NNH"},{label:"North Somerset",value:"NSM"},{label:"Northumberland",value:"NBL"},{label:"Nottingham",value:"NGM"},{label:"Peterborough",value:"PTE"},{label:"Plymouth",value:"PLY"},{label:"Portsmouth",value:"POR"},{label:"Reading",value:"RDG"},{label:"Redcar and Cleveland",value:"RCC"},{label:"Rutland",value:"RUT"},{label:"Shropshire",value:"SHR"},{label:"Slough",value:"SLG"},{label:"South Gloucestershire",value:"SGC"},{label:"Southampton",value:"STH"},{label:"Southend-on-Sea",value:"SOS"},{label:"Stockton-on-Tees",value:"STT"},{label:"Stoke-on-Trent",value:"STE"},{label:"Swindon",value:"SWD"},{label:"Telford and Wrekin",value:"TFW"},{label:"Thurrock",value:"THR"},{label:"Torbay",value:"TOB"},{label:"Warrington",value:"WRT"},{label:"West Berkshire",value:"WBK"},{label:"West Northamptonshire",value:"WNH"},{label:"Wiltshire",value:"WIL"},{label:"Windsor and Maidenhead",value:"WNM"},{label:"Wokingham",value:"WOK"},{label:"York",value:"YOR"},{label:"Antrim and Newtownabbey",value:"ANN"},{label:"Ards and North Down",value:"AND"},{label:"Armagh City, Banbridge and Craigavon",value:"ABC"},{label:"Belfast City",value:"BFS"},{label:"Causeway Coast and Glens",value:"CCG"},{label:"Derry and Strabane",value:"DRS"},{label:"Fermanagh and Omagh",value:"FMO"},{label:"Lisburn and Castlereagh",value:"LBC"},{label:"Mid and East Antrim",value:"MEA"},{label:"Mid-Ulster",value:"MUL"},{label:"Newry, Mourne and Down",value:"NMD"},{label:"Aberdeen City",value:"ABE"},{label:"Aberdeenshire",value:"ABD"},{label:"Angus",value:"ANS"},{label:"Argyll and Bute",value:"AGB"},{label:"Clackmannanshire",value:"CLK"},{label:"Dumfries and Galloway",value:"DGY"},{label:"Dundee City",value:"DND"},{label:"East Ayrshire",value:"EAY"},{label:"East Dunbartonshire",value:"EDU"},{label:"East Lothian",value:"ELN"},{label:"East Renfrewshire",value:"ERW"},{label:"Edinburgh, City of",value:"EDH"},{label:"Eilean Siar",value:"ELS"},{label:"Falkirk",value:"FAL"},{label:"Fife",value:"FIF"},{label:"Glasgow City",value:"GLG"},{label:"Highland",value:"HLD"},{label:"Inverclyde",value:"IVC"},{label:"Midlothian",value:"MLN"},{label:"Moray",value:"MRY"},{label:"North Ayrshire",value:"NAY"},{label:"North Lanarkshire",value:"NLK"},{label:"Orkney Islands",value:"ORK"},{label:"Perth and Kinross",value:"PKN"},{label:"Renfrewshire",value:"RFW"},{label:"Scottish Borders",value:"SCB"},{label:"Shetland Islands",value:"ZET"},{label:"South Ayrshire",value:"SAY"},{label:"South Lanarkshire",value:"SLK"},{label:"Stirling",value:"STG"},{label:"West Dunbartonshire",value:"WDU"},{label:"West Lothian",value:"WLN"},{label:"Blaenau Gwent",value:"BGW"},{label:"Bridgend",value:"BGE"},{label:"Caerphilly",value:"CAY"},{label:"Cardiff",value:"CRF"},{label:"Carmarthenshire",value:"CMN"},{label:"Ceredigion",value:"CGN"},{label:"Conwy",value:"CWY"},{label:"Denbighshire",value:"DEN"},{label:"Flintshire",value:"FLN"},{label:"Gwynedd",value:"GWN"},{label:"Isle of Anglesey",value:"AGY"},{label:"Merthyr Tydfil",value:"MTY"},{label:"Monmouthshire",value:"MON"},{label:"Neath Port Talbot",value:"NTL"},{label:"Newport",value:"NWP"},{label:"Pembrokeshire",value:"PEM"},{label:"Powys",value:"POW"},{label:"Rhondda Cynon Taf",value:"RCT"},{label:"Swansea",value:"SWA"},{label:"Torfaen",value:"TOF"},{label:"Vale of Glamorgan, The",value:"VGL"},{label:"Wrexham",value:"WRX"}],$w=[{label:"Andaman and Nicobar Islands",value:"AN"},{label:"Andhra Pradesh",value:"AP"},{label:"Arunachal Pradesh",value:"AR"},{label:"Assam",value:"AS"},{label:"Bihar",value:"BR"},{label:"Chandigarh",value:"CH"},{label:"Chhattisgarh",value:"CT"},{label:"Dadra and Nagar Haveli and Daman and Diu",value:"DH"},{label:"Delhi",value:"DL"},{label:"Goa",value:"GA"},{label:"Gujarat",value:"GJ"},{label:"Haryana",value:"HR"},{label:"Himachal Pradesh",value:"HP"},{label:"Jammu and Kashmir",value:"JK"},{label:"Jharkhand",value:"JH"},{label:"Karnataka",value:"KA"},{label:"Kerala",value:"KL"},{label:"Ladakh",value:"LA"},{label:"Lakshadweep",value:"LD"},{label:"Madhya Pradesh",value:"MP"},{label:"Maharashtra",value:"MH"},{label:"Manipur",value:"MN"},{label:"Meghalaya",value:"ML"},{label:"Mizoram",value:"MZ"},{label:"Nagaland",value:"NL"},{label:"Odisha",value:"OR"},{label:"Puducherry",value:"PY"},{label:"Punjab",value:"PB"},{label:"Rajasthan",value:"RJ"},{label:"Sikkim",value:"SK"},{label:"Tamil Nadu",value:"TN"},{label:"Telangana",value:"TG"},{label:"Tripura",value:"TR"},{label:"Uttar Pradesh",value:"UP"},{label:"Uttarakhand",value:"UT"},{label:"West Bengal",value:"WB"}],Tl={US:Lw,CA:Mw,GB:sm,NZ:im,AU:Dw,IN:$w},Al=Object.keys(Tl);function Ow(e,t){const{displayName:r,postalAddress:n,addressComponents:o}=e,s={line1:void 0,city:void 0,postalCode:void 0,region:void 0,line2:void 0};if(n&&(s.line1=n.addressLines?.[0]??r??void 0,n.addressLines.length>1&&(s.line1=n.addressLines.join(", ")),s.city=n.locality??void 0,s.postalCode=n.postalCode??void 0),!s.line1){const a=r;a&&(s.line1=a)}if(!s.city){const a=o?.filter(c=>c.types.includes("locality")&&c.types.includes("political"));if(a&&a.length>0&&(s.city=a[0].longText??void 0),!s.city){const c=o?.filter(l=>l.types.includes("administrative_area_level_3"));if(c&&c.length>0)s.city=c[0].longText??void 0;else{const l=o?.filter(f=>f.types.includes("postal_town"));l&&l.length>0&&(s.city=l[0].longText??void 0)}}}if(!s.postalCode){const a=o?.filter(c=>c.types.includes("postal_code"));a&&a.length>0&&(s.postalCode=a?.[0].longText??void 0)}if(Al.includes(t??"")){const a=o?.filter(c=>c.types.includes("administrative_area_level_1"));a&&a.length>0&&(s.region=a[0].shortText??void 0)}else if(n?.administrativeArea)s.region=n.administrativeArea;else{const a=o?.filter(c=>c.types.includes("administrative_area_level_1"));a&&a.length>0&&(s.region=a[0].longText??void 0)}let i=s.region;return["NZ"].includes(t??"")&&(i=im.find(c=>c.label.includes(i?.replaceAll(" Region","")??""))?.value),["GB"].includes(t??"")&&(i=sm.find(c=>c.label.includes(i??""))?.value),s.region=i,s}const Mc=(e,t)=>{const r=e.toLocaleLowerCase(),n=t?.label?.toString().toLocaleLowerCase(),o=t?.value?.toString().toLocaleLowerCase();return!!(n?.includes(r)||o?.includes(r))},_w=10;function kw(e){const{id:t,value:r,onChange:n,className:o,disabled:s,maxLength:i=_w,digitOnly:a}=e;function c(f){let m=f.target.value.replace(/\s/g,"");a&&(m=m.replace(/\D/g,"")),!(m.length>i)&&n?.(m)}const{t:l}=rt();return L.jsx(Dt,{id:t,allowClear:!0,disabled:s,size:"large",placeholder:l("payment.zipPlaceholder"),className:o,value:r,onChange:c})}function lm(e){const{countryCode:t,onAddressComplete:r,onAddressResolvingChange:n,ref:o,className:s,disabled:i}=e,a=Object.keys(Tl).includes(t??"")?Tl[t??""]:[],c=h.useRef(null);return h.useImperativeHandle(o,()=>({clearOptions:()=>{c.current?.clearOptions()}})),L.jsxs("div",{className:le(s),children:[L.jsx(et.Item,{noStyle:!0,name:"line1",rules:[{required:!0,message:pr("payment.lineRequired",{value:1})}],children:L.jsx(Bw,{ref:c,allowClear:!0,size:"large",className:le("mb-[-1px] hover:z-[999]"),styles:{root:{"--ant-border-radius-lg":0}},placeholder:pr("payment.linePlaceholder",{value:1}),country:t,onSelect:l=>r?.(Ow(l,t)),onAddressResolvingChange:n,disabled:i})}),L.jsx(et.Item,{noStyle:!0,name:"line2",children:L.jsx(Dt,{allowClear:!0,size:"large",className:"rounded-none mb-[-1px] hover:z-[999]",placeholder:pr("payment.linePlaceholder",{value:2}),disabled:i})}),L.jsxs("div",{className:"flex",children:[L.jsx(et.Item,{noStyle:!0,name:"city",rules:[{required:!0,message:pr("payment.cityRequired")}],children:L.jsx(Dt,{allowClear:!0,size:"large",className:"rounded-none mb-[-1px] hover:z-[999]",placeholder:pr("payment.cityPlaceholder"),disabled:i})}),L.jsx(et.Item,{noStyle:!0,name:"postalCode",rules:[{required:!0,message:pr("payment.zipRequired")},...t==="IN"?[{pattern:/^\d{6}$/,message:pr("payment.zip6Digits")}]:[]],children:L.jsx(kw,{className:"rounded-none ms-[-1px] mb-[-1px] hover:z-[999]",disabled:i,maxLength:t==="IN"?6:void 0,digitOnly:t==="IN"})})]}),!Al.includes(t??"")&&L.jsx(et.Item,{noStyle:!0,name:"region",rules:[{required:!0,message:pr("payment.regionRequired")}],children:L.jsx(Dt,{allowClear:!0,size:"large",className:"rounded-t-none hover:z-[999]",placeholder:pr("payment.regionPlaceholder"),disabled:i})}
237),Al.includes(t??"")&&L.jsx(et.Item,{noStyle:!0,name:"region",rules:[{required:!0,message:pr("payment.regionSelectRequired")}],children:L.jsx(ur,{showSearch:{optionFilterProp:"label",filterOption:Mc},allowClear:!0,disabled:i,size:"large",className:"payment-region-select hover:z-[999]",styles:{root:{"--ant-select-border-radius":"0 0 var(--ant-border-radius-lg) var(--ant-border-radius-lg)"}},placeholder:pr("payment.regionPlaceholder"),options:a})})]})}function Dc(e){const{id:t,value:r,onChange:n,className:o}=e,s=h.useRef(!1),i=f=>s.current=f,a=Io(f=>f.setCardholderName);function c(f){a(f),n?.(f)}function l(f){const y=f.target.value;if(!y){c("");return}if(!(s.current?/^[\p{L} ']+$/u:/^[\p{L} ]+$/u).test(y)){c(y?.slice?.(0,-1)??"");return}c(y)}return L.jsx(Dt,{...e,id:t,"data-tdbehavior-exkey":"TDBehaviorExInput",allowClear:!0,size:"large",className:o,value:r,onChange:l,onCompositionStart:()=>{i(!0)},onCompositionEnd:()=>{i(!1)}})}const Vw="/static/svg/card-CpVIuWAI.svg",xs="flex pointer-events-none select-none",Ha="w-[32px] h-[20px]",Fw=[rm,tm],za=[em,Qh,Jh,Zh];function Uw(e){const{cardNumber:t}=e,[r,n]=h.useState(za[0]);n1(()=>{n(za[(za.indexOf(r)+1)%za.length])},3e3);const o=t?.replace(/\s/g,"");if(!o||o?.length<6)return L.jsxs("div",{className:le(xs,"gap-1"),children:[Fw.map(i=>L.jsx("img",{src:i,className:Ha},i)),L.jsx(Yt.img,{src:r,className:Ha,initial:{opacity:0}
237,animate:{opacity:1},transition:{duration:.5,ease:"easeInOut"}},r)]});if(e.loading)return L.jsx("div",{className:le(xs,Ha,"items-center justify-center"),children:L.jsx(cr,{size:"small",indicator:L.jsx(Lo,{})})});const s=nm(o);return L.jsx("div",{className:xs,children:L.jsx("img",{src:s?.logo??Vw,className:Ha})})}function jw(e){const{id:t,value:r,onChange:n,onClick:o,onFocus:s,cardBinLoading:i,className:a,maxLength:c=19}=e;function l(f){const m=f.target.value.replace(/\D/g,"");if(m.length>c)return;let d="";for(let v=0;v<m.length;v+=4)d+=`${m.slice(v,v+4)} `;d=d.trim(),n?.(d)}return L.jsx(Dt,{type:"text",inputMode:"numeric",pattern:"[0-9]*",id:t,"data-tdbehavior-exkey":"TDBehaviorExInput",allowClear:!0,size:"large",placeholder:"1234 1234 1234 1234",className:a,value:r,onChange:l,onClick:o,onFocus:s,suffix:L.jsx(Uw,{cardNumber:r,loading:i})})}const Hw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAcZJREFUWEftl79rwkAUx9+d8chQxKHVFgJyiLh0sNCxi6OLiy39P/xD/D9K28XF0aVjoQ5dROQQhFZadDBDjPGuRGogTZsYTOJBvfXej899393jHQLJFpKMBw5AQRWRWyHGmIoxvkUIXQLAUdBpdtzXAeBpOBw+VqtVaxPLUYgxdooQ6iCEKjsmCuv+appmrVQqjW1HB2g0Gt0DwHXYaBHZPxQKhRsHqN/vH6uq+gYASkQJQocxDOOkXC5/rhVijFUwxi+ho0TowDm/oJT2HCDTNPcKRAhxA7Varb0CNZvNA5DvjfMo1G6391qyer3uLpl0r0x6IEII5HI5wBj/Wntd12E6nUbWiTx96KdC6XQa8vm8PECRHX3LQIEKbRknMrP/A5RKpQJVW61WHptYFLJfpKZpvkCccxiP17OYa8UCpKrqulX4rcViAZPJJBmgTCYD2WzWF2g+n8NsNksGyO5diuI/dC6XS7AsZ6Z3wFwl+x5hPwJvY3wGlmEYZ84Ia+eRasi3gQaDgUYI6QDAeXxCeCMLIXpCiBql9N3edf1cu92uUiwWGwBwlcRHUQjxzDm/o5QaG1S5v9JJluqvXAeFgqognUJfgX7+JRV4S28AAAAASUVORK5CYII=",zw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP0AAACiCAMAAAC9MzvsAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAACoUExURQAAAN/f39vb29ra2tnZ2dnZ2djY2NfX19ra2tra2tnZ2dfX19nZ2dnZ2TY2Nv///+PBs/WTZv2CSv98QOe2n+yqjPqHU+PCs9vTz+W8qee2oOLCs6urq319fbe3t87OzoiIiJSUlMLCwp+fnzc3NyAgIKCgoCsrKywsLENDQ3FxcZOTk1paWs3NzXx8fImJiWZmZk9PT2VlZba2tvqIU+yrjeW7qf2BSkfeV6AAAAANdFJOUwAQf7/f73Agn2+AgKC1jvi6AAAAAWJLR0QPGLoA2QAAAAd0SU1FB+kCGgkKDqp9+nMAAAABb3JOVAHPoneaAAACoElEQVR42u3ZYW+aUBTG8aMIuLq7FrtarVWEcYo6t9rVbt//mw2ltjZbXEIaz+B5/m/QFzc5Py5iAiJMpNX2Og4i3wvCt/bQs57ptHUP/R9863FOnR+84NvWs1jU3u+89SA2lbsfwl32Zf7ut9+1HsMqb7v11kPY1RIJrGew60wE7J/+sOLSB73nbeuIWI9gGfW4UY8b9bhRjxv1uKHrPwFHPW7U40Y9btTjRj1u1ONGPW7U40Y9btTjRj1u1ONGPW7U44aut36LbPsG23oC6qmnnnrqqaeeeuqpp5566qmnnnrq30N//j9G/d+6iPqXFYo+N0F/NbgeVtnt0eCq/vqbQSV70XAwrr0+GlXEOzeOaq+/rIx3wz6y/nAt9dQ3QX87mW4P8WySpM8fvsDo40yT4nCXq+q8OA9JcdRFjKFPF7rTZ7r8utK5+1Z8SHL9DqG/3+50oZ+qFmdCNU1Xa+eWuobQr/O7h93eu3h3CuKDH0Pz9bexe3ihLsotn6lOjq5tjL5or49/aLa76d+vNMPY+1d9vND8cX9F6Dw+sraB+kW583E6LW9/UPql5jtwst325Pn2h6JPtSwt/u+zda7LY2sbp5/t9S7NVPPl0bVN0v9R/BgfX9to/T/XUl9Dfb/qQ81G6KOxq9qo/k81x5vKT7Q3B+8zaqp3T5uflewXm6eDr3XVu5uoyousX9G1a4L+XeIbbNyox4163KjHjXrcqMeNetyox4163KjHjXrcqMeNetyox4163KjHjXrcqMeNetyox4163KjHjXrc0PUd6xHs8kU86xns8kTOrGewKxBpWc9gVyjAl363wEvoW49hk7/depHAeg6bAinrWQ9iUU/2BXAXvx/Ia+FH63FOmxfKm8LAA7kAOl6vJazoNzZ4UZniUSqrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI1LTAyLTI2VDA5OjA5OjU0KzAwOjAwcyNltQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNS0wMi0yNlQwOTowOTo1NCswMDowMAJ+3QkAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjUtMDItMjZUMDk6MTA6MTQrMDA6MDDsugYmAAAAAElFTkSuQmCC",Kw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP0AAACiCAMAAAC9MzvsAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAADnUExURQAAAABw3wJu0wFv0gFv0gFu0gJt0QBw1wJv0gJu0wJu0QFu0gBwzwBwzwBt0QBu0QJu0QFu0mGk44C26FGb4HCt5UGS3SGA1yGA2JDA65/J7jGJ2mCk4////+/2/BF31aDI7t/t+b/b86DJ7pC/63Ct5r/b9N/t+rDR8c/k9q/R8a/S8TGJ25/I7hF31IC36VCb4IC26c/k95DA7K/S8J/J7XCu5qDJ70CS3WCk4glz0zmN3Bl81ymF2Rl81kiX32mp5Vmf4lif4nix50CS3mip5UmX33ix6Fif4UGS3lCb4Vmf4SmE2RwrqOAAAAARdFJOUwAQf7/f73Agn2+A3xAgcICgAt7vtwAAAAFiS0dEHesDcZEAAAAHdElNRQfpAhoJCxBJafZRAAAAAW9yTlQBz6J3mgAACRNJREFUeNrtnYt22zYShtkoTrLd2ilACqRNgxAVgV7VN9Ftti1ly3UY2U3b93+ezgzAi+xkT+LtMUOB/0l5AQF6PmAwhCBQ9bxBoG+ejZ4zJ7QzevFyk/3lqGubnlav2vz/2unanKfWzosa/lnXtnShZ1XLd21INzKt/9I5tzfaob7/qmszutIIm75rI7rTN573omsbutO3nufYk74tcH1HYx7q357XtQldaqB3VwO9uxro3dVA764Genc10Lurgd5dDfTu6uun535A+8D3x7j3fV+w0LeKmKA9F+ZaRFn3D/ZFXZxKsdj3cSf8wz7Rh1ImCg8mUsoQzIedT1uSYL49SuEinrMwpfODqrikiuBYDOpHTvtE/wbMH1f0Y0awRD+zbe/LFPZwdWbpU5lqPjGwCI0X6CAJe0efyqnMDP2R/A9jmUwNfWgzWJ6ZTA09YEZ0TslzKE6+g9WQ9Y2eyzQyvjuRP8iEKZlMPkp/jDvMmWEdMRZRd4mlPEnId7hMTD/pE30mT+G/GdGfZlIIOZ20+n2K9MnBwUEm5aGhT43LG72BqpiR73A5BfdQvaKHoBWzMfku0M/kGP49oCdNMZY/oE+hTgT5DtCrRPq9op9B8PJnFO6AXshsLsUDz58Lnsh9VtNTlDvDDQZ6AMYUoGcangR9ok9tG2dED50euv7H+j1wnVv6iQmSPDnGfmMEvoP0dN4f+oWUHJQbKowA0I8/GvWO
237yb1xI6gi4KF/iv0mx/LoO0Qf94r+jbU1Ad9FeuoDlv6IpC099OkL+7wHT08voL0jKJ5S8QzcgejxWm/oQwrkZHSikF5gEGxHPTi0cSyQUht6xrG/TE9YFQLwmjD0Ku0P/eOrLVaflW876T9XA727GujdVW/o42o2B49wpCPgw71q5nXMdR3gCHdss+KkkNg/ONBmZIRTPocbN+0NPa+e8PjMxrFsKucssmn7zXWc4qnGx6eMnZuRLtTD2by+3kf6xLY9DnU0YkVIf+r7cxwUmeuTBGsGqse2PYyXZkGQwqcDnCnQ+HFo1k/6tD6eyCSmmSs78TGHVrbXfQRtPuQuKFWkKQ4RkTtPeznWa9PDoD6hU0ufNfQ0tG/ooZKyQ+PrMMQ/EGebN+0Rfd2XaeBOk3dAPxbBj9bzzRSP3/R7YSZF5QXGOkWp2UbY6ye9naCto968vp7iHF6LnvEp8cO4PxpT+nk/6dP6mGbsM0P/09u3b7WiqCjgw92BYmxzcospMak+K0b48a/1AaiX9ODOHON+1e/r68J8idHQnx/luJtDwsWRMPUV95uevpY5Rt+/T4/TH0Gb3qceEibQ9hm5/39NwOgfvZ3Nic9SBFX4ZH9AD6EtVUCfUNaMQl12AeEgwkiZZEc2cPSQ3oayH03zafD9B/To+/t11IOUiILeFAvQlE8ya8979Ib+0VKinugJRbg557P99P9LA727Gujd1UDvrgZ6dzXQu6uB3l0N9O5qoHdXA727Gujd1UDvrnpML7JEfpk2v77uNf15Kj5vOWqjID3fTOgtPU+/lJ3h13xi47y39FnwmFIi2w56+ahSKnGZ/l6xgb6XGugHeqPQvKZ+xn2zIhkODqsFudyPPlVsS+jf0HKcsFqQFybNemTerG7ZTvqzn81ipEzO+Qzf1MvkD8GFeSsRa2Sr6X/BZbtIn5jX7w/ZbBo1C3e3nJ4nY98sRFNVFYA/HFMSl6fpdtNHivn1MrzzeuXaXKHfp9GW0zPW0J/bJbnipxTDXwZn7tCfy3qRapTg66eZEIkcx58otl30AP8r7kNsbQh/k/ay9m2n5/bnWSJ86oUQ6/MpKJFz7QK9XZ+L67HT46Ra1O1Iv69eSz9kalItTXaC/oHUJ95Bd4P+84oN9L2U2/TJIya0t4c+E48ptZhunPaWXjzm24yztKdvoD+Qn37p9xlnIvU3U/pLb98x/QIl0/u9pcf0/4AGenc10Lurgd5dDfTuaqB3VwO9uxro3dVA764Genc10Lurgd5d/T/0Zna8WDY/4xVfYkKIan3TEl/hllIvbUpkS1617xedUGrcut+DkpRvidsVJbcteVL665wMzH+70dqYu8xjSkE1Bqk8oC3KfJEU09WrnN/k75r7KU0//qnL+n4hlQypZNDKR8twSkw1C3JE/tT0xbsc/2ah38NmTVSqJPrbe+99abL8Ki8a84leQ3KUN4vJDkssuNAFK8rA5sP98m7zfgtiXuXVyutikT81/arUVOMrjS4pyED9nlj49UZOoTn9nvW6wbzWSE+ZtWjyBUhPmemILQKsILbYrM2l5ppqs7Hk9qnp1Qn4b322WJP5BqhcLoNm1UxYKgL6/WYZmBfohC6IGR1mlZ9UN8wVMYs7BY2OJWJt9nyxDJb1/VQZBUh/uw6vrzFVfShaljwNPVpX/80QGVa5IvpVjv3Z9lwAWZrmXEOqzq8I07S4KvU6X1b3gB5E9MVNeVi+K7DkCXUOhvfT+rKVD+l5rgNti3dKvyr/sAGA6PkKyay7LgLrzDdgaMHvCjTf0C/KD8t1VUvX2vr7sgxOAqzN9bUJDcXNCVaF7TgC8yF98AE2tyaYdEkf538gC2e2K5NuTaiK6Yd+63h9lV+i+UR/RWGL26dAqQy9yt9T6QL6h6E3WuZUTeg4hp6Z07hjekH2stzK/h+q7EOI29SIUSOFeaSrfCZSLk2+oMoX5pdEFVUllblfbOiFTY1ZUXwN9ML2vQiV30aQgHZx46krTF3zqIiopeO8oHw6iIAb8y10k+/PdVSs8r9MLVGK5hGUiZp8ivLdRUWR/0L3izqlV/k6RpkkbApVLlQh6ljOrOfjCCYs7cMQPb8o32HK+yafeeJBvpW2vk39Xq8V/K12Pop6dysW6ptWO3RAf1s7fEXPrsC5y2UrI9Gr3yBXNRKgqLfCfO2xAdGrPyEfVw09Dno270f0BXYWXnRG/2mtVPGR1GJ1P1Wt/tl8Xwd9b+R5z7s2oTvteN6oaxu608jzvu3ahu70wvO+69qG7rTrOez6rwDe293p2oxutINN73l7XdvRjfY8o9ddG9KFXnuV9pxz/p09r9Hu912b87Qa7Xob2t0bOeIAz0evv/MGed7f3RYOGVSjAc8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjUtMDItMjZUMDk6MTA6NTIrMDA6MDAtaKSFAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI1LTAyLTI2VDA5OjEwOjUyKzAwOjAwXDUcOQAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNS0wMi0yNlQwOToxMToxNiswMDowMJTnfDEAAAAASUVORK5CYII=";function M0(e){return L.jsxs("div",{className:`flex-1 flex flex-col gap-[20px] ${e.className}`,children:[L.jsx("span",{children:e.title}),L.jsx("img",{src:e.img,className:e.imgClassName}),L.jsx("span",{children:e.subTitle})]})}const Gw=h.forwardRef((e,t)=>{const[r,n]=h.useState(!1);function o(){n(!0)}return h.useImperativeHandle(t,()=>({open:o})),L.jsx($o,{className:e.className,width:650,open:r,maskClosable:!0,centered:!0,onCancel:()=>n(!1),footer:null,children:L.jsxs("div",{className:"flex px-[30px] py-[21px] gap-[26px] max-lg:flex-col max-lg:p-[20px]",children:[L.jsx(M0,{className:"flex-1 pointer-events-none select-none",title:`Visa, MasterCard & Discover: The 3 digits the back of the card next to 238 signature panel.`,subTitle:"Visa, MasterCard & Discover CVV",img:zw}),L.jsx(M0,{className:"flex-1 pointer-events-none select-none",title:"American Express: The 4 digits on the front of the card above the credit card number.",subTitle:"American Express CVV",img:Kw})]})})});function cm(e){const{value:t,onChange:r,style:n,...o}=e;function s(a){const l=a.target.value.replace(/\D/g,"");l.length>4||r?.(l)}const i=h.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx(Dt,{...o,type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off","data-tdbehavior-exkey":"TDBehaviorExInput",allowClear:!0,size:"large",placeholder:"CVV",style:{...n,WebkitTextSecurity:"disc"},value:t,onChange:s,suffix:L.jsx("img",{src:Hw,alt:"cvv",className:"w-[18px] h-[18px] cursor-pointer",onClick:()=>i.current?.open()})}),L.jsx(Gw,{ref:i})]})}function qw(e){const{id:t,value:r,onChange:n,className:o}=e;function s(i){const a=i.target.value;
238let c=a.replace(/[^\d/]/g,"");c.length===1&&Number(c)>1&&(c=`0${c}`),c.length===2&&a.endsWith("/")&&(c=c.slice(0,2));let l="";for(let f=0;f<c.length;f++){const y=c[f];if(f<2){if(f===1&&l[0]==="0"&&y==="0")continue;if(f===1&&parseInt(l+y,10)>12){l=`0${l[0]}`,l+=` / ${y}`;continue}l+=y,f===1&&(l+=" / ")}else{if(y==="/")continue;(l.split(" / ")[1]||"").length<2&&(l+=y)}}c.length===3&&!l.includes("/")&&l.length===2&&(l=`${l.slice(0,2)} / ${c[2]}`),c.endsWith("/")&&(l=l.slice(0,-3)),n?.(l)}return L.jsx(Dt,{type:"text",inputMode:"numeric",pattern:"[0-9]*",id:t,"data-tdbehavior-exkey":"TDBehaviorExInput",size:"large",allowClear:!0,placeholder:"MM / YY",className:o,value:r,onChange:s,suffix:L.jsx($C,{className:"text-ant text-ant-text-quaternary"})})}function Ww(e){const{className:t,form:r,submitLoading:n,exceptionInfo:o,addressDisabled:s}=e,{t:i}=rt(),a=et.useWatch("country",r),c=o.show&&o.type==="card",l=h.useRef(null),f=P=>{tn.includes(P)&&(r.setFieldsValue({line1:void 0,line2:void 0,city:void 0,postalCode:void 0,region:void 0}),l.current?.clearOptions())},y=et.useWatch("cardNumber",r),{countryWithFlagOptions:m}=om(),{cardBinLoading:d,issuingCountryCode:v,preloadPublicKey:b,validateCardNumber:S}=hw(),{showCardCpfNumberInput:u}=mw(),C=v==="BR"&&u,x=et.useWatch("expireDate",r),I=et.useWatch("cvv",r);h.useEffect(()=>{o.show=!1},[y,x,I,o]),h.useEffect(()=>{C||r.setFieldsValue({cpfNumber:void 0})},[r,C]);const{handleValueChange:N,handleFieldsChange:E,handleAddressResolvingChange:g,triggerTaxSession:p}=Yh(r,{skipFields:["cardNumber","expireDate","cvv","cardHolder","cpfNumber"]});function T(P){r.setFieldsValue({line1:P.line1,city:P.city,postalCode:P.postalCode,region:P.region,line2:P.line2}),p()}function R(){Yg()}const B="hover:z-[100] focus-within:z-[101]";return L.jsxs(et,{className:le("payment-card-form",t),form:r,layout:"vertical",disabled:n,onValuesChange:N,onFieldsChange:E,children:[L.jsxs(et.Item,{className:"payment-card-information",label:i("payment.cardInformation"),style:{"--ant-form-item-margin-bottom":c?0:"24px"},children:[L.jsx(et.Item,{noStyle:!0,name:"cardNumber",validateStatus:c?"error":void 0,rules:[{async validator(P,D){return(await S(D))?.paymentMethodAvailable===!1?Promise.reject(i("payment.cardNotSupported")):Promise.resolve()}},{required:!0,message:i("payment.cardNumberRequired"),min:17,max:23,validator(P,D){return ww(D??"")?Promise.resolve():Promise.reject(i("payment.cardNumberRequired"))}}],children:L.jsx(jw,{className:le("rounded-b-[0] mb-[-1px]",B),cardBinLoading:d,onClick:R,onFocus:b})}),L.jsxs("div",{className:"flex",children:[L.jsx(et.Item,{noStyle:!0,name:"expireDate",rules:[{required:!0,message:i("payment.dateRequired")},{required:!0,validator:(P,D)=>{const U=(D??"").trim();let _=aa(U,"MM/YY");return _.isValid()?(_.year()<2e3&&(_=_.add(100,"year")),aa().subtract(1,"day").isBefore(_)?Promise.resolve():Promise.reject(i("payment.dateExpired"))):Promise.reject(i("payment.dateValidate"))}}],children:L.jsx(qw,{className:le("rounded-e-[0] rounded-ss-[0] me-[-1px] flex-1",B)})}),L.jsx(et.Item,{noStyle:!0,name:"cvv",rules:[{required:!0,message:i("payment.cvvRequired"),min:3,max:4},{validator:(P,D)=>{if(!D)return Promise.reject(i("payment.cvvRequired"));const U=nm(y?.replace(/\s/g,""));return U?.cardType!=="amex"&&D.length>3?Promise.reject(i("payment.cvvLengthRequired",{length:3})):U?.cardType==="amex"&&D.length!==4?Promise.reject(i("payment.cvvLengthRequired",{length:4})):Promise.resolve()}}],children:L.jsx(cm,{className:le("rounded-s-[0] rounded-se-[0] flex-1",B)})})]})]}),c&&L.jsx("div",{className:"ant-form-item-explain-error",style:{animation:"animation-shake .5s"},children:o.message}),L.jsx(et.Item,{className:"payment-cardholder-name",label:i("payment.cardholderName"),name:"cardHolder",required:!1,rules:[{required:!0,message:i("payment.cardholderRequired")}],children:L.jsx(Dc,{allowClear:!0,placeholder:i("payment.nameOnCard"),size:"large"})}),C&&L.jsx(et.Item,{className:"payment-cardholder-name",label:i("thirdpart.pix.form.cpfNumber"),name:"cpfNumber",rules:[{required:!0,message:i("common.rules.required",{field:i("thirdpart.pix.form.cpfNumber")})},{pattern:/^\d{3}\.\d{3}\.\d{3}-\d{2}
238$/,message:i("thirdpart.pix.form.invalidCPF")}],children:L.jsx(Xh,{placeholder:"000.000.000-00"})}),L.jsxs(et.Item,{className:"payment-billing-address",label:i("payment.billingAddress"),children:[L.jsx(et.Item,{noStyle:!0,name:"country",rules:[{required:!0,message:i("payment.countryRequired")}],children:L.jsx(ur,{showSearch:{optionFilterProp:"label",filterOption:Mc},disabled:s,allowClear:!0,size:"large",placeholder:i("payment.country"),className:"payment-country-select mb-[-1px] hover:z-[999]",options:m,fieldNames:{label:"labelWithFlag"},styles:{root:{"--ant-select-border-radius":tn.includes(a)?"var(--ant-border-radius-lg) var(--ant-border-radius-lg) 0 0":"var(--ant-border-radius-lg)"}},onSelect:f})}),tn.includes(a)&&L.jsx(lm,{ref:l,countryCode:a,onAddressComplete:T,onAddressResolvingChange:g,disabled:s})]})]})}const Yw="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1787226581258'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4517'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='256'%20height='256'%3e%3cpath%20d='M313.493333%20512a199.04%20199.04%200%200%201%2010.453334-63.402667L206.378667%20360.746667A334.613333%20334.613333%200%200%200%20170.666667%20512c0%2054.336%2012.928%20105.6%2035.754666%20151.125333l117.589334-88.021333A195.733333%20195.733333%200%200%201%20313.493333%20512z'%20fill='%23FBBC05'%20p-id='4518'%3e%3c/path%3e%3cpath%20d='M519.936%20310.293333a204.8%20204.8%200%200%201%20128.554667%2045.013334L750.08%20256c-64-55.125333-145.706667-85.397333-230.186667-85.333333-138.090667%200-256.725333%2077.226667-313.493333%20190.08l117.632%2087.872c26.986667-80.448%20104.192-138.261333%20195.84-138.261334'%20fill='%23EA4335'%20p-id='4519'%3e%3c/path%3e%3cpath%20d='M519.936%20713.685333c-91.648%200-168.832-57.856-195.882667-138.304l-117.674666%2087.850667c56.810667%20112.853333%20175.445333%20190.08%20313.557333%20190.08%2085.12%200%20166.464-29.546667%20227.584-85.056l-111.637333-84.437333c-31.509333%2019.413333-71.104%2029.824-115.946667%2029.824'%20fill='%2334A853'%20p-id='4520'%3e%3c/path%3e%3cpath%20d='M853.333333%20512c0-20.117333-3.2-41.856-7.936-62.08H519.829333v131.797333h187.306667a153.557333%20153.557333%200%200%201-71.317333%20102.08l111.552%2084.394667C811.562667%20710.016%20853.333333%20623.317333%20853.333333%20512z'%20fill='%234285F4'%20p-id='4521'%3e%3c/path%3e%3c/svg%3e";function um(e){return e===!0}function dm(e){return e?.trim().toUpperCase()==="AMEX"?4:3}function Xw(e,t){const r=dm(t);return new RegExp(`^\\d{${r}}$`).test(e)}function Qw(e){const{className:t}=e,{t:r}=rt();return L.jsxs("div",{className:le(t),children:[L.jsx(et.Item,{label:r("thirdpart.pix.form.cardholderName"),name:"cpfName",rules:[{required:!0,message:r("common.rules.required",{field:r("thirdpart.pix.form.cardholderName")})}],hasFeedback:!0,children:L.jsx(Dc,{allowClear:!0,placeholder:r("thirdpart.pix.form.cardholderName")})}),L.jsx(et.Item,{label:r("thirdpart.pix.form.cpfNumber"),name:"cpfNumber",rules:[{required:!0,message:r("common.rules.required",{field:r("thirdpart.pix.form.cpfNumber")})},{pattern:/^\d{3}\.\d{3}\.\d{3}-\d{2}$/,message:r("thirdpart.pix.form.invalidCPF")}],hasFeedback:!0,children:L.jsx(Xh,{placeholder:"000.000.000-00"})})]})}const Zw=["email"];function Nl(e){const{className:t,taxFormDisabled:r,isEbanx:n,emailCollectionEnabled:o}=e,[s]=et.useForm(),{t:i}=rt(),a=et.useWatch("country",s),c=h.useRef(null),l=T=>{tn.includes(T)&&(s.setFieldsValue({line1:void 0,line2:void 0,city:void 0,postalCode:void 0,region:void 0}),c.current?.clearOptions())},f=h.useContext(Bh),{countryWithFlagOptions:y}=om(),{taxAddressInfo:m,handleFieldsChange:d,handleValueChange:v,handleAddressResolvingChange:b,triggerTaxSession:S}=Yh(s,{skipFields:Zw});function u(T){s.setFieldsValue({line1:T.line1,city:T.city,postalCode:T.postalCode,region:T.region,line2:T.line2}),S()}const C=Br(T=>T.currentPaymentType),x=lr(T=>T.requiresTaxCalculation),I=Io.getState().cardholderName,N=I===void 0?{}:{cpfName:I,upiName:I},E=x||n,g=n||tn.includes(a),p=n?"IN":a;return L.jsx(Yt.div,{initial:{opacity:0,transform:"translateX(-10px)"}
238,animate:{opacity:1,transform:"translateX(0)"},transition:{duration:.3},className:le(t,"payment-billing-address","px-4",{"pt-2 pb-3":E||o}),children:L.jsxs(et,{name:"taxAddress",className:"tax-address",disabled:r,form:s,ref:f,onFieldsChange:d,onValuesChange:v,initialValues:n?{...m,...N,country:"IN"}:{...m,...N},layout:"vertical",children:[o&&L.jsx(et.Item,{label:i("payment.emailAddress"),name:"email",rules:[{required:!0,whitespace:!0,message:i("common.rules.required",{field:i("payment.emailAddress")})},{type:"email",message:i("payment.emailInvalid")}],children:L.jsx(Dt,{size:"large",type:"email",allowClear:!0,autoComplete:"email",placeholder:i("payment.emailAddress")})}),C==="PIX"&&L.jsx(Qw,{className:le({"pt-2":!x})}),n&&L.jsx(et.Item,{label:i("payment.upiName"),name:"upiName",rules:[{required:!0,message:i("payment.upiNameRequired")}],children:L.jsx(Dc,{allowClear:!0,size:"large",placeholder:i("payment.upiName")})}),n&&L.jsx(et.Item,{label:i("payment.phoneNumber"),name:"phoneNumber",rules:[{required:!0,message:i("payment.phoneNumberRequired")},{pattern:/^\d{8,10}$/,message:i("payment.phoneNumberInvalid")}],normalize:T=>T?.replace(/\D/g,""),hasFeedback:!0,children:L.jsx(Dt,{size:"large",allowClear:!0,maxLength:10,inputMode:"numeric",placeholder:i("payment.phoneNumber")})}),E&&L.jsxs(et.Item,{label:i("payment.billingAddress"),style:{"--ant-form-item-margin-bottom":0},children:[L.jsx(et.Item,{noStyle:!0,name:"country",rules:[{required:!0,message:i("payment.countryRequired")}],children:L.jsx(ur,{showSearch:{optionFilterProp:"label",filterOption:Mc},allowClear:!0,disabled:n,size:"large",placeholder:i("payment.country"),className:"payment-country-select mb-[-1px] hover:z-[999]",options:y,fieldNames:{label:"labelWithFlag"},styles:{root:{"--ant-select-border-radius":g?"var(--ant-border-radius-lg) var(--ant-border-radius-lg) 0 0":"var(--ant-border-radius-lg)"}},onSelect:l})}),g&&L.jsx(lm,{ref:c,countryCode:p,onAddressComplete:u,onAddressResolvingChange:b})]})]})})}const Jw="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20122.88%2038.52'%20style='enable-background:new%200%200%20122.88%2038.52'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%3c![CDATA[%20.st0{fill:%2320336B;}%20.st1{fill:%2300BAF2;}%20]]%3e%3c/style%3e%3cg%3e%3cpath%20class='st1'%20d='M122.47,11.36c-1.12-3.19-4.16-5.48-7.72-5.48h-0.08c-2.32,0-4.41,0.97-5.9,2.52%20c-1.49-1.55-3.58-2.52-5.9-2.52h-0.07c-2.04,0-3.91,0.75-5.34,1.98V7.24c-0.05-0.63-0.56-1.12-1.2-1.12h-5.48%20c-0.67,0-1.21,0.54-1.21,1.21v29.74c0,0.67,0.54,1.21,1.21,1.21h5.48c0.61,0,1.12-0.46,1.19-1.04l0-21.35c0-0.08,0-0.14,0.01-0.21%20c0.09-0.95,0.79-1.74,1.89-1.83h1.01c0.46,0.04,0.85,0.2,1.15,0.45c0.48,0.38,0.74,0.96,0.74,1.6l0.02,21.24%20c0,0.67,0.54,1.22,1.21,1.22h5.48c0.65,0,1.17-0.51,1.2-1.15l0-21.33c0-0.7,0.32-1.34,0.89-1.71c0.28-0.18,0.62-0.3,1.01-0.34h1.01%20c1.19,0.1,1.9,1,1.9,2.05l0.02,21.22c0,0.67,0.54,1.21,1.21,1.21h5.48c0.64,0,1.17-0.5,1.21-1.13V13.91%20C122.86,12.6,122.69,11.99,122.47,11.36L122.47,11.36z%20M85.39,6.2h-3.13V1.12c0-0.01,0-0.01,0-0.02C82.26,0.5,81.77,0,81.15,0%20c-0.07,0-0.14,0.01-0.21,0.02c-3.47,0.95-2.78,5.76-9.12,6.17h-0.61c-0.09,0-0.18,0.01-0.27,0.03h-0.01l0.01,0%20C70.41,6.35,70,6.83,70,7.41v5.48c0,0.67,0.54,1.21,1.21,1.21h3.3l-0.01,23.22c0,0.66,0.54,1.2,1.2,1.2h5.42%20c0.66,0,1.2-0.54,1.2-1.2l0-23.22h3.07c0.66,0,1.21-0.55,1.21-1.21V7.41C86.6,6.74,86.06,6.2,85.39,6.2L85.39,6.2z'/%3e%3cpath%20class='st0'%20d='M65.69,6.2h-5.48C59.55,6.2,59,6.74,59,7.41v11.33c-0.01,0.7-0.58,1.26-1.28,1.26h-2.29%20c-0.71,0-1.29-0.57-1.29-1.28L54.12,7.41c0-0.67-0.54-1.21-1.21-1.21h-5.48c-0.67,0-1.21,0.54-1.21,1.21v12.41%20c0,4.71,3.36,8.08,8.08,8.08c0,0,3.54,0,3.65,0.02c0.64,0.07,1.13,0.61,1.13,1.27c0,0.65-0.48,1.19-1.12,1.27%20c-0.03,0-0.06,0.01-0.09,0.02l-8.01,0.03c-0.67,0-1.21,0.54-1.21,1.21v5.47c0,0.67,0.54,1.21,1.21,1.21h8.95%20c4.72,0,8.08-3.36,8.08-8.07V7.41C66.9,6.74,66.36,6.2,65.69,6.2L65.69,6.2z%20M34.53,6.23h-7.6c-0.67,0-1.22,0.51-1.22,1.13v2.13%20c0,0.01,0,0.03,0,0.04c0,0.02,0,0.03,0,0.05v2.92c0,0.66,0.58,1.21,1.29,1.21h7.24c0.57,0.09,1.02,0.51,1.09,1.16v0.71%20c-0.06,0.62-0.51,1.07-1.06,1.12h-3.58c-4.77,0-8.16,3.17-8.16,7.61v6.37c0,4.42,2.92,7.56,7.65,7.56h9.93%2
2380c1.78,0,3.23-1.35,3.23-3.01V14.45C43.34,9.41,40.74,6.23,34.53,6.23L34.53,6.23z%20M35.4,29.09v0.86c0,0.07-0.01,0.14-0.02,0.2%20c-0.01,0.06-0.03,0.12-0.05,0.18c-0.17,0.48-0.65,0.83-1.22,0.83h-2.28c-0.71,0-1.29-0.54-1.29-1.21v-1.03c0-0.01,0-0.03,0-0.04%20l0-2.75v-0.86l0-0.01c0-0.66,0.58-1.2,1.29-1.2h2.28c0.71,0,1.29,0.54,1.29,1.21V29.09L35.4,29.09z%20M13.16,6.19H1.19%20C0.53,6.19,0,6.73,0,7.38v5.37c0,0.01,0,0.02,0,0.03c0,0.03,0,0.05,0,0.07v24.29c0,0.66,0.49,1.2,1.11,1.21h5.58%20c0.67,0,1.21-0.54,1.21-1.21l0.02-8.32h5.24c4.38,0,7.44-3.04,7.44-7.45v-7.72C20.6,9.25,17.54,6.19,13.16,6.19L13.16,6.19z%20M12.68,16.23v3.38c0,0.71-0.57,1.29-1.28,1.29l-3.47,0v-6.77h3.47c0.71,0,1.28,0.57,1.28,1.28V16.23L12.68,16.23z'/%3e%3c/g%3e%3c/svg%3e",e4="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769481117736'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5725'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='256'%20height='256'%3e%3cpath%20d='M93.59%2097.82m138.36%200l553.42%200q138.36%200%20138.36%20138.36l0%20553.42q0%20138.36-138.36%20138.36l-553.42%200q-138.36%200-138.36-138.36l0-553.42q0-138.36%20138.36-138.36Z'%20fill='%235F259F'%20p-id='5726'%3e%3c/path%3e%3cpath%20d='M714.22%20414.65c0-16.93-14.51-31.44-31.44-31.44h-58l-133-152.36c-12.09-14.51-31.44-19.35-50.79-14.51L395%20230.85c-7.25%202.42-9.67%2012.09-4.83%2016.93l145.1%20137.84H315.19c-7.26%200-12.09%204.84-12.09%2012.1v24.18c0%2016.93%2014.51%2031.44%2031.43%2031.44h33.86v116.08c0%2087.06%2045.95%20137.85%20123.34%20137.85%2024.18%200%2043.53-2.42%2067.71-12.1v77.39a38.2%2038.2%200%200%200%2038.7%2038.7H632c7.26%200%2014.51-7.26%2014.51-14.51V450.92h55.62c7.26%200%2012.1-4.84%2012.1-12.09z%20m-154.78%20208c-14.51%207.26-33.86%209.68-48.37%209.68-38.69%200-58-19.35-58-62.88V453.34h106.37z'%20fill='%23FFFFFF'%20p-id='5727'%3e%3c/path%3e%3c/svg%3e",t4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='60'%20fill-rule='evenodd'%3e%3cpath%20d='M95.678%2042.9L110%2029.835l-6.784-13.516z'%20fill='%23097939'/%3e%3cpath%20d='M90.854%2042.9l14.322-13.065-6.784-13.516z'%20fill='%23ed752e'/%3e%3cpath%20d='M22.41%2016.47l-6.03%2021.475%2021.407.15%205.88-21.625h5.427l-7.05%2025.14c-.27.96-1.298%201.74-2.295%201.74H12.31c-1.664%200-2.65-1.3-2.2-2.9l6.724-23.98zm66.182-.15h5.427l-7.538%2027.03h-5.58zM49.698%2027.582l27.136-.15%201.81-5.707H51.054l1.658-5.256%2029.4-.27c1.83-.017%202.92%201.4%202.438%203.167L81.78%2029.49c-.483%201.766-2.36%203.197-4.19%203.197H53.316L50.454%2043.8h-5.28z'%20fill='%23747474'/%3e%3c/svg%3e";function No(e){const{disabledReason:t,className:r}=e;return L.jsx("span",{className:le("text-ant-sm leading-[14px] font-semibold text-ant-text-secondary","opacity-90",r),children:t})}const r4=[{img:v2,name:"Google Pay",value:"GOOGLEPAY",i18nkey:"payment.thirdPartNames.googlePay",notSupportRemember:!0,customClass:"w-auto h-[18px]"},{img:e4,name:"PhonePe",value:"PHONEPE",i18nkey:"payment.thirdPartNames.phonePe",notSupportRemember:!0},{img:Jw,name:"Paytm",value:"PAYTM",i18nkey:"payment.thirdPartNames.paytm",notSupportRemember:!0}];function n4(e){const{className:t,paymentOptions:r,disabled:n,selectType:o,taxFormDisabled:s,emailCollectionEnabled:i,showTopBorder:a=!0}=e,{t:c}=rt(),l=h.useMemo(()=>{const d=r.find(v=>v.paymentMethod==="UPI");return d?d.paymentInstrumentList??[]:null},[r]),f=h.useMemo(()=>{const d=r.find(v=>v.paymentMethod==="UPI");return d?yh(d,["disabledReason","disabled"]):null},[r]),y=h.useMemo(()=>r.find(v=>v.paymentMethod==="UPI")?.extraProperties?.gateway==="ebanx",[r]);if(!l)return null;if(Nf()==="qrcode"){const d="UPI:QRCODE",v=o===d;return L.jsx("div",{className:le(t,{"border-t border-ant-border-secondary":a}),children:L.jsxs("div",{children:[L.jsx(Ir,{disabled:n||f?.disabled,styles:{label:{flex:"1"}},value:d,className:le("flex items-center","px-4 py-3","hover:bg-ant-fill-tertiary"),style:{"--ant-radio-wrapper-margin-inline-end":0},children:L.jsxs("div",{className:le("flex justify-between items-center"),children:[L.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[L.jsx("div",{className:le("flex justify-center items-center","w-[42px]"),children:L.jsx("img",{src:g2,className:le("w-[20px] h-[20px] mx-[6px]","pointer-events-none select-none")})}),L.jsxs("div",{className:"flex flex-col",children:[L.jsx("span",{children:c("thirdpart.upi.canAndPay")}),f&&f.disabled&&L.jsx(No,{disabledReason:f.disabledReason})]})]}),L.jsx("div",{})]})}),v&&L.jsx(Nl,{taxFormDisabled:s,isEbanx:y,emailCollectionEnabled:i})]},d)})}return L.jsxs("div",{className:le(t,{"border-t border-ant-border-secondary":a}),children:[l.map(d=>{const v=`UPI:${d.subPaymentMethodType}`,b=o===v,S=r4.find(u=>u.value===d.subPaymentMethodType);return L.jsxs("div",{children:[L.jsx(Ir,{disabled:n||f?.disabled,styles:{label:{flex:"1"}},value:v,className:le("flex items-center","px-4 py-3","hover:bg-ant-fill-tertiary"),style:{"--ant-radio-wrapper-margin-inline-end":0},children:L.jsxs("div",{className:le("flex justify-between items-center"),children:[L.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[L.jsx("div",{className:le("flex justify-center items-center","w-[42px]"),children:L.jsx("img",{src:S?.img,className:le("w-[20px] h-[20px] mx-[6px]","pointer-events-none select-none",S?.customClass)})}),L.jsx("span",{children:S?.name})]}),L.jsx("div",{children:L.jsx("img",{src:t4,className:le("w-[40px] h-[20px] ml-[6px]","pointer-events-none select-none","border border-ant-border-secondary rounded-[2px]")})})]})}),b&&L.jsx(Nl,{taxFormDisabled:s,isEbanx:y,emailCollectionEnabled:i})]},v)}),f&&f.disabled&&L.jsx(No,{className:"block px-4 pb-2",disabledReason:f.disabledReason})]})}const a4={googlepay:{src:Yw,alt:"Google Pay"},applepay:{src:C2,alt:"Apple Pay"},link:{src:b2,alt:"Link"}};function o4(e){if(e)return a4[e.toLowerCase()]}function D0(e){const{paymentOptions:t,selectType:r,onSelectChange:n,disabled:o,taxFormDisabled:s,showFirstDivider:i=!0}=e,{i18n:a,t:c}=rt(),l=t.filter(f=>f.paymentMethod!==hr);return l.length===0?null:L.jsx(Ir.Group,{disabled:o,value:r,onChange:f=>n(f.target.value),className:"w-full",children:l.map((f,y)=>{const m=i||y>0,d=f.paymentInstrumentList?.[0]?.paymentInstrumentId,v=d??f.paymentMethod,b=[d,f.paymentMethod].includes(r),u=l.map(I=>I.paymentInstrumentList??[]).flat(1/0).find(I=>I.paymentInstrumentId===v),C=!!u?.cardLastFour,x=y2(f.extraProperties);return f.paymentMethod==="UPI"?L.jsx(n4,{paymentOptions:l,disabled:o||f.disabled,selectType:r,taxFormDisabled:s,emailCollectionEnabled:x,showTopBorder:m},f.paymentMethod):L.jsxs("div",{className:le({"border-t border-ant-border-secondary":m}),children:[L.jsx(Ir,{disabled:o||f.disabled,styles:{label:{flex:"1"}},value:v,className:le("flex items-center","px-4 py-3","any-hover:hover:bg-ant-fill-tertiary"),style:{"--ant-radio-wrapper-margin-inline-end":0},children:L.jsxs("div",{className:le("flex justify-between items-center"),children:[L.jsxs("div",{className:"flex items-center font-medium gap-1",children:[L.jsx("div",{className:le("flex justify-center items-center","w-[42px]"),children:L.jsx("img",{src:Wa(f.paymentMethod,a)?.img,className:le("w-[20px] h-[20px] mx-[6px]","pointer-events-none select-none",Wa(f.paymentMethod,a)?.customClass)})}),L.jsxs("div",{className:"flex flex-col",children:[L.jsx("span",{children:Wa(f.paymentMethod,a)?.name}),f.disabled&&L.jsx(No,{disabledReason:f.disabledReason})]})]}),L.jsx("div",{children:u?.cardLastFour&&L.jsx(yc,{className:le("m-0","mr-[-8px]"),color:"success",children:c(u.cardLastFour)})})]})}),b&&!C&&L.jsx(Nl,{taxFormDisabled:s,emailCollectionEnabled:x})]},f.paymentMethod)})})}function i4(e){const{cvvForm:t,paymentOptions:r,selectType:n,onSelectChange:o,disabled:s}=e,{t:i}=rt(),a=M3(),c=r.find(f=>f.paymentMethod===hr);if(!c)return null;const l=c.paymentInstrumentList??[];return l.length===0?null:L.jsx(et,{form:t,component:!1,children:L.jsx(Ir.Group,{disabled:s,style:{"--ant-radio-wrapper-margin-inline-end":0,width:"100%"},value:n,onChange:f=>o(f.target.value),children:l.map((f,y)=>{const m=f.paymentInstrumentId===n&&um(f.cvvRequired),d=dm(f.cardScheme),v=o4(f.subPaymentMethodType);return L.jsxs("div",{className:le("mt-3",{"mb-3":y!==l.length-1}),children:[L.jsx(Ir,{styles:{root:{width:"100%"},label:{flex:1}},disabled:f.disabled,value:f.paymentInstrumentId,className:le("flex items-center px-4"),children:L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:le("flex items-center justify-between","text-ant-text gap-[8px] ml-[1px]",{"text-ant-text-disabled":s||f.disabled}),children:[L.jsxs("div",{className:le("flex items-center gap-1 font-medium","text-ant"),children:[L.jsx("div",{className:le("flex justify-center items-center","w-[42px]"),children:v?L.jsx("img",{src:v.src,alt:v.alt,className:le("w-[20px] h-[20px]","pointer-events-none select-none")}):yl(f.cardScheme).node}),L.jsx("span",{children:yl(f.cardScheme).name??"-"}),"â¢â¢â¢â¢",L.jsx("span",{children:f.cardLastFour})]}),f.expiryMonth&&f.expiryYear&&L.jsxs("div",{className:le("max-lg:hidden","text-ant-sm leading-[20px] text-ant-text-secondary font-mono",{"text-ant-text-disabled":s||f.disabled}),children:[i("payment.expires")," ",f.expiryMonth,"/",f.expiryYear]})]}
238),f.disabled&&L.jsx(No,{disabledReason:f.disabledReason,className:"ms-2"})]})}),m&&L.jsx(Yt.div,{initial:a?!1:{opacity:0,transform:"translateY(-6px)"},animate:{opacity:1,transform:"translateY(0)"},transition:{duration:.2,ease:"easeOut"},className:le("px-4 pt-3","text-ant"),children:L.jsx(et.Item,{className:le("mb-0"),layout:"vertical",name:"cvv",preserve:!1,rules:[{required:!0,message:i("payment.cvvRequired")},{validator:(b,S)=>S?Xw(S,f.cardScheme)?Promise.resolve():Promise.reject(i("payment.cvvLengthRequired",{length:d})):Promise.resolve()}],children:L.jsx(cm,{disabled:s||f.disabled})})})]},f.paymentInstrumentId)})})})}var Kn={},Zn={exports:{}},s4=Zn.exports,$0;function l4(){return $0||($0=1,(function(e,t){(function(r,n){n(t)})(s4,(function(r){var n=function(){return n=Object.assign||function(s){for(var i,a=1,c=arguments.length;a<c;a++)for(var l in i=arguments[a])Object.prototype.hasOwnProperty.call(i,l)&&(s[l]=i[l]);return s},n.apply(this,arguments)},o=(function(){function s(i,a,c){var l=this;this.endVal=a,this.options=c,this.version="2.10.1",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",autoAnimate:!1,autoAnimateDelay:200,autoAnimateOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(f){l.startTime||(l.startTime=f);var y=f-l.startTime;l.remaining=l.duration-y,l.useEasing?l.countDown?l.frameVal=l.startVal-l.easingFn(y,0,l.startVal-l.endVal,l.duration):l.frameVal=l.easingFn(y,l.startVal,l.endVal-l.startVal,l.duration):l.frameVal=l.startVal+(l.endVal-l.startVal)*(y/l.duration);var m=l.countDown?l.frameVal<l.endVal:l.frameVal>l.endVal;l.frameVal=m?l.endVal:l.frameVal,l.frameVal=Number(l.frameVal.toFixed(l.options.decimalPlaces)),l.printValue(l.frameVal),y<l.duration?l.rAF=requestAnimationFrame(l.count):l.finalEndVal!==null?l.update(l.finalEndVal):l.options.onCompleteCallback&&l.options.onCompleteCallback()},this.formatNumber=function(f){var y,m,d,v,b=f<0?"-":"";y=Math.abs(f).toFixed(l.options.decimalPlaces);var S=(y+="").split(".");if(m=S[0],d=S.length>1?l.options.decimal+S[1]:"",l.options.useGrouping){v="";for(var u=3,C=0,x=0,I=m.length;x<I;++x)l.options.useIndianSeparators&&x===4&&(u=2,C=1),x!==0&&C%u==0&&(v=l.options.separator+v),C++,v=m[I-x-1]+v;m=v}return l.options.numerals&&l.options.numerals.length&&(m=m.replace(/[0-9]/g,(function(N){return l.options.numerals[+N]})),d=d.replace(/[0-9]/g,(function(N){return l.options.numerals[+N]}))),b+l.options.prefix+m+d+l.options.suffix},this.easeOutExpo=function(f,y,m,d){return m*(1-Math.pow(2,-10*f/d))*1024/1023+y},this.options=n(n({},this.defaults),c),this.options.enableScrollSpy&&(this.options.autoAnimate=!0),this.options.scrollSpyDelay!==void 0&&(this.options.autoAnimateDelay=this.options.scrollSpyDelay),this.options.scrollSpyOnce&&(this.options.autoAnimateOnce=!0),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el=typeof i=="string"?document.getElementById(i):i,a=a??this.parse(this.el.innerHTML),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(a),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,this.options.separator===""&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined",typeof window<"u"&&this.options.autoAnimate&&(this.error||typeof IntersectionObserver>"u"?this.error:this.setupObserver())}return s.prototype.setupObserver=function(){var i=this,a=s.observedElements.get(this.el);a&&a.unobserve(),s.observedElements.set(this.el,this),this.observer=new IntersectionObserver((function(c){for(var l=0,f=c;l<f.length;l++){var y=f[l];y.isIntersecting&&i.paused&&!i.once?(i.paused=!1,i.autoAnimateTimeout=setTimeout((function(){return i.start()}),i.options.autoAnimateDelay),i.options.autoAnimateOnce&&(i.once=!0,i.observer.disconnect())):y.isIntersecting||i.paused||(clearTimeout(i.autoAnimateTimeout),i.reset())}}),{threshold:0}),this.observer.observe(this.el)},s.prototype.unobserve=function(){var i;clearTimeout(this.autoAnimateTimeout),(i=this.observer)===null||i===void 0||i.disconnect(),s.observedElements.delete(this.el)},s.prototype.onDestroy=function(){clearTimeout(this.autoAnimateTimeout),cancelAnimationFrame(this.rAF),this.paused=!0,this.unobserve(),this.options.onCompleteCallback=null,this.options.onStartCallback=null},s.prototype.determineDirectionAndSmartEasing=function(){var i=this.finalEndVal!==null?this.finalEndVal:this.endVal;this.countDown=this.startVal>i;var a=i-this.startVal;if(Math.abs(a)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=i;var c=this.countDown?1:-1;
238this.endVal=i+c*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=i,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},s.prototype.start=function(i){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),i&&(this.options.onCompleteCallback=i),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},s.prototype.pauseResume=function(){if(this.paused)this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count);else{cancelAnimationFrame(this.rAF);var i=this.finalEndVal!==null?this.duration+this.remaining:this.remaining;this.remaining=i}this.paused=!this.paused},s.prototype.reset=function(){clearTimeout(this.autoAnimateTimeout),cancelAnimationFrame(this.rAF),this.paused=!0,this.once=!1,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},s.prototype.update=function(i){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(i),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},s.prototype.printValue=function(i){var a;if(this.el){var c=this.formattingFn(i);!((a=this.options.plugin)===null||a===void 0)&&a.render?this.options.plugin.render(this.el,c):this.el.tagName==="INPUT"?this.el.value=c:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=c:this.el.innerHTML=c}},s.prototype.ensureNumber=function(i){return typeof i=="number"&&!isNaN(i)},s.prototype.validateValue=function(i){var a=Number(i);return this.ensureNumber(a)?a:(this.error="[CountUp] invalid start or end value: ".concat(i),null)},s.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},s.prototype.parse=function(i){var a=function(y){return y.replace(/([.,'Â ])/g,"\\$1")},c=a(this.options.separator),l=a(this.options.decimal),f=i.replace(new RegExp(c,"g"),"").replace(new RegExp(l,"g"),".");return parseFloat(f)},s.observedElements=new WeakMap,s})();r.CountUp=o}))})(Zn,Zn.exports)),Zn.exports}var O0;function c4(){if(O0)return Kn;O0=1,Object.defineProperty(Kn,"__esModule",{value:!0});var e=Xg(),t=l4();function r(p,T){var R=p==null?null:typeof Symbol<"u"&&p[Symbol.iterator]||p["@@iterator"];if(R!=null){var B,P,D,U,_=[],V=!0,z=!1;try{if(D=(R=R.call(p)).next,T!==0)for(;!(V=(B=D.call(R)).done)&&(_.push(B.value),_.length!==T);V=!0);}catch(q){z=!0,P=q}finally{try{if(!V&&R.return!=null&&(U=R.return(),Object(U)!==U))return}finally{if(z)throw P}}return _}}function n(p,T){var R=Object.keys(p);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(p);T&&(B=B.filter(function(P){return Object.getOwnPropertyDescriptor(p,P).enumerable})),R.push.apply(R,B)}return R}function o(p){for(var T=1;T<arguments.length;T++){var R=arguments[T]!=null?arguments[T]:{};T%2?n(Object(R),!0).forEach(function(B){a(p,B,R[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(R)):n(Object(R)).forEach(function(B){Object.defineProperty(p,B,Object.getOwnPropertyDescriptor(R,B))})}return p}function s(p,T){if(typeof p!="object"||!p)return p;var R=p[Symbol.toPrimitive];if(R!==void 0){var B=R.call(p,T);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(p)}function i(p){var T=s(p,"string");return typeof T=="symbol"?T:String(T)}function a(p,T,R){return T=i(T),T in p?Object.defineProperty(p,T,{value:R,enumerable:!0,configurable:!0,writable:!0}):p[T]=R,p}function c(){return c=Object.assign?Object.assign.bind():function(p){for(var T=1;T<arguments.length;T++){var R=arguments[T];for(var B in R)Object.prototype.hasOwnProperty.call(R,B)&&(p[B]=R[B]
238)}return p},c.apply(this,arguments)}function l(p,T){if(p==null)return{};var R={},B=Object.keys(p),P,D;for(D=0;D<B.length;D++)P=B[D],!(T.indexOf(P)>=0)&&(R[P]=p[P]);return R}function f(p,T){if(p==null)return{};var R=l(p,T),B,P;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(p);for(P=0;P<D.length;P++)B=D[P],!(T.indexOf(B)>=0)&&Object.prototype.propertyIsEnumerable.call(p,B)&&(R[B]=p[B])}return R}function y(p,T){return m(p)||r(p,T)||d(p,T)||b()}function m(p){if(Array.isArray(p))return p}function d(p,T){if(p){if(typeof p=="string")return v(p,T);var R=Object.prototype.toString.call(p).slice(8,-1);if(R==="Object"&&p.constructor&&(R=p.constructor.name),R==="Map"||R==="Set")return Array.from(p);if(R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R))return v(p,T)}}function v(p,T){(T==null||T>p.length)&&(T=p.length);for(var R=0,B=new Array(T);R<T;R++)B[R]=p[R];return B}function b(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 239In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function u(p){var T=e.useRef(p);return S(function(){T.current=p}),e.useCallback(function(){for(var R=arguments.length,B=new Array(R),P=0;P<R;P++)B[P]=arguments[P];return T.current.apply(void 0,B)},[])}var C=function(T,R){var B=R.decimal,P=R.decimals,D=R.duration,U=R.easingFn,_=R.end,V=R.formattingFn,z=R.numerals,q=R.prefix,G=R.separator,Y=R.start,ee=R.suffix,J=R.useEasing,te=R.useGrouping,Q=R.useIndianSeparators,Z=R.enableScrollSpy,W=R.scrollSpyDelay,oe=R.scrollSpyOnce,ie=R.plugin;return new t.CountUp(T,_,{startVal:Y,duration:D,decimal:B,decimalPlaces:P,easingFn:U,formattingFn:V,numerals:z,separator:G,prefix:q,suffix:ee,plugin:ie,useEasing:J,useIndianSeparators:Q,useGrouping:te,enableScrollSpy:Z,scrollSpyDelay:W,scrollSpyOnce:oe})},x=["ref","startOnMount","enableReinitialize","delay","onEnd","onStart","onPauseResume","onReset","onUpdate"],I={decimal:".",separator:",",delay:null,prefix:"",suffix:"",duration:2,start:0,decimals:0,startOnMount:!0,enableReinitialize:!0,useEasing:!0,useGrouping:!0,useIndianSeparators:!1},N=function(T){var R=Object.fromEntries(Object.entries(T).filter(function(M){var H=y(M,2),F=H[1];return F!==void 0})),B=e.useMemo(function(){return o(o({},I),R)},[T]),P=B.ref,D=B.startOnMount,U=B.enableReinitialize,_=B.delay,V=B.onEnd,z=B.onStart,q=B.onPauseResume,G=B.onReset,Y=B.onUpdate,ee=f(B,x),J=e.useRef(),te=e.useRef(),Q=e.useRef(!1),Z=u(function(){return C(typeof P=="string"?P:P.current,ee)}),W=u(function(M){var H=J.current;if(H&&!M)return H;var F=Z();return J.current=F,F}),oe=u(function(){var M=function(){return W(!0).start(function(){V?.({pauseResume:ie,reset:A,start:O,update:$})})};_&&_>0?te.current=setTimeout(M,_*1e3):M(),z?.({pauseResume:ie,reset:A,update:$})}),ie=u(function(){W().pauseResume(),q?.({reset:A,start:O,update:$})}),A=u(function(){W().el&&(te.current&&clearTimeout(te.current),W().reset(),G?.({pauseResume:ie,start:O,update:$}))}),$=u(function(M){W().update(M),Y?.({pauseResume:ie,reset:A,start:O})}),O=u(function(){A(),oe()}),w=u(function(M){D&&(M&&A(),oe())});return e.useEffect(function(){Q.current?U&&w(!0):(Q.current=!0,w())},[U,Q,w,_,T.start,T.suffix,T.prefix,T.duration,T.separator,T.decimals,T.decimal,T.formattingFn]),e.useEffect(function(){return function(){A()}},[A]),{start:O,pauseResume:ie,reset:A,update:$,getCountUp:W}},E=["className","redraw","containerProps","children","style"],g=function(T){var R=T.className,B=T.redraw,P=T.containerProps,D=T.children,U=T.style,_=f(T,E),V=e.useRef(null),z=e.useRef(!1),q=N(o(o({},_),{},{ref:V,startOnMount:typeof D!="function"||T.delay===0,enableReinitialize:!1})),G=q.start,Y=q.reset,ee=q.update,J=q.pauseResume,te=q.getCountUp,Q=u(function(){G()}),Z=u(function(ie){T.preserveValue||Y(),ee(ie)}),W=u(function(){typeof T.children=="function"&&!(V.current instanceof Element)||te()});e.useEffect(function(){W()},[W]),e.useEffect(function(){z.current&&Z(T.end)},[T.end,Z]);var oe=B&&T;return e.useEffect(function(){B&&z.current&&Q()},[Q,B,oe]),e.useEffect(function(){!B&&z.current&&Q()},[Q,B,T.start,T.suffix,T.prefix,T.duration,T.separator,T.decimals,T.decimal,T.className,T.formattingFn]),e.useEffect(function(){z.current=!0},[]),typeof D=="function"?D({countUpRef:V,start:G,reset:Y,update:ee,pauseResume:J,getCountUp:te}):e.createElement("span",c({className:R,ref:V,style:U},P),typeof T.start<"u"?te().formattingFn(T.start):"")};return Kn.default=g,Kn.useCountUp=N,Kn}var u4=c4();const d4=Ro(u4);var _0,k0,f4=Array.isArray,fm=typeof window<"u"&&typeof document<"u",p4=fm&&typeof((_0=document.body)==null||(k0=_0.style)==null?void 0:k0.webkitLineClamp)<"u";function pm(){for(var e=[],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];
239return r.forEach(function(o){typeof o=="string"?e.push(o):f4(o)?e=e.concat(o):o&&Object.keys(o).forEach(function(s){o[s]&&e.push(s)})}),e.join(" ")}function h4(e,t){t===void 0&&(t={});var r=t.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var m4=`.__react-ellipsis-native.ellipsis { 240 display: -webkit-box; 241 overflow: hidden; 242 text-overflow: ellipsis; 243 word-break: break-word; 244 -webkit-box-orient: vertical; 245} 246`;h4(m4);function g4(e){var t=e.text,r=e.maxLine,n=e.ellipsis,o=e.dangerouslyUseInnerHTML;return xe.createElement("div",{className:pm("__react-ellipsis-native",{ellipsis:n}),style:{WebkitLineClamp:r}},o?xe.createElement("span",{dangerouslySetInnerHTML:{__html:t}}):xe.createElement("span",null,t))}var v4=xe.memo(g4),V0=typeof window<"u"?h.useLayoutEffect:h.useEffect;function y4(e,t){return window.getComputedStyle||(window.getComputedStyle=function(r){return this.getPropertyValue=function(n){var o=/(-([a-z]){1})/g;return n==="float"&&(n="styleFloat"),o.test(n)&&(n=n.replace(o,function(){return arguments[2].toUpperCase()})),r.currentStyle&&r.currentStyle[n]?r.currentStyle[n]:null},this}),window.getComputedStyle(e,null).getPropertyValue(t)}function b4(e){var t=y4(e,"line-height");if(t==="normal"){var r=document.createElement("span");r.style.width="300px",r.style.position="absolute",r.style.visibility="hidden",r.innerText="test",e.appendChild(r);var n=r.clientHeight;return e.removeChild(r),n*1.1}return parseFloat(t)}function C4(e){var t=document.createElement("span");return t.className="__react-ellipsis-js-content-text",t.textContent=e,t}function hm(e){if(fm)if(e.nodeType===Node.TEXT_NODE){if(e.textContent){var t;(t=e.parentNode)==null||t.replaceChild(C4(e.textContent),e)}}else e.childNodes.forEach(function(r){hm(r)})}function x4(e){return e.getBoundingClientRect().height}function S4(e){var t=e.text,r=e.dangerouslyUseInnerHTML,n=e.maxLine,o=n===void 0?1:n,s=e.visibleLine,i=e.maxHeight,a=e.visibleHeight,c=e.ellipsis,l=e.ellipsisNode,f=e.endExcludes,y=f===void 0?[]:f,m=e.reflowOnResize,d=e.onReflow,v=e.onEllipsisClick,b=typeof s>"u"?o:s,S=h.useRef(null),u=h.useRef(!1),C=h.useRef(null),x=h.useRef(null),I=h.useRef(null),N=h.useRef(0);function E(B,P){d&&typeof d=="function"&&d(B,P)}var g=h.useCallback(function(){if(!(!C.current||!x.current||!I.current||u.current)&&(I.current.style.display="none",r?x.current.innerHTML=t:x.current.innerText=t,!!c)){var B=typeof i>"u"?N.current*o:i,P=typeof a>"u"?typeof i>"u"?N.current*b:i:a,D=x4(C.current);if(D<=Math.max(B,P)){E(!1,t);return}u.current=!0,I.current.style.display="inline",r?(hm(x.current),T(C.current,x.current,P)):p(C.current,x.current,P),u.current=!1}},[t,c,r,o,s,i,a,l,y]);function p(B,P,D){for(var U=P.textContent||"",_="",V=0,z=U.length;V<z;){var q=Math.floor((V+z)/2);if(V===q)break;var G=U.slice(V,q);P.innerText=_+G;var Y=B.clientHeight;Y>D?z=q:(_+=G,V=q)}for(;y.includes(_[_.length-1]);)_=_.slice(0,-1);P.innerText=_,E(!0,_)}function T(B,P,D){var U=P.childNodes;if(U.length===1){var _=U[0];if(_.nodeType===Node.TEXT_NODE)p(B,P,D);else{var V=_.innerHTML;_.innerHTML="";var z=B.clientHeight;if(z>D){P.removeChild(_),E(!0,P.innerHTML);return}_.innerHTML=V,T(B,_,D)}}else{var q=[].slice.call(U);P.innerHTML="";for(var G=0;G<q.length;){var Y=q[G].cloneNode();if(P.appendChild(Y),B.clientHeight>D){P.removeChild(Y),E(!0,P.innerHTML);return}P.removeChild(Y),P.appendChild(q[G]);var ee=B.clientHeight;if(ee>D)break;G++}P.childNodes[G]&&T(B,P.childNodes[G],D)}}V0(function(){C.current&&(N.current=b4(C.current)),g()},[g]),V0(function(){var B=C.current;return B&&m&&!S.current&&c&&(S.current=new T1(g),S.current.observe(B)),function(){if(S.current&&B){var P;(P=S.current)==null||P.unobserve(B),S.current=null}}},[c]);function R(){v&&typeof v=="function"&&v()}return xe.createElement("div",{ref:C,className:"__react-ellipsis-js"},xe.createElement("span",{ref:x,className:"__react-ellipsis-js-content"}),xe.createElement("span",{ref:I,className:"__react-ellipsis-js-ellipsis",onClick:R},l))}var E4=xe.memo(S4);function w4(e){var t=e.className,r=e.ellipsis,n=r===void 0?!0:r,o=e.text,s=e.dangerouslyUseInnerHTML,i=s===void 0?!1:s,a=e.maxLine,c=a===void 0?1:a,l=e.visibleLine,f=e.maxHeight,y=e.visibleHeight,m=e.ellipsisNode,d=m===void 0?"â¦":m,v=e.endExcludes,b=v===void 0?[]:v,S=e.reflowOnResize,u=S===void 0?!1:S,C=e.onReflow,x=e.onEllipsisClick,I=p4&&l===void 0&&f===void 0&&y===void 0&&d==="â¦"&&b.length===0&&!C&&!x;return xe.createElement("div",{className:pm("__react-ellipsis",t)},I?xe.createElement(v4,{ellipsis:n,dangerouslyUseInnerHTML:i,text:o,maxLine:c}):xe.createElement(E4,{text:o,dangerouslyUseInnerHTML:i,maxLine:c,visibleLine:l,maxHeight:f,visibleHeight:y,ellipsis:n,ellipsisNode:d,endExcludes:b,reflowOnResize:u,onReflow:C,onEllipsisClick:x}))}var I4=xe.memo(w4);function $c(e){const{className:t,text:r,maxLine:n=1}=e,[o,s]=h.useState(!1),[i,a]=h.useState(!1),c=h.useCallback(f=>{a(y=>y===f?y:f)},[]);function l(){s(!0),a(!1)}return L.jsxs("div",{className:le("flex items-center gap-1",t),children:[L.jsx(I4,{text:r,maxLine:n,ellipsis:!o,onReflow:c}),L.jsx("button",{"aria-label":r,className:le("hover:bg-[#1A1A1A0D] text-ant-text-tertiary hover:text-black","inline-flex items-center justify-center shrink-0","rounded-[4px] border-0 bg-transparent p-1 cursor-pointer",{"invisible pointer-events-none":!i}),disabled:!i,onClick:l,type:"button",children:L.jsx(ba,{"aria-hidden":!0})})]})}function mm(e){const{productName:t,i18nRecord:r}=e,n=on(s=>s.currentLocale);return h.useMemo(()=>t?r?.[n]||t:"",[t,r,n])}function Ia(e){const{interval:t,intervalCountForCustom:r}=e??{};if(!t)return"";const{t:n}=Qg;return t==="custom"&&typeof r=="number"&&r>0?n("payment.cycleCustomDay",{custom:r}):{day:n("payment.cycleDay"),week:n("payment.cycleWeek"),month:n("payment.cycleMonth"),quarter:n("payment.cycleQuarter"),half_year:n("payment.cycleHalfYear"),year:n("payment.cycleYear")}[t]??t}const T4=h.memo(e=>{const{product:t,className:r,hidden:n=!1,hiddenImage:o=!1}
246=e,s=zt(t.unitAmount,t.currency);return L.jsxs("div",{className:le(n?"hidden":"flex","mb-[16px]",r),children:[o?L.jsx("div",{className:"h-[32px]"}):L.jsxs("div",{className:"mr-[16px]",children:[!t.imageUrl&&L.jsx("div",{className:le("size-[42px]")}),t.imageUrl&&L.jsx(Oo,{src:t.imageUrl,width:42,height:42,className:le("size-[24px] rounded-[4px]")})]}),L.jsx("div",{className:le("flex flex-col w-full"),children:L.jsxs("div",{className:le("flex justify-between gap-2","font-medium text-ant leading-[18px]"),children:[L.jsx("div",{children:L.jsx($c,{text:t.name})}),L.jsxs("span",{className:"font-semibold shrink-0",children:[t.currency," ",s," x ",t.quantity]})]})})]})}),F0=3;function A4(e){const{className:t,priceDataList:r}=e,n=h.useMemo(()=>r.map(c=>({...c,localId:L3()})),[r]),o=n.filter(c=>!!c.imageUrl).length===0,[s,i]=h.useState(!1),{t:a}=rt();return L.jsxs("div",{className:le(t,"flex flex-col"),children:[n.map((c,l)=>L.jsx(T4,{product:c,hidden:!s&&l>=F0,hiddenImage:o},c.localId)),n.length>F0&&L.jsxs("div",{className:le("text-ant-text-tertiary text-ant leading-[20px]","mb-[16px] cursor-pointer","flex items-center gap-2"),onClick:()=>i(!s),children:[!s&&a("payment.viewAllItems",{count:n.length}),s&&a("payment.viewLessItems"),L.jsx(ba,{className:le({"rotate-0":!s,"rotate-180":s},"transition-transform duration-300")})]})]})}const N4="YYYY.MM.DD";function Ss(e){const t=aa(e,"YYYY-MM-DD HH:mm:ss");return t.isValid()?t.format(N4):e}function gm(e){return Bn.find(r=>r.value===e)?.symbol??`${e} `}function R4(e){const{phase:t,fallbackCurrency:r}=e,{t:n}=rt(),o=t.currency||r,s=gm(o),i=`${s}${zt(t.amount,o)}`,a=t.discounted&&t.discountedAmount!=null,c=a?`${s}${zt(t.discountedAmount,o)}`:"",l=t.interval==="custom",f=Ia({interval:t.interval,intervalCountForCustom:l?t.intervalCount:void 0}),y=!l&&t.intervalCount>1?n("payment.chargeEveryCycle",{count:t.intervalCount,cycle:f}):n("payment.chargeByCycle",{cycle:f}),d=t.openEnded||!t.endDate?n("payment.startingFrom",{date:Ss(t.startDate)}):`${Ss(t.startDate)} â ${Ss(t.endDate)}`,v=t.multipleCycles;return L.jsxs("div",{className:le("flex justify-between items-center gap-4","text-ant leading-[20px]"),children:[L.jsx("span",{className:"text-ant-text-tertiary text-[13px]",children:d}),L.jsxs("span",{className:le("shrink-0 flex flex-col items-end text-right"),children:[a&&L.jsx("span",{className:"text-ant-text-tertiary line-through",children:i}),L.jsxs("span",{children:[L.jsx("span",{className:"font-semibold text-ant-text",children:a?c:i}),v&&L.jsx("span",{className:"text-ant-text-tertiary ms-1",children:y})]})]})]})}function P4(e){const{coupon:t,currency:r}=e,{t:n}=rt();if(!t?.showTotalSavings)return null;const s=t?.totalSavings??0,a=`${gm(r)}${zt(s,r)}`;return L.jsx(ql,{title:n("payment.totalSavings",{amount:a}),type:"success",showIcon:!0,style:{"--ant-alert-default-padding":"4px 8px","--ant-color-text-heading":"var(--ant-color-text-tertiary)"}})}function B4(e){const{billingSchedule:t,isFreeTrial:r}=e,n=t?.couponSummary?.labelType;return n?r?["ONCE","REPEATING"].includes(n):n==="REPEATING":!1}function U0(e){const{schedule:t,className:r}=e;if(!t)return null;const n=t?.phases;return!Array.isArray(n)||n.length===0?null:L.jsxs("div",{className:le("flex flex-col gap-2"),children:[L.jsx("div",{className:le("flex flex-col gap-3","rounded-ant-lg bg-ant-fill-tertiary","px-3 py-3","max-h-[200px] overflow-auto","[scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.15)_transparent]","[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar]:h-1.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-black/15","hover:[&::-webkit-scrollbar-thumb]:bg-black/25",r),children:n.map((o,s)=>L.jsx(R4,{phase:o,fallbackCurrency:t?.currency??""},`${o.startDate}-${s}`))}),L.jsx(P4,{currency:t.currency,coupon:t.couponSummary})]})}function L4(e){const{className:t,isFreeTrial:r=!1}=e,n=nn(i=>i.pricingSchedule),o=nn(i=>i.billingSchedule);return n?L.jsx(U0,{schedule:n,className:t}):B4({billingSchedule:o,isFreeTrial:r})?L.jsx(U0,{schedule:o,className:t}):null}const wn=Pc();function M4(e){const{notValidClassName:t,currentCheckedCurrency:r}=e,{t:n}
246=rt(),{currentPromoCode:o,promoName:s,setPromoName:i,setCurrentPromoCode:a,promoCodeStatus:c,promoCodeHelp:l,setPromoCodeStatusAndHelp:f,isValidPromoCode:y,setIsValidPromoCode:m,lastValidPromoCode:d,setLastValidPromoCode:v,readonly:b,couponTerms:S,showPromoName:u}=Jt();function C(V){const z=V.target.value.replace(/[^a-zA-Z0-9]/g,"");c==="error"&&f(void 0,""),a(z)}const[x,I]=h.useState(!1);function N(V){I(V),B(V),yr.emit("loading",{loading:V,from:"promoCode"})}Bc(V=>{I(V.loading),B(V.loading)});const E=h.useRef(null),g=wt(V=>V.sessionCurrencyList),{doPostSession:p}=ai();async function T(V){if(V){f(void 0,void 0);try{N(!0);const z=await p({overrideRequestBody:{promotionCode:V},from:"promoCode"});qr.emit("trigger",{type:"promoCode",session:z}),f(void 0,""),m(!0),v(V),Zg()}catch(z){z instanceof Error&&f("error",z.message),m(!1),setTimeout(()=>{E.current?.focus?.()})}finally{N(!1)}}}const[R,B]=h.useState(!1);async function P(){try{N(!0);const V=await p({overrideRequestBody:{promotionCode:null},from:"promoCode"});qr.emit("trigger",{type:"promoCode",session:V}),m(!1),a(void 0),i(null),Jg()}catch{}finally{N(!1)}}async function D(){a(d),T(d)}const U=h.useMemo(()=>{const V=g.find(Y=>Y.currency===r);if(!V)return"";const{discountAmount:z,currency:q}=V;return Bn.find(Y=>Y.value===q)?.symbol+zt(z,q)},[r,g]),_=h.useMemo(()=>{if(!S)return null;const{originalTerms:V,labelType:z,durationCycles:q}=S;switch(z){case"ONCE":return n("payment.promoTerms.once",{terms:V});case"REPEATING":return n("payment.promoTerms.repeating",{terms:V,count:q??0});case"FOREVER":return n("payment.promoTerms.forever",{terms:V});default:return n("payment.discountAmount",{amount:V})}},[S,n]);return h.useEffect(()=>(wn.on("clearValidate",()=>{y||(f(void 0,void 0),a(void 0),m(!1),i(null))}),()=>{wn.off("clearValidate")}),[a,f,m,i,y]),h.useEffect(()=>(wn.on("focus",()=>{E.current?.focus()}),()=>{wn.off("focus")}),[]),y?L.jsxs(Yt.div,{className:le("flex flex-col"),initial:{opacity:0}
246,animate:{opacity:1},transition:{duration:.5},children:[L.jsxs("div",{className:le("flex justify-between items-center","gap-2"),children:[L.jsxs("div",{className:le("flex items-center gap-2","bg-ant-fill-secondary rounded-ant-lg","px-3 py-2","text-ant"),children:[L.jsx(j3,{style:{transform:"rotateY(180deg)"}}),L.jsx("span",{className:le("font-medium text-ant-text","break-all"),children:u?s:o}),!u&&L.jsx("div",{children:R?L.jsx(Lo,{className:"ms-2 text-primary"}):L.jsx(Bl,{className:le("cursor-pointer ms-2","hover:scale-[105%] hover:text-black",{hidden:b}),onClick:P})})]}),L.jsxs("span",{className:le("text-ant-text text-ant font-medium","shrink-0"),children:["-",U]})]}),L.jsx("div",{className:le("text-ant-text-tertiary text-ant-sm","mt-[4px]"),children:_})]}):L.jsx("div",{className:le("flex justify-between gap-2",t),children:L.jsxs(Yt.div,{className:le("flex flex-col","flex-1"),initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[L.jsx(Dt,{className:le("h-[34px] w-full",{"text-red-500":c==="error"}),style:{"--ant-border-radius":"var(--ant-border-radius-lg)"},variant:"filled",ref:E,value:o,onChange:C,onKeyDown:V=>{V.key==="Enter"&&T(o)},placeholder:n("payment.addPromotionCode"),disabled:x,status:c,suffix:o&&c!=="error"?L.jsx(Or,{style:{"--ant-button-padding-inline-sm":"0","--ant-color-link":"var(--ant-color-primary)","--ant-color-link-hover":"var(--ant-color-primary)"},size:"small",type:"link",loading:x,onClick:()=>T(o),children:n("payment.promotionCodeApply")}):L.jsx("span",{})}),d&&L.jsxs("div",{className:le("text-ant-text-tertiary text-ant-sm","mt-1"),children:[n("payment.usePromotionCode"),L.jsx("span",{className:le("font-semibold underline decoration-dotted","ml-1 cursor-pointer break-all",{"pointer-events-none":x}),onClick:D,children:d})]}),l&&L.jsx("div",{className:le("text-red-500 text-[13px]","mt-1"),style:{animation:"animation-shake .5s"},children:l})]})})}function vm(e){const{receiptCardInfo:t,session:r,className:n,currentCheckedCurrency:o}=e,s=le("flex justify-between items-center","text-ant leading-[18px] text-ant-text font-medium"),{t:i}=rt(),a=r.remoteProductVo||r.priceDataList?.filter?.(b=>!!b.imageUrl)?.length!==0,c=Jt(b=>b.enable),l=wt(b=>b.sessionCurrencyList),f=h.useMemo(()=>{const b=Bn.find(C=>C.value===o),S={currency:t.dueTodayCurrency,amount:t.dueTodayAmount,symbol:b?.symbol,minUnit:b?.minUnit};if(t.isSubscription&&t.isSubscriptionFreeTrail)return S.amount=0,S;const u=l.find(C=>C.currency===o);return u&&(S.amount=u.total),S},[o,t,l]);h.useEffect(()=>{function b(){if(!Bn.find(C=>C.value===o))return;const u=l.find(C=>C.currency===o);u&&(t.taxType=u.taxName,t.taxRate=u.salesRate,t.taxTotal=[null,void 0].includes(u.salesTax)?void 0:`${u.symbol}${zt(u.salesTax,u.currency)}`)}b()},[o,t,l]);const[y,m]=h.useState(!1);h.useEffect(()=>(yr.on("loading",b=>{m(b.loading)}),()=>{yr.off("loading")}),[]);const d=lr(b=>b.requiresTaxCalculation),v=mm({productName:r.remoteProductVo?.name,i18nRecord:r.remoteProductVo?.localizedNames});return L.jsxs("div",{className:n,children:[r.remoteProductVo&&L.jsxs("div",{className:le("flex",{"mb-4":!r.pricingSchedule}),children:[L.jsx("div",{className:"me-[16px]",children:L.jsx(Oo,{src:r.remoteProductVo.image,width:42,he
246ight:42,className:le("rounded-[4px]")})}),L.jsx("div",{className:le("flex flex-col w-full"),children:L.jsxs("div",{className:le("flex justify-between gap-4","font-medium text-ant leading-[18px]"),children:[L.jsxs("div",{children:[L.jsx("div",{className:"break-all",children:L.jsx($c,{text:v})}),t.isSubscription&&!e.session.pricingSchedule&&L.jsx("div",{className:"text-ant-text-tertiary text-ant-sm leading-[20px]",children:i("payment.chargeByCycle",{cycle:Ia({interval:t.subscriptionPeriod,intervalCountForCustom:t.subscriptionIntervalCountForCustom})})})]}),L.jsxs("div",{className:le("flex flex-col","shrink-0"),children:[t.isSubscription&&t.isSubscriptionFreeTrail?L.jsxs("div",{className:le("flex justify-end items-center gap-1","shrink-0"),children:[L.jsx("span",{children:i("payment.daysTrial",{value:t.subscriptionFreeTrailDays})}),L.jsx("span",{className:"text-sm font-semibold",children:i("payment.free")})]}):L.jsx("span",{className:le("flex justify-end","font-semibold shrink-0 "),children:t.subtotal}),t.divideBy&&L.jsx("div",{className:le("text-ant-text-tertiary text-ant-sm leading-[20px] text-right"),children:i("payment.quantityPerUnit",{count:Cc(String(t.divideBy))})})]})]})})]}),r.priceType===rn&&r.priceDataList&&L.jsx(A4,{priceDataList:r.priceDataList}),L.jsxs("div",{className:le("flex flex-col py-4 gap-4","border-t border-ant-border-secondary",{"ms-[58px]":a}),children:[L.jsx(L4,{isFreeTrial:!!t.isSubscriptionFreeTrail}),L.jsxs("div",{className:s,children:[L.jsx("span",{children:i("payment.subtotal")}),L.jsx("span",{className:"font-semibold",children:t.subtotal})]}),c&&L.jsx(M4,{notValidClassName:le(s,"items-baseline"),currentCheckedCurrency:o}),t.promotionCodeEnable&&L.jsxs("div",{className:s,children:[L.jsx("span",{children:i("payment.promotionCodeOff",{value:t.promotionCodeOff})}),L.jsx("span",{children:t.promotionCodeTotal})]}),d&&L.jsxs("div",{className:s,children:[L.jsx("span",{children:t.taxType?`${t.taxType}
246(${t.taxRate}%)`:i("payment.salesTax")}),L.jsx("span",{className:"text-ant-text-secondary font-normal",children:L.jsx(Af,{condition:!y,match:[null,void 0].includes(t.taxTotal)?i("payment.tax.inputAddressTo"):t.taxTotal,fallback:L.jsx(e2.Button,{style:{"--ant-control-height":"18px"},active:y})})})]})]}),L.jsx("div",{className:le("flex flex-col py-[16px] gap-[16px]",{"ms-[58px]":a},"border-t border-ant-border-secondary"),children:L.jsxs("div",{className:s,children:[L.jsx("span",{children:i("payment.dueToday")}),L.jsx("span",{className:"text-ant-lg leading-[20px] font-semibold",children:L.jsx(d4,{end:f.amount,duration:.5,separator:",",decimal:".",decimals:f.minUnit,prefix:f.symbol})})]})})]})}const D4={className:"clink-btn-primary"};function $4({children:e}){const t=Hr(a=>a.isDefaultConfig),r=Hr(a=>a.primaryColor),n=Hr(a=>a.useCustomButtonStyle),o=Hr(a=>a.buttonBackground),s=Hr(a=>a.buttonTextColor),i={token:{colorPrimary:n&&o?o:r},components:{Button:{primaryColor:n&&s?s:"#fff"}}};return t&&!n?L.jsx(Kc,{button:D4,children:e}):L.jsx(Kc,{theme:i,children:e})}function O4(){const e=wt(n=>n.currentCheckedCurrency),t=wt(n=>n.sessionCurrencyList);return{currentSubTotalAmount:h.useMemo(()=>{const n=t.find(o=>o.currency===e);return n?{total:n.total,currency:n.currency}:null},[e,t])}}function _4(e,t){const[r,n]=h.useState(!1);return h.useEffect(()=>{r&&e&&(n(!1),t())},[r,e]),{setPendingAutoSubmit:n}}function k4(e){const[t]=et.useForm(),r=h.useRef(e);return h.useEffect(()=>{r.current!==e&&(t.resetFields(),r.current=e)},[e,t]),t}function V4(e){const{t}=rt(),[r,n]=h.useState(t("payment.payNow"));return h.useEffect(()=>{e&&(e.remotePriceSnapshotVo?.priceType===gr?e.freeTrialDays>0?n(t("payment.startFreeTrial")):n(t("payment.subscribe")):n(t("payment.payNow")))},[e,t]),{buttonText:r}}function Ka(e,...t){}function F4(e){const{paymentLoading:t}=jl(),{onNormal:r,onPending:n,onSuccess:o,onAfterGetSession:s,onInvalid:i}=e??{},a=h.useRef([]);h.useEffect(()=>(a.current=[],()=>{a.current.forEach(l=>l())}),[]);async function c(l,f){try{f||t(!0),a.current.forEach(b=>b());const y=ko(l);a.current.push(y.abort);const m=await y;mr(s)&&s(m);const{status:d,payStatus:v}=m;switch(d){case Mr.NORMAL:{v===Kr.NORMAL&&(Ka("å½åsessionç¶æ: 坿£å¸¸æ¯ä»"),mr(r)&&r(m)),v===Kr.CHANEL_PENDING&&(Ka("å½åsessionç¶æ: pending"),mr(n)&&n(m));break}case Mr.PAID:{Ka("å½åsessionç¶æ: æ¯ä»æå"),mr(o)&&o(m);break}case Mr.INVALID:{Ka("å½åsessionç¶æ: session失æ"),mr(i)&&i(m);break}}}catch(y){if(y instanceof Kl)throw y;y instanceof Bf&&mr(i)&&i()}finally{f||t(!1)}}return{getStatusAndDoNextAction:c}}function U4(e){const{sessionCurrencyList:t,updateSessionCurrencyList:r}=wt(),n=wt(S=>S.currentCheckedCurrency),o=wt(S=>S.setCurrentCheckedCurrency),s=lr(S=>S.setRequiresTaxCalculation),i=h.useRef(""),[a,c]=h.useState(!1);function l(S){c(S),yr.emit("loading",{loading:S,from:"currency"})}Bc(S=>{c(S.loading)});const f=Tn(S=>S.sessionId),{doPostSession:y}=ai();async function m(S,u){if(i.current===S.currency)return;u?.withoutApi||t2({from_currency:i.current,to_currency:S.currency}),l(!0);let C=null;try{const{withoutApi:x}=u??{};if(f&&!x){if(C=await y({overrideRequestBody:{currency:S.currency},from:"currency"}),!C)throw new Error("cold not get session info");if(r(C.sessionCurrencyPriceVoList),s(C.requiresTaxCalculation),C.sessionCurrencyPriceVoList?.length>0&&!C.sessionCurrencyPriceVoList.find(g=>g.currency===S.currency)){const g=C.sessionCurrencyPriceVoList.find(p=>p.currency===S.originalCurrency);g&&(S=g)}}o(S.currency);const I=`${S.symbol}${zt(S.priceAmount,S.currency)}`;e.subtotal=I;const N=`${S.symbol}${zt(S.total,S.currency)}`;e.dueToday=N,e.dueTodayAmount=S.total,e.dueTodayCurrency=S.currency,e.taxType=S.taxName,e.taxRate=S.salesRate,e.taxTotal=[null,void 0].includes(S.salesTax)?void 0:`${S.symbol}${zt(S.salesTax,S.currency)}`,i.current=S.currency,C&&qr.emit("trigger",{type:"currency",session:C})}catch{i.current&&o(i.current)}finally{l(!1),wn.emit("clearValidate")}}function d(S){const{options:u,setupCurrency:C}=S,x=!0;if(r(u),wt.getState().setInitialSessionCurrencyList(u),u.length===1){m(u[0],{withoutApi:x}),i.current=u[0].currency;return}const I=u.find(N=>N.currency===C);I?(m(I,{withoutApi:x}),i.current=I.currency,o(I.currency)):(m(u[0],{withoutApi:x}),i.current=u[0].currency,o(u[0].currency))}const[v,b]=h.useState(!1);return{sessionCurrencyList:t,handleCurrencyChecked:m,currentCheckedCurrency:n,setupDefaultCheckedCurrencyAndOptions:d,currencySelectDisabled:v,setCurrencySelectDisabled:b,currencyLoading:a}}function j4(e){return $n.Post("/subscription",e,{meta:{errorMessageMode:"none"}})}const j0={PC:"WEB",MOBILE:"WAP"};function H4(){return Rf.getSelectorsByUserAgent(navigator.userAgent).isMobile?j0.MOBILE:j0.PC}
246const Es={ANDROID:"ANDROID",IOS:"IOS"};function z4(e=Es.ANDROID){const t=Rf.getSelectorsByUserAgent(navigator.userAgent);return t.isAndroid?Es.ANDROID:t.isIOS?Es.IOS:e}const K4=0;async function G4(){if(!(typeof window>"u")&&window.TDBehavior&&typeof window.TDBehavior.collect=="function")try{const e=await window.TDBehavior.collect();return e?.code!==K4?void 0:e.payload}catch{return}}async function q4(){try{const e=lw(),t=await G4();return{fingerPrint:e,behavior:t}}catch{return{}}}function ym(e){const{cardData:t,publicKeyInfo:r,dayjsFormat:n="MM/YY"}=e,{publicKey:o}=r;let s=aa(t.expireDate,n);s.year()<2e3&&(s=s.add(100,"year"));const i={cardNumber:t.cardNumber.replace(/\s/g,""),expiryMonth:s.format("MM"),expiryYear:s.format("YYYY"),cardholderName:t.cardHolder,timestamp:new Date().getTime().toString(),nonce:Ef(16)};return Tc(o,JSON.stringify(i))}async function W4(e){const{cardData:t,customerId:r,publicKeyInfo:n}=e,{keyName:o,keyVersion:s}=n,a={paymentInstrumentType:"CARD",encryptedData:ym({cardData:t,publicKeyInfo:n}),cpfNumber:t.cpfNumber,billingAddressJson:{city:t.city,country:t.country,line1:t.line1,line2:t.line2,postalCode:t.postalCode,region:t.region},keyName:o,keyVersion:s,customerId:r},{paymentInstrumentId:c}=await D3(a);return c}async function Y4(e){const{paymentInstrumentId:t,session:r,publicKeyInfo:n,paymentCurrency:o,cvv:s,currentPaymentMethodType:i,isRememberPi:a,thirdPartSdkToken:c,blikCode:l,rawPaymentInstrumentOption:f,cardNetwork:y}=e;let m=i;f&&f.subPaymentMethodType&&i==="CARD"&&(m=f.subPaymentMethodType);const d={paymentMethodType:m,paymentInstrumentId:t,paymentCurrency:o,isRememberPi:a};if(x2().includes(i)&&(d.isRememberPi=!1),s){const S=Tc(n.publicKey,s);d.cvvSecretValue=S,d.cvvVersion=n.keyVersion}const v=H4();if(d.platformType=v,v==="WAP"){const S=z4();d.deviceType=S}c&&["GOOGLEPAY","APPLEPAY","LINK"].includes(i)&&(d.additionalPaymentInstrument={token:c,cardNetwork:y}),r.priceType===rn&&i==="BLIK"&&(d.additionalPaymentInstrument={blikCode:l});const b=await q4();switch(d.additionalPaymentInstrument={...d.additionalPaymentInstrument??{},tdBlackBox:b.fingerPrint,tdBehaviorToken:b.behavior},r.priceType){case gr:{const S={...d,subscriptionId:r.subscriptionInfo?.subscriptionId,invoicingId:r.currentOrder?.invoicingId};return await j4(S)}case rn:return await S2({...d})}}function Oc(e){const{status:t,payStatus:r}=e;if(t===Mr.NORMAL){if([Kr.NORMAL,Kr.LOCKED].includes(r))return"payment";if(r===Kr.CHANEL_PENDING)return"chanel_pending"}if(t===Mr.PAID)return"success"}function X4(){const e=Jt(l=>l.setEnable),t=Jt(l=>l.setShowPromoName),r=Jt(l=>l.setPromoName),n=Jt(l=>l.setCurrentPromoCode),o=Jt(l=>l.setReadonly),s=Jt(l=>l.setCouponTerms),i=Jt(l=>l.setIsValidPromoCode),a=Jt(l=>l.setLastValidPromoCode);function c(l){const{promotionCode:f,allowPromotionCodes:y,showPromotionCode:m,sessionCurrencyPriceVoList:d,currentOrder:v}=l;if(e(y),!y)return;t(m===!1);const b=Oc(l);if(f&&d&&d.length>0){let u=l.currency??l.originalCurrency;b!=="payment"&&v&&(u=v.paymentCurrency);const C=d.find(I=>I.currency===u),x=C?.couponTerms;if(x){s(Q4(x,l)),i(!0);const I=C?.couponName??f;r(I),n(f)}else a(f),b!=="payment"&&e(!1)}o(b!=="payment"),!f&&b!=="payment"&&e(!1)}return{setupPromoCode:c}}function Q4(e,t){const r=t.pricingSchedule?.couponSummary;return r?{originalTerms:e,labelType:r.labelType,durationCycles:r.durationCycles}:{originalTerms:e,labelType:null,durationCycles:null}}function Z4(e){const{action:t,currentPageState:r}=e??{},{currentPaymentUtilInfo:n}=Wr(),[o,s]=h.useState(!1);return h.useEffect(()=>{let i=0;const a=1e3,c=Tn.getState().sessionId;async function l(d){if(n.paymentType?.includes("UPI"))try{for(let v=0;v<3;v++)await t(d),await new Promise(b=>setTimeout(b,500))}catch{}}async function f(){if(r!=="payment")return;const d=Date.now();if(!(d-i<a)&&(i=d,!!c))try{s(!0),n.paymentType?.includes("UPI")&&n.extraProperties?.gateway==="bharat"?await l(c):await t(c),s(!1)}catch(v){if(v instanceof Kl)return;s(!1)}}function y(){document.visibilityState==="visible"&&f()}function m(d){d.persisted&&f()}return document.addEventListener("visibilitychange",y),window.addEventListener("pageshow",m),()=>{document.removeEventListener("visibilitychange",y),window.removeEventListener("pageshow",m)}},[t,r,n]),{sessionStatusLoading:o}}const J4="::";function e5(e,t){const r=t??[];let n=e;if(e.includes("_"))n=r.find(a=>(a.paymentInstrumentList??[]).some(c=>c.paymentInstrumentId===e))?.paymentMethod??e;else if(e.includes(":")){const[a]=e.split(":");n=a}const o=E2(r,n),s=o?.extraProperties,i=s?.gateway;return{paymentMethod:n,extraProperties:s,defaultChecked:s?.rememberPaymentMethodDefaultChecked??!0,key:i?`${n}${J4}${i}`:n,resolved:!!o}}const t5=!0;function r5(e){const t=Br(y=>y.currentPaymentType),r=Br(y=>y.paymentOptionVoList),n=h.useMemo(()=>e5(t,r),[t,r]),o=h.useMemo(()=>e?.priceType!==rn,[e?.priceType]),[s,i]=h.useState({}),a=h.useMemo(()=>o?t5:s[n.key]??n.defaultChecked,[o,s,n]),c=Gl(a);function l(){return c.current}function f(y){n.key&&i(m=>({...m,[n.key]:y}))}return{rememberPi:a,rememberPiDisabled:o,getRememberPi:l,handleRememberPiChange:f}}function n5(e){h.useEffect(()=>(qr.on("trigger",e),()=>{qr.off("trigger",e)}),[e])}function a5(){const[e,t]=h.useState({isFreeTrial:!1,interval:"",unit:""});function r(n){if(n.remotePriceSnapshotVo?.priceType!==gr)return;const o=n.freeTrialDays>0,s=n.remotePriceSnapshotVo.recurringDetailsObject;let i;s.interval==="custom"&&s.interval_count&&(i=Number(s.interval_count));const a={isFreeTrial:o,interval:s.interval,unit:s.transform_quantity?.divideBy??"",intervalCountForCustom:i};
246t(a)}return{subscriptionInfo:e,setupSubscriptionInfo:r}}function o5(){const e=Fo({subtotal:"",dueToday:"",dueTodayAmount:0,dueTodayCurrency:""});function t(r){if(r.priceType===gr){e.isSubscription=!0;const{sessionCurrencyPriceVoList:n}=r;if(n.length>0){const s=n[0],i=`${s.symbol}${zt(s.priceAmount,s.currency)}`;e.subtotal=i,e.subscriptionPeriodAmount=i,e.dueToday=i}if(!r.remotePriceSnapshotVo)return;const o=r.remotePriceSnapshotVo.recurringDetailsObject;if(e.subscriptionPeriod=o.interval,Number(o.trial_period_days)>0&&(e.isSubscriptionFreeTrail=!0,e.subscriptionFreeTrailDays=r.freeTrialDays.toString(),n.length>0)){const s=n[0];e.dueToday=`${s.symbol}0`}o.transform_quantity?.divideBy&&(e.divideBy=Number(o.transform_quantity.divideBy)),o.interval==="custom"&&o.interval_count&&(e.subscriptionIntervalCountForCustom=Number(o.interval_count))}r.priceType,rn}return{receiptCardInfo:e,setupReceiptCardInfo:t}}function i5(e){const t=h.useRef(null),r=h.useRef(null),{callback:n}=e??{};return h.useEffect(()=>{async function o(s){const i=s.data;if(i.from==="_clink"&&i.type==="3ds_finished"){t.current?.close(),r.current?.close();const{message:a}=i.data;mr(n)&&n(a)}}return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}},[n]),{threeDsModalRef:t,threeDsPostModalRef:r}}function s5(){const e=Fo({show:!1,message:"",type:"common"});function t(){e.show=!1,e.message="",e.type="common"}function r(n,o){e.show=!0,e.message=n,e.type=o}return{exceptionInfo:e,resetErrorMessage:t,showErrorMessage:r}}function H0(e){if(e.suggestPaymentMethod){const{paymentInstrumentId:r,paymentMethod:n}=e.suggestPaymentMethod,{paymentOptionVoList:o}=e,s=o.map(a=>a.paymentMethod),i=o.map(a=>{const c=a.paymentInstrumentList??[];return a.paymentMethod!=="CARD"&&c.length>0?[c[0]]:c}).flat().map(a=>a.paymentInstrumentId);if(n&&r)return i.includes(r)?r:i.length>0?i[0]:null;if(n&&!r){if(n==="UPI"){if(Nf()==="link"){const c=o.find(f=>f.paymentMethod==="UPI");return!c||(c?.paymentInstrumentList??[])?.length===0||Br.getState().currentPaymentType.includes("UPI:")?null:`UPI:${c.paymentInstrumentList[0].subPaymentMethodType}`}return"UPI:QRCODE"}return s.includes(n)?n:i.length>0?i[0]:null}return null}let t=e.paymentOptionVoList.length>0?e.paymentOptionVoList[0].paymentInstrumentList?.[0]?.paymentInstrumentId:"CARD";return t||(t="CARD"),t}function l5(e){if(e.countryCode&&Ew.map(r=>r.value).find(r=>r===e.countryCode))return e.countryCode}function c5(e){const{maxRetryCount:t=3,retryInterval:r=3e3}={},n=Gc(c=>c.setLoadingAndText),o=Gc(c=>c.setLoading),{dispatch:s}=Ph({isRetrying:!0}),{t:i}=rt();async function a(c){try{n(!0,i("payment.orderInProgress"));for(let l=0;l<t;l++){await new Promise(v=>setTimeout(v,r));const{sessionId:f,tokenValue:y}=c,m=await ko(`${f}#${y}`).then(v=>v).catch(()=>null);if(!m)continue;const d=await s(m);if(d!=="retrying"&&d===!0)break}}catch{}finally{o(!1)}}return{startRetry:a}}function u5(e,t){return $n.Post(`/order/session/pay/apple-pay/validate/${e}`,t,{meta:{errorMessageMode:"none"}})}function bm(e,t,r){if(!Array.isArray(e)||e.length===0)return[...r];const n=new Map(t.map(s=>[s.toLowerCase(),s])),o=new Set;for(const s of e){if(typeof s!="string")continue;const i=n.get(s.trim().toLowerCase());i&&o.add(i)}return o.size===0?[...r]:[...o]}const d5=14,Cm=4;function z0(){if(!window.ApplePaySession)return null;for(let e=d5;e>=Cm;e--)if(window.ApplePaySession.supportsVersion(e))return e;return null}let K0=!1,Ga=null;function f5(){return K0?Promise.resolve():Ga||(Ga=new Promise((e,t)=>{const r=document.createElement("script");r.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",r.crossOrigin="anonymous",r.addEventListener("load",()=>{K0=!0,e()},{once:!0}),r.addEventListener("error",()=>t(new Error("Apple Pay SDK load failed from cdn")),{once:!0}),document.head.appendChild(r)}),Ga)}const xm=["visa","masterCard","amex","discover","chinaUnionPay","jcb","maestro","electron","elo","mada","girocard","interac","bancontact","cartesBancaires","dankort","eftpos","mir","vPay"],p5=xm;function h5(e){return bm(e.supportedNetworks,xm,p5)}function m5(e){const{disabled:t,onSuccess:r,onError:n,isSubscriptionFreeTrail:o,beforeSDKEvent:s,extraProperties:i}=e,a=wt(I=>I.currentCheckedCurrency),c=wt(I=>I.sessionCurrencyList),[l,f]=h.useState(!1),[y,m]=h.useState(!1),d=h.useRef(s);d.current=s;const v=h.useRef(r);v.current=r;const b=h.useRef(n);b.current=n;const S=h.useCallback(()=>{const I=c.find(E=>E.currency===a);if(!I){const E=new Error("could not found currency price");throw n?.(E),E}const N=o||I.total===0;return{currency:a,value:N?0:I.total}},[c,o,a,n]);h.useEffect(()=>{f5().then(()=>{const I=z0();window.ApplePaySession&&window.ApplePaySession.canMakePayments()&&I!==null?(f(!0),si({success:!0,gateway:i.gateway,supported_version:I})):(m(!0),si({success:!1,gateway:i.gateway,supported_version:I,error_message:I===null?`SupportVersion below min version: ${Cm}`:"Device does not support Apple Pay"}))}).catch(I=>{m(!0),si({success:!1,gateway:i.gateway,error_message:I instanceof Error?I.message:String(I)})})},[i.gateway]);const u=h.useCallback(async()=>{try{d.current&&await d.current()}catch{return}try{const I=S(),N={countryCode:"US",currencyCode:I.currency,merchantCapabilities:["supports3DS"],supportedNetworks:h5(i),total:{label:i.merchantName??"Clink",amount:String(I.value)}};if(!window.ApplePaySession)throw new Error("ApplePaySession is not available");const E=z0();if(E===null)throw r2({gateway:i.gateway}),new Error("Device does not support Apple Pay.");const g=new window.ApplePaySession(E,N);g.onvalidatemerchant=async p=>{try{const T=Tn.getState().sessionId;if(!T)throw new Error("sessionId is not found");const R=await u5(T,{validationUrl:p.validationURL,initiativeContext:wa()?window.location.host:"uat-checkout.clinkbill.com"});g.completeMerchantValidation(R),qc({success:!0,gateway:i.gateway,validation_url:p.val
246idationURL})}catch(T){qc({success:!1,gateway:i.gateway,validation_url:p.validationURL,error_message:T instanceof Error?T.message:String(T)}),g.abort(),T instanceof Error&&b.current?.(T)}},g.onpaymentauthorized=async p=>{try{const T=p.payment.token;await v.current?.({token:JSON.stringify(T),cardFormData:null,gateway:i.gateway}),g.completePayment(window.ApplePaySession.STATUS_SUCCESS),Wc({success:!0,gateway:i.gateway})}catch(T){g.completePayment(window.ApplePaySession.STATUS_FAILURE),Wc({success:!1,gateway:i.gateway,error_message:T instanceof Error?T.message:String(T)}),T instanceof Error&&b.current?.(T)}},g.oncancel=()=>{n2({gateway:i.gateway})},g.begin()}catch(I){I instanceof Error&&b.current?.(I)}},[i,S]),{t:C}=rt(),x=on(I=>I.currentLocale);return L.jsxs("div",{className:le({"opacity-50 cursor-not-allowed pointer-events-none":t}),children:[!l&&!y&&L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:C("thirdpart.apple.loading")})})}),y&&L.jsx("div",{className:"h-[45px] flex justify-center items-center px-2",children:L.jsx("span",{className:"text-red-500",children:C("thirdpart.apple.loadFailed")})}),l&&L.jsx("apple-pay-button",{buttonstyle:"black",type:"buy",locale:x,onclick:u,style:{"--apple-pay-button-height":"45px",width:"100%","--apple-pay-button-border-radius":"6px",display:"block"}},x)]})}const g5="This Element has already been destroyed.";function v5(e){return typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:""}function y5(e){if(e)try{e.destroy()}catch(t){if(v5(t).includes(g5))return;throw t}}function Sm(e){let t=0,r=!1,n=!1;function o(){n||(n=!0,y5(e))}return{beginConfirmation(){if(n)return()=>{};t+=1;let s=!1;return()=>{s||(s=!0,t-=1,t===0&&r&&o())}},destroy(){if(t>0){r=!0;return}o()}}}function Em(e,t,r){if(!e)return null;const n={locale:"auto",currency:e.currency.toLowerCase(),setup_future_usage:"off_session",...r};return t||e.minimumUnitAmount===0?{...n,mode:"setup"}:{...n,mode:"payment",amount:e.minimumUnitAmount}}function b5(e){const{payment_method_preview:t}=e,{card:r,billing_details:n}=t,{address:o}=n,s=r?.exp_month??1,i=s<10?`0${s}`:`${s}`;return{cardNumber:r?.last4??"",expireDate:`${i}/${r?.exp_year??""}`,cvv:"",cardHolder:n.name??"",country:o?.country??"",region:o?.state??"",postalCode:o?.postal_code??"",line1:o?.line1??"",line2:o?.line2??""}}let ws,G0="";const C5=e=>{const t=`${e.stripePublishableKey}:${e.connectAccountId??""}`;return(!ws||G0!==t)&&(G0=t,ws=wf(async()=>{const{loadStripe:r}=await import("./index-Chmwl3g_.js");return{loadStripe:r}},[]).then(({loadStripe:r})=>r(e.stripePublishableKey,{developerTools:{assistant:{enabled:!1}},stripeAccount:e.connectAccountId??void 0}))),ws},q0="apple-pay-checkout-element";function x5(e){const{disabled:t,onSuccess:r,onError:n,isSubscriptionFreeTrail:o,beforeSDKEvent:s,extraProperties:i,isVisible:a}=e,c=wt(P=>P.currentCheckedCurrency),f=wt(P=>P.sessionCurrencyList).find(P=>P.currency===c),y=Em(f,o),m=!!y,[d,v]=h.useState(!0),[b,S]=h.useState(!1),u=h.useRef(!1),C=h.useRef(!1),x=h.useRef({beforeSDKEvent:s,onError:n,onSuccess:r}),I=h.useRef(a),N=h.useRef(i),E=h.useRef(null),g=h.useRef(y);I.current=a,N.current=i,g.current=y,h.useEffect(()=>{x.current={beforeSDKEvent:s,onError:n,onSuccess:r}},[s,n,r]),h.useEffect(()=>{let P=!1,D=null,U=null;function _(z,q){const G=z instanceof Error?z:new Error("Stripe payment failed");q.paymentFailed({reason:"fail",message:G.message}),P||x.current.onError?.(G)}async function V(){const z=N.current;if(!(!z||!g.current)){v(!0),S(!1);try{const q=await C5(z);if(P)return;if(!q)throw new Error("Stripe Apple Pay SDK failed to load");const G=q.elements(g.current);E.current=G,G.on("update-end",()=>{P||(C.current||u.current)&&(C.current=!1,v(!1))}),D=G.create("expressCheckout",{paymentMethods:{applePay:"always",amazonPay:"never",googlePay:"never",link:"never",klarna:"never",paypal:"never"},buttonHeight:45,buttonTheme:{applePay:"black"},buttonType:{applePay:"buy"}}),U=Sm(D),D.on("ready",({availablePaymentMethods:Y})=>{if(!P){if(v(!1),!Y||!Y.applePay){S(!0);return}u.current=!0}}),D.on("loaderror",({error:Y})=>{P||(v(!1),S(!0),I.current&&x.current.onError?.(new Error(Y.message)))}),D.on("click",async Y=>{try{const{beforeSDKEvent:ee}=x.current;if(mr(ee)&&await ee(),P){Y.reject();return}Y.resolve()}catch{Y.reject()}}),D.on("confirm",async Y=>{if(P)return;const ee=U?.beginConfirmation();try{const{error:J}=await G.submit();if(J){_(new Error(J.message),Y);return}const{error:te,confirmationToken:Q}=await q.createConfirmationToken({elements:G});if(te){_(new Error(te.message),Y);return}await x.current.onSuccess?.({token:Q.id,cardFormData:b5(Q)})}catch(J){_(J,Y)}finally{ee?.()}}),D.mount(`#${q0}`)}catch(q){if(P)return;
246const G=q instanceof Error?q:new Error("Stripe Apple Pay load failed");v(!1),S(!0),I.current&&x.current.onError?.(G)}}}return V(),()=>{P=!0,U?.destroy(),U=null,D=null,E.current=null}},[i.connectAccountId,i.stripePublishableKey,m]);const p=y?.mode,T=y?.currency,R=y?.mode==="payment"?y.amount:void 0;h.useEffect(()=>{const P=E.current;!P||!p||!T||(v(!0),S(!1),C.current=!0,P.update({mode:p,currency:T,amount:R,setupFutureUsage:"off_session"}))},[R,T,p]);const{t:B}=rt();return L.jsxs("div",{"aria-busy":d,className:le({"opacity-50 cursor-not-allowed":t,"pointer-events-none":t||d}),children:[d&&!u.current&&L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:B("thirdpart.apple.loading")})})}),b&&!d&&L.jsx("div",{className:le("h-[45px] flex justify-center items-center","px-2"),children:L.jsx("span",{className:"text-red-500",children:B("thirdpart.apple.loadFailed")})}),L.jsx("div",{id:q0})]})}function S5(e){const{applePaySdkMode:t,gateway:r}=e.extraProperties??{};return r?r.toLowerCase()==="stripe"&&t!=="APPLE_OFFICIAL_SDK"?L.jsx(x5,{...e}):L.jsx(m5,{...e}):null}const E5=h.memo(e=>{const{currentPaymentUtilInfo:t}=Wr(),r=va("APPLEPAY");if(!r?.extraProperties)return null;const n=r.extraProperties,o=_o(t,"APPLEPAY");return L.jsx("div",{className:le({hidden:!o}),children:L.jsx(S5,{...e,extraProperties:n,isVisible:o})})});function w5(e){const{ref:t,loading:r=!1,onConfirm:n,onCancel:o}=e,{t:s}=rt(),[i,a]=h.useState(!1),[c,l]=h.useState(""),[f,y]=h.useState(!1),m=h.useRef(!1),d=r||f,v=/^\d{6}$/.test(c);function b(){l("")}function S(){a(!1),b()}h.useImperativeHandle(t,()=>({open(){b(),a(!0)},close:S}));function u(){d||m.current||(S(),o?.())}function C(I){l(I.join("").replace(/\D/g,"").slice(0,6))}async function x(){if(!(!v||d||m.current)){m.current=!0,y(!0);try{await n(c)}finally{m.current=!1,y(!1),S()}}}return L.jsx($o,{title:L.jsx("div",{className:"text-center text-ant-lg",children:s("payment.blik.modalTitle")}),open:i,centered:!0,width:560,destroyOnHidden:!0,maskClosable:!d,keyboard:!d,closable:!d,onCancel:u,footer:null,children:L.jsxs("div",{className:"flex flex-col items-center gap-6 py-3",children:[L.jsx("p",{className:"m-0 text-ant-text-secondary text-center whitespace-pre-line",children:s("payment.blik.modalDescription")}),L.jsx(Dt.OTP,{autoFocus:!0,length:6,inputMode:"numeric",size:"large",disabled:d,value:c,formatter:I=>I.replace(/\D/g,""),onInput:C,className:"w-full justify-center",styles:{input:{width:"clamp(36px, 10vw, 56px)",height:"clamp(46px, 12vw, 54px)",fontSize:24}}}),L.jsx(Or,{type:"primary",className:"w-full max-w-[284px]",size:"large",disabled:!v||d,loading:d,onClick:x,children:s("payment.blik.confirm")})]})})}function no(e,t,r,n){function o(s){return s instanceof r?s:new r(function(i){i(s)})}return new(r||(r=Promise))(function(s,i){function a(f){try{l(n.next(f))}catch(y){i(y)}}function c(f){try{l(n.throw(f))}catch(y){i(y)}}function l(f){f.done?s(f.value):o(f.value).then(a,c)}l((n=n.apply(e,[])).next())})}let Is={};function I5(e){const t=Is[e];if(t)return t;const r=new Promise((n,o)=>{const s=document.createElement("script");s.src=e,s.async=!0;const i=()=>{n()},a=()=>{c(),delete Is[e],s.remove(),o(new Error(`Unable to load script ${e}`))};s.addEventListener("load",i),s.addEventListener("error",a),document.body.appendChild(s);function c(){s.removeEventListener("load",i),s.removeEventListener("error",a)}});return Is[e]=r,r}class T5{constructor(t){this.handleClick=r=>no(this,void 0,void 0,function*(){const n=this.config;if(!n)throw new Error("google-pay-button: Missing configuration");const o=this.createLoadPaymentDataRequest(n);try{if(n.onClick&&n.onClick(r),r.defaultPrevented)return;const s=yield this.client.loadPaymentData(o);n.onLoadPaymentData&&n.onLoadPaymentData(s)}catch(s){s.statusCode==="CANCELED"?n.onCancel&&n.onCancel(s):n.onError&&n.onError(s)}}),this.options=t}getElement(){return this.element}isGooglePayLoaded(){var t,r;return"google"in(window||global)&&!!(!((r=(t=google==null?void 0:google.payments)===null||t===void 0?void 0:t.api)===null||r===void 0)&&r.PaymentsClient)}mount(t){var r;return no(this,void 0,void 0,function*(){if(!this.isGooglePayLoaded())try{yield I5("https://pay.google.com/gp/p/js/pay.js")}catch(n){!((r=this.config)===null||r===void 0)&&r.onError&&this.config.onError(n);return}this.element=t,t&&(this.appendStyles(),this.config&&this.updateElement())})}unmount(){this.element=void 0}configure(t){let r;return this.config=t,(!this.oldInvalidationValues||this.isClientInvalidated(t))&&(r=this.updateElement()),this.oldInvalidationValues=this.getInvalidationValues(t),r??Promise.resolve()}createClientOptions(t){const r={environment:t.environment,merchantInfo:this.createMerchantInfo(t)};return(t.onPaymentDataChanged||t.onPaymentAuthorized)&&(r.paymentDataCallbacks={},t.onPaymentDataChanged&&(r.paymentDataCallbacks.onPaymentDataChanged=n=>t.onPaymentDataChanged(n)||{}),t.onPaymentAuthorized&&(r.paymentDataCallbacks.onPaymentAuthorized=n=>t.onPaymentAuthorized(n)||{})),r}createIsReadyToPayRequest(t){const r=t.paymentRequest;return{apiVersion:r.apiVersion,apiVersionMinor:r.apiVersionMinor,allowedPaymentMethods:r.allowedPaymentMethods,existingPaymentMethodRequired:t.existingPaymentMethodRequired}}createLoadPaymentDataRequest(t){return Object.assign(Object.assign({},t.paymentRequest),{merchantInfo:this.createMerchantInfo(t)})}createMerchantInfo(t){const r=Object.assign({},t.paymentRequest.merchantInfo);return r.softwareInfo||(r.softwareInfo={id:this.options.softwareInfoId,version:this.options.softwareInfoVersion}),r}isMounted(){return this.element!=null&&this.element.isConnected!==!1}removeButton(){if(this.element instanceof ShadowRoot||this.element instanceof Element)for(const t of Array.from(this.element.children))t.tagName!=="STYLE"&&t.remove()}updateElement(){return no(this,void 0,void 0,function*(){if(!this.isMounted())return;const t=this.getElement();if(!this.config)throw new Error("google-pay-button: Missing configuration");this.removeButton();try{this.client=new google.payments.api.PaymentsClient(this.createClientOptions(this.config))}catch(a){this.config.onError&&this.config.onError(a);return}const r={buttonType:this.config.buttonType,buttonColor:this.config.buttonColor,buttonRadius:this.config.buttonRadius,buttonSizeMode:this.config.buttonSizeMode,buttonLocale:this.config.buttonLocale,buttonBorderType:this.config.buttonBorderType,onClick:this.handleClick,allowedPaymentMethods:this.config.paymentRequest.allowedPaymentMethods},n=t.getRootNode();n instanceof ShadowRoot&&(r.buttonRootNode=n);const o=this.client.createButton(r);this.setClassName(t,[t.className,"not-ready"]),t.appendChild(o);let s=!1,i;try{i=yield this.client.isReadyToPay(this.createIsReadyToPayRequest(this.config)),s=i.result&&!this.config.existingPaymentMethodRequired||i.result&&i.paymentMethodPresent&&this.config.existingPaymentMethodRequired||!1}catch(a){this.config.onError&&this.config.onError(a)}
246if(this.isMounted()){if(s){try{this.client.prefetchPaymentData(this.createLoadPaymentDataRequest(this.config))}catch{}this.setClassName(t,(t.className||"").split(" ").filter(a=>a&&a!=="not-ready"))}if((this.isReadyToPay!==i?.result||this.paymentMethodPresent!==i?.paymentMethodPresent)&&(this.isReadyToPay=!!i?.result,this.paymentMethodPresent=i?.paymentMethodPresent,this.config.onReadyToPayChange)){const a={isButtonVisible:s,isReadyToPay:this.isReadyToPay};this.paymentMethodPresent&&(a.paymentMethodPresent=this.paymentMethodPresent),this.config.onReadyToPayChange(a)}}})}setClassName(t,r){const n=r.filter(o=>o).join(" ");n?t.className=n:t.removeAttribute("class")}appendStyles(){var t,r,n;if(typeof document>"u")return;const o=(t=this.element)===null||t===void 0?void 0:t.getRootNode(),s=`default-google-style-${this.options.cssSelector.replace(/[^\w-]+/g,"")}-${(r=this.config)===null||r===void 0?void 0:r.buttonLocale}`;if(o&&!(!((n=o.getElementById)===null||n===void 0)&&n.call(o,s))){const i=document.createElement("style");i.id=s,i.type="text/css",i.innerHTML=` 247 ${this.options.cssSelector} { 248 display: inline-block; 249 } 250 ${this.options.cssSelector}.not-ready { 251 width: 0; 252 height: 0; 253 overflow: hidden; 254 } 255 `,o instanceof Document&&o.head?o.head.appendChild(i):o.appendChild(i)}}isClientInvalidated(t){return this.oldInvalidationValues?this.getInvalidationValues(t).some((n,o)=>JSON.stringify(n)!==JSON.stringify(this.oldInvalidationValues[o])):!0}getInvalidationValues(t){var r,n;return[t.environment,t.existingPaymentMethodRequired,!!t.onPaymentDataChanged,!!t.onPaymentAuthorized,t.buttonType,t.buttonColor,t.buttonRadius,t.buttonLocale,t.buttonSizeMode,t.buttonBorderType,t.paymentRequest.merchantInfo.merchantId,t.paymentRequest.merchantInfo.merchantName,(r=t.paymentRequest.merchantInfo.softwareInfo)===null||r===void 0?void 0:r.id,(n=t.paymentRequest.merchantInfo.softwareInfo)===null||n===void 0?void 0:n.version,t.paymentRequest.allowedPaymentMethods]}}var A5="@google-pay/button-react",N5="3.2.1";const W0="google-pay-button-container";class R5 extends xe.Component{constructor(){super(...arguments),this.manager=new T5({cssSelector:`.${W0}`,softwareInfoId:A5,softwareInfoVersion:N5}),this.elementRef=xe.createRef()}componentDidMount(){return no(this,void 0,void 0,function*(){const t=this.elementRef.current;t&&(yield this.manager.configure(this.props),yield this.manager.mount(t))})}componentWillUnmount(){this.manager.unmount()}componentDidUpdate(){this.manager.configure(this.props)}render(){return xe.createElement("div",{ref:this.elementRef,className:[W0,this.props.className].filter(t=>t).join(" "),style:this.props.style})}}const wm={uat:"https://uat-checkout.clinkbill.com"},Im=["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],P5=Im,Tm=["en","ar","bg","ca","cs","da","de","el","es","et","fi","fr","hr","id","it","ja","ko","ms","nl","no","pl","pt","ru","sk","sl","sr","sv","th","tr","uk","zh"];function Am(e){if(e.gateway==="stripe"){const{stripePublishableKey:r,connectAccountId:n,gateway:o,stripeVersion:s}=e,i=n?`${r}/${n}`:r;return{gateway:o,"stripe:version":s,"stripe:publishableKey":i}}else return{gateway:e.gateway,gatewayMerchantId:e.gatewayMerchantId}}function B5(e){const{card:t}=e,r=t?.exp_month??1,n=r<10?`0${r}`:`${r}`;return{cardNumber:t.last4,expireDate:`${n}/${t.exp_year}`,cvv:"",cardHolder:"",country:t.address_country,region:t.address_state,postalCode:t.address_zip,line1:t.address_line1,line2:t.address_line2}}function Nm(e){return bm(e.supportedNetworks,Im,P5)}function Rm(e){const{gateway:t,tokenJsonStr:r,cardNetwork:n}=e;if(t==="stripe"){const o=JSON.parse(r),s=o.id;return{gateway:t,token:s,cardFormData:B5(o)}}else return{gateway:t,token:r,cardFormData:null,cardNetwork:n}}const Y0=wa();function L5(e){const{disabled:t,onSuccess:r,isSubscriptionFreeTrail:n,beforeSDKEvent:o,extraProperties:s}=e,i=wt(u=>u.currentCheckedCurrency),a=wt(u=>u.sessionCurrencyList),c=on(u=>u.currentLocale),l=h.useMemo(()=>{const[u]=c.split("-");return Tm.includes(u.toLocaleLowerCase())?u:"en"},[c]),[f,y]=h.useState(!0),{t:m}=rt(),d=a.find(u=>u.currency===i);if(!d)throw new Error("could not found price info");const v={total:String(n?0:d.total),currency:d.currency},b=s,S=h.useMemo(()=>Nm(b),[b]);return L.jsxs("div",{className:le({"opacity-50 cursor-not-allowed pointer-events-none":t}),children:[f&&L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:m("thirdpart.google.loading")})})}),L.jsx("div",{className:"cursor-pointer",onClick:async u=>{u.preventDefault(),u.stopPropagation(),o&&await o();const C=document.querySelector("div.clink-google-pay-button button[id]");C&&C.click()},children:L.jsx(R5,{onError:u=>{},environment:Y0?"PRODUCTION":"TEST",className:le("h-[45px] w-full","pointer-events-none","clink-google-pay-button"),style:{display:"block"},buttonSizeMode:"fill",buttonRadius:6,buttonLocale:l,buttonType:"pay",paymentRequest:{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:S},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:Am(b)}}],merchantInfo:{merchantId:Y0?b.merchantId:"",merchantName:b.merchantName},transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:v.total,currencyCode:v.currency,countryCode:"US"}},onClick:u=>{u.stopPropagation()},onLoadPaymentData:u=>{if(mr(r)){const C=u.paymentMethodData.tokenizationData.token,x=Rm({gateway:b.gateway,tokenJsonStr:C,cardNetwork:u.paymentMethodData.info?.cardNetwork});r(x)}},onReadyToPayChange:u=>{u.isReadyToPay&&u.isButtonVisible&&y(!1)}})})]})}const X0=wa(),M5="/sdk-buttons/google.html",D5="clink-google-pay-button",$5="clink-google-pay-parent";function O5(e){return`${wm.uat}${e}`}function _5(){return O5(M5)}const Pm=_5();function k5(e){return Array.isArray(e.buttonAllowedPaymentMethods)&&e.buttonAllowedPaymentMethods.length>0?e.buttonAllowedPaymentMethods:e.paymentRequest.allowedPaymentMethods.map(t=>{const r={...t};return delete r.tokenizationSpecification,r})}function V5(e){const t=e;return JSON.stringify({environment:e.environment,buttonBorderType:t.buttonBorderType,buttonColor:t.buttonColor,buttonRadius:e.buttonRadius,buttonLocale:e.buttonLocale,buttonSizeMode:e.buttonSizeMode,buttonType:e.buttonType,existingPaymentMethodRequired:t.existingPaymentMethodRequired,paymentRequest:{apiVersion:e.paymentRequest.apiVersion,apiVersionMinor:e.paymentRequest.apiVersionMinor,allowedPaymentMethods:k5(e),merchantInfo:e.paymentRequest.merchantInfo}})}function F5(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`google-pay-${Date.now()}-${Math.random().toString(36).slice(2)}`}function U5(e){return!e||typeof e!="object"?!1:e.from===D5}function Q0(){return new URL(Pm,window.location.origin).origin}function j5(e){const{disabled:t,onSuccess:r,isSubscriptionFreeTrail:n,beforeSDKEvent:o,extraProperties:s,isVisible:i}=e,a=h.useRef(null),c=h.useRef(F5()),l=h.useRef(""),f=h.useRef(""),[y,m]=h.useState(!1),[d,v]=h.useState(!1),[b,S]=h.useState(i),[u,C]=h.useState(!1),x=wt(q=>q.currentCheckedCurrency),I=wt(q=>q.sessionCurrencyList),N=on(q=>q.currentLocale),E=h.useMemo(()=>{const[q]=N.split("-");return Tm.includes(q.toLocaleLowerCase())?q:"en"},[N]),g=!d,{t:p}=rt(),T=I.find(q=>q.currency===x);if(!T)throw new Error("could not found price info");const R=String(n?0:T.total),B=T.currency,P=s,D=h.useMemo(()=>{const q={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:Nm(P)}};return{environment:X0?"PRODUCTION":"TEST",buttonRadius:6,buttonLocale:E,buttonSizeMode:"fill",buttonType:"pay",buttonAllowedPaymentMethods:[q],paymentRequest:{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{...q,tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:Am(P)}}],merchantInfo:{merchantId:X0?P.merchantId:"",merchantName:P.merchantName},transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:R,currencyCode:B,countryCode:"US"}}}},[B,P,E,R]),U=h.useCallback((q,G)=>{const Y=a.current?.contentWindow;Y&&Y.postMessage({from:$5,type:q,requestId:c.current,data:G},Q0())},[]),_=h.useCallback(()=>{const q=JSON.stringify(D);if(l.current===q)return;l.current=q;const G=V5(D);f.current!==G&&(f.current=G,v(!1)),U("config",D)},[D,U]),V=h.useCallback(()=>{m(!0)},[]),z=h.useCallback(q=>{if(mr(r)){const G=q?.paymentMethodData?.tokenizationData?.token;if(!G)return;const Y=Rm({gateway:P.gateway,tokenJsonStr:G,cardNetwork:q?.paymentMethodData?.info?.cardNetwork});r(Y)}},[P.gateway,r]);return h.useEffect(()=>{i&&y&&_()},[y,i,_]),h.useEffect(()=>{i&&S(!0)},[i]),h.useEffect(()=>{i||C(!1)},[i]),h.useEffect(()=>{async function q(G){const Y=a.current?.contentWindow;if(G.origin!==Q0()||!Y||G.source!==Y)return;const ee=G.data;if(U5(ee)&&!(ee.requestId&&ee.requestId!==c.current))switch(ee.type){case"iframe-ready":{m(!0);break}case"ready-to-pay-change":{const J=ee.data;v(!!(J?.isReadyToPay&&J?.isButtonVisible));break}case"click":{const J=ee.data;if(!J)return;if(t){U("cancel-payment",{clickId:J.clickId});return}try{o&&await o(),C(!0),U("request-payment",{clickId:J.clickId})}catch{U("cancel-payment",{clickId:J.clickId})}break}case"load-payment-data":{const{paymentData:J}=ee.data??{};try{z(J)}finally{C(!1)}break}case"cancel":{C(!1);break}case"error":{ee.data,C(!1);break}}}return window.addEventListener("message",q),()=>{window.removeEventListener("message",q)}},[o,t,z,U]),L.jsxs("div",{"aria-disabled":t,className:le({"opacity-50 cursor-not-allowed pointer-events-none":t}),children:[L.jsx(cr,{fullscreen:!0,spinning:u,size:"large",indicator:L.jsx("div",{})}),L.jsxs("div",{className:"relative h-[45px] w-full",children:[g&&L.jsx("div",{className:"absolute inset-0",children:L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:p("thirdpart.google.loading")})})})}),b&&L.jsx("iframe",{ref:a,allow:"payment *","aria-hidden":g||t,className:le("absolute inset-0 h-[45px] w-full border-none",{"opacity-0 pointer-events-none":g}
255),referrerPolicy:"strict-origin-when-cross-origin",src:Pm,tabIndex:g||t?-1:void 0,title:"Google Pay",onLoad:V})]})]})}function H5(){try{return window.self!==window.top}catch{return!0}}function z5(){const e=wm.uat;return window.location.origin===e}const K5=h.memo(e=>{const{currentPaymentUtilInfo:t}=Wr(),r=va("GOOGLEPAY");if(!r?.extraProperties)return null;const n=r.extraProperties,o=_o(t,"GOOGLEPAY"),i=H5()||z5()?L5:j5;return L.jsx("div",{className:le({hidden:!o}),children:L.jsx(i,{...e,extraProperties:n,isVisible:o})})});let Ts,Z0="";const G5=e=>{const t=`${e.stripePublishableKey}:${e.connectAccountId??""}`;return(!Ts||Z0!==t)&&(Z0=t,Ts=wf(async()=>{const{loadStripe:r}=await import("./index-Chmwl3g_.js");return{loadStripe:r}},[]).then(({loadStripe:r})=>r(e.stripePublishableKey,{developerTools:{assistant:{enabled:!1}},stripeAccount:e.connectAccountId??void 0}))),Ts},J0="stripe-link-checkout-element";function q5(e){const{billing_details:t}=e.payment_method_preview,{address:r}=t;return{cardNumber:"",expireDate:"",cvv:"",cardHolder:t.name??"",country:r?.country??"",region:r?.state??"",postalCode:r?.postal_code??"",line1:r?.line1??"",line2:r?.line2??""}}function W5(e){const{disabled:t,onSuccess:r,onError:n,beforeSDKEvent:o,isSubscriptionFreeTrail:s}=e,{currentPaymentUtilInfo:i}=Wr(),a=va("LINK"),c=_o(i,"LINK"),l=wt(V=>V.currentCheckedCurrency),y=wt(V=>V.sessionCurrencyList).find(V=>V.currency===l),m=Em(y,s,{payment_method_types:["card"]}),[d,v]=h.useState(!0),[b,S]=h.useState(!1),u=h.useRef(!1),C=h.useRef(!1),x=h.useRef({beforeSDKEvent:o,onError:n,onSuccess:r}),I=h.useRef(c),N=h.useRef(null),E=h.useRef(m);I.current=c,E.current=m,h.useEffect(()=>{x.current={beforeSDKEvent:o,onError:n,onSuccess:r}},[o,n,r]);const g=a?.extraProperties,p=h.useRef(g),T=g?.stripePublishableKey,R=g?.connectAccountId,B=!!m;p.current=g,h.useEffect(()=>{let V=!1,z=null,q=null;function G(ee,J){const te=ee instanceof Error?ee:new Error("Stripe payment failed");J.paymentFailed({reason:"fail",message:te.message}),V||x.current.onError?.(te)}async function Y(){const ee=p.current;if(!(!ee||!E.current)){v(!0),S(!1);try{const J=await G5(ee);if(V)return;if(!J)throw new Error("Stripe Link SDK failed to load");const te=J.elements(E.current);N.current=te,te.on("update-end",()=>{V||(C.current||u.current)&&(C.current=!1,v(!1))}),z=te.create("expressCheckout",{paymentMethods:{applePay:"never",amazonPay:"never",googlePay:"never",klarna:"never",link:"auto",paypal:"never"},paymentMethodOrder:["link"],buttonHeight:45}),q=Sm(z),z.on("ready",({availablePaymentMethods:Q})=>{if(!V){if(v(!1),!Q?.link){S(!0);return}u.current=!0}}),z.on("loaderror",({error:Q})=>{V||(v(!1),S(!0),I.current&&x.current.onError?.(new Error(Q.message)))}),z.on("click",async Q=>{try{const{beforeSDKEvent:Z}=x.current;if(mr(Z)&&await Z(),V){Q.reject();return}Q.resolve()}catch{Q.reject()}}),z.on("confirm",async Q=>{if(V)return;const Z=q?.beginConfirmation();try{const{error:W}=await te.submit();if(W){G(new Error(W.message),Q);return}const{error:oe,confirmationToken:ie}=await J.createConfirmationToken({elements:te});if(oe){G(new Error(oe.message),Q);return}await x.current.onSuccess?.({token:ie.id,cardFormData:q5(ie)})}catch(W){G(W,Q)}finally{Z?.()}}),z.mount(`#${J0}`)}catch(J){if(V)return;const te=J instanceof Error?J:new Error("Stripe Link load failed");v(!1),S(!0),I.current&&x.current.onError?.(te)}}}return Y(),()=>{V=!0,q?.destroy(),q=null,z=null,N.current=null}},[R,B,T]);const P=m?.mode,D=m?.currency,U=m?.mode==="payment"?m.amount:void 0;h.useEffect(()=>{const V=N.current;!V||!P||!D||(v(!0),S(!1),C.current=!0,V.update({mode:P,currency:D,amount:U,setupFutureUsage:"off_session"}))},[U,D,P]);const{t:_}=rt();return g?L.jsxs("div",{"aria-busy":d,className:le({hidden:!c,"opacity-50 cursor-not-allowed":t,"pointer-events-none":t||d}),children:[d&&!u.current&&L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:_("thirdpart.link.loading")})})}),b&&!d&&L.jsx("div",{className:le("h-[45px] flex justify-center items-center","px-2"),role:"alert",children:L.jsx("span",{className:"text-red-500",children:_("thirdpart.link.loadFailed")})}),L.jsx("div",{id:J0})]}):null}function Y5(){return typeof window>"u"&&typeof document>"u"}var Gn={PENDING:"pending",RESOLVED:"resolved",REJECTED:"rejected"},qn="data-loading-state";function X5(e){var t,r;if(e===void 0&&(e={}),Q5(e),Y5())return Promise.resolve(null);var n=e.environment,o=e.debug,s=e.dataNamespace,i=e.dataSdkIntegrationSource,a=s??"paypal",c=ef(a);if(c?.version.startsWith("6"))return Promise.resolve(c);var l=n==="production"?"https://www.paypal.com":"https://www.sandbox.paypal.com",f=new URL("/web-sdk/v6/core",l);o&&f.searchParams.append("debug","true");var y=(r=document.querySelector('script[src*="'.concat(f.pathname,'"][').concat(qn,'="').concat(Gn.PEND
255ING,'"]')))!==null&&r!==void 0?r:Z5({url:f.toString(),attributes:(t={"data-namespace":s,"data-sdk-integration-source":i},t[qn]=Gn.PENDING,t)});return new Promise(function(m,d){y.addEventListener("load",function(){var v=ef(a);return v?(y.setAttribute(qn,Gn.RESOLVED),m(v)):(y.setAttribute(qn,Gn.REJECTED),d("The window.".concat(a," global variable is not available")))},{once:!0}),y.addEventListener("error",function(){var v=new Error('The script "'.concat(f.toString(),'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return y.setAttribute(qn,Gn.REJECTED),d(v)},{once:!0})})}function Q5(e){if(typeof e!="object"||e===null)throw new Error("Expected an options object");var t=e,r=t.environment,n=t.dataNamespace,o=t.dataSdkIntegrationSource;if(r&&r!=="production"&&r!=="sandbox")throw new Error('The "environment" option must be either "production" or "sandbox"');if(n!==void 0&&n.trim()==="")throw new Error('The "dataNamespace" option cannot be an empty string');if(o!==void 0&&o.trim()==="")throw new Error('The "dataSdkIntegrationSource" option cannot be an empty string')}function ef(e){return window[e]}function Z5(e){var t=e.url,r=e.attributes,n=document.createElement("script");n.src=t;for(var o=0,s=Object.entries(r);o<s.length;o++){var i=s[o],a=i[0],c=i[1];c!==void 0&&n.setAttribute(a,c)}return document.head.appendChild(n),n}var or;(function(e){e.PENDING="pending",e.RESOLVED="resolved",e.REJECTED="rejected"})(or||(or={}));var er;(function(e){e.SET_LOADING_STATUS="setLoadingStatus",e.SET_INSTANCE="setInstance",e.SET_ELIGIBILITY="setEligibility",e.SET_ERROR="setError",e.RESET_STATE="resetState"})(er||(er={}));var tf;(function(e){e.SET_LOADING_STATUS="setLoadingStatus",e.SET_INSTANCE="setInstance",e.SET_ERROR="setError",e.RESET_STATE="resetState"})(tf||(tf={}));const Bm={sdkInstance:null,eligiblePaymentMethods:null,eligiblePaymentMethodsPayload:null,loadingStatus:or.PENDING,error:null,isHydrated:!1};function J5(e,t){switch(t.type){case er.SET_LOADING_STATUS:return{...e,loadingStatus:t.value};case er.SET_INSTANCE:return{...e,sdkInstance:t.value,loadingStatus:or.RESOLVED};case er.SET_ELIGIBILITY:return{...e,eligiblePaymentMethods:t.value.eligiblePaymentMethods,eligiblePaymentMethodsPayload:t.value.payload};case er.SET_ERROR:return{...e,error:t.value,loadingStatus:or.REJECTED};case er.RESET_STATE:return Bm;default:return e}}const Lm=h.createContext(null);function Ta(){const e=h.useContext(Lm);if(e===null)throw new Error("usePayPal must be used within a PayPalProvider");return e}function e6(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function t6(e){const t=h.useRef(e);return e6(t.current,e)||(t.current=e),t.current}function Mm(e){const t=h.useRef(new Proxy({},{get(r,n,o){return typeof r[n]=="function"?(...s)=>r[n](...s):Reflect.get(r,n,o)}}));return t.current=Object.assign(t.current,e),t.current}function qa(e){return e instanceof Error?e:new Error(String(e))}function r6(e){const t=h.useRef();return(!t.current||!Rl(e,t.current.value))&&(t.current={value:e}),t.current.value}function Rl(e,t,r=10,n=0){if(n>r)return!1;if(e===t)return!0;if(e==null||t===null||t===void 0||typeof e!=typeof t||typeof e!="object")return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!Rl(e[c],t[c],r,n+1))return!1;return!0}if(Array.isArray(e)||Array.isArray(t))return!1;const o=e,s=t,i=Object.keys(o),a=Object.keys(s);if(i.length!==a.length)return!1;for(const c of i)if(!Rl(o[c],s[c],r,n+1))return!1;return!0}function Dm({sessionCreator:e,failedSdkRef:t,sdkInstance:r,setError:n,errorMessage:o}){if(t.current===r)return null;try{return e()}catch(s){t.current=r;const i=new Error(o,{cause:s});return n(i),null}}h.createContext(null);h.createContext(null);function _c(e=!1){const[t,r]=h.useState(null),n=h.useCallback(o=>{r(o)},[e]);return[t,n]}function $m(){const e=h.useRef(!1);return h.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function n6({presentationMode:e="auto",fullPageOverlay:t,autoRedirect:r,createOrder:n,orderId:o,savePayment:s,testBuyerCountry:i,...a}){const{sdkInstance:c,loadingStatus:l}=Ta(),f=$m(),y=h.useRef(null),m=Mm(a),[d,v]=_c(),b=h.useRef(null),S=l===or.PENDING,u=h.useCallback(()=>{y.current?.destroy(),y.current=null},[]),C=h.useCallback(()=>{y.current?.cancel()},[]);h.useEffect(()=>
255{b.current!==c&&(b.current=null),c?v(null):l!==or.PENDING&&v(new Error("no sdk instance available"))},[c,v,l]),h.useEffect(()=>{if(!c)return;const I=Dm({sessionCreator:()=>c.createPayPalOneTimePaymentSession({orderId:o,savePayment:s,testBuyerCountry:i,...m}),failedSdkRef:b,sdkInstance:c,setError:v,errorMessage:'Failed to create payment session. This may occur if the required component "paypal-payments" is not included in the SDK components array.'});return I?(y.current=I,(e==="redirect"||e==="direct-app-switch")&&(async()=>{try{if(!I)return;I.hasReturned?.()&&await I.resume?.()}catch(g){v(g)}})(),()=>{I.destroy()}):void 0},[c,o,m,e,v,s,i]);const x=h.useCallback(async()=>{if(!f.current)return;if(!y.current){v(new Error("PayPal session not available"));return}const I={presentationMode:e,fullPageOverlay:t,autoRedirect:r};return await y.current.start(I,n?.())},[f,e,t,r,n,v]);return{error:d,isPending:S,handleClick:x,handleCancel:C,handleDestroy:u}}const a6=({type:e="pay",disabled:t=!1,...r})=>{const{error:n,isPending:o,handleClick:s}=n6(r),{isHydrated:i}=Ta();return h.useEffect(()=>{},[n]),i?xe.createElement("paypal-button",{onClick:s,type:e,disabled:t||o||n!==null?!0:void 0}):xe.createElement("div",null)},o6=h.createContext(null),i6=typeof window<"u"?h.useLayoutEffect:h.useEffect,s6=({clientMetadataId:e,clientToken:t,clientId:r,components:n=["paypal-payments"],locale:o,pageType:s,partnerAttributionId:i,shopperSessionId:a,testBuyerCountry:c,eligibleMethodsResponse:l,children:f,merchantId:y,...m})=>{const d=t6(n),v=r6(y),[b,S]=h.useState(null),[u,C]=h.useReducer(J5,Bm),[x,I]=h.useState(!1),N=h.useRef({...m,dataSdkIntegrationSource:"react-paypal-js"});i6(()=>{I(!0)},[]);const[,E]=_c();h.useEffect(()=>{let p=!0;return(async()=>{try{const R=await X5({environment:N.current.environment,debug:N.current.debug,dataNamespace:N.current.dataNamespace,dataSdkIntegrationSource:N.current.dataSdkIntegrationSource});R&&p&&S(R)}catch(R){p&&(E(R),C({type:er.SET_ERROR,value:qa(R)}))}})(),()=>{p=!1}},[E]),h.useEffect(()=>{if(!b||!t&&!r)return;C({type:er.SET_LOADING_STATUS,value:or.PENDING});let p=!0;return(async()=>{try{const R=t||r,B=!!t;let P;if(typeof R=="string")P=R;else if(R)try{P=await R}catch(V){const z=new Error(`Failed to resolve ${B?"clientToken":"clientId"}. Expected a Promise that resolves to a string, but it was rejected with: ${qa(V).message}`);p&&(E(z),C({type:er.SET_ERROR,value:z}));return}if(!P||!p)return;const D={clientMetadataId:e,components:d,locale:o,pageType:s,partnerAttributionId:i,shopperSessionId:a,testBuyerCountry:c,merchantId:v},U=B?{...D,clientToken:P}:{...D,clientId:P},_=await b.createInstance(U);if(!p)return;C({type:er.SET_INSTANCE,value:_})}catch(R){p&&(E(R),C({type:er.SET_ERROR,value:qa(R)}))}})(),()=>{p=!1}},[e,t,r,o,d,v,s,i,b,a,c,E]),h.useEffect(()=>{const p=u.sdkInstance;if(p)try{if(l){const T=p.hydrateEligibleMethods(l);C({type:er.SET_ELIGIBILITY,value:{eligiblePaymentMethods:T,payload:null}})}}catch(T){E(T),C({type:er.SET_ERROR,value:qa(T)})}},[u.sdkInstance,l,E]);const g=h.useMemo(()=>({sdkInstance:u.sdkInstance,eligiblePaymentMethods:u.eligiblePaymentMethods,eligiblePaymentMethodsPayload:u.eligiblePaymentMethodsPayload,error:u.error,loadingStatus:u.loadingStatus,isHydrated:x}),[u.sdkInstance,u.eligiblePaymentMethods,u.eligiblePaymentMethodsPayload,u.error,u.loadingStatus,x]);return xe.createElement(o6.Provider,{value:C},xe.createElement(Lm.Provider,{value:g},f))};or.PENDING;h.createContext(null);function l6({presentationMode:e="auto",fullPageOverlay:t,autoRedirect:r,createVaultToken:n,vaultSetupToken:o,...s}){const{sdkInstance:i,loadingStatus:a}=Ta(),c=$m(),l=h.useRef(null),f=Mm(s),[y,m]=_c(),d=h.useRef(null),v=a===or.PENDING,b=h.useCallback(()=>{l.current?.destroy(),l.current=null},[]);h.useEffect(()=>{d.current!==i&&(d.current=null),i?m(null):a!==or.PENDING&&m(new Error("no sdk instance available"))},[i,m,a]),h.useEffect(()=>{if(!i)return;const C=Dm({sessionCreator:()=>i.createPayPalSavePaymentSession({vaultSetupToken:o,...f}),failedSdkRef:d,sdkInstance:i,setError:m,errorMessage:'Failed to create payment session. This may occur if the required component "paypal-payments" is not included in the SDK components array.'});return C?(l.current=C,(e==="redirect"||e==="direct-app-switch")&&(async()=>{try{if(!C)return;C.hasReturned?.()&&await C.resume?.()}catch(N){m(N)}})(),()=>{C.destroy()}):void 0},[i,o,f,e,m]);const S=h.useCallback(()=>{l.current?.cancel()},[]),u=h.useCallback(async()=>
255{if(!c.current)return;if(!l.current){m(new Error("Save Payment session not available"));return}const C={presentationMode:e,fullPageOverlay:t,autoRedirect:r};n?await l.current.start(C,n()):await l.current.start(C)},[c,e,t,r,n,m]);return{error:y,isPending:v,handleClick:u,handleCancel:S,handleDestroy:b}}const c6=({type:e="pay",disabled:t=!1,...r})=>{const{error:n,isPending:o,handleClick:s}=l6(r),{isHydrated:i}=Ta();return h.useEffect(()=>{},[n]),i?xe.createElement("paypal-button",{type:e,disabled:t||o||n!==null?!0:void 0,onClick:s}):xe.createElement("div",null)};async function u6(e){const{onSuccess:t,onError:r,callbackData:n,currentPedId:o}=e;try{const s=JSON.stringify(n),i=await V2({paymentExecutionDetailId:o,data:s});if(i.status!==F2)throw new Error(i.message??"Unknown error");await t(),Ls("payment_completed_success",{payment_method:"PAYPAL",order_id:"",click_uuid:""})}catch(s){s instanceof Error&&await r(s)}}function d6(e){const{disabled:t,isZeroPayment:r,handleSubmit:n,currentPedId:o,onSuccess:s,onError:i}=e,{loadingStatus:a}=Ta(),{t:c}=rt(),{currentPaymentUtilInfo:l}=Wr(),f=va("PAYPAL"),y=_o(l,"PAYPAL");if(!f||y&&!Ms(f.extraProperties))return null;if(a===or.PENDING)return L.jsx("div",{className:le({hidden:!y}),children:L.jsx(cr,{spinning:!0,children:L.jsx("div",{className:"h-[45px] flex justify-center items-center",children:L.jsx("span",{children:c("thirdpart.paypal.loading")})})})});if(a===or.REJECTED)return L.jsxs("div",{className:le("h-[45px] flex justify-center items-center gap-2","text-red-500","border rounded-md",{hidden:!y}),children:[L.jsx(W3,{}),L.jsx("span",{children:c("thirdpart.paypal.loadFailed")})]});const m=async d=>{await u6({onSuccess:s,onError:v=>i(v.message),callbackData:d,currentPedId:o.current})};return r?L.jsx("div",{className:le({hidden:!y}),children:L.jsx(c6,{createVaultToken:async()=>({vaultSetupToken:await n()}),disabled:t,presentationMode:"auto",onApprove:m})}):L.jsx("div",{className:le({hidden:!y}),children:L.jsx(a6,{createOrder:async()=>({orderId:await n()}),disabled:t,presentationMode:"auto",onApprove:m,savePayment:!0})})}const f6={"zh-hant":"zh-TW","zh-hant-tw":"zh-TW","zh-tw":"zh-TW","zh-hant-hk":"zh-HK","zh-hk":"zh-HK","zh-mo":"zh-HK"};function p6(e){const t=e.trim().replace(/_/g,"-").toLowerCase(),r=f6[t];return r||e.trim()}const h6=wa();function m6(e){return function(){const r=va("PAYPAL")?.extraProperties?.clientId,n=on(s=>s.currentLocale),o=p6(n);return L.jsx(s6,{clientId:r,components:["paypal-payments"],pageType:"checkout",locale:o,environment:h6?"production":"sandbox",children:L.jsx(e,{})})}}function g6(e){if(!e)return null;const{customerVo:t}=e;if(!t)return null;const{customerExtraObject:r}=t,{cpfName:n,cpfNumber:o}=r??{},s=v6(e);return{cpfName:n,cpfNumber:o,...s}}function v6(e){if(!e)return null;const{customerVo:t}=e;if(!t)return null;const{billingAddress:r}=t;if(!r)return null;try{const n=JSON.parse(r??"{}"),{city:o,country:s,line1:i,line2:a,postalCode:c,region:l}=n??{};return{line1:i,line2:a,city:o,region:l,country:s,postalCode:c}}catch{return null}}function y6(){const e=lr(r=>r.setInfo);function t(r,n){const o=g6(r);o&&(o.country?e({...o}):e({...o,country:n??void 0}))}return{setupPixExtraAddress:t}}const b6="/static/png/store-CGZamhXS.png";function C6(e){const{cancelUrl:t,merchantName:r,className:n}=e,{t:o}=rt();if(!t)return null;const s=r?o("payment.backToMerchantName",{merchant:r}):o("payment.backToMerchant");return L.jsx(On,{placement:"top",title:s,children:L.jsx(V3,{className:le(n),onClick:()=>window.location.href=t})})}function x6(e){const{receiptCardInfo:t,session:r,currentCheckedCurrency:n}=e,[o,{toggle:s,set:i}]=r1(!1);h.useEffect(()=>(o?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"}),[o]),h.useImperativeHandle(e.ref,()=>({open:()=>i(!0)}),[i]);function a(l){l.stopPropagation()}const{t:c}=rt();return L.jsxs("div",{className:"ml-auto lg:hidden",children:[L.jsxs("div",{className:"relative flex items-center",onClick:s,children:[L.jsxs("div",{className:"relative w-[52px] h-[20px] opacity-60",children:[L.jsx("span",{className:le("text-sm absolute right-[8px] transition-all duration-300",o?"-translate-x-full opacity-0":"translate-x-0 opacity-100"),children:c("payment.details")}),L.jsx("span",{className:le("text-sm absolute right-[8px] transition-all duration-300",o?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:c("payment.close")})]}),L.jsx(ba,{className:le("transition-all duration-300 opacity-60",{"rotate-180":o})})]}),L.jsx(Yt.div,{onClick:()=>i(!1),initial:!1,animate:o?{opacity:1,height:"100vh"}:{opacity:0,height:0},transition:{opacity:{duration:.3,ease:"easeOut"},height:{duration:0,delay:o?0:.3}}
255,className:le("absolute inset-x-0 top-[60px] bg-[#000]/20",{"pointer-events-none":!o}),children:L.jsx(Yt.div,{onClick:a,initial:!1,animate:{height:o?"auto":0},transition:{duration:.3,ease:"easeOut"},className:"overflow-hidden bg-white shadow-md",children:L.jsx("div",{className:le("flex gap-4 max-lg:justify-center items-center","payment-container max-lg:mx-auto","max-lg:max-h-[calc(100vh-60px)] max-lg:overflow-y-auto"),children:L.jsx(vm,{className:"px-5 pb-4 pt-2 w-full",receiptCardInfo:t,session:r,currentCheckedCurrency:n})})})})]})}function S6(e){const{sessionContext:t,session:r,mobileDetailRef:n,receiptCardInfo:o,currentCheckedCurrency:s}=e;return L.jsx("div",{className:le("max-lg:fixed max-lg:top-0 max-lg:inset-x-0","max-lg:p-5 max-lg:bg-[white] max-lg:shadow-sm max-lg:z-[999]","flex"),children:L.jsxs("div",{className:le("flex gap-4 max-lg:justify-center items-center","w-[380px] max-lg:mx-auto"),children:[L.jsx(C6,{cancelUrl:t?.cancelUrl,merchantName:r?.remoteMerchantVo?.merchantName,className:le("cursor-pointer text-ant-lg","lg:absolute lg:top-[-4px] lg:left-[-40px] lg:z-[100] lg:p-2 lg:mr-0","static p-0 mr-1","hover:bg-ant-fill-secondary rounded-full")}),L.jsx("div",{children:L.jsx("div",{className:le("flex justify-center items-center text-[white]","size-[24px] max-lg:size-[20px]"),children:L.jsx(Oo,{src:r.remoteMerchantVo.logoUrl||b6,className:"pointer-events-none select-none rounded-full"})})}),L.jsx("span",{className:le("font-medium text-ant leading-[22px]","overflow-hidden text-ellipsis","lg:break-all"),children:r.remoteMerchantVo.merchantName}),L.jsx(x6,{ref:n,receiptCardInfo:o,session:r,currentCheckedCurrency:s})]})})}function Om(e){const{text:t,className:r}=e;return L.jsx("div",{className:le("text-ant-lg leading-[24px] text-ant-text-secondary","font-medium break-all",r),children:L.jsx($c,{text:t})})}function _m(e){const{options:t,onChecked:r,value:n,disabled:o,loading:s,singleCurrencyClassName:i}=e,{t:a}=rt();function c(m){return Bn.find(v=>v.value===m)?.logo||""}const l=t.find(m=>m.currency===n),f=l?a("payment.conversionFee2",{originalCurrency:l.originalCurrency,rateAmount:l.rate,currentCurrency:l.currency,fee:(l.point*100).toFixed(4)}):"",y=l&&l.originalCurrency!==l.currency&&f;if(t.length===1){const[m]=t;return L.jsxs("span",{className:le("font-semibold text-ant-text","text-[36px] leading-[46px]","max-lg:text-[28px] max-lg:leading-[36px]","flex max-lg:justify-center",i),onClick:()=>r(m),children:[m.symbol,zt(m.total,m.currency)]})}return L.jsxs(L.Fragment,{children:[L.jsx(cr,{spinning:s,children:L.jsx("div",{className:le("grid grid-cols-2 gap-3",{"cursor-not-allowed":o}),children:t.map(m=>L.jsxs("div",{className:le("border px-3 py-3 rounded-ant-lg","flex items-center cursor-pointer","transition-all duration-300 ease-in-out",o&&["opacity-50 pointer-events-none","bg-ant-fill-tertiary"],m.currency===n?["border-primary","bg-primary-bg","shadow-sm"]:["border-ant-border-secondary",!o&&"hover:shadow-md hover:bg-ant-bg-layout"]),onClick:()=>r(m),children:[L.jsx("img",{src:c(m.currency),className:le("rounded-[2px] w-[26px] h-[20px]","select-none pointer-events-none","box-border border border-ant-border-secondary")}),L.jsx("div",{className:le("text-sm flex gap-1 ms-2",m.currency===n?"font-semibold text-ant-text":"text-ant-text-secondary"),children:L.jsxs("span",{children:[m.symbol,zt(m.total,m.currency)]})})]},m.currency))})}),L.jsx("span",{className:le("mt-2 text-ant-sm leading-[17px]","text-ant-text-tertiary h-[17px] max-lg:mb-[16px]"),children:y?f:a("payment.exchangeRateTip")})]})}function E6(){const{token:e}=If.useToken();let t="#ff9472",r="#ff7da9";return Hr(o=>o.isDefaultConfig)||(t=e.colorPrimaryHover,r=e.colorPrimaryActive),L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"110",height:"24",viewBox:"0 0 110 24",children:[L.jsx("defs",{children:L.jsxs("linearGradient",{x1:"1.0015935897827148",y1:"0.48389294743537903",x2:"0.001638147048652172",y2:"0.48389294743537903",id:"master_svg0_43_6147",children:[L.jsx("stop",{offset:"0%","stop-color":t,"stop-opacity":"1"}
255),L.jsx("stop",{offset:"100%","stop-color":r,"stop-opacity":"1"})]})}),L.jsxs("g",{children:[L.jsx("g",{children:L.jsx("path",{d:"M1.10287,10.7039C0.467129,11.451,0.467129,12.549,1.10287,13.2961L9.61202,23.2961C9.99201,23.7427,10.5488,24,11.1352,24L108,24C109.105,24,110,23.1046,110,22L110,2C110,0.895431,109.105,0,108,0L11.1352,0C10.5488,0,9.99201,0.257321,9.61202,0.703895L1.10287,10.7039Z",fill:"url(#master_svg0_43_6147)","fill-opacity":"1"})}),L.jsx("g",{children:L.jsx("ellipse",{cx:"12",cy:"12",rx:"3",ry:"3",fill:"#F7F8F9","fill-opacity":"1"})})]})]})}function km(e){const{subscriptionInfo:t,session:r,currencyOptions:n,className:o}=e,s=Jt(l=>l.isValidPromoCode),i=nn(l=>l.pricingSchedule),{t:a}=rt(),c=h.useMemo(()=>{if(n.length===0||r.remotePriceSnapshotVo?.priceType!==gr)return null;const l=n[0],f=l.durationType,y=l.symbol+zt(l.subTotal,l.currency),m=l.symbol+zt(l.nextPeriodPayableAmount,l.currency),d=Ia({interval:t.interval,intervalCountForCustom:t.intervalCountForCustom});if(t.isFreeTrial){const v=aa(r.freeEndTime,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD");if(s&&f)switch(f){case"ONCE":return null;case"REPEATING":return null;case"FOREVER":return a("subscription.extra.hasTrial.FOREVER",{cycle:d,amount:m,freeEndTime:v})}return a("subscription.extra.hasTrial.fallback",{cycle:d,originalAmount:y,freeEndTime:v})}if(!t.isFreeTrial){if(s&&f)switch(f){case"ONCE":return a("subscription.extra.notTrial.ONCE",{cycle:d,originalAmount:y});case"REPEATING":return null;case"FOREVER":return null}return null}return null},[t,r,s,a,n]);return!c||i?null:L.jsx("div",{className:le("text-ant-text-secondary font-medium",o),children:c})}function w6(e){const{session:t,subscriptionInfo:r,...n}=e,{t:o}=rt(),s=mm({productName:t.remoteProductVo?.name,i18nRecord:t.remoteProductVo?.localizedNames});return L.jsxs("div",{className:"mt-[32px]",children:[L.jsx(Om,{text:`${o("payment.subscribe")} ${s}`}),L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx(Vm,{session:t,sessionCurrencyOptions:n.options}),!r.isFreeTrial&&!t.pricingSchedule&&L.jsxs("div",{className:le("flex flex-col","text-ant-text-secondary text-ant leading-[16px]","font-semibold"),children:[L.jsx("span",{children:o("payment.per")}),L.jsx("span",{children:Ia({interval:r.interval,intervalCountForCustom:r.intervalCountForCustom})})]}),r.isFreeTrial&&L.jsxs("span",{className:"relative flex items-center",children:[L.jsx(E6,{}),L.jsx("span",{className:le("absolute left-[30%] top-[2px]","font-medium text-sm text-white"),children:o("payment.freeTrial")})]})]}),L.jsx(km,{session:t,subscriptionInfo:r,currencyOptions:n.options})]})}function Vm(e){const{className:t,session:r,sessionCurrencyOptions:n}=e,{t:o}=rt(),s=r.freeTrialDays??0,i=s>0;return L.jsxs("span",{className:le("font-semibold text-[36px] text-ant-text","leading-[50px]",t),children:[i&&L.jsx("span",{className:le("font-semibold text-ant-text","text-[36px] leading-[46px]","max-lg:text-[28px] max-lg:leading-[36px]","flex max-lg:justify-center"),children:o("subscription.freeDays",{days:s})}),!i&&L.jsx(_m,{options:n,value:"",onChecked:()=>{}})]})}function I6(e){const{session:t,subscriptionInfo:r,onDetailClick:n,sessionCurrencyOptions:o}=e,{t:s}=rt(),i=80,a=120,c=160,[l,f]=h.useState(i);h.useEffect(()=>{const u=Co(()=>{const C=window.innerHeight;C>811?f(c):C>666?f(a):f(i)},200);return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]);const y=Jt(u=>u.enable),d=!Jt(u=>u.isValidPromoCode)||!y,v=h.useMemo(()=>s(y?"payment.addPromotionCode":"payment.viewDetails"),[y,s]),b=h.useMemo(()=>{if(t.priceType===rn&&t.priceDataList&&t.priceDataList.length>0){const u=t.priceDataList[0];return{title:s("payment.payForMerchant",{merchant:t.remoteMerchantVo.merchantName}),image:u.imageUrl??""}}return{title:t.remoteProductVo?.name??"",image:t.remoteProductVo?.image??""}},[t,s]),{token:S}=If.useToken();return L.jsxs("div",{className:le("lg:hidden flex justify-center items-center flex-col","px-[16px] pb-[32px] pt-[16px]"),children:[L.jsxs("div",{className:"flex justify-center",children:[!b.image&&L.jsx("div",{className:"mt-10"}),b.image&&L.jsx(Oo,{width:l,height:l,src:b.image,className:le("box-border object-contain","rounded-[6px] pointer-events-none select-none"),style:{width:l,height:l},styles:{root:{width:l,height:l,overflow:"hidden"}}})]}),L.jsx(Om,{className:le("mt-[16px]"),text:b.title}),t.remotePriceSnapshotVo?.priceType===gr&&L.jsxs("div",{className:le("flex gap-2",r.isFreeTrial?"items-center":"items-end"),children:[L.jsx(Vm,{session:t,sessionCurrencyOptions:o}),L.jsx("div",{className:"flex flex-col gap-[2px]",children:!r.isFreeTrial&&!t.pricingSchedule&&L.jsxs("span",{className:le("text-ant-text-secondary font-semibold",{"text-ant leading-[20px] mb-[5px]":!r.is
255FreeTrial},{"text-[13px] leading-[15px]":r.isFreeTrial}),children:[s("payment.per"),L.jsx("span",{className:"ml-1",children:Ia({interval:r.interval,intervalCountForCustom:r.intervalCountForCustom})})]})})]}),r.unit&&L.jsx("div",{className:le("text-ant-text-tertiary text-ant-sm leading-[20px] text-right"),children:s("payment.quantityPerUnit",{count:Cc(String(r.unit))})}),L.jsx(km,{session:t,subscriptionInfo:r,currencyOptions:o,className:le("max-lg:text-center")}),d&&L.jsxs(Or,{className:le("mt-2 text-ant px-3 font-medium","bg-[#1A1A1A0D]"),style:{color:S.colorTextBase},type:"default",size:"large",onClick:n,children:[v,L.jsx(ba,{})]})]})}function rf(e){const{sessionCurrencyList:t,currencySelectDisabled:r,className:n}=e,{t:o}=rt();return L.jsxs("div",{className:le("flex flex-col",n),children:[t.length>1&&L.jsx("span",{className:le("font-medium text-sm mb-4",{"text-ant-text-disabled":r,"text-ant-text-secondary":!r}),children:o("payment.chooseACurrency")}),L.jsx(_m,{...e,singleCurrencyClassName:le("max-lg:mb-4")})]})}function T6(e){const{className:t,session:r,disabled:n,onCheckChange:o,checked:s}=e,{t:i}=rt(),{currentPaymentUtilInfo:a}=Wr(),c=h.useMemo(()=>r.priceType===gr,[r]);return Oc(r)!=="payment"||!a.extraProperties?.supportsPasswordlessPayment||a.paymentId?.includes("_")?null:L.jsxs(Yt.div,{className:le("flex gap-2","border px-4 py-3 rounded-[6px]","shadow-sm","bg-[var(--components-background)]",t),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},children:[L.jsx(pc,{id:"save-payment-method",disabled:n,checked:s,onChange:f=>o(f.target.checked)}),L.jsxs("label",{htmlFor:"save-payment-method",className:le("text-ant-text font-medium","cursor-pointer",{"text-black/25":n}),children:[i("payment.rememberPaymentMethod.title"),L.jsx(On,{placement:"top",title:i("payment.rememberPaymentMethod.forceTip"),children:c&&L.jsx(Mf,{className:"ms-2"})})]})]})}function A6({className:e}){return L.jsx("div",{className:le("relative w-full h-full flex items-center justify-center",e),children:L.jsxs("svg",{viewBox:"0 0 400 300",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full max-w-[400px]",children:[L.jsxs("defs",{children:[L.jsxs("linearGradient",{id:"glassGradient",x1:"150",y1:"50",x2:"250",y2:"250",gradientUnits:"userSpaceOnUse",children:[L.jsx("stop",{stopColor:"white",stopOpacity:"0.4"}),L.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.1"})]}),L.jsxs("filter",{id:"shadowBlur",x:"-20%",y:"-20%",width:"140%",height:"140%",children:[L.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),L.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})]}),L.jsx(Yt.ellipse,{cx:"200",cy:"240",rx:"60",ry:"10",className:"fill-slate-200 dark:fill-slate-800",initial:{scale:.8,opacity:0}
255,animate:{scale:1,opacity:1},transition:{duration:.8}}),L.jsxs(Yt.g,{initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.8,ease:"easeOut"},children:[L.jsx("path",{d:"M160 60 H240 C242 60 245 62 245 65 V70 H155 V65 C155 62 158 60 160 60 Z",className:"fill-slate-700 dark:fill-slate-600"}),L.jsx("path",{d:"M155 230 H245 V235 C245 238 242 240 240 240 H160 C158 240 155 238 155 235 V230 Z",className:"fill-slate-700 dark:fill-slate-600"}),L.jsx("path",{d:`M165 70 256 C165 70, 150 100, 192 148 257 L192 152 258 C150 200, 165 230, 165 230 259 H235 260 C235 230, 250 200, 208 152 261 L208 148 262 C250 100, 235 70, 235 70 263 H165 Z`,className:"fill-slate-100/50 stroke-slate-300 stroke-2 dark:fill-slate-800/50 dark:stroke-slate-600",strokeLinejoin:"round"}),L.jsx("path",{d:`M172 225 264 C172 225, 185 195, 200 185 265 C215 195, 228 225, 228 225 266 H172 Z`,className:"fill-amber-400 dark:fill-amber-500"}),L.jsx(Yt.path,{d:"M198 150 L202 150 L200 150 Z",className:"fill-amber-400 dark:fill-amber-500",animate:{d:"M198 150 L202 150 L200 158 Z"}}),L.jsx(Yt.rect,{x:"199",y:"150",width:"2",height:"30",className:"fill-amber-400 dark:fill-amber-500",initial:{scaleY:1,opacity:1},animate:{scaleY:0,opacity:0},transition:{duration:1.5,delay:.5,ease:"linear",repeat:1/0,repeatDelay:3},style:{originY:0}}),L.jsx("path",{d:"M170 80 Q160 110 185 130",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeOpacity:"0.6"}),L.jsx("path",{d:"M230 220 Q240 190 215 170",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeOpacity:"0.6"})]}),L.jsxs(Yt.g,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:200,delay:1},children:[L.jsx("circle",{cx:"260",cy:"100",r:"24",className:"fill-red-50 stroke-red-100 dark:fill-red-900/30 dark:stroke-red-800",strokeWidth:"2"}),L.jsx("text",{x:"260",y:"108",textAnchor:"middle",className:"fill-red-500 font-bold text-2xl font-sans",children:"!"})]}),L.jsx("circle",{cx:"120",cy:"180",r:"4",className:"fill-slate-200 dark:fill-slate-700"}),L.jsx("circle",{cx:"280",cy:"200",r:"6",className:"fill-slate-200 dark:fill-slate-700"}),L.jsx("circle",{cx:"270",cy:"150",r:"3",className:"fill-slate-200 dark:fill-slate-700"})]})})}function N6(){const{t:e}=rt();return L.jsx(Yt.div,{className:le("w-screen h-screen flex justify-center items-center text-ant-text","overflow-hidden"),initial:{opacity:0}
266,animate:{opacity:1},transition:{duration:.5},children:L.jsxs("div",{className:le("bg-white container h-[85%] max-lg:h-full","rounded-[8px] my-[80px] max-lg:my-0 max-lg:p-10","flex justify-center items-center flex-col"),children:[L.jsx("div",{className:"relative top-0 left-0 w-[400px] max-lg:w-[90%] select-none pointer-events-none",children:L.jsx(A6,{})}),L.jsx("span",{className:"font-semibold text-xl mt-[24px]",children:e("payment.sessionInvalid.description")}),L.jsx(Vo,{className:"mt-[36px]"})]})})}function R6(){const{t:e}=rt();fw();const r=a2().sessionParam??"",n=Br(se=>se.currentPaymentType),o=Br(se=>se.setCurrentPaymentType),{showNativeButton:s}=Wr(),[i]=et.useForm(),a=k4(n),[c,l]=h.useState(!1),[f,y]=h.useState(!1),[m,d]=h.useState(!1),[v,b]=h.useState(!1);Bc(se=>{y(se.loading),l(se.loading),["currency","promoCode"].includes(se.from)&&b(se.loading),["taxAddress","paymentMethod"].includes(se.from)||d(se.loading)});const{paymentLoading:S}=jl(),{startRetry:u}=c5(),[C,x]=h.useState(null);function I(se,fe,Ae,Ke){_e(se),Fe(!0),Ce({options:fe,setupCurrency:Ae}),qr.emit("trigger",{type:"done",session:Ke})}const{getStatusAndDoNextAction:N}=F4({onPending(se){I("chanel_pending",se.sessionCurrencyPriceVoList,se.currentOrder.paymentCurrency,se)},onSuccess(se){I("success",se.sessionCurrencyPriceVoList,se.currentOrder.paymentCurrency,se)},async onInvalid(){_e(void 0),A(!0)},onAfterGetSession(se){x(se)}});async function E(se){c2({errMessage:se}),se&&R(se,"common"),N(r)}const{threeDsModalRef:g,threeDsPostModalRef:p}=i5({callback:E}),{exceptionInfo:T,showErrorMessage:R,resetErrorMessage:B}=s5(),{defaultQrcodeRef:P,qrcodeModalRefs:D,cashAppQrcodeRef:U,wechatQrcodeRef:_,pixQrcodeRef:V,upiQrcodeRef:z}=w2(),{handleRedirectOrQrcode:q}=I2({qrcodeModalRefs:D}),G=h.useRef(null),Y=lr(se=>se.setInfo),{setupPixExtraAddress:ee}=y6(),J=h.useRef(""),te=h.useRef(null),Q=h.useRef(null),Z=h.useRef(void 0);async function W(){const se=Ef(64);i2({click_uuid:se});let fe=null;try{B();let Ae="",Ke,Ye=null,Je,st;if(l(!0),b(!0),S(!0),n.includes("_")){const{paymentId:we,paymentType:Ve,rawData:dt}=Yc();if(Ae=we??n,Je=dt?Ve:void 0,st=dt,Je===hr&&um(st?.cvvRequired))try{Ke=(await a.validateFields(["cvv"])).cvv}catch{return}}else{const we=M2.map(Ve=>Ve.value);if(we.push(...D2),n===hr){const Ve=await i.validateFields();Ye=await Ja(),Ae=await W4({cardData:Ve,publicKeyInfo:Ye,customerId:w.customerId}),Ke=Ve.cvv,Je="CARD"}else if(we.includes(n)){const Ve=await G.current?.validateFields();let dt=n,Ct;dt.includes(":")&&([dt,Ct]=dt.split(":"));const St=Ve?.email?.trim();let Bt;te.current?.cardFormData?.cardNumber&&(Ye=await Ja(),Bt=ym({cardData:te.current.cardFormData,publicKeyInfo:Ye,dayjsFormat:"MM/YYYY"}));let At=Xc(Ve??{},["cpfName","cpfNumber","phoneNumber","upiName","email"]);xo(At)&&te.current?.cardFormData&&(At=Xc(te.current.cardFormData,["cardHolder","cardNumber","cvv","expireDate"])),xo(At)&&(At=null),Ae=(await $3({paymentInstrumentType:dt,subPaymentMethodType:Ct,email:St,billingAddressJson:At,cpfName:Ve?.cpfName,cpfNumber:Ve?.cpfNumber,phoneNumber:Ve?.phoneNumber,upiName:Ve?.upiName,encryptedData:Bt,keyName:Ye?.keyName,keyVersion:Ye?.keyVersion})).paymentInstrumentId,Je=dt}else{Na.info("Payment methods not currently supported");return}}if(!wt.getState().currentCheckedCurrency){Na.info("Please select the currency.");return}if(!Je){Na.error("cannot find payment method type of pi");return}Ye||(Ye=await Ja());const Pt=wt.getState().currentCheckedCurrency,Ge=await Y4({paymentInstrumentId:Ae,session:w,publicKeyInfo:Ye,paymentCurrency:Pt,cvv:Ke,currentPaymentMethodType:Je,isRememberPi:ct(),thirdPartSdkToken:te.current?.token,cardNetwork:te.current?.cardNetwork,blikCode:Z.current,rawPaymentInstrumentOption:st});if(Ge){const{channelPaymentResponse:we}=Ge;if(fe=await ko(w.sessionId),x(fe),we.status===sd.SUCCESS)Ls("payment_completed_success",{order_id:fe.currentOrder?.orderId,click_uuid:se}),I("success",fe.sessionCurrencyPriceVoList,fe.currentOrder.paymentCurrency,fe);else if(we&&we.status===sd.CHANEL_PENDING)Ls("payment_completed_pending",{order_id:fe.currentOrder?.orderId,click_uuid:se}),I("chanel_pending",fe.sessionCurrencyPriceVoList,fe.currentOrder.paymentCurrency,fe);else{if(M({data:fe}),we.action&&we.action.type){const{method:Ct,redirectUrl:St,type:Bt}=we.action;if(Ct==="GET"&&St){Qc({payment_method:n,order_id:fe.currentOrder?.orderId,click_uuid:se,action_type:"3ds_get"}),g.current?.open(St);return}if(Ct==="POST"&&St){Qc({payment_method:n,order_id:fe.currentOrder?.orderId,click_uuid:se,action_type:"3ds_post"});const{postData:Vn={}}=we.action;p.current?.open(St,Vn);return}const{paymentExecutionDetailId:At,channelTransactionId:ir}=we,un=Zc();if(Bt==="PAYPAL"&&ir&&Ms(un?.extraProperties))return J.current=At,ir;await q(Ge,{orderId:fe.currentOrder?.orderId,clickUuid:se,paymentMethod:n});return}const Ve=we.message||"Payment failed",dt=sS.includes(Ge.channelPaymentResponse.code)&&n===hr?"card":"common";R(Ve,dt),s2({payment_method:n,message:we.message,order_id:fe.currentOrder?.orderId,click_uuid:se})}}else{Na.info("Payment failed"),R("Payment failed","common");return}}catch(Ae){if(Ae instanceof U2&&Ae.message.startsWith("timeout")){await u(w);return}if(Ae instanceof j2){await N(r);return}if(Ae instanceof Kh){R(e("payment.paymentUnexpectedError"),"common");return}if(Ae instanceof Error){R(Ae.message,"common"),l2({payment_method:n,message:Ae.message,click_uuid:se});const Ke=Zc();if(Ke?.paymentType==="PAYPAL"&&Ms(Ke?.extraProperties))throw Ae}}finally{l(!1),b(!1),S(!1),te.current=null,Z.current=void 0}}function oe(){const{paymentType:se}=Yc();if(se==="BLIK"){Q.current?.open();return}else return W()}const[ie,A]=h.useState(!1),{send:$,loading:O,data:w,update:M}=T2(Pf,{immediate:!1}),{subscriptionInfo:H,setupSubscriptionInfo:F}=a5(),{receiptCardInfo:X,setupReceiptCardInfo:ce}=o5(),ae=Tn(se=>se.setToken),re=Tn(se=>se.setSessionId),{sessionCurrencyList:de,setupDefaultCheckedCurrencyAndOptions:Ce,handleCurrencyChecked:he,currentCheckedCurrency:ye,currencySelectDisabled:De,setCurrencySelectDisabled:Fe,currencyLoading:je}=U4(X),[Le,_e]=h.useState(void 0),{paymentOptionVoList:ze,setPaymentOptionVoList:Ue}=Br(),{beforeCardOptions:be,cardOption:Se,afterCardOptions:Pe}=A2(ze),{rememberPi:$e,rememberPiDisabled:ke,getRememberPi:ct,handleRememberPiChange:at}=r5(w),{dispatch:ft}=Ph(),[yt,ot]=h.useState(""),{setupPromoCode:gt}=X4();n5(se=>{const{session:fe}=se;if(gt(fe),["currency","promoCode","taxAddress","paymentMethod"].includes(se.type)){const Ae=H0(fe);Ae&&o(Ae),Ue(fe.paymentOptionVoList),M({data:{...w,priceDataList:fe.priceDataList??w.priceDataList}})}B()});const{setPendingAutoSubmit:bt}=_4(w,W),xt=nn(se=>se.setPricingSchedule),It=nn(se=>se.setBillingSchedule);Fl(async()=>{const se=r.split("%23")[0];re(se);let fe=null;try{fe=await $(r)}catch(Ge){if(Ge instanceof Bf){A(!0),Ra({session_id:se,page_status:"session_expired"});return}Ge instanceof Error&&(ot(Ge.message),_e("error"),Ra({session_id:se,page_status:"error",message:Ge.message}))}if(!fe)return;ae(fe.tokenValue),re(fe.sessionId),u2(fe);const Ae=fe.sessionContext?.portalRedirectUrl;if(Ae&&Hl(Ae)){d2(),M({loading:!0,data:null}),window.location.replace(Ae);return}await ft(fe),fe.themeConfig&&Hr.getState().setThemeSafely(fe.themeConfig);const Ke=fe.sessionCurrencyPriceVoList;Ce({options:Ke,setupCurrency:fe.currency??fe.originalCurrency});const Ye=l5(fe);Ye&&(i.setFieldValue("country",Ye),Y({country:Ye}));const Je=fe.sessionContext?.initializeCardholder;Je&&(Io.getState().setCardholderName(Je),i.setFieldValue("cardHolder",Je)),Ue(fe.paymentOptionVoList),F(fe),ce(fe),gt(fe),xt(fe.pricingSchedule),It(fe.billingSchedule);const st=H0(fe);st&&o(st),ee(fe,Ye),lr.setState({requiresTaxCalculation:fe.requiresTaxCalculation});const Pt=Oc(fe);_e(Pt),x(fe),["success","chanel_pending"].includes(Pt)?(Ce({options:Ke,setupCurrency:fe.currentOrder.paymentCurrency}),Fe(!0),Ra({order_id:fe.currentOrder?.orderId,page_status:Pt==="success"?"success":"pending"})):Ra({page_status:"ready_to_pay",init_currency:fe.currency??fe.originalCurrency}),Pt==="payment"&&st&&fe.suggestPaymentMethod?.paymentMethod!=="BLIK"&&fe.suggestPaymentMethod?.directPaymentQrCodeSupported&&bt(!0)},[]);const{buttonText:ut}=V4(C),{doPostSession:tt}=ai({onSuccess:()=>B(),onError(se){R(se.message,"common")}});async function We(se){if(B(),o(se),o2(),se===hr){LE(i);const{cardholderName:Ae}=Io.getState();Ae!==void 0&&i.setFieldValue("cardHolder",Ae)}const fe=await tt({from:"paymentMethod"});fe&&qr.emit("trigger",{type:"paymentMethod",session:fe})}const it=h.useRef(null),{sessionStatusLoading:Ee}=Z4({action:se=>N(se,!0),currentPageState:Le}),{currentSubTotalAmount:Ie}=O4(),Oe=Ie&&Ie.total===0||H.isFreeTrial;QE();const ve=Hr(se=>se.cardBorderRadius);if(ie)return L.jsx(N6,{});if(Le==="error"&&yt)return L.jsx(f2,{message:yt});if(O||!w)return L.jsx(iS,{});const Te=JSON.parse(w.content||"{}");return L.jsxs(Yt.div,{className:le("box-border flex justify-center items-center","antialiased text-ant-text"),initial:{opacity:0}
266,animate:{opacity:1},transition:{duration:.5,ease:"easeInOut"},children:[L.jsx(cr,{fullscreen:!0,spinning:Ee,size:"large"}),L.jsxs("div",{className:le("relative rounded-[8px] lg:min-h-[600px] flex max-lg:flex-col","lg:mt-[48px] max-lg:m-0 max-lg:p-[20px]","payment-container flex lg:justify-between max-lg:w-full"),children:[L.jsxs("div",{className:le("flex flex-col","lg:min-h-[calc(100vh-100px)]","lg:w-[380px]"),children:[L.jsx(S6,{session:w,sessionContext:Te,receiptCardInfo:X,mobileDetailRef:it,currentCheckedCurrency:ye}),L.jsxs("div",{className:le("max-lg:hidden flex justify-center flex-col","mt-[10px]"),children:[w.remotePriceSnapshotVo?.priceType!==gr&&L.jsx(rf,{className:"mt-[24px]",sessionCurrencyList:de,currencySelectDisabled:De,disabled:De,value:ye,options:de,onChecked:he,loading:je}),w.remotePriceSnapshotVo?.priceType===gr&&L.jsx(w6,{session:w,subscriptionInfo:H,disabled:De,value:ye,options:de,onChecked:he,loading:je}),L.jsx("div",{className:le("mt-[32px]"),children:L.jsx(vm,{receiptCardInfo:X,session:w,currentCheckedCurrency:ye})})]}),L.jsx("div",{className:"lg:hidden block mt-[42px]"}),L.jsx(I6,{session:w,subscriptionInfo:H,onDetailClick:()=>{it.current?.open?.(),setTimeout(()=>{wn.emit("focus")})},sessionCurrencyOptions:de}),w.remotePriceSnapshotVo?.priceType!==gr&&L.jsx(rf,{className:"mt-10 max-lg:mt-0 lg:hidden",sessionCurrencyList:de,currencySelectDisabled:De,disabled:De,value:ye,options:de,onChecked:he,loading:je})]}),L.jsxs("div",{className:"lg:w-[380px] payment-right-section",children:[Le==="payment"&&L.jsxs("div",{className:le("flex flex-col flex-1","max-lg:pb-[160px]"),style:{borderRadius:`${ve}px`},children:[L.jsxs("div",{className:"flex items-center justify-between",children:[L.jsx("div",{className:"max-lg:hidden font-medium text-ant-lg leading-[20px] text-ant-text",children:e("payment.paymentInformation")}),L.jsx(Y3,{className:"max-lg:hidden"})]}),L.jsx("div",{className:le("flex flex-col","lg:mt-[24px]"),children:L.jsxs("div",{children:[w?.customerVo?.email&&L.jsx(et.Item,{layout:"vertical",label:e("payment.emailAddress"),children:L.jsx(Dt,{size:"large",defaultValue:w?.customerVo?.email,disabled:!0})}),L.jsx(et.Item,{layout:"vertical",label:e("payment.paymentMethod"),children:L.jsx(cr,{spinning:!1,children:L.jsx("div",{className:"flex flex-col payment-method-card overflow-hidden",style:{borderRadius:`${ve}px`,boxShadow:"0 0 0 1px #e0e0e0,0 2px 4px 0 rgba(0,0,0,0.07),0 1px 1.5px 0 rgba(0,0,0,0.05)",background:"var(--components-background)"},children:L.jsx("div",{children:L.jsxs(Bh.Provider,{value:G,children:[L.jsx(D0,{disabled:v,selectType:n,paymentOptions:be,onSelectChange:We,taxFormDisabled:m,showFirstDivider:!1}),Se&&L.jsxs("div",{className:le({"border-t border-ant-border-secondary":be.length>0}),children:[L.jsx(i4,{disabled:v,cvvForm:a,paymentOptions:[Se],selectType:n,onSelectChange:We}),L.jsx("div",{className:"py-3 px-[16px]",children:L.jsx(Ir,{disabled:v,checked:n===hr,onChange:()=>We(hr),className:"flex items-center",children:L.jsxs("div",{className:le("text-ant-text flex items-center","gap-1 ml-[1px] font-medium"),children:[L.jsx("div",{className:le("flex justify-center items-center","w-[42px]"),children:L.jsx("img",{src:pl,className:"w-[32px] h-[20px] pointer-events-none box-border"})}),L.jsx("span",{className:le({"text-ant-text-disabled":v}),children:e("payment.addNewCard")})]})})}),L.jsx("div",{className:le("grid transition-[grid-template-rows] ease-in-out duration-300",n===hr?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:L.jsx("div",{className:"payment-form-container overflow-hidden min-h-0",children:L.jsx(Ww,{exceptionInfo:T,className:"px-4",form:i,addressDisabled:m})})})]}),L.jsx(D0,{disabled:v,selectType:n,paymentOptions:Pe,onSelectChange:We,taxFormDisabled:m})]})})})})})]})}),L.jsx(T6,{className:le("mb-6"),session:w,checked:$e,onCheckChange:at,disabled:ke||c}),T.show&&T.type==="common"&&L.jsx(ql,{style:{animation:"animation-shake .5s","--ant-color-text-heading":"var(--ant-color-highlight)"},className:"mb-4",title:T.message,type:"error",showIcon:!0}),s&&L.jsx("div",{className:"flex justify-center items-center",children:L.jsx($4,{children:L.jsx(Or,{style:{"--ant-control-height-lg":"45px"},block:!0,type:"primary",size:"large",loading:c,disabled:f,onClick:oe,children:ut})})}),L.jsx(d6,{disabled:f,isZeroPayment:!!Oe,handleSubmit:W,currentPedId:J,onSuccess:()=>N(r),onError:se=>R(se,"common")},Ie?.total),L.jsx(K5,{disabled:f,isSubscriptionFreeTrail:H.isFreeTrial,beforeS
266DKEvent:async()=>await G.current?.validateFields(),onSuccess:se=>{te.current=se,W()}}),L.jsx(W5,{disabled:f,isSubscriptionFreeTrail:H.isFreeTrial,beforeSDKEvent:async()=>await G.current?.validateFields(),onSuccess:async se=>{te.current=se,await W()},onError:se=>R(se.message,"common")}),L.jsx(E5,{disabled:f,isSubscriptionFreeTrail:H.isFreeTrial,beforeSDKEvent:async()=>await G.current?.validateFields(),onSuccess:async se=>{te.current=se,await W()},onAirwallexAuthorizedSuccess:()=>N(r,!1),onError:se=>R(se.message,"common")}),L.jsx(aS,{className:"mt-6"}),L.jsx(Vo,{})]}),Le==="success"&&C&&L.jsx(RE,{session:C}),Le==="chanel_pending"&&C&&L.jsx(wE,{session:C,onPaymentSuccessDetected:()=>N(C.sessionId,!0)}),L.jsx("div",{className:"lg:h-[48px]"})]})]}),L.jsx(PE,{ref:g,onCancel:E}),L.jsx(BE,{ref:p,onCancel:E}),L.jsx(w5,{ref:Q,loading:c,onConfirm:se=>(Z.current=se,W())}),L.jsx(N2,{ref:U,onComplete:()=>N(r,!0)}),L.jsx(R2,{ref:_,onComplete:()=>N(r,!0)}),L.jsx(P2,{ref:V,onComplete:()=>N(r,!0)}),L.jsx(B2,{ref:z,onComplete:()=>N(r,!0)}),L.jsx(L2,{ref:P,onComplete:()=>N(r,!0)})]})}const V6=m6(R6);export{R6 as PaymentPage,V6 as default}; 267 268//# chunkId=0092a68e-bb60-53cf-97ef-8e792cfb1d81
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.