Files
Sub-Store/sub-store-0.min.js
github-actions[bot] 0fe9da6e02 release: 2.20.2
2025-08-08 04:46:50 +00:00

1170 lines
931 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var iy=Object.create;var Og=Object.defineProperty;var sy=Object.getOwnPropertyDescriptor;var uy=Object.getOwnPropertyNames;var ay=Object.getPrototypeOf,oy=Object.prototype.hasOwnProperty;var Da=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cy=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of uy(t))!oy.call(e,s)&&s!==r&&Og(e,s,{get:()=>t[s],enumerable:!(n=sy(t,s))||n.enumerable});return e};var On=(e,t,r)=>(r=e!=null?iy(ay(e)):{},cy(t||!e||!e.__esModule?Og(r,"default",{value:e,enumerable:!0}):r,e));var K0=Be(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.isCorrect=Co.isInSubnet=void 0;function $y(e){return this.subnetMask<e.subnetMask?!1:this.mask(e.subnetMask)===e.mask()}Co.isInSubnet=$y;function Py(e){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}Co.isCorrect=Py});var V0=Be(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.RE_SUBNET_STRING=vs.RE_ADDRESS=vs.GROUPS=vs.BITS=void 0;vs.BITS=32;vs.GROUPS=4;vs.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;vs.RE_SUBNET_STRING=/\/\d{1,2}$/});var of=Be(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.AddressError=void 0;var G0=class extends Error{constructor(t,r){super(t),this.name="AddressError",r!==null&&(this.parseMessage=r)}};af.AddressError=G0});var z0=Be((cf,sm)=>{(function(){var e,t=0xdeadbeefcafe,r=(t&16777215)==15715070;function n(R,O,H){R!=null&&(typeof R=="number"?this.fromNumber(R,O,H):O==null&&typeof R!="string"?this.fromString(R,256):this.fromString(R,O))}function s(){return new n(null)}function u(R,O,H,Q,ve,we){for(;--we>=0;){var $e=O*this[R++]+H[Q]+ve;ve=Math.floor($e/67108864),H[Q++]=$e&67108863}return ve}function i(R,O,H,Q,ve,we){for(var $e=O&32767,Oe=O>>15;--we>=0;){var zt=this[R]&32767,Er=this[R++]>>15,sn=Oe*zt+Er*$e;zt=$e*zt+((sn&32767)<<15)+H[Q]+(ve&1073741823),ve=(zt>>>30)+(sn>>>15)+Oe*Er+(ve>>>30),H[Q++]=zt&1073741823}return ve}function o(R,O,H,Q,ve,we){for(var $e=O&16383,Oe=O>>14;--we>=0;){var zt=this[R]&16383,Er=this[R++]>>14,sn=Oe*zt+Er*$e;zt=$e*zt+((sn&16383)<<14)+H[Q]+ve,ve=(zt>>28)+(sn>>14)+Oe*Er,H[Q++]=zt&268435455}return ve}var l=typeof navigator<"u";l&&r&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=i,e=30):l&&r&&navigator.appName!="Netscape"?(n.prototype.am=u,e=26):(n.prototype.am=o,e=28),n.prototype.DB=e,n.prototype.DM=(1<<e)-1,n.prototype.DV=1<<e;var f=52;n.prototype.FV=Math.pow(2,f),n.prototype.F1=f-e,n.prototype.F2=2*e-f;var d="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array,p,h;for(p=48,h=0;h<=9;++h)E[p++]=h;for(p=97,h=10;h<36;++h)E[p++]=h;for(p=65,h=10;h<36;++h)E[p++]=h;function w(R){return d.charAt(R)}function v(R,O){var H=E[R.charCodeAt(O)];return H??-1}function D(R){for(var O=this.t-1;O>=0;--O)R[O]=this[O];R.t=this.t,R.s=this.s}function A(R){this.t=1,this.s=R<0?-1:0,R>0?this[0]=R:R<-1?this[0]=R+this.DV:this.t=0}function F(R){var O=s();return O.fromInt(R),O}function S(R,O){var H;if(O==16)H=4;else if(O==8)H=3;else if(O==256)H=8;else if(O==2)H=1;else if(O==32)H=5;else if(O==4)H=2;else{this.fromRadix(R,O);return}this.t=0,this.s=0;for(var Q=R.length,ve=!1,we=0;--Q>=0;){var $e=H==8?R[Q]&255:v(R,Q);if($e<0){R.charAt(Q)=="-"&&(ve=!0);continue}ve=!1,we==0?this[this.t++]=$e:we+H>this.DB?(this[this.t-1]|=($e&(1<<this.DB-we)-1)<<we,this[this.t++]=$e>>this.DB-we):this[this.t-1]|=$e<<we,we+=H,we>=this.DB&&(we-=this.DB)}H==8&&R[0]&128&&(this.s=-1,we>0&&(this[this.t-1]|=(1<<this.DB-we)-1<<we)),this.clamp(),ve&&n.ZERO.subTo(this,this)}function B(){for(var R=this.s&this.DM;this.t>0&&this[this.t-1]==R;)--this.t}function _(R){if(this.s<0)return"-"+this.negate().toString(R);var O;if(R==16)O=4;else if(R==8)O=3;else if(R==2)O=1;else if(R==32)O=5;else if(R==4)O=2;else return this.toRadix(R);var H=(1<<O)-1,Q,ve=!1,we="",$e=this.t,Oe=this.DB-$e*this.DB%O;if($e-- >0)for(Oe<this.DB&&(Q=this[$e]>>Oe)>0&&(ve=!0,we=w(Q));$e>=0;)Oe<O?(Q=(this[$e]&(1<<Oe)-1)<<O-Oe,Q|=this[--$e]>>(Oe+=this.DB-O)):(Q=this[$e]>>(Oe-=O)&H,Oe<=0&&(Oe+=this.DB,--$e)),Q>0&&(ve=!0),ve&&(we+=w(Q));return ve?we:"0"}function K(){var R=s();return n.ZERO.subTo(this,R),R}function G(){return this.s<0?this.negate():this}function b(R){var O=this.s-R.s;if(O!=0)return O;var H=this.t;if(O=H-R.t,O!=0)return this.s<0?-O:O;for(;--H>=0;)if((O=this[H]-R[H])!=0)return O;return 0}function P(R){var O=1,H;return(H=R>>>16)!=0&&(R=H,O+=16),(H=R>>8)!=0&&(R=H,O+=8),(H=R>>4)!=0&&(R=H,O+=4),(H=R>>2)!=0&&(R=H,O+=2),(H=R>>1)!=0&&(R=H,O+=1),O}function L(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)}function j(R,O){var H;for(H=this.t-1;H>=0;--H)O[H+R]=this[H];for(H=R-1;H>=0;--H)O[H]=0;O.t=this.t+R,O.s=this.s}function V(R,O){for(var H=R;H<this.t;++H)O[H-R]=this[H];O.t=Math.max(this.t-R,0),O.s=this.s}function W(R,O){var H=R%this.DB,Q=this.DB-H,ve=(1<<Q)-1,we=Math.floor(R/this.DB),$e=this.s<<H&this.DM,Oe;for(Oe=this.t-1;Oe>=0;--Oe)O[Oe+we+1]=this[Oe]>>Q|$e,$e=(this[Oe]&ve)<<H;for(Oe=we-1;Oe>=0;--Oe)O[Oe]=0;O[we]=$e,O.t=this.t+we+1,O.s=this.s,O.clamp()}function q(R,O){O.s=this.s;var H=Math.floor(R/this.DB);if(H>=this.t){O.t=0;return}var Q=R%this.DB,ve=this.DB-Q,we=(1<<Q)-1;O[0]=this[H]>>Q;for(var $e=H+1;$e<this.t;++$e)O[$e-H-1]|=(this[$e]&we)<<ve,O[$e-H]=this[$e]>>Q;Q>0&&(O[this.t-H-1]|=(this.s&we)<<ve),O.t=this.t-H,O.clamp()}function z(R,O){for(var H=0,Q=0,ve=Math.min(R.t,this.t);H<ve;)Q+=this[H]-R[H],O[H++]=Q&this.DM,Q>>=this.DB;if(R.t<this.t){for(Q-=R.s;H<this.t;)Q+=this[H],O[H++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{for(Q+=this.s;H<R.t;)Q-=R[H],O[H++]=Q&this.DM,Q>>=this.DB;Q-=R.s}O.s=Q<0?-1:0,Q<-1?O[H++]=this.DV+Q:Q>0&&(O[H++]=Q),O.t=H,O.clamp()}function J(R,O){var H=this.abs(),Q=R.abs(),ve=H.t;for(O.t=ve+Q.t;--ve>=0;)O[ve]=0;for(ve=0;ve<Q.t;++ve)O[ve+H.t]=H.am(0,Q[ve],O,ve,0,H.t);O.s=0,O.clamp(),this.s!=R.s&&n.ZERO.subTo(O,O)}function se(R){for(var O=this.abs(),H=R.t=2*O.t;--H>=0;)R[H]=0;for(H=0;H<O.t-1;++H){var Q=O.am(H,O[H],R,2*H,0,1);(R[H+O.t]+=O.am(H+1,2*O[H],R,2*H+1,Q,O.t-H-1))>=O.DV&&(R[H+O.t]-=O.DV,R[H+O.t+1]=1)}R.t>0&&(R[R.t-1]+=O.am(H,O[H],R,2*H,0,1)),R.s=0,R.clamp()}function ye(R,O,H){var Q=R.abs();if(!(Q.t<=0)){var ve=this.abs();if(ve.t<Q.t){O?.fromInt(0),H!=null&&this.copyTo(H);return}H==null&&(H=s());var we=s(),$e=this.s,Oe=R.s,zt=this.DB-P(Q[Q.t-1]);zt>0?(Q.lShiftTo(zt,we),ve.lShiftTo(zt,H)):(Q.copyTo(we),ve.copyTo(H));var Er=we.t,sn=we[Er-1];if(sn!=0){var un=sn*(1<<this.F1)+(Er>1?we[Er-2]>>this.F2:0),ai=this.FV/un,Pu=(1<<this.F1)/un,In=1<<this.F2,an=H.t,Ru=an-Er,Bi=O??s();for(we.dlShiftTo(Ru,Bi),H.compareTo(Bi)>=0&&(H[H.t++]=1,H.subTo(Bi,H)),n.ONE.dlShiftTo(Er,Bi),Bi.subTo(we,we);we.t<Er;)we[we.t++]=0;for(;--Ru>=0;){var ha=H[--an]==sn?this.DM:Math.floor(H[an]*ai+(H[an-1]+In)*Pu);if((H[an]+=we.am(0,ha,H,Ru,0,Er))<ha)for(we.dlShiftTo(Ru,Bi),H.subTo(Bi,H);H[an]<--ha;)H.subTo(Bi,H)}O!=null&&(H.drShiftTo(Er,O),$e!=Oe&&n.ZERO.subTo(O,O)),H.t=Er,H.clamp(),zt>0&&H.rShiftTo(zt,H),$e<0&&n.ZERO.subTo(H,H)}}}function Ce(R){var O=s();return this.abs().divRemTo(R,null,O),this.s<0&&O.compareTo(n.ZERO)>0&&R.subTo(O,O),O}function Pe(R){this.m=R}function Xe(R){return R.s<0||R.compareTo(this.m)>=0?R.mod(this.m):R}function ce(R){return R}function Ie(R){R.divRemTo(this.m,null,R)}function Me(R,O,H){R.multiplyTo(O,H),this.reduce(H)}function _r(R,O){R.squareTo(O),this.reduce(O)}Pe.prototype.convert=Xe,Pe.prototype.revert=ce,Pe.prototype.reduce=Ie,Pe.prototype.mulTo=Me,Pe.prototype.sqrTo=_r;function Kt(){if(this.t<1)return 0;var R=this[0];if(!(R&1))return 0;var O=R&3;return O=O*(2-(R&15)*O)&15,O=O*(2-(R&255)*O)&255,O=O*(2-((R&65535)*O&65535))&65535,O=O*(2-R*O%this.DV)%this.DV,O>0?this.DV-O:-O}function Ft(R){this.m=R,this.mp=R.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<R.DB-15)-1,this.mt2=2*R.t}function gr(R){var O=s();return R.abs().dlShiftTo(this.m.t,O),O.divRemTo(this.m,null,O),R.s<0&&O.compareTo(n.ZERO)>0&&this.m.subTo(O,O),O}function nr(R){var O=s();return R.copyTo(O),this.reduce(O),O}function ht(R){for(;R.t<=this.mt2;)R[R.t++]=0;for(var O=0;O<this.m.t;++O){var H=R[O]&32767,Q=H*this.mpl+((H*this.mph+(R[O]>>15)*this.mpl&this.um)<<15)&R.DM;for(H=O+this.m.t,R[H]+=this.m.am(0,Q,R,O,0,this.m.t);R[H]>=R.DV;)R[H]-=R.DV,R[++H]++}R.clamp(),R.drShiftTo(this.m.t,R),R.compareTo(this.m)>=0&&R.subTo(this.m,R)}function Vt(R,O){R.squareTo(O),this.reduce(O)}function st(R,O,H){R.multiplyTo(O,H),this.reduce(H)}Ft.prototype.convert=gr,Ft.prototype.revert=nr,Ft.prototype.reduce=ht,Ft.prototype.mulTo=st,Ft.prototype.sqrTo=Vt;function ze(){return(this.t>0?this[0]&1:this.s)==0}function ir(R,O){if(R>4294967295||R<1)return n.ONE;var H=s(),Q=s(),ve=O.convert(this),we=P(R)-1;for(ve.copyTo(H);--we>=0;)if(O.sqrTo(H,Q),(R&1<<we)>0)O.mulTo(Q,ve,H);else{var $e=H;H=Q,Q=$e}return O.revert(H)}function je(R,O){var H;return R<256||O.isEven()?H=new Pe(O):H=new Ft(O),this.exp(R,H)}n.prototype.copyTo=D,n.prototype.fromInt=A,n.prototype.fromString=S,n.prototype.clamp=B,n.prototype.dlShiftTo=j,n.prototype.drShiftTo=V,n.prototype.lShiftTo=W,n.prototype.rShiftTo=q,n.prototype.subTo=z,n.prototype.multiplyTo=J,n.prototype.squareTo=se,n.prototype.divRemTo=ye,n.prototype.invDigit=Kt,n.prototype.isEven=ze,n.prototype.exp=ir,n.prototype.toString=_,n.prototype.negate=K,n.prototype.abs=G,n.prototype.compareTo=b,n.prototype.bitLength=L,n.prototype.mod=Ce,n.prototype.modPowInt=je,n.ZERO=F(0),n.ONE=F(1);function Tt(){var R=s();return this.copyTo(R),R}function Zr(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Zt(){return this.t==0?this.s:this[0]<<24>>24}function Gt(){return this.t==0?this.s:this[0]<<16>>16}function mt(R){return Math.floor(Math.LN2*this.DB/Math.log(R))}function Br(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function ui(R){if(R==null&&(R=10),this.signum()==0||R<2||R>36)return"0";var O=this.chunkSize(R),H=Math.pow(R,O),Q=F(H),ve=s(),we=s(),$e="";for(this.divRemTo(Q,ve,we);ve.signum()>0;)$e=(H+we.intValue()).toString(R).substr(1)+$e,ve.divRemTo(Q,ve,we);return we.intValue().toString(R)+$e}function Qr(R,O){this.fromInt(0),O==null&&(O=10);for(var H=this.chunkSize(O),Q=Math.pow(O,H),ve=!1,we=0,$e=0,Oe=0;Oe<R.length;++Oe){var zt=v(R,Oe);if(zt<0){R.charAt(Oe)=="-"&&this.signum()==0&&(ve=!0);continue}$e=O*$e+zt,++we>=H&&(this.dMultiply(Q),this.dAddOffset($e,0),we=0,$e=0)}we>0&&(this.dMultiply(Math.pow(O,we)),this.dAddOffset($e,0)),ve&&n.ZERO.subTo(this,this)}function Dt(R,O,H){if(typeof O=="number")if(R<2)this.fromInt(1);else for(this.fromNumber(R,H),this.testBit(R-1)||this.bitwiseTo(n.ONE.shiftLeft(R-1),ge,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(O);)this.dAddOffset(2,0),this.bitLength()>R&&this.subTo(n.ONE.shiftLeft(R-1),this);else{var Q=new Array,ve=R&7;Q.length=(R>>3)+1,O.nextBytes(Q),ve>0?Q[0]&=(1<<ve)-1:Q[0]=0,this.fromString(Q,256)}}function Ue(){var R=this.t,O=new Array;O[0]=this.s;var H=this.DB-R*this.DB%8,Q,ve=0;if(R-- >0)for(H<this.DB&&(Q=this[R]>>H)!=(this.s&this.DM)>>H&&(O[ve++]=Q|this.s<<this.DB-H);R>=0;)H<8?(Q=(this[R]&(1<<H)-1)<<8-H,Q|=this[--R]>>(H+=this.DB-8)):(Q=this[R]>>(H-=8)&255,H<=0&&(H+=this.DB,--R)),Q&128&&(Q|=-256),ve==0&&(this.s&128)!=(Q&128)&&++ve,(ve>0||Q!=this.s)&&(O[ve++]=Q);return O}function be(R){return this.compareTo(R)==0}function mr(R){return this.compareTo(R)<0?this:R}function en(R){return this.compareTo(R)>0?this:R}function ut(R,O,H){var Q,ve,we=Math.min(R.t,this.t);for(Q=0;Q<we;++Q)H[Q]=O(this[Q],R[Q]);if(R.t<this.t){for(ve=R.s&this.DM,Q=we;Q<this.t;++Q)H[Q]=O(this[Q],ve);H.t=this.t}else{for(ve=this.s&this.DM,Q=we;Q<R.t;++Q)H[Q]=O(ve,R[Q]);H.t=R.t}H.s=O(this.s,R.s),H.clamp()}function Us(R,O){return R&O}function tn(R){var O=s();return this.bitwiseTo(R,Us,O),O}function ge(R,O){return R|O}function ns(R){var O=s();return this.bitwiseTo(R,ge,O),O}function _t(R,O){return R^O}function qr(R){var O=s();return this.bitwiseTo(R,_t,O),O}function Vi(R,O){return R&~O}function bu(R){var O=s();return this.bitwiseTo(R,Vi,O),O}function is(){for(var R=s(),O=0;O<this.t;++O)R[O]=this.DM&~this[O];return R.t=this.t,R.s=~this.s,R}function _u(R){var O=s();return R<0?this.rShiftTo(-R,O):this.lShiftTo(R,O),O}function ss(R){var O=s();return R<0?this.lShiftTo(-R,O):this.rShiftTo(R,O),O}function Gi(R){if(R==0)return-1;var O=0;return R&65535||(R>>=16,O+=16),R&255||(R>>=8,O+=8),R&15||(R>>=4,O+=4),R&3||(R>>=2,O+=2),R&1||++O,O}function xt(){for(var R=0;R<this.t;++R)if(this[R]!=0)return R*this.DB+Gi(this[R]);return this.s<0?this.t*this.DB:-1}function Hn(R){for(var O=0;R!=0;)R&=R-1,++O;return O}function Bu(){for(var R=0,O=this.s&this.DM,H=0;H<this.t;++H)R+=Hn(this[H]^O);return R}function Iu(R){var O=Math.floor(R/this.DB);return O>=this.t?this.s!=0:(this[O]&1<<R%this.DB)!=0}function $u(R,O){var H=n.ONE.shiftLeft(R);return this.bitwiseTo(H,O,H),H}function us(R){return this.changeBit(R,ge)}function ra(R){return this.changeBit(R,Vi)}function as(R){return this.changeBit(R,_t)}function na(R,O){for(var H=0,Q=0,ve=Math.min(R.t,this.t);H<ve;)Q+=this[H]+R[H],O[H++]=Q&this.DM,Q>>=this.DB;if(R.t<this.t){for(Q+=R.s;H<this.t;)Q+=this[H],O[H++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{for(Q+=this.s;H<R.t;)Q+=R[H],O[H++]=Q&this.DM,Q>>=this.DB;Q+=R.s}O.s=Q<0?-1:0,Q>0?O[H++]=Q:Q<-1&&(O[H++]=this.DV+Q),O.t=H,O.clamp()}function Hs(R){var O=s();return this.addTo(R,O),O}function re(R){var O=s();return this.subTo(R,O),O}function fe(R){var O=s();return this.multiplyTo(R,O),O}function Le(){var R=s();return this.squareTo(R),R}function ke(R){var O=s();return this.divRemTo(R,O,null),O}function Ve(R){var O=s();return this.divRemTo(R,null,O),O}function at(R){var O=s(),H=s();return this.divRemTo(R,O,H),new Array(O,H)}function lt(R){this[this.t]=this.am(0,R-1,this,0,0,this.t),++this.t,this.clamp()}function yr(R,O){if(R!=0){for(;this.t<=O;)this[this.t++]=0;for(this[O]+=R;this[O]>=this.DV;)this[O]-=this.DV,++O>=this.t&&(this[this.t++]=0),++this[O]}}function Ut(){}function jn(R){return R}function _i(R,O,H){R.multiplyTo(O,H)}function rn(R,O){R.squareTo(O)}Ut.prototype.convert=jn,Ut.prototype.revert=jn,Ut.prototype.mulTo=_i,Ut.prototype.sqrTo=rn;function pn(R){return this.exp(R,new Ut)}function vr(R,O,H){var Q=Math.min(this.t+R.t,O);for(H.s=0,H.t=Q;Q>0;)H[--Q]=0;var ve;for(ve=H.t-this.t;Q<ve;++Q)H[Q+this.t]=this.am(0,R[Q],H,Q,0,this.t);for(ve=Math.min(R.t,O);Q<ve;++Q)this.am(0,R[Q],H,Q,0,O-Q);H.clamp()}function nn(R,O,H){--O;var Q=H.t=this.t+R.t-O;for(H.s=0;--Q>=0;)H[Q]=0;for(Q=Math.max(O-this.t,0);Q<R.t;++Q)H[this.t+Q-O]=this.am(O-Q,R[Q],H,0,0,this.t+Q-O);H.clamp(),H.drShiftTo(1,H)}function kr(R){this.r2=s(),this.q3=s(),n.ONE.dlShiftTo(2*R.t,this.r2),this.mu=this.r2.divide(R),this.m=R}function ia(R){if(R.s<0||R.t>2*this.m.t)return R.mod(this.m);if(R.compareTo(this.m)<0)return R;var O=s();return R.copyTo(O),this.reduce(O),O}function os(R){return R}function Sn(R){for(R.drShiftTo(this.m.t-1,this.r2),R.t>this.m.t+1&&(R.t=this.m.t+1,R.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);R.compareTo(this.r2)<0;)R.dAddOffset(1,this.m.t+1);for(R.subTo(this.r2,R);R.compareTo(this.m)>=0;)R.subTo(this.m,R)}function Pt(R,O){R.squareTo(O),this.reduce(O)}function Ar(R,O,H){R.multiplyTo(O,H),this.reduce(H)}kr.prototype.convert=ia,kr.prototype.revert=os,kr.prototype.reduce=Sn,kr.prototype.mulTo=Ar,kr.prototype.sqrTo=Pt;function rt(R,O){var H=R.bitLength(),Q,ve=F(1),we;if(H<=0)return ve;H<18?Q=1:H<48?Q=3:H<144?Q=4:H<768?Q=5:Q=6,H<8?we=new Pe(O):O.isEven()?we=new kr(O):we=new Ft(O);var $e=new Array,Oe=3,zt=Q-1,Er=(1<<Q)-1;if($e[1]=we.convert(this),Q>1){var sn=s();for(we.sqrTo($e[1],sn);Oe<=Er;)$e[Oe]=s(),we.mulTo(sn,$e[Oe-2],$e[Oe]),Oe+=2}var un=R.t-1,ai,Pu=!0,In=s(),an;for(H=P(R[un])-1;un>=0;){for(H>=zt?ai=R[un]>>H-zt&Er:(ai=(R[un]&(1<<H+1)-1)<<zt-H,un>0&&(ai|=R[un-1]>>this.DB+H-zt)),Oe=Q;!(ai&1);)ai>>=1,--Oe;if((H-=Oe)<0&&(H+=this.DB,--un),Pu)$e[ai].copyTo(ve),Pu=!1;else{for(;Oe>1;)we.sqrTo(ve,In),we.sqrTo(In,ve),Oe-=2;Oe>0?we.sqrTo(ve,In):(an=ve,ve=In,In=an),we.mulTo(In,$e[ai],ve)}for(;un>=0&&!(R[un]&1<<H);)we.sqrTo(ve,In),an=ve,ve=In,In=an,--H<0&&(H=this.DB-1,--un)}return we.revert(ve)}function sr(R){var O=this.s<0?this.negate():this.clone(),H=R.s<0?R.negate():R.clone();if(O.compareTo(H)<0){var Q=O;O=H,H=Q}var ve=O.getLowestSetBit(),we=H.getLowestSetBit();if(we<0)return O;for(ve<we&&(we=ve),we>0&&(O.rShiftTo(we,O),H.rShiftTo(we,H));O.signum()>0;)(ve=O.getLowestSetBit())>0&&O.rShiftTo(ve,O),(ve=H.getLowestSetBit())>0&&H.rShiftTo(ve,H),O.compareTo(H)>=0?(O.subTo(H,O),O.rShiftTo(1,O)):(H.subTo(O,H),H.rShiftTo(1,H));return we>0&&H.lShiftTo(we,H),H}function Kr(R){if(R<=0)return 0;var O=this.DV%R,H=this.s<0?R-1:0;if(this.t>0)if(O==0)H=this[0]%R;else for(var Q=this.t-1;Q>=0;--Q)H=(O*H+this[Q])%R;return H}function ur(R){var O=R.isEven();if(this.isEven()&&O||R.signum()==0)return n.ZERO;for(var H=R.clone(),Q=this.clone(),ve=F(1),we=F(0),$e=F(0),Oe=F(1);H.signum()!=0;){for(;H.isEven();)H.rShiftTo(1,H),O?((!ve.isEven()||!we.isEven())&&(ve.addTo(this,ve),we.subTo(R,we)),ve.rShiftTo(1,ve)):we.isEven()||we.subTo(R,we),we.rShiftTo(1,we);for(;Q.isEven();)Q.rShiftTo(1,Q),O?((!$e.isEven()||!Oe.isEven())&&($e.addTo(this,$e),Oe.subTo(R,Oe)),$e.rShiftTo(1,$e)):Oe.isEven()||Oe.subTo(R,Oe),Oe.rShiftTo(1,Oe);H.compareTo(Q)>=0?(H.subTo(Q,H),O&&ve.subTo($e,ve),we.subTo(Oe,we)):(Q.subTo(H,Q),O&&$e.subTo(ve,$e),Oe.subTo(we,Oe))}if(Q.compareTo(n.ONE)!=0)return n.ZERO;if(Oe.compareTo(R)>=0)return Oe.subtract(R);if(Oe.signum()<0)Oe.addTo(R,Oe);else return Oe;return Oe.signum()<0?Oe.add(R):Oe}var Ht=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],bn=(1<<26)/Ht[Ht.length-1];function Mn(R){var O,H=this.abs();if(H.t==1&&H[0]<=Ht[Ht.length-1]){for(O=0;O<Ht.length;++O)if(H[0]==Ht[O])return!0;return!1}if(H.isEven())return!1;for(O=1;O<Ht.length;){for(var Q=Ht[O],ve=O+1;ve<Ht.length&&Q<bn;)Q*=Ht[ve++];for(Q=H.modInt(Q);O<ve;)if(Q%Ht[O++]==0)return!1}return H.millerRabin(R)}function qn(R){var O=this.subtract(n.ONE),H=O.getLowestSetBit();if(H<=0)return!1;var Q=O.shiftRight(H);R=R+1>>1,R>Ht.length&&(R=Ht.length);for(var ve=s(),we=0;we<R;++we){ve.fromInt(Ht[Math.floor(Math.random()*Ht.length)]);var $e=ve.modPow(Q,this);if($e.compareTo(n.ONE)!=0&&$e.compareTo(O)!=0){for(var Oe=1;Oe++<H&&$e.compareTo(O)!=0;)if($e=$e.modPowInt(2,this),$e.compareTo(n.ONE)==0)return!1;if($e.compareTo(O)!=0)return!1}}return!0}n.prototype.chunkSize=mt,n.prototype.toRadix=ui,n.prototype.fromRadix=Qr,n.prototype.fromNumber=Dt,n.prototype.bitwiseTo=ut,n.prototype.changeBit=$u,n.prototype.addTo=na,n.prototype.dMultiply=lt,n.prototype.dAddOffset=yr,n.prototype.multiplyLowerTo=vr,n.prototype.multiplyUpperTo=nn,n.prototype.modInt=Kr,n.prototype.millerRabin=qn,n.prototype.clone=Tt,n.prototype.intValue=Zr,n.prototype.byteValue=Zt,n.prototype.shortValue=Gt,n.prototype.signum=Br,n.prototype.toByteArray=Ue,n.prototype.equals=be,n.prototype.min=mr,n.prototype.max=en,n.prototype.and=tn,n.prototype.or=ns,n.prototype.xor=qr,n.prototype.andNot=bu,n.prototype.not=is,n.prototype.shiftLeft=_u,n.prototype.shiftRight=ss,n.prototype.getLowestSetBit=xt,n.prototype.bitCount=Bu,n.prototype.testBit=Iu,n.prototype.setBit=us,n.prototype.clearBit=ra,n.prototype.flipBit=as,n.prototype.add=Hs,n.prototype.subtract=re,n.prototype.multiply=fe,n.prototype.divide=ke,n.prototype.remainder=Ve,n.prototype.divideAndRemainder=at,n.prototype.modPow=rt,n.prototype.modInverse=ur,n.prototype.pow=pn,n.prototype.gcd=sr,n.prototype.isProbablePrime=Mn,n.prototype.square=Le,n.prototype.Barrett=kr;var _n,Ir,or;function ec(R){Ir[or++]^=R&255,Ir[or++]^=R>>8&255,Ir[or++]^=R>>16&255,Ir[or++]^=R>>24&255,or>=Bn&&(or-=Bn)}function sa(){ec(new Date().getTime())}if(Ir==null){Ir=new Array,or=0;var Vr;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var aa=new Uint8Array(32);for(window.crypto.getRandomValues(aa),Vr=0;Vr<32;++Vr)Ir[or++]=aa[Vr]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var za=window.crypto.random(32);for(Vr=0;Vr<za.length;++Vr)Ir[or++]=za.charCodeAt(Vr)&255}}for(;or<Bn;)Vr=Math.floor(65536*Math.random()),Ir[or++]=Vr>>>8,Ir[or++]=Vr&255;or=0,sa()}function Ya(){if(_n==null){for(sa(),_n=fa(),_n.init(Ir),or=0;or<Ir.length;++or)Ir[or]=0;or=0}return _n.next()}function oa(R){var O;for(O=0;O<R.length;++O)R[O]=Ya()}function cs(){}cs.prototype.nextBytes=oa;function ca(){this.i=0,this.j=0,this.S=new Array}function Wa(R){var O,H,Q;for(O=0;O<256;++O)this.S[O]=O;for(H=0,O=0;O<256;++O)H=H+this.S[O]+R[O%R.length]&255,Q=this.S[O],this.S[O]=this.S[H],this.S[H]=Q;this.i=0,this.j=0}function la(){var R;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,R=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=R,this.S[R+this.S[this.i]&255]}ca.prototype.init=Wa,ca.prototype.next=la;function fa(){return new ca}var Bn=256;typeof cf<"u"?cf=sm.exports={default:n,BigInteger:n,SecureRandom:cs}:this.jsbn={BigInteger:n,SecureRandom:cs}}).call(cf)});var Sc=Be(lf=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(i){return n(u(i),arguments)}function r(i,o){return t.apply(null,[i].concat(o||[]))}function n(i,o){var l=1,f=i.length,d,E="",p,h,w,v,D,A,F,S;for(p=0;p<f;p++)if(typeof i[p]=="string")E+=i[p];else if(typeof i[p]=="object"){if(w=i[p],w.keys)for(d=o[l],h=0;h<w.keys.length;h++){if(d==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',w.keys[h],w.keys[h-1]));d=d[w.keys[h]]}else w.param_no?d=o[w.param_no]:d=o[l++];if(e.not_type.test(w.type)&&e.not_primitive.test(w.type)&&d instanceof Function&&(d=d()),e.numeric_arg.test(w.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(t("[sprintf] expecting number but found %T",d));switch(e.number.test(w.type)&&(F=d>=0),w.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,w.width?parseInt(w.width):0);break;case"e":d=w.precision?parseFloat(d).toExponential(w.precision):parseFloat(d).toExponential();break;case"f":d=w.precision?parseFloat(d).toFixed(w.precision):parseFloat(d);break;case"g":d=w.precision?String(Number(d.toPrecision(w.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=w.precision?d.substring(0,w.precision):d;break;case"t":d=String(!!d),d=w.precision?d.substring(0,w.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=w.precision?d.substring(0,w.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=w.precision?d.substring(0,w.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase();break}e.json.test(w.type)?E+=d:(e.number.test(w.type)&&(!F||w.sign)?(S=F?"+":"-",d=d.toString().replace(e.sign,"")):S="",D=w.pad_char?w.pad_char==="0"?"0":w.pad_char.charAt(1):" ",A=w.width-(S+d).length,v=w.width&&A>0?D.repeat(A):"",E+=w.align?S+d+v:D==="0"?S+v+d:v+S+d)}return E}var s=Object.create(null);function u(i){if(s[i])return s[i];for(var o=i,l,f=[],d=0;o;){if((l=e.text.exec(o))!==null)f.push(l[0]);else if((l=e.modulo.exec(o))!==null)f.push("%");else if((l=e.placeholder.exec(o))!==null){if(l[2]){d|=1;var E=[],p=l[2],h=[];if((h=e.key.exec(p))!==null)for(E.push(h[1]);(p=p.substring(h[0].length))!=="";)if((h=e.key_access.exec(p))!==null)E.push(h[1]);else if((h=e.index_access.exec(p))!==null)E.push(h[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=E}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");f.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");o=o.substring(l[0].length)}return s[i]=f}typeof lf<"u"&&(lf.sprintf=t,lf.vsprintf=r),typeof window<"u"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var W0=Be(As=>{"use strict";var Ry=As&&As.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Ty=As&&As.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),om=As&&As.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ry(t,e,r);return Ty(t,e),t};Object.defineProperty(As,"__esModule",{value:!0});As.Address4=void 0;var um=om(K0()),Zi=om(V0()),am=of(),bc=z0(),Do=Sc(),Y0=class e{constructor(t){this.groups=Zi.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=um.isCorrect(Zi.BITS),this.isInSubnet=um.isInSubnet,this.address=t;let r=Zi.RE_SUBNET_STRING.exec(t);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>Zi.BITS)throw new am.AddressError("Invalid subnet mask.");t=t.replace(Zi.RE_SUBNET_STRING,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new e(t),!0}catch{return!1}}parse(t){let r=t.split(".");if(!t.match(Zi.RE_ADDRESS))throw new am.AddressError("Invalid IPv4 address.");return r}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let r=t.replace(/:/g,"").padStart(8,"0"),n=[],s;for(s=0;s<8;s+=2){let u=r.slice(s,s+2);n.push(parseInt(u,16))}return new e(n.join("."))}static fromInteger(t){return e.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new e(n)}toHex(){return this.parsedAddress.map(t=>(0,Do.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],r;for(r=0;r<Zi.GROUPS;r+=2){let n=(0,Do.sprintf)("%02x%02x",parseInt(this.parsedAddress[r],10),parseInt(this.parsedAddress[r+1],10));t.push((0,Do.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new bc.BigInteger(this.parsedAddress.map(t=>(0,Do.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new bc.BigInteger(this.mask()+"0".repeat(Zi.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new bc.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new bc.BigInteger(this.mask()+"1".repeat(Zi.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new bc.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return e.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,r){return this.binaryZeroPad().slice(t,r)}reverseForm(t){t||(t={});let r=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?r:(0,Do.sprintf)("%s.in-addr.arpa.",r)}isMulticast(){return this.isInSubnet(new e("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(Zi.BITS,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(Zi.RE_ADDRESS,(0,Do.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};As.Address4=Y0});var J0=Be(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.RE_URL_WITH_PORT=Cr.RE_URL=Cr.RE_ZONE_STRING=Cr.RE_SUBNET_STRING=Cr.RE_BAD_ADDRESS=Cr.RE_BAD_CHARACTERS=Cr.TYPES=Cr.SCOPES=Cr.GROUPS=Cr.BITS=void 0;Cr.BITS=128;Cr.GROUPS=8;Cr.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Cr.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};Cr.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Cr.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Cr.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Cr.RE_ZONE_STRING=/%.*$/;Cr.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);Cr.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var X0=Be(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.simpleGroup=Es.spanLeadingZeroes=Es.spanAll=Es.spanAllZeroes=void 0;var cm=Sc();function lm(e){return e.replace(/(0+)/g,'<span class="zero">$1</span>')}Es.spanAllZeroes=lm;function xy(e,t=0){return e.split("").map((n,s)=>(0,cm.sprintf)('<span class="digit value-%s position-%d">%s</span>',n,s+t,lm(n))).join("")}Es.spanAll=xy;function fm(e){return e.replace(/^(0+)/,'<span class="zero">$1</span>')}function Oy(e){return e.split(":").map(r=>fm(r)).join(":")}Es.spanLeadingZeroes=Oy;function ky(e,t=0){return e.split(":").map((n,s)=>/group-v4/.test(n)?n:(0,cm.sprintf)('<span class="hover-group group-%d">%s</span>',s+t,fm(n)))}Es.simpleGroup=ky});var hm=Be(Yr=>{"use strict";var Ny=Yr&&Yr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Ly=Yr&&Yr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uy=Yr&&Yr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ny(t,e,r);return Ly(t,e),t};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.possibleElisions=Yr.simpleRegularExpression=Yr.ADDRESS_BOUNDARY=Yr.padGroup=Yr.groupPossibilities=void 0;var Hy=Uy(J0()),yo=Sc();function hf(e){return(0,yo.sprintf)("(%s)",e.join("|"))}Yr.groupPossibilities=hf;function ff(e){return e.length<4?(0,yo.sprintf)("0{0,%d}%s",4-e.length,e):e}Yr.padGroup=ff;Yr.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function jy(e){let t=[];e.forEach((n,s)=>{parseInt(n,16)===0&&t.push(s)});let r=t.map(n=>e.map((s,u)=>{if(u===n){let i=u===0||u===Hy.GROUPS-1?":":"";return hf([ff(s),i])}return ff(s)}).join(":"));return r.push(e.map(ff).join(":")),hf(r)}Yr.simpleRegularExpression=jy;function My(e,t,r){let n=t?"":":",s=r?"":":",u=[];!t&&!r&&u.push("::"),t&&r&&u.push(""),(r&&!t||!r&&t)&&u.push(":"),u.push((0,yo.sprintf)("%s(:0{1,4}){1,%d}",n,e-1)),u.push((0,yo.sprintf)("(0{1,4}:){1,%d}%s",e-1,s)),u.push((0,yo.sprintf)("(0{1,4}:){%d}0{1,4}",e-1));for(let i=1;i<e-1;i++)for(let o=1;o<e-i;o++)u.push((0,yo.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",o,e-o-i-1));return hf(u)}Yr.possibleElisions=My});var mm=Be(ws=>{"use strict";var qy=ws&&ws.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Ky=ws&&ws.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),df=ws&&ws.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&qy(t,e,r);return Ky(t,e),t};Object.defineProperty(ws,"__esModule",{value:!0});ws.Address6=void 0;var pm=df(K0()),Z0=df(V0()),rr=df(J0()),Q0=df(X0()),Ba=W0(),Ia=hm(),su=of(),kn=z0(),Nn=Sc();function pf(e){if(!e)throw new Error("Assertion failed.")}function Vy(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function Gy(e){return e=e.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),e=e.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),e}function zy(e,t){let r=[],n=[],s;for(s=0;s<e.length;s++)s<t[0]?r.push(e[s]):s>t[1]&&n.push(e[s]);return r.concat(["compact"]).concat(n)}function dm(e){return(0,Nn.sprintf)("%04x",parseInt(e,16))}function gm(e){return e&255}var ep=class e{constructor(t,r){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=pm.isInSubnet,this.isCorrect=pm.isCorrect(rr.BITS),r===void 0?this.groups=rr.GROUPS:this.groups=r,this.address=t;let n=rr.RE_SUBNET_STRING.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>rr.BITS)throw new su.AddressError("Invalid subnet mask.");t=t.replace(rr.RE_SUBNET_STRING,"")}else if(/\//.test(t))throw new su.AddressError("Invalid subnet mask.");let s=rr.RE_ZONE_STRING.exec(t);s&&(this.zone=s[0],t=t.replace(rr.RE_ZONE_STRING,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new e(t),!0}catch{return!1}}static fromBigInteger(t){let r=t.toString(16).padStart(32,"0"),n=[],s;for(s=0;s<rr.GROUPS;s++)n.push(r.slice(s*4,(s+1)*4));return new e(n.join(":"))}static fromURL(t){let r,n=null,s;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(s=rr.RE_URL_WITH_PORT.exec(t),s===null)return{error:"failed to parse address with port",address:null,port:null};r=s[1],n=s[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),s=rr.RE_URL.exec(t),s===null)return{error:"failed to parse address from URL",address:null,port:null};r=s[1]}else r=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new e(r),port:n}}static fromAddress4(t){let r=new Ba.Address4(t),n=rr.BITS-(Z0.BITS-r.subnetMask);return new e(`::ffff:${r.correctForm()}/${n}`)}static fromArpa(t){let r=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(r.length!==63)throw new su.AddressError("Invalid 'ip6.arpa' form.");let s=r.split(".").reverse();for(let u=n;u>0;u--){let i=u*4;s.splice(i,0,":")}return r=s.join(""),new e(r)}microsoftTranscription(){return(0,Nn.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let r=rr.BITS-this.subnetMask,n=Math.abs(t-rr.BITS),s=r-n;return s<0?"0":Vy(new kn.BigInteger("2",10).pow(s).toString(10))}_startAddress(){return new kn.BigInteger(this.mask()+"0".repeat(rr.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new kn.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new kn.BigInteger(this.mask()+"1".repeat(rr.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new kn.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=rr.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(rr.TYPES))if(this.isInSubnet(new e(t)))return rr.TYPES[t];return"Global unicast"}getBits(t,r){return new kn.BigInteger(this.getBitsBase2(t,r),2)}getBitsBase2(t,r){return this.binaryZeroPad().slice(t,r)}getBitsBase16(t,r){let n=r-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,r).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,rr.BITS)}reverseForm(t){t||(t={});let r=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,r).reverse().join(".");return r>0?t.omitSuffix?n:(0,Nn.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,r=[],n=0,s=[];for(t=0;t<this.parsedAddress.length;t++){let o=parseInt(this.parsedAddress[t],16);o===0&&n++,o!==0&&n>0&&(n>1&&s.push([t-n,t-1]),n=0)}n>1&&s.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let u=s.map(o=>o[1]-o[0]+1);if(s.length>0){let o=u.indexOf(Math.max(...u));r=zy(this.parsedAddress,s[o])}else r=this.parsedAddress;for(t=0;t<r.length;t++)r[t]!=="compact"&&(r[t]=parseInt(r[t],16).toString(16));let i=r.join(":");return i=i.replace(/^compact$/,"::"),i=i.replace(/^compact|compact$/,":"),i=i.replace(/compact/,""),i}binaryZeroPad(){return this.bigInteger().toString(2).padStart(rr.BITS,"0")}parse4in6(t){let r=t.split(":"),s=r.slice(-1)[0].match(Z0.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new Ba.Address4(this.parsedAddress4);for(let u=0;u<this.address4.groups;u++)if(/^0[0-9]+/.test(this.address4.parsedAddress[u]))throw new su.AddressError("IPv4 addresses can't have leading zeroes.",t.replace(Z0.RE_ADDRESS,this.address4.parsedAddress.map(Gy).join(".")));this.v4=!0,r[r.length-1]=this.address4.toGroup6(),t=r.join(":")}return t}parse(t){t=this.parse4in6(t);let r=t.match(rr.RE_BAD_CHARACTERS);if(r)throw new su.AddressError((0,Nn.sprintf)("Bad character%s detected in address: %s",r.length>1?"s":"",r.join("")),t.replace(rr.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let n=t.match(rr.RE_BAD_ADDRESS);if(n)throw new su.AddressError((0,Nn.sprintf)("Address failed regex: %s",n.join("")),t.replace(rr.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let s=[],u=t.split("::");if(u.length===2){let i=u[0].split(":"),o=u[1].split(":");i.length===1&&i[0]===""&&(i=[]),o.length===1&&o[0]===""&&(o=[]);let l=this.groups-(i.length+o.length);if(!l)throw new su.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=i.length,this.elisionEnd=i.length+this.elidedGroups,s=s.concat(i);for(let f=0;f<l;f++)s.push("0");s=s.concat(o)}else if(u.length===1)s=t.split(":"),this.elidedGroups=0;else throw new su.AddressError("Too many :: groups found");if(s=s.map(i=>(0,Nn.sprintf)("%x",parseInt(i,16))),s.length!==this.groups)throw new su.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(dm).join(":")}decimal(){return this.parsedAddress.map(t=>(0,Nn.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new kn.BigInteger(this.parsedAddress.map(dm).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return Ba.Address4.fromHex(new kn.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new e(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(n)||(s=":"),n+s+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),r=this.getBits(80,96).xor(new kn.BigInteger("ffff",16)).toString(),n=Ba.Address4.fromHex(this.getBitsBase16(32,64)),s=Ba.Address4.fromHex(this.getBits(96,128).xor(new kn.BigInteger("ffffffff",16)).toString(16)),u=this.getBits(64,80),i=this.getBitsBase2(64,80),o=u.testBit(15),l=u.testBit(14),f=u.testBit(8),d=u.testBit(9),E=new kn.BigInteger(i.slice(2,6)+i.slice(8,16),2).toString(10);return{prefix:(0,Nn.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:s.address,flags:i,coneNat:o,microsoft:{reserved:l,universalLocal:d,groupIndividual:f,nonce:E},udpPort:r}}inspect6to4(){let t=this.getBitsBase16(0,16),r=Ba.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,Nn.sprintf)("%s",t.slice(0,4)),gateway:r.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new e(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(gm)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(gm))}static fromUnsignedByteArray(t){let r=new kn.BigInteger("256",10),n=new kn.BigInteger("0",10),s=new kn.BigInteger("1",10);for(let u=t.length-1;u>=0;u--)n=n.add(s.multiply(new kn.BigInteger(t[u].toString(10),10))),s=s.multiply(r);return e.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new e("2001::/32"))}is6to4(){return this.isInSubnet(new e("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,Nn.sprintf)(":%s",t),(0,Nn.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let r=this.correctForm;return t.v4&&(r=this.to4in6),t.className?(0,Nn.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,r.call(this),t.className):(0,Nn.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,r.call(this))}group(){if(this.elidedGroups===0)return Q0.simpleGroup(this.address).join(":");pf(typeof this.elidedGroups=="number"),pf(typeof this.elisionBegin=="number");let t=[],[r,n]=this.address.split("::");r.length?t.push(...Q0.simpleGroup(r)):t.push("");let s=["hover-group"];for(let u=this.elisionBegin;u<this.elisionBegin+this.elidedGroups;u++)s.push((0,Nn.sprintf)("group-%d",u));return t.push((0,Nn.sprintf)('<span class="%s"></span>',s.join(" "))),n.length?t.push(...Q0.simpleGroup(n,this.elisionEnd)):t.push(""),this.is4()&&(pf(this.address4 instanceof Ba.Address4),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let r=[],n=new e(this.correctForm());if(n.elidedGroups===0)r.push((0,Ia.simpleRegularExpression)(n.parsedAddress));else if(n.elidedGroups===rr.GROUPS)r.push((0,Ia.possibleElisions)(rr.GROUPS));else{let s=n.address.split("::");s[0].length&&r.push((0,Ia.simpleRegularExpression)(s[0].split(":"))),pf(typeof n.elidedGroups=="number"),r.push((0,Ia.possibleElisions)(n.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&r.push((0,Ia.simpleRegularExpression)(s[1].split(":"))),r=[r.join(":")]}return t||(r=["(?=^|",Ia.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...r,")(?=[^\\w\\:]|",Ia.ADDRESS_BOUNDARY,"|$)"]),r.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};ws.Address6=ep});var vm=Be(An=>{"use strict";var Yy=An&&An.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Wy=An&&An.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Jy=An&&An.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Yy(t,e,r);return Wy(t,e),t};Object.defineProperty(An,"__esModule",{value:!0});An.v6=An.AddressError=An.Address6=An.Address4=void 0;var Xy=W0();Object.defineProperty(An,"Address4",{enumerable:!0,get:function(){return Xy.Address4}});var Zy=mm();Object.defineProperty(An,"Address6",{enumerable:!0,get:function(){return Zy.Address6}});var Qy=of();Object.defineProperty(An,"AddressError",{enumerable:!0,get:function(){return Qy.AddressError}});var e3=Jy(X0());An.v6={helpers:e3}});var Df=Be((Bo,Ic)=>{(function(){var e,t="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",u="Invalid `variable` option passed into `_.template`",i="__lodash_hash_undefined__",o=500,l="__lodash_placeholder__",f=1,d=2,E=4,p=1,h=2,w=1,v=2,D=4,A=8,F=16,S=32,B=64,_=128,K=256,G=512,b=30,P="...",L=800,j=16,V=1,W=2,q=3,z=1/0,J=9007199254740991,se=17976931348623157e292,ye=NaN,Ce=4294967295,Pe=Ce-1,Xe=Ce>>>1,ce=[["ary",_],["bind",w],["bindKey",v],["curry",A],["curryRight",F],["flip",G],["partial",S],["partialRight",B],["rearg",K]],Ie="[object Arguments]",Me="[object Array]",_r="[object AsyncFunction]",Kt="[object Boolean]",Ft="[object Date]",gr="[object DOMException]",nr="[object Error]",ht="[object Function]",Vt="[object GeneratorFunction]",st="[object Map]",ze="[object Number]",ir="[object Null]",je="[object Object]",Tt="[object Promise]",Zr="[object Proxy]",Zt="[object RegExp]",Gt="[object Set]",mt="[object String]",Br="[object Symbol]",ui="[object Undefined]",Qr="[object WeakMap]",Dt="[object WeakSet]",Ue="[object ArrayBuffer]",be="[object DataView]",mr="[object Float32Array]",en="[object Float64Array]",ut="[object Int8Array]",Us="[object Int16Array]",tn="[object Int32Array]",ge="[object Uint8Array]",ns="[object Uint8ClampedArray]",_t="[object Uint16Array]",qr="[object Uint32Array]",Vi=/\b__p \+= '';/g,bu=/\b(__p \+=) '' \+/g,is=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_u=/&(?:amp|lt|gt|quot|#39);/g,ss=/[&<>"']/g,Gi=RegExp(_u.source),xt=RegExp(ss.source),Hn=/<%-([\s\S]+?)%>/g,Bu=/<%([\s\S]+?)%>/g,Iu=/<%=([\s\S]+?)%>/g,$u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,us=/^\w*$/,ra=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,as=/[\\^$.*+?()[\]{}|]/g,na=RegExp(as.source),Hs=/^\s+/,re=/\s/,fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Le=/\{\n\/\* \[wrapped with (.+)\] \*/,ke=/,? & /,Ve=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,at=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,yr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ut=/\w*$/,jn=/^[-+]0x[0-9a-f]+$/i,_i=/^0b[01]+$/i,rn=/^\[object .+?Constructor\]$/,pn=/^0o[0-7]+$/i,vr=/^(?:0|[1-9]\d*)$/,nn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kr=/($^)/,ia=/['\n\r\u2028\u2029\\]/g,os="\\ud800-\\udfff",Sn="\\u0300-\\u036f",Pt="\\ufe20-\\ufe2f",Ar="\\u20d0-\\u20ff",rt=Sn+Pt+Ar,sr="\\u2700-\\u27bf",Kr="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",Ht="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",bn="\\u2000-\\u206f",Mn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qn="A-Z\\xc0-\\xd6\\xd8-\\xde",_n="\\ufe0e\\ufe0f",Ir=ur+Ht+bn+Mn,or="['\u2019]",ec="["+os+"]",sa="["+Ir+"]",Vr="["+rt+"]",aa="\\d+",za="["+sr+"]",Ya="["+Kr+"]",oa="[^"+os+Ir+aa+sr+Kr+qn+"]",cs="\\ud83c[\\udffb-\\udfff]",ca="(?:"+Vr+"|"+cs+")",Wa="[^"+os+"]",la="(?:\\ud83c[\\udde6-\\uddff]){2}",fa="[\\ud800-\\udbff][\\udc00-\\udfff]",Bn="["+qn+"]",R="\\u200d",O="(?:"+Ya+"|"+oa+")",H="(?:"+Bn+"|"+oa+")",Q="(?:"+or+"(?:d|ll|m|re|s|t|ve))?",ve="(?:"+or+"(?:D|LL|M|RE|S|T|VE))?",we=ca+"?",$e="["+_n+"]?",Oe="(?:"+R+"(?:"+[Wa,la,fa].join("|")+")"+$e+we+")*",zt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Er="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sn=$e+we+Oe,un="(?:"+[za,la,fa].join("|")+")"+sn,ai="(?:"+[Wa+Vr+"?",Vr,la,fa,ec].join("|")+")",Pu=RegExp(or,"g"),In=RegExp(Vr,"g"),an=RegExp(cs+"(?="+cs+")|"+ai+sn,"g"),Ru=RegExp([Bn+"?"+Ya+"+"+Q+"(?="+[sa,Bn,"$"].join("|")+")",H+"+"+ve+"(?="+[sa,Bn+O,"$"].join("|")+")",Bn+"?"+O+"+"+Q,Bn+"+"+ve,Er,zt,aa,un].join("|"),"g"),Bi=RegExp("["+R+os+rt+_n+"]"),ha=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ch=-1,Qt={};Qt[mr]=Qt[en]=Qt[ut]=Qt[Us]=Qt[tn]=Qt[ge]=Qt[ns]=Qt[_t]=Qt[qr]=!0,Qt[Ie]=Qt[Me]=Qt[Ue]=Qt[Kt]=Qt[be]=Qt[Ft]=Qt[nr]=Qt[ht]=Qt[st]=Qt[ze]=Qt[je]=Qt[Zt]=Qt[Gt]=Qt[mt]=Qt[Qr]=!1;var Jt={};Jt[Ie]=Jt[Me]=Jt[Ue]=Jt[be]=Jt[Kt]=Jt[Ft]=Jt[mr]=Jt[en]=Jt[ut]=Jt[Us]=Jt[tn]=Jt[st]=Jt[ze]=Jt[je]=Jt[Zt]=Jt[Gt]=Jt[mt]=Jt[Br]=Jt[ge]=Jt[ns]=Jt[_t]=Jt[qr]=!0,Jt[nr]=Jt[ht]=Jt[Qr]=!1;var Dh={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},yh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sh={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_h=parseFloat,Bh=parseInt,il=typeof global=="object"&&global&&global.Object===Object&&global,Ih=typeof self=="object"&&self&&self.Object===Object&&self,$r=il||Ih||Function("return this")(),tc=typeof Bo=="object"&&Bo&&!Bo.nodeType&&Bo,js=tc&&typeof Ic=="object"&&Ic&&!Ic.nodeType&&Ic,sl=js&&js.exports===tc,rc=sl&&il.process,Kn=function(){try{var ne=js&&js.require&&js.require("util").types;return ne||rc&&rc.binding&&rc.binding("util")}catch{}}(),ul=Kn&&Kn.isArrayBuffer,al=Kn&&Kn.isDate,ol=Kn&&Kn.isMap,cl=Kn&&Kn.isRegExp,ll=Kn&&Kn.isSet,fl=Kn&&Kn.isTypedArray;function $n(ne,he,oe){switch(oe.length){case 0:return ne.call(he);case 1:return ne.call(he,oe[0]);case 2:return ne.call(he,oe[0],oe[1]);case 3:return ne.call(he,oe[0],oe[1],oe[2])}return ne.apply(he,oe)}function $h(ne,he,oe,Ne){for(var nt=-1,yt=ne==null?0:ne.length;++nt<yt;){var fr=ne[nt];he(Ne,fr,oe(fr),ne)}return Ne}function Vn(ne,he){for(var oe=-1,Ne=ne==null?0:ne.length;++oe<Ne&&he(ne[oe],oe,ne)!==!1;);return ne}function I(ne,he){for(var oe=ne==null?0:ne.length;oe--&&he(ne[oe],oe,ne)!==!1;);return ne}function ot(ne,he){for(var oe=-1,Ne=ne==null?0:ne.length;++oe<Ne;)if(!he(ne[oe],oe,ne))return!1;return!0}function oi(ne,he){for(var oe=-1,Ne=ne==null?0:ne.length,nt=0,yt=[];++oe<Ne;){var fr=ne[oe];he(fr,oe,ne)&&(yt[nt++]=fr)}return yt}function Pn(ne,he){var oe=ne==null?0:ne.length;return!!oe&&Tu(ne,he,0)>-1}function pa(ne,he,oe){for(var Ne=-1,nt=ne==null?0:ne.length;++Ne<nt;)if(oe(he,ne[Ne]))return!0;return!1}function te(ne,he){for(var oe=-1,Ne=ne==null?0:ne.length,nt=Array(Ne);++oe<Ne;)nt[oe]=he(ne[oe],oe,ne);return nt}function ci(ne,he){for(var oe=-1,Ne=he.length,nt=ne.length;++oe<Ne;)ne[nt+oe]=he[oe];return ne}function nc(ne,he,oe,Ne){var nt=-1,yt=ne==null?0:ne.length;for(Ne&&yt&&(oe=ne[++nt]);++nt<yt;)oe=he(oe,ne[nt],nt,ne);return oe}function Jd(ne,he,oe,Ne){var nt=ne==null?0:ne.length;for(Ne&&nt&&(oe=ne[--nt]);nt--;)oe=he(oe,ne[nt],nt,ne);return oe}function hl(ne,he){for(var oe=-1,Ne=ne==null?0:ne.length;++oe<Ne;)if(he(ne[oe],oe,ne))return!0;return!1}var lr=Ms("length");function Xd(ne){return ne.split("")}function ic(ne){return ne.match(Ve)||[]}function Ye(ne,he,oe){var Ne;return oe(ne,function(nt,yt,fr){if(he(nt,yt,fr))return Ne=yt,!1}),Ne}function Pr(ne,he,oe,Ne){for(var nt=ne.length,yt=oe+(Ne?1:-1);Ne?yt--:++yt<nt;)if(he(ne[yt],yt,ne))return yt;return-1}function Tu(ne,he,oe){return he===he?Al(ne,he,oe):Pr(ne,Ii,oe)}function Ph(ne,he,oe,Ne){for(var nt=oe-1,yt=ne.length;++nt<yt;)if(Ne(ne[nt],he))return nt;return-1}function Ii(ne){return ne!==ne}function sc(ne,he){var oe=ne==null?0:ne.length;return oe?Ja(ne,he)/oe:ye}function Ms(ne){return function(he){return he==null?e:he[ne]}}function me(ne){return function(he){return ne==null?e:ne[he]}}function pl(ne,he,oe,Ne,nt){return nt(ne,function(yt,fr,Yt){oe=Ne?(Ne=!1,yt):he(oe,yt,fr,Yt)}),oe}function dl(ne,he){var oe=ne.length;for(ne.sort(he);oe--;)ne[oe]=ne[oe].value;return ne}function Ja(ne,he){for(var oe,Ne=-1,nt=ne.length;++Ne<nt;){var yt=he(ne[Ne]);yt!==e&&(oe=oe===e?yt:oe+yt)}return oe}function uc(ne,he){for(var oe=-1,Ne=Array(ne);++oe<ne;)Ne[oe]=he(oe);return Ne}function Rh(ne,he){return te(he,function(oe){return[oe,ne[oe]]})}function ac(ne){return ne&&ne.slice(0,Qa(ne)+1).replace(Hs,"")}function dn(ne){return function(he){return ne(he)}}function da(ne,he){return te(he,function(oe){return ne[oe]})}function ga(ne,he){return ne.has(he)}function Xa(ne,he){for(var oe=-1,Ne=ne.length;++oe<Ne&&Tu(he,ne[oe],0)>-1;);return oe}function gl(ne,he){for(var oe=ne.length;oe--&&Tu(he,ne[oe],0)>-1;);return oe}function ml(ne,he){for(var oe=ne.length,Ne=0;oe--;)ne[oe]===he&&++Ne;return Ne}var oc=me(Dh),Th=me(yh);function vl(ne){return"\\"+bh[ne]}function xh(ne,he){return ne==null?e:ne[he]}function qs(ne){return Bi.test(ne)}function Oh(ne){return ha.test(ne)}function kh(ne){for(var he,oe=[];!(he=ne.next()).done;)oe.push(he.value);return oe}function cc(ne){var he=-1,oe=Array(ne.size);return ne.forEach(function(Ne,nt){oe[++he]=[nt,Ne]}),oe}function on(ne,he){return function(oe){return ne(he(oe))}}function li(ne,he){for(var oe=-1,Ne=ne.length,nt=0,yt=[];++oe<Ne;){var fr=ne[oe];(fr===he||fr===l)&&(ne[oe]=l,yt[nt++]=oe)}return yt}function fi(ne){var he=-1,oe=Array(ne.size);return ne.forEach(function(Ne){oe[++he]=Ne}),oe}function Za(ne){var he=-1,oe=Array(ne.size);return ne.forEach(function(Ne){oe[++he]=[Ne,Ne]}),oe}function Al(ne,he,oe){for(var Ne=oe-1,nt=ne.length;++Ne<nt;)if(ne[Ne]===he)return Ne;return-1}function Nh(ne,he,oe){for(var Ne=oe+1;Ne--;)if(ne[Ne]===he)return Ne;return Ne}function Ks(ne){return qs(ne)?wl(ne):lr(ne)}function Gn(ne){return qs(ne)?Lh(ne):Xd(ne)}function Qa(ne){for(var he=ne.length;he--&&re.test(ne.charAt(he)););return he}var El=me(Sh);function wl(ne){for(var he=an.lastIndex=0;an.test(ne);)++he;return he}function Lh(ne){return ne.match(an)||[]}function Uh(ne){return ne.match(Ru)||[]}var Hh=function ne(he){he=he==null?$r:$i.defaults($r.Object(),he,$i.pick($r,Fh));var oe=he.Array,Ne=he.Date,nt=he.Error,yt=he.Function,fr=he.Math,Yt=he.Object,eo=he.RegExp,jh=he.String,zn=he.TypeError,to=oe.prototype,Fl=yt.prototype,Vs=Yt.prototype,zi=he["__core-js_shared__"],ro=Fl.toString,Bt=Vs.hasOwnProperty,Mh=0,no=function(){var a=/[^.]+$/.exec(zi&&zi.keys&&zi.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),io=Vs.toString,qh=ro.call(Yt),Kh=$r._,Vh=eo("^"+ro.call(Bt).replace(as,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),so=sl?he.Buffer:e,ls=he.Symbol,uo=he.Uint8Array,Cl=so?so.allocUnsafe:e,ao=on(Yt.getPrototypeOf,Yt),Dl=Yt.create,yl=Vs.propertyIsEnumerable,kt=to.splice,Sl=ls?ls.isConcatSpreadable:e,Gs=ls?ls.iterator:e,zs=ls?ls.toStringTag:e,oo=function(){try{var a=wa(Yt,"defineProperty");return a({},"",{}),a}catch{}}(),C=he.clearTimeout!==$r.clearTimeout&&he.clearTimeout,k=Ne&&Ne.now!==$r.Date.now&&Ne.now,X=he.setTimeout!==$r.setTimeout&&he.setTimeout,M=fr.ceil,ue=fr.floor,le=Yt.getOwnPropertySymbols,Wt=so?so.isBuffer:e,wr=he.isFinite,aw=to.join,ow=on(Yt.keys,Yt),Nr=fr.max,gn=fr.min,cw=Ne.now,lw=he.parseInt,Zd=fr.random,fw=to.reverse,Gh=wa(he,"DataView"),lc=wa(he,"Map"),zh=wa(he,"Promise"),co=wa(he,"Set"),fc=wa(he,"WeakMap"),hc=wa(Yt,"create"),bl=fc&&new fc,lo={},hw=Fa(Gh),pw=Fa(lc),dw=Fa(zh),gw=Fa(co),mw=Fa(fc),_l=ls?ls.prototype:e,pc=_l?_l.valueOf:e,Qd=_l?_l.toString:e;function N(a){if(Fr(a)&&!ct(a)&&!(a instanceof Ct)){if(a instanceof Pi)return a;if(Bt.call(a,"__wrapped__"))return eg(a)}return new Pi(a)}var fo=function(){function a(){}return function(c){if(!hr(c))return{};if(Dl)return Dl(c);a.prototype=c;var m=new a;return a.prototype=e,m}}();function Bl(){}function Pi(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}N.templateSettings={escape:Hn,evaluate:Bu,interpolate:Iu,variable:"",imports:{_:N}},N.prototype=Bl.prototype,N.prototype.constructor=N,Pi.prototype=fo(Bl.prototype),Pi.prototype.constructor=Pi;function Ct(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ce,this.__views__=[]}function vw(){var a=new Ct(this.__wrapped__);return a.__actions__=Yn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Yn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Yn(this.__views__),a}function Aw(){if(this.__filtered__){var a=new Ct(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function Ew(){var a=this.__wrapped__.value(),c=this.__dir__,m=ct(a),y=c<0,T=m?a.length:0,U=P4(0,T,this.__views__),Y=U.start,Z=U.end,ie=Z-Y,Ae=y?Z:Y-1,Ee=this.__iteratees__,Fe=Ee.length,Re=0,He=gn(ie,this.__takeCount__);if(!m||!y&&T==ie&&He==ie)return D1(a,this.__actions__);var et=[];e:for(;ie--&&Re<He;){Ae+=c;for(var gt=-1,tt=a[Ae];++gt<Fe;){var wt=Ee[gt],St=wt.iteratee,di=wt.type,xn=St(tt);if(di==W)tt=xn;else if(!xn){if(di==V)continue e;break e}}et[Re++]=tt}return et}Ct.prototype=fo(Bl.prototype),Ct.prototype.constructor=Ct;function ma(a){var c=-1,m=a==null?0:a.length;for(this.clear();++c<m;){var y=a[c];this.set(y[0],y[1])}}function ww(){this.__data__=hc?hc(null):{},this.size=0}function Fw(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}function Cw(a){var c=this.__data__;if(hc){var m=c[a];return m===i?e:m}return Bt.call(c,a)?c[a]:e}function Dw(a){var c=this.__data__;return hc?c[a]!==e:Bt.call(c,a)}function yw(a,c){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=hc&&c===e?i:c,this}ma.prototype.clear=ww,ma.prototype.delete=Fw,ma.prototype.get=Cw,ma.prototype.has=Dw,ma.prototype.set=yw;function Ys(a){var c=-1,m=a==null?0:a.length;for(this.clear();++c<m;){var y=a[c];this.set(y[0],y[1])}}function Sw(){this.__data__=[],this.size=0}function bw(a){var c=this.__data__,m=Il(c,a);if(m<0)return!1;var y=c.length-1;return m==y?c.pop():kt.call(c,m,1),--this.size,!0}function _w(a){var c=this.__data__,m=Il(c,a);return m<0?e:c[m][1]}function Bw(a){return Il(this.__data__,a)>-1}function Iw(a,c){var m=this.__data__,y=Il(m,a);return y<0?(++this.size,m.push([a,c])):m[y][1]=c,this}Ys.prototype.clear=Sw,Ys.prototype.delete=bw,Ys.prototype.get=_w,Ys.prototype.has=Bw,Ys.prototype.set=Iw;function Ws(a){var c=-1,m=a==null?0:a.length;for(this.clear();++c<m;){var y=a[c];this.set(y[0],y[1])}}function $w(){this.size=0,this.__data__={hash:new ma,map:new(lc||Ys),string:new ma}}function Pw(a){var c=jl(this,a).delete(a);return this.size-=c?1:0,c}function Rw(a){return jl(this,a).get(a)}function Tw(a){return jl(this,a).has(a)}function xw(a,c){var m=jl(this,a),y=m.size;return m.set(a,c),this.size+=m.size==y?0:1,this}Ws.prototype.clear=$w,Ws.prototype.delete=Pw,Ws.prototype.get=Rw,Ws.prototype.has=Tw,Ws.prototype.set=xw;function va(a){var c=-1,m=a==null?0:a.length;for(this.__data__=new Ws;++c<m;)this.add(a[c])}function Ow(a){return this.__data__.set(a,i),this}function kw(a){return this.__data__.has(a)}va.prototype.add=va.prototype.push=Ow,va.prototype.has=kw;function Yi(a){var c=this.__data__=new Ys(a);this.size=c.size}function Nw(){this.__data__=new Ys,this.size=0}function Lw(a){var c=this.__data__,m=c.delete(a);return this.size=c.size,m}function Uw(a){return this.__data__.get(a)}function Hw(a){return this.__data__.has(a)}function jw(a,c){var m=this.__data__;if(m instanceof Ys){var y=m.__data__;if(!lc||y.length<r-1)return y.push([a,c]),this.size=++m.size,this;m=this.__data__=new Ws(y)}return m.set(a,c),this.size=m.size,this}Yi.prototype.clear=Nw,Yi.prototype.delete=Lw,Yi.prototype.get=Uw,Yi.prototype.has=Hw,Yi.prototype.set=jw;function e1(a,c){var m=ct(a),y=!m&&Ca(a),T=!m&&!y&&Lu(a),U=!m&&!y&&!T&&mo(a),Y=m||y||T||U,Z=Y?uc(a.length,jh):[],ie=Z.length;for(var Ae in a)(c||Bt.call(a,Ae))&&!(Y&&(Ae=="length"||T&&(Ae=="offset"||Ae=="parent")||U&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||Qs(Ae,ie)))&&Z.push(Ae);return Z}function t1(a){var c=a.length;return c?a[i0(0,c-1)]:e}function Mw(a,c){return Ml(Yn(a),Aa(c,0,a.length))}function qw(a){return Ml(Yn(a))}function Yh(a,c,m){(m!==e&&!Wi(a[c],m)||m===e&&!(c in a))&&Js(a,c,m)}function dc(a,c,m){var y=a[c];(!(Bt.call(a,c)&&Wi(y,m))||m===e&&!(c in a))&&Js(a,c,m)}function Il(a,c){for(var m=a.length;m--;)if(Wi(a[m][0],c))return m;return-1}function Kw(a,c,m,y){return xu(a,function(T,U,Y){c(y,T,m(T),Y)}),y}function r1(a,c){return a&&ps(c,Gr(c),a)}function Vw(a,c){return a&&ps(c,Jn(c),a)}function Js(a,c,m){c=="__proto__"&&oo?oo(a,c,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[c]=m}function Wh(a,c){for(var m=-1,y=c.length,T=oe(y),U=a==null;++m<y;)T[m]=U?e:I0(a,c[m]);return T}function Aa(a,c,m){return a===a&&(m!==e&&(a=a<=m?a:m),c!==e&&(a=a>=c?a:c)),a}function Ri(a,c,m,y,T,U){var Y,Z=c&f,ie=c&d,Ae=c&E;if(m&&(Y=T?m(a,y,T,U):m(a)),Y!==e)return Y;if(!hr(a))return a;var Ee=ct(a);if(Ee){if(Y=T4(a),!Z)return Yn(a,Y)}else{var Fe=mn(a),Re=Fe==ht||Fe==Vt;if(Lu(a))return b1(a,Z);if(Fe==je||Fe==Ie||Re&&!T){if(Y=ie||Re?{}:V1(a),!Z)return ie?C4(a,Vw(Y,a)):F4(a,r1(Y,a))}else{if(!Jt[Fe])return T?a:{};Y=x4(a,Fe,Z)}}U||(U=new Yi);var He=U.get(a);if(He)return He;U.set(a,Y),wg(a)?a.forEach(function(tt){Y.add(Ri(tt,c,m,tt,a,U))}):Ag(a)&&a.forEach(function(tt,wt){Y.set(wt,Ri(tt,c,m,wt,a,U))});var et=Ae?ie?g0:d0:ie?Jn:Gr,gt=Ee?e:et(a);return Vn(gt||a,function(tt,wt){gt&&(wt=tt,tt=a[wt]),dc(Y,wt,Ri(tt,c,m,wt,a,U))}),Y}function Gw(a){var c=Gr(a);return function(m){return n1(m,a,c)}}function n1(a,c,m){var y=m.length;if(a==null)return!y;for(a=Yt(a);y--;){var T=m[y],U=c[T],Y=a[T];if(Y===e&&!(T in a)||!U(Y))return!1}return!0}function i1(a,c,m){if(typeof a!="function")throw new zn(s);return Fc(function(){a.apply(e,m)},c)}function gc(a,c,m,y){var T=-1,U=Pn,Y=!0,Z=a.length,ie=[],Ae=c.length;if(!Z)return ie;m&&(c=te(c,dn(m))),y?(U=pa,Y=!1):c.length>=r&&(U=ga,Y=!1,c=new va(c));e:for(;++T<Z;){var Ee=a[T],Fe=m==null?Ee:m(Ee);if(Ee=y||Ee!==0?Ee:0,Y&&Fe===Fe){for(var Re=Ae;Re--;)if(c[Re]===Fe)continue e;ie.push(Ee)}else U(c,Fe,y)||ie.push(Ee)}return ie}var xu=P1(hs),s1=P1(Xh,!0);function zw(a,c){var m=!0;return xu(a,function(y,T,U){return m=!!c(y,T,U),m}),m}function $l(a,c,m){for(var y=-1,T=a.length;++y<T;){var U=a[y],Y=c(U);if(Y!=null&&(Z===e?Y===Y&&!pi(Y):m(Y,Z)))var Z=Y,ie=U}return ie}function Yw(a,c,m,y){var T=a.length;for(m=pt(m),m<0&&(m=-m>T?0:T+m),y=y===e||y>T?T:pt(y),y<0&&(y+=T),y=m>y?0:Cg(y);m<y;)a[m++]=c;return a}function u1(a,c){var m=[];return xu(a,function(y,T,U){c(y,T,U)&&m.push(y)}),m}function cn(a,c,m,y,T){var U=-1,Y=a.length;for(m||(m=k4),T||(T=[]);++U<Y;){var Z=a[U];c>0&&m(Z)?c>1?cn(Z,c-1,m,y,T):ci(T,Z):y||(T[T.length]=Z)}return T}var Jh=R1(),a1=R1(!0);function hs(a,c){return a&&Jh(a,c,Gr)}function Xh(a,c){return a&&a1(a,c,Gr)}function Pl(a,c){return oi(c,function(m){return eu(a[m])})}function Ea(a,c){c=ku(c,a);for(var m=0,y=c.length;a!=null&&m<y;)a=a[ds(c[m++])];return m&&m==y?a:e}function o1(a,c,m){var y=c(a);return ct(a)?y:ci(y,m(a))}function Rn(a){return a==null?a===e?ui:ir:zs&&zs in Yt(a)?$4(a):q4(a)}function Zh(a,c){return a>c}function Ww(a,c){return a!=null&&Bt.call(a,c)}function Jw(a,c){return a!=null&&c in Yt(a)}function Xw(a,c,m){return a>=gn(c,m)&&a<Nr(c,m)}function Qh(a,c,m){for(var y=m?pa:Pn,T=a[0].length,U=a.length,Y=U,Z=oe(U),ie=1/0,Ae=[];Y--;){var Ee=a[Y];Y&&c&&(Ee=te(Ee,dn(c))),ie=gn(Ee.length,ie),Z[Y]=!m&&(c||T>=120&&Ee.length>=120)?new va(Y&&Ee):e}Ee=a[0];var Fe=-1,Re=Z[0];e:for(;++Fe<T&&Ae.length<ie;){var He=Ee[Fe],et=c?c(He):He;if(He=m||He!==0?He:0,!(Re?ga(Re,et):y(Ae,et,m))){for(Y=U;--Y;){var gt=Z[Y];if(!(gt?ga(gt,et):y(a[Y],et,m)))continue e}Re&&Re.push(et),Ae.push(He)}}return Ae}function Zw(a,c,m,y){return hs(a,function(T,U,Y){c(y,m(T),U,Y)}),y}function mc(a,c,m){c=ku(c,a),a=W1(a,c);var y=a==null?a:a[ds(xi(c))];return y==null?e:$n(y,a,m)}function c1(a){return Fr(a)&&Rn(a)==Ie}function Qw(a){return Fr(a)&&Rn(a)==Ue}function e4(a){return Fr(a)&&Rn(a)==Ft}function vc(a,c,m,y,T){return a===c?!0:a==null||c==null||!Fr(a)&&!Fr(c)?a!==a&&c!==c:t4(a,c,m,y,vc,T)}function t4(a,c,m,y,T,U){var Y=ct(a),Z=ct(c),ie=Y?Me:mn(a),Ae=Z?Me:mn(c);ie=ie==Ie?je:ie,Ae=Ae==Ie?je:Ae;var Ee=ie==je,Fe=Ae==je,Re=ie==Ae;if(Re&&Lu(a)){if(!Lu(c))return!1;Y=!0,Ee=!1}if(Re&&!Ee)return U||(U=new Yi),Y||mo(a)?M1(a,c,m,y,T,U):B4(a,c,ie,m,y,T,U);if(!(m&p)){var He=Ee&&Bt.call(a,"__wrapped__"),et=Fe&&Bt.call(c,"__wrapped__");if(He||et){var gt=He?a.value():a,tt=et?c.value():c;return U||(U=new Yi),T(gt,tt,m,y,U)}}return Re?(U||(U=new Yi),I4(a,c,m,y,T,U)):!1}function r4(a){return Fr(a)&&mn(a)==st}function e0(a,c,m,y){var T=m.length,U=T,Y=!y;if(a==null)return!U;for(a=Yt(a);T--;){var Z=m[T];if(Y&&Z[2]?Z[1]!==a[Z[0]]:!(Z[0]in a))return!1}for(;++T<U;){Z=m[T];var ie=Z[0],Ae=a[ie],Ee=Z[1];if(Y&&Z[2]){if(Ae===e&&!(ie in a))return!1}else{var Fe=new Yi;if(y)var Re=y(Ae,Ee,ie,a,c,Fe);if(!(Re===e?vc(Ee,Ae,p|h,y,Fe):Re))return!1}}return!0}function l1(a){if(!hr(a)||L4(a))return!1;var c=eu(a)?Vh:rn;return c.test(Fa(a))}function n4(a){return Fr(a)&&Rn(a)==Zt}function i4(a){return Fr(a)&&mn(a)==Gt}function s4(a){return Fr(a)&&Yl(a.length)&&!!Qt[Rn(a)]}function f1(a){return typeof a=="function"?a:a==null?Xn:typeof a=="object"?ct(a)?d1(a[0],a[1]):p1(a):Tg(a)}function t0(a){if(!wc(a))return ow(a);var c=[];for(var m in Yt(a))Bt.call(a,m)&&m!="constructor"&&c.push(m);return c}function u4(a){if(!hr(a))return M4(a);var c=wc(a),m=[];for(var y in a)y=="constructor"&&(c||!Bt.call(a,y))||m.push(y);return m}function r0(a,c){return a<c}function h1(a,c){var m=-1,y=Wn(a)?oe(a.length):[];return xu(a,function(T,U,Y){y[++m]=c(T,U,Y)}),y}function p1(a){var c=v0(a);return c.length==1&&c[0][2]?z1(c[0][0],c[0][1]):function(m){return m===a||e0(m,a,c)}}function d1(a,c){return E0(a)&&G1(c)?z1(ds(a),c):function(m){var y=I0(m,a);return y===e&&y===c?$0(m,a):vc(c,y,p|h)}}function Rl(a,c,m,y,T){a!==c&&Jh(c,function(U,Y){if(T||(T=new Yi),hr(U))a4(a,c,Y,m,Rl,y,T);else{var Z=y?y(F0(a,Y),U,Y+"",a,c,T):e;Z===e&&(Z=U),Yh(a,Y,Z)}},Jn)}function a4(a,c,m,y,T,U,Y){var Z=F0(a,m),ie=F0(c,m),Ae=Y.get(ie);if(Ae){Yh(a,m,Ae);return}var Ee=U?U(Z,ie,m+"",a,c,Y):e,Fe=Ee===e;if(Fe){var Re=ct(ie),He=!Re&&Lu(ie),et=!Re&&!He&&mo(ie);Ee=ie,Re||He||et?ct(Z)?Ee=Z:Sr(Z)?Ee=Yn(Z):He?(Fe=!1,Ee=b1(ie,!0)):et?(Fe=!1,Ee=_1(ie,!0)):Ee=[]:Cc(ie)||Ca(ie)?(Ee=Z,Ca(Z)?Ee=Dg(Z):(!hr(Z)||eu(Z))&&(Ee=V1(ie))):Fe=!1}Fe&&(Y.set(ie,Ee),T(Ee,ie,y,U,Y),Y.delete(ie)),Yh(a,m,Ee)}function g1(a,c){var m=a.length;if(m)return c+=c<0?m:0,Qs(c,m)?a[c]:e}function m1(a,c,m){c.length?c=te(c,function(U){return ct(U)?function(Y){return Ea(Y,U.length===1?U[0]:U)}:U}):c=[Xn];var y=-1;c=te(c,dn(Ze()));var T=h1(a,function(U,Y,Z){var ie=te(c,function(Ae){return Ae(U)});return{criteria:ie,index:++y,value:U}});return dl(T,function(U,Y){return w4(U,Y,m)})}function o4(a,c){return v1(a,c,function(m,y){return $0(a,y)})}function v1(a,c,m){for(var y=-1,T=c.length,U={};++y<T;){var Y=c[y],Z=Ea(a,Y);m(Z,Y)&&Ac(U,ku(Y,a),Z)}return U}function c4(a){return function(c){return Ea(c,a)}}function n0(a,c,m,y){var T=y?Ph:Tu,U=-1,Y=c.length,Z=a;for(a===c&&(c=Yn(c)),m&&(Z=te(a,dn(m)));++U<Y;)for(var ie=0,Ae=c[U],Ee=m?m(Ae):Ae;(ie=T(Z,Ee,ie,y))>-1;)Z!==a&&kt.call(Z,ie,1),kt.call(a,ie,1);return a}function A1(a,c){for(var m=a?c.length:0,y=m-1;m--;){var T=c[m];if(m==y||T!==U){var U=T;Qs(T)?kt.call(a,T,1):a0(a,T)}}return a}function i0(a,c){return a+ue(Zd()*(c-a+1))}function l4(a,c,m,y){for(var T=-1,U=Nr(M((c-a)/(m||1)),0),Y=oe(U);U--;)Y[y?U:++T]=a,a+=m;return Y}function s0(a,c){var m="";if(!a||c<1||c>J)return m;do c%2&&(m+=a),c=ue(c/2),c&&(a+=a);while(c);return m}function vt(a,c){return C0(Y1(a,c,Xn),a+"")}function f4(a){return t1(vo(a))}function h4(a,c){var m=vo(a);return Ml(m,Aa(c,0,m.length))}function Ac(a,c,m,y){if(!hr(a))return a;c=ku(c,a);for(var T=-1,U=c.length,Y=U-1,Z=a;Z!=null&&++T<U;){var ie=ds(c[T]),Ae=m;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return a;if(T!=Y){var Ee=Z[ie];Ae=y?y(Ee,ie,Z):e,Ae===e&&(Ae=hr(Ee)?Ee:Qs(c[T+1])?[]:{})}dc(Z,ie,Ae),Z=Z[ie]}return a}var E1=bl?function(a,c){return bl.set(a,c),a}:Xn,p4=oo?function(a,c){return oo(a,"toString",{configurable:!0,enumerable:!1,value:R0(c),writable:!0})}:Xn;function d4(a){return Ml(vo(a))}function Ti(a,c,m){var y=-1,T=a.length;c<0&&(c=-c>T?0:T+c),m=m>T?T:m,m<0&&(m+=T),T=c>m?0:m-c>>>0,c>>>=0;for(var U=oe(T);++y<T;)U[y]=a[y+c];return U}function g4(a,c){var m;return xu(a,function(y,T,U){return m=c(y,T,U),!m}),!!m}function Tl(a,c,m){var y=0,T=a==null?y:a.length;if(typeof c=="number"&&c===c&&T<=Xe){for(;y<T;){var U=y+T>>>1,Y=a[U];Y!==null&&!pi(Y)&&(m?Y<=c:Y<c)?y=U+1:T=U}return T}return u0(a,c,Xn,m)}function u0(a,c,m,y){var T=0,U=a==null?0:a.length;if(U===0)return 0;c=m(c);for(var Y=c!==c,Z=c===null,ie=pi(c),Ae=c===e;T<U;){var Ee=ue((T+U)/2),Fe=m(a[Ee]),Re=Fe!==e,He=Fe===null,et=Fe===Fe,gt=pi(Fe);if(Y)var tt=y||et;else Ae?tt=et&&(y||Re):Z?tt=et&&Re&&(y||!He):ie?tt=et&&Re&&!He&&(y||!gt):He||gt?tt=!1:tt=y?Fe<=c:Fe<c;tt?T=Ee+1:U=Ee}return gn(U,Pe)}function w1(a,c){for(var m=-1,y=a.length,T=0,U=[];++m<y;){var Y=a[m],Z=c?c(Y):Y;if(!m||!Wi(Z,ie)){var ie=Z;U[T++]=Y===0?0:Y}}return U}function F1(a){return typeof a=="number"?a:pi(a)?ye:+a}function hi(a){if(typeof a=="string")return a;if(ct(a))return te(a,hi)+"";if(pi(a))return Qd?Qd.call(a):"";var c=a+"";return c=="0"&&1/a==-z?"-0":c}function Ou(a,c,m){var y=-1,T=Pn,U=a.length,Y=!0,Z=[],ie=Z;if(m)Y=!1,T=pa;else if(U>=r){var Ae=c?null:b4(a);if(Ae)return fi(Ae);Y=!1,T=ga,ie=new va}else ie=c?[]:Z;e:for(;++y<U;){var Ee=a[y],Fe=c?c(Ee):Ee;if(Ee=m||Ee!==0?Ee:0,Y&&Fe===Fe){for(var Re=ie.length;Re--;)if(ie[Re]===Fe)continue e;c&&ie.push(Fe),Z.push(Ee)}else T(ie,Fe,m)||(ie!==Z&&ie.push(Fe),Z.push(Ee))}return Z}function a0(a,c){return c=ku(c,a),a=W1(a,c),a==null||delete a[ds(xi(c))]}function C1(a,c,m,y){return Ac(a,c,m(Ea(a,c)),y)}function xl(a,c,m,y){for(var T=a.length,U=y?T:-1;(y?U--:++U<T)&&c(a[U],U,a););return m?Ti(a,y?0:U,y?U+1:T):Ti(a,y?U+1:0,y?T:U)}function D1(a,c){var m=a;return m instanceof Ct&&(m=m.value()),nc(c,function(y,T){return T.func.apply(T.thisArg,ci([y],T.args))},m)}function o0(a,c,m){var y=a.length;if(y<2)return y?Ou(a[0]):[];for(var T=-1,U=oe(y);++T<y;)for(var Y=a[T],Z=-1;++Z<y;)Z!=T&&(U[T]=gc(U[T]||Y,a[Z],c,m));return Ou(cn(U,1),c,m)}function y1(a,c,m){for(var y=-1,T=a.length,U=c.length,Y={};++y<T;){var Z=y<U?c[y]:e;m(Y,a[y],Z)}return Y}function c0(a){return Sr(a)?a:[]}function l0(a){return typeof a=="function"?a:Xn}function ku(a,c){return ct(a)?a:E0(a,c)?[a]:Q1(jt(a))}var m4=vt;function Nu(a,c,m){var y=a.length;return m=m===e?y:m,!c&&m>=y?a:Ti(a,c,m)}var S1=C||function(a){return $r.clearTimeout(a)};function b1(a,c){if(c)return a.slice();var m=a.length,y=Cl?Cl(m):new a.constructor(m);return a.copy(y),y}function f0(a){var c=new a.constructor(a.byteLength);return new uo(c).set(new uo(a)),c}function v4(a,c){var m=c?f0(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function A4(a){var c=new a.constructor(a.source,Ut.exec(a));return c.lastIndex=a.lastIndex,c}function E4(a){return pc?Yt(pc.call(a)):{}}function _1(a,c){var m=c?f0(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function B1(a,c){if(a!==c){var m=a!==e,y=a===null,T=a===a,U=pi(a),Y=c!==e,Z=c===null,ie=c===c,Ae=pi(c);if(!Z&&!Ae&&!U&&a>c||U&&Y&&ie&&!Z&&!Ae||y&&Y&&ie||!m&&ie||!T)return 1;if(!y&&!U&&!Ae&&a<c||Ae&&m&&T&&!y&&!U||Z&&m&&T||!Y&&T||!ie)return-1}return 0}function w4(a,c,m){for(var y=-1,T=a.criteria,U=c.criteria,Y=T.length,Z=m.length;++y<Y;){var ie=B1(T[y],U[y]);if(ie){if(y>=Z)return ie;var Ae=m[y];return ie*(Ae=="desc"?-1:1)}}return a.index-c.index}function I1(a,c,m,y){for(var T=-1,U=a.length,Y=m.length,Z=-1,ie=c.length,Ae=Nr(U-Y,0),Ee=oe(ie+Ae),Fe=!y;++Z<ie;)Ee[Z]=c[Z];for(;++T<Y;)(Fe||T<U)&&(Ee[m[T]]=a[T]);for(;Ae--;)Ee[Z++]=a[T++];return Ee}function $1(a,c,m,y){for(var T=-1,U=a.length,Y=-1,Z=m.length,ie=-1,Ae=c.length,Ee=Nr(U-Z,0),Fe=oe(Ee+Ae),Re=!y;++T<Ee;)Fe[T]=a[T];for(var He=T;++ie<Ae;)Fe[He+ie]=c[ie];for(;++Y<Z;)(Re||T<U)&&(Fe[He+m[Y]]=a[T++]);return Fe}function Yn(a,c){var m=-1,y=a.length;for(c||(c=oe(y));++m<y;)c[m]=a[m];return c}function ps(a,c,m,y){var T=!m;m||(m={});for(var U=-1,Y=c.length;++U<Y;){var Z=c[U],ie=y?y(m[Z],a[Z],Z,m,a):e;ie===e&&(ie=a[Z]),T?Js(m,Z,ie):dc(m,Z,ie)}return m}function F4(a,c){return ps(a,A0(a),c)}function C4(a,c){return ps(a,q1(a),c)}function Ol(a,c){return function(m,y){var T=ct(m)?$h:Kw,U=c?c():{};return T(m,a,Ze(y,2),U)}}function ho(a){return vt(function(c,m){var y=-1,T=m.length,U=T>1?m[T-1]:e,Y=T>2?m[2]:e;for(U=a.length>3&&typeof U=="function"?(T--,U):e,Y&&Tn(m[0],m[1],Y)&&(U=T<3?e:U,T=1),c=Yt(c);++y<T;){var Z=m[y];Z&&a(c,Z,y,U)}return c})}function P1(a,c){return function(m,y){if(m==null)return m;if(!Wn(m))return a(m,y);for(var T=m.length,U=c?T:-1,Y=Yt(m);(c?U--:++U<T)&&y(Y[U],U,Y)!==!1;);return m}}function R1(a){return function(c,m,y){for(var T=-1,U=Yt(c),Y=y(c),Z=Y.length;Z--;){var ie=Y[a?Z:++T];if(m(U[ie],ie,U)===!1)break}return c}}function D4(a,c,m){var y=c&w,T=Ec(a);function U(){var Y=this&&this!==$r&&this instanceof U?T:a;return Y.apply(y?m:this,arguments)}return U}function T1(a){return function(c){c=jt(c);var m=qs(c)?Gn(c):e,y=m?m[0]:c.charAt(0),T=m?Nu(m,1).join(""):c.slice(1);return y[a]()+T}}function po(a){return function(c){return nc(Pg($g(c).replace(Pu,"")),a,"")}}function Ec(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var m=fo(a.prototype),y=a.apply(m,c);return hr(y)?y:m}}function y4(a,c,m){var y=Ec(a);function T(){for(var U=arguments.length,Y=oe(U),Z=U,ie=go(T);Z--;)Y[Z]=arguments[Z];var Ae=U<3&&Y[0]!==ie&&Y[U-1]!==ie?[]:li(Y,ie);if(U-=Ae.length,U<m)return L1(a,c,kl,T.placeholder,e,Y,Ae,e,e,m-U);var Ee=this&&this!==$r&&this instanceof T?y:a;return $n(Ee,this,Y)}return T}function x1(a){return function(c,m,y){var T=Yt(c);if(!Wn(c)){var U=Ze(m,3);c=Gr(c),m=function(Z){return U(T[Z],Z,T)}}var Y=a(c,m,y);return Y>-1?T[U?c[Y]:Y]:e}}function O1(a){return Zs(function(c){var m=c.length,y=m,T=Pi.prototype.thru;for(a&&c.reverse();y--;){var U=c[y];if(typeof U!="function")throw new zn(s);if(T&&!Y&&Hl(U)=="wrapper")var Y=new Pi([],!0)}for(y=Y?y:m;++y<m;){U=c[y];var Z=Hl(U),ie=Z=="wrapper"?m0(U):e;ie&&w0(ie[0])&&ie[1]==(_|A|S|K)&&!ie[4].length&&ie[9]==1?Y=Y[Hl(ie[0])].apply(Y,ie[3]):Y=U.length==1&&w0(U)?Y[Z]():Y.thru(U)}return function(){var Ae=arguments,Ee=Ae[0];if(Y&&Ae.length==1&&ct(Ee))return Y.plant(Ee).value();for(var Fe=0,Re=m?c[Fe].apply(this,Ae):Ee;++Fe<m;)Re=c[Fe].call(this,Re);return Re}})}function kl(a,c,m,y,T,U,Y,Z,ie,Ae){var Ee=c&_,Fe=c&w,Re=c&v,He=c&(A|F),et=c&G,gt=Re?e:Ec(a);function tt(){for(var wt=arguments.length,St=oe(wt),di=wt;di--;)St[di]=arguments[di];if(He)var xn=go(tt),gi=ml(St,xn);if(y&&(St=I1(St,y,T,He)),U&&(St=$1(St,U,Y,He)),wt-=gi,He&&wt<Ae){var br=li(St,xn);return L1(a,c,kl,tt.placeholder,m,St,br,Z,ie,Ae-wt)}var Ji=Fe?m:this,ru=Re?Ji[a]:a;return wt=St.length,Z?St=K4(St,Z):et&&wt>1&&St.reverse(),Ee&&ie<wt&&(St.length=ie),this&&this!==$r&&this instanceof tt&&(ru=gt||Ec(ru)),ru.apply(Ji,St)}return tt}function k1(a,c){return function(m,y){return Zw(m,a,c(y),{})}}function Nl(a,c){return function(m,y){var T;if(m===e&&y===e)return c;if(m!==e&&(T=m),y!==e){if(T===e)return y;typeof m=="string"||typeof y=="string"?(m=hi(m),y=hi(y)):(m=F1(m),y=F1(y)),T=a(m,y)}return T}}function h0(a){return Zs(function(c){return c=te(c,dn(Ze())),vt(function(m){var y=this;return a(c,function(T){return $n(T,y,m)})})})}function Ll(a,c){c=c===e?" ":hi(c);var m=c.length;if(m<2)return m?s0(c,a):c;var y=s0(c,M(a/Ks(c)));return qs(c)?Nu(Gn(y),0,a).join(""):y.slice(0,a)}function S4(a,c,m,y){var T=c&w,U=Ec(a);function Y(){for(var Z=-1,ie=arguments.length,Ae=-1,Ee=y.length,Fe=oe(Ee+ie),Re=this&&this!==$r&&this instanceof Y?U:a;++Ae<Ee;)Fe[Ae]=y[Ae];for(;ie--;)Fe[Ae++]=arguments[++Z];return $n(Re,T?m:this,Fe)}return Y}function N1(a){return function(c,m,y){return y&&typeof y!="number"&&Tn(c,m,y)&&(m=y=e),c=tu(c),m===e?(m=c,c=0):m=tu(m),y=y===e?c<m?1:-1:tu(y),l4(c,m,y,a)}}function Ul(a){return function(c,m){return typeof c=="string"&&typeof m=="string"||(c=Oi(c),m=Oi(m)),a(c,m)}}function L1(a,c,m,y,T,U,Y,Z,ie,Ae){var Ee=c&A,Fe=Ee?Y:e,Re=Ee?e:Y,He=Ee?U:e,et=Ee?e:U;c|=Ee?S:B,c&=~(Ee?B:S),c&D||(c&=~(w|v));var gt=[a,c,T,He,Fe,et,Re,Z,ie,Ae],tt=m.apply(e,gt);return w0(a)&&J1(tt,gt),tt.placeholder=y,X1(tt,a,c)}function p0(a){var c=fr[a];return function(m,y){if(m=Oi(m),y=y==null?0:gn(pt(y),292),y&&wr(m)){var T=(jt(m)+"e").split("e"),U=c(T[0]+"e"+(+T[1]+y));return T=(jt(U)+"e").split("e"),+(T[0]+"e"+(+T[1]-y))}return c(m)}}var b4=co&&1/fi(new co([,-0]))[1]==z?function(a){return new co(a)}:O0;function U1(a){return function(c){var m=mn(c);return m==st?cc(c):m==Gt?Za(c):Rh(c,a(c))}}function Xs(a,c,m,y,T,U,Y,Z){var ie=c&v;if(!ie&&typeof a!="function")throw new zn(s);var Ae=y?y.length:0;if(Ae||(c&=~(S|B),y=T=e),Y=Y===e?Y:Nr(pt(Y),0),Z=Z===e?Z:pt(Z),Ae-=T?T.length:0,c&B){var Ee=y,Fe=T;y=T=e}var Re=ie?e:m0(a),He=[a,c,m,y,T,Ee,Fe,U,Y,Z];if(Re&&j4(He,Re),a=He[0],c=He[1],m=He[2],y=He[3],T=He[4],Z=He[9]=He[9]===e?ie?0:a.length:Nr(He[9]-Ae,0),!Z&&c&(A|F)&&(c&=~(A|F)),!c||c==w)var et=D4(a,c,m);else c==A||c==F?et=y4(a,c,Z):(c==S||c==(w|S))&&!T.length?et=S4(a,c,m,y):et=kl.apply(e,He);var gt=Re?E1:J1;return X1(gt(et,He),a,c)}function H1(a,c,m,y){return a===e||Wi(a,Vs[m])&&!Bt.call(y,m)?c:a}function j1(a,c,m,y,T,U){return hr(a)&&hr(c)&&(U.set(c,a),Rl(a,c,e,j1,U),U.delete(c)),a}function _4(a){return Cc(a)?e:a}function M1(a,c,m,y,T,U){var Y=m&p,Z=a.length,ie=c.length;if(Z!=ie&&!(Y&&ie>Z))return!1;var Ae=U.get(a),Ee=U.get(c);if(Ae&&Ee)return Ae==c&&Ee==a;var Fe=-1,Re=!0,He=m&h?new va:e;for(U.set(a,c),U.set(c,a);++Fe<Z;){var et=a[Fe],gt=c[Fe];if(y)var tt=Y?y(gt,et,Fe,c,a,U):y(et,gt,Fe,a,c,U);if(tt!==e){if(tt)continue;Re=!1;break}if(He){if(!hl(c,function(wt,St){if(!ga(He,St)&&(et===wt||T(et,wt,m,y,U)))return He.push(St)})){Re=!1;break}}else if(!(et===gt||T(et,gt,m,y,U))){Re=!1;break}}return U.delete(a),U.delete(c),Re}function B4(a,c,m,y,T,U,Y){switch(m){case be:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case Ue:return!(a.byteLength!=c.byteLength||!U(new uo(a),new uo(c)));case Kt:case Ft:case ze:return Wi(+a,+c);case nr:return a.name==c.name&&a.message==c.message;case Zt:case mt:return a==c+"";case st:var Z=cc;case Gt:var ie=y&p;if(Z||(Z=fi),a.size!=c.size&&!ie)return!1;var Ae=Y.get(a);if(Ae)return Ae==c;y|=h,Y.set(a,c);var Ee=M1(Z(a),Z(c),y,T,U,Y);return Y.delete(a),Ee;case Br:if(pc)return pc.call(a)==pc.call(c)}return!1}function I4(a,c,m,y,T,U){var Y=m&p,Z=d0(a),ie=Z.length,Ae=d0(c),Ee=Ae.length;if(ie!=Ee&&!Y)return!1;for(var Fe=ie;Fe--;){var Re=Z[Fe];if(!(Y?Re in c:Bt.call(c,Re)))return!1}var He=U.get(a),et=U.get(c);if(He&&et)return He==c&&et==a;var gt=!0;U.set(a,c),U.set(c,a);for(var tt=Y;++Fe<ie;){Re=Z[Fe];var wt=a[Re],St=c[Re];if(y)var di=Y?y(St,wt,Re,c,a,U):y(wt,St,Re,a,c,U);if(!(di===e?wt===St||T(wt,St,m,y,U):di)){gt=!1;break}tt||(tt=Re=="constructor")}if(gt&&!tt){var xn=a.constructor,gi=c.constructor;xn!=gi&&"constructor"in a&&"constructor"in c&&!(typeof xn=="function"&&xn instanceof xn&&typeof gi=="function"&&gi instanceof gi)&&(gt=!1)}return U.delete(a),U.delete(c),gt}function Zs(a){return C0(Y1(a,e,ng),a+"")}function d0(a){return o1(a,Gr,A0)}function g0(a){return o1(a,Jn,q1)}var m0=bl?function(a){return bl.get(a)}:O0;function Hl(a){for(var c=a.name+"",m=lo[c],y=Bt.call(lo,c)?m.length:0;y--;){var T=m[y],U=T.func;if(U==null||U==a)return T.name}return c}function go(a){var c=Bt.call(N,"placeholder")?N:a;return c.placeholder}function Ze(){var a=N.iteratee||T0;return a=a===T0?f1:a,arguments.length?a(arguments[0],arguments[1]):a}function jl(a,c){var m=a.__data__;return N4(c)?m[typeof c=="string"?"string":"hash"]:m.map}function v0(a){for(var c=Gr(a),m=c.length;m--;){var y=c[m],T=a[y];c[m]=[y,T,G1(T)]}return c}function wa(a,c){var m=xh(a,c);return l1(m)?m:e}function $4(a){var c=Bt.call(a,zs),m=a[zs];try{a[zs]=e;var y=!0}catch{}var T=io.call(a);return y&&(c?a[zs]=m:delete a[zs]),T}var A0=le?function(a){return a==null?[]:(a=Yt(a),oi(le(a),function(c){return yl.call(a,c)}))}:k0,q1=le?function(a){for(var c=[];a;)ci(c,A0(a)),a=ao(a);return c}:k0,mn=Rn;(Gh&&mn(new Gh(new ArrayBuffer(1)))!=be||lc&&mn(new lc)!=st||zh&&mn(zh.resolve())!=Tt||co&&mn(new co)!=Gt||fc&&mn(new fc)!=Qr)&&(mn=function(a){var c=Rn(a),m=c==je?a.constructor:e,y=m?Fa(m):"";if(y)switch(y){case hw:return be;case pw:return st;case dw:return Tt;case gw:return Gt;case mw:return Qr}return c});function P4(a,c,m){for(var y=-1,T=m.length;++y<T;){var U=m[y],Y=U.size;switch(U.type){case"drop":a+=Y;break;case"dropRight":c-=Y;break;case"take":c=gn(c,a+Y);break;case"takeRight":a=Nr(a,c-Y);break}}return{start:a,end:c}}function R4(a){var c=a.match(Le);return c?c[1].split(ke):[]}function K1(a,c,m){c=ku(c,a);for(var y=-1,T=c.length,U=!1;++y<T;){var Y=ds(c[y]);if(!(U=a!=null&&m(a,Y)))break;a=a[Y]}return U||++y!=T?U:(T=a==null?0:a.length,!!T&&Yl(T)&&Qs(Y,T)&&(ct(a)||Ca(a)))}function T4(a){var c=a.length,m=new a.constructor(c);return c&&typeof a[0]=="string"&&Bt.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function V1(a){return typeof a.constructor=="function"&&!wc(a)?fo(ao(a)):{}}function x4(a,c,m){var y=a.constructor;switch(c){case Ue:return f0(a);case Kt:case Ft:return new y(+a);case be:return v4(a,m);case mr:case en:case ut:case Us:case tn:case ge:case ns:case _t:case qr:return _1(a,m);case st:return new y;case ze:case mt:return new y(a);case Zt:return A4(a);case Gt:return new y;case Br:return E4(a)}}function O4(a,c){var m=c.length;if(!m)return a;var y=m-1;return c[y]=(m>1?"& ":"")+c[y],c=c.join(m>2?", ":" "),a.replace(fe,`{
/* [wrapped with `+c+`] */
`)}function k4(a){return ct(a)||Ca(a)||!!(Sl&&a&&a[Sl])}function Qs(a,c){var m=typeof a;return c=c??J,!!c&&(m=="number"||m!="symbol"&&vr.test(a))&&a>-1&&a%1==0&&a<c}function Tn(a,c,m){if(!hr(m))return!1;var y=typeof c;return(y=="number"?Wn(m)&&Qs(c,m.length):y=="string"&&c in m)?Wi(m[c],a):!1}function E0(a,c){if(ct(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||pi(a)?!0:us.test(a)||!$u.test(a)||c!=null&&a in Yt(c)}function N4(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}function w0(a){var c=Hl(a),m=N[c];if(typeof m!="function"||!(c in Ct.prototype))return!1;if(a===m)return!0;var y=m0(m);return!!y&&a===y[0]}function L4(a){return!!no&&no in a}var U4=zi?eu:N0;function wc(a){var c=a&&a.constructor,m=typeof c=="function"&&c.prototype||Vs;return a===m}function G1(a){return a===a&&!hr(a)}function z1(a,c){return function(m){return m==null?!1:m[a]===c&&(c!==e||a in Yt(m))}}function H4(a){var c=Gl(a,function(y){return m.size===o&&m.clear(),y}),m=c.cache;return c}function j4(a,c){var m=a[1],y=c[1],T=m|y,U=T<(w|v|_),Y=y==_&&m==A||y==_&&m==K&&a[7].length<=c[8]||y==(_|K)&&c[7].length<=c[8]&&m==A;if(!(U||Y))return a;y&w&&(a[2]=c[2],T|=m&w?0:D);var Z=c[3];if(Z){var ie=a[3];a[3]=ie?I1(ie,Z,c[4]):Z,a[4]=ie?li(a[3],l):c[4]}return Z=c[5],Z&&(ie=a[5],a[5]=ie?$1(ie,Z,c[6]):Z,a[6]=ie?li(a[5],l):c[6]),Z=c[7],Z&&(a[7]=Z),y&_&&(a[8]=a[8]==null?c[8]:gn(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=T,a}function M4(a){var c=[];if(a!=null)for(var m in Yt(a))c.push(m);return c}function q4(a){return io.call(a)}function Y1(a,c,m){return c=Nr(c===e?a.length-1:c,0),function(){for(var y=arguments,T=-1,U=Nr(y.length-c,0),Y=oe(U);++T<U;)Y[T]=y[c+T];T=-1;for(var Z=oe(c+1);++T<c;)Z[T]=y[T];return Z[c]=m(Y),$n(a,this,Z)}}function W1(a,c){return c.length<2?a:Ea(a,Ti(c,0,-1))}function K4(a,c){for(var m=a.length,y=gn(c.length,m),T=Yn(a);y--;){var U=c[y];a[y]=Qs(U,m)?T[U]:e}return a}function F0(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}var J1=Z1(E1),Fc=X||function(a,c){return $r.setTimeout(a,c)},C0=Z1(p4);function X1(a,c,m){var y=c+"";return C0(a,O4(y,V4(R4(y),m)))}function Z1(a){var c=0,m=0;return function(){var y=cw(),T=j-(y-m);if(m=y,T>0){if(++c>=L)return arguments[0]}else c=0;return a.apply(e,arguments)}}function Ml(a,c){var m=-1,y=a.length,T=y-1;for(c=c===e?y:c;++m<c;){var U=i0(m,T),Y=a[U];a[U]=a[m],a[m]=Y}return a.length=c,a}var Q1=H4(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(ra,function(m,y,T,U){c.push(T?U.replace(lt,"$1"):y||m)}),c});function ds(a){if(typeof a=="string"||pi(a))return a;var c=a+"";return c=="0"&&1/a==-z?"-0":c}function Fa(a){if(a!=null){try{return ro.call(a)}catch{}try{return a+""}catch{}}return""}function V4(a,c){return Vn(ce,function(m){var y="_."+m[0];c&m[1]&&!Pn(a,y)&&a.push(y)}),a.sort()}function eg(a){if(a instanceof Ct)return a.clone();var c=new Pi(a.__wrapped__,a.__chain__);return c.__actions__=Yn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}function G4(a,c,m){(m?Tn(a,c,m):c===e)?c=1:c=Nr(pt(c),0);var y=a==null?0:a.length;if(!y||c<1)return[];for(var T=0,U=0,Y=oe(M(y/c));T<y;)Y[U++]=Ti(a,T,T+=c);return Y}function z4(a){for(var c=-1,m=a==null?0:a.length,y=0,T=[];++c<m;){var U=a[c];U&&(T[y++]=U)}return T}function Y4(){var a=arguments.length;if(!a)return[];for(var c=oe(a-1),m=arguments[0],y=a;y--;)c[y-1]=arguments[y];return ci(ct(m)?Yn(m):[m],cn(c,1))}var W4=vt(function(a,c){return Sr(a)?gc(a,cn(c,1,Sr,!0)):[]}),J4=vt(function(a,c){var m=xi(c);return Sr(m)&&(m=e),Sr(a)?gc(a,cn(c,1,Sr,!0),Ze(m,2)):[]}),X4=vt(function(a,c){var m=xi(c);return Sr(m)&&(m=e),Sr(a)?gc(a,cn(c,1,Sr,!0),e,m):[]});function Z4(a,c,m){var y=a==null?0:a.length;return y?(c=m||c===e?1:pt(c),Ti(a,c<0?0:c,y)):[]}function Q4(a,c,m){var y=a==null?0:a.length;return y?(c=m||c===e?1:pt(c),c=y-c,Ti(a,0,c<0?0:c)):[]}function eF(a,c){return a&&a.length?xl(a,Ze(c,3),!0,!0):[]}function tF(a,c){return a&&a.length?xl(a,Ze(c,3),!0):[]}function rF(a,c,m,y){var T=a==null?0:a.length;return T?(m&&typeof m!="number"&&Tn(a,c,m)&&(m=0,y=T),Yw(a,c,m,y)):[]}function tg(a,c,m){var y=a==null?0:a.length;if(!y)return-1;var T=m==null?0:pt(m);return T<0&&(T=Nr(y+T,0)),Pr(a,Ze(c,3),T)}function rg(a,c,m){var y=a==null?0:a.length;if(!y)return-1;var T=y-1;return m!==e&&(T=pt(m),T=m<0?Nr(y+T,0):gn(T,y-1)),Pr(a,Ze(c,3),T,!0)}function ng(a){var c=a==null?0:a.length;return c?cn(a,1):[]}function nF(a){var c=a==null?0:a.length;return c?cn(a,z):[]}function iF(a,c){var m=a==null?0:a.length;return m?(c=c===e?1:pt(c),cn(a,c)):[]}function sF(a){for(var c=-1,m=a==null?0:a.length,y={};++c<m;){var T=a[c];y[T[0]]=T[1]}return y}function ig(a){return a&&a.length?a[0]:e}function uF(a,c,m){var y=a==null?0:a.length;if(!y)return-1;var T=m==null?0:pt(m);return T<0&&(T=Nr(y+T,0)),Tu(a,c,T)}function aF(a){var c=a==null?0:a.length;return c?Ti(a,0,-1):[]}var oF=vt(function(a){var c=te(a,c0);return c.length&&c[0]===a[0]?Qh(c):[]}),cF=vt(function(a){var c=xi(a),m=te(a,c0);return c===xi(m)?c=e:m.pop(),m.length&&m[0]===a[0]?Qh(m,Ze(c,2)):[]}),lF=vt(function(a){var c=xi(a),m=te(a,c0);return c=typeof c=="function"?c:e,c&&m.pop(),m.length&&m[0]===a[0]?Qh(m,e,c):[]});function fF(a,c){return a==null?"":aw.call(a,c)}function xi(a){var c=a==null?0:a.length;return c?a[c-1]:e}function hF(a,c,m){var y=a==null?0:a.length;if(!y)return-1;var T=y;return m!==e&&(T=pt(m),T=T<0?Nr(y+T,0):gn(T,y-1)),c===c?Nh(a,c,T):Pr(a,Ii,T,!0)}function pF(a,c){return a&&a.length?g1(a,pt(c)):e}var dF=vt(sg);function sg(a,c){return a&&a.length&&c&&c.length?n0(a,c):a}function gF(a,c,m){return a&&a.length&&c&&c.length?n0(a,c,Ze(m,2)):a}function mF(a,c,m){return a&&a.length&&c&&c.length?n0(a,c,e,m):a}var vF=Zs(function(a,c){var m=a==null?0:a.length,y=Wh(a,c);return A1(a,te(c,function(T){return Qs(T,m)?+T:T}).sort(B1)),y});function AF(a,c){var m=[];if(!(a&&a.length))return m;var y=-1,T=[],U=a.length;for(c=Ze(c,3);++y<U;){var Y=a[y];c(Y,y,a)&&(m.push(Y),T.push(y))}return A1(a,T),m}function D0(a){return a==null?a:fw.call(a)}function EF(a,c,m){var y=a==null?0:a.length;return y?(m&&typeof m!="number"&&Tn(a,c,m)?(c=0,m=y):(c=c==null?0:pt(c),m=m===e?y:pt(m)),Ti(a,c,m)):[]}function wF(a,c){return Tl(a,c)}function FF(a,c,m){return u0(a,c,Ze(m,2))}function CF(a,c){var m=a==null?0:a.length;if(m){var y=Tl(a,c);if(y<m&&Wi(a[y],c))return y}return-1}function DF(a,c){return Tl(a,c,!0)}function yF(a,c,m){return u0(a,c,Ze(m,2),!0)}function SF(a,c){var m=a==null?0:a.length;if(m){var y=Tl(a,c,!0)-1;if(Wi(a[y],c))return y}return-1}function bF(a){return a&&a.length?w1(a):[]}function _F(a,c){return a&&a.length?w1(a,Ze(c,2)):[]}function BF(a){var c=a==null?0:a.length;return c?Ti(a,1,c):[]}function IF(a,c,m){return a&&a.length?(c=m||c===e?1:pt(c),Ti(a,0,c<0?0:c)):[]}function $F(a,c,m){var y=a==null?0:a.length;return y?(c=m||c===e?1:pt(c),c=y-c,Ti(a,c<0?0:c,y)):[]}function PF(a,c){return a&&a.length?xl(a,Ze(c,3),!1,!0):[]}function RF(a,c){return a&&a.length?xl(a,Ze(c,3)):[]}var TF=vt(function(a){return Ou(cn(a,1,Sr,!0))}),xF=vt(function(a){var c=xi(a);return Sr(c)&&(c=e),Ou(cn(a,1,Sr,!0),Ze(c,2))}),OF=vt(function(a){var c=xi(a);return c=typeof c=="function"?c:e,Ou(cn(a,1,Sr,!0),e,c)});function kF(a){return a&&a.length?Ou(a):[]}function NF(a,c){return a&&a.length?Ou(a,Ze(c,2)):[]}function LF(a,c){return c=typeof c=="function"?c:e,a&&a.length?Ou(a,e,c):[]}function y0(a){if(!(a&&a.length))return[];var c=0;return a=oi(a,function(m){if(Sr(m))return c=Nr(m.length,c),!0}),uc(c,function(m){return te(a,Ms(m))})}function ug(a,c){if(!(a&&a.length))return[];var m=y0(a);return c==null?m:te(m,function(y){return $n(c,e,y)})}var UF=vt(function(a,c){return Sr(a)?gc(a,c):[]}),HF=vt(function(a){return o0(oi(a,Sr))}),jF=vt(function(a){var c=xi(a);return Sr(c)&&(c=e),o0(oi(a,Sr),Ze(c,2))}),MF=vt(function(a){var c=xi(a);return c=typeof c=="function"?c:e,o0(oi(a,Sr),e,c)}),qF=vt(y0);function KF(a,c){return y1(a||[],c||[],dc)}function VF(a,c){return y1(a||[],c||[],Ac)}var GF=vt(function(a){var c=a.length,m=c>1?a[c-1]:e;return m=typeof m=="function"?(a.pop(),m):e,ug(a,m)});function ag(a){var c=N(a);return c.__chain__=!0,c}function zF(a,c){return c(a),a}function ql(a,c){return c(a)}var YF=Zs(function(a){var c=a.length,m=c?a[0]:0,y=this.__wrapped__,T=function(U){return Wh(U,a)};return c>1||this.__actions__.length||!(y instanceof Ct)||!Qs(m)?this.thru(T):(y=y.slice(m,+m+(c?1:0)),y.__actions__.push({func:ql,args:[T],thisArg:e}),new Pi(y,this.__chain__).thru(function(U){return c&&!U.length&&U.push(e),U}))});function WF(){return ag(this)}function JF(){return new Pi(this.value(),this.__chain__)}function XF(){this.__values__===e&&(this.__values__=Fg(this.value()));var a=this.__index__>=this.__values__.length,c=a?e:this.__values__[this.__index__++];return{done:a,value:c}}function ZF(){return this}function QF(a){for(var c,m=this;m instanceof Bl;){var y=eg(m);y.__index__=0,y.__values__=e,c?T.__wrapped__=y:c=y;var T=y;m=m.__wrapped__}return T.__wrapped__=a,c}function eC(){var a=this.__wrapped__;if(a instanceof Ct){var c=a;return this.__actions__.length&&(c=new Ct(this)),c=c.reverse(),c.__actions__.push({func:ql,args:[D0],thisArg:e}),new Pi(c,this.__chain__)}return this.thru(D0)}function tC(){return D1(this.__wrapped__,this.__actions__)}var rC=Ol(function(a,c,m){Bt.call(a,m)?++a[m]:Js(a,m,1)});function nC(a,c,m){var y=ct(a)?ot:zw;return m&&Tn(a,c,m)&&(c=e),y(a,Ze(c,3))}function iC(a,c){var m=ct(a)?oi:u1;return m(a,Ze(c,3))}var sC=x1(tg),uC=x1(rg);function aC(a,c){return cn(Kl(a,c),1)}function oC(a,c){return cn(Kl(a,c),z)}function cC(a,c,m){return m=m===e?1:pt(m),cn(Kl(a,c),m)}function og(a,c){var m=ct(a)?Vn:xu;return m(a,Ze(c,3))}function cg(a,c){var m=ct(a)?I:s1;return m(a,Ze(c,3))}var lC=Ol(function(a,c,m){Bt.call(a,m)?a[m].push(c):Js(a,m,[c])});function fC(a,c,m,y){a=Wn(a)?a:vo(a),m=m&&!y?pt(m):0;var T=a.length;return m<0&&(m=Nr(T+m,0)),Wl(a)?m<=T&&a.indexOf(c,m)>-1:!!T&&Tu(a,c,m)>-1}var hC=vt(function(a,c,m){var y=-1,T=typeof c=="function",U=Wn(a)?oe(a.length):[];return xu(a,function(Y){U[++y]=T?$n(c,Y,m):mc(Y,c,m)}),U}),pC=Ol(function(a,c,m){Js(a,m,c)});function Kl(a,c){var m=ct(a)?te:h1;return m(a,Ze(c,3))}function dC(a,c,m,y){return a==null?[]:(ct(c)||(c=c==null?[]:[c]),m=y?e:m,ct(m)||(m=m==null?[]:[m]),m1(a,c,m))}var gC=Ol(function(a,c,m){a[m?0:1].push(c)},function(){return[[],[]]});function mC(a,c,m){var y=ct(a)?nc:pl,T=arguments.length<3;return y(a,Ze(c,4),m,T,xu)}function vC(a,c,m){var y=ct(a)?Jd:pl,T=arguments.length<3;return y(a,Ze(c,4),m,T,s1)}function AC(a,c){var m=ct(a)?oi:u1;return m(a,zl(Ze(c,3)))}function EC(a){var c=ct(a)?t1:f4;return c(a)}function wC(a,c,m){(m?Tn(a,c,m):c===e)?c=1:c=pt(c);var y=ct(a)?Mw:h4;return y(a,c)}function FC(a){var c=ct(a)?qw:d4;return c(a)}function CC(a){if(a==null)return 0;if(Wn(a))return Wl(a)?Ks(a):a.length;var c=mn(a);return c==st||c==Gt?a.size:t0(a).length}function DC(a,c,m){var y=ct(a)?hl:g4;return m&&Tn(a,c,m)&&(c=e),y(a,Ze(c,3))}var yC=vt(function(a,c){if(a==null)return[];var m=c.length;return m>1&&Tn(a,c[0],c[1])?c=[]:m>2&&Tn(c[0],c[1],c[2])&&(c=[c[0]]),m1(a,cn(c,1),[])}),Vl=k||function(){return $r.Date.now()};function SC(a,c){if(typeof c!="function")throw new zn(s);return a=pt(a),function(){if(--a<1)return c.apply(this,arguments)}}function lg(a,c,m){return c=m?e:c,c=a&&c==null?a.length:c,Xs(a,_,e,e,e,e,c)}function fg(a,c){var m;if(typeof c!="function")throw new zn(s);return a=pt(a),function(){return--a>0&&(m=c.apply(this,arguments)),a<=1&&(c=e),m}}var S0=vt(function(a,c,m){var y=w;if(m.length){var T=li(m,go(S0));y|=S}return Xs(a,y,c,m,T)}),hg=vt(function(a,c,m){var y=w|v;if(m.length){var T=li(m,go(hg));y|=S}return Xs(c,y,a,m,T)});function pg(a,c,m){c=m?e:c;var y=Xs(a,A,e,e,e,e,e,c);return y.placeholder=pg.placeholder,y}function dg(a,c,m){c=m?e:c;var y=Xs(a,F,e,e,e,e,e,c);return y.placeholder=dg.placeholder,y}function gg(a,c,m){var y,T,U,Y,Z,ie,Ae=0,Ee=!1,Fe=!1,Re=!0;if(typeof a!="function")throw new zn(s);c=Oi(c)||0,hr(m)&&(Ee=!!m.leading,Fe="maxWait"in m,U=Fe?Nr(Oi(m.maxWait)||0,c):U,Re="trailing"in m?!!m.trailing:Re);function He(br){var Ji=y,ru=T;return y=T=e,Ae=br,Y=a.apply(ru,Ji),Y}function et(br){return Ae=br,Z=Fc(wt,c),Ee?He(br):Y}function gt(br){var Ji=br-ie,ru=br-Ae,xg=c-Ji;return Fe?gn(xg,U-ru):xg}function tt(br){var Ji=br-ie,ru=br-Ae;return ie===e||Ji>=c||Ji<0||Fe&&ru>=U}function wt(){var br=Vl();if(tt(br))return St(br);Z=Fc(wt,gt(br))}function St(br){return Z=e,Re&&y?He(br):(y=T=e,Y)}function di(){Z!==e&&S1(Z),Ae=0,y=ie=T=Z=e}function xn(){return Z===e?Y:St(Vl())}function gi(){var br=Vl(),Ji=tt(br);if(y=arguments,T=this,ie=br,Ji){if(Z===e)return et(ie);if(Fe)return S1(Z),Z=Fc(wt,c),He(ie)}return Z===e&&(Z=Fc(wt,c)),Y}return gi.cancel=di,gi.flush=xn,gi}var bC=vt(function(a,c){return i1(a,1,c)}),_C=vt(function(a,c,m){return i1(a,Oi(c)||0,m)});function BC(a){return Xs(a,G)}function Gl(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new zn(s);var m=function(){var y=arguments,T=c?c.apply(this,y):y[0],U=m.cache;if(U.has(T))return U.get(T);var Y=a.apply(this,y);return m.cache=U.set(T,Y)||U,Y};return m.cache=new(Gl.Cache||Ws),m}Gl.Cache=Ws;function zl(a){if(typeof a!="function")throw new zn(s);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function IC(a){return fg(2,a)}var $C=m4(function(a,c){c=c.length==1&&ct(c[0])?te(c[0],dn(Ze())):te(cn(c,1),dn(Ze()));var m=c.length;return vt(function(y){for(var T=-1,U=gn(y.length,m);++T<U;)y[T]=c[T].call(this,y[T]);return $n(a,this,y)})}),b0=vt(function(a,c){var m=li(c,go(b0));return Xs(a,S,e,c,m)}),mg=vt(function(a,c){var m=li(c,go(mg));return Xs(a,B,e,c,m)}),PC=Zs(function(a,c){return Xs(a,K,e,e,e,c)});function RC(a,c){if(typeof a!="function")throw new zn(s);return c=c===e?c:pt(c),vt(a,c)}function TC(a,c){if(typeof a!="function")throw new zn(s);return c=c==null?0:Nr(pt(c),0),vt(function(m){var y=m[c],T=Nu(m,0,c);return y&&ci(T,y),$n(a,this,T)})}function xC(a,c,m){var y=!0,T=!0;if(typeof a!="function")throw new zn(s);return hr(m)&&(y="leading"in m?!!m.leading:y,T="trailing"in m?!!m.trailing:T),gg(a,c,{leading:y,maxWait:c,trailing:T})}function OC(a){return lg(a,1)}function kC(a,c){return b0(l0(c),a)}function NC(){if(!arguments.length)return[];var a=arguments[0];return ct(a)?a:[a]}function LC(a){return Ri(a,E)}function UC(a,c){return c=typeof c=="function"?c:e,Ri(a,E,c)}function HC(a){return Ri(a,f|E)}function jC(a,c){return c=typeof c=="function"?c:e,Ri(a,f|E,c)}function MC(a,c){return c==null||n1(a,c,Gr(c))}function Wi(a,c){return a===c||a!==a&&c!==c}var qC=Ul(Zh),KC=Ul(function(a,c){return a>=c}),Ca=c1(function(){return arguments}())?c1:function(a){return Fr(a)&&Bt.call(a,"callee")&&!yl.call(a,"callee")},ct=oe.isArray,VC=ul?dn(ul):Qw;function Wn(a){return a!=null&&Yl(a.length)&&!eu(a)}function Sr(a){return Fr(a)&&Wn(a)}function GC(a){return a===!0||a===!1||Fr(a)&&Rn(a)==Kt}var Lu=Wt||N0,zC=al?dn(al):e4;function YC(a){return Fr(a)&&a.nodeType===1&&!Cc(a)}function WC(a){if(a==null)return!0;if(Wn(a)&&(ct(a)||typeof a=="string"||typeof a.splice=="function"||Lu(a)||mo(a)||Ca(a)))return!a.length;var c=mn(a);if(c==st||c==Gt)return!a.size;if(wc(a))return!t0(a).length;for(var m in a)if(Bt.call(a,m))return!1;return!0}function JC(a,c){return vc(a,c)}function XC(a,c,m){m=typeof m=="function"?m:e;var y=m?m(a,c):e;return y===e?vc(a,c,e,m):!!y}function _0(a){if(!Fr(a))return!1;var c=Rn(a);return c==nr||c==gr||typeof a.message=="string"&&typeof a.name=="string"&&!Cc(a)}function ZC(a){return typeof a=="number"&&wr(a)}function eu(a){if(!hr(a))return!1;var c=Rn(a);return c==ht||c==Vt||c==_r||c==Zr}function vg(a){return typeof a=="number"&&a==pt(a)}function Yl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=J}function hr(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function Fr(a){return a!=null&&typeof a=="object"}var Ag=ol?dn(ol):r4;function QC(a,c){return a===c||e0(a,c,v0(c))}function e6(a,c,m){return m=typeof m=="function"?m:e,e0(a,c,v0(c),m)}function t6(a){return Eg(a)&&a!=+a}function r6(a){if(U4(a))throw new nt(n);return l1(a)}function n6(a){return a===null}function i6(a){return a==null}function Eg(a){return typeof a=="number"||Fr(a)&&Rn(a)==ze}function Cc(a){if(!Fr(a)||Rn(a)!=je)return!1;var c=ao(a);if(c===null)return!0;var m=Bt.call(c,"constructor")&&c.constructor;return typeof m=="function"&&m instanceof m&&ro.call(m)==qh}var B0=cl?dn(cl):n4;function s6(a){return vg(a)&&a>=-J&&a<=J}var wg=ll?dn(ll):i4;function Wl(a){return typeof a=="string"||!ct(a)&&Fr(a)&&Rn(a)==mt}function pi(a){return typeof a=="symbol"||Fr(a)&&Rn(a)==Br}var mo=fl?dn(fl):s4;function u6(a){return a===e}function a6(a){return Fr(a)&&mn(a)==Qr}function o6(a){return Fr(a)&&Rn(a)==Dt}var c6=Ul(r0),l6=Ul(function(a,c){return a<=c});function Fg(a){if(!a)return[];if(Wn(a))return Wl(a)?Gn(a):Yn(a);if(Gs&&a[Gs])return kh(a[Gs]());var c=mn(a),m=c==st?cc:c==Gt?fi:vo;return m(a)}function tu(a){if(!a)return a===0?a:0;if(a=Oi(a),a===z||a===-z){var c=a<0?-1:1;return c*se}return a===a?a:0}function pt(a){var c=tu(a),m=c%1;return c===c?m?c-m:c:0}function Cg(a){return a?Aa(pt(a),0,Ce):0}function Oi(a){if(typeof a=="number")return a;if(pi(a))return ye;if(hr(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=hr(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=ac(a);var m=_i.test(a);return m||pn.test(a)?Bh(a.slice(2),m?2:8):jn.test(a)?ye:+a}function Dg(a){return ps(a,Jn(a))}function f6(a){return a?Aa(pt(a),-J,J):a===0?a:0}function jt(a){return a==null?"":hi(a)}var h6=ho(function(a,c){if(wc(c)||Wn(c)){ps(c,Gr(c),a);return}for(var m in c)Bt.call(c,m)&&dc(a,m,c[m])}),yg=ho(function(a,c){ps(c,Jn(c),a)}),Jl=ho(function(a,c,m,y){ps(c,Jn(c),a,y)}),p6=ho(function(a,c,m,y){ps(c,Gr(c),a,y)}),d6=Zs(Wh);function g6(a,c){var m=fo(a);return c==null?m:r1(m,c)}var m6=vt(function(a,c){a=Yt(a);var m=-1,y=c.length,T=y>2?c[2]:e;for(T&&Tn(c[0],c[1],T)&&(y=1);++m<y;)for(var U=c[m],Y=Jn(U),Z=-1,ie=Y.length;++Z<ie;){var Ae=Y[Z],Ee=a[Ae];(Ee===e||Wi(Ee,Vs[Ae])&&!Bt.call(a,Ae))&&(a[Ae]=U[Ae])}return a}),v6=vt(function(a){return a.push(e,j1),$n(Sg,e,a)});function A6(a,c){return Ye(a,Ze(c,3),hs)}function E6(a,c){return Ye(a,Ze(c,3),Xh)}function w6(a,c){return a==null?a:Jh(a,Ze(c,3),Jn)}function F6(a,c){return a==null?a:a1(a,Ze(c,3),Jn)}function C6(a,c){return a&&hs(a,Ze(c,3))}function D6(a,c){return a&&Xh(a,Ze(c,3))}function y6(a){return a==null?[]:Pl(a,Gr(a))}function S6(a){return a==null?[]:Pl(a,Jn(a))}function I0(a,c,m){var y=a==null?e:Ea(a,c);return y===e?m:y}function b6(a,c){return a!=null&&K1(a,c,Ww)}function $0(a,c){return a!=null&&K1(a,c,Jw)}var _6=k1(function(a,c,m){c!=null&&typeof c.toString!="function"&&(c=io.call(c)),a[c]=m},R0(Xn)),B6=k1(function(a,c,m){c!=null&&typeof c.toString!="function"&&(c=io.call(c)),Bt.call(a,c)?a[c].push(m):a[c]=[m]},Ze),I6=vt(mc);function Gr(a){return Wn(a)?e1(a):t0(a)}function Jn(a){return Wn(a)?e1(a,!0):u4(a)}function $6(a,c){var m={};return c=Ze(c,3),hs(a,function(y,T,U){Js(m,c(y,T,U),y)}),m}function P6(a,c){var m={};return c=Ze(c,3),hs(a,function(y,T,U){Js(m,T,c(y,T,U))}),m}var R6=ho(function(a,c,m){Rl(a,c,m)}),Sg=ho(function(a,c,m,y){Rl(a,c,m,y)}),T6=Zs(function(a,c){var m={};if(a==null)return m;var y=!1;c=te(c,function(U){return U=ku(U,a),y||(y=U.length>1),U}),ps(a,g0(a),m),y&&(m=Ri(m,f|d|E,_4));for(var T=c.length;T--;)a0(m,c[T]);return m});function x6(a,c){return bg(a,zl(Ze(c)))}var O6=Zs(function(a,c){return a==null?{}:o4(a,c)});function bg(a,c){if(a==null)return{};var m=te(g0(a),function(y){return[y]});return c=Ze(c),v1(a,m,function(y,T){return c(y,T[0])})}function k6(a,c,m){c=ku(c,a);var y=-1,T=c.length;for(T||(T=1,a=e);++y<T;){var U=a==null?e:a[ds(c[y])];U===e&&(y=T,U=m),a=eu(U)?U.call(a):U}return a}function N6(a,c,m){return a==null?a:Ac(a,c,m)}function L6(a,c,m,y){return y=typeof y=="function"?y:e,a==null?a:Ac(a,c,m,y)}var _g=U1(Gr),Bg=U1(Jn);function U6(a,c,m){var y=ct(a),T=y||Lu(a)||mo(a);if(c=Ze(c,4),m==null){var U=a&&a.constructor;T?m=y?new U:[]:hr(a)?m=eu(U)?fo(ao(a)):{}:m={}}return(T?Vn:hs)(a,function(Y,Z,ie){return c(m,Y,Z,ie)}),m}function H6(a,c){return a==null?!0:a0(a,c)}function j6(a,c,m){return a==null?a:C1(a,c,l0(m))}function M6(a,c,m,y){return y=typeof y=="function"?y:e,a==null?a:C1(a,c,l0(m),y)}function vo(a){return a==null?[]:da(a,Gr(a))}function q6(a){return a==null?[]:da(a,Jn(a))}function K6(a,c,m){return m===e&&(m=c,c=e),m!==e&&(m=Oi(m),m=m===m?m:0),c!==e&&(c=Oi(c),c=c===c?c:0),Aa(Oi(a),c,m)}function V6(a,c,m){return c=tu(c),m===e?(m=c,c=0):m=tu(m),a=Oi(a),Xw(a,c,m)}function G6(a,c,m){if(m&&typeof m!="boolean"&&Tn(a,c,m)&&(c=m=e),m===e&&(typeof c=="boolean"?(m=c,c=e):typeof a=="boolean"&&(m=a,a=e)),a===e&&c===e?(a=0,c=1):(a=tu(a),c===e?(c=a,a=0):c=tu(c)),a>c){var y=a;a=c,c=y}if(m||a%1||c%1){var T=Zd();return gn(a+T*(c-a+_h("1e-"+((T+"").length-1))),c)}return i0(a,c)}var z6=po(function(a,c,m){return c=c.toLowerCase(),a+(m?Ig(c):c)});function Ig(a){return P0(jt(a).toLowerCase())}function $g(a){return a=jt(a),a&&a.replace(nn,oc).replace(In,"")}function Y6(a,c,m){a=jt(a),c=hi(c);var y=a.length;m=m===e?y:Aa(pt(m),0,y);var T=m;return m-=c.length,m>=0&&a.slice(m,T)==c}function W6(a){return a=jt(a),a&&xt.test(a)?a.replace(ss,Th):a}function J6(a){return a=jt(a),a&&na.test(a)?a.replace(as,"\\$&"):a}var X6=po(function(a,c,m){return a+(m?"-":"")+c.toLowerCase()}),Z6=po(function(a,c,m){return a+(m?" ":"")+c.toLowerCase()}),Q6=T1("toLowerCase");function eD(a,c,m){a=jt(a),c=pt(c);var y=c?Ks(a):0;if(!c||y>=c)return a;var T=(c-y)/2;return Ll(ue(T),m)+a+Ll(M(T),m)}function tD(a,c,m){a=jt(a),c=pt(c);var y=c?Ks(a):0;return c&&y<c?a+Ll(c-y,m):a}function rD(a,c,m){a=jt(a),c=pt(c);var y=c?Ks(a):0;return c&&y<c?Ll(c-y,m)+a:a}function nD(a,c,m){return m||c==null?c=0:c&&(c=+c),lw(jt(a).replace(Hs,""),c||0)}function iD(a,c,m){return(m?Tn(a,c,m):c===e)?c=1:c=pt(c),s0(jt(a),c)}function sD(){var a=arguments,c=jt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}var uD=po(function(a,c,m){return a+(m?"_":"")+c.toLowerCase()});function aD(a,c,m){return m&&typeof m!="number"&&Tn(a,c,m)&&(c=m=e),m=m===e?Ce:m>>>0,m?(a=jt(a),a&&(typeof c=="string"||c!=null&&!B0(c))&&(c=hi(c),!c&&qs(a))?Nu(Gn(a),0,m):a.split(c,m)):[]}var oD=po(function(a,c,m){return a+(m?" ":"")+P0(c)});function cD(a,c,m){return a=jt(a),m=m==null?0:Aa(pt(m),0,a.length),c=hi(c),a.slice(m,m+c.length)==c}function lD(a,c,m){var y=N.templateSettings;m&&Tn(a,c,m)&&(c=e),a=jt(a),c=Jl({},c,y,H1);var T=Jl({},c.imports,y.imports,H1),U=Gr(T),Y=da(T,U),Z,ie,Ae=0,Ee=c.interpolate||kr,Fe="__p += '",Re=eo((c.escape||kr).source+"|"+Ee.source+"|"+(Ee===Iu?yr:kr).source+"|"+(c.evaluate||kr).source+"|$","g"),He="//# sourceURL="+(Bt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ch+"]")+`
`;a.replace(Re,function(tt,wt,St,di,xn,gi){return St||(St=di),Fe+=a.slice(Ae,gi).replace(ia,vl),wt&&(Z=!0,Fe+=`' +
__e(`+wt+`) +
'`),xn&&(ie=!0,Fe+=`';
`+xn+`;
__p += '`),St&&(Fe+=`' +
((__t = (`+St+`)) == null ? '' : __t) +
'`),Ae=gi+tt.length,tt}),Fe+=`';
`;var et=Bt.call(c,"variable")&&c.variable;if(!et)Fe=`with (obj) {
`+Fe+`
}
`;else if(at.test(et))throw new nt(u);Fe=(ie?Fe.replace(Vi,""):Fe).replace(bu,"$1").replace(is,"$1;"),Fe="function("+(et||"obj")+`) {
`+(et?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Fe+`return __p
}`;var gt=Rg(function(){return yt(U,He+"return "+Fe).apply(e,Y)});if(gt.source=Fe,_0(gt))throw gt;return gt}function fD(a){return jt(a).toLowerCase()}function hD(a){return jt(a).toUpperCase()}function pD(a,c,m){if(a=jt(a),a&&(m||c===e))return ac(a);if(!a||!(c=hi(c)))return a;var y=Gn(a),T=Gn(c),U=Xa(y,T),Y=gl(y,T)+1;return Nu(y,U,Y).join("")}function dD(a,c,m){if(a=jt(a),a&&(m||c===e))return a.slice(0,Qa(a)+1);if(!a||!(c=hi(c)))return a;var y=Gn(a),T=gl(y,Gn(c))+1;return Nu(y,0,T).join("")}function gD(a,c,m){if(a=jt(a),a&&(m||c===e))return a.replace(Hs,"");if(!a||!(c=hi(c)))return a;var y=Gn(a),T=Xa(y,Gn(c));return Nu(y,T).join("")}function mD(a,c){var m=b,y=P;if(hr(c)){var T="separator"in c?c.separator:T;m="length"in c?pt(c.length):m,y="omission"in c?hi(c.omission):y}a=jt(a);var U=a.length;if(qs(a)){var Y=Gn(a);U=Y.length}if(m>=U)return a;var Z=m-Ks(y);if(Z<1)return y;var ie=Y?Nu(Y,0,Z).join(""):a.slice(0,Z);if(T===e)return ie+y;if(Y&&(Z+=ie.length-Z),B0(T)){if(a.slice(Z).search(T)){var Ae,Ee=ie;for(T.global||(T=eo(T.source,jt(Ut.exec(T))+"g")),T.lastIndex=0;Ae=T.exec(Ee);)var Fe=Ae.index;ie=ie.slice(0,Fe===e?Z:Fe)}}else if(a.indexOf(hi(T),Z)!=Z){var Re=ie.lastIndexOf(T);Re>-1&&(ie=ie.slice(0,Re))}return ie+y}function vD(a){return a=jt(a),a&&Gi.test(a)?a.replace(_u,El):a}var AD=po(function(a,c,m){return a+(m?" ":"")+c.toUpperCase()}),P0=T1("toUpperCase");function Pg(a,c,m){return a=jt(a),c=m?e:c,c===e?Oh(a)?Uh(a):ic(a):a.match(c)||[]}var Rg=vt(function(a,c){try{return $n(a,e,c)}catch(m){return _0(m)?m:new nt(m)}}),ED=Zs(function(a,c){return Vn(c,function(m){m=ds(m),Js(a,m,S0(a[m],a))}),a});function wD(a){var c=a==null?0:a.length,m=Ze();return a=c?te(a,function(y){if(typeof y[1]!="function")throw new zn(s);return[m(y[0]),y[1]]}):[],vt(function(y){for(var T=-1;++T<c;){var U=a[T];if($n(U[0],this,y))return $n(U[1],this,y)}})}function FD(a){return Gw(Ri(a,f))}function R0(a){return function(){return a}}function CD(a,c){return a==null||a!==a?c:a}var DD=O1(),yD=O1(!0);function Xn(a){return a}function T0(a){return f1(typeof a=="function"?a:Ri(a,f))}function SD(a){return p1(Ri(a,f))}function bD(a,c){return d1(a,Ri(c,f))}var _D=vt(function(a,c){return function(m){return mc(m,a,c)}}),BD=vt(function(a,c){return function(m){return mc(a,m,c)}});function x0(a,c,m){var y=Gr(c),T=Pl(c,y);m==null&&!(hr(c)&&(T.length||!y.length))&&(m=c,c=a,a=this,T=Pl(c,Gr(c)));var U=!(hr(m)&&"chain"in m)||!!m.chain,Y=eu(a);return Vn(T,function(Z){var ie=c[Z];a[Z]=ie,Y&&(a.prototype[Z]=function(){var Ae=this.__chain__;if(U||Ae){var Ee=a(this.__wrapped__),Fe=Ee.__actions__=Yn(this.__actions__);return Fe.push({func:ie,args:arguments,thisArg:a}),Ee.__chain__=Ae,Ee}return ie.apply(a,ci([this.value()],arguments))})}),a}function ID(){return $r._===this&&($r._=Kh),this}function O0(){}function $D(a){return a=pt(a),vt(function(c){return g1(c,a)})}var PD=h0(te),RD=h0(ot),TD=h0(hl);function Tg(a){return E0(a)?Ms(ds(a)):c4(a)}function xD(a){return function(c){return a==null?e:Ea(a,c)}}var OD=N1(),kD=N1(!0);function k0(){return[]}function N0(){return!1}function ND(){return{}}function LD(){return""}function UD(){return!0}function HD(a,c){if(a=pt(a),a<1||a>J)return[];var m=Ce,y=gn(a,Ce);c=Ze(c),a-=Ce;for(var T=uc(y,c);++m<a;)c(m);return T}function jD(a){return ct(a)?te(a,ds):pi(a)?[a]:Yn(Q1(jt(a)))}function MD(a){var c=++Mh;return jt(a)+c}var qD=Nl(function(a,c){return a+c},0),KD=p0("ceil"),VD=Nl(function(a,c){return a/c},1),GD=p0("floor");function zD(a){return a&&a.length?$l(a,Xn,Zh):e}function YD(a,c){return a&&a.length?$l(a,Ze(c,2),Zh):e}function WD(a){return sc(a,Xn)}function JD(a,c){return sc(a,Ze(c,2))}function XD(a){return a&&a.length?$l(a,Xn,r0):e}function ZD(a,c){return a&&a.length?$l(a,Ze(c,2),r0):e}var QD=Nl(function(a,c){return a*c},1),ey=p0("round"),ty=Nl(function(a,c){return a-c},0);function ry(a){return a&&a.length?Ja(a,Xn):0}function ny(a,c){return a&&a.length?Ja(a,Ze(c,2)):0}return N.after=SC,N.ary=lg,N.assign=h6,N.assignIn=yg,N.assignInWith=Jl,N.assignWith=p6,N.at=d6,N.before=fg,N.bind=S0,N.bindAll=ED,N.bindKey=hg,N.castArray=NC,N.chain=ag,N.chunk=G4,N.compact=z4,N.concat=Y4,N.cond=wD,N.conforms=FD,N.constant=R0,N.countBy=rC,N.create=g6,N.curry=pg,N.curryRight=dg,N.debounce=gg,N.defaults=m6,N.defaultsDeep=v6,N.defer=bC,N.delay=_C,N.difference=W4,N.differenceBy=J4,N.differenceWith=X4,N.drop=Z4,N.dropRight=Q4,N.dropRightWhile=eF,N.dropWhile=tF,N.fill=rF,N.filter=iC,N.flatMap=aC,N.flatMapDeep=oC,N.flatMapDepth=cC,N.flatten=ng,N.flattenDeep=nF,N.flattenDepth=iF,N.flip=BC,N.flow=DD,N.flowRight=yD,N.fromPairs=sF,N.functions=y6,N.functionsIn=S6,N.groupBy=lC,N.initial=aF,N.intersection=oF,N.intersectionBy=cF,N.intersectionWith=lF,N.invert=_6,N.invertBy=B6,N.invokeMap=hC,N.iteratee=T0,N.keyBy=pC,N.keys=Gr,N.keysIn=Jn,N.map=Kl,N.mapKeys=$6,N.mapValues=P6,N.matches=SD,N.matchesProperty=bD,N.memoize=Gl,N.merge=R6,N.mergeWith=Sg,N.method=_D,N.methodOf=BD,N.mixin=x0,N.negate=zl,N.nthArg=$D,N.omit=T6,N.omitBy=x6,N.once=IC,N.orderBy=dC,N.over=PD,N.overArgs=$C,N.overEvery=RD,N.overSome=TD,N.partial=b0,N.partialRight=mg,N.partition=gC,N.pick=O6,N.pickBy=bg,N.property=Tg,N.propertyOf=xD,N.pull=dF,N.pullAll=sg,N.pullAllBy=gF,N.pullAllWith=mF,N.pullAt=vF,N.range=OD,N.rangeRight=kD,N.rearg=PC,N.reject=AC,N.remove=AF,N.rest=RC,N.reverse=D0,N.sampleSize=wC,N.set=N6,N.setWith=L6,N.shuffle=FC,N.slice=EF,N.sortBy=yC,N.sortedUniq=bF,N.sortedUniqBy=_F,N.split=aD,N.spread=TC,N.tail=BF,N.take=IF,N.takeRight=$F,N.takeRightWhile=PF,N.takeWhile=RF,N.tap=zF,N.throttle=xC,N.thru=ql,N.toArray=Fg,N.toPairs=_g,N.toPairsIn=Bg,N.toPath=jD,N.toPlainObject=Dg,N.transform=U6,N.unary=OC,N.union=TF,N.unionBy=xF,N.unionWith=OF,N.uniq=kF,N.uniqBy=NF,N.uniqWith=LF,N.unset=H6,N.unzip=y0,N.unzipWith=ug,N.update=j6,N.updateWith=M6,N.values=vo,N.valuesIn=q6,N.without=UF,N.words=Pg,N.wrap=kC,N.xor=HF,N.xorBy=jF,N.xorWith=MF,N.zip=qF,N.zipObject=KF,N.zipObjectDeep=VF,N.zipWith=GF,N.entries=_g,N.entriesIn=Bg,N.extend=yg,N.extendWith=Jl,x0(N,N),N.add=qD,N.attempt=Rg,N.camelCase=z6,N.capitalize=Ig,N.ceil=KD,N.clamp=K6,N.clone=LC,N.cloneDeep=HC,N.cloneDeepWith=jC,N.cloneWith=UC,N.conformsTo=MC,N.deburr=$g,N.defaultTo=CD,N.divide=VD,N.endsWith=Y6,N.eq=Wi,N.escape=W6,N.escapeRegExp=J6,N.every=nC,N.find=sC,N.findIndex=tg,N.findKey=A6,N.findLast=uC,N.findLastIndex=rg,N.findLastKey=E6,N.floor=GD,N.forEach=og,N.forEachRight=cg,N.forIn=w6,N.forInRight=F6,N.forOwn=C6,N.forOwnRight=D6,N.get=I0,N.gt=qC,N.gte=KC,N.has=b6,N.hasIn=$0,N.head=ig,N.identity=Xn,N.includes=fC,N.indexOf=uF,N.inRange=V6,N.invoke=I6,N.isArguments=Ca,N.isArray=ct,N.isArrayBuffer=VC,N.isArrayLike=Wn,N.isArrayLikeObject=Sr,N.isBoolean=GC,N.isBuffer=Lu,N.isDate=zC,N.isElement=YC,N.isEmpty=WC,N.isEqual=JC,N.isEqualWith=XC,N.isError=_0,N.isFinite=ZC,N.isFunction=eu,N.isInteger=vg,N.isLength=Yl,N.isMap=Ag,N.isMatch=QC,N.isMatchWith=e6,N.isNaN=t6,N.isNative=r6,N.isNil=i6,N.isNull=n6,N.isNumber=Eg,N.isObject=hr,N.isObjectLike=Fr,N.isPlainObject=Cc,N.isRegExp=B0,N.isSafeInteger=s6,N.isSet=wg,N.isString=Wl,N.isSymbol=pi,N.isTypedArray=mo,N.isUndefined=u6,N.isWeakMap=a6,N.isWeakSet=o6,N.join=fF,N.kebabCase=X6,N.last=xi,N.lastIndexOf=hF,N.lowerCase=Z6,N.lowerFirst=Q6,N.lt=c6,N.lte=l6,N.max=zD,N.maxBy=YD,N.mean=WD,N.meanBy=JD,N.min=XD,N.minBy=ZD,N.stubArray=k0,N.stubFalse=N0,N.stubObject=ND,N.stubString=LD,N.stubTrue=UD,N.multiply=QD,N.nth=pF,N.noConflict=ID,N.noop=O0,N.now=Vl,N.pad=eD,N.padEnd=tD,N.padStart=rD,N.parseInt=nD,N.random=G6,N.reduce=mC,N.reduceRight=vC,N.repeat=iD,N.replace=sD,N.result=k6,N.round=ey,N.runInContext=ne,N.sample=EC,N.size=CC,N.snakeCase=uD,N.some=DC,N.sortedIndex=wF,N.sortedIndexBy=FF,N.sortedIndexOf=CF,N.sortedLastIndex=DF,N.sortedLastIndexBy=yF,N.sortedLastIndexOf=SF,N.startCase=oD,N.startsWith=cD,N.subtract=ty,N.sum=ry,N.sumBy=ny,N.template=lD,N.times=HD,N.toFinite=tu,N.toInteger=pt,N.toLength=Cg,N.toLower=fD,N.toNumber=Oi,N.toSafeInteger=f6,N.toString=jt,N.toUpper=hD,N.trim=pD,N.trimEnd=dD,N.trimStart=gD,N.truncate=mD,N.unescape=vD,N.uniqueId=MD,N.upperCase=AD,N.upperFirst=P0,N.each=og,N.eachRight=cg,N.first=ig,x0(N,function(){var a={};return hs(N,function(c,m){Bt.call(N.prototype,m)||(a[m]=c)}),a}(),{chain:!1}),N.VERSION=t,Vn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){N[a].placeholder=N}),Vn(["drop","take"],function(a,c){Ct.prototype[a]=function(m){m=m===e?1:Nr(pt(m),0);var y=this.__filtered__&&!c?new Ct(this):this.clone();return y.__filtered__?y.__takeCount__=gn(m,y.__takeCount__):y.__views__.push({size:gn(m,Ce),type:a+(y.__dir__<0?"Right":"")}),y},Ct.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Vn(["filter","map","takeWhile"],function(a,c){var m=c+1,y=m==V||m==q;Ct.prototype[a]=function(T){var U=this.clone();return U.__iteratees__.push({iteratee:Ze(T,3),type:m}),U.__filtered__=U.__filtered__||y,U}}),Vn(["head","last"],function(a,c){var m="take"+(c?"Right":"");Ct.prototype[a]=function(){return this[m](1).value()[0]}}),Vn(["initial","tail"],function(a,c){var m="drop"+(c?"":"Right");Ct.prototype[a]=function(){return this.__filtered__?new Ct(this):this[m](1)}}),Ct.prototype.compact=function(){return this.filter(Xn)},Ct.prototype.find=function(a){return this.filter(a).head()},Ct.prototype.findLast=function(a){return this.reverse().find(a)},Ct.prototype.invokeMap=vt(function(a,c){return typeof a=="function"?new Ct(this):this.map(function(m){return mc(m,a,c)})}),Ct.prototype.reject=function(a){return this.filter(zl(Ze(a)))},Ct.prototype.slice=function(a,c){a=pt(a);var m=this;return m.__filtered__&&(a>0||c<0)?new Ct(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),c!==e&&(c=pt(c),m=c<0?m.dropRight(-c):m.take(c-a)),m)},Ct.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ct.prototype.toArray=function(){return this.take(Ce)},hs(Ct.prototype,function(a,c){var m=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),T=N[y?"take"+(c=="last"?"Right":""):c],U=y||/^find/.test(c);T&&(N.prototype[c]=function(){var Y=this.__wrapped__,Z=y?[1]:arguments,ie=Y instanceof Ct,Ae=Z[0],Ee=ie||ct(Y),Fe=function(wt){var St=T.apply(N,ci([wt],Z));return y&&Re?St[0]:St};Ee&&m&&typeof Ae=="function"&&Ae.length!=1&&(ie=Ee=!1);var Re=this.__chain__,He=!!this.__actions__.length,et=U&&!Re,gt=ie&&!He;if(!U&&Ee){Y=gt?Y:new Ct(this);var tt=a.apply(Y,Z);return tt.__actions__.push({func:ql,args:[Fe],thisArg:e}),new Pi(tt,Re)}return et&&gt?a.apply(this,Z):(tt=this.thru(Fe),et?y?tt.value()[0]:tt.value():tt)})}),Vn(["pop","push","shift","sort","splice","unshift"],function(a){var c=to[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",y=/^(?:pop|shift)$/.test(a);N.prototype[a]=function(){var T=arguments;if(y&&!this.__chain__){var U=this.value();return c.apply(ct(U)?U:[],T)}return this[m](function(Y){return c.apply(ct(Y)?Y:[],T)})}}),hs(Ct.prototype,function(a,c){var m=N[c];if(m){var y=m.name+"";Bt.call(lo,y)||(lo[y]=[]),lo[y].push({name:c,func:m})}}),lo[kl(e,v).name]=[{name:"wrapper",func:e}],Ct.prototype.clone=vw,Ct.prototype.reverse=Aw,Ct.prototype.value=Ew,N.prototype.at=YF,N.prototype.chain=WF,N.prototype.commit=JF,N.prototype.next=XF,N.prototype.plant=QF,N.prototype.reverse=eC,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=tC,N.prototype.first=N.prototype.head,Gs&&(N.prototype[Gs]=ZF),N},$i=Hh();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($r._=$i,define(function(){return $i})):js?((js.exports=$i)._=$i,tc._=$i):$r._=$i}).call(Bo)});var xa=Be((rT,Ta)=>{"use strict";function ym(e){return typeof e>"u"||e===null}function Z3(e){return typeof e=="object"&&e!==null}function Q3(e){return Array.isArray(e)?e:ym(e)?[]:[e]}function e5(e,t){var r,n,s,u;if(t)for(u=Object.keys(t),r=0,n=u.length;r<n;r+=1)s=u[r],e[s]=t[s];return e}function t5(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function r5(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Ta.exports.isNothing=ym;Ta.exports.isObject=Z3;Ta.exports.toArray=Q3;Ta.exports.repeat=t5;Ta.exports.isNegativeZero=r5;Ta.exports.extend=e5});var Io=Be((nT,Sm)=>{"use strict";function Pc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Pc.prototype=Object.create(Error.prototype);Pc.prototype.constructor=Pc;Pc.prototype.toString=function(t){var r=this.name+": ";return r+=this.reason||"(unknown reason)",!t&&this.mark&&(r+=" "+this.mark.toString()),r};Sm.exports=Pc});var Bm=Be((iT,_m)=>{"use strict";var bm=xa();function hp(e,t,r,n,s){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=s}hp.prototype.getSnippet=function(t,r){var n,s,u,i,o;if(!this.buffer)return null;for(t=t||4,r=r||75,n="",s=this.position;s>0&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(s-1))===-1;)if(s-=1,this.position-s>r/2-1){n=" ... ",s+=5;break}for(u="",i=this.position;i<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(i))===-1;)if(i+=1,i-this.position>r/2-1){u=" ... ",i-=5;break}return o=this.buffer.slice(s,i),bm.repeat(" ",t)+n+o+u+`
`+bm.repeat(" ",t+this.position-s+n.length)+"^"};hp.prototype.toString=function(t){var r,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(r=this.getSnippet(),r&&(n+=`:
`+r)),n};_m.exports=hp});var Hr=Be((sT,$m)=>{"use strict";var Im=Io(),n5=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i5=["scalar","sequence","mapping"];function s5(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function u5(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(n5.indexOf(r)===-1)throw new Im('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=s5(t.styleAliases||null),i5.indexOf(this.kind)===-1)throw new Im('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}$m.exports=u5});var Oa=Be((uT,Rm)=>{"use strict";var Pm=xa(),yf=Io(),a5=Hr();function pp(e,t,r){var n=[];return e.include.forEach(function(s){r=pp(s,t,r)}),e[t].forEach(function(s){r.forEach(function(u,i){u.tag===s.tag&&u.kind===s.kind&&n.push(i)}),r.push(s)}),r.filter(function(s,u){return n.indexOf(u)===-1})}function o5(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function n(s){e[s.kind][s.tag]=e.fallback[s.tag]=s}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function $o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new yf("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=pp(this,"implicit",[]),this.compiledExplicit=pp(this,"explicit",[]),this.compiledTypeMap=o5(this.compiledImplicit,this.compiledExplicit)}$o.DEFAULT=null;$o.create=function(){var t,r;switch(arguments.length){case 1:t=$o.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new yf("Wrong number of arguments for Schema.create function")}if(t=Pm.toArray(t),r=Pm.toArray(r),!t.every(function(n){return n instanceof $o}))throw new yf("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(n){return n instanceof a5}))throw new yf("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new $o({include:t,explicit:r})};Rm.exports=$o});var xm=Be((aT,Tm)=>{"use strict";var c5=Hr();Tm.exports=new c5("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var km=Be((oT,Om)=>{"use strict";var l5=Hr();Om.exports=new l5("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var Lm=Be((cT,Nm)=>{"use strict";var f5=Hr();Nm.exports=new f5("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var Sf=Be((lT,Um)=>{"use strict";var h5=Oa();Um.exports=new h5({explicit:[xm(),km(),Lm()]})});var jm=Be((fT,Hm)=>{"use strict";var p5=Hr();function d5(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function g5(){return null}function m5(e){return e===null}Hm.exports=new p5("tag:yaml.org,2002:null",{kind:"scalar",resolve:d5,construct:g5,predicate:m5,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var qm=Be((hT,Mm)=>{"use strict";var v5=Hr();function A5(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function E5(e){return e==="true"||e==="True"||e==="TRUE"}function w5(e){return Object.prototype.toString.call(e)==="[object Boolean]"}Mm.exports=new v5("tag:yaml.org,2002:bool",{kind:"scalar",resolve:A5,construct:E5,predicate:w5,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var Vm=Be((pT,Km)=>{"use strict";var F5=xa(),C5=Hr();function D5(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function y5(e){return 48<=e&&e<=55}function S5(e){return 48<=e&&e<=57}function b5(e){if(e===null)return!1;var t=e.length,r=0,n=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;n=!0}return n&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!D5(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}for(;r<t;r++)if(s=e[r],s!=="_"){if(!y5(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(s===":")break;if(!S5(e.charCodeAt(r)))return!1;n=!0}return!n||s==="_"?!1:s!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(r))}function _5(e){var t=e,r=1,n,s,u=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0"?0:n==="0"?t[1]==="b"?r*parseInt(t.slice(2),2):t[1]==="x"?r*parseInt(t,16):r*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(i){u.unshift(parseInt(i,10))}),t=0,s=1,u.forEach(function(i){t+=i*s,s*=60}),r*t):r*parseInt(t,10)}function B5(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!F5.isNegativeZero(e)}Km.exports=new C5("tag:yaml.org,2002:int",{kind:"scalar",resolve:b5,construct:_5,predicate:B5,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var Ym=Be((dT,zm)=>{"use strict";var Gm=xa(),I5=Hr(),$5=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function P5(e){return!(e===null||!$5.test(e)||e[e.length-1]==="_")}function R5(e){var t,r,n,s;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,s=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(u){s.unshift(parseFloat(u,10))}),t=0,n=1,s.forEach(function(u){t+=u*n,n*=60}),r*t):r*parseFloat(t,10)}var T5=/^[-+]?[0-9]+e/;function x5(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Gm.isNegativeZero(e))return"-0.0";return r=e.toString(10),T5.test(r)?r.replace("e",".e"):r}function O5(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Gm.isNegativeZero(e))}zm.exports=new I5("tag:yaml.org,2002:float",{kind:"scalar",resolve:P5,construct:R5,predicate:O5,represent:x5,defaultStyle:"lowercase"})});var dp=Be((gT,Wm)=>{"use strict";var k5=Oa();Wm.exports=new k5({include:[Sf()],implicit:[jm(),qm(),Vm(),Ym()]})});var gp=Be((mT,Jm)=>{"use strict";var N5=Oa();Jm.exports=new N5({include:[dp()]})});var ev=Be((vT,Qm)=>{"use strict";var L5=Hr(),Xm=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Zm=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function U5(e){return e===null?!1:Xm.exec(e)!==null||Zm.exec(e)!==null}function H5(e){var t,r,n,s,u,i,o,l=0,f=null,d,E,p;if(t=Xm.exec(e),t===null&&(t=Zm.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,n,s));if(u=+t[4],i=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=+t[10],E=+(t[11]||0),f=(d*60+E)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(r,n,s,u,i,o,l)),f&&p.setTime(p.getTime()-f),p}function j5(e){return e.toISOString()}Qm.exports=new L5("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:U5,construct:H5,instanceOf:Date,represent:j5})});var rv=Be((AT,tv)=>{"use strict";var M5=Hr();function q5(e){return e==="<<"||e===null}tv.exports=new M5("tag:yaml.org,2002:merge",{kind:"scalar",resolve:q5})});var sv=Be((ET,iv)=>{"use strict";var ka;try{nv=Da,ka=nv("buffer").Buffer}catch{}var nv,K5=Hr(),mp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function V5(e){if(e===null)return!1;var t,r,n=0,s=e.length,u=mp;for(r=0;r<s;r++)if(t=u.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function G5(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,u=mp,i=0,o=[];for(t=0;t<s;t++)t%4===0&&t&&(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)),i=i<<6|u.indexOf(n.charAt(t));return r=s%4*6,r===0?(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)):r===18?(o.push(i>>10&255),o.push(i>>2&255)):r===12&&o.push(i>>4&255),ka?ka.from?ka.from(o):new ka(o):o}function z5(e){var t="",r=0,n,s,u=e.length,i=mp;for(n=0;n<u;n++)n%3===0&&n&&(t+=i[r>>18&63],t+=i[r>>12&63],t+=i[r>>6&63],t+=i[r&63]),r=(r<<8)+e[n];return s=u%3,s===0?(t+=i[r>>18&63],t+=i[r>>12&63],t+=i[r>>6&63],t+=i[r&63]):s===2?(t+=i[r>>10&63],t+=i[r>>4&63],t+=i[r<<2&63],t+=i[64]):s===1&&(t+=i[r>>2&63],t+=i[r<<4&63],t+=i[64],t+=i[64]),t}function Y5(e){return ka&&ka.isBuffer(e)}iv.exports=new K5("tag:yaml.org,2002:binary",{kind:"scalar",resolve:V5,construct:G5,predicate:Y5,represent:z5})});var av=Be((FT,uv)=>{"use strict";var W5=Hr(),J5=Object.prototype.hasOwnProperty,X5=Object.prototype.toString;function Z5(e){if(e===null)return!0;var t=[],r,n,s,u,i,o=e;for(r=0,n=o.length;r<n;r+=1){if(s=o[r],i=!1,X5.call(s)!=="[object Object]")return!1;for(u in s)if(J5.call(s,u))if(!i)i=!0;else return!1;if(!i)return!1;if(t.indexOf(u)===-1)t.push(u);else return!1}return!0}function Q5(e){return e!==null?e:[]}uv.exports=new W5("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Z5,construct:Q5})});var cv=Be((CT,ov)=>{"use strict";var eS=Hr(),tS=Object.prototype.toString;function rS(e){if(e===null)return!0;var t,r,n,s,u,i=e;for(u=new Array(i.length),t=0,r=i.length;t<r;t+=1){if(n=i[t],tS.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;u[t]=[s[0],n[s[0]]]}return!0}function nS(e){if(e===null)return[];var t,r,n,s,u,i=e;for(u=new Array(i.length),t=0,r=i.length;t<r;t+=1)n=i[t],s=Object.keys(n),u[t]=[s[0],n[s[0]]];return u}ov.exports=new eS("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:rS,construct:nS})});var fv=Be((DT,lv)=>{"use strict";var iS=Hr(),sS=Object.prototype.hasOwnProperty;function uS(e){if(e===null)return!0;var t,r=e;for(t in r)if(sS.call(r,t)&&r[t]!==null)return!1;return!0}function aS(e){return e!==null?e:{}}lv.exports=new iS("tag:yaml.org,2002:set",{kind:"mapping",resolve:uS,construct:aS})});var Po=Be((yT,hv)=>{"use strict";var oS=Oa();hv.exports=new oS({include:[gp()],implicit:[ev(),rv()],explicit:[sv(),av(),cv(),fv()]})});var dv=Be((ST,pv)=>{"use strict";var cS=Hr();function lS(){return!0}function fS(){}function hS(){return""}function pS(e){return typeof e>"u"}pv.exports=new cS("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:lS,construct:fS,predicate:pS,represent:hS})});var mv=Be((bT,gv)=>{"use strict";var dS=Hr();function gS(e){if(e===null||e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),n="";return!(t[0]==="/"&&(r&&(n=r[1]),n.length>3||t[t.length-n.length-1]!=="/"))}function mS(e){var t=e,r=/\/([gim]*)$/.exec(e),n="";return t[0]==="/"&&(r&&(n=r[1]),t=t.slice(1,t.length-n.length-1)),new RegExp(t,n)}function vS(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function AS(e){return Object.prototype.toString.call(e)==="[object RegExp]"}gv.exports=new dS("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:gS,construct:mS,predicate:AS,represent:vS})});var Ev=Be((_T,Av)=>{"use strict";var bf;try{vv=Da,bf=vv("esprima")}catch{typeof window<"u"&&(bf=window.esprima)}var vv,ES=Hr();function wS(e){if(e===null)return!1;try{var t="("+e+")",r=bf.parse(t,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function FS(e){var t="("+e+")",r=bf.parse(t,{range:!0}),n=[],s;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(u){n.push(u.name)}),s=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(n,t.slice(s[0]+1,s[1]-1)):new Function(n,"return "+t.slice(s[0],s[1]))}function CS(e){return e.toString()}function DS(e){return Object.prototype.toString.call(e)==="[object Function]"}Av.exports=new ES("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:wS,construct:FS,predicate:DS,represent:CS})});var Rc=Be((IT,Fv)=>{"use strict";var wv=Oa();Fv.exports=wv.DEFAULT=new wv({include:[Po()],explicit:[dv(),mv(),Ev()]})});var Hv=Be(($T,Tc)=>{"use strict";var au=xa(),Bv=Io(),yS=Bm(),Iv=Po(),SS=Rc(),Gu=Object.prototype.hasOwnProperty,_f=1,$v=2,Pv=3,Bf=4,vp=1,bS=2,Cv=3,_S=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,BS=/[\x85\u2028\u2029]/,IS=/[,\[\]\{\}]/,Rv=/^(?:!|!!|![a-z\-]+!)$/i,Tv=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Dv(e){return Object.prototype.toString.call(e)}function ys(e){return e===10||e===13}function La(e){return e===9||e===32}function Zn(e){return e===9||e===32||e===10||e===13}function Ro(e){return e===44||e===91||e===93||e===123||e===125}function $S(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function PS(e){return e===120?2:e===117?4:e===85?8:0}function RS(e){return 48<=e&&e<=57?e-48:-1}function yv(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function TS(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var xv=new Array(256),Ov=new Array(256);for(Na=0;Na<256;Na++)xv[Na]=yv(Na)?1:0,Ov[Na]=yv(Na);var Na;function xS(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||SS,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function kv(e,t){return new Bv(t,new yS(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Qe(e,t){throw kv(e,t)}function If(e,t){e.onWarning&&e.onWarning.call(null,kv(e,t))}var Sv={YAML:function(t,r,n){var s,u,i;t.version!==null&&Qe(t,"duplication of %YAML directive"),n.length!==1&&Qe(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),s===null&&Qe(t,"ill-formed argument of the YAML directive"),u=parseInt(s[1],10),i=parseInt(s[2],10),u!==1&&Qe(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&If(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var s,u;n.length!==2&&Qe(t,"TAG directive accepts exactly two arguments"),s=n[0],u=n[1],Rv.test(s)||Qe(t,"ill-formed tag handle (first argument) of the TAG directive"),Gu.call(t.tagMap,s)&&Qe(t,'there is a previously declared suffix for "'+s+'" tag handle'),Tv.test(u)||Qe(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[s]=u}};function Vu(e,t,r,n){var s,u,i,o;if(t<r){if(o=e.input.slice(t,r),n)for(s=0,u=o.length;s<u;s+=1)i=o.charCodeAt(s),i===9||32<=i&&i<=1114111||Qe(e,"expected valid JSON character");else _S.test(o)&&Qe(e,"the stream contains non-printable characters");e.result+=o}}function bv(e,t,r,n){var s,u,i,o;for(au.isObject(r)||Qe(e,"cannot merge mappings; the provided source object is unacceptable"),s=Object.keys(r),i=0,o=s.length;i<o;i+=1)u=s[i],Gu.call(t,u)||(t[u]=r[u],n[u]=!0)}function To(e,t,r,n,s,u,i,o){var l,f;if(Array.isArray(s))for(s=Array.prototype.slice.call(s),l=0,f=s.length;l<f;l+=1)Array.isArray(s[l])&&Qe(e,"nested arrays are not supported inside keys"),typeof s=="object"&&Dv(s[l])==="[object Object]"&&(s[l]="[object Object]");if(typeof s=="object"&&Dv(s)==="[object Object]"&&(s="[object Object]"),s=String(s),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(u))for(l=0,f=u.length;l<f;l+=1)bv(e,t,u[l],r);else bv(e,t,u,r);else!e.json&&!Gu.call(r,s)&&Gu.call(t,s)&&(e.line=i||e.line,e.position=o||e.position,Qe(e,"duplicated mapping key")),t[s]=u,delete r[s];return t}function Ap(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Qe(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function xr(e,t,r){for(var n=0,s=e.input.charCodeAt(e.position);s!==0;){for(;La(s);)s=e.input.charCodeAt(++e.position);if(t&&s===35)do s=e.input.charCodeAt(++e.position);while(s!==10&&s!==13&&s!==0);if(ys(s))for(Ap(e),s=e.input.charCodeAt(e.position),n++,e.lineIndent=0;s===32;)e.lineIndent++,s=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&If(e,"deficient indentation"),n}function $f(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Zn(r)))}function Ep(e,t){t===1?e.result+=" ":t>1&&(e.result+=au.repeat(`
`,t-1))}function OS(e,t,r){var n,s,u,i,o,l,f,d,E=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),Zn(h)||Ro(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(s=e.input.charCodeAt(e.position+1),Zn(s)||r&&Ro(s)))return!1;for(e.kind="scalar",e.result="",u=i=e.position,o=!1;h!==0;){if(h===58){if(s=e.input.charCodeAt(e.position+1),Zn(s)||r&&Ro(s))break}else if(h===35){if(n=e.input.charCodeAt(e.position-1),Zn(n))break}else{if(e.position===e.lineStart&&$f(e)||r&&Ro(h))break;if(ys(h))if(l=e.line,f=e.lineStart,d=e.lineIndent,xr(e,!1,-1),e.lineIndent>=t){o=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=l,e.lineStart=f,e.lineIndent=d;break}}o&&(Vu(e,u,i,!1),Ep(e,e.line-l),u=i=e.position,o=!1),La(h)||(i=e.position+1),h=e.input.charCodeAt(++e.position)}return Vu(e,u,i,!1),e.result?!0:(e.kind=E,e.result=p,!1)}function kS(e,t){var r,n,s;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=s=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Vu(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,s=e.position;else return!0;else ys(r)?(Vu(e,n,s,!0),Ep(e,xr(e,!1,t)),n=s=e.position):e.position===e.lineStart&&$f(e)?Qe(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);Qe(e,"unexpected end of the stream within a single quoted scalar")}function NS(e,t){var r,n,s,u,i,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Vu(e,r,e.position,!0),e.position++,!0;if(o===92){if(Vu(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),ys(o))xr(e,!1,t);else if(o<256&&xv[o])e.result+=Ov[o],e.position++;else if((i=PS(o))>0){for(s=i,u=0;s>0;s--)o=e.input.charCodeAt(++e.position),(i=$S(o))>=0?u=(u<<4)+i:Qe(e,"expected hexadecimal character");e.result+=TS(u),e.position++}else Qe(e,"unknown escape sequence");r=n=e.position}else ys(o)?(Vu(e,r,n,!0),Ep(e,xr(e,!1,t)),r=n=e.position):e.position===e.lineStart&&$f(e)?Qe(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Qe(e,"unexpected end of the stream within a double quoted scalar")}function LS(e,t){var r=!0,n,s=e.tag,u,i=e.anchor,o,l,f,d,E,p={},h,w,v,D;if(D=e.input.charCodeAt(e.position),D===91)l=93,E=!1,u=[];else if(D===123)l=125,E=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),D=e.input.charCodeAt(++e.position);D!==0;){if(xr(e,!0,t),D=e.input.charCodeAt(e.position),D===l)return e.position++,e.tag=s,e.anchor=i,e.kind=E?"mapping":"sequence",e.result=u,!0;r||Qe(e,"missed comma between flow collection entries"),w=h=v=null,f=d=!1,D===63&&(o=e.input.charCodeAt(e.position+1),Zn(o)&&(f=d=!0,e.position++,xr(e,!0,t))),n=e.line,xo(e,t,_f,!1,!0),w=e.tag,h=e.result,xr(e,!0,t),D=e.input.charCodeAt(e.position),(d||e.line===n)&&D===58&&(f=!0,D=e.input.charCodeAt(++e.position),xr(e,!0,t),xo(e,t,_f,!1,!0),v=e.result),E?To(e,u,p,w,h,v):f?u.push(To(e,null,p,w,h,v)):u.push(h),xr(e,!0,t),D=e.input.charCodeAt(e.position),D===44?(r=!0,D=e.input.charCodeAt(++e.position)):r=!1}Qe(e,"unexpected end of the stream within a flow collection")}function US(e,t){var r,n,s=vp,u=!1,i=!1,o=t,l=0,f=!1,d,E;if(E=e.input.charCodeAt(e.position),E===124)n=!1;else if(E===62)n=!0;else return!1;for(e.kind="scalar",e.result="";E!==0;)if(E=e.input.charCodeAt(++e.position),E===43||E===45)vp===s?s=E===43?Cv:bS:Qe(e,"repeat of a chomping mode identifier");else if((d=RS(E))>=0)d===0?Qe(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?Qe(e,"repeat of an indentation width identifier"):(o=t+d-1,i=!0);else break;if(La(E)){do E=e.input.charCodeAt(++e.position);while(La(E));if(E===35)do E=e.input.charCodeAt(++e.position);while(!ys(E)&&E!==0)}for(;E!==0;){for(Ap(e),e.lineIndent=0,E=e.input.charCodeAt(e.position);(!i||e.lineIndent<o)&&E===32;)e.lineIndent++,E=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>o&&(o=e.lineIndent),ys(E)){l++;continue}if(e.lineIndent<o){s===Cv?e.result+=au.repeat(`
`,u?1+l:l):s===vp&&u&&(e.result+=`
`);break}for(n?La(E)?(f=!0,e.result+=au.repeat(`
`,u?1+l:l)):f?(f=!1,e.result+=au.repeat(`
`,l+1)):l===0?u&&(e.result+=" "):e.result+=au.repeat(`
`,l):e.result+=au.repeat(`
`,u?1+l:l),u=!0,i=!0,l=0,r=e.position;!ys(E)&&E!==0;)E=e.input.charCodeAt(++e.position);Vu(e,r,e.position,!1)}return!0}function _v(e,t){var r,n=e.tag,s=e.anchor,u=[],i,o=!1,l;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),l=e.input.charCodeAt(e.position);l!==0&&!(l!==45||(i=e.input.charCodeAt(e.position+1),!Zn(i)));){if(o=!0,e.position++,xr(e,!0,-1)&&e.lineIndent<=t){u.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,xo(e,t,Pv,!1,!0),u.push(e.result),xr(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Qe(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=s,e.kind="sequence",e.result=u,!0):!1}function HS(e,t,r){var n,s,u,i,o=e.tag,l=e.anchor,f={},d={},E=null,p=null,h=null,w=!1,v=!1,D;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),D=e.input.charCodeAt(e.position);D!==0;){if(n=e.input.charCodeAt(e.position+1),u=e.line,i=e.position,(D===63||D===58)&&Zn(n))D===63?(w&&(To(e,f,d,E,p,null),E=p=h=null),v=!0,w=!0,s=!0):w?(w=!1,s=!0):Qe(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,D=n;else if(xo(e,r,$v,!1,!0))if(e.line===u){for(D=e.input.charCodeAt(e.position);La(D);)D=e.input.charCodeAt(++e.position);if(D===58)D=e.input.charCodeAt(++e.position),Zn(D)||Qe(e,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(To(e,f,d,E,p,null),E=p=h=null),v=!0,w=!1,s=!1,E=e.tag,p=e.result;else if(v)Qe(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=o,e.anchor=l,!0}else if(v)Qe(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=o,e.anchor=l,!0;else break;if((e.line===u||e.lineIndent>t)&&(xo(e,t,Bf,!0,s)&&(w?p=e.result:h=e.result),w||(To(e,f,d,E,p,h,u,i),E=p=h=null),xr(e,!0,-1),D=e.input.charCodeAt(e.position)),e.lineIndent>t&&D!==0)Qe(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return w&&To(e,f,d,E,p,null),v&&(e.tag=o,e.anchor=l,e.kind="mapping",e.result=f),v}function jS(e){var t,r=!1,n=!1,s,u,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&Qe(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(r=!0,i=e.input.charCodeAt(++e.position)):i===33?(n=!0,s="!!",i=e.input.charCodeAt(++e.position)):s="!",t=e.position,r){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(u=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):Qe(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!Zn(i);)i===33&&(n?Qe(e,"tag suffix cannot contain exclamation marks"):(s=e.input.slice(t-1,e.position+1),Rv.test(s)||Qe(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);u=e.input.slice(t,e.position),IS.test(u)&&Qe(e,"tag suffix cannot contain flow indicator characters")}return u&&!Tv.test(u)&&Qe(e,"tag name cannot contain such characters: "+u),r?e.tag=u:Gu.call(e.tagMap,s)?e.tag=e.tagMap[s]+u:s==="!"?e.tag="!"+u:s==="!!"?e.tag="tag:yaml.org,2002:"+u:Qe(e,'undeclared tag handle "'+s+'"'),!0}function MS(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Qe(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Zn(r)&&!Ro(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Qe(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function qS(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Zn(n)&&!Ro(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Qe(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Gu.call(e.anchorMap,r)||Qe(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],xr(e,!0,-1),!0}function xo(e,t,r,n,s){var u,i,o,l=1,f=!1,d=!1,E,p,h,w,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,u=i=o=Bf===r||Pv===r,n&&xr(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;jS(e)||MS(e);)xr(e,!0,-1)?(f=!0,o=u,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):o=!1;if(o&&(o=f||s),(l===1||Bf===r)&&(_f===r||$v===r?w=t:w=t+1,v=e.position-e.lineStart,l===1?o&&(_v(e,v)||HS(e,v,w))||LS(e,w)?d=!0:(i&&US(e,w)||kS(e,w)||NS(e,w)?d=!0:qS(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&Qe(e,"alias node should not have any properties")):OS(e,w,_f===r)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=o&&_v(e,v))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Qe(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),E=0,p=e.implicitTypes.length;E<p;E+=1)if(h=e.implicitTypes[E],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Gu.call(e.typeMap[e.kind||"fallback"],e.tag)?(h=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&h.kind!==e.kind&&Qe(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result)?(e.result=h.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Qe(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):Qe(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function KS(e){var t=e.position,r,n,s,u=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(i=e.input.charCodeAt(e.position))!==0&&(xr(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(u=!0,i=e.input.charCodeAt(++e.position),r=e.position;i!==0&&!Zn(i);)i=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),s=[],n.length<1&&Qe(e,"directive name must not be less than one character in length");i!==0;){for(;La(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!ys(i));break}if(ys(i))break;for(r=e.position;i!==0&&!Zn(i);)i=e.input.charCodeAt(++e.position);s.push(e.input.slice(r,e.position))}i!==0&&Ap(e),Gu.call(Sv,n)?Sv[n](e,n,s):If(e,'unknown document directive "'+n+'"')}if(xr(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,xr(e,!0,-1)):u&&Qe(e,"directives end mark is expected"),xo(e,e.lineIndent-1,Bf,!1,!0),xr(e,!0,-1),e.checkLineBreaks&&BS.test(e.input.slice(t,e.position))&&If(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$f(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,xr(e,!0,-1));return}if(e.position<e.length-1)Qe(e,"end of the stream or a document separator is expected");else return}function Nv(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new xS(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Qe(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)KS(r);return r.documents}function Lv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=Nv(e,r);if(typeof t!="function")return n;for(var s=0,u=n.length;s<u;s+=1)t(n[s])}function Uv(e,t){var r=Nv(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Bv("expected a single document in the stream, but found more")}}function VS(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),Lv(e,t,au.extend({schema:Iv},r))}function GS(e,t){return Uv(e,au.extend({schema:Iv},t))}Tc.exports.loadAll=Lv;Tc.exports.load=Uv;Tc.exports.safeLoadAll=VS;Tc.exports.safeLoad=GS});var c2=Be((PT,Dp)=>{"use strict";var Oc=xa(),kc=Io(),zS=Rc(),YS=Po(),Yv=Object.prototype.toString,Wv=Object.prototype.hasOwnProperty,WS=9,xc=10,JS=13,XS=32,ZS=33,QS=34,Jv=35,e8=37,t8=38,r8=39,n8=42,Xv=44,i8=45,Zv=58,s8=61,u8=62,a8=63,o8=64,Qv=91,e2=93,c8=96,t2=123,l8=124,r2=125,Dn={};Dn[0]="\\0";Dn[7]="\\a";Dn[8]="\\b";Dn[9]="\\t";Dn[10]="\\n";Dn[11]="\\v";Dn[12]="\\f";Dn[13]="\\r";Dn[27]="\\e";Dn[34]='\\"';Dn[92]="\\\\";Dn[133]="\\N";Dn[160]="\\_";Dn[8232]="\\L";Dn[8233]="\\P";var f8=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function h8(e,t){var r,n,s,u,i,o,l;if(t===null)return{};for(r={},n=Object.keys(t),s=0,u=n.length;s<u;s+=1)i=n[s],o=String(t[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),l=e.compiledTypeMap.fallback[i],l&&Wv.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[i]=o;return r}function jv(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new kc("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Oc.repeat("0",n-t.length)+t}function p8(e){this.schema=e.schema||zS,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Oc.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=h8(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Mv(e,t){for(var r=Oc.repeat(" ",t),n=0,s=-1,u="",i,o=e.length;n<o;)s=e.indexOf(`
`,n),s===-1?(i=e.slice(n),n=o):(i=e.slice(n,s+1),n=s+1),i.length&&i!==`
`&&(u+=r),u+=i;return u}function wp(e,t){return`
`+Oc.repeat(" ",e.indent*t)}function d8(e,t){var r,n,s;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}function Cp(e){return e===XS||e===WS}function Oo(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function g8(e){return Oo(e)&&!Cp(e)&&e!==65279&&e!==JS&&e!==xc}function qv(e,t){return Oo(e)&&e!==65279&&e!==Xv&&e!==Qv&&e!==e2&&e!==t2&&e!==r2&&e!==Zv&&(e!==Jv||t&&g8(t))}function m8(e){return Oo(e)&&e!==65279&&!Cp(e)&&e!==i8&&e!==a8&&e!==Zv&&e!==Xv&&e!==Qv&&e!==e2&&e!==t2&&e!==r2&&e!==Jv&&e!==t8&&e!==n8&&e!==ZS&&e!==l8&&e!==s8&&e!==u8&&e!==r8&&e!==QS&&e!==e8&&e!==o8&&e!==c8}function n2(e){var t=/^\n* /;return t.test(e)}var i2=1,s2=2,u2=3,a2=4,Pf=5;function v8(e,t,r,n,s){var u,i,o,l=!1,f=!1,d=n!==-1,E=-1,p=m8(e.charCodeAt(0))&&!Cp(e.charCodeAt(e.length-1));if(t)for(u=0;u<e.length;u++){if(i=e.charCodeAt(u),!Oo(i))return Pf;o=u>0?e.charCodeAt(u-1):null,p=p&&qv(i,o)}else{for(u=0;u<e.length;u++){if(i=e.charCodeAt(u),i===xc)l=!0,d&&(f=f||u-E-1>n&&e[E+1]!==" ",E=u);else if(!Oo(i))return Pf;o=u>0?e.charCodeAt(u-1):null,p=p&&qv(i,o)}f=f||d&&u-E-1>n&&e[E+1]!==" "}return!l&&!f?p&&!s(e)?i2:s2:r>9&&n2(e)?Pf:f?a2:u2}function A8(e,t,r,n){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&f8.indexOf(t)!==-1)return"'"+t+"'";var s=e.indent*Math.max(1,r),u=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),i=n||e.flowLevel>-1&&r>=e.flowLevel;function o(l){return d8(e,l)}switch(v8(t,i,e.indent,u,o)){case i2:return t;case s2:return"'"+t.replace(/'/g,"''")+"'";case u2:return"|"+Kv(t,e.indent)+Vv(Mv(t,s));case a2:return">"+Kv(t,e.indent)+Vv(Mv(E8(t,u),s));case Pf:return'"'+w8(t,u)+'"';default:throw new kc("impossible error: invalid scalar style")}}()}function Kv(e,t){var r=n2(e)?String(t):"",n=e[e.length-1]===`
`,s=n&&(e[e.length-2]===`
`||e===`
`),u=s?"+":n?"":"-";return r+u+`
`}function Vv(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function E8(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var f=e.indexOf(`
`);return f=f!==-1?f:e.length,r.lastIndex=f,Gv(e.slice(0,f),t)}(),s=e[0]===`
`||e[0]===" ",u,i;i=r.exec(e);){var o=i[1],l=i[2];u=l[0]===" ",n+=o+(!s&&!u&&l!==""?`
`:"")+Gv(l,t),s=u}return n}function Gv(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,s=0,u,i=0,o=0,l="";n=r.exec(e);)o=n.index,o-s>t&&(u=i>s?i:o,l+=`
`+e.slice(s,u),s=u+1),i=o;return l+=`
`,e.length-s>t&&i>s?l+=e.slice(s,i)+`
`+e.slice(i+1):l+=e.slice(s),l.slice(1)}function w8(e){for(var t="",r,n,s,u=0;u<e.length;u++){if(r=e.charCodeAt(u),r>=55296&&r<=56319&&(n=e.charCodeAt(u+1),n>=56320&&n<=57343)){t+=jv((r-55296)*1024+n-56320+65536),u++;continue}s=Dn[r],t+=!s&&Oo(r)?e[u]:s||jv(r)}return t}function F8(e,t,r){var n="",s=e.tag,u,i;for(u=0,i=r.length;u<i;u+=1)Ua(e,t,r[u],!1,!1)&&(u!==0&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}function C8(e,t,r,n){var s="",u=e.tag,i,o;for(i=0,o=r.length;i<o;i+=1)Ua(e,t+1,r[i],!0,!0)&&((!n||i!==0)&&(s+=wp(e,t)),e.dump&&xc===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=u,e.dump=s||"[]"}function D8(e,t,r){var n="",s=e.tag,u=Object.keys(r),i,o,l,f,d;for(i=0,o=u.length;i<o;i+=1)d="",i!==0&&(d+=", "),e.condenseFlow&&(d+='"'),l=u[i],f=r[l],Ua(e,t,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ua(e,t,f,!1,!1)&&(d+=e.dump,n+=d));e.tag=s,e.dump="{"+n+"}"}function y8(e,t,r,n){var s="",u=e.tag,i=Object.keys(r),o,l,f,d,E,p;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new kc("sortKeys must be a boolean or a function");for(o=0,l=i.length;o<l;o+=1)p="",(!n||o!==0)&&(p+=wp(e,t)),f=i[o],d=r[f],Ua(e,t+1,f,!0,!0,!0)&&(E=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,E&&(e.dump&&xc===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,E&&(p+=wp(e,t)),Ua(e,t+1,d,!0,E)&&(e.dump&&xc===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,s+=p));e.tag=u,e.dump=s||"{}"}function zv(e,t,r){var n,s,u,i,o,l;for(s=r?e.explicitTypes:e.implicitTypes,u=0,i=s.length;u<i;u+=1)if(o=s[u],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(e.tag=r?o.tag:"?",o.represent){if(l=e.styleMap[o.tag]||o.defaultStyle,Yv.call(o.represent)==="[object Function]")n=o.represent(t,l);else if(Wv.call(o.represent,l))n=o.represent[l](t,l);else throw new kc("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}function Ua(e,t,r,n,s,u){e.tag=null,e.dump=r,zv(e,r,!1)||zv(e,r,!0);var i=Yv.call(e.dump);n&&(n=e.flowLevel<0||e.flowLevel>t);var o=i==="[object Object]"||i==="[object Array]",l,f;if(o&&(l=e.duplicates.indexOf(r),f=l!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(s=!1),f&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(o&&f&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),i==="[object Object]")n&&Object.keys(e.dump).length!==0?(y8(e,t,e.dump,s),f&&(e.dump="&ref_"+l+e.dump)):(D8(e,t,e.dump),f&&(e.dump="&ref_"+l+" "+e.dump));else if(i==="[object Array]"){var d=e.noArrayIndent&&t>0?t-1:t;n&&e.dump.length!==0?(C8(e,d,e.dump,s),f&&(e.dump="&ref_"+l+e.dump)):(F8(e,d,e.dump),f&&(e.dump="&ref_"+l+" "+e.dump))}else if(i==="[object String]")e.tag!=="?"&&A8(e,e.dump,t,u);else{if(e.skipInvalid)return!1;throw new kc("unacceptable kind of an object to dump "+i)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function S8(e,t){var r=[],n=[],s,u;for(Fp(e,r,n),s=0,u=n.length;s<u;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(u)}function Fp(e,t,r){var n,s,u;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,u=e.length;s<u;s+=1)Fp(e[s],t,r);else for(n=Object.keys(e),s=0,u=n.length;s<u;s+=1)Fp(e[n[s]],t,r)}function o2(e,t){t=t||{};var r=new p8(t);return r.noRefs||S8(e,r),Ua(r,0,e,!0,!0)?r.dump+`
`:""}function b8(e,t){return o2(e,Oc.extend({schema:YS},t))}Dp.exports.dump=o2;Dp.exports.safeDump=b8});var f2=Be((RT,Dr)=>{"use strict";var Rf=Hv(),l2=c2();function Tf(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}Dr.exports.Type=Hr();Dr.exports.Schema=Oa();Dr.exports.FAILSAFE_SCHEMA=Sf();Dr.exports.JSON_SCHEMA=dp();Dr.exports.CORE_SCHEMA=gp();Dr.exports.DEFAULT_SAFE_SCHEMA=Po();Dr.exports.DEFAULT_FULL_SCHEMA=Rc();Dr.exports.load=Rf.load;Dr.exports.loadAll=Rf.loadAll;Dr.exports.safeLoad=Rf.safeLoad;Dr.exports.safeLoadAll=Rf.safeLoadAll;Dr.exports.dump=l2.dump;Dr.exports.safeDump=l2.safeDump;Dr.exports.YAMLException=Io();Dr.exports.MINIMAL_SCHEMA=Sf();Dr.exports.SAFE_SCHEMA=Po();Dr.exports.DEFAULT_SCHEMA=Rc();Dr.exports.scan=Tf("scan");Dr.exports.parse=Tf("parse");Dr.exports.compose=Tf("compose");Dr.exports.addConstructor=Tf("addConstructor")});var p2=Be((TT,h2)=>{"use strict";var _8=f2();h2.exports=_8});var g2=Be((xT,d2)=>{"use strict";var xf=p2();d2.exports={safeLoad:xf.safeLoad,load:xf.load,safeDump:xf.safeDump,dump:xf.dump}});var F2=Be(kf=>{"use strict";kf.byteLength=k8;kf.toByteArray=L8;kf.fromByteArray=j8;var bs=[],Ui=[],O8=typeof Uint8Array<"u"?Uint8Array:Array,yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ha=0,E2=yp.length;Ha<E2;++Ha)bs[Ha]=yp[Ha],Ui[yp.charCodeAt(Ha)]=Ha;var Ha,E2;Ui[45]=62;Ui[95]=63;function w2(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function k8(e){var t=w2(e),r=t[0],n=t[1];return(r+n)*3/4-n}function N8(e,t,r){return(t+r)*3/4-r}function L8(e){var t,r=w2(e),n=r[0],s=r[1],u=new O8(N8(e,n,s)),i=0,o=s>0?n-4:n,l;for(l=0;l<o;l+=4)t=Ui[e.charCodeAt(l)]<<18|Ui[e.charCodeAt(l+1)]<<12|Ui[e.charCodeAt(l+2)]<<6|Ui[e.charCodeAt(l+3)],u[i++]=t>>16&255,u[i++]=t>>8&255,u[i++]=t&255;return s===2&&(t=Ui[e.charCodeAt(l)]<<2|Ui[e.charCodeAt(l+1)]>>4,u[i++]=t&255),s===1&&(t=Ui[e.charCodeAt(l)]<<10|Ui[e.charCodeAt(l+1)]<<4|Ui[e.charCodeAt(l+2)]>>2,u[i++]=t>>8&255,u[i++]=t&255),u}function U8(e){return bs[e>>18&63]+bs[e>>12&63]+bs[e>>6&63]+bs[e&63]}function H8(e,t,r){for(var n,s=[],u=t;u<r;u+=3)n=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(e[u+2]&255),s.push(U8(n));return s.join("")}function j8(e){for(var t,r=e.length,n=r%3,s=[],u=16383,i=0,o=r-n;i<o;i+=u)s.push(H8(e,i,i+u>o?o:i+u));return n===1?(t=e[r-1],s.push(bs[t>>2]+bs[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],s.push(bs[t>>10]+bs[t>>4&63]+bs[t<<2&63]+"=")),s.join("")}});var C2=Be(Sp=>{Sp.read=function(e,t,r,n,s){var u,i,o=s*8-n-1,l=(1<<o)-1,f=l>>1,d=-7,E=r?s-1:0,p=r?-1:1,h=e[t+E];for(E+=p,u=h&(1<<-d)-1,h>>=-d,d+=o;d>0;u=u*256+e[t+E],E+=p,d-=8);for(i=u&(1<<-d)-1,u>>=-d,d+=n;d>0;i=i*256+e[t+E],E+=p,d-=8);if(u===0)u=1-f;else{if(u===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,n),u=u-f}return(h?-1:1)*i*Math.pow(2,u-n)};Sp.write=function(e,t,r,n,s,u){var i,o,l,f=u*8-s-1,d=(1<<f)-1,E=d>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:u-1,w=n?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+E>=1?t+=p/l:t+=p*Math.pow(2,1-E),t*l>=2&&(i++,l/=2),i+E>=d?(o=0,i=d):i+E>=1?(o=(t*l-1)*Math.pow(2,s),i=i+E):(o=t*Math.pow(2,E-1)*Math.pow(2,s),i=0));s>=8;e[r+h]=o&255,h+=w,o/=256,s-=8);for(i=i<<s|o,f+=s;f>0;e[r+h]=i&255,h+=w,i/=256,f-=8);e[r+h-w]|=v*128}});var Uf=Be(Uo=>{"use strict";var bp=F2(),No=C2(),D2=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Uo.Buffer=pe;Uo.SlowBuffer=z8;Uo.INSPECT_MAX_BYTES=50;var Nf=2147483647;Uo.kMaxLength=Nf;pe.TYPED_ARRAY_SUPPORT=M8();!pe.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function M8(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(pe.prototype,"parent",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.buffer}});Object.defineProperty(pe.prototype,"offset",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.byteOffset}});function ou(e){if(e>Nf)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,pe.prototype),t}function pe(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $p(e)}return _2(e,t,r)}pe.poolSize=8192;function _2(e,t,r){if(typeof e=="string")return K8(e,t);if(ArrayBuffer.isView(e))return V8(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_s(e,ArrayBuffer)||e&&_s(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_s(e,SharedArrayBuffer)||e&&_s(e.buffer,SharedArrayBuffer)))return Bp(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return pe.from(n,t,r);let s=G8(e);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return pe.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}pe.from=function(e,t,r){return _2(e,t,r)};Object.setPrototypeOf(pe.prototype,Uint8Array.prototype);Object.setPrototypeOf(pe,Uint8Array);function B2(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function q8(e,t,r){return B2(e),e<=0?ou(e):t!==void 0?typeof r=="string"?ou(e).fill(t,r):ou(e).fill(t):ou(e)}pe.alloc=function(e,t,r){return q8(e,t,r)};function $p(e){return B2(e),ou(e<0?0:Pp(e)|0)}pe.allocUnsafe=function(e){return $p(e)};pe.allocUnsafeSlow=function(e){return $p(e)};function K8(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!pe.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=I2(e,t)|0,n=ou(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}function _p(e){let t=e.length<0?0:Pp(e.length)|0,r=ou(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function V8(e){if(_s(e,Uint8Array)){let t=new Uint8Array(e);return Bp(t.buffer,t.byteOffset,t.byteLength)}return _p(e)}function Bp(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,pe.prototype),n}function G8(e){if(pe.isBuffer(e)){let t=Pp(e.length)|0,r=ou(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Tp(e.length)?ou(0):_p(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _p(e.data)}function Pp(e){if(e>=Nf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nf.toString(16)+" bytes");return e|0}function z8(e){return+e!=e&&(e=0),pe.alloc(+e)}pe.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==pe.prototype};pe.compare=function(t,r){if(_s(t,Uint8Array)&&(t=pe.from(t,t.offset,t.byteLength)),_s(r,Uint8Array)&&(r=pe.from(r,r.offset,r.byteLength)),!pe.isBuffer(t)||!pe.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,s=r.length;for(let u=0,i=Math.min(n,s);u<i;++u)if(t[u]!==r[u]){n=t[u],s=r[u];break}return n<s?-1:s<n?1:0};pe.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};pe.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return pe.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let s=pe.allocUnsafe(r),u=0;for(n=0;n<t.length;++n){let i=t[n];if(_s(i,Uint8Array))u+i.length>s.length?(pe.isBuffer(i)||(i=pe.from(i)),i.copy(s,u)):Uint8Array.prototype.set.call(s,i,u);else if(pe.isBuffer(i))i.copy(s,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=i.length}return s};function I2(e,t){if(pe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_s(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let s=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Ip(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return L2(e).length;default:if(s)return n?-1:Ip(e).length;t=(""+t).toLowerCase(),s=!0}}pe.byteLength=I2;function Y8(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ib(this,t,r);case"utf8":case"utf-8":return P2(this,t,r);case"ascii":return rb(this,t,r);case"latin1":case"binary":return nb(this,t,r);case"base64":return eb(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sb(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}pe.prototype._isBuffer=!0;function ja(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}pe.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)ja(this,r,r+1);return this};pe.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)ja(this,r,r+3),ja(this,r+1,r+2);return this};pe.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)ja(this,r,r+7),ja(this,r+1,r+6),ja(this,r+2,r+5),ja(this,r+3,r+4);return this};pe.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?P2(this,0,t):Y8.apply(this,arguments)};pe.prototype.toLocaleString=pe.prototype.toString;pe.prototype.equals=function(t){if(!pe.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:pe.compare(this,t)===0};pe.prototype.inspect=function(){let t="",r=Uo.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};D2&&(pe.prototype[D2]=pe.prototype.inspect);pe.prototype.compare=function(t,r,n,s,u){if(_s(t,Uint8Array)&&(t=pe.from(t,t.offset,t.byteLength)),!pe.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),s===void 0&&(s=0),u===void 0&&(u=this.length),r<0||n>t.length||s<0||u>this.length)throw new RangeError("out of range index");if(s>=u&&r>=n)return 0;if(s>=u)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,s>>>=0,u>>>=0,this===t)return 0;let i=u-s,o=n-r,l=Math.min(i,o),f=this.slice(s,u),d=t.slice(r,n);for(let E=0;E<l;++E)if(f[E]!==d[E]){i=f[E],o=d[E];break}return i<o?-1:o<i?1:0};function $2(e,t,r,n,s){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Tp(r)&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return-1;r=e.length-1}else if(r<0)if(s)r=0;else return-1;if(typeof t=="string"&&(t=pe.from(t,n)),pe.isBuffer(t))return t.length===0?-1:y2(e,t,r,n,s);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y2(e,[t],r,n,s);throw new TypeError("val must be string, number or Buffer")}function y2(e,t,r,n,s){let u=1,i=e.length,o=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;u=2,i/=2,o/=2,r/=2}function l(d,E){return u===1?d[E]:d.readUInt16BE(E*u)}let f;if(s){let d=-1;for(f=r;f<i;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===o)return d*u}else d!==-1&&(f-=f-d),d=-1}else for(r+o>i&&(r=i-o),f=r;f>=0;f--){let d=!0;for(let E=0;E<o;E++)if(l(e,f+E)!==l(t,E)){d=!1;break}if(d)return f}return-1}pe.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};pe.prototype.indexOf=function(t,r,n){return $2(this,t,r,n,!0)};pe.prototype.lastIndexOf=function(t,r,n){return $2(this,t,r,n,!1)};function W8(e,t,r,n){r=Number(r)||0;let s=e.length-r;n?(n=Number(n),n>s&&(n=s)):n=s;let u=t.length;n>u/2&&(n=u/2);let i;for(i=0;i<n;++i){let o=parseInt(t.substr(i*2,2),16);if(Tp(o))return i;e[r+i]=o}return i}function J8(e,t,r,n){return Lf(Ip(t,e.length-r),e,r,n)}function X8(e,t,r,n){return Lf(cb(t),e,r,n)}function Z8(e,t,r,n){return Lf(L2(t),e,r,n)}function Q8(e,t,r,n){return Lf(lb(t,e.length-r),e,r,n)}pe.prototype.write=function(t,r,n,s){if(r===void 0)s="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")s=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let u=this.length-r;if((n===void 0||n>u)&&(n=u),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let i=!1;for(;;)switch(s){case"hex":return W8(this,t,r,n);case"utf8":case"utf-8":return J8(this,t,r,n);case"ascii":case"latin1":case"binary":return X8(this,t,r,n);case"base64":return Z8(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q8(this,t,r,n);default:if(i)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),i=!0}};pe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function eb(e,t,r){return t===0&&r===e.length?bp.fromByteArray(e):bp.fromByteArray(e.slice(t,r))}function P2(e,t,r){r=Math.min(e.length,r);let n=[],s=t;for(;s<r;){let u=e[s],i=null,o=u>239?4:u>223?3:u>191?2:1;if(s+o<=r){let l,f,d,E;switch(o){case 1:u<128&&(i=u);break;case 2:l=e[s+1],(l&192)===128&&(E=(u&31)<<6|l&63,E>127&&(i=E));break;case 3:l=e[s+1],f=e[s+2],(l&192)===128&&(f&192)===128&&(E=(u&15)<<12|(l&63)<<6|f&63,E>2047&&(E<55296||E>57343)&&(i=E));break;case 4:l=e[s+1],f=e[s+2],d=e[s+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(E=(u&15)<<18|(l&63)<<12|(f&63)<<6|d&63,E>65535&&E<1114112&&(i=E))}}i===null?(i=65533,o=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),s+=o}return tb(n)}var S2=4096;function tb(e){let t=e.length;if(t<=S2)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S2));return r}function rb(e,t,r){let n="";r=Math.min(e.length,r);for(let s=t;s<r;++s)n+=String.fromCharCode(e[s]&127);return n}function nb(e,t,r){let n="";r=Math.min(e.length,r);for(let s=t;s<r;++s)n+=String.fromCharCode(e[s]);return n}function ib(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let s="";for(let u=t;u<r;++u)s+=fb[e[u]];return s}function sb(e,t,r){let n=e.slice(t,r),s="";for(let u=0;u<n.length-1;u+=2)s+=String.fromCharCode(n[u]+n[u+1]*256);return s}pe.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let s=this.subarray(t,r);return Object.setPrototypeOf(s,pe.prototype),s};function Wr(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}pe.prototype.readUintLE=pe.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||Wr(t,r,this.length);let s=this[t],u=1,i=0;for(;++i<r&&(u*=256);)s+=this[t+i]*u;return s};pe.prototype.readUintBE=pe.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||Wr(t,r,this.length);let s=this[t+--r],u=1;for(;r>0&&(u*=256);)s+=this[t+--r]*u;return s};pe.prototype.readUint8=pe.prototype.readUInt8=function(t,r){return t=t>>>0,r||Wr(t,1,this.length),this[t]};pe.prototype.readUint16LE=pe.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||Wr(t,2,this.length),this[t]|this[t+1]<<8};pe.prototype.readUint16BE=pe.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||Wr(t,2,this.length),this[t]<<8|this[t+1]};pe.prototype.readUint32LE=pe.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};pe.prototype.readUint32BE=pe.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};pe.prototype.readBigUInt64LE=zu(function(t){t=t>>>0,Lo(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Uc(t,this.length-8);let s=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,u=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(s)+(BigInt(u)<<BigInt(32))});pe.prototype.readBigUInt64BE=zu(function(t){t=t>>>0,Lo(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Uc(t,this.length-8);let s=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],u=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(s)<<BigInt(32))+BigInt(u)});pe.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||Wr(t,r,this.length);let s=this[t],u=1,i=0;for(;++i<r&&(u*=256);)s+=this[t+i]*u;return u*=128,s>=u&&(s-=Math.pow(2,8*r)),s};pe.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||Wr(t,r,this.length);let s=r,u=1,i=this[t+--s];for(;s>0&&(u*=256);)i+=this[t+--s]*u;return u*=128,i>=u&&(i-=Math.pow(2,8*r)),i};pe.prototype.readInt8=function(t,r){return t=t>>>0,r||Wr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};pe.prototype.readInt16LE=function(t,r){t=t>>>0,r||Wr(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};pe.prototype.readInt16BE=function(t,r){t=t>>>0,r||Wr(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};pe.prototype.readInt32LE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};pe.prototype.readInt32BE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};pe.prototype.readBigInt64LE=zu(function(t){t=t>>>0,Lo(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Uc(t,this.length-8);let s=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(s)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});pe.prototype.readBigInt64BE=zu(function(t){t=t>>>0,Lo(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Uc(t,this.length-8);let s=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(s)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});pe.prototype.readFloatLE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),No.read(this,t,!0,23,4)};pe.prototype.readFloatBE=function(t,r){return t=t>>>0,r||Wr(t,4,this.length),No.read(this,t,!1,23,4)};pe.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||Wr(t,8,this.length),No.read(this,t,!0,52,8)};pe.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||Wr(t,8,this.length),No.read(this,t,!1,52,8)};function Qn(e,t,r,n,s,u){if(!pe.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<u)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}pe.prototype.writeUintLE=pe.prototype.writeUIntLE=function(t,r,n,s){if(t=+t,r=r>>>0,n=n>>>0,!s){let o=Math.pow(2,8*n)-1;Qn(this,t,r,n,o,0)}let u=1,i=0;for(this[r]=t&255;++i<n&&(u*=256);)this[r+i]=t/u&255;return r+n};pe.prototype.writeUintBE=pe.prototype.writeUIntBE=function(t,r,n,s){if(t=+t,r=r>>>0,n=n>>>0,!s){let o=Math.pow(2,8*n)-1;Qn(this,t,r,n,o,0)}let u=n-1,i=1;for(this[r+u]=t&255;--u>=0&&(i*=256);)this[r+u]=t/i&255;return r+n};pe.prototype.writeUint8=pe.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,1,255,0),this[r]=t&255,r+1};pe.prototype.writeUint16LE=pe.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};pe.prototype.writeUint16BE=pe.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};pe.prototype.writeUint32LE=pe.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};pe.prototype.writeUint32BE=pe.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function R2(e,t,r,n,s){N2(t,n,s,e,r,7);let u=Number(t&BigInt(4294967295));e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,r}function T2(e,t,r,n,s){N2(t,n,s,e,r,7);let u=Number(t&BigInt(4294967295));e[r+7]=u,u=u>>8,e[r+6]=u,u=u>>8,e[r+5]=u,u=u>>8,e[r+4]=u;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=i,i=i>>8,e[r+2]=i,i=i>>8,e[r+1]=i,i=i>>8,e[r]=i,r+8}pe.prototype.writeBigUInt64LE=zu(function(t,r=0){return R2(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});pe.prototype.writeBigUInt64BE=zu(function(t,r=0){return T2(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});pe.prototype.writeIntLE=function(t,r,n,s){if(t=+t,r=r>>>0,!s){let l=Math.pow(2,8*n-1);Qn(this,t,r,n,l-1,-l)}let u=0,i=1,o=0;for(this[r]=t&255;++u<n&&(i*=256);)t<0&&o===0&&this[r+u-1]!==0&&(o=1),this[r+u]=(t/i>>0)-o&255;return r+n};pe.prototype.writeIntBE=function(t,r,n,s){if(t=+t,r=r>>>0,!s){let l=Math.pow(2,8*n-1);Qn(this,t,r,n,l-1,-l)}let u=n-1,i=1,o=0;for(this[r+u]=t&255;--u>=0&&(i*=256);)t<0&&o===0&&this[r+u+1]!==0&&(o=1),this[r+u]=(t/i>>0)-o&255;return r+n};pe.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};pe.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};pe.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};pe.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};pe.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Qn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};pe.prototype.writeBigInt64LE=zu(function(t,r=0){return R2(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});pe.prototype.writeBigInt64BE=zu(function(t,r=0){return T2(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function x2(e,t,r,n,s,u){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O2(e,t,r,n,s){return t=+t,r=r>>>0,s||x2(e,t,r,4,34028234663852886e22,-34028234663852886e22),No.write(e,t,r,n,23,4),r+4}pe.prototype.writeFloatLE=function(t,r,n){return O2(this,t,r,!0,n)};pe.prototype.writeFloatBE=function(t,r,n){return O2(this,t,r,!1,n)};function k2(e,t,r,n,s){return t=+t,r=r>>>0,s||x2(e,t,r,8,17976931348623157e292,-17976931348623157e292),No.write(e,t,r,n,52,8),r+8}pe.prototype.writeDoubleLE=function(t,r,n){return k2(this,t,r,!0,n)};pe.prototype.writeDoubleBE=function(t,r,n){return k2(this,t,r,!1,n)};pe.prototype.copy=function(t,r,n,s){if(!pe.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),r>=t.length&&(r=t.length),r||(r=0),s>0&&s<n&&(s=n),s===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),t.length-r<s-n&&(s=t.length-r+n);let u=s-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,s):Uint8Array.prototype.set.call(t,this.subarray(n,s),r),u};pe.prototype.fill=function(t,r,n,s){if(typeof t=="string"){if(typeof r=="string"?(s=r,r=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!pe.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(t.length===1){let i=t.charCodeAt(0);(s==="utf8"&&i<128||s==="latin1")&&(t=i)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let u;if(typeof t=="number")for(u=r;u<n;++u)this[u]=t;else{let i=pe.isBuffer(t)?t:pe.from(t,s),o=i.length;if(o===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(u=0;u<n-r;++u)this[u+r]=i[u%o]}return this};var ko={};function Rp(e,t,r){ko[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(s){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:s,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}Rp("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Rp("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);Rp("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,s=r;return Number.isInteger(r)&&Math.abs(r)>2**32?s=b2(String(r)):typeof r=="bigint"&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=b2(s)),s+="n"),n+=` It must be ${t}. Received ${s}`,n},RangeError);function b2(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function ub(e,t,r){Lo(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Uc(t,e.length-(r+1))}function N2(e,t,r,n,s,u){if(e>r||e<t){let i=typeof t=="bigint"?"n":"",o;throw u>3?t===0||t===BigInt(0)?o=`>= 0${i} and < 2${i} ** ${(u+1)*8}${i}`:o=`>= -(2${i} ** ${(u+1)*8-1}${i}) and < 2 ** ${(u+1)*8-1}${i}`:o=`>= ${t}${i} and <= ${r}${i}`,new ko.ERR_OUT_OF_RANGE("value",o,e)}ub(n,s,u)}function Lo(e,t){if(typeof e!="number")throw new ko.ERR_INVALID_ARG_TYPE(t,"number",e)}function Uc(e,t,r){throw Math.floor(e)!==e?(Lo(e,r),new ko.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new ko.ERR_BUFFER_OUT_OF_BOUNDS:new ko.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var ab=/[^+/0-9A-Za-z-_]/g;function ob(e){if(e=e.split("=")[0],e=e.trim().replace(ab,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Ip(e,t){t=t||1/0;let r,n=e.length,s=null,u=[];for(let i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!s){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(i+1===n){(t-=3)>-1&&u.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&u.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return u}function cb(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function lb(e,t){let r,n,s,u=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,s=r%256,u.push(s),u.push(n);return u}function L2(e){return bp.toByteArray(ob(e))}function Lf(e,t,r,n){let s;for(s=0;s<n&&!(s+r>=t.length||s>=e.length);++s)t[s+r]=e[s];return s}function _s(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Tp(e){return e!==e}var fb=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let s=0;s<16;++s)t[n+s]=e[r]+e[s]}return t}();function zu(e){return typeof BigInt>"u"?hb:e}function hb(){throw new Error("BigInt not supported")}});var oA=Be(Se=>{var Hc={};Hc.userAgent=!1;var Ho={},pb="11.1.0",db="jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license";var _e=_e||function(e,t){var r={},n=r.lib={},s=n.Base=function(){function h(){}return{extend:function(w){h.prototype=this;var v=new h;return w&&v.mixIn(w),v.hasOwnProperty("init")||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var v in w)w.hasOwnProperty(v)&&(this[v]=w[v]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=n.WordArray=s.extend({init:function(h,w){h=this.words=h||[],w!=t?this.sigBytes=w:this.sigBytes=h.length*4},toString:function(h){return(h||o).stringify(this)},concat:function(h){var w=this.words,v=h.words,D=this.sigBytes,A=h.sigBytes;if(this.clamp(),D%4)for(var F=0;F<A;F++){var S=v[F>>>2]>>>24-F%4*8&255;w[D+F>>>2]|=S<<24-(D+F)%4*8}else for(var F=0;F<A;F+=4)w[D+F>>>2]=v[F>>>2];return this.sigBytes+=A,this},clamp:function(){var h=this.words,w=this.sigBytes;h[w>>>2]&=4294967295<<32-w%4*8,h.length=e.ceil(w/4)},clone:function(){var h=s.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var w=[],v=0;v<h;v+=4)w.push(e.random()*4294967296|0);return new u.init(w,h)}}),i=r.enc={},o=i.Hex={stringify:function(h){for(var w=h.words,v=h.sigBytes,D=[],A=0;A<v;A++){var F=w[A>>>2]>>>24-A%4*8&255;D.push((F>>>4).toString(16)),D.push((F&15).toString(16))}return D.join("")},parse:function(h){for(var w=h.length,v=[],D=0;D<w;D+=2)v[D>>>3]|=parseInt(h.substr(D,2),16)<<24-D%8*4;return new u.init(v,w/2)}},l=i.Latin1={stringify:function(h){for(var w=h.words,v=h.sigBytes,D=[],A=0;A<v;A++){var F=w[A>>>2]>>>24-A%4*8&255;D.push(String.fromCharCode(F))}return D.join("")},parse:function(h){for(var w=h.length,v=[],D=0;D<w;D++)v[D>>>2]|=(h.charCodeAt(D)&255)<<24-D%4*8;return new u.init(v,w)}},f=i.Utf8={stringify:function(h){try{return decodeURIComponent(escape(l.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return l.parse(unescape(encodeURIComponent(h)))}},d=n.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=f.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var w=this._data,v=w.words,D=w.sigBytes,A=this.blockSize,F=A*4,S=D/F;h?S=e.ceil(S):S=e.max((S|0)-this._minBufferSize,0);var B=S*A,_=e.min(B*4,D);if(B){for(var K=0;K<B;K+=A)this._doProcessBlock(v,K);var G=v.splice(0,B);w.sigBytes-=_}return new u.init(G,_)},clone:function(){var h=s.clone.call(this);return h._data=this._data.clone(),h},_minBufferSize:0}),E=n.Hasher=d.extend({cfg:s.extend(),init:function(h){this.cfg=this.cfg.extend(h),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(h){return this._append(h),this._process(),this},finalize:function(h){h&&this._append(h);var w=this._doFinalize();return w},blockSize:512/32,_createHelper:function(h){return function(w,v){return new h.init(v).finalize(w)}},_createHmacHelper:function(h){return function(w,v){return new p.HMAC.init(h,v).finalize(w)}}}),p=r.algo={};return r}(Math);(function(e){var s=_e,t=s.lib,r=t.Base,n=t.WordArray,s=s.x64={};s.Word=r.extend({init:function(u,i){this.high=u,this.low=i}}),s.WordArray=r.extend({init:function(u,i){u=this.words=u||[],this.sigBytes=i!=e?i:8*u.length},toX32:function(){for(var u=this.words,i=u.length,o=[],l=0;l<i;l++){var f=u[l];o.push(f.high),o.push(f.low)}return n.create(o,this.sigBytes)},clone:function(){for(var u=r.clone.call(this),i=u.words=this.words.slice(0),o=i.length,l=0;l<o;l++)i[l]=i[l].clone();return u}})})();_e.lib.Cipher||function(e){var h=_e,t=h.lib,r=t.Base,n=t.WordArray,s=t.BufferedBlockAlgorithm,u=h.enc.Base64,i=h.algo.EvpKDF,o=t.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(v,D){return this.create(this._ENC_XFORM_MODE,v,D)},createDecryptor:function(v,D){return this.create(this._DEC_XFORM_MODE,v,D)},init:function(v,D,A){this.cfg=this.cfg.extend(A),this._xformMode=v,this._key=D,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(v){return this._append(v),this._process()},finalize:function(v){return v&&this._append(v),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(v){return{encrypt:function(D,A,F){return(typeof A=="string"?w:p).encrypt(v,D,A,F)},decrypt:function(D,A,F){return(typeof A=="string"?w:p).decrypt(v,D,A,F)}}}});t.StreamCipher=o.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var E=h.mode={},l=function(v,D,A){var F=this._iv;F?this._iv=e:F=this._prevBlock;for(var S=0;S<A;S++)v[D+S]^=F[S]},f=(t.BlockCipherMode=r.extend({createEncryptor:function(v,D){return this.Encryptor.create(v,D)},createDecryptor:function(v,D){return this.Decryptor.create(v,D)},init:function(v,D){this._cipher=v,this._iv=D}})).extend();f.Encryptor=f.extend({processBlock:function(v,D){var A=this._cipher,F=A.blockSize;l.call(this,v,D,F),A.encryptBlock(v,D),this._prevBlock=v.slice(D,D+F)}}),f.Decryptor=f.extend({processBlock:function(v,D){var A=this._cipher,F=A.blockSize,S=v.slice(D,D+F);A.decryptBlock(v,D),l.call(this,v,D,F),this._prevBlock=S}}),E=E.CBC=f,f=(h.pad={}).Pkcs7={pad:function(v,D){for(var A=4*D,A=A-v.sigBytes%A,F=A<<24|A<<16|A<<8|A,S=[],B=0;B<A;B+=4)S.push(F);A=n.create(S,A),v.concat(A)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=o.extend({cfg:o.cfg.extend({mode:E,padding:f}),reset:function(){o.reset.call(this);var D=this.cfg,v=D.iv,D=D.mode;if(this._xformMode==this._ENC_XFORM_MODE)var A=D.createEncryptor;else A=D.createDecryptor,this._minBufferSize=1;this._mode=A.call(D,this,v&&v.words)},_doProcessBlock:function(v,D){this._mode.processBlock(v,D)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var D=this._process(!0)}else D=this._process(!0),v.unpad(D);return D},blockSize:4});var d=t.CipherParams=r.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),E=(h.format={}).OpenSSL={stringify:function(v){var D=v.ciphertext;return v=v.salt,(v?n.create([1398893684,1701076831]).concat(v).concat(D):D).toString(u)},parse:function(v){v=u.parse(v);var D=v.words;if(D[0]==1398893684&&D[1]==1701076831){var A=n.create(D.slice(2,4));D.splice(0,4),v.sigBytes-=16}return d.create({ciphertext:v,salt:A})}},p=t.SerializableCipher=r.extend({cfg:r.extend({format:E}),encrypt:function(v,D,A,F){F=this.cfg.extend(F);var S=v.createEncryptor(A,F);return D=S.finalize(D),S=S.cfg,d.create({ciphertext:D,key:A,iv:S.iv,algorithm:v,mode:S.mode,padding:S.padding,blockSize:v.blockSize,formatter:F.format})},decrypt:function(v,D,A,F){return F=this.cfg.extend(F),D=this._parse(D,F.format),v.createDecryptor(A,F).finalize(D.ciphertext)},_parse:function(v,D){return typeof v=="string"?D.parse(v,this):v}}),h=(h.kdf={}).OpenSSL={execute:function(v,D,A,F){return F||(F=n.random(8)),v=i.create({keySize:D+A}).compute(v,F),A=n.create(v.words.slice(D),4*A),v.sigBytes=4*D,d.create({key:v,iv:A,salt:F})}},w=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:h}),encrypt:function(v,D,A,F){return F=this.cfg.extend(F),A=F.kdf.execute(A,v.keySize,v.ivSize),F.iv=A.iv,v=p.encrypt.call(this,v,D,A.key,F),v.mixIn(A),v},decrypt:function(v,D,A,F){return F=this.cfg.extend(F),D=this._parse(D,F.format),A=F.kdf.execute(A,v.keySize,v.ivSize,D.salt),F.iv=A.iv,p.decrypt.call(this,v,D,A.key,F)}})}();(function(){for(var e=_e,t=e.lib.BlockCipher,K=e.algo,r=[],n=[],s=[],u=[],i=[],o=[],l=[],f=[],d=[],E=[],p=[],h=0;256>h;h++)p[h]=128>h?h<<1:h<<1^283;for(var w=0,v=0,h=0;256>h;h++){var D=v^v<<1^v<<2^v<<3^v<<4,D=D>>>8^D&255^99;r[w]=D,n[D]=w;var A=p[w],F=p[A],S=p[F],B=257*p[D]^16843008*D;s[w]=B<<24|B>>>8,u[w]=B<<16|B>>>16,i[w]=B<<8|B>>>24,o[w]=B,B=16843009*S^65537*F^257*A^16843008*w,l[D]=B<<24|B>>>8,f[D]=B<<16|B>>>16,d[D]=B<<8|B>>>24,E[D]=B,w?(w=A^p[p[p[S^A]]],v^=p[p[v]]):w=v=1}var _=[0,1,2,4,8,16,32,64,128,27,54],K=K.AES=t.extend({_doReset:function(){for(var P=this._key,G=P.words,b=P.sigBytes/4,P=4*((this._nRounds=b+6)+1),L=this._keySchedule=[],j=0;j<P;j++)if(j<b)L[j]=G[j];else{var V=L[j-1];j%b?6<b&&j%b==4&&(V=r[V>>>24]<<24|r[V>>>16&255]<<16|r[V>>>8&255]<<8|r[V&255]):(V=V<<8|V>>>24,V=r[V>>>24]<<24|r[V>>>16&255]<<16|r[V>>>8&255]<<8|r[V&255],V^=_[j/b|0]<<24),L[j]=L[j-b]^V}for(G=this._invKeySchedule=[],b=0;b<P;b++)j=P-b,V=b%4?L[j]:L[j-4],G[b]=4>b||4>=j?V:l[r[V>>>24]]^f[r[V>>>16&255]]^d[r[V>>>8&255]]^E[r[V&255]]},encryptBlock:function(G,b){this._doCryptBlock(G,b,this._keySchedule,s,u,i,o,r)},decryptBlock:function(G,b){var P=G[b+1];G[b+1]=G[b+3],G[b+3]=P,this._doCryptBlock(G,b,this._invKeySchedule,l,f,d,E,n),P=G[b+1],G[b+1]=G[b+3],G[b+3]=P},_doCryptBlock:function(G,b,P,L,j,V,W,q){for(var z=this._nRounds,ce=G[b]^P[0],Ie=G[b+1]^P[1],Me=G[b+2]^P[2],Xe=G[b+3]^P[3],J=4,se=1;se<z;se++)var ye=L[ce>>>24]^j[Ie>>>16&255]^V[Me>>>8&255]^W[Xe&255]^P[J++],Ce=L[Ie>>>24]^j[Me>>>16&255]^V[Xe>>>8&255]^W[ce&255]^P[J++],Pe=L[Me>>>24]^j[Xe>>>16&255]^V[ce>>>8&255]^W[Ie&255]^P[J++],Xe=L[Xe>>>24]^j[ce>>>16&255]^V[Ie>>>8&255]^W[Me&255]^P[J++],ce=ye,Ie=Ce,Me=Pe;ye=(q[ce>>>24]<<24|q[Ie>>>16&255]<<16|q[Me>>>8&255]<<8|q[Xe&255])^P[J++],Ce=(q[Ie>>>24]<<24|q[Me>>>16&255]<<16|q[Xe>>>8&255]<<8|q[ce&255])^P[J++],Pe=(q[Me>>>24]<<24|q[Xe>>>16&255]<<16|q[ce>>>8&255]<<8|q[Ie&255])^P[J++],Xe=(q[Xe>>>24]<<24|q[ce>>>16&255]<<16|q[Ie>>>8&255]<<8|q[Me&255])^P[J++],G[b]=ye,G[b+1]=Ce,G[b+2]=Pe,G[b+3]=Xe},keySize:8});e.AES=t._createHelper(K)})();(function(){function e(p,h){var w=(this._lBlock>>>p^this._rBlock)&h;this._rBlock^=w,this._lBlock^=w<<p}function t(p,h){var w=(this._rBlock>>>p^this._lBlock)&h;this._lBlock^=w,this._rBlock^=w<<p}var r=_e,s=r.lib,n=s.WordArray,s=s.BlockCipher,u=r.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],E=u.DES=s.extend({_doReset:function(){for(var p=this._key.words,h=[],w=0;56>w;w++){var v=i[w]-1;h[w]=p[v>>>5]>>>31-v%32&1}for(p=this._subKeys=[],v=0;16>v;v++){for(var D=p[v]=[],A=l[v],w=0;24>w;w++)D[w/6|0]|=h[(o[w]-1+A)%28]<<31-w%6,D[4+(w/6|0)]|=h[28+(o[w+24]-1+A)%28]<<31-w%6;for(D[0]=D[0]<<1|D[0]>>>31,w=1;7>w;w++)D[w]>>>=4*(w-1)+3;D[7]=D[7]<<5|D[7]>>>27}for(h=this._invSubKeys=[],w=0;16>w;w++)h[w]=p[15-w]},encryptBlock:function(p,h){this._doCryptBlock(p,h,this._subKeys)},decryptBlock:function(p,h){this._doCryptBlock(p,h,this._invSubKeys)},_doCryptBlock:function(p,h,w){this._lBlock=p[h],this._rBlock=p[h+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var v=0;16>v;v++){for(var D=w[v],A=this._lBlock,F=this._rBlock,S=0,B=0;8>B;B++)S|=f[B][((F^D[B])&d[B])>>>0];this._lBlock=F,this._rBlock=A^S}w=this._lBlock,this._lBlock=this._rBlock,this._rBlock=w,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),p[h]=this._lBlock,p[h+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=s._createHelper(E),u=u.TripleDES=s.extend({_doReset:function(){var p=this._key.words;this._des1=E.createEncryptor(n.create(p.slice(0,2))),this._des2=E.createEncryptor(n.create(p.slice(2,4))),this._des3=E.createEncryptor(n.create(p.slice(4,6)))},encryptBlock:function(p,h){this._des1.encryptBlock(p,h),this._des2.decryptBlock(p,h),this._des3.encryptBlock(p,h)},decryptBlock:function(p,h){this._des3.decryptBlock(p,h),this._des2.encryptBlock(p,h),this._des1.decryptBlock(p,h)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=s._createHelper(u)})();(function(){var e=_e,t=e.lib.WordArray;e.enc.Base64={stringify:function(r){var n=r.words,s=r.sigBytes,u=this._map;r.clamp(),r=[];for(var i=0;i<s;i+=3)for(var o=(n[i>>>2]>>>24-8*(i%4)&255)<<16|(n[i+1>>>2]>>>24-8*((i+1)%4)&255)<<8|n[i+2>>>2]>>>24-8*((i+2)%4)&255,l=0;4>l&&i+.75*l<s;l++)r.push(u.charAt(o>>>6*(3-l)&63));if(n=u.charAt(64))for(;r.length%4;)r.push(n);return r.join("")},parse:function(r){var n=r.length,s=this._map,u=s.charAt(64);u&&(u=r.indexOf(u),u!=-1&&(n=u));for(var u=[],i=0,o=0;o<n;o++)if(o%4){var l=s.indexOf(r.charAt(o-1))<<2*(o%4),f=s.indexOf(r.charAt(o))>>>6-2*(o%4);u[i>>>2]|=(l|f)<<24-8*(i%4),i++}return t.create(u,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(e){function t(E,p,h,w,v,D,A){return E=E+(p&h|~p&w)+v+A,(E<<D|E>>>32-D)+p}function r(E,p,h,w,v,D,A){return E=E+(p&w|h&~w)+v+A,(E<<D|E>>>32-D)+p}function n(E,p,h,w,v,D,A){return E=E+(p^h^w)+v+A,(E<<D|E>>>32-D)+p}function s(E,p,h,w,v,D,A){return E=E+(h^(p|~w))+v+A,(E<<D|E>>>32-D)+p}for(var u=_e,l=u.lib,i=l.WordArray,o=l.Hasher,l=u.algo,f=[],d=0;64>d;d++)f[d]=4294967296*e.abs(e.sin(d+1))|0;l=l.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,p){for(var h=0;16>h;h++){var w=p+h,v=E[w];E[w]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360}var h=this._hash.words,w=E[p+0],v=E[p+1],D=E[p+2],A=E[p+3],F=E[p+4],S=E[p+5],B=E[p+6],_=E[p+7],K=E[p+8],G=E[p+9],b=E[p+10],P=E[p+11],L=E[p+12],j=E[p+13],V=E[p+14],W=E[p+15],q=h[0],se=h[1],J=h[2],z=h[3],q=t(q,se,J,z,w,7,f[0]),z=t(z,q,se,J,v,12,f[1]),J=t(J,z,q,se,D,17,f[2]),se=t(se,J,z,q,A,22,f[3]),q=t(q,se,J,z,F,7,f[4]),z=t(z,q,se,J,S,12,f[5]),J=t(J,z,q,se,B,17,f[6]),se=t(se,J,z,q,_,22,f[7]),q=t(q,se,J,z,K,7,f[8]),z=t(z,q,se,J,G,12,f[9]),J=t(J,z,q,se,b,17,f[10]),se=t(se,J,z,q,P,22,f[11]),q=t(q,se,J,z,L,7,f[12]),z=t(z,q,se,J,j,12,f[13]),J=t(J,z,q,se,V,17,f[14]),se=t(se,J,z,q,W,22,f[15]),q=r(q,se,J,z,v,5,f[16]),z=r(z,q,se,J,B,9,f[17]),J=r(J,z,q,se,P,14,f[18]),se=r(se,J,z,q,w,20,f[19]),q=r(q,se,J,z,S,5,f[20]),z=r(z,q,se,J,b,9,f[21]),J=r(J,z,q,se,W,14,f[22]),se=r(se,J,z,q,F,20,f[23]),q=r(q,se,J,z,G,5,f[24]),z=r(z,q,se,J,V,9,f[25]),J=r(J,z,q,se,A,14,f[26]),se=r(se,J,z,q,K,20,f[27]),q=r(q,se,J,z,j,5,f[28]),z=r(z,q,se,J,D,9,f[29]),J=r(J,z,q,se,_,14,f[30]),se=r(se,J,z,q,L,20,f[31]),q=n(q,se,J,z,S,4,f[32]),z=n(z,q,se,J,K,11,f[33]),J=n(J,z,q,se,P,16,f[34]),se=n(se,J,z,q,V,23,f[35]),q=n(q,se,J,z,v,4,f[36]),z=n(z,q,se,J,F,11,f[37]),J=n(J,z,q,se,_,16,f[38]),se=n(se,J,z,q,b,23,f[39]),q=n(q,se,J,z,j,4,f[40]),z=n(z,q,se,J,w,11,f[41]),J=n(J,z,q,se,A,16,f[42]),se=n(se,J,z,q,B,23,f[43]),q=n(q,se,J,z,G,4,f[44]),z=n(z,q,se,J,L,11,f[45]),J=n(J,z,q,se,W,16,f[46]),se=n(se,J,z,q,D,23,f[47]),q=s(q,se,J,z,w,6,f[48]),z=s(z,q,se,J,_,10,f[49]),J=s(J,z,q,se,V,15,f[50]),se=s(se,J,z,q,S,21,f[51]),q=s(q,se,J,z,L,6,f[52]),z=s(z,q,se,J,A,10,f[53]),J=s(J,z,q,se,b,15,f[54]),se=s(se,J,z,q,v,21,f[55]),q=s(q,se,J,z,K,6,f[56]),z=s(z,q,se,J,W,10,f[57]),J=s(J,z,q,se,B,15,f[58]),se=s(se,J,z,q,j,21,f[59]),q=s(q,se,J,z,F,6,f[60]),z=s(z,q,se,J,P,10,f[61]),J=s(J,z,q,se,D,15,f[62]),se=s(se,J,z,q,G,21,f[63]);h[0]=h[0]+q|0,h[1]=h[1]+se|0,h[2]=h[2]+J|0,h[3]=h[3]+z|0},_doFinalize:function(){var E=this._data,p=E.words,h=8*this._nDataBytes,w=8*E.sigBytes;p[w>>>5]|=128<<24-w%32;var v=e.floor(h/4294967296);for(p[(w+64>>>9<<4)+15]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,p[(w+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,E.sigBytes=4*(p.length+1),this._process(),E=this._hash,p=E.words,h=0;4>h;h++)w=p[h],p[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;return E},clone:function(){var E=o.clone.call(this);return E._hash=this._hash.clone(),E}}),u.MD5=o._createHelper(l),u.HmacMD5=o._createHmacHelper(l)})(Math);(function(){var e=_e,s=e.lib,t=s.WordArray,r=s.Hasher,n=[],s=e.algo.SHA1=r.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,i){for(var o=this._hash.words,l=o[0],f=o[1],d=o[2],E=o[3],p=o[4],h=0;80>h;h++){if(16>h)n[h]=u[i+h]|0;else{var w=n[h-3]^n[h-8]^n[h-14]^n[h-16];n[h]=w<<1|w>>>31}w=(l<<5|l>>>27)+p+n[h],w=20>h?w+((f&d|~f&E)+1518500249):40>h?w+((f^d^E)+1859775393):60>h?w+((f&d|f&E|d&E)-1894007588):w+((f^d^E)-899497514),p=E,E=d,d=f<<30|f>>>2,f=l,l=w}o[0]=o[0]+l|0,o[1]=o[1]+f|0,o[2]=o[2]+d|0,o[3]=o[3]+E|0,o[4]=o[4]+p|0},_doFinalize:function(){var u=this._data,i=u.words,o=8*this._nDataBytes,l=8*u.sigBytes;return i[l>>>5]|=128<<24-l%32,i[(l+64>>>9<<4)+14]=Math.floor(o/4294967296),i[(l+64>>>9<<4)+15]=o,u.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var u=r.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=r._createHelper(s),e.HmacSHA1=r._createHmacHelper(s)})();(function(e){for(var t=_e,h=t.lib,r=h.WordArray,n=h.Hasher,h=t.algo,s=[],u=[],i=function(v){return 4294967296*(v-(v|0))|0},o=2,l=0;64>l;){var f;e:{f=o;for(var d=e.sqrt(f),E=2;E<=d;E++)if(!(f%E)){f=!1;break e}f=!0}f&&(8>l&&(s[l]=i(e.pow(o,.5))),u[l]=i(e.pow(o,1/3)),l++),o++}var p=[],h=h.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(w,v){for(var D=this._hash.words,A=D[0],F=D[1],S=D[2],B=D[3],_=D[4],K=D[5],G=D[6],b=D[7],P=0;64>P;P++){if(16>P)p[P]=w[v+P]|0;else{var L=p[P-15],j=p[P-2];p[P]=((L<<25|L>>>7)^(L<<14|L>>>18)^L>>>3)+p[P-7]+((j<<15|j>>>17)^(j<<13|j>>>19)^j>>>10)+p[P-16]}L=b+((_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25))+(_&K^~_&G)+u[P]+p[P],j=((A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22))+(A&F^A&S^F&S),b=G,G=K,K=_,_=B+L|0,B=S,S=F,F=A,A=L+j|0}D[0]=D[0]+A|0,D[1]=D[1]+F|0,D[2]=D[2]+S|0,D[3]=D[3]+B|0,D[4]=D[4]+_|0,D[5]=D[5]+K|0,D[6]=D[6]+G|0,D[7]=D[7]+b|0},_doFinalize:function(){var w=this._data,v=w.words,D=8*this._nDataBytes,A=8*w.sigBytes;return v[A>>>5]|=128<<24-A%32,v[(A+64>>>9<<4)+14]=e.floor(D/4294967296),v[(A+64>>>9<<4)+15]=D,w.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var w=n.clone.call(this);return w._hash=this._hash.clone(),w}});t.SHA256=n._createHelper(h),t.HmacSHA256=n._createHmacHelper(h)})(Math);(function(){var e=_e,t=e.lib.WordArray,n=e.algo,r=n.SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var s=r._doFinalize.call(this);return s.sigBytes-=4,s}});e.SHA224=r._createHelper(n),e.HmacSHA224=r._createHmacHelper(n)})();(function(){function e(){return n.create.apply(n,arguments)}for(var t=_e,r=t.lib.Hasher,u=t.x64,n=u.Word,s=u.WordArray,u=t.algo,i=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],o=[],l=0;80>l;l++)o[l]=e();u=u.SHA512=r.extend({_doReset:function(){this._hash=new s.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(f,d){for(var F=this._hash.words,E=F[0],p=F[1],h=F[2],w=F[3],v=F[4],D=F[5],A=F[6],F=F[7],S=E.high,B=E.low,_=p.high,K=p.low,G=h.high,b=h.low,P=w.high,L=w.low,j=v.high,V=v.low,W=D.high,q=D.low,z=A.high,J=A.low,se=F.high,ye=F.low,Ce=S,Pe=B,Xe=_,ce=K,Ie=G,Me=b,_r=P,Kt=L,Ft=j,gr=V,nr=W,ht=q,Vt=z,st=J,ze=se,ir=ye,je=0;80>je;je++){var mr=o[je];if(16>je)var Tt=mr.high=f[d+2*je]|0,be=mr.low=f[d+2*je+1]|0;else{var Tt=o[je-15],be=Tt.high,mt=Tt.low,Tt=(be>>>1|mt<<31)^(be>>>8|mt<<24)^be>>>7,mt=(mt>>>1|be<<31)^(mt>>>8|be<<24)^(mt>>>7|be<<25),Br=o[je-2],be=Br.high,Dt=Br.low,Br=(be>>>19|Dt<<13)^(be<<3|Dt>>>29)^be>>>6,Dt=(Dt>>>19|be<<13)^(Dt<<3|be>>>29)^(Dt>>>6|be<<26),be=o[je-7],Zr=be.high,Zt=o[je-16],Ue=Zt.high,Zt=Zt.low,be=mt+be.low,Tt=Tt+Zr+(be>>>0<mt>>>0?1:0),be=be+Dt,Tt=Tt+Br+(be>>>0<Dt>>>0?1:0),be=be+Zt,Tt=Tt+Ue+(be>>>0<Zt>>>0?1:0);mr.high=Tt,mr.low=be}var Zr=Ft&nr^~Ft&Vt,Zt=gr&ht^~gr&st,mr=Ce&Xe^Ce&Ie^Xe&Ie,Gt=Pe&ce^Pe&Me^ce&Me,mt=(Ce>>>28|Pe<<4)^(Ce<<30|Pe>>>2)^(Ce<<25|Pe>>>7),Br=(Pe>>>28|Ce<<4)^(Pe<<30|Ce>>>2)^(Pe<<25|Ce>>>7),Dt=i[je],ui=Dt.high,Qr=Dt.low,Dt=ir+((gr>>>14|Ft<<18)^(gr>>>18|Ft<<14)^(gr<<23|Ft>>>9)),Ue=ze+((Ft>>>14|gr<<18)^(Ft>>>18|gr<<14)^(Ft<<23|gr>>>9))+(Dt>>>0<ir>>>0?1:0),Dt=Dt+Zt,Ue=Ue+Zr+(Dt>>>0<Zt>>>0?1:0),Dt=Dt+Qr,Ue=Ue+ui+(Dt>>>0<Qr>>>0?1:0),Dt=Dt+be,Ue=Ue+Tt+(Dt>>>0<be>>>0?1:0),be=Br+Gt,mr=mt+mr+(be>>>0<Br>>>0?1:0),ze=Vt,ir=st,Vt=nr,st=ht,nr=Ft,ht=gr,gr=Kt+Dt|0,Ft=_r+Ue+(gr>>>0<Kt>>>0?1:0)|0,_r=Ie,Kt=Me,Ie=Xe,Me=ce,Xe=Ce,ce=Pe,Pe=Dt+be|0,Ce=Ue+mr+(Pe>>>0<Dt>>>0?1:0)|0}B=E.low=B+Pe,E.high=S+Ce+(B>>>0<Pe>>>0?1:0),K=p.low=K+ce,p.high=_+Xe+(K>>>0<ce>>>0?1:0),b=h.low=b+Me,h.high=G+Ie+(b>>>0<Me>>>0?1:0),L=w.low=L+Kt,w.high=P+_r+(L>>>0<Kt>>>0?1:0),V=v.low=V+gr,v.high=j+Ft+(V>>>0<gr>>>0?1:0),q=D.low=q+ht,D.high=W+nr+(q>>>0<ht>>>0?1:0),J=A.low=J+st,A.high=z+Vt+(J>>>0<st>>>0?1:0),ye=F.low=ye+ir,F.high=se+ze+(ye>>>0<ir>>>0?1:0)},_doFinalize:function(){var f=this._data,d=f.words,E=8*this._nDataBytes,p=8*f.sigBytes;return d[p>>>5]|=128<<24-p%32,d[(p+128>>>10<<5)+30]=Math.floor(E/4294967296),d[(p+128>>>10<<5)+31]=E,f.sigBytes=4*d.length,this._process(),this._hash.toX32()},clone:function(){var f=r.clone.call(this);return f._hash=this._hash.clone(),f},blockSize:32}),t.SHA512=r._createHelper(u),t.HmacSHA512=r._createHmacHelper(u)})();(function(){var e=_e,s=e.x64,t=s.Word,r=s.WordArray,s=e.algo,n=s.SHA512,s=s.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var u=n._doFinalize.call(this);return u.sigBytes-=16,u}});e.SHA384=n._createHelper(s),e.HmacSHA384=n._createHmacHelper(s)})();(function(){var e=_e,f=e.lib,t=f.WordArray,r=f.Hasher,f=e.algo,n=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),i=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),o=t.create([0,1518500249,1859775393,2400959708,2840853838]),l=t.create([1352829926,1548603684,1836072691,2053994217,0]),f=f.RIPEMD160=r.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,E){for(var p=0;16>p;p++){var h=E+p,w=d[h];d[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var h=this._hash.words,w=o.words,v=l.words,D=n.words,A=s.words,F=u.words,S=i.words,B,_,K,G,b,P,L,j,V,W;P=B=h[0],L=_=h[1],j=K=h[2],V=G=h[3],W=b=h[4];for(var q,p=0;80>p;p+=1)q=B+d[E+D[p]]|0,q=16>p?q+((_^K^G)+w[0]):32>p?q+((_&K|~_&G)+w[1]):48>p?q+(((_|~K)^G)+w[2]):64>p?q+((_&G|K&~G)+w[3]):q+((_^(K|~G))+w[4]),q|=0,q=q<<F[p]|q>>>32-F[p],q=q+b|0,B=b,b=G,G=K<<10|K>>>22,K=_,_=q,q=P+d[E+A[p]]|0,q=16>p?q+((L^(j|~V))+v[0]):32>p?q+((L&V|j&~V)+v[1]):48>p?q+(((L|~j)^V)+v[2]):64>p?q+((L&j|~L&V)+v[3]):q+((L^j^V)+v[4]),q|=0,q=q<<S[p]|q>>>32-S[p],q=q+W|0,P=W,W=V,V=j<<10|j>>>22,j=L,L=q;q=h[1]+K+V|0,h[1]=h[2]+G+W|0,h[2]=h[3]+b+P|0,h[3]=h[4]+B+L|0,h[4]=h[0]+_+j|0,h[0]=q},_doFinalize:function(){var d=this._data,E=d.words,p=8*this._nDataBytes,h=8*d.sigBytes;for(E[h>>>5]|=128<<24-h%32,E[(h+64>>>9<<4)+14]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,d.sigBytes=4*(E.length+1),this._process(),d=this._hash,E=d.words,p=0;5>p;p++)h=E[p],E[p]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return d},clone:function(){var d=r.clone.call(this);return d._hash=this._hash.clone(),d}});e.RIPEMD160=r._createHelper(f),e.HmacRIPEMD160=r._createHmacHelper(f)})(Math);(function(){var e=_e,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(r,n){r=this._hasher=new r.init,typeof n=="string"&&(n=t.parse(n));var s=r.blockSize,u=4*s;n.sigBytes>u&&(n=r.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),o=this._iKey=n.clone(),l=i.words,f=o.words,d=0;d<s;d++)l[d]^=1549556828,f[d]^=909522486;i.sigBytes=o.sigBytes=u,this.reset()},reset:function(){var r=this._hasher;r.reset(),r.update(this._iKey)},update:function(r){return this._hasher.update(r),this},finalize:function(r){var n=this._hasher;return r=n.finalize(r),n.reset(),n.finalize(this._oKey.clone().concat(r))}})})();(function(){var e=_e,n=e.lib,t=n.Base,r=n.WordArray,n=e.algo,s=n.HMAC,u=n.PBKDF2=t.extend({cfg:t.extend({keySize:4,hasher:n.SHA1,iterations:1}),init:function(i){this.cfg=this.cfg.extend(i)},compute:function(i,o){for(var w=this.cfg,l=s.create(w.hasher,i),f=r.create(),d=r.create([1]),E=f.words,p=d.words,h=w.keySize,w=w.iterations;E.length<h;){var v=l.update(o).finalize(d);l.reset();for(var D=v.words,A=D.length,F=v,S=1;S<w;S++){F=l.finalize(F),l.reset();for(var B=F.words,_=0;_<A;_++)D[_]^=B[_]}f.concat(v),p[0]++}return f.sigBytes=4*h,f}});e.PBKDF2=function(i,o,l){return u.create(l).compute(i,o)}})();var jo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Np="=";function lu(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=jo.charAt(r>>6)+jo.charAt(r&63);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=jo.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=jo.charAt(r>>2)+jo.charAt((r&3)<<4)),Np)for(;(n.length&3)>0;)n+=Np;return n}function qo(e){var t="",r,n=0,s,u;for(r=0;r<e.length&&e.charAt(r)!=Np;++r)u=jo.indexOf(e.charAt(r)),!(u<0)&&(n==0?(t+=cu(u>>2),s=u&3,n=1):n==1?(t+=cu(s<<2|u>>4),s=u&15,n=2):n==2?(t+=cu(s),t+=cu(u>>2),s=u&3,n=3):(t+=cu(s<<2|u>>4),t+=cu(u&15),n=0));return n==1&&(t+=cu(s<<2)),t}function M2(e){var t=qo(e),r,n=new Array;for(r=0;2*r<t.length;++r)n[r]=parseInt(t.substring(2*r,2*r+2),16);return n}var Wu,gb=0xdeadbeefcafe,U2=(gb&16777215)==15715070;function ee(e,t,r){e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}function bt(){return new ee(null)}function mb(e,t,r,n,s,u){for(;--u>=0;){var i=t*this[e++]+r[n]+s;s=Math.floor(i/67108864),r[n++]=i&67108863}return s}function vb(e,t,r,n,s,u){for(var i=t&32767,o=t>>15;--u>=0;){var l=this[e]&32767,f=this[e++]>>15,d=o*l+f*i;l=i*l+((d&32767)<<15)+r[n]+(s&1073741823),s=(l>>>30)+(d>>>15)+o*f+(s>>>30),r[n++]=l&1073741823}return s}function Ab(e,t,r,n,s,u){for(var i=t&16383,o=t>>14;--u>=0;){var l=this[e]&16383,f=this[e++]>>14,d=o*l+f*i;l=i*l+((d&16383)<<14)+r[n]+s,s=(l>>28)+(d>>14)+o*f,r[n++]=l&268435455}return s}U2&&Hc.appName=="Microsoft Internet Explorer"?(ee.prototype.am=vb,Wu=30):U2&&Hc.appName!="Netscape"?(ee.prototype.am=mb,Wu=26):(ee.prototype.am=Ab,Wu=28);ee.prototype.DB=Wu;ee.prototype.DM=(1<<Wu)-1;ee.prototype.DV=1<<Wu;var Mp=52;ee.prototype.FV=Math.pow(2,Mp);ee.prototype.F1=Mp-Wu;ee.prototype.F2=2*Wu-Mp;var Eb="0123456789abcdefghijklmnopqrstuvwxyz",Kf=new Array,Ko,ji;Ko=48;for(ji=0;ji<=9;++ji)Kf[Ko++]=ji;Ko=97;for(ji=10;ji<36;++ji)Kf[Ko++]=ji;Ko=65;for(ji=10;ji<36;++ji)Kf[Ko++]=ji;function cu(e){return Eb.charAt(e)}function q2(e,t){var r=Kf[e.charCodeAt(t)];return r??-1}function wb(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function Fb(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function Yu(e){var t=bt();return t.fromInt(e),t}function Cb(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,s=!1,u=0;--n>=0;){var i=r==8?e[n]&255:q2(e,n);if(i<0){e.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=i:u+r>this.DB?(this[this.t-1]|=(i&(1<<this.DB-u)-1)<<u,this[this.t++]=i>>this.DB-u):this[this.t-1]|=i<<u,u+=r,u>=this.DB&&(u-=this.DB)}r==8&&e[0]&128&&(this.s=-1,u>0&&(this[this.t-1]|=(1<<this.DB-u)-1<<u)),this.clamp(),s&&ee.ZERO.subTo(this,this)}function Db(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function yb(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,s=!1,u="",i=this.t,o=this.DB-i*this.DB%t;if(i-- >0)for(o<this.DB&&(n=this[i]>>o)>0&&(s=!0,u=cu(n));i>=0;)o<t?(n=(this[i]&(1<<o)-1)<<t-o,n|=this[--i]>>(o+=this.DB-t)):(n=this[i]>>(o-=t)&r,o<=0&&(o+=this.DB,--i)),n>0&&(s=!0),s&&(u+=cu(n));return s?u:"0"}function Sb(){var e=bt();return ee.ZERO.subTo(this,e),e}function bb(){return this.s<0?this.negate():this}function _b(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}function Vf(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function Bb(){return this.t<=0?0:this.DB*(this.t-1)+Vf(this[this.t-1]^this.s&this.DM)}function Ib(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}function $b(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}function Pb(e,t){var r=e%this.DB,n=this.DB-r,s=(1<<n)-1,u=Math.floor(e/this.DB),i=this.s<<r&this.DM,o;for(o=this.t-1;o>=0;--o)t[o+u+1]=this[o]>>n|i,i=(this[o]&s)<<r;for(o=u-1;o>=0;--o)t[o]=0;t[u]=i,t.t=this.t+u+1,t.s=this.s,t.clamp()}function Rb(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,s=this.DB-n,u=(1<<n)-1;t[0]=this[r]>>n;for(var i=r+1;i<this.t;++i)t[i-r-1]|=(this[i]&u)<<s,t[i-r]=this[i]>>n;n>0&&(t[this.t-r-1]|=(this.s&u)<<s),t.t=this.t-r,t.clamp()}function Tb(e,t){for(var r=0,n=0,s=Math.min(e.t,this.t);r<s;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}function xb(e,t){var r=this.abs(),n=e.abs(),s=r.t;for(t.t=s+n.t;--s>=0;)t[s]=0;for(s=0;s<n.t;++s)t[s+r.t]=r.am(0,n[s],t,s,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&ee.ZERO.subTo(t,t)}function Ob(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}function kb(e,t,r){var n=e.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=bt());var u=bt(),i=this.s,o=e.s,l=this.DB-Vf(n[n.t-1]);l>0?(n.lShiftTo(l,u),s.lShiftTo(l,r)):(n.copyTo(u),s.copyTo(r));var f=u.t,d=u[f-1];if(d!=0){var E=d*(1<<this.F1)+(f>1?u[f-2]>>this.F2:0),p=this.FV/E,h=(1<<this.F1)/E,w=1<<this.F2,v=r.t,D=v-f,A=t??bt();for(u.dlShiftTo(D,A),r.compareTo(A)>=0&&(r[r.t++]=1,r.subTo(A,r)),ee.ONE.dlShiftTo(f,A),A.subTo(u,u);u.t<f;)u[u.t++]=0;for(;--D>=0;){var F=r[--v]==d?this.DM:Math.floor(r[v]*p+(r[v-1]+w)*h);if((r[v]+=u.am(0,F,r,D,0,f))<F)for(u.dlShiftTo(D,A),r.subTo(A,r);r[v]<--F;)r.subTo(A,r)}t!=null&&(r.drShiftTo(f,t),i!=o&&ee.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),i<0&&ee.ZERO.subTo(r,r)}}}function Nb(e){var t=bt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ee.ZERO)>0&&e.subTo(t,t),t}function Ma(e){this.m=e}function Lb(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Ub(e){return e}function Hb(e){e.divRemTo(this.m,null,e)}function jb(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Mb(e,t){e.squareTo(t),this.reduce(t)}Ma.prototype.convert=Lb;Ma.prototype.revert=Ub;Ma.prototype.reduce=Hb;Ma.prototype.mulTo=jb;Ma.prototype.sqrTo=Mb;function qb(){if(this.t<1)return 0;var e=this[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function qa(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Kb(e){var t=bt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ee.ZERO)>0&&this.m.subTo(t,t),t}function Vb(e){var t=bt();return e.copyTo(t),this.reduce(t),t}function Gb(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function zb(e,t){e.squareTo(t),this.reduce(t)}function Yb(e,t,r){e.multiplyTo(t,r),this.reduce(r)}qa.prototype.convert=Kb;qa.prototype.revert=Vb;qa.prototype.reduce=Gb;qa.prototype.mulTo=Yb;qa.prototype.sqrTo=zb;function Wb(){return(this.t>0?this[0]&1:this.s)==0}function Jb(e,t){if(e>4294967295||e<1)return ee.ONE;var r=bt(),n=bt(),s=t.convert(this),u=Vf(e)-1;for(s.copyTo(r);--u>=0;)if(t.sqrTo(r,n),(e&1<<u)>0)t.mulTo(n,s,r);else{var i=r;r=n,n=i}return t.revert(r)}function Xb(e,t){var r;return e<256||t.isEven()?r=new Ma(t):r=new qa(t),this.exp(e,r)}ee.prototype.copyTo=wb;ee.prototype.fromInt=Fb;ee.prototype.fromString=Cb;ee.prototype.clamp=Db;ee.prototype.dlShiftTo=Ib;ee.prototype.drShiftTo=$b;ee.prototype.lShiftTo=Pb;ee.prototype.rShiftTo=Rb;ee.prototype.subTo=Tb;ee.prototype.multiplyTo=xb;ee.prototype.squareTo=Ob;ee.prototype.divRemTo=kb;ee.prototype.invDigit=qb;ee.prototype.isEven=Wb;ee.prototype.exp=Jb;ee.prototype.toString=yb;ee.prototype.negate=Sb;ee.prototype.abs=bb;ee.prototype.compareTo=_b;ee.prototype.bitLength=Bb;ee.prototype.mod=Nb;ee.prototype.modPowInt=Xb;ee.ZERO=Yu(0);ee.ONE=Yu(1);function Zb(){var e=bt();return this.copyTo(e),e}function Qb(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function e_(){return this.t==0?this.s:this[0]<<24>>24}function t_(){return this.t==0?this.s:this[0]<<16>>16}function r_(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function n_(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function i_(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Yu(r),s=bt(),u=bt(),i="";for(this.divRemTo(n,s,u);s.signum()>0;)i=(r+u.intValue()).toString(e).substr(1)+i,s.divRemTo(n,s,u);return u.intValue().toString(e)+i}function s_(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),s=!1,u=0,i=0,o=0;o<e.length;++o){var l=q2(e,o);if(l<0){e.charAt(o)=="-"&&this.signum()==0&&(s=!0);continue}i=t*i+l,++u>=r&&(this.dMultiply(n),this.dAddOffset(i,0),u=0,i=0)}u>0&&(this.dMultiply(Math.pow(t,u)),this.dAddOffset(i,0)),s&&ee.ZERO.subTo(this,this)}function u_(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(ee.ONE.shiftLeft(e-1),qp,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ee.ONE.shiftLeft(e-1),this);else{var n=new Array,s=e&7;n.length=(e>>3)+1,t.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}}function a_(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,s=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[s++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(t[s++]=n);return t}function o_(e){return this.compareTo(e)==0}function c_(e){return this.compareTo(e)<0?this:e}function l_(e){return this.compareTo(e)>0?this:e}function f_(e,t,r){var n,s,u=Math.min(e.t,this.t);for(n=0;n<u;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(s=e.s&this.DM,n=u;n<this.t;++n)r[n]=t(this[n],s);r.t=this.t}else{for(s=this.s&this.DM,n=u;n<e.t;++n)r[n]=t(s,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function h_(e,t){return e&t}function p_(e){var t=bt();return this.bitwiseTo(e,h_,t),t}function qp(e,t){return e|t}function d_(e){var t=bt();return this.bitwiseTo(e,qp,t),t}function K2(e,t){return e^t}function g_(e){var t=bt();return this.bitwiseTo(e,K2,t),t}function V2(e,t){return e&~t}function m_(e){var t=bt();return this.bitwiseTo(e,V2,t),t}function v_(){for(var e=bt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function A_(e){var t=bt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function E_(e){var t=bt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function w_(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function F_(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+w_(this[e]);return this.s<0?this.t*this.DB:-1}function C_(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function D_(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=C_(this[r]^t);return e}function y_(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function S_(e,t){var r=ee.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function b_(e){return this.changeBit(e,qp)}function __(e){return this.changeBit(e,V2)}function B_(e){return this.changeBit(e,K2)}function I_(e,t){for(var r=0,n=0,s=Math.min(e.t,this.t);r<s;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}function $_(e){var t=bt();return this.addTo(e,t),t}function P_(e){var t=bt();return this.subTo(e,t),t}function R_(e){var t=bt();return this.multiplyTo(e,t),t}function T_(){var e=bt();return this.squareTo(e),e}function x_(e){var t=bt();return this.divRemTo(e,t,null),t}function O_(e){var t=bt();return this.divRemTo(e,null,t),t}function k_(e){var t=bt(),r=bt();return this.divRemTo(e,t,r),new Array(t,r)}function N_(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function L_(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function Mc(){}function G2(e){return e}function U_(e,t,r){e.multiplyTo(t,r)}function H_(e,t){e.squareTo(t)}Mc.prototype.convert=G2;Mc.prototype.revert=G2;Mc.prototype.mulTo=U_;Mc.prototype.sqrTo=H_;function j_(e){return this.exp(e,new Mc)}function M_(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var s;for(s=r.t-this.t;n<s;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(s=Math.min(e.t,t);n<s;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}function q_(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function Vo(e){this.r2=bt(),this.q3=bt(),ee.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function K_(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=bt();return e.copyTo(t),this.reduce(t),t}function V_(e){return e}function G_(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function z_(e,t){e.squareTo(t),this.reduce(t)}function Y_(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Vo.prototype.convert=K_;Vo.prototype.revert=V_;Vo.prototype.reduce=G_;Vo.prototype.mulTo=Y_;Vo.prototype.sqrTo=z_;function W_(e,t){var r=e.bitLength(),n,s=Yu(1),u;if(r<=0)return s;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?u=new Ma(t):t.isEven()?u=new Vo(t):u=new qa(t);var i=new Array,o=3,l=n-1,f=(1<<n)-1;if(i[1]=u.convert(this),n>1){var d=bt();for(u.sqrTo(i[1],d);o<=f;)i[o]=bt(),u.mulTo(d,i[o-2],i[o]),o+=2}var E=e.t-1,p,h=!0,w=bt(),v;for(r=Vf(e[E])-1;E>=0;){for(r>=l?p=e[E]>>r-l&f:(p=(e[E]&(1<<r+1)-1)<<l-r,E>0&&(p|=e[E-1]>>this.DB+r-l)),o=n;!(p&1);)p>>=1,--o;if((r-=o)<0&&(r+=this.DB,--E),h)i[p].copyTo(s),h=!1;else{for(;o>1;)u.sqrTo(s,w),u.sqrTo(w,s),o-=2;o>0?u.sqrTo(s,w):(v=s,s=w,w=v),u.mulTo(w,i[p],s)}for(;E>=0&&!(e[E]&1<<r);)u.sqrTo(s,w),v=s,s=w,w=v,--r<0&&(r=this.DB-1,--E)}return u.revert(s)}function J_(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var s=t.getLowestSetBit(),u=r.getLowestSetBit();if(u<0)return t;for(s<u&&(u=s),u>0&&(t.rShiftTo(u,t),r.rShiftTo(u,r));t.signum()>0;)(s=t.getLowestSetBit())>0&&t.rShiftTo(s,t),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return u>0&&r.lShiftTo(u,r),r}function X_(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}function Z_(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return ee.ZERO;for(var r=e.clone(),n=this.clone(),s=Yu(1),u=Yu(0),i=Yu(0),o=Yu(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!u.isEven())&&(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);r.compareTo(n)>=0?(r.subTo(n,r),t&&s.subTo(i,s),u.subTo(o,u)):(n.subTo(r,n),t&&i.subTo(s,i),o.subTo(u,o))}if(n.compareTo(ee.ONE)!=0)return ee.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var Ln=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Q_=(1<<26)/Ln[Ln.length-1];function e9(e){var t,r=this.abs();if(r.t==1&&r[0]<=Ln[Ln.length-1]){for(t=0;t<Ln.length;++t)if(r[0]==Ln[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Ln.length;){for(var n=Ln[t],s=t+1;s<Ln.length&&n<Q_;)n*=Ln[s++];for(n=r.modInt(n);t<s;)if(n%Ln[t++]==0)return!1}return r.millerRabin(e)}function t9(e){var t=this.subtract(ee.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Ln.length&&(e=Ln.length);for(var s=bt(),u=0;u<e;++u){s.fromInt(Ln[Math.floor(Math.random()*Ln.length)]);var i=s.modPow(n,this);if(i.compareTo(ee.ONE)!=0&&i.compareTo(t)!=0){for(var o=1;o++<r&&i.compareTo(t)!=0;)if(i=i.modPowInt(2,this),i.compareTo(ee.ONE)==0)return!1;if(i.compareTo(t)!=0)return!1}}return!0}ee.prototype.chunkSize=r_;ee.prototype.toRadix=i_;ee.prototype.fromRadix=s_;ee.prototype.fromNumber=u_;ee.prototype.bitwiseTo=f_;ee.prototype.changeBit=S_;ee.prototype.addTo=I_;ee.prototype.dMultiply=N_;ee.prototype.dAddOffset=L_;ee.prototype.multiplyLowerTo=M_;ee.prototype.multiplyUpperTo=q_;ee.prototype.modInt=X_;ee.prototype.millerRabin=t9;ee.prototype.clone=Zb;ee.prototype.intValue=Qb;ee.prototype.byteValue=e_;ee.prototype.shortValue=t_;ee.prototype.signum=n_;ee.prototype.toByteArray=a_;ee.prototype.equals=o_;ee.prototype.min=c_;ee.prototype.max=l_;ee.prototype.and=p_;ee.prototype.or=d_;ee.prototype.xor=g_;ee.prototype.andNot=m_;ee.prototype.not=v_;ee.prototype.shiftLeft=A_;ee.prototype.shiftRight=E_;ee.prototype.getLowestSetBit=F_;ee.prototype.bitCount=D_;ee.prototype.testBit=y_;ee.prototype.setBit=b_;ee.prototype.clearBit=__;ee.prototype.flipBit=B_;ee.prototype.add=$_;ee.prototype.subtract=P_;ee.prototype.multiply=R_;ee.prototype.divide=x_;ee.prototype.remainder=O_;ee.prototype.divideAndRemainder=k_;ee.prototype.modPow=W_;ee.prototype.modInverse=Z_;ee.prototype.pow=j_;ee.prototype.gcd=J_;ee.prototype.isProbablePrime=e9;ee.prototype.square=T_;function Kp(){this.i=0,this.j=0,this.S=new Array}function r9(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0}function n9(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}Kp.prototype.init=r9;Kp.prototype.next=n9;function i9(){return new Kp}var Lp=256;var Hf,vi,Jr;function s9(e){vi[Jr++]^=e&255,vi[Jr++]^=e>>8&255,vi[Jr++]^=e>>16&255,vi[Jr++]^=e>>24&255,Jr>=Lp&&(Jr-=Lp)}function Vp(){s9(new Date().getTime())}if(vi==null){if(vi=new Array,Jr=0,Ho!==void 0&&(Ho.crypto!==void 0||Ho.msCrypto!==void 0)){if(xp=Ho.crypto||Ho.msCrypto,xp.getRandomValues)for(Op=new Uint8Array(32),xp.getRandomValues(Op),Hi=0;Hi<32;++Hi)vi[Jr++]=Op[Hi];else if(Hc.appName=="Netscape"&&Hc.appVersion<"5")for(kp=Ho.crypto.random(32),Hi=0;Hi<kp.length;++Hi)vi[Jr++]=kp.charCodeAt(Hi)&255}for(;Jr<Lp;)Hi=Math.floor(65536*Math.random()),vi[Jr++]=Hi>>>8,vi[Jr++]=Hi&255;Jr=0,Vp()}var Hi,xp,Op,kp;function u9(){if(Hf==null){for(Vp(),Hf=i9(),Hf.init(vi),Jr=0;Jr<vi.length;++Jr)vi[Jr]=0;Jr=0}return Hf.next()}function a9(e){var t;for(t=0;t<e.length;++t)e[t]=u9()}function Go(){}Go.prototype.nextBytes=a9;function ei(e,t){return new ee(e,t)}function it(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function o9(e,t){if(this.isPublic=!0,this.isPrivate=!1,typeof e!="string")this.n=e,this.e=t;else if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=ei(e,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function c9(e){return e.modPowInt(this.e,this.n)}it.prototype.doPublic=c9;it.prototype.setPublic=o9;it.prototype.type="RSA";function l9(e,t,r){if(this.isPrivate=!0,typeof e!="string")this.n=e,this.e=t,this.d=r;else if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=ei(e,16),this.e=parseInt(t,16),this.d=ei(r,16);else throw"Invalid RSA private key"}function f9(e,t,r,n,s,u,i,o){if(this.isPrivate=!0,this.isPublic=!1,e==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(e.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(e!=null&&t!=null&&e.length>0&&t.length>0)this.n=ei(e,16),this.e=parseInt(t,16),this.d=ei(r,16),this.p=ei(n,16),this.q=ei(s,16),this.dmp1=ei(u,16),this.dmq1=ei(i,16),this.coeff=ei(o,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function h9(e,t){var r=new Go,n=e>>1;this.e=parseInt(t,16);for(var s=new ee(t,16),u=e/2-100,i=ee.ONE.shiftLeft(u);;){for(;this.p=new ee(e-n,1,r),!(this.p.subtract(ee.ONE).gcd(s).compareTo(ee.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new ee(n,1,r),!(this.q.subtract(ee.ONE).gcd(s).compareTo(ee.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var l=this.q.subtract(this.p).abs();if(!(l.bitLength()<u||l.compareTo(i)<=0)){var f=this.p.subtract(ee.ONE),d=this.q.subtract(ee.ONE),E=f.multiply(d);if(E.gcd(s).compareTo(ee.ONE)==0&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=s.modInverse(E),this.dmp1=this.d.mod(f),this.dmq1=this.d.mod(d),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0}function p9(e){if(this.p==null||this.q==null)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)}it.prototype.doPrivate=p9;it.prototype.setPrivate=l9;it.prototype.setPrivateEx=f9;it.prototype.generate=h9;function Mr(e,t){this.x=t,this.q=e}function d9(e){return e==this?!0:this.q.equals(e.q)&&this.x.equals(e.x)}function g9(){return this.x}function m9(){return new Mr(this.q,this.x.negate().mod(this.q))}function v9(e){return new Mr(this.q,this.x.add(e.toBigInteger()).mod(this.q))}function A9(e){return new Mr(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}function E9(e){return new Mr(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}function w9(){return new Mr(this.q,this.x.square().mod(this.q))}function F9(e){return new Mr(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}Mr.prototype.equals=d9;Mr.prototype.toBigInteger=g9;Mr.prototype.negate=m9;Mr.prototype.add=v9;Mr.prototype.subtract=A9;Mr.prototype.multiply=E9;Mr.prototype.square=w9;Mr.prototype.divide=F9;Mr.prototype.sqrt=function(){return new Mr(this.q,this.x.sqrt().mod(this.q))};function Ot(e,t,r,n){this.curve=e,this.x=t,this.y=r,n==null?this.z=ee.ONE:this.z=n,this.zinv=null}function C9(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function D9(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function y9(e){if(e==this)return!0;if(this.isInfinity())return e.isInfinity();if(e.isInfinity())return this.isInfinity();var t,r;return t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),t.equals(ee.ZERO)?(r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q),r.equals(ee.ZERO)):!1}function S9(){return this.x==null&&this.y==null?!0:this.z.equals(ee.ZERO)&&!this.y.toBigInteger().equals(ee.ZERO)}function b9(){return new Ot(this.curve,this.x,this.y.negate(),this.z)}function _9(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(ee.ZERO.equals(r))return ee.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new ee("3"),s=this.x.toBigInteger(),u=this.y.toBigInteger(),i=e.x.toBigInteger(),o=e.y.toBigInteger(),l=r.square(),f=l.multiply(r),d=s.multiply(l),E=t.square().multiply(this.z),p=E.subtract(d.shiftLeft(1)).multiply(e.z).subtract(f).multiply(r).mod(this.curve.q),h=d.multiply(n).multiply(t).subtract(u.multiply(f)).subtract(E.multiply(t)).multiply(e.z).add(t.multiply(f)).mod(this.curve.q),w=f.multiply(this.z).multiply(e.z).mod(this.curve.q);return new Ot(this.curve,this.curve.fromBigInteger(p),this.curve.fromBigInteger(h),w)}function B9(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=new ee("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),s=n.multiply(r).mod(this.curve.q),u=this.curve.a.toBigInteger(),i=t.square().multiply(e);ee.ZERO.equals(u)||(i=i.add(this.z.square().multiply(u))),i=i.mod(this.curve.q);var o=i.square().subtract(t.shiftLeft(3).multiply(s)).shiftLeft(1).multiply(n).mod(this.curve.q),l=i.multiply(e).multiply(t).subtract(s.shiftLeft(1)).shiftLeft(2).multiply(s).subtract(i.square().multiply(i)).mod(this.curve.q),f=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new Ot(this.curve,this.curve.fromBigInteger(o),this.curve.fromBigInteger(l),f)}function I9(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new ee("3")),n=this.negate(),s=this,u=this.curve.q.subtract(e),i=u.multiply(new ee("3")),o=new Ot(this.curve,this.x,this.y),l=o.negate(),f;for(f=r.bitLength()-2;f>0;--f){s=s.twice();var d=r.testBit(f),E=t.testBit(f);d!=E&&(s=s.add(d?this:n))}for(f=i.bitLength()-2;f>0;--f){o=o.twice();var p=i.testBit(f),h=u.testBit(f);p!=h&&(o=o.add(p?o:l))}return s}function $9(e,t,r){var n;e.bitLength()>r.bitLength()?n=e.bitLength()-1:n=r.bitLength()-1;for(var s=this.curve.getInfinity(),u=this.add(t);n>=0;)s=s.twice(),e.testBit(n)?r.testBit(n)?s=s.add(u):s=s.add(this):r.testBit(n)&&(s=s.add(t)),--n;return s}Ot.prototype.getX=C9;Ot.prototype.getY=D9;Ot.prototype.equals=y9;Ot.prototype.isInfinity=S9;Ot.prototype.negate=b9;Ot.prototype.add=_9;Ot.prototype.twice=B9;Ot.prototype.multiply=I9;Ot.prototype.multiplyTwo=$9;function fu(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new Ot(this,null,null)}function P9(){return this.q}function R9(){return this.a}function T9(){return this.b}function x9(e){return e==this?!0:this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}function O9(){return this.infinity}function k9(e){return new Mr(this.q,e)}function N9(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=e.substr(0,2),r=e.substr(2),n=this.fromBigInteger(new ee(f,16)),s=this.getA(),u=this.getB(),i=n.square().add(s).multiply(n).add(u),o=i.sqrt();return t=="03"&&(o=o.negate()),new Ot(this,n,o);case 4:case 6:case 7:var l=(e.length-2)/2,f=e.substr(2,l),d=e.substr(l+2,l);return new Ot(this,this.fromBigInteger(new ee(f,16)),this.fromBigInteger(new ee(d,16)));default:return null}}fu.prototype.getQ=P9;fu.prototype.getA=R9;fu.prototype.getB=T9;fu.prototype.equals=x9;fu.prototype.getInfinity=O9;fu.prototype.fromBigInteger=k9;fu.prototype.decodePointHex=N9;Mr.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)};Ot.prototype.getEncoded=function(e){var t=function(u,i){var o=u.toByteArrayUnsigned();if(i<o.length)o=o.slice(o.length-i);else for(;i>o.length;)o.unshift(0);return o},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),s=t(r,32);return e?n.isEven()?s.unshift(2):s.unshift(3):(s.unshift(4),s=s.concat(t(n,32))),s};Ot.decodeFrom=function(e,t){var r=t[0],n=t.length-1,s=t.slice(1,1+n/2),u=t.slice(1+n/2,1+n);s.unshift(0),u.unshift(0);var i=new ee(s),o=new ee(u);return new Ot(e,e.fromBigInteger(i),e.fromBigInteger(o))};Ot.decodeFromHex=function(e,t){var r=t.substr(0,2),n=t.length-2,s=t.substr(2,n/2),u=t.substr(2+n/2,n/2),i=new ee(s,16),o=new ee(u,16);return new Ot(e,e.fromBigInteger(i),e.fromBigInteger(o))};Ot.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y),n=r.divide(t),s=n.square().subtract(this.x).subtract(e.x),u=n.multiply(this.x.subtract(s)).subtract(this.y);return new Ot(this.curve,s,u)};Ot.prototype.twice2D=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=this.curve.fromBigInteger(ee.valueOf(2)),t=this.curve.fromBigInteger(ee.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),s=r.multiply(this.x.subtract(n)).subtract(this.y);return new Ot(this.curve,n,s)};Ot.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new ee("3")),n=this.negate(),s=this,u;for(u=r.bitLength()-2;u>0;--u){s=s.twice();var i=r.testBit(u),o=t.testBit(u);i!=o&&(s=s.add2D(i?this:n))}return s};Ot.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),s=this.curve.getQ(),u=t.multiply(t).mod(s),i=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(s);return u.equals(i)};Ot.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};Ot.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(ee.ONE)<0||t.compareTo(e.subtract(ee.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(ee.ONE)<0||r.compareTo(e.subtract(ee.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var z2=function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",t='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',r='(?:"'+t+'*")',n=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+r+")","g"),s=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),u={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:`
`,r:"\r",t:" "};function i(E,p,h){return p?u[p]:String.fromCharCode(parseInt(h,16))}var o=new String(""),l="\\",f={"{":Object,"[":Array},d=Object.hasOwnProperty;return function(E,p){var h=E.match(n),w,v=h[0],D=!1;v==="{"?w={}:v==="["?w=[]:(w=[],D=!0);for(var A,F=[w],S=1-D,B=h.length;S<B;++S){v=h[S];var _;switch(v.charCodeAt(0)){default:_=F[0],_[A||_.length]=+v,A=void 0;break;case 34:if(v=v.substring(1,v.length-1),v.indexOf(l)!==-1&&(v=v.replace(s,i)),_=F[0],!A)if(_ instanceof Array)A=_.length;else{A=v||o;break}_[A]=v,A=void 0;break;case 91:_=F[0],F.unshift(_[A||_.length]=[]),A=void 0;break;case 93:F.shift();break;case 102:_=F[0],_[A||_.length]=!1,A=void 0;break;case 110:_=F[0],_[A||_.length]=null,A=void 0;break;case 116:_=F[0],_[A||_.length]=!0,A=void 0;break;case 123:_=F[0],F.unshift(_[A||_.length]={}),A=void 0;break;case 125:F.shift();break}}if(D){if(F.length!==1)throw new Error;w=w[0]}else if(F.length)throw new Error;if(p){var K=function(G,b){var P=G[b];if(P&&typeof P=="object"){var L=null;for(var j in P)if(d.call(P,j)&&P!==G){var V=K(P,j);V!==void 0?P[j]=V:(L||(L=[]),L.push(j))}if(L)for(var W=L.length;--W>=0;)delete P[L[W]]}return p.call(G,b,P)};w=K({"":w},"")}return w}}();(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});g.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){return Kc(e)},this.getPEMStringFromHex=function(e,t){return yn(e,t)},this.newObject=function(e){var t=g,r=t.asn1,n=r.ASN1Object,s=r.DERBoolean,u=r.DERInteger,i=r.DERBitString,o=r.DEROctetString,l=r.DERNull,f=r.DERObjectIdentifier,d=r.DEREnumerated,E=r.DERUTF8String,p=r.DERNumericString,h=r.DERPrintableString,w=r.DERTeletexString,v=r.DERIA5String,D=r.DERUTCTime,A=r.DERGeneralizedTime,F=r.DERVisibleString,S=r.DERBMPString,B=r.DERSequence,_=r.DERSet,K=r.DERTaggedObject,G=r.ASN1Util.newObject;if(e instanceof r.ASN1Object)return e;var b=Object.keys(e);if(b.length!=1)throw new Error("key of param shall be only one.");var P=b[0];if(":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+P+":")==-1)throw new Error("undefined key: "+P);if(P=="bool")return new s(e[P]);if(P=="int")return new u(e[P]);if(P=="bitstr")return new i(e[P]);if(P=="octstr")return new o(e[P]);if(P=="null")return new l(e[P]);if(P=="oid")return new f(e[P]);if(P=="enum")return new d(e[P]);if(P=="utf8str")return new E(e[P]);if(P=="numstr")return new p(e[P]);if(P=="prnstr")return new h(e[P]);if(P=="telstr")return new w(e[P]);if(P=="ia5str")return new v(e[P]);if(P=="utctime")return new D(e[P]);if(P=="gentime")return new A(e[P]);if(P=="visstr")return new F(e[P]);if(P=="bmpstr")return new S(e[P]);if(P=="asn1")return new n(e[P]);if(P=="seq"){for(var L=e[P],j=[],V=0;V<L.length;V++){var W=G(L[V]);j.push(W)}return new B({array:j})}if(P=="set"){for(var L=e[P],j=[],V=0;V<L.length;V++){var W=G(L[V]);j.push(W)}return new _({array:j})}if(P=="tag"){var q=e[P];if(Object.prototype.toString.call(q)==="[object Array]"&&q.length==3){var z=G(q[2]);return new K({tag:q[0],explicit:q[1],obj:z})}else return new K(q)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.tohex()}};g.asn1.ASN1Util.oidHexToInt=function(e){for(var s="",t=parseInt(e.substr(0,2),16),r=Math.floor(t/40),n=t%40,s=r+"."+n,u="",i=2;i<e.length;i+=2){var o=parseInt(e.substr(i,2),16),l=("00000000"+o.toString(2)).slice(-8);if(u=u+l.substr(1,7),l.substr(0,1)=="0"){var f=new ee(u,2);s=s+"."+f.toString(10),u=""}}return s};g.asn1.ASN1Util.oidIntToHex=function(e){var t=function(o){var l=o.toString(16);return l.length==1&&(l="0"+l),l},r=function(o){var l="",f=new ee(o,10),d=f.toString(2),E=7-d.length%7;E==7&&(E=0);for(var p="",h=0;h<E;h++)p+="0";d=p+d;for(var h=0;h<d.length-1;h+=7){var w=d.substr(h,7);h!=d.length-7&&(w="1"+w),l+=t(parseInt(w,2))}return l};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",s=e.split("."),u=parseInt(s[0])*40+parseInt(s[1]);n+=t(u),s.splice(0,2);for(var i=0;i<s.length;i++)n+=r(s[i]);return n};g.asn1.ASN1Object=function(e){var t=!0,r=null,n="00",s="00",u="";this.params=null,this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+u.length+",v="+this.hV);var i=this.hV.length/2,o=i.toString(16);if(o.length%2==1&&(o="0"+o),i<128)return o;var l=o.length/2;if(l>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+i.toString(16));var f=128+l;return f.toString(16)+o},this.tohex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(i){this.params=i},e!=null&&e.tlv!=null&&(this.hTLV=e.tlv,this.isModified=!1)};g.asn1.DERAbstractString=function(e){g.asn1.DERAbstractString.superclass.constructor.call(this);var t=null,r=null;this.getString=function(){return this.s},this.setString=function(n){this.hTLV=null,this.isModified=!0,this.s=n,this.hV=zf(this.s).toLowerCase()},this.setStringHex=function(n){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"?this.setString(e):typeof e.str<"u"?this.setString(e.str):typeof e.hex<"u"&&this.setStringHex(e.hex))};de(g.asn1.DERAbstractString,g.asn1.ASN1Object);g.asn1.DERAbstractTime=function(e){g.asn1.DERAbstractTime.superclass.constructor.call(this);var t=null,r=null;this.localDateToUTC=function(n){var s=n.getTime()+n.getTimezoneOffset()*6e4,u=new Date(s);return u},this.formatDate=function(n,s,u){var i=this.zeroPadding,o=this.localDateToUTC(n),l=String(o.getFullYear());s=="utc"&&(l=l.substr(2,2));var f=i(String(o.getMonth()+1),2),d=i(String(o.getDate()),2),E=i(String(o.getHours()),2),p=i(String(o.getMinutes()),2),h=i(String(o.getSeconds()),2),w=l+f+d+E+p+h;if(u===!0){var v=o.getMilliseconds();if(v!=0){var D=i(String(v),3);D=D.replace(/[0]+$/,""),w=w+"."+D}}return w+"Z"},this.zeroPadding=function(n,s){return n.length>=s?n:new Array(s-n.length+1).join("0")+n},this.setByParam=function(n){this.hV=null,this.hTLV=null,this.params=n},this.getString=function(){},this.setString=function(n){this.hTLV=null,this.isModified=!0,this.params==null&&(this.params={}),this.params.str=n},this.setByDate=function(n){this.hTLV=null,this.isModified=!0,this.params==null&&(this.params={}),this.params.date=n},this.setByDateValue=function(n,s,u,i,o,l){var f=new Date(Date.UTC(n,s-1,u,i,o,l,0));this.setByDate(f)},this.getFreshValueHex=function(){return this.hV}};de(g.asn1.DERAbstractTime,g.asn1.ASN1Object);g.asn1.DERAbstractStructured=function(e){g.asn1.DERAbstractString.superclass.constructor.call(this);var t=null;this.setByASN1ObjectArray=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array=r},this.appendASN1Object=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array.push(r)},this.asn1Array=new Array,typeof e<"u"&&typeof e.array<"u"&&(this.asn1Array=e.array)};de(g.asn1.DERAbstractStructured,g.asn1.ASN1Object);g.asn1.DERBoolean=function(e){g.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",e==!1?this.hTLV="010100":this.hTLV="0101ff"};de(g.asn1.DERBoolean,g.asn1.ASN1Object);g.asn1.DERInteger=function(e){g.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Kc;this.setByBigInteger=function(r){this.isModified=!0,this.params={bigint:r}},this.setByInteger=function(r){this.isModified=!0,this.params=r},this.setValueHex=function(r){this.isModified=!0,this.params={hex:r}},this.getFreshValueHex=function(){var r=this.params,n=null;if(r==null)throw new Error("value not set");if(typeof r=="object"&&r.hex!=null)return this.hV=r.hex,this.hV;if(typeof r=="number")n=new ee(String(r),10);else if(r.int!=null)n=new ee(String(r.int),10);else if(r.bigint!=null)n=r.bigint;else throw new Error("wrong parameter");return this.hV=t(n),this.hV},e!=null&&(this.params=e)};de(g.asn1.DERInteger,g.asn1.ASN1Object);g.asn1.DERBitString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=g.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}g.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(r){this.hTLV=null,this.isModified=!0,this.hV=r},this.setUnusedBitsAndHexValue=function(r,n){if(r<0||7<r)throw"unused bits shall be from 0 to 7: u = "+r;var s="0"+r;this.hTLV=null,this.isModified=!0,this.hV=s+n},this.setByBinaryString=function(r){r=r.replace(/0+$/,"");var n=8-r.length%8;n==8&&(n=0),r+="0000000".substr(0,n);for(var s="",u=0;u<r.length-1;u+=8){var i=r.substr(u,8),o=parseInt(i,2).toString(16);o.length==1&&(o="0"+o),s+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+n+s},this.setByBooleanArray=function(r){for(var n="",s=0;s<r.length;s++)r[s]==!0?n+="1":n+="0";this.setByBinaryString(n)},this.newFalseArray=function(r){for(var n=new Array(r),s=0;s<r;s++)n[s]=!1;return n},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):typeof e.hex<"u"?this.setHexValueIncludingUnusedBits(e.hex):typeof e.bin<"u"?this.setByBinaryString(e.bin):typeof e.array<"u"&&this.setByBooleanArray(e.array))};de(g.asn1.DERBitString,g.asn1.ASN1Object);g.asn1.DEROctetString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=g.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}g.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"};de(g.asn1.DEROctetString,g.asn1.DERAbstractString);g.asn1.DERNull=function(){g.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};de(g.asn1.DERNull,g.asn1.ASN1Object);g.asn1.DERObjectIdentifier=function(e){g.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var r=eA(t);if(r==null)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(t){var r=g.asn1.x509.OID.name2oid(t);if(r!=="")this.setValueOidString(r);else throw new Error("DERObjectIdentifier oidName undefined: "+t)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){typeof t=="string"?this.setValueNameOrOid(t):t.oid!==void 0?this.setValueNameOrOid(t.oid):t.name!==void 0?this.setValueNameOrOid(t.name):t.hex!==void 0&&this.setValueHex(t.hex)},e!==void 0&&this.setByParam(e)};de(g.asn1.DERObjectIdentifier,g.asn1.ASN1Object);g.asn1.DEREnumerated=function(e){g.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Kc(t)},this.setByInteger=function(t){var r=new ee(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};de(g.asn1.DEREnumerated,g.asn1.ASN1Object);g.asn1.DERUTF8String=function(e){g.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"};de(g.asn1.DERUTF8String,g.asn1.DERAbstractString);g.asn1.DERNumericString=function(e){g.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"};de(g.asn1.DERNumericString,g.asn1.DERAbstractString);g.asn1.DERPrintableString=function(e){g.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"};de(g.asn1.DERPrintableString,g.asn1.DERAbstractString);g.asn1.DERTeletexString=function(e){g.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"};de(g.asn1.DERTeletexString,g.asn1.DERAbstractString);g.asn1.DERIA5String=function(e){g.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"};de(g.asn1.DERIA5String,g.asn1.DERAbstractString);g.asn1.DERVisibleString=function(e){g.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"};de(g.asn1.DERVisibleString,g.asn1.DERAbstractString);g.asn1.DERBMPString=function(e){g.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"};de(g.asn1.DERBMPString,g.asn1.DERAbstractString);g.asn1.DERUTCTime=function(e){g.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(this.params==null&&(t={date:new Date}),typeof t=="string")if(t.match(/^[0-9]{12}Z$/)||t.match(/^[0-9]{12}\.[0-9]+Z$/))this.hV=ti(t);else throw new Error("malformed string for UTCTime: "+t);else if(t.str!=null)this.hV=ti(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=ti(this.formatDate(r,"utc",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=ti(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=ti(this.formatDate(t,"utc")));if(this.hV==null)throw new Error("parameter not specified properly for UTCTime");return this.hV},e!=null&&this.setByParam(e)};de(g.asn1.DERUTCTime,g.asn1.DERAbstractTime);g.asn1.DERGeneralizedTime=function(e){g.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.params=e,this.getFreshValueHex=function(){var t=this.params;if(this.params==null&&(t={date:new Date}),typeof t=="string")if(t.match(/^[0-9]{14}Z$/)||t.match(/^[0-9]{14}\.[0-9]+Z$/))this.hV=ti(t);else throw new Error("malformed string for GeneralizedTime: "+t);else if(t.str!=null)this.hV=ti(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=ti(this.formatDate(r,"gen",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=ti(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=ti(this.formatDate(t,"gen")));if(this.hV==null)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},e!=null&&this.setByParam(e)};de(g.asn1.DERGeneralizedTime,g.asn1.DERAbstractTime);g.asn1.DERSequence=function(e){g.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var t="",r=0;r<this.asn1Array.length;r++){var n=this.asn1Array[r];t+=n.tohex()}return this.hV=t,this.hV}};de(g.asn1.DERSequence,g.asn1.DERAbstractStructured);g.asn1.DERSet=function(e){g.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,r=0;r<this.asn1Array.length;r++){var n=this.asn1Array[r];t.push(n.tohex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof e<"u"&&typeof e.sortflag<"u"&&e.sortflag==!1&&(this.sortFlag=!1)};de(g.asn1.DERSet,g.asn1.DERAbstractStructured);g.asn1.DERTaggedObject=function(e){g.asn1.DERTaggedObject.superclass.constructor.call(this);var t=g.asn1,r=De,n=r.getV,s=r.isASN1HEX,u=t.ASN1Util.newObject;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(i,o,l){this.params={tag:o,explicit:i,obj:l}},this.getFreshValueHex=function(){var i=this.params;if(i.explicit==null&&(i.explicit=!0),i.tage!=null&&(i.tag=i.tage,i.explicit=!0),i.tagi!=null&&(i.tag=i.tagi,i.explicit=!1),i.str!=null)this.hV=zf(i.str);else if(i.hex!=null)this.hV=i.hex;else if(i.obj!=null){var o;i.obj instanceof t.ASN1Object?o=i.obj.tohex():typeof i.obj=="object"&&(o=u(i.obj).tohex()),i.explicit?this.hV=o:this.hV=n(o,0)}else throw new Error("str, hex nor obj not specified");return i.tag==null&&(i.tag="a0"),this.hT=i.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(i){this.params=i},e!==void 0&&this.setByParam(e)};de(g.asn1.DERTaggedObject,g.asn1.ASN1Object);var De=new function(){};De.getLblen=function(e,t){if(e.substr(t+2,1)!="8")return 1;var r=parseInt(e.substr(t+3,1));return r==0?-1:0<r&&r<10?r+1:-2};De.getL=function(e,t){var r=De.getLblen(e,t);return r<1?"":e.substr(t+2,r*2)};De.getVblen=function(e,t){var r,n;return r=De.getL(e,t),r==""?-1:(r.substr(0,1)==="8"?n=new ee(r.substr(2),16):n=new ee(r,16),n.intValue())};De.getVidx=function(e,t){var r=De.getLblen(e,t);return r<0?r:t+(r+1)*2};De.getV=function(e,t){var r=De.getVidx(e,t),n=De.getVblen(e,t);return e.substr(r,n*2)};De.getTLV=function(e,t){return e.substr(t,2)+De.getL(e,t)+De.getV(e,t)};De.getTLVblen=function(e,t){return 2+De.getLblen(e,t)*2+De.getVblen(e,t)*2};De.getNextSiblingIdx=function(e,t){var r=De.getVidx(e,t),n=De.getVblen(e,t);return r+n*2};De.getChildIdx=function(e,t){var r=De,n=[],s,u,i;s=r.getVidx(e,t),u=r.getVblen(e,t)*2,e.substr(t,2)=="03"&&(s+=2,u-=2),i=0;for(var o=s;i<=u;){var l=r.getTLVblen(e,o);if(i+=l,i<=u&&n.push(o),o+=l,i>=u)break}return n};De.getNthChildIdx=function(e,t,r){var n=De.getChildIdx(e,t);return n[r]};De.getIdxbyList=function(e,t,r,n){var s=De,u,i;return r.length==0?n!==void 0&&e.substr(t,2)!==n?-1:t:(u=r.shift(),i=s.getChildIdx(e,t),u>=i.length?-1:s.getIdxbyList(e,i[u],r,n))};De.getIdxbyListEx=function(e,t,r,n){var s=De,u,i;if(r.length==0)return n!==void 0&&e.substr(t,2)!==n?-1:t;u=r.shift(),i=s.getChildIdx(e,t);for(var o=0,l=0;l<i.length;l++){var f=e.substr(i[l],2);if(typeof u=="number"&&!s.isContextTag(f)&&o==u||typeof u=="string"&&s.isContextTag(f,u))return s.getIdxbyListEx(e,i[l],r,n);s.isContextTag(f)||o++}return-1};De.getTLVbyList=function(e,t,r,n){var s=De,u=s.getIdxbyList(e,t,r,n);return u==-1||u>=e.length?null:s.getTLV(e,u)};De.getTLVbyListEx=function(e,t,r,n){var s=De,u=s.getIdxbyListEx(e,t,r,n);return u==-1?null:s.getTLV(e,u)};De.getVbyList=function(e,t,r,n,s){var u=De,i,o;return i=u.getIdxbyList(e,t,r,n),i==-1||i>=e.length?null:(o=u.getV(e,i),s===!0&&(o=o.substr(2)),o)};De.getVbyListEx=function(e,t,r,n,s){var u=De,i,o,l;return i=u.getIdxbyListEx(e,t,r,n),i==-1?null:(l=u.getV(e,i),e.substr(i,2)=="03"&&s!==!1&&(l=l.substr(2)),l)};De.getInt=function(e,t,r){r==null&&(r=-1);try{var n=e.substr(t,2);if(n!="02"&&n!="03")return r;var s=De.getV(e,t);return n=="02"?parseInt(s,16):rA(s)}catch{return r}};De.getOID=function(e,t,r){r==null&&(r=null);try{if(e.substr(t,2)!="06")return r;var n=De.getV(e,t);return Zf(n)}catch{return r}};De.getOIDName=function(e,t,r){r==null&&(r=null);try{var n=De.getOID(e,t,r);if(n==r)return r;var s=g.asn1.x509.OID.oid2name(n);return s==""?n:s}catch{return r}};De.getString=function(e,t,r){r==null&&(r=null);try{var n=De.getV(e,t);return ri(n)}catch{return r}};De.hextooidstr=function(e){var t=function(E,p){return E.length>=p?E:new Array(p-E.length+1).join("0")+E},r=[],n=e.substr(0,2),s=parseInt(n,16);r[0]=new String(Math.floor(s/40)),r[1]=new String(s%40);for(var u=e.substr(2),i=[],o=0;o<u.length/2;o++)i.push(parseInt(u.substr(o*2,2),16));for(var l=[],f="",o=0;o<i.length;o++)i[o]&128?f=f+t((i[o]&127).toString(2),7):(f=f+t((i[o]&127).toString(2),7),l.push(new String(parseInt(f,2))),f="");var d=r.join(".");return l.length>0&&(d=d+"."+l.join(".")),d};De.dump=function(e,t,r,n){var s=De,u=s.getV,i=s.dump,o=s.getChildIdx,l=e;e instanceof g.asn1.ASN1Object&&(l=e.tohex());var f=function(G,b){if(G.length<=b*2)return G;var P=G.substr(0,b)+"..(total "+G.length/2+"bytes).."+G.substr(G.length-b,b);return P};t===void 0&&(t={ommit_long_octet:32}),r===void 0&&(r=0),n===void 0&&(n="");var d=t.ommit_long_octet,_=l.substr(r,2);if(_=="01"){var E=u(l,r);return E=="00"?n+`BOOLEAN FALSE
`:n+`BOOLEAN TRUE
`}if(_=="02"){var E=u(l,r);return n+"INTEGER "+f(E,d)+`
`}if(_=="03"){var E=u(l,r);if(s.isASN1HEX(E.substr(2))){var p=n+`BITSTRING, encapsulates
`;return p=p+i(E.substr(2),t,0,n+" "),p}else return n+"BITSTRING "+f(E,d)+`
`}if(_=="04"){var E=u(l,r);if(s.isASN1HEX(E)){var p=n+`OCTETSTRING, encapsulates
`;return p=p+i(E,t,0,n+" "),p}else return n+"OCTETSTRING "+f(E,d)+`
`}if(_=="05")return n+`NULL
`;if(_=="06"){var h=u(l,r),w=g.asn1.ASN1Util.oidHexToInt(h),v=g.asn1.x509.OID.oid2name(w),D=w.replace(/\./g," ");return v!=""?n+"ObjectIdentifier "+v+" ("+D+`)
`:n+"ObjectIdentifier ("+D+`)
`}if(_=="0a")return n+"ENUMERATED "+parseInt(u(l,r))+`
`;if(_=="0c")return n+"UTF8String '"+qt(u(l,r))+`'
`;if(_=="13")return n+"PrintableString '"+qt(u(l,r))+`'
`;if(_=="14")return n+"TeletexString '"+qt(u(l,r))+`'
`;if(_=="16")return n+"IA5String '"+qt(u(l,r))+`'
`;if(_=="17")return n+"UTCTime "+qt(u(l,r))+`
`;if(_=="18")return n+"GeneralizedTime "+qt(u(l,r))+`
`;if(_=="1a")return n+"VisualString '"+qt(u(l,r))+`'
`;if(_=="1e")return n+"BMPString '"+Wp(u(l,r))+`'
`;if(_=="30"){if(l.substr(r,4)=="3000")return n+`SEQUENCE {}
`;var p=n+`SEQUENCE
`,A=o(l,r),F=t;if((A.length==2||A.length==3)&&l.substr(A[0],2)=="06"&&l.substr(A[A.length-1],2)=="04"){var v=s.oidname(u(l,A[0])),S=JSON.parse(JSON.stringify(t));S.x509ExtName=v,F=S}for(var B=0;B<A.length;B++)p=p+i(l,F,A[B],n+" ");return p}if(_=="31"){for(var p=n+`SET
`,A=o(l,r),B=0;B<A.length;B++)p=p+i(l,t,A[B],n+" ");return p}var _=parseInt(_,16);if(_&128){var K=_&31;if(_&32){for(var p=n+"["+K+`]
`,A=o(l,r),B=0;B<A.length;B++)p=p+i(l,t,A[B],n+" ");return p}else{var E=u(l,r);if(De.isASN1HEX(E)){var p=n+"["+K+`]
`;return p=p+i(E,t,0,n+" "),p}else(E.substr(0,8)=="68747470"||t.x509ExtName==="subjectAltName"&&K==2)&&(E=qt(E));var p=n+"["+K+"] "+E+`
`;return p}}return n+"UNKNOWN("+_+") "+u(l,r)+`
`};De.parse=function(e){var t=De,r=t.parse,n=t.isASN1HEX,s=t.getV,u=t.getTLV,i=t.getChildIdx,o=g.asn1,l=o.ASN1Util.oidHexToInt,f=o.x509.OID.oid2name,d=qt,E=Wp,p=q9,h={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},w=function(P){for(var L=[],j=i(P,0),V=0;V<j.length;V++){var W=j[V],q=u(P,W),z=r(q);L.push(z)}return L},v=e.substr(0,2),D={},A=s(e,0);if(v=="01")return e=="0101ff"?{bool:!0}:{bool:!1};if(v=="02")return{int:{hex:A}};if(v=="03")try{if(A.substr(0,2)!="00")throw"not encap";var F=A.substr(2);if(!n(F))throw"not encap";return{bitstr:{obj:r(F)}}}catch{var S=null;return A.length<=10&&(S=iA(A)),S==null?{bitstr:{hex:A}}:{bitstr:{bin:S}}}else if(v=="04")try{if(!n(A))throw"not encap";return{octstr:{obj:r(A)}}}catch{return{octstr:{hex:A}}}else{if(v=="05")return{null:""};if(v=="06"){var B=l(A),_=f(B);return _==""?{oid:B}:{oid:_}}else{if(v=="0a")return A.length>4?{enum:{hex:A}}:{enum:parseInt(A,16)};if(v=="30"||v=="31")return D[h[v]]=w(e),D;if(v=="14"){var K=p(A);return D[h[v]]={str:K},D}else if(v=="1e"){var K=E(A);return D[h[v]]={str:K},D}else if(":0c:12:13:16:17:18:1a:".indexOf(v)!=-1){var K=d(A);return D[h[v]]={str:K},D}else if(v.match(/^8[0-9]$/)){var K=d(A);return K==null|K==""?{tag:{tag:v,explicit:!1,hex:A}}:K.match(/[\x00-\x1F\x7F-\x9F]/)!=null||K.match(/[\u0000-\u001F\u0080\u009F]/)!=null?{tag:{tag:v,explicit:!1,hex:A}}:{tag:{tag:v,explicit:!1,str:K}}}else if(v.match(/^a[0-9]$/))try{if(!n(A))throw new Error("not encap");return{tag:{tag:v,explicit:!0,obj:r(A)}}}catch{return{tag:{tag:v,explicit:!0,hex:A}}}else{var G=new g.asn1.ASN1Object;G.hV=A;var b=G.getLengthHexFromValue();return{asn1:{tlv:v+b+A}}}}}};De.isContextTag=function(e,t){e=e.toLowerCase();var r,n;try{r=parseInt(e,16)}catch{return-1}if(t===void 0)return(r&192)==128;try{var s=t.match(/^\[[0-9]+\]$/);return s==null||(n=parseInt(t.substr(1,t.length-1),10),n>31)?!1:(r&192)==128&&(r&31)==n}catch{return!1}};De.isASN1HEX=function(e){var t=De;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),s=t.getL(e,0),u=e.length-n.length-s.length;return u==r*2};De.checkStrictDER=function(e,t,r,n,s){var u=De;if(r===void 0){if(typeof e!="string")throw new Error("not hex string");if(e=e.toLowerCase(),!g.lang.String.isHex(e))throw new Error("not hex string");r=e.length,n=e.length/2,n<128?s=1:s=Math.ceil(n.toString(16))+1}var i=u.getL(e,t);if(i.length>s*2)throw new Error("L of TLV too long: idx="+t);var o=u.getVblen(e,t);if(o>n)throw new Error("value of L too long than hex: idx="+t);var l=u.getTLV(e,t),f=l.length-2-u.getL(e,t).length;if(f!==o*2)throw new Error("V string length and L's value not the same:"+f+"/"+o*2);if(t===0&&e.length!=l.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+l.length);var d=e.substr(t,2);if(d==="02"){var E=u.getVidx(e,t);if(e.substr(E,2)=="00"&&e.charCodeAt(E+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(d,16)&32){for(var p=u.getVblen(e,t),h=0,w=u.getChildIdx(e,t),v=0;v<w.length;v++){var D=u.getTLV(e,w[v]);h+=D.length,u.checkStrictDER(e,w[v],r,n,s)}if(p*2!=h)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+h)}};De.oidname=function(e){var t=g.asn1;g.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return r===""&&(r=e),r};(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});(typeof g.asn1.x509>"u"||!g.asn1.x509)&&(g.asn1.x509={});g.asn1.x509.Certificate=function(e){g.asn1.x509.Certificate.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.DERBitString,s=r.DERSequence,u=r.x509,i=u.TBSCertificate,o=u.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=this.params,f=l.sigalg;l.sigalg.name!=null&&(f=l.sigalg.name);var d=l.tbsobj.tohex(),E=new g.crypto.Signature({alg:f});E.init(l.cakey),E.updateHex(d),l.sighex=E.sign()},this.getPEM=function(){return yn(this.tohex(),"CERTIFICATE")},this.tohex=function(){var l=this.params;if((l.tbsobj==null||l.tbsobj==null)&&(l.tbsobj=new i(l)),l.sighex==null&&l.cakey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or cakey parameter not defined");var f=[];f.push(l.tbsobj),f.push(new o({name:l.sigalg})),f.push(new n({hex:"00"+l.sighex}));var d=new s({array:f});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};de(g.asn1.x509.Certificate,g.asn1.ASN1Object);g.asn1.x509.TBSCertificate=function(e){g.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.x509,s=r.DERTaggedObject,u=r.DERInteger,i=r.DERSequence,o=n.AlgorithmIdentifier,l=n.Time,f=n.X500Name,d=n.Extensions,E=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(p){this.params=p},this.tohex=function(){var p=[],h=this.params;if(h.version!=null||h.version!=1){var w=2;h.version!=null&&(w=h.version-1);var v=new s({obj:new u({int:w})});p.push(v)}p.push(new u(h.serial)),p.push(new o({name:h.sigalg})),p.push(new f(h.issuer)),p.push(new i({array:[new l(h.notbefore),new l(h.notafter)]})),p.push(new f(h.subject)),p.push(new E(Et.getKey(h.sbjpubkey))),h.ext!==void 0&&h.ext.length>0&&p.push(new s({tag:"a3",obj:new d(h.ext)}));var D=new g.asn1.DERSequence({array:p});return D.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.TBSCertificate,g.asn1.ASN1Object);g.asn1.x509.Extensions=function(e){g.asn1.x509.Extensions.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.DERSequence,s=r.x509;this.aParam=[],this.setByParam=function(u){this.aParam=u},this.tohex=function(){for(var u=[],i=0;i<this.aParam.length;i++){var o=this.aParam[i],l=o.extname,f=null;if(o.extn!=null)f=new s.PrivateExtension(o);else if(l=="subjectKeyIdentifier")f=new s.SubjectKeyIdentifier(o);else if(l=="keyUsage")f=new s.KeyUsage(o);else if(l=="subjectAltName")f=new s.SubjectAltName(o);else if(l=="issuerAltName")f=new s.IssuerAltName(o);else if(l=="basicConstraints")f=new s.BasicConstraints(o);else if(l=="nameConstraints")f=new s.NameConstraints(o);else if(l=="cRLDistributionPoints")f=new s.CRLDistributionPoints(o);else if(l=="certificatePolicies")f=new s.CertificatePolicies(o);else if(l=="policyMappings")f=new s.PolicyMappings(o);else if(l=="policyConstraints")f=new s.PolicyConstraints(o);else if(l=="inhibitAnyPolicy")f=new s.InhibitAnyPolicy(o);else if(l=="authorityKeyIdentifier")f=new s.AuthorityKeyIdentifier(o);else if(l=="extKeyUsage")f=new s.ExtKeyUsage(o);else if(l=="authorityInfoAccess")f=new s.AuthorityInfoAccess(o);else if(l=="cRLNumber")f=new s.CRLNumber(o);else if(l=="cRLReason")f=new s.CRLReason(o);else if(l=="ocspNonce")f=new s.OCSPNonce(o);else if(l=="ocspNoCheck")f=new s.OCSPNoCheck(o);else if(l=="adobeTimeStamp")f=new s.AdobeTimeStamp(o);else if(l=="subjectDirectoryAttributes")f=new s.SubjectDirectoryAttributes(o);else throw new Error("extension not supported:"+JSON.stringify(o));f!=null&&u.push(f)}var d=new n({array:u});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.x509.Extensions,g.asn1.ASN1Object);g.asn1.x509.Extension=function(e){g.asn1.x509.Extension.superclass.constructor.call(this);var t=null,r=g,n=r.asn1,s=n.DERObjectIdentifier,u=n.DEROctetString,i=n.DERBitString,o=n.DERBoolean,l=n.DERSequence;this.tohex=function(){var f=new s({oid:this.oid}),d=new u({hex:this.getExtnValueHex()}),E=new Array;E.push(f),this.critical&&E.push(new o),E.push(d);var p=new l({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,e!==void 0&&e.critical!==void 0&&(this.critical=e.critical)};de(g.asn1.x509.Extension,g.asn1.ASN1Object);g.asn1.x509.KeyUsage=function(e){g.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var n=this.getBinValue();return this.asn1ExtnValue=new g.asn1.DERBitString({bin:n}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var n=this.params;if(typeof n!="object"||typeof n.names!="object"&&typeof n.bin!="string")throw new t("parameter not yet set");if(n.names!=null)return qf(n.names,r);if(n.bin!=null)return n.bin;throw new t("parameter not set properly")},this.oid="2.5.29.15",e!==void 0&&(this.params=e)};de(g.asn1.x509.KeyUsage,g.asn1.x509.Extension);g.asn1.x509.BasicConstraints=function(e){g.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=g.asn1,r=t.DERBoolean,n=t.DERInteger,s=t.DERSequence,u=!1,i=-1;this.getExtnValueHex=function(){var o=new Array;this.cA&&o.push(new r),this.pathLen>-1&&o.push(new n({int:this.pathLen}));var l=new s({array:o});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,e!==void 0&&(e.cA!==void 0&&(this.cA=e.cA),e.pathLen!==void 0&&(this.pathLen=e.pathLen))};de(g.asn1.x509.BasicConstraints,g.asn1.x509.Extension);g.asn1.x509.CRLDistributionPoints=function(e){g.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(s){for(var u=[],i=0;i<s.length;i++)if(s[i]instanceof g.asn1.ASN1Object)u.push(s[i]);else{var o=new n.DistributionPoint(s[i]);u.push(o)}this.asn1ExtnValue=new r.DERSequence({array:u})},this.setByOneURI=function(s){var u=new n.DistributionPoint({fulluri:s});this.setByDPArray([u])},this.oid="2.5.29.31",e!==void 0&&(e.array!==void 0?this.setByDPArray(e.array):e.uri!==void 0&&this.setByOneURI(e.uri))};de(g.asn1.x509.CRLDistributionPoints,g.asn1.x509.Extension);g.asn1.x509.DistributionPoint=function(e){g.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=null,r=g,n=r.asn1,s=n.x509.DistributionPointName;this.tohex=function(){var u=new n.DERSequence;if(this.asn1DP!=null){var i=new n.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});u.appendASN1Object(i)}return this.hTLV=u.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.dpobj!==void 0?this.asn1DP=e.dpobj:e.dpname!==void 0?this.asn1DP=new s(e.dpname):e.fulluri!==void 0&&(this.asn1DP=new s({full:[{uri:e.fulluri}]})))};de(g.asn1.x509.DistributionPoint,g.asn1.ASN1Object);g.asn1.x509.DistributionPointName=function(e){g.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=null,r=null,n=null,s=null,u=g,i=u.asn1,o=i.DERTaggedObject;if(this.tohex=function(){if(this.type!="full")throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new o({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0)if(i.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else if(e.full!==void 0)this.type="full",this.tag="a0",this.asn1V=new i.x509.GeneralNames(e.full);else throw new Error("This class supports GeneralNames only as argument")};de(g.asn1.x509.DistributionPointName,g.asn1.ASN1Object);g.asn1.x509.CertificatePolicies=function(e){g.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509,s=r.DERSequence,u=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var i=[],o=0;o<this.params.array.length;o++)i.push(new u(this.params.array[o]));var l=new s({array:i});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",e!==void 0&&(this.params=e)};de(g.asn1.x509.CertificatePolicies,g.asn1.x509.Extension);g.asn1.x509.PolicyInformation=function(e){g.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=g.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,s=t.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(this.params.policyoid===void 0&&this.params.array===void 0)throw new Error("parameter oid and array missing");var u=[new n(this.params.policyoid)];if(this.params.array!==void 0){for(var i=[],o=0;o<this.params.array.length;o++)i.push(new s(this.params.array[o]));i.length>0&&u.push(new r({array:i}))}var l=new r({array:u});return l.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};de(g.asn1.x509.PolicyInformation,g.asn1.ASN1Object);g.asn1.x509.PolicyQualifierInfo=function(e){g.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=g.asn1,r=t.DERSequence,n=t.DERIA5String,s=t.DERObjectIdentifier,u=t.x509.UserNotice;this.params=null,this.tohex=function(){if(this.params.cps!==void 0){var i=new r({array:[new s({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]});return i.tohex()}if(this.params.unotice!=null){var i=new r({array:[new s({oid:"1.3.6.1.5.5.7.2.2"}),new u(this.params.unotice)]});return i.tohex()}},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};de(g.asn1.x509.PolicyQualifierInfo,g.asn1.ASN1Object);g.asn1.x509.UserNotice=function(e){g.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=g.asn1.DERSequence,r=g.asn1.DERInteger,n=g.asn1.x509.DisplayText,s=g.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var u=[];this.params.noticeref!==void 0&&u.push(new s(this.params.noticeref)),this.params.exptext!==void 0&&u.push(new n(this.params.exptext));var i=new t({array:u});return i.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};de(g.asn1.x509.UserNotice,g.asn1.ASN1Object);g.asn1.x509.NoticeReference=function(e){g.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=g.asn1.DERSequence,r=g.asn1.DERInteger,n=g.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var s=[];if(this.params.org!==void 0&&s.push(new n(this.params.org)),this.params.noticenum!==void 0){for(var u=[],i=this.params.noticenum,o=0;o<i.length;o++)u.push(new r(i[o]));s.push(new t({array:u}))}if(s.length==0)throw new Error("parameter is empty");var l=new t({array:s});return l.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};de(g.asn1.x509.NoticeReference,g.asn1.ASN1Object);g.asn1.x509.DisplayText=function(e){g.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",e!==void 0&&(e.type==="ia5"?this.hT="16":e.type==="vis"?this.hT="1a":e.type==="bmp"&&(this.hT="1e"))};de(g.asn1.x509.DisplayText,g.asn1.DERAbstractString);g.asn1.x509.PolicyMappings=function(e){g.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){for(var u=this.params,i=[],o=0;o<u.array.length;o++){var l=u.array[o];i.push({seq:[{oid:l[0]},{oid:l[1]}]})}return this.asn1ExtnValue=s({seq:i}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",e!==void 0&&(this.params=e)};de(g.asn1.x509.PolicyMappings,g.asn1.x509.Extension);g.asn1.x509.PolicyConstraints=function(e){g.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){var u=this.params,i=[];return u.reqexp!=null&&i.push({tag:{tagi:"80",obj:{int:u.reqexp}}}),u.inhibit!=null&&i.push({tag:{tagi:"81",obj:{int:u.inhibit}}}),this.asn1ExtnValue=s({seq:i}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",e!==void 0&&(this.params=e)};de(g.asn1.x509.PolicyConstraints,g.asn1.x509.Extension);g.asn1.x509.InhibitAnyPolicy=function(e){g.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=s({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",e!==void 0&&(this.params=e)};de(g.asn1.x509.InhibitAnyPolicy,g.asn1.x509.Extension);g.asn1.x509.NameConstraints=function(e){g.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject,u=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var i=this.params,o=[];if(i.permit!=null&&i.permit.length!=null){for(var l=[],f=0;f<i.permit.length;f++)l.push(new u(i.permit[f]));o.push({tag:{tagi:"a0",obj:{seq:l}}})}if(i.exclude!=null&&i.exclude.length!=null){for(var d=[],f=0;f<i.exclude.length;f++)d.push(new u(i.exclude[f]));o.push({tag:{tagi:"a1",obj:{seq:d}}})}return this.asn1ExtnValue=s({seq:o}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",e!==void 0&&(this.params=e)};de(g.asn1.x509.NameConstraints,g.asn1.x509.Extension);g.asn1.x509.GeneralSubtree=function(e){g.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=g.asn1,r=t.x509,n=r.GeneralName,s=t.ASN1Util.newObject;this.params=null,this.setByParam=function(u){this.params=u},this.tohex=function(){var u=this.params,i=[new n(u)];u.min!=null&&i.push({tag:{tagi:"80",obj:{int:u.min}}}),u.max!=null&&i.push({tag:{tagi:"81",obj:{int:u.max}}});var o=s({seq:i});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.GeneralSubtree,g.asn1.ASN1Object);g.asn1.x509.ExtKeyUsage=function(e){g.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=g,r=t.asn1;this.setPurposeArray=function(n){this.asn1ExtnValue=new r.DERSequence;for(var s=0;s<n.length;s++){var u=new r.DERObjectIdentifier(n[s]);this.asn1ExtnValue.appendASN1Object(u)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",e!==void 0&&e.array!==void 0&&this.setPurposeArray(e.array)};de(g.asn1.x509.ExtKeyUsage,g.asn1.x509.Extension);g.asn1.x509.AuthorityKeyIdentifier=function(e){g.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.DERTaggedObject,s=r.x509.GeneralNames,u=t.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var i=new Array;this.asn1KID&&i.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&i.push(new n({explicit:!1,tag:"a1",obj:new s([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&i.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var o=new r.DERSequence({array:i});return this.asn1ExtnValue=o,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(i){if(i.str!==void 0||i.hex!==void 0)this.asn1KID=new g.asn1.DEROctetString(i);else if(typeof i=="object"&&g.crypto.Util.isKey(i)||typeof i=="string"&&i.indexOf("BEGIN ")!=-1){var o=i;typeof i=="string"&&(o=Et.getKey(i));var l=Et.getKeyID(o);this.asn1KID=new g.asn1.DEROctetString({hex:l})}},this.setCertIssuerByParam=function(i){i.str!==void 0||i.ldapstr!==void 0||i.hex!==void 0||i.certsubject!==void 0||i.certissuer!==void 0?this.asn1CertIssuer=new g.asn1.x509.X500Name(i):typeof i=="string"&&i.indexOf("BEGIN ")!=-1&&i.indexOf("CERTIFICATE")!=-1&&(this.asn1CertIssuer=new g.asn1.x509.X500Name({certissuer:i}))},this.setCertSNByParam=function(i){if(i.str!==void 0||i.bigint!==void 0||i.hex!==void 0)this.asn1CertSN=new g.asn1.DERInteger(i);else if(typeof i=="string"&&i.indexOf("BEGIN ")!=-1&&i.indexOf("CERTIFICATE")){var o=new Je;o.readCertPEM(i);var l=o.getSerialNumberHex();this.asn1CertSN=new g.asn1.DERInteger({hex:l})}},this.oid="2.5.29.35",e!==void 0&&(e.kid!==void 0&&this.setKIDByParam(e.kid),e.issuer!==void 0&&this.setCertIssuerByParam(e.issuer),e.sn!==void 0&&this.setCertSNByParam(e.sn),e.issuersn!==void 0&&typeof e.issuersn=="string"&&e.issuersn.indexOf("BEGIN ")!=-1&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))};de(g.asn1.x509.AuthorityKeyIdentifier,g.asn1.x509.Extension);g.asn1.x509.SubjectKeyIdentifier=function(e){g.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(s){if(s.str!==void 0||s.hex!==void 0)this.asn1KID=new n(s);else if(typeof s=="object"&&g.crypto.Util.isKey(s)||typeof s=="string"&&s.indexOf("BEGIN")!=-1){var u=s;typeof s=="string"&&(u=Et.getKey(s));var i=Et.getKeyID(u);this.asn1KID=new g.asn1.DEROctetString({hex:i})}},this.oid="2.5.29.14",e!==void 0&&e.kid!==void 0&&this.setKIDByParam(e.kid)};de(g.asn1.x509.SubjectKeyIdentifier,g.asn1.x509.Extension);g.asn1.x509.AuthorityInfoAccess=function(e){g.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(t){for(var r=new Array,n=g,s=n.asn1,u=s.DERSequence,i=s.DERObjectIdentifier,o=s.x509.GeneralName,l=0;l<t.length;l++){var f,d=t[l];if(d.ocsp!==void 0)f=new u({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:d.ocsp})]});else if(d.caissuer!==void 0)f=new u({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:d.caissuer})]});else throw new Error("unknown AccessMethod parameter: "+JSON.stringify(d));r.push(f)}this.asn1ExtnValue=new u({array:r})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",e!==void 0&&e.array!==void 0&&this.setAccessDescriptionArray(e.array)};de(g.asn1.x509.AuthorityInfoAccess,g.asn1.x509.Extension);g.asn1.x509.SubjectAltName=function(e){g.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new g.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",e!==void 0&&e.array!==void 0&&this.setNameArray(e.array)};de(g.asn1.x509.SubjectAltName,g.asn1.x509.Extension);g.asn1.x509.IssuerAltName=function(e){g.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new g.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",e!==void 0&&e.array!==void 0&&this.setNameArray(e.array)};de(g.asn1.x509.IssuerAltName,g.asn1.x509.Extension);g.asn1.x509.SubjectDirectoryAttributes=function(e){g.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=g.asn1,r=t.DERSequence,n=t.ASN1Util.newObject,s=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var u=[],i=0;i<this.params.array.length;i++){var o=this.params.array[i];if(o.attr!=null&&o.array!=null){var l={seq:[{oid:o.attr},{set:o.array}]};u.push(n(l));continue}var f={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if(o.attr=="dateOfBirth")f.seq[0].oid=s(o.attr),f.seq[1].set[0]={gentime:o.str};else if(o.attr=="placeOfBirth")f.seq[0].oid=s(o.attr),f.seq[1].set[0]={utf8str:o.str};else if(o.attr=="gender")f.seq[0].oid=s(o.attr),f.seq[1].set[0]={prnstr:o.str};else if(o.attr=="countryOfCitizenship")f.seq[0].oid=s(o.attr),f.seq[1].set[0]={prnstr:o.str};else if(o.attr=="countryOfResidence")f.seq[0].oid=s(o.attr),f.seq[1].set[0]={prnstr:o.str};else throw new Error("unsupported attribute: "+o.attr);u.push(new n(f))}var d=new r({array:u});return this.asn1ExtnValue=d,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",e!==void 0&&(this.params=e)};de(g.asn1.x509.SubjectDirectoryAttributes,g.asn1.x509.Extension);g.asn1.x509.PrivateExtension=function(e){g.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=g,r=t.lang.String.isHex,n=t.asn1,s=n.x509.OID.name2oid,u=n.ASN1Util.newObject;this.params=null,this.setByParam=function(i){this.oid=s(i.extname),this.params=i},this.getExtnValueHex=function(){if(this.params.extname==null||this.params.extn==null)throw new Error("extname or extnhex not specified");var i=this.params.extn;if(typeof i=="string"&&r(i))return i;if(typeof i=="object")try{return u(i).tohex()}catch{}throw new Error("unsupported extn value")},e!=null&&this.setByParam(e)};de(g.asn1.x509.PrivateExtension,g.asn1.x509.Extension);g.asn1.x509.CRL=function(e){g.asn1.x509.CRL.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.DERSequence,s=r.DERBitString,u=r.x509,i=u.AlgorithmIdentifier,o=u.TBSCertList;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=new o(this.params).tohex(),f=new g.crypto.Signature({alg:this.params.sigalg});f.init(this.params.cakey),f.updateHex(l);var d=f.sign();this.params.sighex=d},this.getPEM=function(){return yn(this.tohex(),"X509 CRL")},this.tohex=function(){var l=this.params;if(l.tbsobj==null&&(l.tbsobj=new o(l)),l.sighex==null&&l.cakey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or cakey parameter not defined");var f=[];f.push(l.tbsobj),f.push(new i({name:l.sigalg})),f.push(new s({hex:"00"+l.sighex}));var d=new n({array:f});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};de(g.asn1.x509.CRL,g.asn1.ASN1Object);g.asn1.x509.TBSCertList=function(e){g.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.DERInteger,s=r.DERSequence,u=r.DERTaggedObject,i=r.DERObjectIdentifier,o=r.x509,l=o.AlgorithmIdentifier,f=o.Time,d=o.Extensions,E=o.X500Name;this.params=null,this.setByParam=function(p){this.params=p},this.getRevCertSequence=function(){for(var p=[],h=this.params.revcert,w=0;w<h.length;w++){var v=[new n(h[w].sn),new f(h[w].date)];h[w].ext!=null&&v.push(new d(h[w].ext)),p.push(new s({array:v}))}return new s({array:p})},this.tohex=function(){var p=[],h=this.params;if(h.version!=null){var w=h.version-1,v=new n({int:w});p.push(v)}if(p.push(new l({name:h.sigalg})),p.push(new E(h.issuer)),p.push(new f(h.thisupdate)),h.nextupdate!=null&&p.push(new f(h.nextupdate)),h.revcert!=null&&p.push(this.getRevCertSequence()),h.ext!=null){var D=new d(h.ext);p.push(new u({tag:"a0",explicit:!0,obj:D}))}var A=new s({array:p});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.TBSCertList,g.asn1.ASN1Object);g.asn1.x509.CRLEntry=function(e){g.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=null,r=null,n=g,s=n.asn1;this.setCertSerial=function(u){this.sn=new s.DERInteger(u)},this.setRevocationDate=function(u){this.time=new s.x509.Time(u)},this.tohex=function(){var u=new s.DERSequence({array:[this.sn,this.time]});return this.TLV=u.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.time!==void 0&&this.setRevocationDate(e.time),e.sn!==void 0&&this.setCertSerial(e.sn))};de(g.asn1.x509.CRLEntry,g.asn1.ASN1Object);g.asn1.x509.CRLNumber=function(e){g.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new g.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",e!=null&&(this.params=e)};de(g.asn1.x509.CRLNumber,g.asn1.x509.Extension);g.asn1.x509.CRLReason=function(e){g.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new g.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",e!=null&&(this.params=e)};de(g.asn1.x509.CRLReason,g.asn1.x509.Extension);g.asn1.x509.OCSPNonce=function(e){g.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new g.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",e!=null&&(this.params=e)};de(g.asn1.x509.OCSPNonce,g.asn1.x509.Extension);g.asn1.x509.OCSPNoCheck=function(e){g.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new g.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",e!=null&&(this.params=e)};de(g.asn1.x509.OCSPNoCheck,g.asn1.x509.Extension);g.asn1.x509.AdobeTimeStamp=function(e){g.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=g,r=t.asn1,n=r.DERInteger,s=r.DERBoolean,u=r.DERSequence,i=r.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var o=this.params,l=[new n(1)];return l.push(new i({uri:o.uri})),o.reqauth!=null&&l.push(new s(o.reqauth)),this.asn1ExtnValue=new u({array:l}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",e!==void 0&&this.setByParam(e)};de(g.asn1.x509.AdobeTimeStamp,g.asn1.x509.Extension);g.asn1.x509.X500Name=function(e){g.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=g,r=t.asn1,n=r.x509,s=n.RDN,u=pr;this.setByString=function(i,o){o!==void 0&&(this.sRule=o);var l=i.split("/");l.shift();for(var f=[],d=0;d<l.length;d++)if(l[d].match(/^[^=]+=.+$/))f.push(l[d]);else{var E=f.length-1;f[E]=f[E]+"/"+l[d]}for(var d=0;d<f.length;d++)this.asn1Array.push(new s({str:f[d],rule:this.sRule}))},this.setByLdapString=function(i,o){o!==void 0&&(this.sRule=o);var l=n.X500Name.ldapToCompat(i);this.setByString(l,o)},this.setByObject=function(i,o){o!==void 0&&(this.sRule=o);for(var l in i)if(i.hasOwnProperty(l)){var f=new s({str:l+"="+i[l],rule:this.sRule});this.asn1Array?this.asn1Array.push(f):this.asn1Array=[f]}},this.setByParam=function(i){if(i.rule!==void 0&&(this.sRule=i.rule),i.array!==void 0)this.paramArray=i.array;else if(i.str!==void 0)this.setByString(i.str);else if(i.ldapstr!==void 0)this.setByLdapString(i.ldapstr);else if(i.hex!==void 0)this.hTLV=i.hex;else if(i.certissuer!==void 0){var o=new Je;o.readCertPEM(i.certissuer),this.hTLV=o.getIssuerHex()}else if(i.certsubject!==void 0){var o=new Je;o.readCertPEM(i.certsubject),this.hTLV=o.getSubjectHex()}else typeof i=="object"&&i.certsubject===void 0&&i.certissuer===void 0&&this.setByObject(i)},this.tohex=function(){if(typeof this.hTLV=="string")return this.hTLV;if(this.asn1Array.length==0&&this.paramArray.length>0)for(var i=0;i<this.paramArray.length;i++){var o={array:this.paramArray[i]};this.sRule!="utf8"&&(o.rule=this.sRule);var l=new s(o);this.asn1Array.push(l)}var f=new r.DERSequence({array:this.asn1Array});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.X500Name,g.asn1.ASN1Object);g.asn1.x509.X500Name.compatToLDAP=function(e){if(e.substr(0,1)!=="/")throw"malformed input";var t="";e=e.substr(1);var r=e.split("/");return r.reverse(),r=r.map(function(n){return n.replace(/,/,"\\,")}),r.join(",")};g.asn1.x509.X500Name.onelineToLDAP=function(e){return g.asn1.x509.X500Name.compatToLDAP(e)};g.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),r=!1,n=[],s=0;t.length>0;s++){var u=t.shift();if(r===!0){var i=n.pop(),o=(i+","+u).replace(/\\,/g,",");n.push(o),r=!1}else n.push(u);u.substr(-1,1)==="\\"&&(r=!0)}return n=n.map(function(l){return l.replace("/","\\/")}),n.reverse(),"/"+n.join("/")};g.asn1.x509.X500Name.ldapToOneline=function(e){return g.asn1.x509.X500Name.ldapToCompat(e)};g.asn1.x509.RDN=function(e){g.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=g.asn1.x509.AttributeTypeAndValue;this.setByParam=function(r){r.rule!==void 0&&(this.sRule=r.rule),r.str!==void 0&&this.addByMultiValuedString(r.str),r.array!==void 0&&(this.paramArray=r.array)},this.addByString=function(r){this.asn1Array.push(new g.asn1.x509.AttributeTypeAndValue({str:r,rule:this.sRule}))},this.addByMultiValuedString=function(r){for(var n=g.asn1.x509.RDN.parseString(r),s=0;s<n.length;s++)this.addByString(n[s])},this.tohex=function(){if(this.asn1Array.length==0&&this.paramArray.length>0)for(var r=0;r<this.paramArray.length;r++){var n=this.paramArray[r];n.rule!==void 0&&this.sRule!="utf8"&&(n.rule=this.sRule);var s=new t(n);this.asn1Array.push(s)}var u=new g.asn1.DERSet({array:this.asn1Array});return this.TLV=u.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.RDN,g.asn1.ASN1Object);g.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),r=!1,n=[],s=0;t.length>0;s++){var u=t.shift();if(r===!0){var i=n.pop(),o=(i+"+"+u).replace(/\\\+/g,"+");n.push(o),r=!1}else n.push(u);u.substr(-1,1)==="\\"&&(r=!0)}for(var l=!1,f=[],s=0;n.length>0;s++){var u=n.shift();if(l===!0){var d=f.pop();if(u.match(/"$/)){var o=(d+"+"+u).replace(/^([^=]+)="(.*)"$/,"$1=$2");f.push(o),l=!1}else f.push(d+"+"+u)}else f.push(u);u.match(/^[^=]+="/)&&(l=!0)}return f};g.asn1.x509.AttributeTypeAndValue=function(e){g.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=g,r=t.asn1,n=r.DERSequence,s=r.DERUTF8String,u=r.DERPrintableString,i=r.DERTeletexString,o=r.DERIA5String,l=r.DERVisibleString,f=r.DERBMPString,d=t.lang.String.isMail,E=t.lang.String.isPrintable;this.setByParam=function(p){if(p.rule!==void 0&&(this.sRule=p.rule),p.ds!==void 0&&(this.dsType=p.ds),p.value===void 0&&p.str!==void 0){var h=p.str,w=h.match(/^([^=]+)=(.+)$/);if(w)this.sType=w[1],this.sValue=w[2];else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}else this.sType=p.type,this.sValue=p.value},this.setByString=function(p,h){h!==void 0&&(this.sRule=h);var w=p.match(/^([^=]+)=(.+)$/);if(w)this.setByAttrTypeAndValueStr(w[1],w[2]);else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)},this._getDsType=function(){var p=this.sType,h=this.sValue,w=this.sRule;return w==="prn"?p=="CN"&&d(h)?"ia5":E(h)?"prn":"utf8":w==="utf8"?p=="CN"&&d(h)?"ia5":p=="C"?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(p,h,w){w!==void 0&&(this.sRule=w),this.sType=p,this.sValue=h},this.getValueObj=function(p,h){if(p=="utf8")return new s({str:h});if(p=="prn")return new u({str:h});if(p=="tel")return new i({str:h});if(p=="ia5")return new o({str:h});if(p=="vis")return new l({str:h});if(p=="bmp")return new f({str:h});throw new Error("unsupported directory string type: type="+p+" value="+h)},this.tohex=function(){this.dsType==null&&(this.dsType=this._getDsType());var p=g.asn1.x509.OID.atype2obj(this.sType),h=this.getValueObj(this.dsType,this.sValue),w=new n({array:[p,h]});return this.TLV=w.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.AttributeTypeAndValue,g.asn1.ASN1Object);g.asn1.x509.SubjectPublicKeyInfo=function(e){g.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=null,r=null,n=g,s=n.asn1,u=s.DERInteger,i=s.DERBitString,o=s.DERObjectIdentifier,l=s.DERSequence,f=s.ASN1Util.newObject,d=s.x509,E=d.AlgorithmIdentifier,p=n.crypto,h=p.ECDSA,w=p.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null)throw"algId and/or subjPubKey not set";var v=new l({array:[this.asn1AlgId,this.asn1SubjPKey]});return v},this.tohex=function(){var v=this.getASN1Object();return this.hTLV=v.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(v){try{if(v instanceof it){var D=f({seq:[{int:{bigint:v.n}},{int:{int:v.e}}]}),A=D.tohex();this.asn1AlgId=new E({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+A})}}catch{}try{if(v instanceof g.crypto.ECDSA){var F=new o({name:v.curveName});this.asn1AlgId=new E({name:"ecPublicKey",asn1params:F}),this.asn1SubjPKey=new i({hex:"00"+v.pubKeyHex})}}catch{}try{if(v instanceof g.crypto.DSA){var F=new f({seq:[{int:{bigint:v.p}},{int:{bigint:v.q}},{int:{bigint:v.g}}]});this.asn1AlgId=new E({name:"dsa",asn1params:F});var S=new u({bigint:v.y});this.asn1SubjPKey=new i({hex:"00"+S.tohex()})}}catch{}},e!==void 0&&this.setPubKey(e)};de(g.asn1.x509.SubjectPublicKeyInfo,g.asn1.ASN1Object);g.asn1.x509.Time=function(e){g.asn1.x509.Time.superclass.constructor.call(this);var t=null,r=null,n=g,s=n.asn1,u=s.DERUTCTime,i=s.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(o){this.timeParams=o},this.setByParam=function(o){this.params=o},this.getType=function(o){return o.match(/^[0-9]{12}Z$/)?"utc":o.match(/^[0-9]{14}Z$/)?"gen":o.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":o.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var o=this.params,l=null;if(typeof o=="string"&&(o={str:o}),o!=null&&o.str&&(o.type==null||o.type==null)&&(o.type=this.getType(o.str)),o!=null&&o.str?(o.type=="utc"&&(l=new u(o.str)),o.type=="gen"&&(l=new i(o.str))):this.type=="gen"?l=new i:l=new u,l==null)throw new Error("wrong setting for Time");return this.TLV=l.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};g.asn1.x509.Time_bak=function(e){g.asn1.x509.Time_bak.superclass.constructor.call(this);var t=null,r=null,n=g,s=n.asn1,u=s.DERUTCTime,i=s.DERGeneralizedTime;this.setTimeParams=function(o){this.timeParams=o},this.tohex=function(){var o=null;return this.timeParams!=null?this.type=="utc"?o=new u(this.timeParams):o=new i(this.timeParams):this.type=="utc"?o=new u:o=new i,this.TLV=o.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",e!==void 0&&(e.type!==void 0?this.type=e.type:e.str!==void 0&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)};de(g.asn1.x509.Time,g.asn1.ASN1Object);g.asn1.x509.AlgorithmIdentifier=function(e){g.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=g,r=t.asn1,n=r.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(this.nameAlg===null&&this.asn1Alg===null)throw new Error("algorithm not specified");if(this.nameAlg!==null){var u=null;for(var i in n)i===this.nameAlg&&(u=n[i]);if(u!==null)return this.hTLV=u,this.hTLV}this.nameAlg!==null&&this.asn1Alg===null&&(this.asn1Alg=r.x509.OID.name2obj(this.nameAlg));var o=[this.asn1Alg];this.asn1Params!==null&&o.push(this.asn1Params);var l=new r.DERSequence({array:o});return this.hTLV=l.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(e.name!==void 0&&(this.nameAlg=e.name),e.asn1params!==void 0&&(this.asn1Params=e.asn1params),e.paramempty!==void 0&&(this.paramEmpty=e.paramempty)),this.asn1Params===null&&this.paramEmpty===!1&&this.nameAlg!==null){this.nameAlg.name!==void 0&&(this.nameAlg=this.nameAlg.name);var s=this.nameAlg.toLowerCase();s.substr(-7,7)!=="withdsa"&&s.substr(-9,9)!=="withecdsa"&&(this.asn1Params=new r.DERNull)}};de(g.asn1.x509.AlgorithmIdentifier,g.asn1.ASN1Object);g.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};g.asn1.x509.GeneralName=function(e){g.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87",otherName:"a0"},r=g,n=r.asn1,s=n.x509,u=s.X500Name,i=s.OtherName,o=n.DERIA5String,l=n.DERPrintableString,f=n.DEROctetString,d=n.DERTaggedObject,E=n.ASN1Object,p=Error;this.params=null,this.setByParam=function(h){this.params=h},this.tohex=function(){var h=this.params,w,D,v,D=!1;if(h.other!==void 0)w="a0",v=new i(h.other);else if(h.rfc822!==void 0)w="81",v=new o({str:h.rfc822});else if(h.dns!==void 0)w="82",v=new o({str:h.dns});else if(h.dn!==void 0)w="a4",D=!0,typeof h.dn=="string"?v=new u({str:h.dn}):h.dn instanceof g.asn1.x509.X500Name?v=h.dn:v=new u(h.dn);else if(h.ldapdn!==void 0)w="a4",D=!0,v=new u({ldapstr:h.ldapdn});else if(h.certissuer!==void 0||h.certsubj!==void 0){w="a4",D=!0;var A,F,S=null;if(h.certsubj!==void 0?(A=!1,F=h.certsubj):(A=!0,F=h.certissuer),F.match(/^[0-9A-Fa-f]+$/)&&S==F,F.indexOf("-----BEGIN ")!=-1&&(S=pr(F)),S==null)throw new Error("certsubj/certissuer not cert");var B=new Je;B.hex=S;var _;A?_=B.getIssuerHex():_=B.getSubjectHex(),v=new E,v.hTLV=_}else if(h.uri!==void 0)w="86",v=new o({str:h.uri});else if(h.ip!==void 0){w="87";var K,G=h.ip;try{if(G.match(/^[0-9a-f]+$/)){var b=G.length;if(b==8||b==16||b==32||b==64)K=G;else throw"err"}else K=Yp(G)}catch(L){throw new p("malformed IP address: "+h.ip+":"+L.message)}v=new f({hex:K})}else throw new p("improper params");var P=new d({tag:w,explicit:D,obj:v});return P.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.GeneralName,g.asn1.ASN1Object);g.asn1.x509.GeneralNames=function(e){g.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=null,r=g,n=r.asn1;this.setByParamArray=function(s){for(var u=0;u<s.length;u++){var i=new n.x509.GeneralName(s[u]);this.asn1Array.push(i)}},this.tohex=function(){var s=new n.DERSequence({array:this.asn1Array});return s.tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,typeof e<"u"&&this.setByParamArray(e)};de(g.asn1.x509.GeneralNames,g.asn1.ASN1Object);g.asn1.x509.OtherName=function(e){g.asn1.x509.OtherName.superclass.constructor.call(this);var t=null,r=null,n=g,s=n.asn1,u=s.DERObjectIdentifier,i=s.DERSequence,o=s.ASN1Util.newObject;this.params=null,this.setByParam=function(l){this.params=l},this.tohex=function(){var l=this.params;if(l.oid==null||l.value==null)throw new Error("oid or value not specified");var f=new u({oid:l.oid}),d=o({tag:{tag:"a0",explicit:!0,obj:l.value}}),E=new i({array:[f,d]});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.x509.OtherName,g.asn1.ASN1Object);g.asn1.x509.OID=new function(){var e=g.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]<"u")return this.objCache[t];if(typeof this.name2oidList[t]>"u")throw"Name of ObjectIdentifier not defined: "+t;var r=this.name2oidList[t],n=new e({oid:r});return this.objCache[t]=n,n},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var r;if(t.match(/^\d+\.\d+\.[0-9.]+$/))r=t;else if(this.atype2oidList[t]!==void 0)r=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)r=this.name2oidList[t];else throw new Error("AttributeType name undefined: "+t);var n=new e({oid:r});return this.objCache[t]=n,n},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var r in t)this.name2oidList[r]=t[r]},this.checkOIDs=function(t){try{var r=Object.keys(t);return r.length==0?!1:(r.map(function(n,s,u){var i=this[n];if(!i.match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch{return!1}}};g.asn1.x509.OID.oid2name=function(e){var t=g.asn1.x509.OID.name2oidList;for(var r in t)if(t[r]==e)return r;return""};g.asn1.x509.OID.oid2atype=function(e){var t=g.asn1.x509.OID.atype2oidList;for(var r in t)if(t[r]==e)return r;return e};g.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=g.asn1.x509.OID.name2oidList;return t[e]===void 0?"":t[e]};g.asn1.x509.X509Util={};g.asn1.x509.X509Util.newCertPEM=function(e){var t=g.asn1.x509,r=t.TBSCertificate,n=t.Certificate,s=new n(e);return s.getPEM()};(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});(typeof g.asn1.cms>"u"||!g.asn1.cms)&&(g.asn1.cms={});g.asn1.cms.Attribute=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.DERSet,i=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(o){this.params=o},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var o=new i({oid:this.typeOid}),l=new u({array:this.getValueArray()}),f=new s({array:[o,l]});return f.tohex()},this.getEncodedHex=function(){return this.tohex()}};de(g.asn1.cms.Attribute,g.asn1.ASN1Object);g.asn1.cms.ContentType=function(e){var t=g,r=t.asn1;r.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){var n=new r.DERObjectIdentifier(this.params.type);return[n]},e!=null&&this.setByParam(e)};de(g.asn1.cms.ContentType,g.asn1.cms.Attribute);g.asn1.cms.MessageDigest=function(e){var t=g,r=t.asn1,n=r.DEROctetString,s=r.cms;s.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){var u=new n(this.params);return[u]},e!=null&&this.setByParam(e)};de(g.asn1.cms.MessageDigest,g.asn1.cms.Attribute);g.asn1.cms.SigningTime=function(e){var t=g,r=t.asn1;r.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){var n=new r.x509.Time(this.params);return[n]},e!=null&&this.setByParam(e)};de(g.asn1.cms.SigningTime,g.asn1.cms.Attribute);g.asn1.cms.SigningCertificate=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.cms,i=u.ESSCertID,o=r.crypto;u.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(this.params==null||this.params==null||this.params.array==null)throw new t("parameter 'array' not specified");for(var l=this.params.array,f=[],d=0;d<l.length;d++){var E=l[d];e.hasis==!1&&typeof E=="string"&&(E.indexOf("-----BEGIN")!=-1||De.isASN1HEX(E))&&(E={cert:E}),E.hasis!=!1&&e.hasis==!1&&(E.hasis=!1),f.push(new i(E))}var p=new s({array:f}),h=new s({array:[p]});return[h]},e!=null&&this.setByParam(e)};de(g.asn1.cms.SigningCertificate,g.asn1.cms.Attribute);g.asn1.cms.ESSCertID=function(e){g.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,r=g,n=r.asn1,s=n.DEROctetString,u=n.DERSequence,i=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(o,l){if(o.hash!=null)return o.hash;if(typeof o=="string"&&o.indexOf("-----BEGIN")==-1&&!De.isASN1HEX(o))return o;var f;if(typeof o=="string")f=o;else if(o.cert!=null)f=o.cert;else throw new t("hash nor cert unspecified");var d;f.indexOf("-----BEGIN")!=-1?d=pr(f):d=f,typeof o=="string"&&(o.indexOf("-----BEGIN")!=-1?d=pr(o):De.isASN1HEX(o)&&(d=o));var E;if(o.alg!=null)E=o.alg;else if(l!=null)E=l;else throw new t("hash alg unspecified");return r.crypto.Util.hashHex(d,E)},this.tohex=function(){var o=this.params,l=this.getCertHash(o,"sha1"),f=[];f.push(new s({hex:l})),(typeof o=="string"&&o.indexOf("-----BEGIN")!=-1||o.cert!=null&&o.hasis!=!1||o.issuer!=null&&o.serial!=null)&&f.push(new i(o));var d=new u({array:f});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.ESSCertID,g.asn1.ASN1Object);g.asn1.cms.SigningCertificateV2=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.x509,i=n.cms,o=i.ESSCertIDv2,l=r.crypto;i.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(this.params==null||this.params==null||this.params.array==null)throw new t("parameter 'array' not specified");for(var f=this.params.array,d=[],E=0;E<f.length;E++){var p=f[E];(e.alg!=null||e.hasis==!1)&&typeof p=="string"&&(p.indexOf("-----BEGIN")!=-1||De.isASN1HEX(p))&&(p={cert:p}),p.alg==null&&e.alg!=null&&(p.alg=e.alg),p.hasis!=!1&&e.hasis==!1&&(p.hasis=!1),d.push(new o(p))}var h=new s({array:d}),w=new s({array:[h]});return[w]},e!=null&&this.setByParam(e)};de(g.asn1.cms.SigningCertificateV2,g.asn1.cms.Attribute);g.asn1.cms.ESSCertIDv2=function(e){g.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);var t=Error,r=g,n=r.asn1,s=n.DEROctetString,u=n.DERSequence,i=n.cms.IssuerSerial,o=n.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var l=this.params,f=this.getCertHash(l,"sha256"),d=[];l.alg!=null&&l.alg!="sha256"&&d.push(new o({name:l.alg})),d.push(new s({hex:f})),(typeof l=="string"&&l.indexOf("-----BEGIN")!=-1||l.cert!=null&&l.hasis!=!1||l.issuer!=null&&l.serial!=null)&&d.push(new i(l));var E=new u({array:d});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.ESSCertIDv2,g.asn1.cms.ESSCertID);g.asn1.cms.IssuerSerial=function(e){var t=Error,r=g,n=r.asn1,s=n.DERInteger,u=n.DERSequence,i=n.cms,o=n.x509,l=o.GeneralNames,f=Je;i.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(d){this.params=d},this.tohex=function(){var d=this.params,E,p;if(typeof d=="string"&&d.indexOf("-----BEGIN")!=-1||d.cert!=null){var h;d.cert!=null?h=d.cert:h=d;var w=new f;w.readCertPEM(h),E=w.getIssuer(),p={hex:w.getSerialNumberHex()}}else if(d.issuer!=null&&d.serial)E=d.issuer,p=d.serial;else throw new t("cert or issuer and serial parameter not specified");var v=new l([{dn:E}]),D=new s(p),A=new u({array:[v,D]});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.IssuerSerial,g.asn1.ASN1Object);g.asn1.cms.SignerIdentifier=function(e){var t=g,r=t.asn1,n=r.DERInteger,s=r.DERSequence,u=r.cms,i=u.IssuerAndSerialNumber,o=u.SubjectKeyIdentifier,l=r.x509,f=l.X500Name,d=Je,E=Error;u.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params;if(p.type=="isssn"){var h=new i(p);return h.tohex()}else if(p.type=="skid"){var w=new o(p);return w.tohex()}else throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.SignerIdentifier,g.asn1.ASN1Object);g.asn1.cms.IssuerAndSerialNumber=function(e){var t=g,r=t.asn1,n=r.DERInteger,s=r.DERSequence,u=r.cms,i=r.x509,o=i.X500Name,l=Je,f=Error;u.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E,p;if(typeof d=="string"&&d.indexOf("-----BEGIN")!=-1||d.cert!=null){var h;d.cert!=null?h=d.cert:h=d;var w=new l;w.readCertPEM(h),E=w.getIssuer(),p={hex:w.getSerialNumberHex()}}else if(d.issuer!=null&&d.serial)E=d.issuer,p=d.serial;else throw new f("cert or issuer and serial parameter not specified");var v=new o(E),D=new n(p),A=new s({array:[v,D]});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(d){this.params=d},e!=null&&this.setByParam(e)};de(g.asn1.cms.IssuerAndSerialNumber,g.asn1.ASN1Object);g.asn1.cms.SubjectKeyIdentifier=function(e){var t=g,r=t.asn1,n=r.DERInteger,s=r.DERSequence,u=r.ASN1Util.newObject,i=r.cms,o=i.IssuerAndSerialName,l=i.SubjectKeyIdentifier,f=r.x509,d=f.X500Name,E=Je,p=Error;i.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var h=this.params;if(h.cert==null&&h.skid==null)throw new p("property cert nor skid undefined");var w;if(h.cert!=null){var v=new E(h.cert),D=v.getExtSubjectKeyIdentifier();w=D.kid.hex}else h.skid!=null&&(w=h.skid);var A=u({tag:{tage:"a0",obj:{octstr:{hex:w}}}});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.SubjectKeyIdentifier,g.asn1.ASN1Object);g.asn1.cms.AttributeList=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSet,u=n.cms;u.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(i){this.params=i},this.tohex=function(){var i=this.params;if(this.hTLV!=null)return this.hTLV;var o=!0;i.sortflag!=null&&(o=i.sortflag);for(var l=i.array,f=[],d=0;d<l.length;d++){var E=l[d],p=E.attr;if(p=="contentType")f.push(new u.ContentType(E));else if(p=="messageDigest")f.push(new u.MessageDigest(E));else if(p=="signingTime")f.push(new u.SigningTime(E));else if(p=="signingCertificate")f.push(new u.SigningCertificate(E));else if(p=="signingCertificateV2")f.push(new u.SigningCertificateV2(E));else if(p=="signaturePolicyIdentifier")f.push(new g.asn1.cades.SignaturePolicyIdentifier(E));else if(p=="signatureTimeStamp"||p=="timeStampToken")f.push(new g.asn1.cades.SignatureTimeStamp(E));else throw new t("unknown attr: "+p)}var h=new s({array:f,sortflag:o});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.AttributeList,g.asn1.ASN1Object);g.asn1.cms.SignerInfo=function(e){var t=Error,r=g,n=r.asn1,s=n.DERInteger,u=n.DEROctetString,i=n.DERSequence,o=n.DERTaggedObject,l=n.cms,f=l.SignerIdentifier,d=l.AttributeList,E=l.ContentType,p=l.EncapsulatedContentInfo,h=l.MessageDigest,w=l.SignedData,v=n.x509,D=v.AlgorithmIdentifier,A=r.crypto,F=Et;l.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var S=this.params,B=S.sigalg,_=new d(S.sattrs).tohex(),K=F.getKey(S.signkey),G=new A.Signature({alg:B});G.init(K),G.updateHex(_);var b=G.sign();S.sighex=b},this.tohex=function(){var S=this.params,B=[];if(B.push(new s({int:S.version})),B.push(new f(S.id)),B.push(new D({name:S.hashalg})),S.sattrs!=null){var _=new d(S.sattrs);try{B.push(new o({tag:"a0",explicit:!1,obj:_}))}catch(G){throw new t("si sattr error: "+G)}}if(S.sigalgfield!=null?B.push(new D({name:S.sigalgfield})):B.push(new D({name:S.sigalg})),S.sighex==null&&S.signkey!=null&&this.sign(),B.push(new u({hex:S.sighex})),S.uattrs!=null){var _=new d(S.uattrs);try{B.push(new o({tag:"a1",explicit:!1,obj:_}))}catch(b){throw new t("si uattr error: "+b)}}var K=new i({array:B});return K.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.SignerInfo,g.asn1.ASN1Object);g.asn1.cms.EncapsulatedContentInfo=function(e){var t=g,r=t.asn1,n=r.DERTaggedObject,s=r.DERSequence,u=r.DERObjectIdentifier,i=r.DEROctetString,o=r.cms;o.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,f=[];if(f.push(new u(l.type)),l.content!=null&&(l.content.hex!=null||l.content.str!=null)&&l.isDetached!=!0){var d=new i(l.content),E=new n({tag:"a0",explicit:!0,obj:d});f.push(E)}var p=new s({array:f});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};de(g.asn1.cms.EncapsulatedContentInfo,g.asn1.ASN1Object);g.asn1.cms.ContentInfo=function(e){var t=g,r=t.asn1,n=r.DERTaggedObject,s=r.DERSequence,u=r.DERObjectIdentifier,i=r.x509,o=i.OID.name2obj;g.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,f=[];f.push(new u(l.type));var d=new n({tag:"a0",explicit:!0,obj:l.obj});f.push(d);var E=new s({array:f});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};de(g.asn1.cms.ContentInfo,g.asn1.ASN1Object);g.asn1.cms.SignedData=function(e){var t=Error,r=g,n=r.asn1,s=n.ASN1Object,u=n.DERInteger,i=n.DERSet,o=n.DERSequence,l=n.DERTaggedObject,f=n.cms,d=f.EncapsulatedContentInfo,E=f.SignerInfo,p=f.ContentInfo,h=f.CertificateSet,w=f.RevocationInfoChoices,v=n.x509,D=v.AlgorithmIdentifier;g.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var A=this.params;this._setDigestAlgs(A),this._setContentTypeByEContent(A),this._setMessageDigestByEContent(A),this._setSignerInfoVersion(A),this._setSignedDataVersion(A)},this._setDigestAlgs=function(A){for(var F={},S=A.sinfos,B=0;B<S.length;B++){var _=S[B];F[_.hashalg]=1}A.hashalgs=Object.keys(F).sort()},this._setContentTypeByEContent=function(A){for(var F=A.econtent.type,S=A.sinfos,B=0;B<S.length;B++){var _=S[B],K=this._getAttrParamByName(_,"contentType");K.type=F}},this._setMessageDigestByEContent=function(A){var F=A.econtent,S=A.econtent.type,B=F.content.hex;B==null&&F.type=="data"&&F.content.str!=null&&(B=Bs(F.content.str));for(var _=A.sinfos,K=0;K<_.length;K++){var G=_[K],b=G.hashalg,P=this._getAttrParamByName(G,"messageDigest"),L=g.crypto.Util.hashHex(B,b);P.hex=L}},this._getAttrParamByName=function(A,F){for(var S=A.sattrs.array,B=0;B<S.length;B++)if(S[B].attr==F)return S[B]},this._setSignerInfoVersion=function(A){for(var F=A.sinfos,S=0;S<F.length;S++){var B=F[S],_=1;B.id.type=="skid"&&(_=3),B.version=_}},this._setSignedDataVersion=function(A){var F=this._getSignedDataVersion(A);A.version=F},this._getSignedDataVersion=function(A){if(A.revinfos!=null)for(var F=A.revinfos,S=0;S<F.length;S++){var B=F[S];if(B.ocsp!=null)return 5}for(var _=A.sinfos,S=0;S<_.length;S++){var K=A.sinfos[S];if(K.version==3)return 3}return A.econtent.type!="data"?3:1},this.tohex=function(){var A=this.params;this.getEncodedHexPrepare!=null&&this.getEncodedHexPrepare(),A.fixed!=!0&&this.checkAndFixParam();var F=[];F.push(new u({int:A.version}));for(var S=[],B=0;B<A.hashalgs.length;B++){var _=A.hashalgs[B];S.push(new D({name:_}))}F.push(new i({array:S})),F.push(new d(A.econtent)),A.certs!=null&&F.push(new h(A.certs)),A.revinfos!=null&&F.push(new w(A.revinfos));for(var K=[],B=0;B<A.sinfos.length;B++){var G=A.sinfos[B];K.push(new E(G))}F.push(new i({array:K}));var b=new o({array:F});return b.tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){var A=new p({type:"signed-data",obj:this});return A},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.SignedData,g.asn1.ASN1Object);g.asn1.cms.CertificateSet=function(e){g.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,r=g.asn1,n=r.DERTaggedObject,s=r.DERSet,u=r.ASN1Object;this.params=null,this.tohex=function(){var i=this.params,o=[],l;if(i instanceof Array)l=i;else if(i.array!=null)l=i.array;else throw new t("cert array not specified");for(var f=0;f<l.length;f++){var d=l[f],E=pr(d),p=new u;p.hTLV=E,o.push(p)}var h={array:o};i.sortflag==!1&&(h.sortflag=!1);var w=new s(h),v=new n({tag:"a0",explicit:!1,obj:w});return v.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.CertificateSet,g.asn1.ASN1Object);g.asn1.cms.RevocationInfoChoices=function(e){g.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var r=[],n=0;n<t.length;n++)r.push(new g.asn1.cms.RevocationInfoChoice(t[n]));var s=g.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:r}}});return s.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.RevocationInfoChoices,g.asn1.ASN1Object);g.asn1.cms.RevocationInfoChoice=function(e){g.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(t.crl!=null&&typeof t.crl=="string"){var r=t.crl;return t.crl.indexOf("-----BEGIN")!=-1&&(r=pr(t.crl)),r}else if(t.ocsp!=null){var n=g.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new g.asn1.cms.OtherRevocationFormat(t)}});return n.tohex()}else throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.RevocationInfoChoice,g.asn1.ASN1Object);g.asn1.cms.OtherRevocationFormat=function(e){g.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,r=g,n=r.asn1,s=n.ASN1Util.newObject,u=r.lang.String.isHex;this.params=null,this.tohex=function(){var i=this.params;if(i.ocsp==null)throw new t("property ocsp not specified");if(!u(i.ocsp)||!De.isASN1HEX(i.ocsp))throw new t("ocsp value not ASN.1 hex string");var o=s({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:i.ocsp}}]});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cms.OtherRevocationFormat,g.asn1.ASN1Object);g.asn1.cms.CMSUtil=new function(){};g.asn1.cms.CMSUtil.newSignedData=function(e){return new g.asn1.cms.SignedData(e)};g.asn1.cms.CMSUtil.verifySignedData=function(e){var t=g,r=t.asn1,n=r.cms,s=n.SignerInfo,u=n.SignedData,i=n.SigningTime,o=n.SigningCertificate,l=n.SigningCertificateV2,f=r.cades,d=f.SignaturePolicyIdentifier,E=t.lang.String.isHex,p=De,h=p.getVbyList,w=p.getTLVbyList,v=p.getIdxbyList,D=p.getChildIdx,A=p.getTLV,F=p.oidname,S=t.crypto.Util.hashHex;e.cms===void 0&&E(e.cms);var B=e.cms,_=function(z,J){for(var se,ye=3;ye<6;ye++)if(se=v(z,0,[1,0,ye]),se!==void 0){var Ce=z.substr(se,2);Ce==="a0"&&(J.certsIdx=se),Ce==="a1"&&(J.revinfosIdx=se),Ce==="31"&&(J.signerinfosIdx=se)}},K=function(z,J){var se=J.signerinfosIdx;if(se!==void 0){var ye=D(z,se);J.signerInfoIdxList=ye;for(var Ce=0;Ce<ye.length;Ce++){var Pe=ye[Ce],Xe={idx:Pe};G(z,Xe),J.signerInfos.push(Xe)}}},G=function(z,J){var se=J.idx;J.signerid_issuer1=w(z,se,[1,0],"30"),J.signerid_serial1=h(z,se,[1,1],"02"),J.hashalg=F(h(z,se,[2,0],"06"));var ye=v(z,se,[3],"a0");J.idxSignedAttrs=ye,b(z,J,ye);var Ce=D(z,se),Pe=Ce.length;if(Pe<6)throw"malformed SignerInfo";J.sigalg=F(h(z,se,[Pe-2,0],"06")),J.sigval=h(z,se,[Pe-1],"04")},b=function(z,J,se){var ye=D(z,se);J.signedAttrIdxList=ye;for(var Ce=0;Ce<ye.length;Ce++){var Pe=ye[Ce],Xe=h(z,Pe,[0],"06"),ce;Xe==="2a864886f70d010905"?(ce=qt(h(z,Pe,[1,0])),J.saSigningTime=ce):Xe==="2a864886f70d010904"&&(ce=h(z,Pe,[1,0],"04"),J.saMessageDigest=ce)}},P=function(z,J){if(h(z,0,[0],"06")!=="2a864886f70d010702")return J;J.cmsType="signedData",J.econtent=h(z,0,[1,0,2,1,0]),_(z,J),J.signerInfos=[],K(z,J)},L=function(z,J){for(var se=J.parse.signerInfos,ye=se.length,Ce=!0,Pe=0;Pe<ye;Pe++){var Xe=se[Pe];V(z,J,Xe,Pe),Xe.isValid||(Ce=!1)}J.isValid=Ce},j=function(z,J,se,ye){var Ce=J.parse.certsIdx,Pe;if(J.certs===void 0){Pe=[],J.certkeys=[];for(var Xe=D(z,Ce),ce=0;ce<Xe.length;ce++){var Ie=A(z,Xe[ce]),Me=new Je;Me.readCertHex(Ie),Pe[ce]=Me,J.certkeys[ce]=Me.getPublicKey()}J.certs=Pe}else Pe=J.certs;J.cccc=Pe.length,J.cccci=Xe.length;for(var ce=0;ce<Pe.length;ce++){var _r=Me.getIssuerHex(),Kt=Me.getSerialNumberHex();se.signerid_issuer1===_r&&se.signerid_serial1===Kt&&(se.certkey_idx=ce)}},V=function(z,J,se,ye){se.verifyDetail={};var Ce=se.verifyDetail,Pe=J.parse.econtent,Xe=se.hashalg,ce=se.saMessageDigest;Ce.validMessageDigest=!1,S(Pe,Xe)===ce&&(Ce.validMessageDigest=!0),j(z,J,se,ye),Ce.validSignatureValue=!1;var Ie=se.sigalg,Me="31"+A(z,se.idxSignedAttrs).substr(2);se.signedattrshex=Me;var _r=J.certs[se.certkey_idx].getPublicKey(),Kt=new g.crypto.Signature({alg:Ie});Kt.init(_r),Kt.updateHex(Me);var Ft=Kt.verify(se.sigval);Ce.validSignatureValue_isValid=Ft,Ft===!0&&(Ce.validSignatureValue=!0),se.isValid=!1,Ce.validMessageDigest&&Ce.validSignatureValue&&(se.isValid=!0)},W=function(){},q={isValid:!1,parse:{}};return P(B,q.parse),L(B,q),q};g.asn1.cms.CMSParser=function(){var e=Error,t=Je,r=new t,n=De,s=n.getV,u=n.getTLV,i=n.getIdxbyList,o=n.getTLVbyList,l=n.getTLVbyListEx,f=n.getVbyList,d=n.getVbyListEx,E=n.getChildIdx;this.getCMSSignedData=function(p){var h=o(p,0,[1,0]),w=this.getSignedData(h);return w},this.getSignedData=function(p){var h=E(p,0),w={},v=s(p,h[0]),D=parseInt(v,16);w.version=D;var A=u(p,h[1]);w.hashalgs=this.getHashAlgArray(A);var F=u(p,h[2]);w.econtent=this.getEContent(F);var S=l(p,0,["[0]"]);S!=null&&(w.certs=this.getCertificateSet(S));var B=l(p,0,["[1]"]);B!=null;var _=l(p,0,[3]);return w.sinfos=this.getSignerInfos(_),w},this.getHashAlgArray=function(p){for(var h=E(p,0),w=new t,v=[],D=0;D<h.length;D++){var A=u(p,h[D]),F=w.getAlgorithmIdentifierName(A);v.push(F)}return v},this.getEContent=function(p){var h={},w=f(p,0,[0]),v=f(p,0,[1,0]);return h.type=g.asn1.x509.OID.oid2name(De.hextooidstr(w)),h.content={hex:v},h},this.getSignerInfos=function(p){for(var h=[],w=E(p,0),v=0;v<w.length;v++){var D=u(p,w[v]),A=this.getSignerInfo(D);h.push(A)}return h},this.getSignerInfo=function(p){var h={},w=E(p,0),v=n.getInt(p,w[0],-1);v!=-1&&(h.version=v);var D=u(p,w[1]),A=this.getIssuerAndSerialNumber(D);h.id=A;var F=u(p,w[2]),S=r.getAlgorithmIdentifierName(F);h.hashalg=S;var B=l(p,0,["[0]"]);if(B!=null){var _=this.getAttributeList(B);h.sattrs=_}var K=l(p,0,[3]),G=r.getAlgorithmIdentifierName(K);h.sigalg=G;var b=d(p,0,[4]);h.sighex=b;var P=l(p,0,["[1]"]);if(P!=null){var L=this.getAttributeList(P);h.uattrs=L}return h},this.getSignerIdentifier=function(p){if(p.substr(0,2)=="30")return this.getIssuerAndSerialNumber(p);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(p){var h={type:"isssn"},w=E(p,0),v=u(p,w[0]);h.issuer=r.getX500Name(v);var D=s(p,w[1]);return h.serial={hex:D},h},this.getAttributeList=function(p){for(var h=[],w=E(p,0),v=0;v<w.length;v++){var D=u(p,w[v]),A=this.getAttribute(D);h.push(A)}return{array:h}},this.getAttribute=function(p){var h={},w=E(p,0),v=n.getOID(p,w[0]),D=g.asn1.x509.OID.oid2name(v);h.attr=D;var A=u(p,w[1]),F=E(A,0);if(F.length==1)h.valhex=u(A,F[0]);else{for(var S=[],B=0;B<F.length;B++)S.push(u(A,F[B]));h.valhex=S}return D=="contentType"?this.setContentType(h):D=="messageDigest"?this.setMessageDigest(h):D=="signingTime"?this.setSigningTime(h):D=="signingCertificate"?this.setSigningCertificate(h):D=="signingCertificateV2"?this.setSigningCertificateV2(h):D=="signaturePolicyIdentifier"&&this.setSignaturePolicyIdentifier(h),h},this.setContentType=function(p){var h=n.getOIDName(p.valhex,0,null);h!=null&&(p.type=h,delete p.valhex)},this.setSigningTime=function(p){var h=s(p.valhex,0),w=qt(h);p.str=w,delete p.valhex},this.setMessageDigest=function(p){var h=s(p.valhex,0);p.hex=h,delete p.valhex},this.setSigningCertificate=function(p){var h=E(p.valhex,0);if(h.length>0){for(var w=u(p.valhex,h[0]),v=E(w,0),D=[],A=0;A<v.length;A++){var F=u(w,v[A]),S=this.getESSCertID(F);D.push(S)}p.array=D}if(h.length>1){var B=u(p.valhex,h[1]);p.polhex=B}delete p.valhex},this.setSignaturePolicyIdentifier=function(p){var h=E(p.valhex,0);if(h.length>0){var w=n.getOID(p.valhex,h[0]);p.oid=w}if(h.length>1){var v=new t,D=E(p.valhex,h[1]),A=u(p.valhex,D[0]),F=v.getAlgorithmIdentifierName(A);p.alg=F;var S=s(p.valhex,D[1]);p.hash=S}delete p.valhex},this.setSigningCertificateV2=function(p){var h=E(p.valhex,0);if(h.length>0){for(var w=u(p.valhex,h[0]),v=E(w,0),D=[],A=0;A<v.length;A++){var F=u(w,v[A]),S=this.getESSCertIDv2(F);D.push(S)}p.array=D}if(h.length>1){var B=u(p.valhex,h[1]);p.polhex=B}delete p.valhex},this.getESSCertID=function(p){var h={},w=E(p,0);if(w.length>0){var v=s(p,w[0]);h.hash=v}if(w.length>1){var D=u(p,w[1]),A=this.getIssuerSerial(D);A.serial!=null&&(h.serial=A.serial),A.issuer!=null&&(h.issuer=A.issuer)}return h},this.getESSCertIDv2=function(p){var h={},w=E(p,0);if(w.length<1||3<w.length)throw new e("wrong number of elements");var v=0;if(p.substr(w[0],2)=="30"){var D=u(p,w[0]);h.alg=r.getAlgorithmIdentifierName(D),v++}else h.alg="sha256";var A=s(p,w[v]);if(h.hash=A,w.length>v+1){var F=u(p,w[v+1]),S=this.getIssuerSerial(F);h.issuer=S.issuer,h.serial=S.serial}return h},this.getIssuerSerial=function(p){var h={},w=E(p,0),v=u(p,w[0]),D=r.getGeneralNames(v),A=D[0].dn;h.issuer=A;var F=s(p,w[1]);return h.serial={hex:F},h},this.getCertificateSet=function(p){for(var h=E(p,0),w=[],v=0;v<h.length;v++){var D=u(p,h[v]);if(D.substr(0,2)=="30"){var A=yn(D,"CERTIFICATE");w.push(A)}}return{array:w,sortflag:!1}}};(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});(typeof g.asn1.tsp>"u"||!g.asn1.tsp)&&(g.asn1.tsp={});g.asn1.tsp.TimeStampToken=function(e){var t=g,r=t.asn1,n=r.tsp;n.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var s=new n.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=s.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.TimeStampToken,g.asn1.cms.SignedData);g.asn1.tsp.TSTInfo=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.DERInteger,i=n.DERBoolean,o=n.DERGeneralizedTime,l=n.DERObjectIdentifier,f=n.DERTaggedObject,d=n.tsp,E=d.MessageImprint,p=d.Accuracy,h=n.x509.X500Name,w=n.x509.GeneralName;if(d.TSTInfo.superclass.constructor.call(this),this.dVersion=new u({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var v=[this.dVersion];if(this.dPolicy==null)throw new Error("policy shall be specified.");if(v.push(this.dPolicy),this.dMessageImprint==null)throw new Error("messageImprint shall be specified.");if(v.push(this.dMessageImprint),this.dSerial==null)throw new Error("serialNumber shall be specified.");if(v.push(this.dSerial),this.dGenTime==null)throw new Error("genTime shall be specified.");v.push(this.dGenTime),this.dAccuracy!=null&&v.push(this.dAccuracy),this.dOrdering!=null&&v.push(this.dOrdering),this.dNonce!=null&&v.push(this.dNonce),this.dTsa!=null&&v.push(this.dTsa);var D=new s({array:v});return this.hTLV=D.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0){if(typeof e.policy=="string"){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new l({oid:e.policy})}e.messageImprint!==void 0&&(this.dMessageImprint=new E(e.messageImprint)),e.serial!==void 0&&(this.dSerial=new u(e.serial)),e.genTime!==void 0&&(this.dGenTime=new o(e.genTime)),e.accuracy!==void 0&&(this.dAccuracy=new p(e.accuracy)),e.ordering!==void 0&&e.ordering==!0&&(this.dOrdering=new i),e.nonce!==void 0&&(this.dNonce=new u(e.nonce)),e.tsa!==void 0&&(this.dTsa=new f({tag:"a0",explicit:!0,obj:new w({dn:e.tsa})}))}};de(g.asn1.tsp.TSTInfo,g.asn1.ASN1Object);g.asn1.tsp.Accuracy=function(e){var t=g,r=t.asn1,n=r.ASN1Util.newObject;r.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var s=this.params,u=[];return s.seconds!=null&&typeof s.seconds=="number"&&u.push({int:s.seconds}),s.millis!=null&&typeof s.millis=="number"&&u.push({tag:{tagi:"80",obj:{int:s.millis}}}),s.micros!=null&&typeof s.micros=="number"&&u.push({tag:{tagi:"81",obj:{int:s.micros}}}),n({seq:u}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.Accuracy,g.asn1.ASN1Object);g.asn1.tsp.MessageImprint=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.DEROctetString,u=r.x509,i=u.AlgorithmIdentifier;r.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params,l=new i({name:o.alg}),f=new s({hex:o.hash}),d=new n({array:[l,f]});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.tsp.MessageImprint,g.asn1.ASN1Object);g.asn1.tsp.TimeStampReq=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.DERInteger,u=r.DERBoolean,i=r.ASN1Object,o=r.DERObjectIdentifier,l=r.tsp,f=l.MessageImprint;l.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E=[];E.push(new s({int:1})),d.messageImprint instanceof g.asn1.ASN1Object?E.push(d.messageImprint):E.push(new f(d.messageImprint)),d.policy!=null&&E.push(new o(d.policy)),d.nonce!=null&&E.push(new s(d.nonce)),d.certreq==!0&&E.push(new u);var p=new n({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.TimeStampReq,g.asn1.ASN1Object);g.asn1.tsp.TimeStampResp=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.ASN1Object,u=r.tsp,i=u.PKIStatusInfo;u.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params,l=[];if(o.econtent!=null||o.tst!=null)if(o.statusinfo!=null?l.push(new i(o.statusinfo)):l.push(new i("granted")),o.econtent!=null)l.push(new u.TimeStampToken(o).getContentInfo());else if(o.tst instanceof r.ASN1Object)l.push(o.tst);else throw new Error("improper member tst value");else if(o.statusinfo!=null)l.push(new i(o.statusinfo));else throw new Error("parameter for token nor statusinfo not specified");var f=new n({array:l});return f.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.TimeStampResp,g.asn1.ASN1Object);g.asn1.tsp.PKIStatusInfo=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.tsp,i=u.PKIStatus,o=u.PKIFreeText,l=u.PKIFailureInfo;u.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var f=this.params,d=[];if(typeof f=="string")d.push(new i(f));else{if(f.status==null)throw new t("property 'status' unspecified");d.push(new i(f.status)),f.statusstr!=null&&d.push(new o(f.statusstr)),f.failinfo!=null&&d.push(new l(f.failinfo))}var E=new s({array:d});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.PKIStatusInfo,g.asn1.ASN1Object);g.asn1.tsp.PKIStatus=function(e){var t=Error,r=g,n=r.asn1,s=n.DERInteger,u=n.tsp;u.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var o=this.params,l,f;if(typeof o=="string")try{f=i[o]}catch{throw new t("undefined name: "+o)}else if(typeof o=="number")f=o;else throw new t("unsupported params");return new s({int:f}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.PKIStatus,g.asn1.ASN1Object);g.asn1.tsp.PKIFreeText=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.DERUTF8String,i=n.tsp;i.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var o=this.params;if(!o instanceof Array)throw new t("wrong params: not array");for(var l=[],f=0;f<o.length;f++)l.push(new u({str:o[f]}));var d=new s({array:l});return d.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.PKIFreeText,g.asn1.ASN1Object);g.asn1.tsp.PKIFailureInfo=function(e){var t=Error,r=g,n=r.asn1,s=n.DERBitString,u=n.tsp,i=u.PKIFailureInfo,o={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var l=this.params,f=0;if(typeof l=="number"&&0<=l&&l<=25){f|=1<<l;for(var d=f.toString(2),E="",p=d.length-1;p>=0;p--)E+=d[p];return E}else{if(typeof l=="string"&&o[l]!=null)return qf([l],o);if(typeof l=="object"&&l.length!=null)return qf(l,o);throw new t("wrong params")}},this.tohex=function(){var l=this.params,f=this.getBinValue();return new s({bin:f}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.tsp.PKIFailureInfo,g.asn1.ASN1Object);g.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(t,r){throw"not implemented yet"}};g.asn1.tsp.SimpleTSAAdapter=function(e){var t=g,r=t.asn1,n=r.tsp,s=t.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(u,i){var o=s(u,i);this.params.econtent.content.messageImprint={alg:i,hash:o},this.params.econtent.content.serial={int:this.serial++};var l=Math.floor(Math.random()*1e9);this.params.econtent.content.nonce={int:l};var f=new n.TimeStampToken(this.params);return f.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};de(g.asn1.tsp.SimpleTSAAdapter,g.asn1.tsp.AbstractTSAAdapter);g.asn1.tsp.FixedTSAAdapter=function(e){var t=g,r=t.asn1,n=r.tsp,s=t.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(u,i){var o=s(u,i);this.params.econtent.content.messageImprint={alg:i,hash:o};var l=new n.TimeStampToken(this.params);return l.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};de(g.asn1.tsp.FixedTSAAdapter,g.asn1.tsp.AbstractTSAAdapter);g.asn1.tsp.TSPUtil=new function(){};g.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new g.asn1.tsp.TimeStampToken(e)};g.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){var t=new g.asn1.tsp.TSPParser;return t.getTimeStampReq(e)};g.asn1.tsp.TSPUtil.parseMessageImprint=function(e){var t=new g.asn1.tsp.TSPParser;return t.getMessageImprint(e)};g.asn1.tsp.TSPParser=function(){var e=Error,t=Je,r=new t,n=De,s=n.getV,u=n.getTLV,i=n.getIdxbyList,o=n.getTLVbyListEx,l=n.getChildIdx,f=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],d={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(E){var p=l(E,0);if(p.length==1)return this.getPKIStatusInfo(u(E,p[0]));if(p.length>1){var h=this.getPKIStatusInfo(u(E,p[0])),w=u(E,p[1]),v=this.getToken(w);return v.statusinfo=h,v}},this.getToken=function(E){var p=new g.asn1.cms.CMSParser,h=p.getCMSSignedData(E);return this.setTSTInfo(h),h},this.setTSTInfo=function(E){var p=E.econtent;if(p.type=="tstinfo"){var h=p.content.hex,w=this.getTSTInfo(h);p.content=w}},this.getTSTInfo=function(E){var p={},h=l(E,0),w=s(E,h[1]);p.policy=Zf(w);var v=u(E,h[2]);p.messageImprint=this.getMessageImprint(v);var D=s(E,h[3]);p.serial={hex:D};var A=s(E,h[4]);p.genTime={str:qt(A)};var F=0;if(h.length>5&&E.substr(h[5],2)=="30"){var S=u(E,h[5]);p.accuracy=this.getAccuracy(S),F++}if(h.length>5+F&&E.substr(h[5+F],2)=="01"){var B=s(E,h[5+F]);B=="ff"&&(p.ordering=!0),F++}if(h.length>5+F&&E.substr(h[5+F],2)=="02"){var _=s(E,h[5+F]);p.nonce={hex:_},F++}if(h.length>5+F&&E.substr(h[5+F],2)=="a0"){var K=u(E,h[5+F]);K="30"+K.substr(2),pGeneralNames=r.getGeneralNames(K);var G=pGeneralNames[0].dn;p.tsa=G,F++}if(h.length>5+F&&E.substr(h[5+F],2)=="a1"){var b=u(E,h[5+F]);b="30"+b.substr(2);var P=r.getExtParamArray(b);p.ext=P,F++}return p},this.getAccuracy=function(E){for(var p={},h=l(E,0),w=0;w<h.length;w++){var v=E.substr(h[w],2),D=s(E,h[w]),A=parseInt(D,16);v=="02"?p.seconds=A:v=="80"?p.millis=A:v=="81"&&(p.micros=A)}return p},this.getMessageImprint=function(E){if(E.substr(0,2)!="30")throw new Error("head of messageImprint hex shall be x30");var p={},h=l(E,0),w=i(E,0,[0,0]),v=s(E,w),D=n.hextooidstr(v),A=g.asn1.x509.OID.oid2name(D);if(A=="")throw new Error("hashAlg name undefined: "+D);var F=A,S=i(E,0,[1]);return p.alg=F,p.hash=s(E,S),p},this.getPKIStatusInfo=function(E){var p={},h=l(E,0),w=0;try{var v=s(E,h[0]),D=parseInt(v,16);p.status=f[D]}catch{}if(h.length>1&&E.substr(h[1],2)=="30"){var A=u(E,h[1]);p.statusstr=this.getPKIFreeText(A),w++}if(h.length>w&&E.substr(h[1+w],2)=="03"){var F=u(E,h[1+w]);p.failinfo=this.getPKIFailureInfo(F)}return p},this.getPKIFreeText=function(E){for(var p=[],h=l(E,0),w=0;w<h.length;w++)p.push(n.getString(E,h[w]));return p},this.getPKIFailureInfo=function(E){var p=n.getInt(E,0);return d[p]!=null?d[p]:p},this.getTimeStampReq=function(E){var p={};p.certreq=!1;var h=l(E,0);if(h.length<2)throw new Error("TimeStampReq must have at least 2 items");var w=u(E,h[1]);p.messageImprint=g.asn1.tsp.TSPUtil.parseMessageImprint(w);for(var v=2;v<h.length;v++){var D=h[v],A=E.substr(D,2);if(A=="06"){var F=s(E,D);p.policy=n.hextooidstr(F)}A=="02"&&(p.nonce=s(E,D)),A=="01"&&(p.certreq=!0)}return p}};(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});(typeof g.asn1.cades>"u"||!g.asn1.cades)&&(g.asn1.cades={});g.asn1.cades.SignaturePolicyIdentifier=function(e){var t=g,r=t.asn1,n=r.cades,s=n.SignaturePolicyId;n.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new s(this.params)]},this.setByParam=function(u){this.params=u},e!=null&&this.setByParam(e)};de(g.asn1.cades.SignaturePolicyIdentifier,g.asn1.cms.Attribute);g.asn1.cades.SignaturePolicyId=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.DERObjectIdentifier,u=r.x509,i=u.AlgorithmIdentifier,o=r.cades,l=o.SignaturePolicyId,f=o.OtherHashAlgAndValue;l.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params,E=[];E.push(new s(d.oid)),E.push(new f(d));var p=new n({array:E});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(d){this.params=d},e!=null&&this.setByParam(e)};de(g.asn1.cades.SignaturePolicyId,g.asn1.ASN1Object);g.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.DEROctetString,i=n.x509,o=i.AlgorithmIdentifier,l=n.cades,f=l.OtherHashAlgAndValue;f.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params;if(d.alg==null)throw new t("property 'alg' not specified");if(d.hash==null&&d.cert==null)throw new t("property 'hash' nor 'cert' not specified");var E=null;if(d.hash!=null)E=d.hash;else if(d.cert!=null){if(typeof d.cert!="string")throw new t("cert not string");var p=d.cert;d.cert.indexOf("-----BEGIN")!=-1&&(p=pr(d.cert)),E=g.crypto.Util.hashHex(p,d.alg)}var h=[];h.push(new o({name:d.alg})),h.push(new u({hex:E}));var w=new s({array:h});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cades.OtherHashAlgAndValue,g.asn1.ASN1Object);g.asn1.cades.OtherHashValue=function(e){g.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,r=g,n=r.lang.String.isHex,s=r.asn1,u=s.DEROctetString,i=r.crypto.Util.hashHex;this.params=null,this.tohex=function(){var o=this.params;if(o.hash==null&&o.cert==null)throw new t("hash or cert not specified");var l=null;if(o.hash!=null)l=o.hash;else if(o.cert!=null){if(typeof o.cert!="string")throw new t("cert not string");var f=o.cert;o.cert.indexOf("-----BEGIN")!=-1&&(f=pr(o.cert)),l=g.crypto.Util.hashHex(f,"sha1")}return new u({hex:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cades.OtherHashValue,g.asn1.ASN1Object);g.asn1.cades.SignatureTimeStamp=function(e){var t=Error,r=g,n=r.lang.String.isHex,s=r.asn1,u=s.ASN1Object,i=s.x509,o=s.cades;o.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var l=this.params;if(l.tst!=null)if(n(l.tst)){var f=new u;return f.hTLV=l.tst,[f]}else{if(l.tst instanceof u)return[l.tst];throw new t("params.tst has wrong value")}else if(l.res!=null){var d=l.res;if(d instanceof u&&(d=d.tohex()),typeof d!="string"||!n(d))throw new t("params.res has wrong value");var E=De.getTLVbyList(d,0,[1]),f=new u;return f.hTLV=l.tst,[f]}},e!=null&&this.setByParam(e)};de(g.asn1.cades.SignatureTimeStamp,g.asn1.cms.Attribute);g.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.cades,i=u.OtherCertID,o=r.lang.String.isHex;u.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var l=this.params,f=[],d=0;d<l.array.length;d++){var E=l.array[d];if(typeof E=="string")if(E.indexOf("-----BEGIN")!=-1)E={cert:E};else if(o(E))E={hash:E};else throw new t("unsupported value: "+E);l.alg!=null&&E.alg==null&&(E.alg=l.alg),l.hasis!=null&&E.hasis==null&&(E.hasis=l.hasis);var p=new i(E);f.push(p)}var h=new s({array:f});return[h]},e!=null&&this.setByParam(e)};de(g.asn1.cades.CompleteCertificateRefs,g.asn1.cms.Attribute);g.asn1.cades.OtherCertID=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.cms,u=s.IssuerSerial,i=r.cades,o=i.OtherHashValue,l=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var f=this.params;typeof f=="string"&&(f.indexOf("-----BEGIN")!=-1?f={cert:f}:_isHex(f)&&(f={hash:f}));var d=[],E=null;if(f.alg!=null?E=new l(f):E=new o(f),d.push(E),f.cert!=null&&f.hasis==!0||f.issuer!=null&&f.serial!=null){var p=new u(f);d.push(p)}var h=new n({array:d});return h.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cades.OtherCertID,g.asn1.ASN1Object);g.asn1.cades.OtherHash=function(e){var t=Error,r=g,n=r.asn1,s=n.cms,u=n.cades,i=u.OtherHashAlgAndValue,o=u.OtherHashValue,l=r.crypto.Util.hashHex,f=r.lang.String.isHex;u.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var d=this.params;typeof d=="string"&&(d.indexOf("-----BEGIN")!=-1?d={cert:d}:f(d)&&(d={hash:d}));var E=null;return d.alg!=null?E=new i(d):E=new o(d),E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};de(g.asn1.cades.OtherHash,g.asn1.ASN1Object);g.asn1.cades.CAdESUtil=new function(){};g.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){var t=new g.asn1.cms.CMSParser,r=t.getCMSSignedData(e);return r};g.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,r){var n=De,s=n.getChildIdx,u=n.getTLV,i=n.getV,o=g,l=o.asn1,f=l.ASN1Object,d=l.cms,E=d.AttributeList,p=d.SignerInfo,h={},w=s(e,t);if(w.length!=6)throw"not supported items for SignerInfo (!=6)";var v=w.shift();h.version=u(e,v);var D=w.shift();h.si=u(e,D);var A=w.shift();h.digalg=u(e,A);var F=w.shift();h.sattrs=u(e,F);var S=w.shift();h.sigalg=u(e,S);var B=w.shift();h.sig=u(e,B),h.sigval=i(e,B);var _=null;return h.obj=new p,_=new f,_.hTLV=h.version,h.obj.dCMSVersion=_,_=new f,_.hTLV=h.si,h.obj.dSignerIdentifier=_,_=new f,_.hTLV=h.digalg,h.obj.dDigestAlgorithm=_,_=new f,_.hTLV=h.sattrs,h.obj.dSignedAttrs=_,_=new f,_.hTLV=h.sigalg,h.obj.dSigAlg=_,_=new f,_.hTLV=h.sig,h.obj.dSig=_,h.obj.dUnsignedAttrs=new E,h};(typeof g.asn1.csr>"u"||!g.asn1.csr)&&(g.asn1.csr={});g.asn1.csr.CertificationRequest=function(e){var t=g,r=t.asn1,n=r.DERBitString,s=r.DERSequence,u=r.csr,i=r.x509,o=u.CertificationRequestInfo;u.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(l){this.params=l},this.sign=function(){var l=new o(this.params).tohex(),f=new g.crypto.Signature({alg:this.params.sigalg});f.init(this.params.sbjprvkey),f.updateHex(l);var d=f.sign();this.params.sighex=d},this.getPEM=function(){return yn(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var l=this.params,f=new g.asn1.csr.CertificationRequestInfo(this.params),d=new g.asn1.x509.AlgorithmIdentifier({name:l.sigalg});if(l.sighex==null&&l.sbjprvkey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or sbjprvkey parameter not defined");var E=new n({hex:"00"+l.sighex}),p=new s({array:[f,d,E]});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.csr.CertificationRequest,g.asn1.ASN1Object);g.asn1.csr.CertificationRequestInfo=function(e){var t=g,r=t.asn1,n=r.DERBitString,s=r.DERSequence,u=r.DERInteger,i=r.DERUTF8String,o=r.DERTaggedObject,l=r.ASN1Util.newObject,f=r.csr,d=r.x509,E=d.X500Name,p=d.Extensions,h=d.SubjectPublicKeyInfo,w=f.AttributeList;f.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(D){D!=null&&(this.params=D)},this.tohex=function(){var D=this.params,A=[];if(A.push(new u({int:0})),A.push(new E(D.subject)),A.push(new h(Et.getKey(D.sbjpubkey))),D.attrs!=null){var F=v(D.attrs),S=l({tag:{tage:"a0",obj:F}});A.push(S)}else if(D.extreq!=null){var B=new p(D.extreq),S=l({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[B]}]}}});A.push(S)}else A.push(new o({tag:"a0",explicit:!1,obj:new i({str:""})}));var _=new s({array:A});return _.tohex()},this.getEncodedHex=function(){return this.tohex()};function v(D){for(var A=Error,F=g.asn1.x509.Extensions,S=[],B=0;B<D.length;B++){var _=D[B],K=_.attr;if(K=="extensionRequest"){var G=new F(_.ext),b={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[G]}]};S.push(b)}else if(K=="unstructuredName"){var b={seq:[{oid:"1.2.840.113549.1.9.2"},{set:_.names}]};S.push(b)}else if(K=="challengePassword"){var b={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:_.password}]}]};S.push(b)}else throw new A("unknown CSR attribute")}return{set:S}}e!=null&&this.setByParam(e)};de(g.asn1.csr.CertificationRequestInfo,g.asn1.ASN1Object);g.asn1.csr.AttributeList=function(e){function t(r){}};de(g.asn1.csr.AttributeList,g.asn1.ASN1Object);g.asn1.csr.CSRUtil=new function(){};g.asn1.csr.CSRUtil.newCSRPEM=function(e){var t=Et,r=g.asn1.csr,n=new r.CertificationRequest(e),s=n.getPEM();return s};g.asn1.csr.CSRUtil.getParam=function(e,t){var r=De,n=r.getV,s=r.getIdxbyList,u=r.getTLVbyList,i=r.getTLVbyListEx,o=r.getVbyListEx,l=function(F){var S=s(F,0,[0,3,0,0],"06");return n(F,S)!="2a864886f70d01090e"?null:u(F,0,[0,3,0,1,0],"30")},f={};if(e.indexOf("-----BEGIN CERTIFICATE REQUEST")==-1)throw new Error("argument is not PEM file");var d=pr(e,"CERTIFICATE REQUEST");t&&(f.tbs=u(d,0,[0]));try{var E=i(d,0,[0,1]);if(E=="3000")f.subject={};else{var v=new Je;f.subject=v.getX500Name(E)}}catch{}var p=i(d,0,[0,2]),h=Et.getKey(p,null,"pkcs8pub");f.sbjpubkey=Et.getPEM(h,"PKCS8PUB");var w=l(d),v=new Je;w!=null&&(f.extreq=v.getExtParamArray(w));try{var D=i(d,0,[1],"30"),v=new Je;f.sigalg=v.getAlgorithmIdentifierName(D)}catch{}try{var A=o(d,0,[2]);f.sighex=A}catch{}return f};g.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if(typeof e=="string"&&e.indexOf("-----BEGIN CERTIFICATE REQUEST")!=-1?t=g.asn1.csr.CSRUtil.getParam(e,!0):typeof e=="object"&&e.sbjpubkey!=null&&e.sigalg!=null&&e.sighex!=null&&e.tbs!=null&&(t=e),t==null)return!1;var r=new g.crypto.Signature({alg:t.sigalg});return r.init(t.sbjpubkey),r.updateHex(t.tbs),r.verify(t.sighex)}catch(n){return alert(n),!1}};(typeof g>"u"||!g)&&(g={});(typeof g.asn1>"u"||!g.asn1)&&(g.asn1={});(typeof g.asn1.ocsp>"u"||!g.asn1.ocsp)&&(g.asn1.ocsp={});g.asn1.ocsp.DEFAULT_HASH="sha1";g.asn1.ocsp.OCSPResponse=function(e){g.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);var t=g.asn1.DEREnumerated,r=g.asn1.ASN1Util.newObject,n=g.asn1.ocsp.ResponseBytes,s=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var u=this.params.resstatus;return typeof u=="number"?u:typeof u!="string"?-1:s.indexOf(u)},this.setByParam=function(u){this.params=u},this.tohex=function(){var u=this.params,i=this._getStatusCode();if(i==-1)throw new Error("responseStatus not supported: "+u.resstatus);if(i!=0)return r({seq:[{enum:{int:i}}]}).tohex();var o=new n(u);return r({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:o}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.OCSPResponse,g.asn1.ASN1Object);g.asn1.ocsp.ResponseBytes=function(e){g.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=g.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,s=t.DEROctetString,u=t.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(i){this.params=i},this.tohex=function(){var i=this.params;if(i.restype!="ocspBasic")throw new Error("not supported responseType: "+i.restype);var o=new u(i),l=[];l.push(new n({name:"ocspBasic"})),l.push(new s({hex:o.tohex()}));var f=new r({array:l});return f.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.ResponseBytes,g.asn1.ASN1Object);g.asn1.ocsp.BasicOCSPResponse=function(e){g.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,r=g.asn1,n=r.ASN1Object,s=r.DERSequence,u=r.DERGeneralizedTime,i=r.DERTaggedObject,o=r.DERBitString,l=r.x509.Extensions,f=r.x509.AlgorithmIdentifier,d=r.ocsp,E=d.ResponderID;_SingleResponseList=d.SingleResponseList,_ResponseData=d.ResponseData,this.params=null,this.setByParam=function(p){this.params=p},this.sign=function(){var p=this.params,h=p.tbsresp.tohex(),w=new g.crypto.Signature({alg:p.sigalg});w.init(p.reskey),w.updateHex(h),p.sighex=w.sign()},this.tohex=function(){var p=this.params;p.tbsresp==null&&(p.tbsresp=new _ResponseData(p)),p.sighex==null&&p.reskey!=null&&this.sign();var h=[];if(h.push(p.tbsresp),h.push(new f({name:p.sigalg})),h.push(new o({hex:"00"+p.sighex})),p.certs!=null&&p.certs.length!=null){for(var w=[],v=0;v<p.certs.length;v++){var D=p.certs[v],A=null;if(De.isASN1HEX(D))A=D;else if(D.match(/-----BEGIN/))A=pr(D);else throw new t("certs["+v+"] not hex or PEM");w.push(new n({tlv:A}))}var F=new s({array:w});h.push(new i({tag:"a0",explicit:!0,obj:F}))}var S=new s({array:h});return S.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.BasicOCSPResponse,g.asn1.ASN1Object);g.asn1.ocsp.ResponseData=function(e){g.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,r=g.asn1,n=r.DERSequence,s=r.DERGeneralizedTime,u=r.DERTaggedObject,i=r.x509.Extensions,o=r.ocsp,l=o.ResponderID;_SingleResponseList=o.SingleResponseList,this.params=null,this.tohex=function(){var f=this.params;f.respid!=null&&new t("respid not specified"),f.prodat!=null&&new t("prodat not specified"),f.array!=null&&new t("array not specified");var d=[];if(d.push(new l(f.respid)),d.push(new s(f.prodat)),d.push(new _SingleResponseList(f.array)),f.ext!=null){var E=new i(f.ext);d.push(new u({tag:"a1",explicit:!0,obj:E}))}var p=new n({array:d});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(f){this.params=f},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.ResponseData,g.asn1.ASN1Object);g.asn1.ocsp.ResponderID=function(e){g.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=g,r=t.asn1,n=r.ASN1Util.newObject,s=r.x509.X500Name,u=t.lang.String.isHex,i=Error;this.params=null,this.tohex=function(){var o=this.params;if(o.key!=null){var l=null;if(typeof o.key=="string"){if(u(o.key)&&(l=o.key),o.key.match(/-----BEGIN CERTIFICATE/)){var f=new Je(o.key),d=f.getExtSubjectKeyIdentifier();d!=null&&(l=d.kid.hex)}}else if(o.key instanceof Je){var d=o.key.getExtSubjectKeyIdentifier();d!=null&&(l=d.kid.hex)}if(l==null)throw new i("wrong key member value");var E=n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:l}}}});return E.tohex()}else if(o.name!=null){var p=null;if(typeof o.name=="string"&&o.name.match(/-----BEGIN CERTIFICATE/)){var f=new Je(o.name);p=f.getSubject()}else o.name instanceof Je?p=o.name.getSubject():typeof o.name=="object"&&(o.name.array!=null||o.name.str!=null)&&(p=o.name);if(p==null)throw new i("wrong name member value");var E=n({tag:{tag:"a1",explicit:!0,obj:new s(p)}});return E.tohex()}throw new i("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(o){this.params=o},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.ResponderID,g.asn1.ASN1Object);g.asn1.ocsp.SingleResponseList=function(e){g.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=g.asn1,r=t.DERSequence,n=t.ocsp.SingleResponse;this.params=null,this.tohex=function(){var s=this.params;if(typeof s!="object"||s.length==null)throw new Error("params not specified properly");for(var u=[],i=0;i<s.length;i++)u.push(new n(s[i]));var o=new r({array:u});return o.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(s){this.params=s},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.SingleResponseList,g.asn1.ASN1Object);g.asn1.ocsp.SingleResponse=function(e){var t=Error,r=g,n=r.asn1,s=n.DERSequence,u=n.DERGeneralizedTime,i=n.DERTaggedObject,o=n.ocsp,l=o.CertID,f=o.CertStatus,d=n.x509,E=d.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params,h=[];if(p.certid==null)throw new t("certid unspecified");if(p.status==null)throw new t("status unspecified");if(p.thisupdate==null)throw new t("thisupdate unspecified");if(h.push(new l(p.certid)),h.push(new f(p.status)),h.push(new u(p.thisupdate)),p.nextupdate!=null){var w=new u(p.nextupdate);h.push(new i({tag:"a0",explicit:!0,obj:w}))}if(p.ext!=null){var v=new E(p.ext);h.push(new i({tag:"a1",explicit:!0,obj:v}))}var D=new s({array:h});return D.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(p){this.params=p},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.SingleResponse,g.asn1.ASN1Object);g.asn1.ocsp.CertID=function(e){var t=g,r=t.asn1,n=r.DEROctetString,s=r.DERInteger,u=r.DERSequence,i=r.x509,o=i.AlgorithmIdentifier,l=r.ocsp,f=l.DEFAULT_HASH,d=t.crypto,E=d.Util.hashHex,p=Je,h=De,w=h.getVbyList;l.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(v,D,A,F){F==null&&(F=this.DEFAULT_HASH),this.params={alg:F,issname:v,isskey:D,sbjsn:A}},this.setByCert=function(v,D,A){A==null&&(A=this.DEFAULT_HASH),this.params={alg:A,issuerCert:v,subjectCert:D}},this.getParamByCerts=function(v,D,A){A==null&&(A=this.DEFAULT_HASH);var F=new p(v),S=new p(D),B=E(F.getSubjectHex(),A),_=F.getPublicKeyHex(),K=E(w(_,0,[1],"03",!0),A),G=S.getSerialNumberHex(),b={alg:A,issname:B,isskey:K,sbjsn:G};return b},this.tohex=function(){if(typeof this.params!="object")throw new Error("params not set");var v=this.params,D,A,F,S;if(v.alg==null?S=this.DEFAULT_HASH:S=v.alg,v.issuerCert!=null&&v.subjectCert!=null){var B=this.getParamByCerts(v.issuerCert,v.subjectCert,S);D=B.issname,A=B.isskey,F=B.sbjsn}else if(v.issname!=null&&v.isskey!=null&&v.sbjsn!=null)D=v.issname,A=v.isskey,F=v.sbjsn;else throw new Error("required param members not defined");var _=new o({name:S}),K=new n({hex:D}),G=new n({hex:A}),b=new s({hex:F}),P=new u({array:[_,K,G,b]});return this.hTLV=P.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.CertID,g.asn1.ASN1Object);g.asn1.ocsp.CertStatus=function(e){g.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(t.status=="good")return"8000";if(t.status=="unknown")return"8200";if(t.status=="revoked"){var r=[{gentime:{str:t.time}}];t.reason!=null&&r.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:r}};return g.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},e!==void 0&&this.setByParam(e)};de(g.asn1.ocsp.CertStatus,g.asn1.ASN1Object);g.asn1.ocsp.Request=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.ocsp;if(s.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var i=[];if(this.dReqCert===null)throw"reqCert not set";i.push(this.dReqCert);var o=new n({array:i});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},typeof e<"u"){var u=new s.CertID(e);this.dReqCert=u}};de(g.asn1.ocsp.Request,g.asn1.ASN1Object);g.asn1.ocsp.TBSRequest=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.ocsp;s.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(u){for(var i=[],o=0;o<u.length;o++){var l=new s.Request(u[0]);i.push(l)}this.dRequestList=i},this.tohex=function(){var u=[];if(this.version!==0)throw"not supported version: "+this.version;if(this.dRequestorName!==null)throw"requestorName not supported";var i=new n({array:this.dRequestList});if(u.push(i),this.dRequestExt!==null)throw"requestExtensions not supported";var o=new n({array:u});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0&&this.setRequestListByParam(e.reqList)};de(g.asn1.ocsp.TBSRequest,g.asn1.ASN1Object);g.asn1.ocsp.OCSPRequest=function(e){var t=g,r=t.asn1,n=r.DERSequence,s=r.ocsp;if(s.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var i=[];if(this.dTbsRequest!==null)i.push(this.dTbsRequest);else throw"tbsRequest not set";if(this.dOptionalSignature!==null)throw"optionalSignature not supported";var o=new n({array:i});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0){var u=new s.TBSRequest(e);this.dTbsRequest=u}};de(g.asn1.ocsp.OCSPRequest,g.asn1.ASN1Object);g.asn1.ocsp.OCSPUtil={};g.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,r){var n=g,s=n.asn1,u=s.ocsp;r===void 0&&(r=u.DEFAULT_HASH);var i={alg:r,issuerCert:e,subjectCert:t},o=new u.OCSPRequest({reqList:[i]});return o.tohex()};g.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=De,r=t.getVbyList,n=t.getVbyListEx,s=t.getIdxbyList,u=t.getIdxbyListEx,i=t.getV,o={};try{var l=n(e,0,[0],"0a");o.responseStatus=parseInt(l,16)}catch{}if(o.responseStatus!==0)return o;try{var f=s(e,0,[1,0,1,0,0,2,0,1]);e.substr(f,2)==="80"?o.certStatus="good":e.substr(f,2)==="a1"?(o.certStatus="revoked",o.revocationTime=qt(r(e,f,[0]))):e.substr(f,2)==="82"&&(o.certStatus="unknown")}catch{}try{var d=s(e,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=qt(i(e,d))}catch{}try{var E=s(e,0,[1,0,1,0,0,2,0,3]);e.substr(E,2)==="a0"&&(o.nextUpdate=qt(r(e,E,[0])))}catch{}return o};g.asn1.ocsp.OCSPParser=function(){var e=Error,t=Je,r=new t,n=De,s=n.getV,u=n.getTLV,i=n.getIdxbyList,o=n.getVbyList,l=n.getTLVbyList,f=n.getVbyListEx,d=n.getTLVbyListEx,E=n.getChildIdx;this.getOCSPRequest=function(p){var h=E(p,0);if(h.length!=1&&h.length!=2)throw new e("wrong number elements: "+h.length);var w=this.getTBSRequest(u(p,h[0]));return w},this.getTBSRequest=function(p){var h={},w=d(p,0,[0],"30");h.array=this.getRequestList(w);var v=d(p,0,["[2]",0],"30");return v!=null&&(h.ext=r.getExtParamArray(v)),h},this.getRequestList=function(p){for(var h=[],w=E(p,0),v=0;v<w.length;v++){var p=u(p,w[v]);h.push(this.getRequest(p))}return h},this.getRequest=function(p){var h=E(p,0);if(h.length!=1&&h.length!=2)throw new e("wrong number elements: "+h.length);var w=this.getCertID(u(p,h[0]));if(h.length==2){var v=i(p,0,[1,0]);w.ext=r.getExtParamArray(u(p,v))}return w},this.getCertID=function(p){var h=E(p,0);if(h.length!=4)throw new e("wrong number elements: "+h.length);var w=new t,v={};return v.alg=w.getAlgorithmIdentifierName(u(p,h[0])),v.issname=s(p,h[1]),v.isskey=s(p,h[2]),v.sbjsn=s(p,h[3]),v},this.getOCSPResponse=function(p){var h=E(p,0),w,v=s(p,h[0]),D=parseInt(v);if(h.length==1)return{resstatus:D};var A=l(p,0,[1,0]);return w=this.getResponseBytes(A),w.resstatus=D,w},this.getResponseBytes=function(p){var h=E(p,0),w,v=l(p,0,[1,0]);w=this.getBasicOCSPResponse(v);var D=s(p,h[0]);return w.restype=g.asn1.x509.OID.oid2name(Zf(D)),w},this.getBasicOCSPResponse=function(p){var h=E(p,0),w;w=this.getResponseData(u(p,h[0]));var v=new Je;w.alg=v.getAlgorithmIdentifierName(u(p,h[1]));var D=s(p,h[2]);w.sighex=D.substr(2);var A=f(p,0,["[0]"]);if(A!=null){for(var F=E(A,0),S=[],B=0;B<F.length;B++){var _=u(A,F[B]);S.push(_)}w.certs=S}return w},this.getResponseData=function(p){var h=E(p,0),w=h.length,v={},D=0;p.substr(h[0],2)=="a0"&&D++,v.respid=this.getResponderID(u(p,h[D++]));var A=s(p,h[D++]);if(v.prodat=qt(A),v.array=this.getSingleResponseList(u(p,h[D++])),p.substr(h[w-1],2)=="a1"){var F=l(p,h[w-1],[0]),S=new Je;v.ext=S.getExtParamArray(F)}return v},this.getResponderID=function(p){var h={};if(p.substr(0,2)=="a2"){var w=o(p,0,[0]);h.key=w}if(p.substr(0,2)=="a1"){var v=l(p,0,[0]),D=new Je;h.name=D.getX500Name(v)}return h},this.getSingleResponseList=function(p){for(var h=E(p,0),w=[],v=0;v<h.length;v++){var D=this.getSingleResponse(u(p,h[v]));w.push(D)}return w},this.getSingleResponse=function(p){var h=E(p,0),w={},v=this.getCertID(u(p,h[0]));w.certid=v;var D=this.getCertStatus(u(p,h[1]));if(w.status=D,p.substr(h[2],2)=="18"){var A=s(p,h[2]);w.thisupdate=qt(A)}for(var F=3;F<h.length;F++){if(p.substr(h[F],2)=="a0"){var S=o(p,h[F],[0],"18");w.nextupdate=qt(S)}if(p.substr(h[F],2)=="a1"){var B=new Je,_=l(p,0,[F,0]);w.ext=B.getExtParamArray(_)}}return w},this.getCertStatus=function(p){var h={};if(p=="8000")return{status:"good"};if(p=="8200")return{status:"unknown"};if(p.substr(0,2)=="a1"){h.status="revoked";var w=o(p,0,[0]),v=qt(w);h.time=v}return h}};var g;(typeof g>"u"||!g)&&(g={});(typeof g.lang>"u"||!g.lang)&&(g.lang={});g.lang.String=function(){};function Y2(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function W2(e){for(var t="",r=0;r<e.length;r++)t=t+String.fromCharCode(e[r]);return t}function Gf(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);n.length==1&&(n="0"+n),t=t+n}return t}function ti(e){return Gf(Y2(e))}function L9(e){return lu(ti(e))}function U9(e){return Mo(lu(ti(e)))}function H9(e){return W2(M2(qc(e)))}function Mo(e){return e=e.replace(/\=/g,""),e=e.replace(/\+/g,"-"),e=e.replace(/\//g,"_"),e}function qc(e){return e.length%4==2?e=e+"==":e.length%4==3&&(e=e+"="),e=e.replace(/-/g,"+"),e=e.replace(/_/g,"/"),e}function jr(e){return e.length%2==1&&(e="0"+e),Mo(lu(e))}function ar(e){return qo(qc(e))}var jc,Qi;typeof Buffer=="function"?(jc=function(e){return Mo(Buffer.from(e,"utf8").toString("base64"))},Qi=function(e){return Buffer.from(qc(e),"base64").toString("utf8")}):(jc=function(e){return jr(Wf(Xf(e)))},Qi=function(e){return decodeURIComponent(Jf(ar(e)))});function j9(e){return lu(Wf(Xf(e)))}function M9(e){return decodeURIComponent(Jf(qo(e)))}function zf(e){return Wf(Xf(e)).toLowerCase()}function qt(e){try{return decodeURIComponent(Jf(e))}catch{return null}}function q9(e){return qt(K9(e))}function K9(e){for(var t=e.match(/.{1,2}/g),r=[],n=0;n<t.length;n++){var s=parseInt(t[n],16);161<=s&&s<=191?(r.push("c2"),r.push(t[n])):192<=s&&s<=255?(r.push("c3"),r.push((s-64).toString(16))):r.push(t[n])}return r.join("")}function ri(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Bs(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function Gp(e){return lu(e)}function V9(e){return Yf(Gp(e),64)}function Yf(e,t){return e=e.replace(new RegExp("(.{"+t+"})","g"),`$1\r
`),e=e.replace(/\s+$/,""),e}function J2(e){var t=e.replace(/[^0-9A-Za-z\/+=]*/g,""),r=qo(t);return r}function G9(e,t){return"-----BEGIN "+t+`-----\r
`+Yf(e,64)+`\r
-----END `+t+`-----\r
`}function yn(e,t){return"-----BEGIN "+t+`-----\r
`+Yf(Gp(e),64)+`\r
-----END `+t+`-----\r
`}function pr(e,t){if(e.indexOf("-----BEGIN ")==-1)throw new Error("can't find PEM header");return t!==void 0?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),e=e.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,""),e=e.replace(/-----END [^-]+-----[^]*$/,"")),J2(e)}function z9(e){return e.indexOf("-----BEGIN ")==-1||e.indexOf("-----END ")==-1?null:(e=e.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,""),e=e.replace(/-----END [\s\S]+$/m,""),e=e.replace(/\s+/g,""),e.match(/^[0-9a-zA-Z+/=]+$/)?e:null)}function Y9(e){if(e.length%2!=0)throw"input is not even length";if(e.match(/^[0-9A-Fa-f]+$/)==null)throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),r=new DataView(t),n=0;n<e.length/2;n++)r.setUint8(n,parseInt(e.substr(n*2,2),16));return t}function W9(e){for(var t="",r=new DataView(e),n=0;n<e.byteLength;n++)t+=("00"+r.getUint8(n).toString(16)).slice(-2);return t}function zp(e){var t,r,n,s,u,i,o,l,f,d,E,p;if(e=Z2(e),p=e.match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/),p)return t=parseInt(p[1]),r=parseInt(p[2])-1,n=parseInt(p[3]),s=parseInt(p[4]),u=parseInt(p[5]),i=parseInt(p[6]),o=0,d=p[7],d!==""&&(E=(d.substr(1)+"00").substr(0,3),o=parseInt(E)),Date.UTC(t,r,n,s,u,i,o);throw new Error("unsupported zulu format: "+e)}function J9(e){var t=new Date(e),r=("0000"+t.getUTCFullYear()).slice(-4),n=("00"+(t.getUTCMonth()+1)).slice(-2),s=("00"+t.getUTCDate()).slice(-2),u=("00"+t.getUTCHours()).slice(-2),i=("00"+t.getUTCMinutes()).slice(-2),o=("00"+t.getUTCSeconds()).slice(-2),l=("000"+t.getUTCMilliseconds()).slice(-3);return l=l.replace(/0+$/,""),l=l!=""?"."+l:l,r+n+s+u+i+o+l+"Z"}function X2(e){return Math.round(zp(e)/1e3)}function X9(e){return new Date(zp(e))}function Z9(e,t,r){var n,s=e.getUTCFullYear();if(t){if(s<1950||2049<s)throw"not proper year for UTCTime: "+s;n=(""+s).slice(-2)}else n=("000"+s).slice(-4);if(n+=("0"+(e.getUTCMonth()+1)).slice(-2),n+=("0"+e.getUTCDate()).slice(-2),n+=("0"+e.getUTCHours()).slice(-2),n+=("0"+e.getUTCMinutes()).slice(-2),n+=("0"+e.getUTCSeconds()).slice(-2),r){var u=e.getUTCMilliseconds();u!==0&&(u=("00"+u).slice(-3),u=u.replace(/0+$/g,""),n+="."+u)}return n+="Z",n}function Z2(e){return e.match(/^[0-9]{12}Z$/)||e.match(/^[0-9]{12}[.][0-9]*Z$/)?e.match(/^[0-4]/)?"20"+e:"19"+e:e}function Wf(e){return e.replace(/%/g,"")}function Jf(e){return e.replace(/(..)/g,"%$1")}function Up(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;e=e.toLowerCase();var r=e.split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2);e=e.replace("::",n);var s=e.split(":");if(s.length!=8)throw t;for(var u=0;u<8;u++)s[u]=("0000"+s[u]).slice(-4);return s.join("")}function Hp(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+e);e=e.toLowerCase();var t=e.match(/.{1,4}/g);t=t.map(function(s){return s.replace(/^0+/,"")}),t=t.map(function(s){return s==""?"0":s}),e=":"+t.join(":")+":";var r=e.match(/:(0:){2,}/g);if(r==null)return e.slice(1,-1);var n=r.sort().slice(-1)[0];return e=e.replace(n.substr(0,n.length-1),":"),e.substr(0,2)!="::"&&(e=e.substr(1)),e.substr(-2,2)!="::"&&(e=e.substr(0,e.length-1)),e}function jf(e){var t=new Error("malformed hex value");if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(e.length==8){var r;try{return r=parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16),r}catch{throw t}}else if(e.length==16)try{return jf(e.substr(0,8))+"/"+H2(e.substr(8))}catch{throw t}else{if(e.length==32)return Hp(e);if(e.length==64){try{return Hp(e.substr(0,32))+"/"+H2(e.substr(32))}catch{throw t}return}else return e}}function H2(e){var t=new Error("malformed mask"),r;try{r=new ee(e,16).toString(2)}catch{throw t}if(!r.match(/^1*0*$/))throw t;return r.replace(/0+$/,"").length}function Yp(e){var t=new Error("malformed IP address");if(e=e.toLowerCase(e),!e.match(/^[0-9a-f.:/]+$/))throw t;if(e.match(/^[0-9.]+$/)){var r=e.split(".");if(r.length!==4)throw t;var n="";try{for(var s=0;s<4;s++){var u=parseInt(r[s]);n+=("0"+u.toString(16)).slice(-2)}return n}catch{throw t}}else if(e.match(/^[0-9.]+\/[0-9]+$/)){var i=e.split("/");return Yp(i[0])+j2(parseInt(i[1]),32)}else{if(e.match(/^[0-9a-f:]+$/)&&e.indexOf(":")!==-1)return Up(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&e.indexOf(":")!==-1){var i=e.split("/");return Up(i[0])+j2(parseInt(i[1]),128)}else throw t}}function j2(e,t){if(t==32&&e==0)return"00000000";if(t==128&&e==0)return"00000000000000000000000000000000";var r=Array(e+1).join("1")+Array(t-e+1).join("0");return new ee(r,2).toString(16)}function Wp(e){function t(s){var u=parseInt(s.substr(0,2),16),i=parseInt(s.substr(2),16);if(u==0&i<128)return String.fromCharCode(i);if(u<8){var o=192|(u&7)<<3|(i&192)>>6,l=128|i&63;return qt(o.toString(16)+l.toString(16))}var o=224|(u&240)>>4,l=128|(u&15)<<2|(i&192)>>6,f=128|i&63;return qt(o.toString(16)+l.toString(16)+f.toString(16))}var r=e.match(/.{4}/g),n=r.map(t);return n.join("")}function Xf(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)t[n]=="%"?(r=r+t.substr(n,3),n=n+2):r=r+"%"+ti(t[n]);return r}function Q9(e){return e=e.replace(/\r\n/mg,`
`),e}function eB(e){return e=e.replace(/\r\n/mg,`
`),e=e.replace(/\n/mg,`\r
`),e}g.lang.String.isInteger=function(e){return e.match(/^[0-9]+$/)?!0:!!e.match(/^-[0-9]+$/)};g.lang.String.isHex=function(e){return Q2(e)};function Q2(e){return!!(e.length%2==0&&(e.match(/^[0-9a-f]+$/)||e.match(/^[0-9A-F]+$/)))}g.lang.String.isBase64=function(e){return e=e.replace(/\s+/g,""),!!(e.match(/^[0-9A-Za-z+\/]+={0,3}$/)&&e.length%4==0)};g.lang.String.isBase64URL=function(e){return e.match(/[+/=]/)?!1:(e=qc(e),g.lang.String.isBase64(e))};function Jp(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}g.lang.String.isIntegerArray=function(e){return e=e.replace(/\s+/g,""),!!e.match(/^\[[0-9,]+\]$/)};g.lang.String.isPrintable=function(e){return e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null};g.lang.String.isIA5=function(e){return e.match(/^[\x20-\x21\x23-\x7f]*$/)!==null};g.lang.String.isMail=function(e){return e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function jp(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}function tB(e){e=e.replace(/^\s*\[\s*/,""),e=e.replace(/\s*\]\s*$/,""),e=e.replace(/\s*/g,"");try{var t=e.split(/,/).map(function(r,n,s){var u=parseInt(r);if(u<0||255<u)throw"integer not in range 0-255";var i=("00"+u.toString(16)).slice(-2);return i}).join("");return t}catch(r){throw"malformed integer array string: "+r}}var rB=function(e,t){var r=e.length;e.length>t.length&&(r=t.length);for(var n=0;n<r;n++)if(e.charCodeAt(n)!=t.charCodeAt(n))return n;return e.length!=t.length?r:-1};function eA(e){var t=function(o){var l=o.toString(16);return l.length==1&&(l="0"+l),l},r=function(o){var l="",f=parseInt(o,10),d=f.toString(2),E=7-d.length%7;E==7&&(E=0);for(var p="",h=0;h<E;h++)p+="0";d=p+d;for(var h=0;h<d.length-1;h+=7){var w=d.substr(h,7);h!=d.length-7&&(w="1"+w),l+=t(parseInt(w,2))}return l};try{if(!e.match(/^[0-9.]+$/))return null;var n="",s=e.split("."),u=parseInt(s[0],10)*40+parseInt(s[1],10);n+=t(u),s.splice(0,2);for(var i=0;i<s.length;i++)n+=r(s[i]);return n}catch{return null}}function Zf(e){if(!Q2(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var s=e.substr(2),u=[],i=0;i<s.length/2;i++)u.push(parseInt(s.substr(i*2,2),16));for(var o=[],l="",i=0;i<u.length;i++)u[i]&128?l=l+Mf((u[i]&127).toString(2),7):(l=l+Mf((u[i]&127).toString(2),7),o.push(new String(parseInt(l,2))),l="");var f=t.join(".");return o.length>0&&(f=f+"."+o.join(".")),f}catch{return null}}function tA(e){var t=new ee(String(e),10);return Kc(t)}function Kc(e){var t=e.toString(16);if(t.substr(0,1)!="-")return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;var r=t.substr(1),n=r.length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var s="",u=0;u<n;u++)s+="f";var i=new ee(s,16),o=i.xor(e).add(ee.ONE);return t=o.toString(16).replace(/^-/,""),t}var Mf=function(e,t,r){return r==null&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};function rA(e){if(e.length%2!=0||(e=e.toLowerCase(),e.match(/^[0-9a-f]+$/)==null))return-1;try{var t=e.substr(0,2);if(t=="00")return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return-1;var n=e.substr(2),s=parseInt(n,16).toString(2);s=="0"&&(s="00000000"),s=s.slice(0,0-r);var u=parseInt(s,2);return u==NaN?-1:u}catch{return-1}}function nA(e){if(typeof e!="number"||e<0)return null;var t=Number(e).toString(2),r=8-t.length%8;r==8&&(r=0),t=t+Mf("",r,"0");var n=parseInt(t,2).toString(16);n.length%2==1&&(n="0"+n);var s="0"+r;return s+n}function iA(e){if(typeof e!="string"||e.length%2!=0||!e.match(/^[0-9a-f]+$/))return null;try{var t=parseInt(e.substr(0,2),16);if(t<0||7<t)return null;for(var r=e.substr(2),n="",s=0;s<r.length;s+=2){var u=r.substr(s,2),i=parseInt(u,16).toString(2);i=("0000000"+i).slice(-8),n+=i}return n.substr(0,n.length-t)}catch{return null}}function nB(e){if(typeof e!="string"||e.match(/^[01]+$/)==null)return null;try{var t=parseInt(e,2);return nA(t)}catch{return null}}function qf(e,t){for(var r=0,n=0;n<e.length;n++)r|=1<<t[e[n]];for(var s=r.toString(2),u="",n=s.length-1;n>=0;n--)u+=s[n];return u}function Xt(e,n,r){if(typeof e=="object"){for(var n=String(n).split("."),s=0;s<n.length&&e;s++){var u=n[s];u.match(/^[0-9]+$/)&&(u=parseInt(u)),e=e[u]}return e||e===!1?e:r}}function de(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}(typeof g>"u"||!g)&&(g={});(typeof g.crypto>"u"||!g.crypto)&&(g.crypto={});g.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:_e.algo.MD5,sha1:_e.algo.SHA1,sha224:_e.algo.SHA224,sha256:_e.algo.SHA256,sha384:_e.algo.SHA384,sha512:_e.algo.SHA512,ripemd160:_e.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(typeof this.DIGESTINFOHEAD[t]>"u")throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),s=r/4;if(n.length+22>s)throw"key is too short for SigAlg: keylen="+r+","+t;for(var u="0001",i="00"+n,o="",l=s-u.length-i.length,f=0;f<l;f+=2)o+="ff";var d=u+o+i;return d},this.hashString=function(e,t){var r=new g.crypto.MessageDigest({alg:t});return r.digestString(e)},this.hashHex=function(e,t){var r=new g.crypto.MessageDigest({alg:t});return r.digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof it||e instanceof g.crypto.DSA||e instanceof g.crypto.ECDSA}};g.crypto.Util.md5=function(e){var t=new g.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return t.digestString(e)};g.crypto.Util.ripemd160=function(e){var t=new g.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return t.digestString(e)};g.crypto.Util.SECURERANDOMGEN=new Go;g.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return g.crypto.Util.SECURERANDOMGEN.nextBytes(t),Gf(t)};g.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new ee(g.crypto.Util.getRandomHexOfNbytes(e),16)};g.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=(e-t)/8,n=new Array(r+1);return g.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],Gf(n)};g.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new ee(g.crypto.Util.getRandomHexOfNbits(e),16)};g.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=g.crypto.Util.getRandomBigIntegerOfNbits(t);if(e.compareTo(r)!=-1)return r}};g.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(r==1)throw"biMin is greater than biMax";if(r==0)return e;var n=t.subtract(e),s=g.crypto.Util.getRandomBigIntegerZeroToMax(n);return s.add(e)};g.crypto.MessageDigest=function(e){var t=null,r=null,n=null;this.setAlgAndProvider=function(s,u){if(s=g.crypto.MessageDigest.getCanonicalAlgName(s),s!==null&&u===void 0&&(u=g.crypto.Util.DEFAULTPROVIDER[s]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(s)!=-1&&u=="cryptojs"){try{this.md=g.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[s].create()}catch(i){throw"setAlgAndProvider hash alg set fail alg="+s+"/"+i}this.updateString=function(i){this.md.update(i)},this.updateHex=function(i){var o=_e.enc.Hex.parse(i);this.md.update(o)},this.digest=function(){var i=this.md.finalize();return i.toString(_e.enc.Hex)},this.digestString=function(i){return this.updateString(i),this.digest()},this.digestHex=function(i){return this.updateHex(i),this.digest()}}if(":sha256:".indexOf(s)!=-1&&u=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(i){throw"setAlgAndProvider hash alg set fail alg="+s+"/"+i}this.updateString=function(i){this.md.update(i)},this.updateHex=function(i){var o=sjcl.codec.hex.toBits(i);this.md.update(o)},this.digest=function(){var i=this.md.finalize();return sjcl.codec.hex.fromBits(i)},this.digestString=function(i){return this.updateString(i),this.digest()},this.digestHex=function(i){return this.updateHex(i),this.digest()}}},this.updateString=function(s){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(s){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(s){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(s){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},e!==void 0&&e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=g.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};g.crypto.MessageDigest.getCanonicalAlgName=function(e){return typeof e=="string"&&(e=e.toLowerCase(),e=e.replace(/-/,"")),e};g.crypto.MessageDigest.getHashLength=function(e){var t=g.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(t.HASHLENGTH[r]===void 0)throw"not supported algorithm: "+e;return t.HASHLENGTH[r]};g.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};g.crypto.Mac=function(e){var t=null,r=null,n=null,s=null,u=null;this.setAlgAndProvider=function(i,o){if(i=i.toLowerCase(),i==null&&(i="hmacsha1"),i=i.toLowerCase(),i.substr(0,4)!="hmac")throw"setAlgAndProvider unsupported HMAC alg: "+i;o===void 0&&(o=g.crypto.Util.DEFAULTPROVIDER[i]),this.algProv=i+"/"+o;var l=i.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(l)!=-1&&o=="cryptojs"){try{var f=g.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[l];this.mac=_e.algo.HMAC.create(f,this.pass)}catch(d){throw"setAlgAndProvider hash alg set fail hashAlg="+l+"/"+d}this.updateString=function(d){this.mac.update(d)},this.updateHex=function(d){var E=_e.enc.Hex.parse(d);this.mac.update(E)},this.doFinal=function(){var d=this.mac.finalize();return d.toString(_e.enc.Hex)},this.doFinalString=function(d){return this.updateString(d),this.doFinal()},this.doFinalHex=function(d){return this.updateHex(d),this.doFinal()}}},this.updateString=function(i){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(i){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(i){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(i){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(i){if(typeof i=="string"){var o=i;(i.length%2==1||!i.match(/^[0-9A-Fa-f]+$/))&&(o=Bs(i)),this.pass=_e.enc.Hex.parse(o);return}if(typeof i!="object")throw"KJUR.crypto.Mac unsupported password type: "+i;var o=null;if(i.hex!==void 0){if(i.hex.length%2!=0||!i.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+i.hex;o=i.hex}if(i.utf8!==void 0&&(o=zf(i.utf8)),i.rstr!==void 0&&(o=Bs(i.rstr)),i.b64!==void 0&&(o=qo(i.b64)),i.b64u!==void 0&&(o=ar(i.b64u)),o==null)throw"KJUR.crypto.Mac unsupported password type: "+i;this.pass=_e.enc.Hex.parse(o)},e!==void 0&&(e.pass!==void 0&&this.setPassword(e.pass),e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=g.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))};g.crypto.Signature=function(e){var t=null,r=null,n=null,s=null,u=null,i=null,o=null,l=null,f=null,d=null,E=-1,p=null,h=null,w=null,v=null,D=null;if(this._setAlgNames=function(){var A=this.algName.match(/^(.+)with(.+)$/);A&&(this.mdAlgName=A[1].toLowerCase(),this.pubkeyAlgName=A[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(A,F){for(var S="",B=F/4-A.length,_=0;_<B;_++)S=S+"0";return S+A},this.setAlgAndProvider=function(A,F){if(this._setAlgNames(),F!="cryptojs/jsrsa")throw new Error("provider not supported: "+F);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new g.crypto.MessageDigest({alg:this.mdAlgName})}catch(S){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+S)}this.init=function(S,B){var _=null;try{B===void 0?_=Et.getKey(S):_=Et.getKey(S,B)}catch(K){throw"init failed:"+K}if(_.isPrivate===!0)this.prvKey=_,this.state="SIGN";else if(_.isPublic===!0)this.pubKey=_,this.state="VERIFY";else throw"init failed.:"+_},this.updateString=function(S){this.md.updateString(S)},this.updateHex=function(S){this.md.updateHex(S)},this.sign=function(){if(this.sHashHex=this.md.digest(),this.prvKey===void 0&&this.ecprvhex!==void 0&&this.eccurvename!==void 0&&g.crypto.ECDSA!==void 0&&(this.prvKey=new g.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof it&&this.pubkeyAlgName==="rsaandmgf1")this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof it&&this.pubkeyAlgName==="rsa")this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof g.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else if(this.prvKey instanceof g.crypto.DSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;return this.hSign},this.signString=function(S){return this.updateString(S),this.sign()},this.signHex=function(S){return this.updateHex(S),this.sign()},this.verify=function(S){if(this.sHashHex=this.md.digest(),this.pubKey===void 0&&this.ecpubhex!==void 0&&this.eccurvename!==void 0&&g.crypto.ECDSA!==void 0&&(this.pubKey=new g.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof it&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,S,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof it&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,S);if(g.crypto.ECDSA!==void 0&&this.pubKey instanceof g.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,S);if(g.crypto.DSA!==void 0&&this.pubKey instanceof g.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,S);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(A,F){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(A){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(A){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(A){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(A){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(A){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,e!==void 0&&(e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0?this.provName=g.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),e.psssaltlen!==void 0&&(this.pssSaltLen=e.psssaltlen),e.prvkeypem!==void 0)){if(e.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=Et.getKey(e.prvkeypem);this.init(t)}catch(A){throw"fatal error to load pem private key: "+A}}};g.crypto.Cipher=function(e){};g.crypto.Cipher.encrypt=function(e,t,r,n){if(Xt(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var s=t,u=e;Xt(n,"key")!=null&&(s=n.key),Xt(n,"enc")!=null&&(hEnc=n.enc);var i=_e.enc.Hex.parse(s),o=_e.enc.Hex.parse(u),l=_e.enc.Hex.parse(n.iv),f;if(r=="des-EDE3-CBC")f=_e.TripleDES.encrypt(o,i,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")f=_e.AES.encrypt(o,i,{iv:l});else throw new Error("unsupported algorithm: "+r);return f+""}else throw new Error("Cipher.encrypt: unsupported key or algorithm")};g.crypto.Cipher.decrypt=function(e,t,r,n){if(Xt(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var s=t,u=e;Xt(n,"key")!=null&&(s=n.key),Xt(n,"enc")!=null&&(u=n.enc);var i=_e.enc.Hex.parse(s),o=_e.enc.Hex.parse(u),l=_e.enc.Hex.parse(n.iv),f;if(r=="des-EDE3-CBC")f=_e.TripleDES.decrypt({ciphertext:o},i,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")f=_e.AES.decrypt({ciphertext:o},i,{iv:l});else throw new Error("unsupported algorithm: "+r);return _e.enc.Hex.stringify(f)}else throw new Error("Cipher.decrypt: unsupported key or algorithm")};g.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};(typeof g>"u"||!g)&&(g={});(typeof g.crypto>"u"||!g.crypto)&&(g.crypto={});g.crypto.ECDSA=function(e){var t="secp256r1",r=null,n=null,s=null,u=Error,i=ee,o=Ot,l=g.crypto.ECDSA,f=g.crypto.ECParameterDB,d=l.getName,E=De,p=E.getVbyListEx,h=E.isASN1HEX,w=new Go,v=null;this.type="EC",this.isPrivate=!1,this.isPublic=!1;function D(A,F,S,B){for(var _=Math.max(F.bitLength(),B.bitLength()),K=A.add2D(S),G=A.curve.getInfinity(),b=_-1;b>=0;--b)G=G.twice2D(),G.z=i.ONE,F.testBit(b)?B.testBit(b)?G=G.add2D(K):G=G.add2D(A):B.testBit(b)&&(G=G.add2D(S));return G}this.getBigRandom=function(A){return new i(A.bitLength(),w).mod(A.subtract(i.ONE)).add(i.ONE)},this.setNamedCurve=function(A){this.ecparams=f.getByName(A),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=A},this.setPrivateKeyHex=function(A){this.isPrivate=!0,this.prvKeyHex=A},this.setPublicKeyHex=function(A){this.isPublic=!0,this.pubKeyHex=A},this.getPublicKeyXYHex=function(){var A=this.pubKeyHex;if(A.substr(0,2)!=="04")throw"this method supports uncompressed format(04) only";var F=this.ecparams.keycharlen;if(A.length!==2+F*2)throw"malformed public key hex length";var S={};return S.x=A.substr(2,F),S.y=A.substr(2+F),S},this.getShortNISTPCurveName=function(){var A=this.curveName;return A==="secp256r1"||A==="NIST P-256"||A==="P-256"||A==="prime256v1"?"P-256":A==="secp384r1"||A==="NIST P-384"||A==="P-384"?"P-384":A==="secp521r1"||A==="NIST P-521"||A==="P-521"?"P-521":null},this.generateKeyPairHex=function(){var A=this.ecparams.n,F=this.getBigRandom(A),S=this.ecparams.keycharlen,B=("0000000000"+F.toString(16)).slice(-S);this.setPrivateKeyHex(B);var _=this.generatePublicKeyHex();return{ecprvhex:B,ecpubhex:_}},this.generatePublicKeyHex=function(){var A=new i(this.prvKeyHex,16),F=this.ecparams.G.multiply(A),S=F.getX().toBigInteger(),B=F.getY().toBigInteger(),_=this.ecparams.keycharlen,K=("0000000000"+S.toString(16)).slice(-_),G=("0000000000"+B.toString(16)).slice(-_),b="04"+K+G;return this.setPublicKeyHex(b),b},this.signWithMessageHash=function(A){return this.signHex(A,this.prvKeyHex)},this.signHex=function(A,F){var S=new i(F,16),B=this.ecparams.n,_=new i(A.substring(0,this.ecparams.keycharlen),16);do var K=this.getBigRandom(B),G=this.ecparams.G,b=G.multiply(K),P=b.getX().toBigInteger().mod(B);while(P.compareTo(i.ZERO)<=0);var L=K.modInverse(B).multiply(_.add(S.multiply(P))).mod(B);return l.biRSSigToASN1Sig(P,L)},this.sign=function(A,F){var S=F,B=this.ecparams.n,_=i.fromByteArrayUnsigned(A);do var K=this.getBigRandom(B),G=this.ecparams.G,b=G.multiply(K),P=b.getX().toBigInteger().mod(B);while(P.compareTo(ee.ZERO)<=0);var L=K.modInverse(B).multiply(_.add(S.multiply(P))).mod(B);return this.serializeSig(P,L)},this.verifyWithMessageHash=function(A,F){return this.verifyHex(A,F,this.pubKeyHex)},this.verifyHex=function(A,F,S){try{var B,_,K=l.parseSigHex(F);B=K.r,_=K.s;var G=o.decodeFromHex(this.ecparams.curve,S),b=new i(A.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(b,B,_,G)}catch{return!1}},this.verify=function(A,F,S){var B,_;if(Bitcoin.Util.isArray(F)){var K=this.parseSig(F);B=K.r,_=K.s}else if(typeof F=="object"&&F.r&&F.s)B=F.r,_=F.s;else throw"Invalid value for signature";var G;if(S instanceof Ot)G=S;else if(Bitcoin.Util.isArray(S))G=o.decodeFrom(this.ecparams.curve,S);else throw"Invalid format for pubkey value, must be byte array or ECPointFp";var b=i.fromByteArrayUnsigned(A);return this.verifyRaw(b,B,_,G)},this.verifyRaw=function(A,F,S,B){var _=this.ecparams.n,K=this.ecparams.G;if(F.compareTo(i.ONE)<0||F.compareTo(_)>=0||S.compareTo(i.ONE)<0||S.compareTo(_)>=0)return!1;var G=S.modInverse(_),b=A.multiply(G).mod(_),P=F.multiply(G).mod(_),L=K.multiply(b).add(B.multiply(P)),j=L.getX().toBigInteger().mod(_);return j.equals(F)},this.serializeSig=function(A,F){var S=A.toByteArraySigned(),B=F.toByteArraySigned(),_=[];return _.push(2),_.push(S.length),_=_.concat(S),_.push(2),_.push(B.length),_=_.concat(B),_.unshift(_.length),_.unshift(48),_},this.parseSig=function(A){var F;if(A[0]!=48)throw new Error("Signature not a valid DERSequence");if(F=2,A[F]!=2)throw new Error("First element in signature must be a DERInteger");var S=A.slice(F+2,F+2+A[F+1]);if(F+=2+A[F+1],A[F]!=2)throw new Error("Second element in signature must be a DERInteger");var B=A.slice(F+2,F+2+A[F+1]);F+=2+A[F+1];var _=i.fromByteArrayUnsigned(S),K=i.fromByteArrayUnsigned(B);return{r:_,s:K}},this.parseSigCompact=function(A){if(A.length!==65)throw"Signature has the wrong length";var F=A[0]-27;if(F<0||F>7)throw"Invalid signature type";var S=this.ecparams.n,B=i.fromByteArrayUnsigned(A.slice(1,33)).mod(S),_=i.fromByteArrayUnsigned(A.slice(33,65)).mod(S);return{r:B,s:_,i:F}},this.readPKCS5PrvKeyHex=function(A){if(h(A)===!1)throw new Error("not ASN.1 hex string");var F,S,B;try{F=p(A,0,["[0]",0],"06"),S=p(A,0,[1],"04");try{B=p(A,0,["[1]",0],"03")}catch{}}catch{throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=d(F),this.curveName===void 0)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(B),this.setPrivateKeyHex(S),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(A){if(h(A)===!1)throw new u("not ASN.1 hex string");var F,S,B,_;try{F=p(A,0,[1,0],"06"),S=p(A,0,[1,1],"06"),B=p(A,0,[2,0,1],"04");try{_=p(A,0,[2,0,"[1]",0],"03")}catch{}}catch{throw new u("malformed PKCS#8 plain ECC private key")}if(this.curveName=d(S),this.curveName===void 0)throw new u("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(_),this.setPrivateKeyHex(B),this.isPublic=!1},this.readPKCS8PubKeyHex=function(A){if(h(A)===!1)throw new u("not ASN.1 hex string");var F,S,B;try{F=p(A,0,[0,0],"06"),S=p(A,0,[0,1],"06"),B=p(A,0,[1],"03")}catch{throw new u("malformed PKCS#8 ECC public key")}if(this.curveName=d(S),this.curveName===null)throw new u("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(B)},this.readCertPubKeyHex=function(A,F){if(h(A)===!1)throw new u("not ASN.1 hex string");var S,B;try{S=p(A,0,[0,5,0,1],"06"),B=p(A,0,[0,5,1],"03")}catch{throw new u("malformed X.509 certificate ECC public key")}if(this.curveName=d(S),this.curveName===null)throw new u("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(B)},e!==void 0&&e.curve!==void 0&&(this.curveName=e.curve),this.curveName===void 0&&(this.curveName=t),this.setNamedCurve(this.curveName),e!==void 0&&(e.prv!==void 0&&this.setPrivateKeyHex(e.prv),e.pub!==void 0&&this.setPublicKeyHex(e.pub))};g.crypto.ECDSA.parseSigHex=function(e){var t=g.crypto.ECDSA.parseSigHexInHexRS(e),r=new ee(t.r,16),n=new ee(t.s,16);return{r,s:n}};g.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=De,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),e.substr(0,2)!="30")throw new Error("signature is not a ASN.1 sequence");var s=r(e,0);if(s.length!=2)throw new Error("signature shall have two elements");var u=s[0],i=s[1];if(e.substr(u,2)!="02")throw new Error("1st item not ASN.1 integer");if(e.substr(i,2)!="02")throw new Error("2nd item not ASN.1 integer");var o=n(e,u),l=n(e,i);return{r:o,s:l}};g.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=g.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");r.substr(0,2)=="00"&&(r=r.substr(2)),n.substr(0,2)=="00"&&(n=n.substr(2));var s=Math.max(r.length,n.length);return r=("000000"+r).slice(-s),n=("000000"+n).slice(-s),r+n}if(r.substr(0,2)=="00"&&r.length%32==2&&(r=r.substr(2)),n.substr(0,2)=="00"&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n};g.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return g.crypto.ECDSA.hexRSSigToASN1Sig(t,r)};g.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new ee(e,16),n=new ee(t,16);return g.crypto.ECDSA.biRSSigToASN1Sig(r,n)};g.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=g.asn1,n=new r.DERInteger({bigint:e}),s=new r.DERInteger({bigint:t}),u=new r.DERSequence({array:[n,s]});return u.tohex()};g.crypto.ECDSA.getName=function(e){return e==="2b8104001f"?"secp192k1":e==="2a8648ce3d030107"?"secp256r1":e==="2b8104000a"?"secp256k1":e==="2b81040021"?"secp224r1":e==="2b81040022"?"secp384r1":e==="2b81040023"?"secp521r1":"|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)!==-1?"secp256r1":"|secp256k1|".indexOf(e)!==-1?"secp256k1":"|secp224r1|NIST P-224|P-224|".indexOf(e)!==-1?"secp224r1":"|secp384r1|NIST P-384|P-384|".indexOf(e)!==-1?"secp384r1":"|secp521r1|NIST P-521|P-521|".indexOf(e)!==-1?"secp521r1":null};(typeof g>"u"||!g)&&(g={});(typeof g.crypto>"u"||!g.crypto)&&(g.crypto={});g.crypto.ECParameterDB=new function(){var e={},t={};function r(n){return new ee(n,16)}this.getByName=function(n){var s=n;if(typeof t[s]<"u"&&(s=t[n]),typeof e[s]<"u")return e[s];throw"unregistered EC curve name: "+s},this.regist=function(n,s,u,i,o,l,f,d,E,p,h,w){e[n]={};var v=r(u),D=r(i),A=r(o),F=r(l),S=r(f),B=new fu(v,D,A),_=B.decodePointHex("04"+d+E);e[n].name=n,e[n].keylen=s,e[n].keycharlen=Math.ceil(s/8)*2,e[n].curve=B,e[n].G=_,e[n].n=F,e[n].h=S,e[n].oid=h,e[n].info=w;for(var K=0;K<p.length;K++)t[p[K]]=n}};g.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field");g.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field");g.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field");g.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]);g.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]);g.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]);g.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]);g.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]);g.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]);g.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);(typeof g>"u"||!g)&&(g={});(typeof g.crypto>"u"||!g.crypto)&&(g.crypto={});g.crypto.DSA=function(){var e=De,t=e.getVbyList,r=e.getVbyListEx,n=e.isASN1HEX,s=ee;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(u,i,o,l,f){this.isPrivate=!0,this.p=u,this.q=i,this.g=o,this.y=l,this.x=f},this.setPrivateHex=function(u,i,o,l,f){var d,E,p,h,w;d=new ee(u,16),E=new ee(i,16),p=new ee(o,16),typeof l=="string"&&l.length>1?h=new ee(l,16):h=null,w=new ee(f,16),this.setPrivate(d,E,p,h,w)},this.setPublic=function(u,i,o,l){this.isPublic=!0,this.p=u,this.q=i,this.g=o,this.y=l,this.x=null},this.setPublicHex=function(u,i,o,l){var f,d,E,p;f=new ee(u,16),d=new ee(i,16),E=new ee(o,16),p=new ee(l,16),this.setPublic(f,d,E,p)},this.signWithMessageHash=function(u){var i=this.p,o=this.q,l=this.g,f=this.y,d=this.x,E=g.crypto.Util.getRandomBigIntegerMinToMax(ee.ONE.add(ee.ONE),o.subtract(ee.ONE)),p=u.substr(0,o.bitLength()/4),h=new ee(p,16),w=l.modPow(E,i).mod(o),v=E.modInverse(o).multiply(h.add(d.multiply(w))).mod(o),D=g.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:w}},{int:{bigint:v}}]});return D},this.verifyWithMessageHash=function(u,i){var o=this.p,l=this.q,f=this.g,d=this.y,E=this.parseASN1Signature(i),p=E[0],h=E[1],w=u.substr(0,l.bitLength()/4),v=new ee(w,16);if(ee.ZERO.compareTo(p)>0||p.compareTo(l)>0||ee.ZERO.compareTo(h)>=0||h.compareTo(l)>0)throw"invalid DSA signature";var D=h.modInverse(l),A=v.multiply(D).mod(l),F=p.multiply(D).mod(l),S=f.modPow(A,o).multiply(d.modPow(F,o)).mod(o).mod(l);return S.compareTo(p)==0},this.parseASN1Signature=function(u){try{var i=new s(r(u,0,[0],"02"),16),o=new s(r(u,0,[1],"02"),16);return[i,o]}catch{throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(u){var i,o,l,f,d;if(n(u)===!1)throw new Error("not ASN.1 hex string");try{i=r(u,0,[1],"02"),o=r(u,0,[2],"02"),l=r(u,0,[3],"02"),f=r(u,0,[4],"02"),d=r(u,0,[5],"02")}catch{throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(i,o,l,f,d)},this.readPKCS8PrvKeyHex=function(u){var i,o,l,f;if(n(u)===!1)throw new Error("not ASN.1 hex string");try{i=r(u,0,[1,1,0],"02"),o=r(u,0,[1,1,1],"02"),l=r(u,0,[1,1,2],"02"),f=r(u,0,[2,0],"02")}catch{throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(i,o,l,null,f)},this.readPKCS8PubKeyHex=function(u){var i,o,l,f;if(n(u)===!1)throw new Error("not ASN.1 hex string");try{i=r(u,0,[0,1,0],"02"),o=r(u,0,[0,1,1],"02"),l=r(u,0,[0,1,2],"02"),f=r(u,0,[1,0],"02")}catch{throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(i,o,l,f)},this.readCertPubKeyHex=function(u,i){var o,l,f,d;if(n(u)===!1)throw new Error("not ASN.1 hex string");try{o=r(u,0,[0,5,0,1,0],"02"),l=r(u,0,[0,5,0,1,1],"02"),f=r(u,0,[0,5,0,1,2],"02"),d=r(u,0,[0,5,1,0],"02")}catch{throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(o,l,f,d)}};var Et=function(){var e=function(v,D,A){return n(_e.AES,v,D,A)},t=function(v,D,A){return n(_e.TripleDES,v,D,A)},r=function(v,D,A){return n(_e.DES,v,D,A)},n=function(v,D,A,F){var S=_e.enc.Hex.parse(D),B=_e.enc.Hex.parse(A),_=_e.enc.Hex.parse(F),K={};K.key=B,K.iv=_,K.ciphertext=S;var G=v.decrypt(K,B,{iv:_});return _e.enc.Hex.stringify(G)},s=function(v,D,A){return o(_e.AES,v,D,A)},u=function(v,D,A){return o(_e.TripleDES,v,D,A)},i=function(v,D,A){return o(_e.DES,v,D,A)},o=function(v,D,A,F){var S=_e.enc.Hex.parse(D),B=_e.enc.Hex.parse(A),_=_e.enc.Hex.parse(F),K=v.encrypt(S,B,{iv:_}),G=_e.enc.Hex.parse(K.toString()),b=_e.enc.Base64.stringify(G);return b},l={"AES-256-CBC":{proc:e,eproc:s,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:s,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:s,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:u,keylen:24,ivlen:8},"DES-CBC":{proc:r,eproc:i,keylen:8,ivlen:8}},f=function(v){return l[v].proc},d=function(v){var D=_e.lib.WordArray.random(v),A=_e.enc.Hex.stringify(D);return A},E=function(v){var D={},A=v.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));A&&(D.cipher=A[1],D.ivsalt=A[2]);var F=v.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));F&&(D.type=F[1]);var S=-1,B=0;v.indexOf(`\r
\r
`)!=-1&&(S=v.indexOf(`\r
\r
`),B=2),v.indexOf(`
`)!=-1&&(S=v.indexOf(`
`),B=1);var _=v.indexOf("-----END");if(S!=-1&&_!=-1){var K=v.substring(S+B*2,_-B);K=K.replace(/\s+/g,""),D.data=K}return D},p=function(v,D,A){for(var F=A.substring(0,16),S=_e.enc.Hex.parse(F),B=_e.enc.Utf8.parse(D),_=l[v].keylen+l[v].ivlen,K="",G=null;;){var b=_e.algo.MD5.create();if(G!=null&&b.update(G),b.update(B),b.update(S),G=b.finalize(),K=K+_e.enc.Hex.stringify(G),K.length>=_*2)break}var P={};return P.keyhex=K.substr(0,l[v].keylen*2),P.ivhex=K.substr(l[v].keylen*2,l[v].ivlen*2),P},h=function(v,D,A,F){var S=_e.enc.Base64.parse(v),B=_e.enc.Hex.stringify(S),_=l[D].proc,K=_(B,A,F);return K},w=function(v,D,A,F){var S=l[D].eproc,B=S(v,A,F);return B};return{version:"1.0.0",parsePKCS5PEM:function(v){return E(v)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(v,D,A){return p(v,D,A)},decryptKeyB64:function(v,D,A,F){return h(v,D,A,F)},getDecryptedKeyHex:function(v,D){var A=E(v),F=A.type,S=A.cipher,B=A.ivsalt,_=A.data,K=p(S,D,B),G=K.keyhex,b=h(_,S,G,B);return b},getEncryptedPKCS5PEMFromPrvKeyHex:function(v,D,A,F,S){var L="";if((typeof F>"u"||F==null)&&(F="AES-256-CBC"),typeof l[F]>"u")throw new Error("KEYUTIL unsupported algorithm: "+F);if(typeof S>"u"||S==null){var B=l[F].ivlen,_=d(B);S=_.toUpperCase()}var K=p(F,A,S),G=K.keyhex,b=w(D,F,G,S),P=b.replace(/(.{64})/g,`$1\r
`),L="-----BEGIN "+v+` PRIVATE KEY-----\r
`;return L+=`Proc-Type: 4,ENCRYPTED\r
`,L+="DEK-Info: "+F+","+S+`\r
`,L+=`\r
`,L+=P,L+=`\r
-----END `+v+` PRIVATE KEY-----\r
`,L},getEncryptedPKCS8PEM:function(v,D,A){var F=this.getEncryptedPKCS8Hex(v,D,A);return yn(F,"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(v,D,A){var F;A==null||A==null?F={}:F=JSON.parse(JSON.stringify(A)),F.plain=v,this.initPBES2Param(F),this.encryptPBES2Param(F,D);var S=this.generatePBES2ASN1Param(F);return g.asn1.ASN1Util.newObject(S).tohex()},initPBES2Param:function(v){if(Xt(v,"encalg")==null&&(v.encalg="aes256-CBC"),Xt(v,"iter")==null&&(v.iter=2048),Xt(v,"prf")==null&&(v.prf="hmacWithSHA256"),Xt(v,"salt")==null&&(v.salt=_e.enc.Hex.stringify(_e.lib.WordArray.random(8))),Xt(v,"enciv")==null){var D;v.encalg=="des-EDE3-CBC"&&(D=8),v.encalg=="aes128-CBC"&&(D=16),v.encalg=="aes256-CBC"&&(D=16),v.enciv=_e.enc.Hex.stringify(_e.lib.WordArray.random(D))}},encryptPBES2Param:function(v,D){var A=Et.getDKFromPBES2Param(v,D);try{var F=g.crypto.Cipher.encrypt(v.plain,A,v.encalg,{iv:v.enciv})}catch{throw new Error("encrypt error: "+v.plain+" "+A+" "+v.encalg+" "+v.enciv)}v.enc=F},generatePBES2ASN1Param:function(v){var D={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:v.salt}},{int:{hex:tA(v.iter)}}]}]},{seq:[{oid:v.encalg},{octstr:{hex:v.enciv}}]}]}]},{octstr:{hex:v.enc}}]};return v.prf!="hmacWithSHA1"&&D.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:v.prf},{null:""}]}),D},parseHexOfEncryptedPKCS8:function(v){var D=De,A=D.getChildIdx,F=D.getV,S={},B=A(v,0);if(B.length!=2)throw new Error("malformed format: SEQUENCE(0).items != 2: "+B.length);S.ciphertext=F(v,B[1]);var _=A(v,B[0]);if(_.length!=2)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+_.length);if(F(v,_[0])!="2a864886f70d01050d")throw new Error("this only supports pkcs5PBES2");var K=A(v,_[1]);if(_.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+K.length);var G=A(v,K[1]);if(G.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+G.length);if(F(v,G[0])!="2a864886f70d0307")throw"this only supports TripleDES";S.encryptionSchemeAlg="TripleDES",S.encryptionSchemeIV=F(v,G[1]);var b=A(v,K[0]);if(b.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+b.length);if(F(v,b[0])!="2a864886f70d01050c")throw new Error("this only supports pkcs5PBKDF2");var P=A(v,b[1]);if(P.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+P.length);S.pbkdf2Salt=F(v,P[0]);var L=F(v,P[1]);try{S.pbkdf2Iter=parseInt(L,16)}catch{throw new Error("malformed format pbkdf2Iter: "+L)}return S},getPBKDF2KeyHexFromParam:function(v,D){var A=_e.enc.Hex.parse(v.pbkdf2Salt),F=v.pbkdf2Iter,S=_e.PBKDF2(D,A,{keySize:192/32,iterations:F}),B=_e.enc.Hex.stringify(S);return B},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(v,D){var A=pr(v,"ENCRYPTED PRIVATE KEY"),F=this.parseHexOfEncryptedPKCS8(A),S=Et.getPBKDF2KeyHexFromParam(F,D),B={};B.ciphertext=_e.enc.Hex.parse(F.ciphertext);var _=_e.enc.Hex.parse(S),K=_e.enc.Hex.parse(F.encryptionSchemeIV),G=_e.TripleDES.decrypt(B,_,{iv:K}),b=_e.enc.Hex.stringify(G);return b},parsePBES2:function(v){var D=De.parse(v);if(Xt(D,"seq.0.seq.0.oid")!="pkcs5PBES2"||Xt(D,"seq.0.seq.1.seq.0.seq.0.oid")!="pkcs5PBKDF2")throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var A=Xt(D,"seq.0.seq.1.seq.0.seq.1.seq");if(A==null)throw new Error("PBKDF2 parameter not found");var F=Xt(A,"0.octstr.hex"),S=Xt(A,"1.int.hex"),B=Xt(A,"2.seq.0.oid","hmacWithSHA1"),_=-1;try{_=parseInt(S,16)}catch{throw new Error("iter not proper value")}var K=Xt(D,"seq.0.seq.1.seq.1.seq.0.oid"),G=Xt(D,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),b=Xt(D,"seq.1.octstr.hex");if(K==null||G==null||b==null)throw new Error("encalg, enciv or enc is undefined");var P={salt:F,iter:_,prf:B,encalg:K,enciv:G,enc:b};return P},getDKFromPBES2Param:function(v,D){var A={hmacWithSHA1:_e.algo.SHA1,hmacWithSHA224:_e.algo.SHA224,hmacWithSHA256:_e.algo.SHA256,hmacWithSHA384:_e.algo.SHA384,hmacWithSHA512:_e.algo.SHA512},F={"des-EDE3-CBC":192/32,"aes128-CBC":128/32,"aes256-CBC":256/32},S=A[v.prf];if(S==null)throw new Error("unsupported prf");var B=F[v.encalg];if(B==null)throw new Error("unsupported encalg");var _=_e.enc.Hex.parse(v.salt),K=v.iter;try{var G=_e.PBKDF2(D,_,{keySize:B,iterations:K,hasher:S});return _e.enc.Hex.stringify(G)}catch(b){throw new Error("PBKDF2 error: "+b+" "+JSON.stringify(v)+" "+D)}},getPlainHexFromEncryptedPKCS8PEM:function(v,D){if(v.indexOf("BEGIN ENCRYPTED PRIVATE KEY")==-1)throw new Error("not Encrypted PKCS#8 PEM string");var A=pr(v),F;try{F=Et.parsePBES2(A)}catch(B){throw new Error("malformed PBES2 format: "+B.message)}var S=Et.getDKFromPBES2Param(F,D);return g.crypto.Cipher.decrypt(F.enc,S,F.encalg,{iv:F.enciv})},getKeyFromEncryptedPKCS8PEM:function(v,D){var A=this.getPlainHexFromEncryptedPKCS8PEM(v,D),F=this.getKeyFromPlainPrivatePKCS8Hex(A);return F},parsePlainPrivatePKCS8Hex:function(v){var D=De,A=D.getChildIdx,F=D.getV,S={};if(S.algparam=null,v.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var B=A(v,0);if(B.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(v.substr(B[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var _=A(v,B[1]);if(_.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(v.substr(_[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(S.algoid=F(v,_[0]),v.substr(_[1],2)=="06"&&(S.algparam=F(v,_[1])),v.substr(B[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return S.keyidx=D.getVidx(v,B[2]),S},getKeyFromPlainPrivatePKCS8PEM:function(v){var D=pr(v,"PRIVATE KEY"),A=this.getKeyFromPlainPrivatePKCS8Hex(D);return A},getKeyFromPlainPrivatePKCS8Hex:function(v){var D=this.parsePlainPrivatePKCS8Hex(v),A;if(D.algoid=="2a864886f70d010101")A=new it;else if(D.algoid=="2a8648ce380401")A=new g.crypto.DSA;else if(D.algoid=="2a8648ce3d0201")A=new g.crypto.ECDSA;else throw new Error("unsupported private key algorithm");return A.readPKCS8PrvKeyHex(v),A},_getKeyFromPublicPKCS8Hex:function(v){var D,A=De.getVbyList(v,0,[0,0],"06");if(A==="2a864886f70d010101")D=new it;else if(A==="2a8648ce380401")D=new g.crypto.DSA;else if(A==="2a8648ce3d0201")D=new g.crypto.ECDSA;else throw new Error("unsupported PKCS#8 public key hex");return D.readPKCS8PubKeyHex(v),D},parsePublicRawRSAKeyHex:function(v){var D=De,A=D.getChildIdx,F=D.getV,S={};if(v.substr(0,2)!="30")throw new Error("malformed RSA key(code:001)");var B=A(v,0);if(B.length!=2)throw new Error("malformed RSA key(code:002)");if(v.substr(B[0],2)!="02")throw new Error("malformed RSA key(code:003)");if(S.n=F(v,B[0]),v.substr(B[1],2)!="02")throw new Error("malformed RSA key(code:004)");return S.e=F(v,B[1]),S},parsePublicPKCS8Hex:function(v){var D=De,A=D.getChildIdx,F=D.getV,S={};S.algparam=null;var B=A(v,0);if(B.length!=2)throw new Error("outer DERSequence shall have 2 elements: "+B.length);var _=B[0];if(v.substr(_,2)!="30")throw new Error("malformed PKCS8 public key(code:001)");var K=A(v,_);if(K.length!=2)throw new Error("malformed PKCS8 public key(code:002)");if(v.substr(K[0],2)!="06")throw new Error("malformed PKCS8 public key(code:003)");if(S.algoid=F(v,K[0]),v.substr(K[1],2)=="06"?S.algparam=F(v,K[1]):v.substr(K[1],2)=="30"&&(S.algparam={},S.algparam.p=D.getVbyList(v,K[1],[0],"02"),S.algparam.q=D.getVbyList(v,K[1],[1],"02"),S.algparam.g=D.getVbyList(v,K[1],[2],"02")),v.substr(B[1],2)!="03")throw new Error("malformed PKCS8 public key(code:004)");return S.key=F(v,B[1]).substr(2),S}}}();Et.getKey=function(e,t,r){var n=De,s=n.getChildIdx,u=n.getV,i=n.getVbyList,o=g.crypto,l=o.ECDSA,f=o.DSA,d=it,E=pr,p=Et;if(typeof d<"u"&&e instanceof d||typeof l<"u"&&e instanceof l||typeof f<"u"&&e instanceof f)return e;if(e.curve!==void 0&&e.xy!==void 0&&e.d===void 0)return new l({pub:e.xy,curve:e.curve});if(e.curve!==void 0&&e.d!==void 0)return new l({prv:e.d,curve:e.curve});if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d===void 0){var h=new d;return h.setPublic(e.n,e.e),h}if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.co!==void 0&&e.qi===void 0){var h=new d;return h.setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),h}if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p===void 0){var h=new d;return h.setPrivate(e.n,e.e,e.d),h}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x===void 0){var h=new f;return h.setPublic(e.p,e.q,e.g,e.y),h}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x!==void 0){var h=new f;return h.setPrivate(e.p,e.q,e.g,e.y,e.x),h}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d===void 0){var h=new d;return h.setPublic(ar(e.n),ar(e.e)),h}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.qi!==void 0){var h=new d;return h.setPrivateEx(ar(e.n),ar(e.e),ar(e.d),ar(e.p),ar(e.q),ar(e.dp),ar(e.dq),ar(e.qi)),h}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0){var h=new d;return h.setPrivate(ar(e.n),ar(e.e),ar(e.d)),h}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d===void 0){var w=new l({curve:e.crv}),v=w.ecparams.keycharlen,D=("0000000000"+ar(e.x)).slice(-v),A=("0000000000"+ar(e.y)).slice(-v),F="04"+D+A;return w.setPublicKeyHex(F),w}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d!==void 0){var w=new l({curve:e.crv}),v=w.ecparams.keycharlen,D=("0000000000"+ar(e.x)).slice(-v),A=("0000000000"+ar(e.y)).slice(-v),F="04"+D+A,S=("0000000000"+ar(e.d)).slice(-v);return w.setPublicKeyHex(F),w.setPrivateKeyHex(S),w}if(r==="pkcs5prv"){var B=e,n=De,_,h;if(_=s(B,0),_.length===9)h=new d,h.readPKCS5PrvKeyHex(B);else if(_.length===6)h=new f,h.readPKCS5PrvKeyHex(B);else if(_.length>2&&B.substr(_[1],2)==="04")h=new l,h.readPKCS5PrvKeyHex(B);else throw new Error("unsupported PKCS#1/5 hexadecimal key");return h}if(r==="pkcs8prv"){var h=p.getKeyFromPlainPrivatePKCS8Hex(e);return h}if(r==="pkcs8pub")return p._getKeyFromPublicPKCS8Hex(e);if(r==="x509pub")return Je.getPublicKeyFromCertHex(e);if(e.indexOf("-END CERTIFICATE-",0)!=-1||e.indexOf("-END X509 CERTIFICATE-",0)!=-1||e.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Je.getPublicKeyFromCertPEM(e);if(e.indexOf("-END PUBLIC KEY-")!=-1){var K=pr(e,"PUBLIC KEY");return p._getKeyFromPublicPKCS8Hex(K)}if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var G=E(e,"RSA PRIVATE KEY");return p.getKey(G,null,"pkcs5prv")}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var b=E(e,"DSA PRIVATE KEY"),P=i(b,0,[1],"02"),L=i(b,0,[2],"02"),j=i(b,0,[3],"02"),V=i(b,0,[4],"02"),W=i(b,0,[5],"02"),h=new f;return h.setPrivate(new ee(P,16),new ee(L,16),new ee(j,16),new ee(V,16),new ee(W,16)),h}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var G=E(e,"EC PRIVATE KEY");return p.getKey(G,null,"pkcs5prv")}if(e.indexOf("-END PRIVATE KEY-")!=-1)return p.getKeyFromPlainPrivatePKCS8PEM(e);if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var q=p.getDecryptedKeyHex(e,t),z=new it;return z.readPKCS5PrvKeyHex(q),z}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var b=p.getDecryptedKeyHex(e,t),h=i(b,0,[1],"04"),J=i(b,0,[2,0],"06"),se=i(b,0,[3,0],"03").substr(2),ye="";if(g.crypto.OID.oidhex2name[J]!==void 0)ye=g.crypto.OID.oidhex2name[J];else throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+J);var w=new l({curve:ye});return w.setPublicKeyHex(se),w.setPrivateKeyHex(h),w.isPublic=!1,w}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var b=p.getDecryptedKeyHex(e,t),P=i(b,0,[1],"02"),L=i(b,0,[2],"02"),j=i(b,0,[3],"02"),V=i(b,0,[4],"02"),W=i(b,0,[5],"02"),h=new f;return h.setPrivate(new ee(P,16),new ee(L,16),new ee(j,16),new ee(V,16),new ee(W,16)),h}if(e.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return p.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")};Et.generateKeypair=function(e,t){if(e=="RSA"){var r=t,n=new it;n.generate(r,"10001"),n.isPrivate=!0,n.isPublic=!0;var s=new it,u=n.n.toString(16),i=n.e.toString(16);s.setPublic(u,i),s.isPrivate=!1,s.isPublic=!0;var o={};return o.prvKeyObj=n,o.pubKeyObj=s,o}else if(e=="EC"){var l=t,f=new g.crypto.ECDSA({curve:l}),d=f.generateKeyPairHex(),n=new g.crypto.ECDSA({curve:l});n.setPublicKeyHex(d.ecpubhex),n.setPrivateKeyHex(d.ecprvhex),n.isPrivate=!0,n.isPublic=!1;var s=new g.crypto.ECDSA({curve:l});s.setPublicKeyHex(d.ecpubhex),s.isPrivate=!1,s.isPublic=!0;var o={};return o.prvKeyObj=n,o.pubKeyObj=s,o}else throw new Error("unknown algorithm: "+e)};Et.getPEM=function(e,t,r,n,s,u){var i=g,o=i.asn1,l=o.DERObjectIdentifier,f=o.DERInteger,d=o.ASN1Util.newObject,E=o.x509,p=E.SubjectPublicKeyInfo,h=i.crypto,w=h.DSA,v=h.ECDSA,D=it;function A(z){var J=d({seq:[{int:0},{int:{bigint:z.n}},{int:z.e},{int:{bigint:z.d}},{int:{bigint:z.p}},{int:{bigint:z.q}},{int:{bigint:z.dmp1}},{int:{bigint:z.dmq1}},{int:{bigint:z.coeff}}]});return J}function F(z){var J=d({seq:[{int:1},{octstr:{hex:z.prvKeyHex}},{tag:["a0",!0,{oid:{name:z.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+z.pubKeyHex}}]}]});return J}function S(z){var J=d({seq:[{int:0},{int:{bigint:z.p}},{int:{bigint:z.q}},{int:{bigint:z.g}},{int:{bigint:z.y}},{int:{bigint:z.x}}]});return J}if((D!==void 0&&e instanceof D||w!==void 0&&e instanceof w||v!==void 0&&e instanceof v)&&e.isPublic==!0&&(t===void 0||t=="PKCS8PUB")){var B=new p(e),_=B.tohex();return yn(_,"PUBLIC KEY")}if(t=="PKCS1PRV"&&D!==void 0&&e instanceof D&&(r===void 0||r==null)&&e.isPrivate==!0){var B=A(e),_=B.tohex();return yn(_,"RSA PRIVATE KEY")}if(t=="PKCS1PRV"&&v!==void 0&&e instanceof v&&(r===void 0||r==null)&&e.isPrivate==!0){var K=new l({name:e.curveName}),G=K.tohex(),b=F(e),P=b.tohex(),L="";return L+=yn(G,"EC PARAMETERS"),L+=yn(P,"EC PRIVATE KEY"),L}if(t=="PKCS1PRV"&&w!==void 0&&e instanceof w&&(r===void 0||r==null)&&e.isPrivate==!0){var B=S(e),_=B.tohex();return yn(_,"DSA PRIVATE KEY")}if(t=="PKCS5PRV"&&D!==void 0&&e instanceof D&&r!==void 0&&r!=null&&e.isPrivate==!0){var B=A(e),_=B.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",_,r,n,u)}if(t=="PKCS5PRV"&&v!==void 0&&e instanceof v&&r!==void 0&&r!=null&&e.isPrivate==!0){var B=F(e),_=B.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",_,r,n,u)}if(t=="PKCS5PRV"&&w!==void 0&&e instanceof w&&r!==void 0&&r!=null&&e.isPrivate==!0){var B=S(e),_=B.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",_,r,n,u)}var j=function(z,J){if(typeof J=="string")return Et.getEncryptedPKCS8PEM(z,J);if(typeof J=="object"&&Xt(J,"passcode")!=null){var se=JSON.parse(JSON.stringify(J)),ye=se.passcode;return delete se.passcode,Et.getEncryptedPKCS8PEM(z,ye,se)}};if(t=="PKCS8PRV"&&D!=null&&e instanceof D&&e.isPrivate==!0){var V=A(e),W=V.tohex(),B=d({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:W}}]}),_=B.tohex();return r===void 0||r==null?yn(_,"PRIVATE KEY"):j(_,r)}if(t=="PKCS8PRV"&&v!==void 0&&e instanceof v&&e.isPrivate==!0){var q={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};typeof e.pubKeyHex=="string"&&q.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});var V=new d(q),W=V.tohex(),B=d({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:W}}]}),_=B.tohex();return r===void 0||r==null?yn(_,"PRIVATE KEY"):j(_,r)}if(t=="PKCS8PRV"&&w!==void 0&&e instanceof w&&e.isPrivate==!0){var V=new f({bigint:e.x}),W=V.tohex(),B=d({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:W}}]}),_=B.tohex();return r===void 0||r==null?yn(_,"PRIVATE KEY"):j(_,r)}throw new Error("unsupported object nor format")};Et.getKeyFromCSRPEM=function(e){var t=pr(e,"CERTIFICATE REQUEST"),r=Et.getKeyFromCSRHex(t);return r};Et.getKeyFromCSRHex=function(e){var t=Et.parseCSRHex(e),r=Et.getKey(t.p8pubkeyhex,null,"pkcs8pub");return r};Et.parseCSRHex=function(e){var t=De,r=t.getChildIdx,n=t.getTLV,s={},u=e;if(u.substr(0,2)!="30")throw new Error("malformed CSR(code:001)");var i=r(u,0);if(i.length<1)throw new Error("malformed CSR(code:002)");if(u.substr(i[0],2)!="30")throw new Error("malformed CSR(code:003)");var o=r(u,i[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return s.p8pubkeyhex=n(u,o[2]),s};Et.getKeyID=function(e){var t=Et,r=De;typeof e=="string"&&e.indexOf("BEGIN ")!=-1&&(e=t.getKey(e));var n=pr(t.getPEM(e)),s=r.getIdxbyList(n,0,[1]),u=r.getV(n,s).substring(2);return g.crypto.Util.hashHex(u,"sha1")};Et.getJWK=function(e,t,r,n,s){var u,i={},o,l=g.crypto.Util.hashHex;if(typeof e=="string")u=Et.getKey(e),e.indexOf("CERTIFICATE")!=-1&&(o=pr(e));else if(typeof e=="object")e instanceof Je?(u=e.getPublicKey(),o=e.hex):u=e;else throw new Error("unsupported keyinfo type");if(u instanceof it&&u.isPrivate)i.kty="RSA",i.n=jr(u.n.toString(16)),i.e=jr(u.e.toString(16)),i.d=jr(u.d.toString(16)),i.p=jr(u.p.toString(16)),i.q=jr(u.q.toString(16)),i.dp=jr(u.dmp1.toString(16)),i.dq=jr(u.dmq1.toString(16)),i.qi=jr(u.coeff.toString(16));else if(u instanceof it&&u.isPublic)i.kty="RSA",i.n=jr(u.n.toString(16)),i.e=jr(u.e.toString(16));else if(u instanceof g.crypto.ECDSA&&u.isPrivate){var f=u.getShortNISTPCurveName();if(f!=="P-256"&&f!=="P-384"&&f!=="P-521")throw new Error("unsupported curve name for JWT: "+f);var d=u.getPublicKeyXYHex();i.kty="EC",i.crv=f,i.x=jr(d.x),i.y=jr(d.y),i.d=jr(u.prvKeyHex)}else if(u instanceof g.crypto.ECDSA&&u.isPublic){var f=u.getShortNISTPCurveName();if(f!=="P-256"&&f!=="P-384"&&f!=="P-521")throw new Error("unsupported curve name for JWT: "+f);var d=u.getPublicKeyXYHex();i.kty="EC",i.crv=f,i.x=jr(d.x),i.y=jr(d.y)}if(i.kty==null)throw new Error("unsupported keyinfo");return!u.isPrivate&&t!=!0&&(i.kid=g.jws.JWS.getJWKthumbprint(i)),o!=null&&r!=!0&&(i.x5c=[lu(o)]),o!=null&&n!=!0&&(i.x5t=Mo(lu(l(o,"sha1")))),o!=null&&s!=!0&&(i["x5t#S256"]=Mo(lu(l(o,"sha256")))),i};Et.getJWKFromKey=function(e){return Et.getJWK(e,!0,!0,!0,!0)};it.getPosArrayOfChildrenFromHex=function(e){return De.getChildIdx(e,0)};it.getHexValueArrayOfChildrenFromHex=function(e){var t=De,r=t.getV,p=it.getPosArrayOfChildrenFromHex(e),n=r(e,p[0]),s=r(e,p[1]),u=r(e,p[2]),i=r(e,p[3]),o=r(e,p[4]),l=r(e,p[5]),f=r(e,p[6]),d=r(e,p[7]),E=r(e,p[8]),p=new Array;return p.push(n,s,u,i,o,l,f,d,E),p};it.prototype.readPrivateKeyFromPEMString=function(e){var t=pr(e),r=it.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])};it.prototype.readPKCS5PrvKeyHex=function(e){var t=it.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};it.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,s,u,i,o,l,f=De,d=f.getVbyListEx;if(f.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");try{t=d(e,0,[2,0,1],"02"),r=d(e,0,[2,0,2],"02"),n=d(e,0,[2,0,3],"02"),s=d(e,0,[2,0,4],"02"),u=d(e,0,[2,0,5],"02"),i=d(e,0,[2,0,6],"02"),o=d(e,0,[2,0,7],"02"),l=d(e,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,s,u,i,o,l)};it.prototype.readPKCS5PubKeyHex=function(e){var t=De,r=t.getV;if(t.isASN1HEX(e)===!1)throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(n.length!==2||e.substr(n[0],2)!=="02"||e.substr(n[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var s=r(e,n[0]),u=r(e,n[1]);this.setPublic(s,u)};it.prototype.readPKCS8PubKeyHex=function(e){var t=De;if(t.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(e,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)};it.prototype.readCertPubKeyHex=function(e,t){var r,n;r=new Je,r.readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var KT=new RegExp("[^0-9a-f]","gi");function sA(e,t){for(var r="",n=t/4-e.length,s=0;s<n;s++)r=r+"0";return r+e}it.prototype.sign=function(e,t){var r=function(s){return g.crypto.Util.hashString(s,t)},n=r(e);return this.signWithMessageHash(n,t)};it.prototype.signWithMessageHash=function(e,t){var r=g.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),n=ei(r,16),s=this.doPrivate(n),u=s.toString(16);return sA(u,this.n.bitLength())};function uA(e,t,r){for(var n="",s=0;n.length<t;)n+=ri(r(Bs(e+String.fromCharCode.apply(String,[(s&4278190080)>>24,(s&16711680)>>16,(s&65280)>>8,s&255])))),s+=1;return n}it.prototype.signPSS=function(e,t,r){var n=function(u){return g.crypto.Util.hashHex(u,t)},s=n(Bs(e));return r===void 0&&(r=-1),this.signWithMessageHashPSS(s,t,r)};it.prototype.signWithMessageHashPSS=function(e,t,r){var n=ri(e),s=n.length,u=this.n.bitLength()-1,i=Math.ceil(u/8),o,l=function(D){return g.crypto.Util.hashHex(D,t)};if(r===-1||r===void 0)r=s;else if(r===-2)r=i-s-2;else if(r<-2)throw new Error("invalid salt length");if(i<s+r+2)throw new Error("data too long");var f="";r>0&&(f=new Array(r),new Go().nextBytes(f),f=String.fromCharCode.apply(String,f));var d=ri(l(Bs("\0\0\0\0\0\0\0\0"+n+f))),E=[];for(o=0;o<i-r-s-2;o+=1)E[o]=0;var p=String.fromCharCode.apply(String,E)+""+f,h=uA(d,p.length,l),w=[];for(o=0;o<p.length;o+=1)w[o]=p.charCodeAt(o)^h.charCodeAt(o);var v=65280>>8*i-u&255;for(w[0]&=~v,o=0;o<s;o++)w.push(d.charCodeAt(o));return w.push(188),sA(this.doPrivate(new ee(w)).toString(16),this.n.bitLength())};function aA(e){for(var t in g.crypto.Util.DIGESTINFOHEAD){var r=g.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r){var s=[t,e.substring(n)];return s}}return[]}it.prototype.verify=function(e,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var r=ei(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var s=this.doPublic(r),u=s.toString(16);if(u.length+3!=n/4)return!1;var i=u.replace(/^1f+00/,""),o=aA(i);if(o.length==0)return!1;var l=o[0],f=o[1],d=function(p){return g.crypto.Util.hashString(p,l)},E=d(e);return f==E};it.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=ei(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=this.doPublic(r),s=n.toString(16).replace(/^1f+00/,""),u=aA(s);if(u.length==0)return!1;var i=u[0],o=u[1];return o==e};it.prototype.verifyPSS=function(e,t,r,n){var s=function(i){return g.crypto.Util.hashHex(i,r)},u=s(Bs(e));return n===void 0&&(n=-1),this.verifyWithMessageHashPSS(u,t,r,n)};it.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var s=new ee(t,16),u=function(F){return g.crypto.Util.hashHex(F,r)},i=ri(e),o=i.length,l=this.n.bitLength()-1,f=Math.ceil(l/8),d;if(n===-1||n===void 0)n=o;else if(n===-2)n=f-o-2;else if(n<-2)throw new Error("invalid salt length");if(f<o+n+2)throw new Error("data too long");var E=this.doPublic(s).toByteArray();for(d=0;d<E.length;d+=1)E[d]&=255;for(;E.length<f;)E.unshift(0);if(E[f-1]!==188)throw new Error("encoded message does not end in 0xbc");E=String.fromCharCode.apply(String,E);var p=E.substr(0,f-o-1),h=E.substr(p.length,o),w=65280>>8*f-l&255;if(p.charCodeAt(0)&w)throw new Error("bits beyond keysize not zero");var v=uA(h,p.length,u),D=[];for(d=0;d<p.length;d+=1)D[d]=p.charCodeAt(d)^v.charCodeAt(d);D[0]&=~w;var A=f-o-n-2;for(d=0;d<A;d+=1)if(D[d]!==0)throw new Error("leftmost octets not zero");if(D[A]!==1)throw new Error("0x01 marker not found");return h===ri(u(Bs("\0\0\0\0\0\0\0\0"+i+String.fromCharCode.apply(String,D.slice(-n)))))};it.SALT_LEN_HLEN=-1;it.SALT_LEN_MAX=-2;it.SALT_LEN_RECOVER=-2;function Je(e){var t=De,r=t.getChildIdx,n=t.getV,s=t.dump,u=t.parse,i=t.getTLV,o=t.getVbyList,l=t.getVbyListEx,f=t.getTLVbyList,d=t.getTLVbyListEx,E=t.getIdxbyList,p=t.getIdxbyListEx,h=t.getVidx,w=t.getInt,v=t.oidname,D=t.hextooidstr,A=Je,F=pr,S,B=Error;try{S=g.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch{}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var b=f(this.hex,0,[0,0]);if(b.substr(0,2)=="a0"){var P=f(b,0,[0]),L=w(P,0);if(L<0||2<L)throw new Error("malformed version field");return this.version=L+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return l(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var b=d(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(b)},this.getAlgorithmIdentifierName=function(b){for(var P in S)if(b===S[P])return P;return v(l(b,0,[0],"06"))},this.getIssuer=function(b,P){return this.getX500Name(this.getIssuerHex(),b,P)},this.getIssuerHex=function(){return f(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var b=this.getIssuer();return b.str},this.getSubject=function(b,P){return this.getX500Name(this.getSubjectHex(),b,P)},this.getSubjectHex=function(){return f(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var b=this.getSubject();return b.str},this.getNotBefore=function(){var b=o(this.hex,0,[0,4+this.foffset,0]);return b=b.replace(/(..)/g,"%$1"),b=decodeURIComponent(b),b},this.getNotAfter=function(){var b=o(this.hex,0,[0,4+this.foffset,1]);return b=b.replace(/(..)/g,"%$1"),b=decodeURIComponent(b),b},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return f(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var b=this.getSPKI();return b==null?null:o(b,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return E(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var b=this.getPublicKeyIdx();return E(this.hex,b,[1,0],"30")},this.getPublicKey=function(){return Et.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var b=f(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(b)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(b){var P=this.getSignatureAlgorithmField(),L=this.getSignatureValueHex(),j=f(this.hex,0,[0],"30"),V=new g.crypto.Signature({alg:P});return V.init(b),V.updateHex(j),V.verify(L)},this.parseExt=function(b){var P,L,j;if(b===void 0){if(j=this.hex,this.version!==3)return-1;P=E(j,0,[0,7,0],"30"),L=r(j,P)}else{j=pr(b);var V=E(j,0,[0,3,0,0],"06");if(n(j,V)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}P=E(j,0,[0,3,0,1,0],"30"),L=r(j,P),this.hex=j}this.aExtInfo=new Array;for(var W=0;W<L.length;W++){var q={};q.critical=!1;var z=r(j,L[W]),J=0;z.length===3&&(q.critical=!0,J=1),q.oid=t.hextooidstr(o(j,L[W],[0],"06"));var se=E(j,L[W],[1+J]);q.vidx=h(j,se),this.aExtInfo.push(q)}},this.getExtInfo=function(b){var P=this.aExtInfo,L=b;if(b.match(/^[0-9.]+$/)||(L=g.asn1.x509.OID.name2oid(b)),L!==""){for(var j=0;j<P.length;j++)if(P[j].oid===L)return P[j]}},this.getCriticalExtV=function(b,P,L){if(P!=null)return[P,L];var j=this.getExtInfo(b);return j==null?[null,null]:[i(this.hex,j.vidx),j.critical]},this.getExtBasicConstraints=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("basicConstraints");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"basicConstraints"};if(P&&(j.critical=!0),b==="3000")return j;if(b==="30030101ff")return j.cA=!0,j;if(b.substr(0,12)==="30060101ff02"){var V=n(b,10),W=parseInt(V,16);return j.cA=!0,j.pathLen=W,j}throw new Error("hExtV parse error: "+b)},this.getExtNameConstraints=function(b,P){var L=this.getCriticalExtV("nameConstraints",b,P);if(b=L[0],P=L[1],b!=null){var j={extname:"nameConstraints"};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++){for(var q=[],z=r(b,V[W]),J=0;J<z.length;J++){var se=i(b,z[J]),ye=this.getGeneralSubtree(se);q.push(ye)}var Ce=b.substr(V[W],2);Ce=="a0"?j.permit=q:Ce=="a1"&&(j.exclude=q)}return j}},this.getGeneralSubtree=function(b){var P=r(b,0),L=P.length;if(L<1||2<L)throw new Error("wrong num elements");for(var j=this.getGeneralName(i(b,P[0])),V=1;V<L;V++){var W=b.substr(P[V],2),q=n(b,P[V]),z=parseInt(q,16);W=="80"&&(j.min=z),W=="81"&&(j.max=z)}return j},this.getExtKeyUsage=function(b,P){var L=this.getCriticalExtV("keyUsage",b,P);if(b=L[0],P=L[1],b!=null){var j={extname:"keyUsage"};return P&&(j.critical=!0),j.names=this.getExtKeyUsageString(b).split(","),j}},this.getExtKeyUsageBin=function(b){if(b===void 0){var P=this.getExtInfo("keyUsage");if(P===void 0)return"";b=i(this.hex,P.vidx)}if(b.length!=8&&b.length!=10)throw new Error("malformed key usage value: "+b);var L="000000000000000"+parseInt(b.substr(6),16).toString(2);return b.length==8&&(L=L.slice(-8)),b.length==10&&(L=L.slice(-16)),L=L.replace(/0+$/,""),L==""&&(L="0"),L},this.getExtKeyUsageString=function(b){for(var P=this.getExtKeyUsageBin(b),L=new Array,j=0;j<P.length;j++)P.substr(j,1)=="1"&&L.push(Je.KEYUSAGE_NAME[j]);return L.join(",")},this.getExtSubjectKeyIdentifier=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("subjectKeyIdentifier");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"subjectKeyIdentifier"};P&&(j.critical=!0);var V=n(b,0);return j.kid={hex:V},j},this.getExtAuthorityKeyIdentifier=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("authorityKeyIdentifier");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"authorityKeyIdentifier"};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++){var q=b.substr(V[W],2);if(q==="80"&&(j.kid={hex:n(b,V[W])}),q==="a1"){var z=i(b,V[W]),J=this.getGeneralNames(z);j.issuer=J[0].dn}q==="82"&&(j.sn={hex:n(b,V[W])})}return j},this.getExtExtKeyUsage=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("extKeyUsage");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"extKeyUsage",array:[]};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++)j.array.push(v(n(b,V[W])));return j},this.getExtExtKeyUsageName=function(){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return b;var P=new Array,L=i(this.hex,b.vidx);if(L==="")return P;for(var j=r(L,0),V=0;V<j.length;V++)P.push(v(n(L,j[V])));return P},this.getExtSubjectAltName=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("subjectAltName");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"subjectAltName",array:[]};return P&&(j.critical=!0),j.array=this.getGeneralNames(b),j},this.getExtIssuerAltName=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("issuerAltName");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"issuerAltName",array:[]};return P&&(j.critical=!0),j.array=this.getGeneralNames(b),j},this.getGeneralNames=function(b){for(var P=r(b,0),L=[],j=0;j<P.length;j++){var V=this.getGeneralName(i(b,P[j]));V!==void 0&&L.push(V)}return L},this.getGeneralName=function(b){var P=b.substr(0,2),L=n(b,0),j=ri(L);if(P=="81")return{rfc822:j};if(P=="82")return{dns:j};if(P=="86")return{uri:j};if(P=="87")return{ip:jf(L)};if(P=="a4")return{dn:this.getX500Name(L)};if(P=="a0")return{other:this.getOtherName(b)}},this.getExtSubjectAltName2=function(){var b,P,L,j=this.getExtInfo("subjectAltName");if(j===void 0)return j;for(var V=new Array,W=i(this.hex,j.vidx),q=r(W,0),z=0;z<q.length;z++)L=W.substr(q[z],2),b=n(W,q[z]),L==="81"&&(P=qt(b),V.push(["MAIL",P])),L==="82"&&(P=qt(b),V.push(["DNS",P])),L==="84"&&(P=Je.hex2dn(b,0),V.push(["DN",P])),L==="86"&&(P=qt(b),V.push(["URI",P])),L==="87"&&(P=jf(b),V.push(["IP",P]));return V},this.getExtCRLDistributionPoints=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("cRLDistributionPoints");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"cRLDistributionPoints",array:[]};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++){var q=i(b,V[W]);j.array.push(this.getDistributionPoint(q))}return j},this.getDistributionPoint=function(b){for(var P={},L=r(b,0),j=0;j<L.length;j++){var V=b.substr(L[j],2),W=i(b,L[j]);V=="a0"&&(P.dpname=this.getDistributionPointName(W))}return P},this.getDistributionPointName=function(b){for(var P={},L=r(b,0),j=0;j<L.length;j++){var V=b.substr(L[j],2),W=i(b,L[j]);V=="a0"&&(P.full=this.getGeneralNames(W))}return P},this.getExtCRLDistributionPointsURI=function(){var b=this.getExtCRLDistributionPoints();if(b==null)return b;for(var P=b.array,L=[],j=0;j<P.length;j++)try{P[j].dpname.full[0].uri!=null&&L.push(P[j].dpname.full[0].uri)}catch{}return L},this.getExtAIAInfo=function(){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return b;for(var P={ocsp:[],caissuer:[]},L=r(this.hex,b.vidx),j=0;j<L.length;j++){var V=o(this.hex,L[j],[0],"06"),W=o(this.hex,L[j],[1],"86");V==="2b06010505073001"&&P.ocsp.push(qt(W)),V==="2b06010505073002"&&P.caissuer.push(qt(W))}return P},this.getExtAuthorityInfoAccess=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("authorityInfoAccess");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"authorityInfoAccess",array:[]};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++){var q=l(b,V[W],[0],"06"),z=o(b,V[W],[1],"86"),J=qt(z);if(q=="2b06010505073001")j.array.push({ocsp:J});else if(q=="2b06010505073002")j.array.push({caissuer:J});else throw new Error("unknown method: "+q)}return j},this.getExtCertificatePolicies=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("certificatePolicies");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"certificatePolicies",array:[]};P&&(j.critical=!0);for(var V=r(b,0),W=0;W<V.length;W++){var q=i(b,V[W]),z=this.getPolicyInformation(q);j.array.push(z)}return j},this.getPolicyInformation=function(b){var P={},L=o(b,0,[0],"06");P.policyoid=v(L);var j=p(b,0,[1],"30");if(j!=-1){P.array=[];for(var V=r(b,j),W=0;W<V.length;W++){var q=i(b,V[W]),z=this.getPolicyQualifierInfo(q);P.array.push(z)}}return P},this.getOtherName=function(b){var P={},L=r(b,0),j=o(b,L[0],[],"06"),V=o(b,L[1],[]);return P.oid=v(j),P.value=u(V),P},this.getPolicyQualifierInfo=function(b){var P={},L=o(b,0,[0],"06");if(L==="2b06010505070201"){var j=l(b,0,[1],"16");P.cps=ri(j)}else if(L==="2b06010505070202"){var V=f(b,0,[1],"30");P.unotice=this.getUserNotice(V)}return P},this.getUserNotice=function(b){var P=null,L={};try{P=t.parse(b);var j=this._asn1ToUnotice(P);return j}catch{return}},this._asn1ToUnotice=function(b){try{for(var P={},L=Xt(b,"seq"),j=0;j<L.length;j++){var V=this._asn1ToNoticeRef(L[j]);V!=null&&(P.noticeref=V);var W=this.asn1ToDisplayText(L[j]);W!=null&&(P.exptext=W)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeRef=function(b){try{for(var P={},L=Xt(b,"seq"),j=0;j<L.length;j++){var V=this._asn1ToNoticeNum(L[j]);V!=null&&(P.noticenum=V);var W=this.asn1ToDisplayText(L[j]);W!=null&&(P.org=W)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeNum=function(b){try{for(var P=Xt(b,"seq"),L=[],j=0;j<P.length;j++){var V=P[j];L.push(parseInt(Xt(V,"int.hex"),16))}return L}catch{return}},this.getDisplayText=function(b){var P={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},L={};return L.type=P[b.substr(0,2)],L.str=ri(n(b,0)),L},this.asn1ToDisplayText=function(b){if(b.utf8str!=null)return{type:"utf8",str:b.utf8str.str};if(b.ia5str!=null)return{type:"ia5",str:b.ia5str.str};if(b.visstr!=null)return{type:"vis",str:b.visstr.str};if(b.bmpstr!=null)return{type:"bmp",str:b.bmpstr.str};if(b.prnstr!=null)return{type:"prn",str:b.prnstr.str}},this.getExtPolicyMappings=function(b,P){var L=this.getCriticalExtV("policyMappings",b,P);if(b=L[0],P=L[1],b!=null){var j={extname:"policyMappings"};P&&(j.critical=!0);try{for(var V=u(b),W=V.seq,q=[],z=0;z<W.length;z++){var J=W[z].seq;q.push([J[0].oid,J[1].oid])}j.array=q}catch{throw new B("malformed policyMappings")}return j}},this.getExtPolicyConstraints=function(b,P){var L=this.getCriticalExtV("policyConstraints",b,P);if(b=L[0],P=L[1],b!=null){var j={extname:"policyConstraints"};P&&(j.critical=!0);var V=u(b);try{for(var W=V.seq,q=0;q<W.length;q++){var z=W[q].tag;z.explicit==!1&&(z.tag=="80"&&(j.reqexp=parseInt(z.hex,16)),z.tag=="81"&&(j.inhibit=parseInt(z.hex,16)))}}catch{return new B("malformed policyConstraints value")}return j}},this.getExtInhibitAnyPolicy=function(b,P){var L=this.getCriticalExtV("inhibitAnyPolicy",b,P);if(b=L[0],P=L[1],b!=null){var j={extname:"inhibitAnyPolicy"};P&&(j.critical=!0);var V=w(b,0);return V==-1?new B("wrong value"):(j.skip=V,j)}},this.getExtCRLNumber=function(b,P){var L={extname:"cRLNumber"};if(P&&(L.critical=!0),b.substr(0,2)=="02")return L.num={hex:n(b,0)},L;throw new B("hExtV parse error: "+b)},this.getExtCRLReason=function(b,P){var L={extname:"cRLReason"};if(P&&(L.critical=!0),b.substr(0,2)=="0a")return L.code=parseInt(n(b,0),16),L;throw new Error("hExtV parse error: "+b)},this.getExtOcspNonce=function(b,P){var L={extname:"ocspNonce"};P&&(L.critical=!0);var j=n(b,0);return L.hex=j,L},this.getExtOcspNoCheck=function(b,P){var L={extname:"ocspNoCheck"};return P&&(L.critical=!0),L},this.getExtAdobeTimeStamp=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("adobeTimeStamp");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"adobeTimeStamp"};P&&(j.critical=!0);var V=r(b,0);if(V.length>1){var W=i(b,V[1]),q=this.getGeneralName(W);q.uri!=null&&(j.uri=q.uri)}if(V.length>2){var z=i(b,V[2]);z=="0101ff"&&(j.reqauth=!0),z=="010100"&&(j.reqauth=!1)}return j},this.getExtSubjectDirectoryAttributes=function(b,P){if(b===void 0&&P===void 0){var L=this.getExtInfo("subjectDirectoryAttributes");if(L===void 0)return;b=i(this.hex,L.vidx),P=L.critical}var j={extname:"subjectDirectoryAttributes"};P&&(j.critical=!0);try{for(var V=u(b),W=[],q=0;q<V.seq.length;q++){var z=V.seq[q],J=Xt(z,"seq.0.oid"),se=Xt(z,"seq.1.set");if(J==null||se==null)throw"error";W.push({attr:J,array:se})}return j.array=W,j}catch{throw new Error("malformed subjectDirectoryAttributes extension value")}};var _=function(b){var P={};try{var L=b.seq[0].oid,j=g.asn1.x509.OID.name2oid(L);P.type=g.asn1.x509.OID.oid2atype(j);var V=b.seq[1];if(V.utf8str!=null)P.ds="utf8",P.value=V.utf8str.str;else if(V.numstr!=null)P.ds="num",P.value=V.numstr.str;else if(V.telstr!=null)P.ds="tel",P.value=V.telstr.str;else if(V.prnstr!=null)P.ds="prn",P.value=V.prnstr.str;else if(V.ia5str!=null)P.ds="ia5",P.value=V.ia5str.str;else if(V.visstr!=null)P.ds="vis",P.value=V.visstr.str;else if(V.bmpstr!=null)P.ds="bmp",P.value=V.bmpstr.str;else throw"error";return P}catch{throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},K=function(b){try{return b.set.map(function(P){return _(P)})}catch(P){throw new Error("improper ASN.1 parsed RDN: "+P)}},G=function(b){try{return b.seq.map(function(P){return K(P)})}catch(P){throw new Error("improper ASN.1 parsed X500Name: "+P)}};this.getX500NameRule=function(b){for(var P=!0,L=!0,j=!1,V="",W="",q=null,z=[],J=0;J<b.length;J++)for(var se=b[J],ye=0;ye<se.length;ye++)z.push(se[ye]);for(var J=0;J<z.length;J++){var Ce=z[J],Pe=Ce.ds,Xe=Ce.value,ce=Ce.type;if(V+=":"+Pe,Pe!="prn"&&Pe!="utf8"&&Pe!="ia5")return"mixed";if(Pe=="ia5"){if(ce!="CN")return"mixed";if(g.lang.String.isMail(Xe))continue;return"mixed"}if(ce=="C"){if(Pe=="prn")continue;return"mixed"}if(W+=":"+Pe,q==null)q=Pe;else if(q!==Pe)return"mixed"}return q??"prn"},this.getAttrTypeAndValue=function(b){var P=u(b);return _(P)},this.getRDN=function(b){var P=u(b);return K(P)},this.getX500NameArray=function(b){var P=u(b);return G(P)},this.getX500Name=function(b,P,L){var j=this.getX500NameArray(b),V=this.dnarraytostr(j),W={str:V};return W.array=j,L==!0&&(W.hex=b),P==!0&&(W.canon=this.c14nRDNArray(j)),W},this.readCertPEM=function(b){this.readCertHex(F(b))},this.readCertHex=function(b){this.hex=b,this.getVersion();try{E(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(b){var P={};return b==null&&(b={}),P.version=this.getVersion(),P.serial={hex:this.getSerialNumberHex()},P.sigalg=this.getSignatureAlgorithmField(),P.issuer=this.getIssuer(b.dncanon,b.dnhex),P.notbefore=this.getNotBefore(),P.notafter=this.getNotAfter(),P.subject=this.getSubject(b.dncanon,b.dnhex),P.sbjpubkey=yn(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo!=null&&this.aExtInfo.length>0&&(P.ext=this.getExtParamArray()),P.sighex=this.getSignatureValueHex(),b.tbshex==!0&&(P.tbshex=f(this.hex,0,[0])),b.nodnarray==!0&&(delete P.issuer.array,delete P.subject.array),P},this.getExtParamArray=function(b){if(b==null){var P=p(this.hex,0,[0,"[3]"]);P!=-1&&(b=d(this.hex,0,[0,"[3]",0],"30"))}for(var L=[],j=r(b,0),V=0;V<j.length;V++){var W=i(b,j[V]),q=this.getExtParam(W);q!=null&&L.push(q)}return L},this.getExtParam=function(b){var P={},L=r(b,0),j=L.length;if(j!=2&&j!=3)throw new Error("wrong number elements in Extension: "+j+" "+b);var V=D(o(b,0,[0],"06")),W=!1;j==3&&f(b,0,[1])=="0101ff"&&(W=!0);var q=f(b,0,[j-1,0]),z=void 0;if(V=="2.5.29.14"?z=this.getExtSubjectKeyIdentifier(q,W):V=="2.5.29.15"?z=this.getExtKeyUsage(q,W):V=="2.5.29.17"?z=this.getExtSubjectAltName(q,W):V=="2.5.29.18"?z=this.getExtIssuerAltName(q,W):V=="2.5.29.19"?z=this.getExtBasicConstraints(q,W):V=="2.5.29.30"?z=this.getExtNameConstraints(q,W):V=="2.5.29.31"?z=this.getExtCRLDistributionPoints(q,W):V=="2.5.29.32"?z=this.getExtCertificatePolicies(q,W):V=="2.5.29.33"?z=this.getExtPolicyMappings(q,W):V=="2.5.29.35"?z=this.getExtAuthorityKeyIdentifier(q,W):V=="2.5.29.36"?z=this.getExtPolicyConstraints(q,W):V=="2.5.29.37"?z=this.getExtExtKeyUsage(q,W):V=="2.5.29.54"?z=this.getExtInhibitAnyPolicy(q,W):V=="1.3.6.1.5.5.7.1.1"?z=this.getExtAuthorityInfoAccess(q,W):V=="2.5.29.20"?z=this.getExtCRLNumber(q,W):V=="2.5.29.21"?z=this.getExtCRLReason(q,W):V=="2.5.29.9"?z=this.getExtSubjectDirectoryAttributes(q,W):V=="1.3.6.1.5.5.7.48.1.2"?z=this.getExtOcspNonce(q,W):V=="1.3.6.1.5.5.7.48.1.5"?z=this.getExtOcspNoCheck(q,W):V=="1.2.840.113583.1.1.9.1"?z=this.getExtAdobeTimeStamp(q,W):Je.EXT_PARSER[V]!=null&&(z=Je.EXT_PARSER[V](V,W,q)),z!=null)return z;var J={extname:V,extn:q};try{J.extn=u(q)}catch{}return W&&(J.critical=!0),J},this.findExt=function(b,P){for(var L=0;L<b.length;L++)if(b[L].extname==P)return b[L];return null},this.updateExtCDPFullURI=function(b,P){var L=this.findExt(b,"cRLDistributionPoints");if(L!=null&&L.array!=null){for(var j=L.array,V=0;V<j.length;V++)if(j[V].dpname!=null&&j[V].dpname.full!=null)for(var W=j[V].dpname.full,q=0;q<W.length;q++){var z=W[V];z.uri!=null&&(z.uri=P)}}},this.updateExtAIAOCSP=function(b,P){var L=this.findExt(b,"authorityInfoAccess");if(L!=null&&L.array!=null)for(var j=L.array,V=0;V<j.length;V++)j[V].ocsp!=null&&(j[V].ocsp=P)},this.updateExtAIACAIssuer=function(b,P){var L=this.findExt(b,"authorityInfoAccess");if(L!=null&&L.array!=null)for(var j=L.array,V=0;V<j.length;V++)j[V].caissuer!=null&&(j[V].caissuer=P)},this.dnarraytostr=function(b){function P(j){return j.map(function(V){return L(V).replace(/\+/,"\\+")}).join("+")}function L(j){return j.type+"="+j.value}return"/"+b.map(function(j){return P(j).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(b){var P;if(b.str!=null&&b.array==null){var L=new g.asn1.x509.X500Name({str:b.str}),j=L.tohex();P=this.getX500NameArray(j)}else P=b.array;b.canon==null&&(b.canon=this.c14nRDNArray(P))},this.c14nRDNArray=function(b){for(var P=[],L=0;L<b.length;L++){for(var j=b[L],V=[],W=0;W<j.length;W++){var q=j[W],z=q.value;z=z.replace(/^\s*/,""),z=z.replace(/\s*$/,""),z=z.replace(/\s+/g," "),z=z.toLowerCase(),V.push(q.type.toLowerCase()+"="+z)}P.push(V.join("+"))}return"/"+P.join("/")},this.getInfo=function(){var b=function(nr){for(var ht="",Vt=" ",st=`
`,ze=nr.array,ir=0;ir<ze.length;ir++){var je=ze[ir];if(je.dn!=null&&(ht+=Vt+"dn: "+je.dn.str+st),je.ip!=null&&(ht+=Vt+"ip: "+je.ip+st),je.rfc822!=null&&(ht+=Vt+"rfc822: "+je.rfc822+st),je.dns!=null&&(ht+=Vt+"dns: "+je.dns+st),je.uri!=null&&(ht+=Vt+"uri: "+je.uri+st),je.other!=null){var Tt=je.other.oid,Zr=JSON.stringify(je.other.value).replace(/\"/g,"");ht+=Vt+"other: "+Tt+"="+Zr+st}}return ht=ht.replace(/\n$/,""),ht},P=function(nr){for(var ht="",Vt=nr.array,st=0;st<Vt.length;st++){var ze=Vt[st];if(ht+=" policy oid: "+ze.policyoid+`
`,ze.array!==void 0)for(var ir=0;ir<ze.array.length;ir++){var je=ze.array[ir];je.cps!==void 0&&(ht+=" cps: "+je.cps+`
`)}}return ht},L=function(nr){for(var ht="",Vt=nr.array,st=0;st<Vt.length;st++){var ze=Vt[st];try{ze.dpname.full[0].uri!==void 0&&(ht+=" "+ze.dpname.full[0].uri+`
`)}catch{}try{ze.dname.full[0].dn.hex!==void 0&&(ht+=" "+Je.hex2dn(ze.dpname.full[0].dn.hex)+`
`)}catch{}}return ht},j=function(nr){for(var ht="",Vt=nr.array,st=0;st<Vt.length;st++){var ze=Vt[st];ze.caissuer!==void 0&&(ht+=" caissuer: "+ze.caissuer+`
`),ze.ocsp!==void 0&&(ht+=" ocsp: "+ze.ocsp+`
`)}return ht},V=Je,W,q,z;if(W=`Basic Fields
`,W+=" serial number: "+this.getSerialNumberHex()+`
`,W+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
`,W+=" issuer: "+this.getIssuerString()+`
`,W+=" notBefore: "+this.getNotBefore()+`
`,W+=" notAfter: "+this.getNotAfter()+`
`,W+=" subject: "+this.getSubjectString()+`
`,W+=` subject public key info:
`,q=this.getPublicKey(),W+=" key algorithm: "+q.type+`
`,q.type==="RSA"&&(W+=" n="+jp(q.n.toString(16)).substr(0,16)+`...
`,W+=" e="+jp(q.e.toString(16))+`
`),z=this.aExtInfo,z!=null){W+=`X509v3 Extensions:
`;for(var J=0;J<z.length;J++){var se=z[J],ye=g.asn1.x509.OID.oid2name(se.oid);ye===""&&(ye=se.oid);var Ce="";if(se.critical===!0&&(Ce="CRITICAL"),W+=" "+ye+" "+Ce+`:
`,ye==="basicConstraints"){var Pe=this.getExtBasicConstraints();Pe.cA===void 0?W+=` {}
`:(W+=" cA=true",Pe.pathLen!==void 0&&(W+=", pathLen="+Pe.pathLen),W+=`
`)}else if(ye=="policyMappings"){var Xe=this.getExtPolicyMappings().array,ce=Xe.map(function(nr){var ht=nr;return ht[0]+":"+ht[1]}).join(", ");W+=" "+ce+`
`}else if(ye=="policyConstraints"){var Ie=this.getExtPolicyConstraints();W+=" ",Ie.reqexp!=null&&(W+=" reqexp="+Ie.reqexp),Ie.inhibit!=null&&(W+=" inhibit="+Ie.inhibit),W+=`
`}else if(ye=="inhibitAnyPolicy"){var Ie=this.getExtInhibitAnyPolicy();W+=" skip="+Ie.skip+`
`}else if(ye=="keyUsage")W+=" "+this.getExtKeyUsageString()+`
`;else if(ye=="subjectKeyIdentifier")W+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
`;else if(ye=="authorityKeyIdentifier"){var Me=this.getExtAuthorityKeyIdentifier();Me.kid!==void 0&&(W+=" kid="+Me.kid.hex+`
`)}else if(ye=="extKeyUsage"){var _r=this.getExtExtKeyUsage().array;W+=" "+_r.join(", ")+`
`}else if(ye=="subjectAltName"){var Kt=b(this.getExtSubjectAltName());W+=Kt+`
`}else if(ye=="cRLDistributionPoints"){var Ft=this.getExtCRLDistributionPoints();W+=L(Ft)}else if(ye=="authorityInfoAccess"){var gr=this.getExtAuthorityInfoAccess();W+=j(gr)}else ye=="certificatePolicies"&&(W+=P(this.getExtCertificatePolicies()))}}return W+="signature algorithm: "+this.getSignatureAlgorithmName()+`
`,W+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
`,W},typeof e=="string"&&(e.indexOf("-----BEGIN")!=-1?this.readCertPEM(e):g.lang.String.isHex(e)&&this.readCertHex(e))}Je.EXT_PARSER={};Je.registExtParser=function(e,t){Je.EXT_PARSER[e]=t};Je.hex2dn=function(e,t){t===void 0&&(t=0);var r=new Je,n=De.getTLV(e,t),s=r.getX500Name(e);return s.str};Je.hex2rdn=function(e,t){if(t===void 0&&(t=0),e.substr(t,2)!=="31")throw new Error("malformed RDN");for(var r=new Array,n=De.getChildIdx(e,t),s=0;s<n.length;s++)r.push(Je.hex2attrTypeValue(e,n[s]));return r=r.map(function(u){return u.replace("+","\\+")}),r.join("+")};Je.hex2attrTypeValue=function(e,t){var r=De,n=r.getV;if(t===void 0&&(t=0),e.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var s=r.getChildIdx(e,t);s.length!==2||e.substr(s[0],2);var u=n(e,s[0]),i=g.asn1.ASN1Util.oidHexToInt(u),o=g.asn1.x509.OID.oid2atype(i),l=n(e,s[1]),f=ri(l);return o+"="+f};Je.getPublicKeyFromCertHex=function(e){var t=new Je;return t.readCertHex(e),t.getPublicKey()};Je.getPublicKeyFromCertPEM=function(e){var t=new Je;return t.readCertPEM(e),t.getPublicKey()};Je.getPublicKeyInfoPropOfCertPEM=function(e){var t=De,r=t.getVbyList,n={},s,u,i;return n.algparam=null,s=new Je,s.readCertPEM(e),u=s.getPublicKeyHex(),n.keyhex=r(u,0,[1],"03").substr(2),n.algoid=r(u,0,[0,0],"06"),n.algoid==="2a8648ce3d0201"&&(n.algparam=r(u,0,[0,1],"06")),n};Je.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var iB=function(e){var t=g,r=t.lang.String.isHex,n=De,s=n.getV,u=n.getTLV,i=n.getVbyList,o=n.getTLVbyList,l=n.getTLVbyListEx,f=n.getIdxbyList,d=n.getIdxbyListEx,E=n.getChildIdx,p=new Je;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var h=f(this.hex,0,[0,0]),w=this.hex.substr(h,2);if(w=="02")this.posSigAlg=1;else if(w=="30")this.posSigAlg=0;else throw new Error("malformed 1st item of TBSCertList: "+w);var v=f(this.hex,0,[0,this.posSigAlg+3]),D=this.hex.substr(v,2);if(D=="17"||D=="18"){var A,F;A=f(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,A!=-1&&(F=this.hex.substr(A,2),F=="30"&&(this.posRevCert=this.posSigAlg+4))}else if(D=="30")this.posRevCert=this.posSigAlg+3;else if(D=="a0")this.posRevCert=null;else throw new Error("malformed nextUpdate or revCert tag: "+D)},this.getVersion=function(){return this.posSigAlg==0?null:parseInt(i(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var h=o(this.hex,0,[0,this.posSigAlg],"30");return p.getAlgorithmIdentifierName(h)},this.getIssuer=function(){return p.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var h=i(this.hex,0,[0,this.posSigAlg+2]);return result=ri(h)},this.getNextUpdate=function(){var h=f(this.hex,0,[0,this.posSigAlg+3]),w=this.hex.substr(h,2);return w!="17"&&w!="18"?null:ri(s(this.hex,h))},this.getRevCertArray=function(){if(this.posRevCert==null)return null;for(var h=[],w=f(this.hex,0,[0,this.posRevCert]),v=E(this.hex,w),D=0;D<v.length;D++){var A=u(this.hex,v[D]);h.push(this.getRevCert(A))}return h},this.getRevCert=function(h){var w={},v=E(h,0);return w.sn={hex:i(h,0,[0],"02")},w.date=ri(i(h,0,[1])),v.length==3&&(w.ext=p.getExtParamArray(o(h,0,[2]))),w},this.findRevCert=function(h){var w=new Je(h),v=w.getSerialNumberHex();return this.findRevCertBySN(v)},this.findRevCertBySN=function(h){if(this.parsed==null&&this.getParam(),this.parsed.revcert==null)return null;for(var w=this.parsed.revcert,v=0;v<w.length;v++)if(h==w[v].sn.hex)return w[v];return null},this.getSignatureValueHex=function(){return i(this.hex,0,[2],"03",!0)},this.verifySignature=function(h){var w=this.getSignatureAlgorithmField(),v=this.getSignatureValueHex(),D=o(this.hex,0,[0],"30"),A=new g.crypto.Signature({alg:w});return A.init(h),A.updateHex(D),A.verify(v)},this.getParam=function(h){var w={},v=this.getVersion();v!=null&&(w.version=v),w.sigalg=this.getSignatureAlgorithmField(),w.issuer=this.getIssuer(),w.thisupdate=this.getThisUpdate();var D=this.getNextUpdate();D!=null&&(w.nextupdate=D);var A=this.getRevCertArray();A!=null&&(w.revcert=A);var F=d(this.hex,0,[0,"[0]"]);if(F!=-1){var S=l(this.hex,0,[0,"[0]",0]);w.ext=p.getExtParamArray(S)}return w.sighex=this.getSignatureValueHex(),this.parsed=w,typeof h=="object"&&(h.tbshex==!0&&(w.tbshex=o(this.hex,0,[0])),h.nodnarray==!0&&delete w.issuer.array),w},typeof e=="string"&&(r(e)?this.hex=e:e.match(/-----BEGIN X509 CRL/)&&(this.hex=pr(e)),this._setPos())};(typeof g>"u"||!g)&&(g={});(typeof g.jws>"u"||!g.jws)&&(g.jws={});g.jws.JWS=function(){var e=g,t=e.jws.JWS,r=t.isSafeJSONString;this.parseJWS=function(n,s){if(!(this.parsedJWS!==void 0&&(s||this.parsedJWS.sigvalH!==void 0))){var u=n.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(u==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=u[1],o=u[2],l=u[3],f=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=l,this.parsedJWS.si=f,!s){var d=ar(l),E=ei(d,16);this.parsedJWS.sigvalH=d,this.parsedJWS.sigvalBI=E}var p=Qi(i),h=Qi(o);if(this.parsedJWS.headS=p,this.parsedJWS.payloadS=h,!r(p,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+p}}};g.jws.JWS.sign=function(e,t,r,n,s){var u=g,i=u.jws,o=i.JWS,l=o.readSafeJSONString,f=o.isSafeJSONString,d=u.crypto,E=d.ECDSA,p=d.Mac,h=d.Signature,w=JSON,v,D,A;if(typeof t!="string"&&typeof t!="object")throw"spHeader must be JSON string or object: "+t;if(typeof t=="object"&&(D=t,v=w.stringify(D)),typeof t=="string"){if(v=t,!f(v))throw"JWS Head is not safe JSON string: "+v;D=l(v)}if(A=r,typeof r=="object"&&(A=w.stringify(r)),(e==""||e==null)&&D.alg!==void 0&&(e=D.alg),e!=""&&e!=null&&D.alg===void 0&&(D.alg=e,v=w.stringify(D)),e!==D.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+D.alg;var F=null;if(o.jwsalg2sigalg[e]===void 0)throw"unsupported alg name: "+e;F=o.jwsalg2sigalg[e];var S=jc(v),B=jc(A),_=S+"."+B,K="";if(F.substr(0,4)=="Hmac"){if(n===void 0)throw"mac key shall be specified for HS* alg";var G=new p({alg:F,prov:"cryptojs",pass:n});G.updateString(_),K=G.doFinal()}else if(F.indexOf("withECDSA")!=-1){var b=new h({alg:F});b.init(n,s),b.updateString(_);var P=b.sign();K=g.crypto.ECDSA.asn1SigToConcatSig(P)}else if(F!="none"){var b=new h({alg:F});b.init(n,s),b.updateString(_),K=b.sign()}var L=jr(K);return _+"."+L};g.jws.JWS.verify=function(e,t,r){var n=g,s=n.jws,u=s.JWS,i=u.readSafeJSONString,o=n.crypto,l=o.ECDSA,f=o.Mac,d=o.Signature,E;if(typeof it!==void 0&&(E=it),!Jp(e))return!1;var p=e.split(".");if(p.length!==3)return!1;var h=p[0],w=p[1],v=h+"."+w,D=ar(p[2]),A=i(Qi(p[0])),F=null,S=null;if(A.alg===void 0)throw"algorithm not specified in header";if(F=A.alg,S=F.substr(0,2),r!=null&&Object.prototype.toString.call(r)==="[object Array]"&&r.length>0){var B=":"+r.join(":")+":";if(B.indexOf(":"+F+":")==-1)throw"algorithm '"+F+"' not accepted in the list"}if(F!="none"&&t===null)throw"key shall be specified to verify.";if(typeof t=="string"&&t.indexOf("-----BEGIN ")!=-1&&(t=Et.getKey(t)),(S=="RS"||S=="PS")&&!(t instanceof E))throw"key shall be a RSAKey obj for RS* and PS* algs";if(S=="ES"&&!(t instanceof l))throw"key shall be a ECDSA obj for ES* algs";F=="none";var _=null;if(u.jwsalg2sigalg[A.alg]===void 0)throw"unsupported alg name: "+F;if(_=u.jwsalg2sigalg[F],_=="none")throw"not supported";if(_.substr(0,4)=="Hmac"){var K=null;if(t===void 0)throw"hexadecimal key shall be specified for HMAC";var G=new f({alg:_,pass:t});return G.updateString(v),K=G.doFinal(),D==K}else if(_.indexOf("withECDSA")!=-1){var b=null;try{b=l.concatSigToASN1Sig(D)}catch{return!1}var P=new d({alg:_});return P.init(t),P.updateString(v),P.verify(b)}else{var P=new d({alg:_});return P.init(t),P.updateString(v),P.verify(D)}};g.jws.JWS.parse=function(e){var t=e.split("."),r={},n,s,u;if(t.length!=2&&t.length!=3)throw"malformed sJWS: wrong number of '.' splitted elements";return n=t[0],s=t[1],t.length==3&&(u=t[2]),r.headerObj=g.jws.JWS.readSafeJSONString(Qi(n)),r.payloadObj=g.jws.JWS.readSafeJSONString(Qi(s)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadObj==null?r.payloadPP=Qi(s):r.payloadPP=JSON.stringify(r.payloadObj,null," "),u!==void 0&&(r.sigHex=ar(u)),r};g.jws.JWS.verifyJWT=function(e,t,r){var n=g,s=n.jws,u=s.JWS,i=u.readSafeJSONString,o=u.inArray,l=u.includedArray;if(!Jp(e))return!1;var f=e.split(".");if(f.length!=3)return!1;var d=f[0],E=f[1],p=d+"."+E,h=ar(f[2]),w=i(Qi(d)),v=i(Qi(E));if(w.alg===void 0)return!1;if(r.alg===void 0)throw"acceptField.alg shall be specified";if(!o(w.alg,r.alg)||v.iss!==void 0&&typeof r.iss=="object"&&!o(v.iss,r.iss)||v.sub!==void 0&&typeof r.sub=="object"&&!o(v.sub,r.sub))return!1;if(v.aud!==void 0&&typeof r.aud=="object"){if(typeof v.aud=="string"){if(!o(v.aud,r.aud))return!1}else if(typeof v.aud=="object"&&!l(v.aud,r.aud))return!1}var D=s.IntDate.getNow();return r.verifyAt!==void 0&&typeof r.verifyAt=="number"&&(D=r.verifyAt),(r.gracePeriod===void 0||typeof r.gracePeriod!="number")&&(r.gracePeriod=0),!(v.exp!==void 0&&typeof v.exp=="number"&&v.exp+r.gracePeriod<D||v.nbf!==void 0&&typeof v.nbf=="number"&&D<v.nbf-r.gracePeriod||v.iat!==void 0&&typeof v.iat=="number"&&D<v.iat-r.gracePeriod||v.jti!==void 0&&r.jti!==void 0&&v.jti!==r.jti||!u.verify(e,t,r.alg))};g.jws.JWS.includedArray=function(e,t){var r=g.jws.JWS.inArray;if(e===null||typeof e!="object"||typeof e.length!="number")return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t))return!1;return!0};g.jws.JWS.inArray=function(e,t){if(t===null||typeof t!="object"||typeof t.length!="number")return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1};g.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"};g.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return n=z2(e),typeof n!="object"||n.constructor===Array?0:(t&&(t[r]=n),1)}catch{return 0}};g.jws.JWS.readSafeJSONString=function(e){var t=null;try{return t=z2(e),typeof t!="object"||t.constructor===Array?null:t}catch{return null}};g.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(t==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]};g.jws.JWS.getJWKthumbprint=function(e){if(e.kty!=="RSA"&&e.kty!=="EC"&&e.kty!=="oct")throw"unsupported algorithm for JWK Thumprint";var t="{";if(e.kty==="RSA"){if(typeof e.n!="string"||typeof e.e!="string")throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if(e.kty==="EC"){if(typeof e.crv!="string"||typeof e.x!="string"||typeof e.y!="string")throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if(e.kty==="oct"){if(typeof e.k!="string")throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=Bs(t),n=g.crypto.Util.hashHex(r,"sha256"),s=jr(n);return s};g.jws.IntDate={};g.jws.IntDate.get=function(e){var t=g.jws.IntDate,r=t.getNow,n=t.getZulu;if(e=="now")return r();if(e=="now + 1hour")return r()+60*60;if(e=="now + 1day")return r()+60*60*24;if(e=="now + 1month")return r()+60*60*24*30;if(e=="now + 1year")return r()+60*60*24*365;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e};g.jws.IntDate.getZulu=function(e){return X2(e)};g.jws.IntDate.getNow=function(){var e=~~(new Date/1e3);return e};g.jws.IntDate.intDate2UTCString=function(e){var t=new Date(e*1e3);return t.toUTCString()};g.jws.IntDate.intDate2Zulu=function(e){var t=new Date(e*1e3),r=("0000"+t.getUTCFullYear()).slice(-4),n=("00"+(t.getUTCMonth()+1)).slice(-2),s=("00"+t.getUTCDate()).slice(-2),u=("00"+t.getUTCHours()).slice(-2),i=("00"+t.getUTCMinutes()).slice(-2),o=("00"+t.getUTCSeconds()).slice(-2);return r+n+s+u+i+o+"Z"};(typeof g>"u"||!g)&&(g={});(typeof g.jws>"u"||!g.jws)&&(g.jws={});g.jws.JWSJS=function(){var e=g,t=e.jws,r=t.JWS,n=r.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(s){this.init();var u=s.split(".");if(u.length!=3)throw"malformed input JWS";this.aHeader.push(u[0]),this.sPayload=u[1],this.aSignature.push(u[2])},this.addSignature=function(s,u,i,o){if(this.sPayload===void 0||this.sPayload===null)throw"there's no JSON-JS signature to add.";var l=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var f=g.jws.JWS.sign(s,u,this.sPayload,i,o),d=f.split("."),E=d[0],p=d[2];this.aHeader.push(d[0]),this.aSignature.push(d[2])}catch(h){throw this.aHeader.length>l&&this.aHeader.pop(),this.aSignature.length>l&&this.aSignature.pop(),"addSignature failed: "+h}},this.verifyAll=function(s){if(this.aHeader.length!==s.length||this.aSignature.length!==s.length)return!1;for(var u=0;u<s.length;u++){var i=s[u];if(i.length!==2)return!1;var o=this.verifyNth(u,i[0],i[1]);if(o===!1)return!1}return!0},this.verifyNth=function(s,u,i){if(this.aHeader.length<=s||this.aSignature.length<=s)return!1;var o=this.aHeader[s],l=this.aSignature[s],f=o+"."+this.sPayload+"."+l,d=!1;try{d=r.verify(f,u,i)}catch{return!1}return d},this.readJWSJS=function(s){if(typeof s=="string"){var u=n(s);if(u==null)throw"argument is not safe JSON object string";this.aHeader=u.headers,this.sPayload=u.payload,this.aSignature=u.signatures}else try{if(s.headers.length>0)this.aHeader=s.headers;else throw"malformed header";if(typeof s.payload=="string")this.sPayload=s.payload;else throw"malformed signatures";if(s.signatures.length>0)this.aSignature=s.signatures;else throw"malformed signatures"}catch(i){throw"malformed JWS-JS JSON object: "+i}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return this.aHeader.length==0?1:0}};Se.SecureRandom=Go;Se.rng_seed_time=Vp;Se.BigInteger=ee;Se.RSAKey=it;Se.ECDSA=g.crypto.ECDSA;Se.DSA=g.crypto.DSA;Se.Signature=g.crypto.Signature;Se.MessageDigest=g.crypto.MessageDigest;Se.Mac=g.crypto.Mac;Se.KEYUTIL=Et;Se.ASN1HEX=De;Se.X509=Je;Se.X509CRL=iB;Se.CryptoJS=_e;Se.b64tohex=qo;Se.b64toBA=M2;Se.ECFieldElementFp=Mr;Se.ECPointFp=Ot;Se.ECCurveFp=fu;Se.stoBA=Y2;Se.BAtos=W2;Se.BAtohex=Gf;Se.stohex=ti;Se.stob64=L9;Se.stob64u=U9;Se.b64utos=H9;Se.b64tob64u=Mo;Se.b64utob64=qc;Se.hex2b64=lu;Se.hextob64u=jr;Se.b64utohex=ar;Se.utf8tob64u=jc;Se.b64utoutf8=Qi;Se.utf8tob64=j9;Se.b64toutf8=M9;Se.utf8tohex=zf;Se.hextoutf8=qt;Se.hextorstr=ri;Se.rstrtohex=Bs;Se.hextob64=Gp;Se.hextob64nl=V9;Se.b64nltohex=J2;Se.hextopem=yn;Se.pemtohex=pr;Se.hextoArrayBuffer=Y9;Se.ArrayBuffertohex=W9;Se.zulutomsec=zp;Se.msectozulu=J9;Se.zulutosec=X2;Se.zulutodate=X9;Se.datetozulu=Z9;Se.uricmptohex=Wf;Se.hextouricmp=Jf;Se.ipv6tohex=Up;Se.hextoipv6=Hp;Se.hextoip=jf;Se.iptohex=Yp;Se.ucs2hextoutf8=Wp;Se.encodeURIComponentAll=Xf;Se.newline_toUnix=Q9;Se.newline_toDos=eB;Se.hextoposhex=jp;Se.intarystrtohex=tB;Se.strdiffidx=rB;Se.oidtohex=eA;Se.hextooid=Zf;Se.strpad=Mf;Se.bitstrtoint=rA;Se.inttobitstr=nA;Se.bitstrtobinstr=iA;Se.binstrtobitstr=nB;Se.isBase64URLDot=Jp;Se.namearraytobinstr=qf;Se.extendClass=de;Se.foldnl=Yf;Se.b64topem=G9;Se.pemtob64=z9;Se.timeogen=Z2;Se.aryval=Xt;Se.inttohex=tA;Se.twoscompl=Kc;Se.KJUR=g;Se.crypto=g.crypto;Se.asn1=g.asn1;Se.jws=g.jws;Se.lang=g.lang;Se.VERSION=pb;Se.VERSION_FULL=db});var fA=Be(Qp=>{"use strict";Qp.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};Qp.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var hA=Be(ed=>{"use strict";ed.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};ed.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var pA=Be(td=>{"use strict";td.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};td.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var dA=Be(rd=>{"use strict";rd.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};rd.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var gA=Be(nd=>{"use strict";nd.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};nd.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var AA=Be((vA,sd)=>{var mA=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=E,e.encode=d,e.familyOf=f,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,s=16,u={name:"v4",size:r,isFormat:p=>t.test(p),encode(p,h,w){w=~~w,h=h||new Uint8Array(w+r);let v=p.length,D=0;for(let A=0;A<v;){let F=p.charCodeAt(A++);F===46?(h[w++]=D,D=0):D=D*10+(F-48)}return h[w]=D,h},decode(p,h){return h=~~h,`${p[h++]}.${p[h++]}.${p[h++]}.${p[h]}`}};e.v4=u;let i={name:"v6",size:s,isFormat:p=>p.length>0&&n.test(p),encode(p,h,w){w=~~w;let v=w+s,D=-1,A=0,F=0,S=!0,B=!1;h=h||new Uint8Array(w+s);for(let _=0;_<p.length;_++){let K=p.charCodeAt(_);K===58?(S?D!==-1?(w<v&&(h[w]=0),w<v-1&&(h[w+1]=0),w+=2):w<v&&(D=w):(B===!0?(w<v&&(h[w]=F),w++):(w<v&&(h[w]=A>>8),w<v-1&&(h[w+1]=A&255),w+=2),A=0,F=0),S=!0,B=!1):K===46?(w<v&&(h[w]=F),w++,F=0,A=0,S=!1,B=!0):(S=!1,K>=97?K-=87:K>=65?K-=55:(K-=48,F=F*10+K),A=(A<<4)+K)}if(S===!1)B===!0?(w<v&&(h[w]=F),w++):(w<v&&(h[w]=A>>8),w<v-1&&(h[w+1]=A&255),w+=2);else if(D===0)w<v&&(h[w]=0),w<v-1&&(h[w+1]=0),w+=2;else if(D!==-1){w+=2;for(let _=Math.min(w-1,v-1);_>=D+2;_--)h[_]=h[_-2];h[D]=0,h[D+1]=0,D=w}if(D!==w&&D!==-1)for(w>v-2&&(w=v-2);v>D;)h[--v]=w<v&&w>D?h[--w]:0;else for(;w<v;)h[w++]=0;return h},decode(p,h){h=~~h;let w="";for(let v=0;v<s;v+=2)v!==0&&(w+=":"),w+=(p[h+v]<<8|p[h+v+1]).toString(16);return w.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=i;let o="ip";e.name=o;function l(p){if(u.isFormat(p))return u.size;if(i.isFormat(p))return i.size;throw Error(`Invalid ip address: ${p}`)}function f(p){return l(p)===u.size?1:2}function d(p,h,w){w=~~w;let v=l(p);return typeof h=="function"&&(h=h(w+v)),v===u.size?u.encode(p,h,w):i.encode(p,h,w)}function E(p,h,w){if(h=~~h,w=w||p.length-h,w===u.size)return u.decode(p,h,w);if(w===i.size)return i.decode(p,h,w);throw Error(`Invalid buffer size needs to be ${u.size} for v4 or ${i.size} for v6.`)}return"default"in e?e.default:e}({});typeof define=="function"&&define.amd?define([],function(){return mA}):typeof sd=="object"&&typeof vA=="object"&&(sd.exports=mA)});var FA=Be(qe=>{"use strict";var Ke=Uf().Buffer,Fu=fA(),uB=hA(),aB=pA(),rh=dA(),ud=gA(),Ka=AA(),oB=0,EA=32768,ad=32768,cB=~ad,wA=32768,lB=~wA,Te=qe.name={};Te.encode=function(e,t,r,{mail:n=!1}={}){t||(t=Ke.alloc(Te.encodingLength(e))),r||(r=0);let s=r,u=e.replace(/^\.|\.$/gm,"");if(u.length){let i=[];if(n){let o="";u.split(".").forEach(l=>{l.endsWith("\\")?o+=(o.length?".":"")+l.slice(0,-1):i.length===0&&o.length?i.push(o+"."+l):i.push(l)})}else i=u.split(".");for(let o=0;o<i.length;o++){let l=t.write(i[o],r+1);t[r]=l,r+=l+1}}return t[r++]=0,Te.encode.bytes=r-s,t};Te.encode.bytes=0;Te.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let n=[],s=t,u=0,i=0,o=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(i+=o?0:1,l===0)break;if(l&192)if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let f=e.readUInt16BE(t-1)-49152;if(f>=s)throw new Error("Cannot decode name (bad pointer)");t=f,s=f,i+=o?0:1,o=!0}else throw new Error("Cannot decode name (bad label)");else{if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(u+=l+1,u>254)throw new Error("Cannot decode name (name too long)");let f=e.toString("utf-8",t,t+l);r&&(f=f.replace(/\./g,"\\.")),n.push(f),t+=l,i+=o?0:l}}return Te.decode.bytes=i,n.length===0?".":n.join(".")};Te.decode.bytes=0;Te.encodingLength=function(e){return e==="."||e===".."?1:Ke.byteLength(e.replace(/^\.|\.$/gm,""))+2};var At={};At.encode=function(e,t,r){t||(t=Ke.alloc(At.encodingLength(e))),r||(r=0);let n=t.write(e,r+1);return t[r]=n,At.encode.bytes=n+1,t};At.encode.bytes=0;At.decode=function(e,t){t||(t=0);let r=e[t],n=e.toString("utf-8",t+1,t+1+r);return At.decode.bytes=r+1,n};At.decode.bytes=0;At.encodingLength=function(e){return Ke.byteLength(e)+1};var rs={};rs.encode=function(e,t,r){t||(t=rs.encodingLength(e)),r||(r=0);let n=(e.flags||0)&32767,s=e.type==="response"?EA:oB;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(n|s,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};rs.encode.bytes=12;rs.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&EA?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:aB.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:uB.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};rs.decode.bytes=12;rs.encodingLength=function(){return 12};var hu=qe.unknown={};hu.encode=function(e,t,r){return t||(t=Ke.alloc(hu.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),hu.encode.bytes=e.length+2,t};hu.encode.bytes=0;hu.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=e.slice(t+2,t+2+r);return hu.decode.bytes=r+2,n};hu.decode.bytes=0;hu.encodingLength=function(e){return e.length+2};var pu=qe.ns={};pu.encode=function(e,t,r){return t||(t=Ke.alloc(pu.encodingLength(e))),r||(r=0),Te.encode(e,t,r+2),t.writeUInt16BE(Te.encode.bytes,r),pu.encode.bytes=Te.encode.bytes+2,t};pu.encode.bytes=0;pu.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=Te.decode(e,t+2);return pu.decode.bytes=r+2,n};pu.decode.bytes=0;pu.encodingLength=function(e){return Te.encodingLength(e)+2};var du=qe.soa={};du.encode=function(e,t,r){t||(t=Ke.alloc(du.encodingLength(e))),r||(r=0);let n=r;return r+=2,Te.encode(e.mname,t,r),r+=Te.encode.bytes,Te.encode(e.rname,t,r,{mail:!0}),r+=Te.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-n-2,n),du.encode.bytes=r-n,t};du.encode.bytes=0;du.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mname=Te.decode(e,t),t+=Te.decode.bytes,n.rname=Te.decode(e,t,{mail:!0}),t+=Te.decode.bytes,n.serial=e.readUInt32BE(t),t+=4,n.refresh=e.readUInt32BE(t),t+=4,n.retry=e.readUInt32BE(t),t+=4,n.expire=e.readUInt32BE(t),t+=4,n.minimum=e.readUInt32BE(t),t+=4,du.decode.bytes=t-r,n};du.decode.bytes=0;du.encodingLength=function(e){return 22+Te.encodingLength(e.mname)+Te.encodingLength(e.rname)};var gu=qe.txt={};gu.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let s=0;s<e.length;s++)if(typeof e[s]=="string"&&(e[s]=Ke.from(e[s])),!Ke.isBuffer(e[s]))throw new Error("Must be a Buffer");t||(t=Ke.alloc(gu.encodingLength(e))),r||(r=0);let n=r;return r+=2,e.forEach(function(s){t[r++]=s.length,s.copy(t,r,0,s.length),r+=s.length}),t.writeUInt16BE(r-n-2,n),gu.encode.bytes=r-n,t};gu.encode.bytes=0;gu.decode=function(e,t){t||(t=0);let r=t,n=e.readUInt16BE(t);t+=2;let s=[];for(;n>0;){let u=e[t++];if(--n,n<u)throw new Error("Buffer overflow");s.push(e.slice(t,t+u)),t+=u,n-=u}return gu.decode.bytes=t-r,s};gu.decode.bytes=0;gu.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=Ke.byteLength(r)+1:t+=r.length+1}),t};var mu=qe.null={};mu.encode=function(e,t,r){t||(t=Ke.alloc(mu.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=Ke.from(e)),e||(e=Ke.alloc(0));let n=r;r+=2;let s=e.length;return e.copy(t,r,0,s),r+=s,t.writeUInt16BE(r-n-2,n),mu.encode.bytes=r-n,t};mu.encode.bytes=0;mu.decode=function(e,t){t||(t=0);let r=t,n=e.readUInt16BE(t);t+=2;let s=e.slice(t,t+n);return t+=n,mu.decode.bytes=t-r,s};mu.decode.bytes=0;mu.encodingLength=function(e){return e?(Ke.isBuffer(e)?e.length:Ke.byteLength(e))+2:2};var vu=qe.hinfo={};vu.encode=function(e,t,r){t||(t=Ke.alloc(vu.encodingLength(e))),r||(r=0);let n=r;return r+=2,At.encode(e.cpu,t,r),r+=At.encode.bytes,At.encode(e.os,t,r),r+=At.encode.bytes,t.writeUInt16BE(r-n-2,n),vu.encode.bytes=r-n,t};vu.encode.bytes=0;vu.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.cpu=At.decode(e,t),t+=At.decode.bytes,n.os=At.decode(e,t),t+=At.decode.bytes,vu.decode.bytes=t-r,n};vu.decode.bytes=0;vu.encodingLength=function(e){return At.encodingLength(e.cpu)+At.encodingLength(e.os)+2};var es=qe.ptr={},fB=qe.cname=es,hB=qe.dname=es;es.encode=function(e,t,r){return t||(t=Ke.alloc(es.encodingLength(e))),r||(r=0),Te.encode(e,t,r+2),t.writeUInt16BE(Te.encode.bytes,r),es.encode.bytes=Te.encode.bytes+2,t};es.encode.bytes=0;es.decode=function(e,t){t||(t=0);let r=Te.decode(e,t+2);return es.decode.bytes=Te.decode.bytes+2,r};es.decode.bytes=0;es.encodingLength=function(e){return Te.encodingLength(e)+2};var Au=qe.srv={};Au.encode=function(e,t,r){t||(t=Ke.alloc(Au.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),Te.encode(e.target,t,r+8);let n=Te.encode.bytes+6;return t.writeUInt16BE(n,r),Au.encode.bytes=n+2,t};Au.encode.bytes=0;Au.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n={};return n.priority=e.readUInt16BE(t+2),n.weight=e.readUInt16BE(t+4),n.port=e.readUInt16BE(t+6),n.target=Te.decode(e,t+8),Au.decode.bytes=r+2,n};Au.decode.bytes=0;Au.encodingLength=function(e){return 8+Te.encodingLength(e.target)};var Ai=qe.caa={};Ai.ISSUER_CRITICAL=128;Ai.encode=function(e,t,r){let n=Ai.encodingLength(e);return t||(t=Ke.alloc(Ai.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=Ai.ISSUER_CRITICAL),t.writeUInt16BE(n-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,At.encode(e.tag,t,r),r+=At.encode.bytes,t.write(e.value,r),r+=Ke.byteLength(e.value),Ai.encode.bytes=n,t};Ai.encode.bytes=0;Ai.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let n=t,s={};return s.flags=e.readUInt8(t),t+=1,s.tag=At.decode(e,t),t+=At.decode.bytes,s.value=e.toString("utf-8",t,n+r),s.issuerCritical=!!(s.flags&Ai.ISSUER_CRITICAL),Ai.decode.bytes=r+2,s};Ai.decode.bytes=0;Ai.encodingLength=function(e){return At.encodingLength(e.tag)+At.encodingLength(e.value)+2};var Ju=qe.mx={};Ju.encode=function(e,t,r){t||(t=Ke.alloc(Ju.encodingLength(e))),r||(r=0);let n=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,Te.encode(e.exchange,t,r),r+=Te.encode.bytes,t.writeUInt16BE(r-n-2,n),Ju.encode.bytes=r-n,t};Ju.encode.bytes=0;Ju.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.preference=e.readUInt16BE(t),t+=2,n.exchange=Te.decode(e,t),t+=Te.decode.bytes,Ju.decode.bytes=t-r,n};Ju.encodingLength=function(e){return 4+Te.encodingLength(e.exchange)};var Eu=qe.a={};Eu.encode=function(e,t,r){return t||(t=Ke.alloc(Eu.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,Ka.v4.encode(e,t,r),Eu.encode.bytes=6,t};Eu.encode.bytes=0;Eu.decode=function(e,t){t||(t=0),t+=2;let r=Ka.v4.decode(e,t);return Eu.decode.bytes=6,r};Eu.decode.bytes=0;Eu.encodingLength=function(){return 6};var wu=qe.aaaa={};wu.encode=function(e,t,r){return t||(t=Ke.alloc(wu.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,Ka.v6.encode(e,t,r),wu.encode.bytes=18,t};wu.encode.bytes=0;wu.decode=function(e,t){t||(t=0),t+=2;let r=Ka.v6.decode(e,t);return wu.decode.bytes=18,r};wu.decode.bytes=0;wu.encodingLength=function(){return 18};var ni=qe.option={};ni.encode=function(e,t,r){t||(t=Ke.alloc(ni.encodingLength(e))),r||(r=0);let n=r,s=ud.toCode(e.code);if(t.writeUInt16BE(s,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(s){case 8:let u=e.sourcePrefixLength||0,i=e.family||Ka.familyOf(e.ip),o=Ka.encode(e.ip,Ke.alloc),l=Math.ceil(u/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(i,r),r+=2,t.writeUInt8(u,r++),t.writeUInt8(e.scopePrefixLength||0,r++),o.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let f=e.length||0;t.writeUInt16BE(f,r),r+=2,t.fill(0,r,r+f),r+=f;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let E of e.tags)t.writeUInt16BE(E,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return ni.encode.bytes=r-n,t};ni.encode.bytes=0;ni.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=ud.toString(r.code),t+=2;let n=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+n),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let s=Ke.alloc(r.family===1?4:16);e.copy(s,0,t,t+n-4),r.ip=Ka.decode(s);break;case 11:n>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let u=0;u<n;u+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return ni.decode.bytes=n+4,r};ni.decode.bytes=0;ni.encodingLength=function(e){if(e.data)return e.data.length+4;switch(ud.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var wi=qe.opt={};wi.encode=function(e,t,r){t||(t=Ke.alloc(wi.encodingLength(e))),r||(r=0);let n=r,s=Yo(e,ni);return t.writeUInt16BE(s,r),r=Gc(e,ni,t,r+2),wi.encode.bytes=r-n,t};wi.encode.bytes=0;wi.decode=function(e,t){t||(t=0);let r=t,n=[],s=e.readUInt16BE(t);t+=2;let u=0;for(;s>0;)n[u++]=ni.decode(e,t),t+=ni.decode.bytes,s-=ni.decode.bytes;return wi.decode.bytes=t-r,n};wi.decode.bytes=0;wi.encodingLength=function(e){return 2+Yo(e||[],ni)};var Un=qe.dnskey={};Un.PROTOCOL_DNSSEC=3;Un.ZONE_KEY=128;Un.SECURE_ENTRYPOINT=32768;Un.encode=function(e,t,r){t||(t=Ke.alloc(Un.encodingLength(e))),r||(r=0);let n=r,s=e.key;if(!Ke.isBuffer(s))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(Un.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,Un.encode.bytes=r-n,t.writeUInt16BE(Un.encode.bytes-2,n),t};Un.encode.bytes=0;Un.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);if(t+=2,n.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==Un.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,n.algorithm=e.readUInt8(t),t+=1,n.key=e.slice(t,r+s+2),t+=n.key.length,Un.decode.bytes=t-r,n};Un.decode.bytes=0;Un.encodingLength=function(e){return 6+Ke.byteLength(e.key)};var Is=qe.rrsig={};Is.encode=function(e,t,r){t||(t=Ke.alloc(Is.encodingLength(e))),r||(r=0);let n=r,s=e.signature;if(!Ke.isBuffer(s))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(Fu.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,Te.encode(e.signersName,t,r),r+=Te.encode.bytes,s.copy(t,r,0,s.length),r+=s.length,Is.encode.bytes=r-n,t.writeUInt16BE(Is.encode.bytes-2,n),t};Is.encode.bytes=0;Is.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);return t+=2,n.typeCovered=Fu.toString(e.readUInt16BE(t)),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.labels=e.readUInt8(t),t+=1,n.originalTTL=e.readUInt32BE(t),t+=4,n.expiration=e.readUInt32BE(t),t+=4,n.inception=e.readUInt32BE(t),t+=4,n.keyTag=e.readUInt16BE(t),t+=2,n.signersName=Te.decode(e,t),t+=Te.decode.bytes,n.signature=e.slice(t,r+s+2),t+=n.signature.length,Is.decode.bytes=t-r,n};Is.decode.bytes=0;Is.encodingLength=function(e){return 20+Te.encodingLength(e.signersName)+Ke.byteLength(e.signature)};var $s=qe.rp={};$s.encode=function(e,t,r){t||(t=Ke.alloc($s.encodingLength(e))),r||(r=0);let n=r;return r+=2,Te.encode(e.mbox||".",t,r,{mail:!0}),r+=Te.encode.bytes,Te.encode(e.txt||".",t,r),r+=Te.encode.bytes,$s.encode.bytes=r-n,t.writeUInt16BE($s.encode.bytes-2,n),t};$s.encode.bytes=0;$s.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mbox=Te.decode(e,t,{mail:!0})||".",t+=Te.decode.bytes,n.txt=Te.decode(e,t)||".",t+=Te.decode.bytes,$s.decode.bytes=t-r,n};$s.decode.bytes=0;$s.encodingLength=function(e){return 2+Te.encodingLength(e.mbox||".")+Te.encodingLength(e.txt||".")};var Xr={};Xr.encode=function(e,t,r){t||(t=Ke.alloc(Xr.encodingLength(e))),r||(r=0);let n=r;for(var s=[],u=0;u<e.length;u++){var i=Fu.toType(e[u]);s[i>>8]===void 0&&(s[i>>8]=[]),s[i>>8][i>>3&31]|=1<<7-(i&7)}for(u=0;u<s.length;u++)if(s[u]!==void 0){var o=Ke.from(s[u]);t.writeUInt8(u,r),r+=1,t.writeUInt8(o.length,r),r+=1,o.copy(t,r),r+=o.length}return Xr.encode.bytes=r-n,t};Xr.encode.bytes=0;Xr.decode=function(e,t,r){t||(t=0);let n=t;for(var s=[];t-n<r;){var u=e.readUInt8(t);t+=1;var i=e.readUInt8(t);t+=1;for(var o=0;o<i;o++)for(var l=e.readUInt8(t+o),f=0;f<8;f++)if(l&1<<7-f){var d=Fu.toString(u<<8|o<<3|f);s.push(d)}t+=i}return Xr.decode.bytes=t-n,s};Xr.decode.bytes=0;Xr.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var n=Fu.toType(e[r]);t[n>>8]=Math.max(t[n>>8]||0,n&255)}var s=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(s+=2+Math.ceil((t[r]+1)/8));return s};var Ps=qe.nsec={};Ps.encode=function(e,t,r){t||(t=Ke.alloc(Ps.encodingLength(e))),r||(r=0);let n=r;return r+=2,Te.encode(e.nextDomain,t,r),r+=Te.encode.bytes,Xr.encode(e.rrtypes,t,r),r+=Xr.encode.bytes,Ps.encode.bytes=r-n,t.writeUInt16BE(Ps.encode.bytes-2,n),t};Ps.encode.bytes=0;Ps.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);return t+=2,n.nextDomain=Te.decode(e,t),t+=Te.decode.bytes,n.rrtypes=Xr.decode(e,t,s-(t-r)),t+=Xr.decode.bytes,Ps.decode.bytes=t-r,n};Ps.decode.bytes=0;Ps.encodingLength=function(e){return 2+Te.encodingLength(e.nextDomain)+Xr.encodingLength(e.rrtypes)};var Rs=qe.nsec3={};Rs.encode=function(e,t,r){t||(t=Ke.alloc(Rs.encodingLength(e))),r||(r=0);let n=r,s=e.salt;if(!Ke.isBuffer(s))throw new Error("salt must be a Buffer");let u=e.nextDomain;if(!Ke.isBuffer(u))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(s.length,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,t.writeUInt8(u.length,r),r+=1,u.copy(t,r,0,u.length),r+=u.length,Xr.encode(e.rrtypes,t,r),r+=Xr.encode.bytes,Rs.encode.bytes=r-n,t.writeUInt16BE(Rs.encode.bytes-2,n),t};Rs.encode.bytes=0;Rs.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);t+=2,n.algorithm=e.readUInt8(t),t+=1,n.flags=e.readUInt8(t),t+=1,n.iterations=e.readUInt16BE(t),t+=2;let u=e.readUInt8(t);t+=1,n.salt=e.slice(t,t+u),t+=u;let i=e.readUInt8(t);return t+=1,n.nextDomain=e.slice(t,t+i),t+=i,n.rrtypes=Xr.decode(e,t,s-(t-r)),t+=Xr.decode.bytes,Rs.decode.bytes=t-r,n};Rs.decode.bytes=0;Rs.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Xr.encodingLength(e.rrtypes)};var Ts=qe.ds={};Ts.encode=function(e,t,r){t||(t=Ke.alloc(Ts.encodingLength(e))),r||(r=0);let n=r,s=e.digest;if(!Ke.isBuffer(s))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,Ts.encode.bytes=r-n,t.writeUInt16BE(Ts.encode.bytes-2,n),t};Ts.encode.bytes=0;Ts.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);return t+=2,n.keyTag=e.readUInt16BE(t),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.digestType=e.readUInt8(t),t+=1,n.digest=e.slice(t,r+s+2),t+=n.digest.length,Ts.decode.bytes=t-r,n};Ts.decode.bytes=0;Ts.encodingLength=function(e){return 6+Ke.byteLength(e.digest)};var Ei=qe.sshfp={};Ei.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};Ei.encode=function(t,r,n){r||(r=Ke.alloc(Ei.encodingLength(t))),n||(n=0);let s=n;n+=2,r[n]=t.algorithm,n+=1,r[n]=t.hash,n+=1;let u=Ke.from(t.fingerprint.toUpperCase(),"hex");if(u.length!==Ei.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return u.copy(r,n),n+=u.byteLength,Ei.encode.bytes=n-s,r.writeUInt16BE(Ei.encode.bytes-2,s),r};Ei.encode.bytes=0;Ei.decode=function(t,r){r||(r=0);let n=r,s={};r+=2,s.algorithm=t[r],r+=1,s.hash=t[r],r+=1;let u=Ei.getFingerprintLengthForHashType(s.hash);return s.fingerprint=t.slice(r,r+u).toString("hex").toUpperCase(),r+=u,Ei.decode.bytes=r-n,s};Ei.decode.bytes=0;Ei.encodingLength=function(e){return 4+Ke.from(e.fingerprint,"hex").byteLength};var xs=qe.naptr={};xs.encode=function(e,t,r){t||(t=Ke.alloc(xs.encodingLength(e))),r||(r=0);let n=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,At.encode(e.flags,t,r),r+=At.encode.bytes,At.encode(e.services,t,r),r+=At.encode.bytes,At.encode(e.regexp,t,r),r+=At.encode.bytes,Te.encode(e.replacement,t,r),r+=Te.encode.bytes,xs.encode.bytes=r-n,t.writeUInt16BE(xs.encode.bytes-2,n),t};xs.encode.bytes=0;xs.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.order=e.readUInt16BE(t),t+=2,n.preference=e.readUInt16BE(t),t+=2,n.flags=At.decode(e,t),t+=At.decode.bytes,n.services=At.decode(e,t),t+=At.decode.bytes,n.regexp=At.decode(e,t),t+=At.decode.bytes,n.replacement=Te.decode(e,t),t+=Te.decode.bytes,xs.decode.bytes=t-r,n};xs.decode.bytes=0;xs.encodingLength=function(e){return At.encodingLength(e.flags)+At.encodingLength(e.services)+At.encodingLength(e.regexp)+Te.encodingLength(e.replacement)+6};var Os=qe.tlsa={};Os.encode=function(e,t,r){t||(t=Ke.alloc(Os.encodingLength(e))),r||(r=0);let n=r,s=e.certificate;if(!Ke.isBuffer(s))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,Os.encode.bytes=r-n,t.writeUInt16BE(Os.encode.bytes-2,n),t};Os.encode.bytes=0;Os.decode=function(e,t){t||(t=0);let r=t,n={},s=e.readUInt16BE(t);return t+=2,n.usage=e.readUInt8(t),t+=1,n.selector=e.readUInt8(t),t+=1,n.matchingType=e.readUInt8(t),t+=1,n.certificate=e.slice(t,r+s+2),t+=n.certificate.length,Os.decode.bytes=t-r,n};Os.decode.bytes=0;Os.encodingLength=function(e){return 5+Ke.byteLength(e.certificate)};var od=qe.record=function(e){switch(e.toUpperCase()){case"A":return Eu;case"PTR":return es;case"CNAME":return fB;case"DNAME":return hB;case"TXT":return gu;case"NULL":return mu;case"AAAA":return wu;case"SRV":return Au;case"HINFO":return vu;case"CAA":return Ai;case"NS":return pu;case"SOA":return du;case"MX":return Ju;case"OPT":return wi;case"DNSKEY":return Un;case"RRSIG":return Is;case"RP":return $s;case"NSEC":return Ps;case"NSEC3":return Rs;case"SSHFP":return Ei;case"DS":return Ts;case"NAPTR":return xs;case"TLSA":return Os}return hu},hn=qe.answer={};hn.encode=function(e,t,r){t||(t=Ke.alloc(hn.encodingLength(e))),r||(r=0);let n=r;if(Te.encode(e.name,t,r),r+=Te.encode.bytes,t.writeUInt16BE(Fu.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,wi.encode(e.options||[],t,r),r+=wi.encode.bytes}else{let s=rh.toClass(e.class===void 0?"IN":e.class);e.flush&&(s|=ad),t.writeUInt16BE(s,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let u=od(e.type);u.encode(e.data,t,r),r+=u.encode.bytes}return hn.encode.bytes=r-n,t};hn.encode.bytes=0;hn.decode=function(e,t){t||(t=0);let r={},n=t;if(r.name=Te.decode(e,t),t+=Te.decode.bytes,r.type=Fu.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=wi.decode(e,t+8),t+=8+wi.decode.bytes;else{let s=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=rh.toString(s&cB),r.flush=!!(s&ad);let u=od(r.type);r.data=u.decode(e,t+8),t+=8+u.decode.bytes}return hn.decode.bytes=t-n,r};hn.decode.bytes=0;hn.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return Te.encodingLength(e.name)+8+od(e.type).encodingLength(t)};var ts=qe.question={};ts.encode=function(e,t,r){t||(t=Ke.alloc(ts.encodingLength(e))),r||(r=0);let n=r;return Te.encode(e.name,t,r),r+=Te.encode.bytes,t.writeUInt16BE(Fu.toType(e.type),r),r+=2,t.writeUInt16BE(rh.toClass(e.class===void 0?"IN":e.class),r),r+=2,ts.encode.bytes=r-n,e};ts.encode.bytes=0;ts.decode=function(e,t){t||(t=0);let r=t,n={};return n.name=Te.decode(e,t),t+=Te.decode.bytes,n.type=Fu.toString(e.readUInt16BE(t)),t+=2,n.class=rh.toString(e.readUInt16BE(t)),t+=2,!!(n.class&wA)&&(n.class&=lB),ts.decode.bytes=t-r,n};ts.decode.bytes=0;ts.encodingLength=function(e){return Te.encodingLength(e.name)+4};qe.AUTHORITATIVE_ANSWER=1024;qe.TRUNCATED_RESPONSE=512;qe.RECURSION_DESIRED=256;qe.RECURSION_AVAILABLE=128;qe.AUTHENTIC_DATA=32;qe.CHECKING_DISABLED=16;qe.DNSSEC_OK=32768;qe.encode=function(e,t,r){let n=!t;n&&(t=Ke.alloc(qe.encodingLength(e))),r||(r=0);let s=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),rs.encode(e,t,r),r+=rs.encode.bytes,r=Gc(e.questions,ts,t,r),r=Gc(e.answers,hn,t,r),r=Gc(e.authorities,hn,t,r),r=Gc(e.additionals,hn,t,r),qe.encode.bytes=r-s,n&&qe.encode.bytes!==t.length?t.slice(0,qe.encode.bytes):t};qe.encode.bytes=0;qe.decode=function(e,t){t||(t=0);let r=t,n=rs.decode(e,t);return t+=rs.decode.bytes,t=th(n.questions,ts,e,t),t=th(n.answers,hn,e,t),t=th(n.authorities,hn,e,t),t=th(n.additionals,hn,e,t),qe.decode.bytes=t-r,n};qe.decode.bytes=0;qe.encodingLength=function(e){return rs.encodingLength(e)+Yo(e.questions||[],ts)+Yo(e.answers||[],hn)+Yo(e.authorities||[],hn)+Yo(e.additionals||[],hn)};qe.streamEncode=function(e){let t=qe.encode(e),r=Ke.alloc(2);r.writeUInt16BE(t.byteLength);let n=Ke.concat([r,t]);return qe.streamEncode.bytes=n.byteLength,n};qe.streamEncode.bytes=0;qe.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=qe.decode(e.slice(2));return qe.streamDecode.bytes=qe.decode.bytes,r};qe.streamDecode.bytes=0;function Yo(e,t){let r=0;for(let n=0;n<e.length;n++)r+=t.encodingLength(e[n]);return r}function Gc(e,t,r,n){for(let s=0;s<e.length;s++)t.encode(e[s],r,n),n+=t.encode.bytes;return n}function th(e,t,r,n){for(let s=0;s<e.length;s++)e[s]=t.decode(r,n),n+=t.decode.bytes;return n}});var fh=Be((bO,UA)=>{"use strict";var OI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},vd=class e extends Error{constructor(t,r,n){super(t),OI(this,e.prototype),this.name="GrammarError",this.location=r,n===void 0&&(n=[]),this.diagnostics=n,this.stage=null,this.problems=[["error",t,r,n]]}toString(){let t=super.toString();this.location&&(t+=`
at `,this.location.source!==void 0&&this.location.source!==null&&(t+=`${this.location.source}:`),t+=`${this.location.start.line}:${this.location.start.column}`);for(let r of this.diagnostics)t+=`
from `,r.location.source!==void 0&&r.location.source!==null&&(t+=`${r.location.source}:`),t+=`${r.location.start.line}:${r.location.start.column}: ${r.message}`;return t}format(t){let r=t.map(({source:u,text:i})=>({source:u,text:i.split(/\r\n|\n|\r/g)}));function n(u,i,o=""){let l="",f=r.find(({source:E})=>E===u.source),d=u.start;if(f){let E=u.end,p=f.text[d.line-1],w=(d.line===E.line?E.column:p.length+1)-d.column||1;o&&(l+=`
note: ${o}`),l+=`
--> ${u.source}:${d.line}:${d.column}
${"".padEnd(i)} |
${d.line.toString().padStart(i)} | ${p}
${"".padEnd(i)} | ${"".padEnd(d.column-1)}${"".padEnd(w,"^")}`}else l+=`
at ${u.source}:${d.line}:${d.column}`,o&&(l+=`: ${o}`);return l}function s(u,i,o,l=[]){let f;o?f=l.reduce((E,{location:p})=>Math.max(E,p.start.line),o.start.line):f=Math.max.apply(null,l.map(E=>E.location.start.line)),f=f.toString().length;let d=`${u}: ${i}`;o&&(d+=n(o,f));for(let E of l)d+=n(E.location,f,E.message);return d}return this.problems.filter(u=>u[0]!=="info").map(u=>s(...u)).join(`
`)}};UA.exports=vd});var qi=Be((_O,HA)=>{"use strict";var kI={build(e){function t(i,...o){return e[i.type](i,...o)}function r(){}function n(i,...o){return t(i.expression,...o)}function s(i){return function(o,...l){o[i].forEach(f=>t(f,...l))}}let u={grammar(i,...o){i.topLevelInitializer&&t(i.topLevelInitializer,...o),i.initializer&&t(i.initializer,...o),i.rules.forEach(l=>t(l,...o))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:s("alternatives"),action:n,sequence:s("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(u).forEach(i=>{Object.prototype.hasOwnProperty.call(e,i)||(e[i]=u[i])}),t}};HA.exports=kI});var Zu=Be((BO,MA)=>{"use strict";var NI=qi(),jA={findRule(e,t){for(let r=0;r<e.rules.length;r++)if(e.rules[r].name===t)return e.rules[r]},indexOfRule(e,t){for(let r=0;r<e.rules.length;r++)if(e.rules[r].name===t)return r;return-1},alwaysConsumesOnSuccess(e,t){function r(){return!0}function n(){return!1}let s=NI.build({choice(u){return u.alternatives.every(s)},sequence(u){return u.elements.some(s)},simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(u){let i=jA.findRule(e,u.name);return i?s(i):void 0},literal(u){return u.value!==""},class:r,any:r});return s(t)}};MA.exports=jA});var Ad=Be((IO,qA)=>{"use strict";var LI={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29};qA.exports=LI});var Ed=Be(($O,KA)=>{"use strict";var UI=qi(),HI=Zu(),jI=fh(),Xc=1,Ga=0,Zc=-1;function hh(e){function t(i){return i.match=Ga}function r(i){return u(i.expression),i.match=Xc}function n(i){return i.match=u(i.expression)}function s(i,o){let l=i.length,f=0,d=0;for(let E=0;E<l;++E){let p=u(i[E]);p===Xc&&++f,p===Zc&&++d}return f===l?Xc:o?d===l?Zc:Ga:d>0?Zc:Ga}let u=UI.build({rule(i){let o,l=0;if(typeof i.match>"u"){i.match=Ga;do if(o=i.match,i.match=u(i.expression),++l>6)throw new jI("Infinity cycle detected when trying to evaluate node match result",i.location);while(o!==i.match)}return i.match},named:n,choice(i){return i.match=s(i.alternatives,!0)},action:n,sequence(i){return i.match=s(i.elements,!1)},labeled:n,text:n,simple_and:n,simple_not(i){return i.match=-u(i.expression)},optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:t,semantic_not:t,rule_ref(i){let o=HI.findRule(e,i.name);return i.match=u(o)},literal(i){let o=i.value.length===0?Xc:Ga;return i.match=o},class(i){let o=i.parts.length===0?Zc:Ga;return i.match=o},any:t});u(e)}hh.ALWAYS_MATCH=Xc;hh.SOMETIMES_MATCH=Ga;hh.NEVER_MATCH=Zc;KA.exports=hh});var GA=Be((PO,VA)=>{"use strict";var MI=Zu(),xe=Ad(),qI=qi(),{ALWAYS_MATCH:Zo,SOMETIMES_MATCH:wd,NEVER_MATCH:Fd}=Ed();function KI(e){let t=[],r=[],n=[],s=[];function u(F){let S=t.indexOf(F);return S===-1?t.push(F)-1:S}function i(F){let S={value:F.parts,inverted:F.inverted,ignoreCase:F.ignoreCase},B=JSON.stringify(S),_=r.findIndex(K=>JSON.stringify(K)===B);return _===-1?r.push(S)-1:_}function o(F){let S=JSON.stringify(F),B=n.findIndex(_=>JSON.stringify(_)===S);return B===-1?n.push(F)-1:B}function l(F,S,B){let _={predicate:F,params:S,body:B.code,location:B.codeLocation},K=JSON.stringify(_),G=s.findIndex(b=>JSON.stringify(b)===K);return G===-1?s.push(_)-1:G}function f(F){let S={};return Object.keys(F).forEach(B=>{S[B]=F[B]}),S}function d(F,...S){return F.concat(...S)}function E(F,S,B,_){return F===Zo?B:F===Fd?_:S.concat([B.length,_.length],B,_)}function p(F,S){return F.concat([S.length],S)}function h(F,S,B,_){let K=Object.keys(B).map(G=>_-B[G]);return[xe.CALL,F,S,K.length].concat(K)}function w(F,S,B){let _=F.match|0;return d([xe.PUSH_CURR_POS],[xe.SILENT_FAILS_ON],A(F,{sp:B.sp+1,env:f(B.env),action:null}),[xe.SILENT_FAILS_OFF],E(S?-_:_,[S?xe.IF_ERROR:xe.IF_NOT_ERROR],d([xe.POP],[S?xe.POP:xe.POP_CURR_POS],[xe.PUSH_UNDEFINED]),d([xe.POP],[S?xe.POP_CURR_POS:xe.POP],[xe.PUSH_FAILED])))}function v(F,S,B){let _=l(!0,Object.keys(B.env),F);return d([xe.UPDATE_SAVED_POS],h(_,0,B.env,B.sp),E(F.match|0,[xe.IF],d([xe.POP],S?[xe.PUSH_FAILED]:[xe.PUSH_UNDEFINED]),d([xe.POP],S?[xe.PUSH_UNDEFINED]:[xe.PUSH_FAILED])))}function D(F){return p([xe.WHILE_NOT_ERROR],d([xe.APPEND],F))}let A=qI.build({grammar(F){F.rules.forEach(A),F.literals=t,F.classes=r,F.expectations=n,F.functions=s},rule(F){F.bytecode=A(F.expression,{sp:-1,env:{},pluck:[],action:null})},named(F,S){let B=F.match|0,_=B===Fd?null:o({type:"rule",value:F.name});return d([xe.SILENT_FAILS_ON],A(F.expression,S),[xe.SILENT_FAILS_OFF],E(B,[xe.IF_ERROR],[xe.FAIL,_],[]))},choice(F,S){function B(_,K){let G=_[0].match|0,b=A(_[0],{sp:K.sp,env:f(K.env),action:null});return G===Zo?b:d(b,_.length>1?E(wd,[xe.IF_ERROR],d([xe.POP],B(_.slice(1),K)),[]):[])}return B(F.alternatives,S)},action(F,S){let B=f(S.env),_=F.expression.type!=="sequence"||F.expression.elements.length===0,K=A(F.expression,{sp:S.sp+(_?1:0),env:B,action:F}),G=F.expression.match|0,b=_&&G!==Fd?l(!1,Object.keys(B),F):null;return _?d([xe.PUSH_CURR_POS],K,E(G,[xe.IF_NOT_ERROR],d([xe.LOAD_SAVED_POS,1],h(b,1,B,S.sp+2)),[]),[xe.NIP]):K},sequence(F,S){function B(_,K){if(_.length>0){let G=F.elements.length-_.length+1;return d(A(_[0],{sp:K.sp,env:K.env,pluck:K.pluck,action:null}),E(_[0].match|0,[xe.IF_NOT_ERROR],B(_.slice(1),{sp:K.sp+1,env:K.env,pluck:K.pluck,action:K.action}),d(G>1?[xe.POP_N,G]:[xe.POP],[xe.POP_CURR_POS],[xe.PUSH_FAILED])))}else{if(K.pluck.length>0)return d([xe.PLUCK,F.elements.length+1,K.pluck.length],K.pluck.map(G=>K.sp-G));if(K.action){let G=l(!1,Object.keys(K.env),K.action);return d([xe.LOAD_SAVED_POS,F.elements.length],h(G,F.elements.length+1,K.env,K.sp))}else return d([xe.WRAP,F.elements.length],[xe.NIP])}}return d([xe.PUSH_CURR_POS],B(F.elements,{sp:S.sp+1,env:S.env,pluck:[],action:S.action}))},labeled(F,S){let B=S.env,_=F.label,K=S.sp+1;return _&&(B=f(S.env),S.env[F.label]=K),F.pick&&S.pluck.push(K),A(F.expression,{sp:S.sp,env:B,action:null})},text(F,S){return d([xe.PUSH_CURR_POS],A(F.expression,{sp:S.sp+1,env:f(S.env),action:null}),E(F.match|0,[xe.IF_NOT_ERROR],d([xe.POP],[xe.TEXT]),[xe.NIP]))},simple_and(F,S){return w(F.expression,!1,S)},simple_not(F,S){return w(F.expression,!0,S)},optional(F,S){return d(A(F.expression,{sp:S.sp,env:f(S.env),action:null}),E(-(F.expression.match|0),[xe.IF_ERROR],d([xe.POP],[xe.PUSH_NULL]),[]))},zero_or_more(F,S){let B=A(F.expression,{sp:S.sp+1,env:f(S.env),action:null});return d([xe.PUSH_EMPTY_ARRAY],B,D(B),[xe.POP])},one_or_more(F,S){let B=A(F.expression,{sp:S.sp+1,env:f(S.env),action:null});return d([xe.PUSH_EMPTY_ARRAY],B,E(F.expression.match|0,[xe.IF_NOT_ERROR],d(D(B),[xe.POP]),d([xe.POP],[xe.POP],[xe.PUSH_FAILED])))},group(F,S){return A(F.expression,{sp:S.sp,env:f(S.env),action:null})},semantic_and(F,S){return v(F,!1,S)},semantic_not(F,S){return v(F,!0,S)},rule_ref(F){return[xe.RULE,MI.indexOfRule(e,F.name)]},literal(F){if(F.value.length>0){let S=F.match|0,_=S===wd||S===Zo&&!F.ignoreCase?u(F.ignoreCase?F.value.toLowerCase():F.value):null,K=S!==Zo?o({type:"literal",value:F.value,ignoreCase:F.ignoreCase}):null;return E(S,F.ignoreCase?[xe.MATCH_STRING_IC,_]:[xe.MATCH_STRING,_],F.ignoreCase?[xe.ACCEPT_N,F.value.length]:[xe.ACCEPT_STRING,_],[xe.FAIL,K])}return[xe.PUSH_EMPTY_STRING]},class(F){let S=F.match|0,B=S===wd?i(F):null,_=S!==Zo?o({type:"class",value:F.parts,inverted:F.inverted,ignoreCase:F.ignoreCase}):null;return E(S,[xe.MATCH_CHAR_CLASS,B],[xe.ACCEPT_N,1],[xe.FAIL,_])},any(F){let S=F.match|0,B=S!==Zo?o({type:"any"}):null;return E(S,[xe.MATCH_ANY],[xe.ACCEPT_N,1],[xe.FAIL,B])}});A(e)}VA.exports=KI});var YA=Be((RO,zA)=>{"use strict";var Cd=class{constructor(t,r,n){this.sp=-1,this.maxSp=-1,this.varName=r,this.ruleName=t,this.type=n}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}<x>' at an index ${t}`);return this.varName+t}push(t){let r=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),r}pop(t){return t!==void 0?(this.sp-=t,Array.from({length:t},(r,n)=>this.name(this.sp+1+n))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,r)=>this.name(r)).join(", ")+";"}checkedIf(t,r,n){let s=this.sp;if(r(),n){let u=this.sp;if(this.sp=s,n(),u!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+s+", after then: "+u+", after else: "+this.sp+").")}}checkedLoop(t,r){let n=this.sp;if(r(),n!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+n+", after: "+this.sp+").")}};zA.exports=Cd});var Dd=Be((TO,WA)=>{"use strict";WA.exports="2.0.1"});var JA=Be(ph=>{"use strict";function yu(e){return e.charCodeAt(0).toString(16).toUpperCase()}ph.hex=yu;function VI(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+yu(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+yu(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+yu(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+yu(t))}ph.stringEscape=VI;function GI(e){return e.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+yu(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+yu(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+yu(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+yu(t))}ph.regexpClassEscape=GI});var QA=Be(ZA=>{var XA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ZA.encode=function(e){if(0<=e&&e<XA.length)return XA[e];throw new TypeError("Must be between 0 and 63: "+e)}});var nE=Be(rE=>{var zI=QA(),eE=5,tE=1<<eE,YI=tE-1,WI=tE;function JI(e){return e<0?(-e<<1)+1:(e<<1)+0}rE.encode=function(t){let r="",n,s=JI(t);do n=s&YI,s>>>=eE,s>0&&(n|=WI),r+=zI.encode(n);while(s>0);return r}});var gh=Be(ea=>{function XI(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}ea.getArg=XI;var sE=function(){return!("__proto__"in Object.create(null))}();function uE(e){return e}function ZI(e){return aE(e)?"$"+e:e}ea.toSetString=sE?uE:ZI;function QI(e){return aE(e)?e.slice(1):e}ea.fromSetString=sE?uE:QI;function aE(e){if(!e)return!1;let t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(let r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function iE(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function e7(e,t){let r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=iE(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:iE(e.name,t.name)}ea.compareByGeneratedPositionsInflated=e7;var yd="http:",Qc=`${yd}//host`;function oE(e){return t=>{let r=el(t),n=Sd(t),s=new URL(t,n);e(s);let u=s.toString();return r==="absolute"?u:r==="scheme-relative"?u.slice(yd.length):r==="path-absolute"?u.slice(Qc.length):bd(n,u)}}function Qu(e,t){return new URL(e,t).toString()}function t7(e,t){let r=0;do{let n=e+r++;if(t.indexOf(n)===-1)return n}while(!0)}function Sd(e){let t=e.split("..").length-1,r=t7("p",e),n=`${Qc}/`;for(let s=0;s<t;s++)n+=`${r}/`;return n}var r7=/^[A-Za-z0-9\+\-\.]+:/;function el(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":r7.test(e)?"absolute":"path-relative"}function bd(e,t){typeof e=="string"&&(e=new URL(e)),typeof t=="string"&&(t=new URL(t));let r=t.pathname.split("/"),n=e.pathname.split("/");for(n.length>0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+t.search+t.hash}var n7=oE(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),dh=oE(e=>{});ea.normalize=dh;function i7(e,t){let r=el(t),n=el(e);if(e=n7(e),r==="absolute")return Qu(t,void 0);if(n==="absolute")return Qu(t,e);if(r==="scheme-relative")return dh(t);if(n==="scheme-relative")return Qu(t,Qu(e,Qc)).slice(yd.length);if(r==="path-absolute")return dh(t);if(n==="path-absolute")return Qu(t,Qu(e,Qc)).slice(Qc.length);let s=Sd(t+e),u=Qu(t,Qu(e,s));return bd(s,u)}ea.join=i7;function s7(e,t){let r=u7(e,t);return typeof r=="string"?r:dh(t)}ea.relative=s7;function u7(e,t){if(el(e)!==el(t))return null;let n=Sd(e+t),s=new URL(e,n),u=new URL(t,n);try{new URL("",u.toString())}catch{return null}return u.protocol!==s.protocol||u.user!==s.user||u.password!==s.password||u.hostname!==s.hostname||u.port!==s.port?null:bd(s,u)}});var lE=Be(cE=>{var _d=class e{constructor(){this._array=[],this._set=new Map}static fromArray(t,r){let n=new e;for(let s=0,u=t.length;s<u;s++)n.add(t[s],r);return n}size(){return this._set.size}add(t,r){let n=this.has(t),s=this._array.length;(!n||r)&&this._array.push(t),n||this._set.set(t,s)}has(t){return this._set.has(t)}indexOf(t){let r=this._set.get(t);if(r>=0)return r;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)}toArray(){return this._array.slice()}};cE.ArraySet=_d});var pE=Be(hE=>{var fE=gh();function a7(e,t){let r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,u=t.generatedColumn;return n>r||n==r&&u>=s||fE.compareByGeneratedPositionsInflated(e,t)<=0}var Bd=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(t,r){this._array.forEach(t,r)}add(t){a7(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(fE.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};hE.MappingList=Bd});var Id=Be(dE=>{var tl=nE(),Or=gh(),mh=lE().ArraySet,o7=pE().MappingList,vh=class e{constructor(t){t||(t={}),this._file=Or.getArg(t,"file",null),this._sourceRoot=Or.getArg(t,"sourceRoot",null),this._skipValidation=Or.getArg(t,"skipValidation",!1),this._sources=new mh,this._names=new mh,this._mappings=new o7,this._sourcesContents=null}static fromSourceMap(t){let r=t.sourceRoot,n=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(s){let u={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(u.source=s.source,r!=null&&(u.source=Or.relative(r,u.source)),u.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(u.name=s.name)),n.addMapping(u)}),t.sources.forEach(function(s){let u=s;r!=null&&(u=Or.relative(r,s)),n._sources.has(u)||n._sources.add(u);let i=t.sourceContentFor(s);i!=null&&n.setSourceContent(s,i)}),n}addMapping(t){let r=Or.getArg(t,"generated"),n=Or.getArg(t,"original",null),s=Or.getArg(t,"source",null),u=Or.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,u),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),u!=null&&(u=String(u),this._names.has(u)||this._names.add(u)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:s,name:u})}setSourceContent(t,r){let n=t;this._sourceRoot!=null&&(n=Or.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Or.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Or.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(t,r,n){let s=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);s=t.file}let u=this._sourceRoot;u!=null&&(s=Or.relative(u,s));let i=this._mappings.toArray().length>0?new mh:this._sources,o=new mh;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){let E=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});E.source!=null&&(l.source=E.source,n!=null&&(l.source=Or.join(n,l.source)),u!=null&&(l.source=Or.relative(u,l.source)),l.originalLine=E.line,l.originalColumn=E.column,E.name!=null&&(l.name=E.name))}let f=l.source;f!=null&&!i.has(f)&&i.add(f);let d=l.name;d!=null&&!o.has(d)&&o.add(d)},this),this._sources=i,this._names=o,t.sources.forEach(function(l){let f=t.sourceContentFor(l);f!=null&&(n!=null&&(l=Or.join(n,l)),u!=null&&(l=Or.relative(u,l)),this.setSourceContent(l,f))},this)}_validateMapping(t,r,n,s){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!s)){if(!(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:s}))}}_serializeMappings(){let t=0,r=1,n=0,s=0,u=0,i=0,o="",l,f,d,E,p=this._mappings.toArray();for(let h=0,w=p.length;h<w;h++){if(f=p[h],l="",f.generatedLine!==r)for(t=0;f.generatedLine!==r;)l+=";",r++;else if(h>0){if(!Or.compareByGeneratedPositionsInflated(f,p[h-1]))continue;l+=","}l+=tl.encode(f.generatedColumn-t),t=f.generatedColumn,f.source!=null&&(E=this._sources.indexOf(f.source),l+=tl.encode(E-i),i=E,l+=tl.encode(f.originalLine-1-s),s=f.originalLine-1,l+=tl.encode(f.originalColumn-n),n=f.originalColumn,f.name!=null&&(d=this._names.indexOf(f.name),l+=tl.encode(d-u),u=d)),o+=l}return o}_generateSourcesContent(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Or.relative(r,n));let s=Or.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null},this)}toJSON(){let t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}};vh.prototype._version=3;dE.SourceMapGenerator=vh});var mE=Be(gE=>{var c7=Id().SourceMapGenerator,Ah=gh(),l7=/(\r?\n)/,f7=10,Qo="$$$isSourceNode$$$",$d=class e{constructor(t,r,n,s,u){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=n??null,this.name=u??null,this[Qo]=!0,s!=null&&this.add(s)}static fromStringWithSourceMap(t,r,n){let s=new e,u=t.split(l7),i=0,o=function(){let h=v(),w=v()||"";return h+w;function v(){return i<u.length?u[i++]:void 0}},l=1,f=0,d=null,E;return r.eachMapping(function(h){if(d!==null)if(l<h.generatedLine)p(d,o()),l++,f=0;else{E=u[i]||"";let w=E.substr(0,h.generatedColumn-f);u[i]=E.substr(h.generatedColumn-f),f=h.generatedColumn,p(d,w),d=h;return}for(;l<h.generatedLine;)s.add(o()),l++;f<h.generatedColumn&&(E=u[i]||"",s.add(E.substr(0,h.generatedColumn)),u[i]=E.substr(h.generatedColumn),f=h.generatedColumn),d=h},this),i<u.length&&(d&&p(d,o()),s.add(u.splice(i).join(""))),r.sources.forEach(function(h){let w=r.sourceContentFor(h);w!=null&&(n!=null&&(h=Ah.join(n,h)),s.setSourceContent(h,w))}),s;function p(h,w){if(h===null||h.source===void 0)s.add(w);else{let v=n?Ah.join(n,h.source):h.source;s.add(new e(h.originalLine,h.originalColumn,v,w,h.name))}}}add(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Qo]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}prepend(t){if(Array.isArray(t))for(let r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Qo]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}walk(t){let r;for(let n=0,s=this.children.length;n<s;n++)r=this.children[n],r[Qo]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})}join(t){let r,n,s=this.children.length;if(s>0){for(r=[],n=0;n<s-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this}replaceRight(t,r){let n=this.children[this.children.length-1];return n[Qo]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this}setSourceContent(t,r){this.sourceContents[Ah.toSetString(t)]=r}walkSourceContents(t){for(let n=0,s=this.children.length;n<s;n++)this.children[n][Qo]&&this.children[n].walkSourceContents(t);let r=Object.keys(this.sourceContents);for(let n=0,s=r.length;n<s;n++)t(Ah.fromSetString(r[n]),this.sourceContents[r[n]])}toString(){let t="";return this.walk(function(r){t+=r}),t}toStringWithSourceMap(t){let r={code:"",line:1,column:0},n=new c7(t),s=!1,u=null,i=null,o=null,l=null;return this.walk(function(f,d){r.code+=f,d.source!==null&&d.line!==null&&d.column!==null?((u!==d.source||i!==d.line||o!==d.column||l!==d.name)&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),u=d.source,i=d.line,o=d.column,l=d.name,s=!0):s&&(n.addMapping({generated:{line:r.line,column:r.column}}),u=null,s=!1);for(let E=0,p=f.length;E<p;E++)f.charCodeAt(E)===f7?(r.line++,r.column=0,E+1===p?(u=null,s=!1):s&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(f,d){n.setSourceContent(f,d)}),{code:r.code,map:n}}};gE.SourceNode=$d});var vE=Be(Pd=>{Pd.SourceMapGenerator=Id().SourceMapGenerator;Pd.SourceNode=mE().SourceNode});var FE=Be((qO,wE)=>{"use strict";var h7=Zu(),Lt=Ad(),p7=YA(),d7=Dd(),{stringEscape:yi,regexpClassEscape:Rd}=JA(),{SourceNode:Ki}=vE();function EE(e,t,r){let n=t.start.line,s=t.start.column-1,u=e.split(`
`);return u.length===1?new Ki(n,s,t.source,e,r):new Ki(null,null,t.source,u.map((i,o)=>new Ki(n+o,o===0?s:0,t.source,o===u.length-1?i:[i,`
`],r)))}function AE(e,t,r,n,s){return r?new Ki(null,null,r.source,[e,EE(t,r,s),new Ki(r.end.line,r.end.column-1,r.source,n)]):new Ki(null,null,null,[e,t,n])}function g7(e,t){function r(v){return v instanceof Ki?v:v.replace(/^(.+)$/gm," $1")}function n(v){return"peg$c"+v}function s(v){return"peg$r"+v}function u(v){return"peg$e"+v}function i(v){return"peg$f"+v}function o(v){return"peg$parse"+v}function l(){function v(S){return'"'+yi(S)+'"'}function D(S){return"/^["+(S.inverted?"^":"")+S.value.map(B=>Array.isArray(B)?Rd(B[0])+"-"+Rd(B[1]):Rd(B)).join("")+"]/"+(S.ignoreCase?"i":"")}function A(S){switch(S.type){case"rule":return'peg$otherExpectation("'+yi(S.value)+'")';case"literal":return'peg$literalExpectation("'+yi(S.value)+'", '+S.ignoreCase+")";case"class":return"peg$classExpectation(["+S.value.map(_=>Array.isArray(_)?'["'+yi(_[0])+'", "'+yi(_[1])+'"]':'"'+yi(_)+'"').join(", ")+"], "+S.inverted+", "+S.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(S)+")")}}function F(S,B){return AE(`
var ${i(B)} = function(${S.params.join(", ")}) {`,S.body,S.location,"};")}return new Ki(null,null,t.grammarSource,[e.literals.map((S,B)=>" var "+n(B)+" = "+v(S)+";").concat("",e.classes.map((S,B)=>" var "+s(B)+" = "+D(S)+";")).concat("",e.expectations.map((S,B)=>" var "+u(B)+" = "+A(S)+";")).concat("").join(`
`),e.functions.map(F)])}function f(v,D){let A=[];return A.push(""),t.trace&&A.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+v+","," location: peg$computeLocation(startPos, startPos)","});",""),t.cache&&(A.push("var key = peg$currPos * "+e.rules.length+" + "+D+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),t.trace&&A.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+v+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+v+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),A.push(" return cached.result;","}","")),A}function d(v,D){let A=[];return t.cache&&A.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+D+" };"),t.trace&&A.push("","if ("+D+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+v+","," result: "+D+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+v+","," location: peg$computeLocation(startPos, startPos)"," });","}"),A.push("","return "+D+";"),A}function E(v){let D=[],A=new p7(v.name,"s","var");function F(B){let _=0,K=B.length,G=[],b;function P(V,W){let q=W+3,z=B[_+q-2],J=B[_+q-1],se,ye;A.checkedIf(_,()=>{_+=q,se=F(B.slice(_,_+z)),_+=z},J>0?()=>{ye=F(B.slice(_,_+J)),_+=J}:null),G.push("if ("+V+") {"),G.push(...se.map(r)),J>0&&(G.push("} else {"),G.push(...ye.map(r))),G.push("}")}function L(V){let q=B[_+2-1],z;A.checkedLoop(_,()=>{_+=2,z=F(B.slice(_,_+q)),_+=q}),G.push("while ("+V+") {"),G.push(...z.map(r)),G.push("}")}function j(){let W=B[_+4-1],q=i(B[_+1])+"("+B.slice(_+4,_+4+W).map(z=>A.index(z)).join(", ")+")";A.pop(B[_+2]),G.push(A.push(q)),_+=4+W}for(;_<K;)switch(B[_]){case Lt.PUSH_EMPTY_STRING:G.push(A.push("''")),_++;break;case Lt.PUSH_CURR_POS:G.push(A.push("peg$currPos")),_++;break;case Lt.PUSH_UNDEFINED:G.push(A.push("undefined")),_++;break;case Lt.PUSH_NULL:G.push(A.push("null")),_++;break;case Lt.PUSH_FAILED:G.push(A.push("peg$FAILED")),_++;break;case Lt.PUSH_EMPTY_ARRAY:G.push(A.push("[]")),_++;break;case Lt.POP:A.pop(),_++;break;case Lt.POP_CURR_POS:G.push("peg$currPos = "+A.pop()+";"),_++;break;case Lt.POP_N:A.pop(B[_+1]),_+=2;break;case Lt.NIP:b=A.pop(),A.pop(),G.push(A.push(b)),_++;break;case Lt.APPEND:b=A.pop(),G.push(A.top()+".push("+b+");"),_++;break;case Lt.WRAP:G.push(A.push("["+A.pop(B[_+1]).join(", ")+"]")),_+=2;break;case Lt.TEXT:G.push(A.push("input.substring("+A.pop()+", peg$currPos)")),_++;break;case Lt.PLUCK:{let W=B[_+3-1],q=3+W;b=B.slice(_+3,_+q),b=W===1?A.index(b[0]):`[ ${b.map(z=>A.index(z)).join(", ")} ]`,A.pop(B[_+1]),G.push(A.push(b)),_+=q;break}case Lt.IF:P(A.top(),0);break;case Lt.IF_ERROR:P(A.top()+" === peg$FAILED",0);break;case Lt.IF_NOT_ERROR:P(A.top()+" !== peg$FAILED",0);break;case Lt.WHILE_NOT_ERROR:L(A.top()+" !== peg$FAILED");break;case Lt.MATCH_ANY:P("input.length > peg$currPos",0);break;case Lt.MATCH_STRING:P(e.literals[B[_+1]].length>1?"input.substr(peg$currPos, "+e.literals[B[_+1]].length+") === "+n(B[_+1]):"input.charCodeAt(peg$currPos) === "+e.literals[B[_+1]].charCodeAt(0),1);break;case Lt.MATCH_STRING_IC:P("input.substr(peg$currPos, "+e.literals[B[_+1]].length+").toLowerCase() === "+n(B[_+1]),1);break;case Lt.MATCH_CHAR_CLASS:P(s(B[_+1])+".test(input.charAt(peg$currPos))",1);break;case Lt.ACCEPT_N:G.push(A.push(B[_+1]>1?"input.substr(peg$currPos, "+B[_+1]+")":"input.charAt(peg$currPos)")),G.push(B[_+1]>1?"peg$currPos += "+B[_+1]+";":"peg$currPos++;"),_+=2;break;case Lt.ACCEPT_STRING:G.push(A.push(n(B[_+1]))),G.push(e.literals[B[_+1]].length>1?"peg$currPos += "+e.literals[B[_+1]].length+";":"peg$currPos++;"),_+=2;break;case Lt.FAIL:G.push(A.push("peg$FAILED")),G.push("if (peg$silentFails === 0) { peg$fail("+u(B[_+1])+"); }"),_+=2;break;case Lt.LOAD_SAVED_POS:G.push("peg$savedPos = "+A.index(B[_+1])+";"),_+=2;break;case Lt.UPDATE_SAVED_POS:G.push("peg$savedPos = peg$currPos;"),_++;break;case Lt.CALL:j();break;case Lt.RULE:G.push(A.push(o(e.rules[B[_+1]].name)+"()")),_+=2;break;case Lt.SILENT_FAILS_ON:G.push("peg$silentFails++;"),_++;break;case Lt.SILENT_FAILS_OFF:G.push("peg$silentFails--;"),_++;break;default:throw new Error("Invalid opcode: "+B[_]+".")}return G}let S=F(v.bytecode);return D.push(AE(" function ",o(v.name),v.nameLocation,`() {
`,v.name)),t.trace&&D.push(" var startPos = peg$currPos;"),D.push(r(A.defines())),D.push(...f('"'+yi(v.name)+'"',h7.indexOfRule(e,v.name)).map(r)),D.push(...S.map(r)),D.push(...d('"'+yi(v.name)+'"',A.result()).map(r)),D.push("}"),D}function p(v){return v.codeLocation?EE(v.code,v.codeLocation,"$"+v.type):v.code}function h(){let v=[];e.topLevelInitializer&&(v.push(p(e.topLevelInitializer)),v.push("")),v.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;",` var filler = peg$padEnd("", s.line.toString().length, ' ');`," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --> " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',` + filler + " | " + peg$padEnd("", s.column - 1, ' ')`,' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),t.trace&&v.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");let D="{ "+t.allowedStartRules.map(F=>F+": "+o(F)).join(", ")+" }",A=o(t.allowedStartRules[0]);return v.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+D+";"," var peg$startRuleFunction = "+A+";","",l(),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),t.cache&&v.push(" var peg$resultsCache = {};",""),t.trace&&v.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),v.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",` throw new Error("Can't start parsing from rule \\"" + options.startRule + "\\".");`," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),e.rules.forEach(F=>{v.push(...E(F).map(r)),v.push("")}),e.initializer&&(v.push(p(e.initializer)),v.push("")),v.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new Ki(null,null,t.grammarSource,v.map(F=>F instanceof Ki?F:F+`
`))}function w(v){function D(){return[`// Generated by Peggy ${d7}.`,"//","// https://peggyjs.org/"]}function A(){return t.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join(`
`):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join(`
`)}let S={bare(){return[...D(),"(function() {",' "use strict";',"",v,"",r("return "+A()+";"),"})()"]},commonjs(){let B=Object.keys(t.dependencies),_=D();return _.push("",'"use strict";',""),B.length>0&&(B.forEach(K=>{_.push("var "+K+' = require("'+yi(t.dependencies[K])+'");')}),_.push("")),_.push(v,"","module.exports = "+A()+";"),_},es(){let B=Object.keys(t.dependencies),_=D();return _.push(""),B.length>0&&(B.forEach(K=>{_.push("import "+K+' from "'+yi(t.dependencies[K])+'";')}),_.push("")),_.push(v,"","export {"," peg$SyntaxError as SyntaxError,",t.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),_},amd(){let B=Object.keys(t.dependencies),K="["+B.map(b=>t.dependencies[b]).map(b=>'"'+yi(b)+'"').join(", ")+"]",G=B.join(", ");return[...D(),"define("+K+", function("+G+") {",' "use strict";',"",v,"",r("return "+A()+";"),"});"]},globals(){return[...D(),"(function(root) {",' "use strict";',"",v,"",r("root."+t.exportVar+" = "+A()+";"),"})(this);"]},umd(){let B=Object.keys(t.dependencies),_=B.map(L=>t.dependencies[L]),K="["+_.map(L=>'"'+yi(L)+'"').join(", ")+"]",G=_.map(L=>'require("'+yi(L)+'")').join(", "),b=B.join(", "),P=D();return P.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+K+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+G+");"),t.exportVar!==null&&P.push(" } else {"," root."+t.exportVar+" = factory();"),P.push(" }","})(this, function("+b+") {",' "use strict";',"",v,"",r("return "+A()+";"),"});"),P}}[t.format]();return new Ki(null,null,t.grammarSource,S.map(B=>B instanceof Ki?B:B+`
`))}e.code=w(h())}wE.exports=g7});var DE=Be((KO,CE)=>{"use strict";var m7=Zu(),v7=qi();function A7(e,t,r){function n(i){return i.type==="rule"&&i.expression.type==="rule_ref"}function s(i,o,l){v7.build({rule_ref(d){d.name===o&&(d.name=l,r.info(`Proxy rule "${o}" replaced by the rule "${l}"`,d.location,[{message:"This rule will be used",location:m7.findRule(i,l).nameLocation}]))}})(i)}let u=[];e.rules.forEach((i,o)=>{n(i)&&(s(e,i.name,i.expression.name),t.allowedStartRules.indexOf(i.name)===-1&&u.push(o))}),u.reverse(),u.forEach(i=>{e.rules.splice(i,1)})}CE.exports=A7});var SE=Be((VO,yE)=>{"use strict";var E7=qi();function w7(e,t,r){function n(i){let o={};return Object.keys(i).forEach(l=>{o[l]=i[l]}),o}function s(i,o){u(i.expression,n(o))}let u=E7.build({rule(i){u(i.expression,{})},choice(i,o){i.alternatives.forEach(l=>{u(l,n(o))})},action:s,labeled(i,o){let l=i.label;l&&Object.prototype.hasOwnProperty.call(o,l)&&r.error(`Label "${i.label}" is already defined`,i.labelLocation,[{message:"Original label location",location:o[l]}]),u(i.expression,o),o[i.label]=i.labelLocation},text:s,simple_and:s,simple_not:s,optional:s,zero_or_more:s,one_or_more:s,group:s});u(e)}yE.exports=w7});var _E=Be((GO,bE)=>{"use strict";var F7=qi();function C7(e,t,r){let n={};F7.build({rule(u){if(Object.prototype.hasOwnProperty.call(n,u.name)){r.error(`Rule "${u.name}" is already defined`,u.nameLocation,[{message:"Original rule location",location:n[u.name]}]);return}n[u.name]=u.nameLocation}})(e)}bE.exports=C7});var $E=Be((zO,IE)=>{"use strict";var BE=Zu(),D7=qi();function y7(e,t,r){let n=[],s=[],u=D7.build({rule(i){n.push(i.name),u(i.expression),n.pop()},sequence(i){i.elements.every(o=>(u(o),!BE.alwaysConsumesOnSuccess(e,o)))},rule_ref(i){s.push(i);let o=BE.findRule(e,i.name);if(n.indexOf(i.name)!==-1){n.push(i.name),r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",o.nameLocation,s.map((l,f,d)=>({message:f+1!==d.length?`Step ${f+1}: call of the rule "${l.name}" without input consumption`:`Step ${f+1}: call itself without input consumption - left recursion`,location:l.location})));return}o&&u(o),s.pop()}});u(e)}IE.exports=y7});var TE=Be((YO,RE)=>{"use strict";var PE=Zu(),S7=qi();function b7(e,t,r){S7.build({zero_or_more(s){PE.alwaysConsumesOnSuccess(e,s.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",s.location)},one_or_more(s){PE.alwaysConsumesOnSuccess(e,s.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",s.location)}})(e)}RE.exports=b7});var OE=Be((WO,xE)=>{"use strict";var _7=Zu(),B7=qi();function I7(e,t,r){B7.build({rule_ref(s){_7.findRule(e,s.name)||r.error(`Rule "${s.name}" is not defined`,s.location)}})(e)}xE.exports=I7});var NE=Be((JO,kE)=>{"use strict";var $7=qi();function P7(e,t,r){let n=$7.build({action(s){n(s.expression,s)},labeled(s,u){s.pick&&u&&r.error('"@" cannot be used with an action block',s.labelLocation,[{message:"Action block location",location:u.codeLocation}]),n(s.expression)}});n(e)}kE.exports=P7});var UE=Be((XO,LE)=>{"use strict";var R7=fh(),Td=class{constructor(t){t=typeof t<"u"?t:{},typeof t.error=="function"&&(this.error=t.error),typeof t.warning=="function"&&(this.warning=t.warning),typeof t.info=="function"&&(this.info=t.info)}error(){}warning(){}info(){}},xd=class{constructor(t){this._callbacks=new Td(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,this._firstError===null&&(this._firstError=new R7(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(this.errors!==0)throw this._firstError}};LE.exports=xd});var HE=Be((exports,module)=>{"use strict";var generateBytecode=GA(),generateJS=FE(),inferenceMatchResult=Ed(),removeProxyRules=DE(),reportDuplicateLabels=SE(),reportDuplicateRules=_E(),reportInfiniteRecursion=$E(),reportInfiniteRepetition=TE(),reportUndefinedRules=OE(),reportIncorrectPlucking=NE(),Session=UE(),visitor=qi();function processOptions(e,t){let r={};return Object.keys(e).forEach(n=>{r[n]=e[n]}),Object.keys(t).forEach(n=>{Object.prototype.hasOwnProperty.call(r,n)||(r[n]=t[n])}),r}var compiler={visitor,passes:{check:[reportUndefinedRules,reportDuplicateRules,reportDuplicateLabels,reportInfiniteRecursion,reportInfiniteRepetition,reportIncorrectPlucking],transform:[removeProxyRules,inferenceMatchResult],generate:[generateBytecode,generateJS]},compile(ast,passes,options){if(options=options!==void 0?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(options.allowedStartRules.length===0)throw new Error("Must have at least one start rule");let allRules=ast.rules.map(e=>e.name);for(let e of options.allowedStartRules)if(allRules.indexOf(e)===-1)throw new Error(`Unknown start rule "${e}"`);let session=new Session(options);switch(Object.keys(passes).forEach(e=>{session.stage=e,session.info(`Process stage ${e}`),passes[e].forEach(t=>{session.info(`Process pass ${e}.${t.name}`),t(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};module.exports=compiler});var ME=Be((ZO,jE)=>{"use strict";var T7={$:"text","&":"simple_and","!":"simple_not"},x7={"?":"optional","*":"zero_or_more","+":"one_or_more"},O7={"&":"semantic_and","!":"semantic_not"};function k7(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function ta(e,t,r,n){var s=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(s,ta.prototype),s.expected=t,s.found=r,s.location=n,s.name="SyntaxError",s}k7(ta,Error);function Od(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,r+=r.repeat(t),e+r.slice(0,t))}ta.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r=null,n;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var s=this.location.start,u=this.location.source+":"+s.line+":"+s.column;if(r){var i=this.location.end,o=Od("",s.line.toString().length," "),l=r[s.line-1],f=s.line===i.line?i.column:l.length+1,d=f-s.column||1;t+=`
--> `+u+`
`+o+` |
`+s.line+" | "+l+`
`+o+" | "+Od("",s.column-1," ")+Od("",d,"^")}else t+=`
at `+u}return t};ta.buildMessage=function(e,t){var r={literal:function(f){return'"'+s(f.text)+'"'},class:function(f){var d=f.parts.map(function(E){return Array.isArray(E)?u(E[0])+"-"+u(E[1]):u(E)});return"["+(f.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(f){return f.description}};function n(f){return f.charCodeAt(0).toString(16).toUpperCase()}function s(f){return f.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function u(f){return f.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function i(f){return r[f.type](f)}function o(f){var d=f.map(i),E,p;if(d.sort(),d.length>0){for(E=1,p=1;E<d.length;E++)d[E-1]!==d[E]&&(d[p]=d[E],p++);d.length=p}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function l(f){return f?'"'+s(f)+'"':"end of input"}return"Expected "+o(e)+" but "+l(t)+" found."};function N7(e,t){t=t!==void 0?t:{};var r={},n=t.grammarSource,s={Grammar:Ja},u=Ja,i="{",o="}",l="=",f="/",d="@",E=":",p="$",h="&",w="!",v="?",D="*",A="+",F="(",S=")",B=" ",_="\v",K="\f",G=" ",b="\xA0",P="\uFEFF",L=`
`,j=`\r
`,V="\r",W="\u2028",q="\u2029",z="/*",J="*/",se="//",ye="_",Ce="\\",Pe="\u200C",Xe="\u200D",ce="i",Ie='"',Me="'",_r="[",Kt="^",Ft="]",gr="-",nr="0",ht="b",Vt="f",st="n",ze="r",ir="t",je="v",Tt="x",Zr="u",Zt=".",Gt=";",mt=/^[\n\r\u2028\u2029]/,Br=/^[0-9]/,ui=/^[0-9a-f]/i,Qr=/^[{}]/,Dt=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/,Ue=/^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C-\uA69D\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3-\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E-\uFF9F]/,be=/^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,mr=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,en=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A]/,ut=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B3E\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82-\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2-\u0DF3\u0F3E-\u0F3F\u0F7F\u102B-\u102C\u1031\u1038\u103B-\u103C\u1056-\u1057\u1062-\u1064\u1067-\u106D\u1083-\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF2-\u1CF3\u302E-\u302F\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC]/,Us=/^[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62-\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC-\u0CCD\u0CE2-\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62-\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099-\u309A\uA66F\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/,tn=/^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/,ge=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,ns=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,_t=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,qr=Ye("{",!1),Vi=Ye("}",!1),bu=Ye("=",!1),is=Ye("/",!1),_u=Ye("@",!1),ss=Ye(":",!1),Gi=Ye("$",!1),xt=Ye("&",!1),Hn=Ye("!",!1),Bu=Ye("?",!1),Iu=Ye("*",!1),$u=Ye("+",!1),us=Ye("(",!1),ra=Ye(")",!1),as=Tu(),na=Ii("whitespace"),Hs=Ye(" ",!1),re=Ye("\v",!1),fe=Ye("\f",!1),Le=Ye(" ",!1),ke=Ye("\xA0",!1),Ve=Ye("\uFEFF",!1),at=Pr([`
`,"\r","\u2028","\u2029"],!1,!1),lt=Ii("end of line"),yr=Ye(`
`,!1),Ut=Ye(`\r
`,!1),jn=Ye("\r",!1),_i=Ye("\u2028",!1),rn=Ye("\u2029",!1),pn=Ii("comment"),vr=Ye("/*",!1),nn=Ye("*/",!1),kr=Ye("//",!1),ia=Ii("identifier"),os=Ye("_",!1),Sn=Ye("\\",!1),Pt=Ye("\u200C",!1),Ar=Ye("\u200D",!1),rt=Ii("literal"),sr=Ye("i",!1),Kr=Ii("string"),ur=Ye('"',!1),Ht=Ye("'",!1),bn=Ii("character class"),Mn=Ye("[",!1),qn=Ye("^",!1),_n=Ye("]",!1),Ir=Ye("-",!1),or=Ye("0",!1),ec=Ye("b",!1),sa=Ye("f",!1),Vr=Ye("n",!1),aa=Ye("r",!1),za=Ye("t",!1),Ya=Ye("v",!1),oa=Ye("x",!1),cs=Ye("u",!1),ca=Pr([["0","9"]],!1,!1),Wa=Pr([["0","9"],["a","f"]],!1,!0),la=Ye(".",!1),fa=Ii("code block"),Bn=Pr(["{","}"],!1,!1),R=Pr([["a","z"],"\xB5",["\xDF","\xF6"],["\xF8","\xFF"],"\u0101","\u0103","\u0105","\u0107","\u0109","\u010B","\u010D","\u010F","\u0111","\u0113","\u0115","\u0117","\u0119","\u011B","\u011D","\u011F","\u0121","\u0123","\u0125","\u0127","\u0129","\u012B","\u012D","\u012F","\u0131","\u0133","\u0135",["\u0137","\u0138"],"\u013A","\u013C","\u013E","\u0140","\u0142","\u0144","\u0146",["\u0148","\u0149"],"\u014B","\u014D","\u014F","\u0151","\u0153","\u0155","\u0157","\u0159","\u015B","\u015D","\u015F","\u0161","\u0163","\u0165","\u0167","\u0169","\u016B","\u016D","\u016F","\u0171","\u0173","\u0175","\u0177","\u017A","\u017C",["\u017E","\u0180"],"\u0183","\u0185","\u0188",["\u018C","\u018D"],"\u0192","\u0195",["\u0199","\u019B"],"\u019E","\u01A1","\u01A3","\u01A5","\u01A8",["\u01AA","\u01AB"],"\u01AD","\u01B0","\u01B4","\u01B6",["\u01B9","\u01BA"],["\u01BD","\u01BF"],"\u01C6","\u01C9","\u01CC","\u01CE","\u01D0","\u01D2","\u01D4","\u01D6","\u01D8","\u01DA",["\u01DC","\u01DD"],"\u01DF","\u01E1","\u01E3","\u01E5","\u01E7","\u01E9","\u01EB","\u01ED",["\u01EF","\u01F0"],"\u01F3","\u01F5","\u01F9","\u01FB","\u01FD","\u01FF","\u0201","\u0203","\u0205","\u0207","\u0209","\u020B","\u020D","\u020F","\u0211","\u0213","\u0215","\u0217","\u0219","\u021B","\u021D","\u021F","\u0221","\u0223","\u0225","\u0227","\u0229","\u022B","\u022D","\u022F","\u0231",["\u0233","\u0239"],"\u023C",["\u023F","\u0240"],"\u0242","\u0247","\u0249","\u024B","\u024D",["\u024F","\u0293"],["\u0295","\u02AF"],"\u0371","\u0373","\u0377",["\u037B","\u037D"],"\u0390",["\u03AC","\u03CE"],["\u03D0","\u03D1"],["\u03D5","\u03D7"],"\u03D9","\u03DB","\u03DD","\u03DF","\u03E1","\u03E3","\u03E5","\u03E7","\u03E9","\u03EB","\u03ED",["\u03EF","\u03F3"],"\u03F5","\u03F8",["\u03FB","\u03FC"],["\u0430","\u045F"],"\u0461","\u0463","\u0465","\u0467","\u0469","\u046B","\u046D","\u046F","\u0471","\u0473","\u0475","\u0477","\u0479","\u047B","\u047D","\u047F","\u0481","\u048B","\u048D","\u048F","\u0491","\u0493","\u0495","\u0497","\u0499","\u049B","\u049D","\u049F","\u04A1","\u04A3","\u04A5","\u04A7","\u04A9","\u04AB","\u04AD","\u04AF","\u04B1","\u04B3","\u04B5","\u04B7","\u04B9","\u04BB","\u04BD","\u04BF","\u04C2","\u04C4","\u04C6","\u04C8","\u04CA","\u04CC",["\u04CE","\u04CF"],"\u04D1","\u04D3","\u04D5","\u04D7","\u04D9","\u04DB","\u04DD","\u04DF","\u04E1","\u04E3","\u04E5","\u04E7","\u04E9","\u04EB","\u04ED","\u04EF","\u04F1","\u04F3","\u04F5","\u04F7","\u04F9","\u04FB","\u04FD","\u04FF","\u0501","\u0503","\u0505","\u0507","\u0509","\u050B","\u050D","\u050F","\u0511","\u0513","\u0515","\u0517","\u0519","\u051B","\u051D","\u051F","\u0521","\u0523","\u0525","\u0527","\u0529","\u052B","\u052D","\u052F",["\u0561","\u0587"],["\u13F8","\u13FD"],["\u1D00","\u1D2B"],["\u1D6B","\u1D77"],["\u1D79","\u1D9A"],"\u1E01","\u1E03","\u1E05","\u1E07","\u1E09","\u1E0B","\u1E0D","\u1E0F","\u1E11","\u1E13","\u1E15","\u1E17","\u1E19","\u1E1B","\u1E1D","\u1E1F","\u1E21","\u1E23","\u1E25","\u1E27","\u1E29","\u1E2B","\u1E2D","\u1E2F","\u1E31","\u1E33","\u1E35","\u1E37","\u1E39","\u1E3B","\u1E3D","\u1E3F","\u1E41","\u1E43","\u1E45","\u1E47","\u1E49","\u1E4B","\u1E4D","\u1E4F","\u1E51","\u1E53","\u1E55","\u1E57","\u1E59","\u1E5B","\u1E5D","\u1E5F","\u1E61","\u1E63","\u1E65","\u1E67","\u1E69","\u1E6B","\u1E6D","\u1E6F","\u1E71","\u1E73","\u1E75","\u1E77","\u1E79","\u1E7B","\u1E7D","\u1E7F","\u1E81","\u1E83","\u1E85","\u1E87","\u1E89","\u1E8B","\u1E8D","\u1E8F","\u1E91","\u1E93",["\u1E95","\u1E9D"],"\u1E9F","\u1EA1","\u1EA3","\u1EA5","\u1EA7","\u1EA9","\u1EAB","\u1EAD","\u1EAF","\u1EB1","\u1EB3","\u1EB5","\u1EB7","\u1EB9","\u1EBB","\u1EBD","\u1EBF","\u1EC1","\u1EC3","\u1EC5","\u1EC7","\u1EC9","\u1ECB","\u1ECD","\u1ECF","\u1ED1","\u1ED3","\u1ED5","\u1ED7","\u1ED9","\u1EDB","\u1EDD","\u1EDF","\u1EE1","\u1EE3","\u1EE5","\u1EE7","\u1EE9","\u1EEB","\u1EED","\u1EEF","\u1EF1","\u1EF3","\u1EF5","\u1EF7","\u1EF9","\u1EFB","\u1EFD",["\u1EFF","\u1F07"],["\u1F10","\u1F15"],["\u1F20","\u1F27"],["\u1F30","\u1F37"],["\u1F40","\u1F45"],["\u1F50","\u1F57"],["\u1F60","\u1F67"],["\u1F70","\u1F7D"],["\u1F80","\u1F87"],["\u1F90","\u1F97"],["\u1FA0","\u1FA7"],["\u1FB0","\u1FB4"],["\u1FB6","\u1FB7"],"\u1FBE",["\u1FC2","\u1FC4"],["\u1FC6","\u1FC7"],["\u1FD0","\u1FD3"],["\u1FD6","\u1FD7"],["\u1FE0","\u1FE7"],["\u1FF2","\u1FF4"],["\u1FF6","\u1FF7"],"\u210A",["\u210E","\u210F"],"\u2113","\u212F","\u2134","\u2139",["\u213C","\u213D"],["\u2146","\u2149"],"\u214E","\u2184",["\u2C30","\u2C5E"],"\u2C61",["\u2C65","\u2C66"],"\u2C68","\u2C6A","\u2C6C","\u2C71",["\u2C73","\u2C74"],["\u2C76","\u2C7B"],"\u2C81","\u2C83","\u2C85","\u2C87","\u2C89","\u2C8B","\u2C8D","\u2C8F","\u2C91","\u2C93","\u2C95","\u2C97","\u2C99","\u2C9B","\u2C9D","\u2C9F","\u2CA1","\u2CA3","\u2CA5","\u2CA7","\u2CA9","\u2CAB","\u2CAD","\u2CAF","\u2CB1","\u2CB3","\u2CB5","\u2CB7","\u2CB9","\u2CBB","\u2CBD","\u2CBF","\u2CC1","\u2CC3","\u2CC5","\u2CC7","\u2CC9","\u2CCB","\u2CCD","\u2CCF","\u2CD1","\u2CD3","\u2CD5","\u2CD7","\u2CD9","\u2CDB","\u2CDD","\u2CDF","\u2CE1",["\u2CE3","\u2CE4"],"\u2CEC","\u2CEE","\u2CF3",["\u2D00","\u2D25"],"\u2D27","\u2D2D","\uA641","\uA643","\uA645","\uA647","\uA649","\uA64B","\uA64D","\uA64F","\uA651","\uA653","\uA655","\uA657","\uA659","\uA65B","\uA65D","\uA65F","\uA661","\uA663","\uA665","\uA667","\uA669","\uA66B","\uA66D","\uA681","\uA683","\uA685","\uA687","\uA689","\uA68B","\uA68D","\uA68F","\uA691","\uA693","\uA695","\uA697","\uA699","\uA69B","\uA723","\uA725","\uA727","\uA729","\uA72B","\uA72D",["\uA72F","\uA731"],"\uA733","\uA735","\uA737","\uA739","\uA73B","\uA73D","\uA73F","\uA741","\uA743","\uA745","\uA747","\uA749","\uA74B","\uA74D","\uA74F","\uA751","\uA753","\uA755","\uA757","\uA759","\uA75B","\uA75D","\uA75F","\uA761","\uA763","\uA765","\uA767","\uA769","\uA76B","\uA76D","\uA76F",["\uA771","\uA778"],"\uA77A","\uA77C","\uA77F","\uA781","\uA783","\uA785","\uA787","\uA78C","\uA78E","\uA791",["\uA793","\uA795"],"\uA797","\uA799","\uA79B","\uA79D","\uA79F","\uA7A1","\uA7A3","\uA7A5","\uA7A7","\uA7A9","\uA7B5","\uA7B7","\uA7FA",["\uAB30","\uAB5A"],["\uAB60","\uAB65"],["\uAB70","\uABBF"],["\uFB00","\uFB06"],["\uFB13","\uFB17"],["\uFF41","\uFF5A"]],!1,!1),O=Pr([["\u02B0","\u02C1"],["\u02C6","\u02D1"],["\u02E0","\u02E4"],"\u02EC","\u02EE","\u0374","\u037A","\u0559","\u0640",["\u06E5","\u06E6"],["\u07F4","\u07F5"],"\u07FA","\u081A","\u0824","\u0828","\u0971","\u0E46","\u0EC6","\u10FC","\u17D7","\u1843","\u1AA7",["\u1C78","\u1C7D"],["\u1D2C","\u1D6A"],"\u1D78",["\u1D9B","\u1DBF"],"\u2071","\u207F",["\u2090","\u209C"],["\u2C7C","\u2C7D"],"\u2D6F","\u2E2F","\u3005",["\u3031","\u3035"],"\u303B",["\u309D","\u309E"],["\u30FC","\u30FE"],"\uA015",["\uA4F8","\uA4FD"],"\uA60C","\uA67F",["\uA69C","\uA69D"],["\uA717","\uA71F"],"\uA770","\uA788",["\uA7F8","\uA7F9"],"\uA9CF","\uA9E6","\uAA70","\uAADD",["\uAAF3","\uAAF4"],["\uAB5C","\uAB5F"],"\uFF70",["\uFF9E","\uFF9F"]],!1,!1),H=Pr(["\xAA","\xBA","\u01BB",["\u01C0","\u01C3"],"\u0294",["\u05D0","\u05EA"],["\u05F0","\u05F2"],["\u0620","\u063F"],["\u0641","\u064A"],["\u066E","\u066F"],["\u0671","\u06D3"],"\u06D5",["\u06EE","\u06EF"],["\u06FA","\u06FC"],"\u06FF","\u0710",["\u0712","\u072F"],["\u074D","\u07A5"],"\u07B1",["\u07CA","\u07EA"],["\u0800","\u0815"],["\u0840","\u0858"],["\u08A0","\u08B4"],["\u0904","\u0939"],"\u093D","\u0950",["\u0958","\u0961"],["\u0972","\u0980"],["\u0985","\u098C"],["\u098F","\u0990"],["\u0993","\u09A8"],["\u09AA","\u09B0"],"\u09B2",["\u09B6","\u09B9"],"\u09BD","\u09CE",["\u09DC","\u09DD"],["\u09DF","\u09E1"],["\u09F0","\u09F1"],["\u0A05","\u0A0A"],["\u0A0F","\u0A10"],["\u0A13","\u0A28"],["\u0A2A","\u0A30"],["\u0A32","\u0A33"],["\u0A35","\u0A36"],["\u0A38","\u0A39"],["\u0A59","\u0A5C"],"\u0A5E",["\u0A72","\u0A74"],["\u0A85","\u0A8D"],["\u0A8F","\u0A91"],["\u0A93","\u0AA8"],["\u0AAA","\u0AB0"],["\u0AB2","\u0AB3"],["\u0AB5","\u0AB9"],"\u0ABD","\u0AD0",["\u0AE0","\u0AE1"],"\u0AF9",["\u0B05","\u0B0C"],["\u0B0F","\u0B10"],["\u0B13","\u0B28"],["\u0B2A","\u0B30"],["\u0B32","\u0B33"],["\u0B35","\u0B39"],"\u0B3D",["\u0B5C","\u0B5D"],["\u0B5F","\u0B61"],"\u0B71","\u0B83",["\u0B85","\u0B8A"],["\u0B8E","\u0B90"],["\u0B92","\u0B95"],["\u0B99","\u0B9A"],"\u0B9C",["\u0B9E","\u0B9F"],["\u0BA3","\u0BA4"],["\u0BA8","\u0BAA"],["\u0BAE","\u0BB9"],"\u0BD0",["\u0C05","\u0C0C"],["\u0C0E","\u0C10"],["\u0C12","\u0C28"],["\u0C2A","\u0C39"],"\u0C3D",["\u0C58","\u0C5A"],["\u0C60","\u0C61"],["\u0C85","\u0C8C"],["\u0C8E","\u0C90"],["\u0C92","\u0CA8"],["\u0CAA","\u0CB3"],["\u0CB5","\u0CB9"],"\u0CBD","\u0CDE",["\u0CE0","\u0CE1"],["\u0CF1","\u0CF2"],["\u0D05","\u0D0C"],["\u0D0E","\u0D10"],["\u0D12","\u0D3A"],"\u0D3D","\u0D4E",["\u0D5F","\u0D61"],["\u0D7A","\u0D7F"],["\u0D85","\u0D96"],["\u0D9A","\u0DB1"],["\u0DB3","\u0DBB"],"\u0DBD",["\u0DC0","\u0DC6"],["\u0E01","\u0E30"],["\u0E32","\u0E33"],["\u0E40","\u0E45"],["\u0E81","\u0E82"],"\u0E84",["\u0E87","\u0E88"],"\u0E8A","\u0E8D",["\u0E94","\u0E97"],["\u0E99","\u0E9F"],["\u0EA1","\u0EA3"],"\u0EA5","\u0EA7",["\u0EAA","\u0EAB"],["\u0EAD","\u0EB0"],["\u0EB2","\u0EB3"],"\u0EBD",["\u0EC0","\u0EC4"],["\u0EDC","\u0EDF"],"\u0F00",["\u0F40","\u0F47"],["\u0F49","\u0F6C"],["\u0F88","\u0F8C"],["\u1000","\u102A"],"\u103F",["\u1050","\u1055"],["\u105A","\u105D"],"\u1061",["\u1065","\u1066"],["\u106E","\u1070"],["\u1075","\u1081"],"\u108E",["\u10D0","\u10FA"],["\u10FD","\u1248"],["\u124A","\u124D"],["\u1250","\u1256"],"\u1258",["\u125A","\u125D"],["\u1260","\u1288"],["\u128A","\u128D"],["\u1290","\u12B0"],["\u12B2","\u12B5"],["\u12B8","\u12BE"],"\u12C0",["\u12C2","\u12C5"],["\u12C8","\u12D6"],["\u12D8","\u1310"],["\u1312","\u1315"],["\u1318","\u135A"],["\u1380","\u138F"],["\u1401","\u166C"],["\u166F","\u167F"],["\u1681","\u169A"],["\u16A0","\u16EA"],["\u16F1","\u16F8"],["\u1700","\u170C"],["\u170E","\u1711"],["\u1720","\u1731"],["\u1740","\u1751"],["\u1760","\u176C"],["\u176E","\u1770"],["\u1780","\u17B3"],"\u17DC",["\u1820","\u1842"],["\u1844","\u1877"],["\u1880","\u18A8"],"\u18AA",["\u18B0","\u18F5"],["\u1900","\u191E"],["\u1950","\u196D"],["\u1970","\u1974"],["\u1980","\u19AB"],["\u19B0","\u19C9"],["\u1A00","\u1A16"],["\u1A20","\u1A54"],["\u1B05","\u1B33"],["\u1B45","\u1B4B"],["\u1B83","\u1BA0"],["\u1BAE","\u1BAF"],["\u1BBA","\u1BE5"],["\u1C00","\u1C23"],["\u1C4D","\u1C4F"],["\u1C5A","\u1C77"],["\u1CE9","\u1CEC"],["\u1CEE","\u1CF1"],["\u1CF5","\u1CF6"],["\u2135","\u2138"],["\u2D30","\u2D67"],["\u2D80","\u2D96"],["\u2DA0","\u2DA6"],["\u2DA8","\u2DAE"],["\u2DB0","\u2DB6"],["\u2DB8","\u2DBE"],["\u2DC0","\u2DC6"],["\u2DC8","\u2DCE"],["\u2DD0","\u2DD6"],["\u2DD8","\u2DDE"],"\u3006","\u303C",["\u3041","\u3096"],"\u309F",["\u30A1","\u30FA"],"\u30FF",["\u3105","\u312D"],["\u3131","\u318E"],["\u31A0","\u31BA"],["\u31F0","\u31FF"],["\u3400","\u4DB5"],["\u4E00","\u9FD5"],["\uA000","\uA014"],["\uA016","\uA48C"],["\uA4D0","\uA4F7"],["\uA500","\uA60B"],["\uA610","\uA61F"],["\uA62A","\uA62B"],"\uA66E",["\uA6A0","\uA6E5"],"\uA78F","\uA7F7",["\uA7FB","\uA801"],["\uA803","\uA805"],["\uA807","\uA80A"],["\uA80C","\uA822"],["\uA840","\uA873"],["\uA882","\uA8B3"],["\uA8F2","\uA8F7"],"\uA8FB","\uA8FD",["\uA90A","\uA925"],["\uA930","\uA946"],["\uA960","\uA97C"],["\uA984","\uA9B2"],["\uA9E0","\uA9E4"],["\uA9E7","\uA9EF"],["\uA9FA","\uA9FE"],["\uAA00","\uAA28"],["\uAA40","\uAA42"],["\uAA44","\uAA4B"],["\uAA60","\uAA6F"],["\uAA71","\uAA76"],"\uAA7A",["\uAA7E","\uAAAF"],"\uAAB1",["\uAAB5","\uAAB6"],["\uAAB9","\uAABD"],"\uAAC0","\uAAC2",["\uAADB","\uAADC"],["\uAAE0","\uAAEA"],"\uAAF2",["\uAB01","\uAB06"],["\uAB09","\uAB0E"],["\uAB11","\uAB16"],["\uAB20","\uAB26"],["\uAB28","\uAB2E"],["\uABC0","\uABE2"],["\uAC00","\uD7A3"],["\uD7B0","\uD7C6"],["\uD7CB","\uD7FB"],["\uF900","\uFA6D"],["\uFA70","\uFAD9"],"\uFB1D",["\uFB1F","\uFB28"],["\uFB2A","\uFB36"],["\uFB38","\uFB3C"],"\uFB3E",["\uFB40","\uFB41"],["\uFB43","\uFB44"],["\uFB46","\uFBB1"],["\uFBD3","\uFD3D"],["\uFD50","\uFD8F"],["\uFD92","\uFDC7"],["\uFDF0","\uFDFB"],["\uFE70","\uFE74"],["\uFE76","\uFEFC"],["\uFF66","\uFF6F"],["\uFF71","\uFF9D"],["\uFFA0","\uFFBE"],["\uFFC2","\uFFC7"],["\uFFCA","\uFFCF"],["\uFFD2","\uFFD7"],["\uFFDA","\uFFDC"]],!1,!1),Q=Pr(["\u01C5","\u01C8","\u01CB","\u01F2",["\u1F88","\u1F8F"],["\u1F98","\u1F9F"],["\u1FA8","\u1FAF"],"\u1FBC","\u1FCC","\u1FFC"],!1,!1),ve=Pr([["A","Z"],["\xC0","\xD6"],["\xD8","\xDE"],"\u0100","\u0102","\u0104","\u0106","\u0108","\u010A","\u010C","\u010E","\u0110","\u0112","\u0114","\u0116","\u0118","\u011A","\u011C","\u011E","\u0120","\u0122","\u0124","\u0126","\u0128","\u012A","\u012C","\u012E","\u0130","\u0132","\u0134","\u0136","\u0139","\u013B","\u013D","\u013F","\u0141","\u0143","\u0145","\u0147","\u014A","\u014C","\u014E","\u0150","\u0152","\u0154","\u0156","\u0158","\u015A","\u015C","\u015E","\u0160","\u0162","\u0164","\u0166","\u0168","\u016A","\u016C","\u016E","\u0170","\u0172","\u0174","\u0176",["\u0178","\u0179"],"\u017B","\u017D",["\u0181","\u0182"],"\u0184",["\u0186","\u0187"],["\u0189","\u018B"],["\u018E","\u0191"],["\u0193","\u0194"],["\u0196","\u0198"],["\u019C","\u019D"],["\u019F","\u01A0"],"\u01A2","\u01A4",["\u01A6","\u01A7"],"\u01A9","\u01AC",["\u01AE","\u01AF"],["\u01B1","\u01B3"],"\u01B5",["\u01B7","\u01B8"],"\u01BC","\u01C4","\u01C7","\u01CA","\u01CD","\u01CF","\u01D1","\u01D3","\u01D5","\u01D7","\u01D9","\u01DB","\u01DE","\u01E0","\u01E2","\u01E4","\u01E6","\u01E8","\u01EA","\u01EC","\u01EE","\u01F1","\u01F4",["\u01F6","\u01F8"],"\u01FA","\u01FC","\u01FE","\u0200","\u0202","\u0204","\u0206","\u0208","\u020A","\u020C","\u020E","\u0210","\u0212","\u0214","\u0216","\u0218","\u021A","\u021C","\u021E","\u0220","\u0222","\u0224","\u0226","\u0228","\u022A","\u022C","\u022E","\u0230","\u0232",["\u023A","\u023B"],["\u023D","\u023E"],"\u0241",["\u0243","\u0246"],"\u0248","\u024A","\u024C","\u024E","\u0370","\u0372","\u0376","\u037F","\u0386",["\u0388","\u038A"],"\u038C",["\u038E","\u038F"],["\u0391","\u03A1"],["\u03A3","\u03AB"],"\u03CF",["\u03D2","\u03D4"],"\u03D8","\u03DA","\u03DC","\u03DE","\u03E0","\u03E2","\u03E4","\u03E6","\u03E8","\u03EA","\u03EC","\u03EE","\u03F4","\u03F7",["\u03F9","\u03FA"],["\u03FD","\u042F"],"\u0460","\u0462","\u0464","\u0466","\u0468","\u046A","\u046C","\u046E","\u0470","\u0472","\u0474","\u0476","\u0478","\u047A","\u047C","\u047E","\u0480","\u048A","\u048C","\u048E","\u0490","\u0492","\u0494","\u0496","\u0498","\u049A","\u049C","\u049E","\u04A0","\u04A2","\u04A4","\u04A6","\u04A8","\u04AA","\u04AC","\u04AE","\u04B0","\u04B2","\u04B4","\u04B6","\u04B8","\u04BA","\u04BC","\u04BE",["\u04C0","\u04C1"],"\u04C3","\u04C5","\u04C7","\u04C9","\u04CB","\u04CD","\u04D0","\u04D2","\u04D4","\u04D6","\u04D8","\u04DA","\u04DC","\u04DE","\u04E0","\u04E2","\u04E4","\u04E6","\u04E8","\u04EA","\u04EC","\u04EE","\u04F0","\u04F2","\u04F4","\u04F6","\u04F8","\u04FA","\u04FC","\u04FE","\u0500","\u0502","\u0504","\u0506","\u0508","\u050A","\u050C","\u050E","\u0510","\u0512","\u0514","\u0516","\u0518","\u051A","\u051C","\u051E","\u0520","\u0522","\u0524","\u0526","\u0528","\u052A","\u052C","\u052E",["\u0531","\u0556"],["\u10A0","\u10C5"],"\u10C7","\u10CD",["\u13A0","\u13F5"],"\u1E00","\u1E02","\u1E04","\u1E06","\u1E08","\u1E0A","\u1E0C","\u1E0E","\u1E10","\u1E12","\u1E14","\u1E16","\u1E18","\u1E1A","\u1E1C","\u1E1E","\u1E20","\u1E22","\u1E24","\u1E26","\u1E28","\u1E2A","\u1E2C","\u1E2E","\u1E30","\u1E32","\u1E34","\u1E36","\u1E38","\u1E3A","\u1E3C","\u1E3E","\u1E40","\u1E42","\u1E44","\u1E46","\u1E48","\u1E4A","\u1E4C","\u1E4E","\u1E50","\u1E52","\u1E54","\u1E56","\u1E58","\u1E5A","\u1E5C","\u1E5E","\u1E60","\u1E62","\u1E64","\u1E66","\u1E68","\u1E6A","\u1E6C","\u1E6E","\u1E70","\u1E72","\u1E74","\u1E76","\u1E78","\u1E7A","\u1E7C","\u1E7E","\u1E80","\u1E82","\u1E84","\u1E86","\u1E88","\u1E8A","\u1E8C","\u1E8E","\u1E90","\u1E92","\u1E94","\u1E9E","\u1EA0","\u1EA2","\u1EA4","\u1EA6","\u1EA8","\u1EAA","\u1EAC","\u1EAE","\u1EB0","\u1EB2","\u1EB4","\u1EB6","\u1EB8","\u1EBA","\u1EBC","\u1EBE","\u1EC0","\u1EC2","\u1EC4","\u1EC6","\u1EC8","\u1ECA","\u1ECC","\u1ECE","\u1ED0","\u1ED2","\u1ED4","\u1ED6","\u1ED8","\u1EDA","\u1EDC","\u1EDE","\u1EE0","\u1EE2","\u1EE4","\u1EE6","\u1EE8","\u1EEA","\u1EEC","\u1EEE","\u1EF0","\u1EF2","\u1EF4","\u1EF6","\u1EF8","\u1EFA","\u1EFC","\u1EFE",["\u1F08","\u1F0F"],["\u1F18","\u1F1D"],["\u1F28","\u1F2F"],["\u1F38","\u1F3F"],["\u1F48","\u1F4D"],"\u1F59","\u1F5B","\u1F5D","\u1F5F",["\u1F68","\u1F6F"],["\u1FB8","\u1FBB"],["\u1FC8","\u1FCB"],["\u1FD8","\u1FDB"],["\u1FE8","\u1FEC"],["\u1FF8","\u1FFB"],"\u2102","\u2107",["\u210B","\u210D"],["\u2110","\u2112"],"\u2115",["\u2119","\u211D"],"\u2124","\u2126","\u2128",["\u212A","\u212D"],["\u2130","\u2133"],["\u213E","\u213F"],"\u2145","\u2183",["\u2C00","\u2C2E"],"\u2C60",["\u2C62","\u2C64"],"\u2C67","\u2C69","\u2C6B",["\u2C6D","\u2C70"],"\u2C72","\u2C75",["\u2C7E","\u2C80"],"\u2C82","\u2C84","\u2C86","\u2C88","\u2C8A","\u2C8C","\u2C8E","\u2C90","\u2C92","\u2C94","\u2C96","\u2C98","\u2C9A","\u2C9C","\u2C9E","\u2CA0","\u2CA2","\u2CA4","\u2CA6","\u2CA8","\u2CAA","\u2CAC","\u2CAE","\u2CB0","\u2CB2","\u2CB4","\u2CB6","\u2CB8","\u2CBA","\u2CBC","\u2CBE","\u2CC0","\u2CC2","\u2CC4","\u2CC6","\u2CC8","\u2CCA","\u2CCC","\u2CCE","\u2CD0","\u2CD2","\u2CD4","\u2CD6","\u2CD8","\u2CDA","\u2CDC","\u2CDE","\u2CE0","\u2CE2","\u2CEB","\u2CED","\u2CF2","\uA640","\uA642","\uA644","\uA646","\uA648","\uA64A","\uA64C","\uA64E","\uA650","\uA652","\uA654","\uA656","\uA658","\uA65A","\uA65C","\uA65E","\uA660","\uA662","\uA664","\uA666","\uA668","\uA66A","\uA66C","\uA680","\uA682","\uA684","\uA686","\uA688","\uA68A","\uA68C","\uA68E","\uA690","\uA692","\uA694","\uA696","\uA698","\uA69A","\uA722","\uA724","\uA726","\uA728","\uA72A","\uA72C","\uA72E","\uA732","\uA734","\uA736","\uA738","\uA73A","\uA73C","\uA73E","\uA740","\uA742","\uA744","\uA746","\uA748","\uA74A","\uA74C","\uA74E","\uA750","\uA752","\uA754","\uA756","\uA758","\uA75A","\uA75C","\uA75E","\uA760","\uA762","\uA764","\uA766","\uA768","\uA76A","\uA76C","\uA76E","\uA779","\uA77B",["\uA77D","\uA77E"],"\uA780","\uA782","\uA784","\uA786","\uA78B","\uA78D","\uA790","\uA792","\uA796","\uA798","\uA79A","\uA79C","\uA79E","\uA7A0","\uA7A2","\uA7A4","\uA7A6","\uA7A8",["\uA7AA","\uA7AD"],["\uA7B0","\uA7B4"],"\uA7B6",["\uFF21","\uFF3A"]],!1,!1),we=Pr(["\u0903","\u093B",["\u093E","\u0940"],["\u0949","\u094C"],["\u094E","\u094F"],["\u0982","\u0983"],["\u09BE","\u09C0"],["\u09C7","\u09C8"],["\u09CB","\u09CC"],"\u09D7","\u0A03",["\u0A3E","\u0A40"],"\u0A83",["\u0ABE","\u0AC0"],"\u0AC9",["\u0ACB","\u0ACC"],["\u0B02","\u0B03"],"\u0B3E","\u0B40",["\u0B47","\u0B48"],["\u0B4B","\u0B4C"],"\u0B57",["\u0BBE","\u0BBF"],["\u0BC1","\u0BC2"],["\u0BC6","\u0BC8"],["\u0BCA","\u0BCC"],"\u0BD7",["\u0C01","\u0C03"],["\u0C41","\u0C44"],["\u0C82","\u0C83"],"\u0CBE",["\u0CC0","\u0CC4"],["\u0CC7","\u0CC8"],["\u0CCA","\u0CCB"],["\u0CD5","\u0CD6"],["\u0D02","\u0D03"],["\u0D3E","\u0D40"],["\u0D46","\u0D48"],["\u0D4A","\u0D4C"],"\u0D57",["\u0D82","\u0D83"],["\u0DCF","\u0DD1"],["\u0DD8","\u0DDF"],["\u0DF2","\u0DF3"],["\u0F3E","\u0F3F"],"\u0F7F",["\u102B","\u102C"],"\u1031","\u1038",["\u103B","\u103C"],["\u1056","\u1057"],["\u1062","\u1064"],["\u1067","\u106D"],["\u1083","\u1084"],["\u1087","\u108C"],"\u108F",["\u109A","\u109C"],"\u17B6",["\u17BE","\u17C5"],["\u17C7","\u17C8"],["\u1923","\u1926"],["\u1929","\u192B"],["\u1930","\u1931"],["\u1933","\u1938"],["\u1A19","\u1A1A"],"\u1A55","\u1A57","\u1A61",["\u1A63","\u1A64"],["\u1A6D","\u1A72"],"\u1B04","\u1B35","\u1B3B",["\u1B3D","\u1B41"],["\u1B43","\u1B44"],"\u1B82","\u1BA1",["\u1BA6","\u1BA7"],"\u1BAA","\u1BE7",["\u1BEA","\u1BEC"],"\u1BEE",["\u1BF2","\u1BF3"],["\u1C24","\u1C2B"],["\u1C34","\u1C35"],"\u1CE1",["\u1CF2","\u1CF3"],["\u302E","\u302F"],["\uA823","\uA824"],"\uA827",["\uA880","\uA881"],["\uA8B4","\uA8C3"],["\uA952","\uA953"],"\uA983",["\uA9B4","\uA9B5"],["\uA9BA","\uA9BB"],["\uA9BD","\uA9C0"],["\uAA2F","\uAA30"],["\uAA33","\uAA34"],"\uAA4D","\uAA7B","\uAA7D","\uAAEB",["\uAAEE","\uAAEF"],"\uAAF5",["\uABE3","\uABE4"],["\uABE6","\uABE7"],["\uABE9","\uABEA"],"\uABEC"],!1,!1),$e=Pr([["\u0300","\u036F"],["\u0483","\u0487"],["\u0591","\u05BD"],"\u05BF",["\u05C1","\u05C2"],["\u05C4","\u05C5"],"\u05C7",["\u0610","\u061A"],["\u064B","\u065F"],"\u0670",["\u06D6","\u06DC"],["\u06DF","\u06E4"],["\u06E7","\u06E8"],["\u06EA","\u06ED"],"\u0711",["\u0730","\u074A"],["\u07A6","\u07B0"],["\u07EB","\u07F3"],["\u0816","\u0819"],["\u081B","\u0823"],["\u0825","\u0827"],["\u0829","\u082D"],["\u0859","\u085B"],["\u08E3","\u0902"],"\u093A","\u093C",["\u0941","\u0948"],"\u094D",["\u0951","\u0957"],["\u0962","\u0963"],"\u0981","\u09BC",["\u09C1","\u09C4"],"\u09CD",["\u09E2","\u09E3"],["\u0A01","\u0A02"],"\u0A3C",["\u0A41","\u0A42"],["\u0A47","\u0A48"],["\u0A4B","\u0A4D"],"\u0A51",["\u0A70","\u0A71"],"\u0A75",["\u0A81","\u0A82"],"\u0ABC",["\u0AC1","\u0AC5"],["\u0AC7","\u0AC8"],"\u0ACD",["\u0AE2","\u0AE3"],"\u0B01","\u0B3C","\u0B3F",["\u0B41","\u0B44"],"\u0B4D","\u0B56",["\u0B62","\u0B63"],"\u0B82","\u0BC0","\u0BCD","\u0C00",["\u0C3E","\u0C40"],["\u0C46","\u0C48"],["\u0C4A","\u0C4D"],["\u0C55","\u0C56"],["\u0C62","\u0C63"],"\u0C81","\u0CBC","\u0CBF","\u0CC6",["\u0CCC","\u0CCD"],["\u0CE2","\u0CE3"],"\u0D01",["\u0D41","\u0D44"],"\u0D4D",["\u0D62","\u0D63"],"\u0DCA",["\u0DD2","\u0DD4"],"\u0DD6","\u0E31",["\u0E34","\u0E3A"],["\u0E47","\u0E4E"],"\u0EB1",["\u0EB4","\u0EB9"],["\u0EBB","\u0EBC"],["\u0EC8","\u0ECD"],["\u0F18","\u0F19"],"\u0F35","\u0F37","\u0F39",["\u0F71","\u0F7E"],["\u0F80","\u0F84"],["\u0F86","\u0F87"],["\u0F8D","\u0F97"],["\u0F99","\u0FBC"],"\u0FC6",["\u102D","\u1030"],["\u1032","\u1037"],["\u1039","\u103A"],["\u103D","\u103E"],["\u1058","\u1059"],["\u105E","\u1060"],["\u1071","\u1074"],"\u1082",["\u1085","\u1086"],"\u108D","\u109D",["\u135D","\u135F"],["\u1712","\u1714"],["\u1732","\u1734"],["\u1752","\u1753"],["\u1772","\u1773"],["\u17B4","\u17B5"],["\u17B7","\u17BD"],"\u17C6",["\u17C9","\u17D3"],"\u17DD",["\u180B","\u180D"],"\u18A9",["\u1920","\u1922"],["\u1927","\u1928"],"\u1932",["\u1939","\u193B"],["\u1A17","\u1A18"],"\u1A1B","\u1A56",["\u1A58","\u1A5E"],"\u1A60","\u1A62",["\u1A65","\u1A6C"],["\u1A73","\u1A7C"],"\u1A7F",["\u1AB0","\u1ABD"],["\u1B00","\u1B03"],"\u1B34",["\u1B36","\u1B3A"],"\u1B3C","\u1B42",["\u1B6B","\u1B73"],["\u1B80","\u1B81"],["\u1BA2","\u1BA5"],["\u1BA8","\u1BA9"],["\u1BAB","\u1BAD"],"\u1BE6",["\u1BE8","\u1BE9"],"\u1BED",["\u1BEF","\u1BF1"],["\u1C2C","\u1C33"],["\u1C36","\u1C37"],["\u1CD0","\u1CD2"],["\u1CD4","\u1CE0"],["\u1CE2","\u1CE8"],"\u1CED","\u1CF4",["\u1CF8","\u1CF9"],["\u1DC0","\u1DF5"],["\u1DFC","\u1DFF"],["\u20D0","\u20DC"],"\u20E1",["\u20E5","\u20F0"],["\u2CEF","\u2CF1"],"\u2D7F",["\u2DE0","\u2DFF"],["\u302A","\u302D"],["\u3099","\u309A"],"\uA66F",["\uA674","\uA67D"],["\uA69E","\uA69F"],["\uA6F0","\uA6F1"],"\uA802","\uA806","\uA80B",["\uA825","\uA826"],"\uA8C4",["\uA8E0","\uA8F1"],["\uA926","\uA92D"],["\uA947","\uA951"],["\uA980","\uA982"],"\uA9B3",["\uA9B6","\uA9B9"],"\uA9BC","\uA9E5",["\uAA29","\uAA2E"],["\uAA31","\uAA32"],["\uAA35","\uAA36"],"\uAA43","\uAA4C","\uAA7C","\uAAB0",["\uAAB2","\uAAB4"],["\uAAB7","\uAAB8"],["\uAABE","\uAABF"],"\uAAC1",["\uAAEC","\uAAED"],"\uAAF6","\uABE5","\uABE8","\uABED","\uFB1E",["\uFE00","\uFE0F"],["\uFE20","\uFE2F"]],!1,!1),Oe=Pr([["0","9"],["\u0660","\u0669"],["\u06F0","\u06F9"],["\u07C0","\u07C9"],["\u0966","\u096F"],["\u09E6","\u09EF"],["\u0A66","\u0A6F"],["\u0AE6","\u0AEF"],["\u0B66","\u0B6F"],["\u0BE6","\u0BEF"],["\u0C66","\u0C6F"],["\u0CE6","\u0CEF"],["\u0D66","\u0D6F"],["\u0DE6","\u0DEF"],["\u0E50","\u0E59"],["\u0ED0","\u0ED9"],["\u0F20","\u0F29"],["\u1040","\u1049"],["\u1090","\u1099"],["\u17E0","\u17E9"],["\u1810","\u1819"],["\u1946","\u194F"],["\u19D0","\u19D9"],["\u1A80","\u1A89"],["\u1A90","\u1A99"],["\u1B50","\u1B59"],["\u1BB0","\u1BB9"],["\u1C40","\u1C49"],["\u1C50","\u1C59"],["\uA620","\uA629"],["\uA8D0","\uA8D9"],["\uA900","\uA909"],["\uA9D0","\uA9D9"],["\uA9F0","\uA9F9"],["\uAA50","\uAA59"],["\uABF0","\uABF9"],["\uFF10","\uFF19"]],!1,!1),zt=Pr([["\u16EE","\u16F0"],["\u2160","\u2182"],["\u2185","\u2188"],"\u3007",["\u3021","\u3029"],["\u3038","\u303A"],["\uA6E6","\uA6EF"]],!1,!1),Er=Pr(["_",["\u203F","\u2040"],"\u2054",["\uFE33","\uFE34"],["\uFE4D","\uFE4F"],"\uFF3F"],!1,!1),sn=Pr([" ","\xA0","\u1680",["\u2000","\u200A"],"\u202F","\u205F","\u3000"],!1,!1),un=Ye(";",!1),ai=function(C,k,X){return{type:"grammar",topLevelInitializer:C,initializer:k,rules:X,location:lr()}},Pu=function(C){return{type:"top_level_initializer",code:C[0],codeLocation:C[1],location:lr()}},In=function(C){return{type:"initializer",code:C[0],codeLocation:C[1],location:lr()}},an=function(C,k,X){return{type:"rule",name:C[0],nameLocation:C[1],expression:k!==null?{type:"named",name:k,expression:X,location:lr()}:X,location:lr()}},Ru=function(C,k){return k.length>0?{type:"choice",alternatives:[C].concat(k),location:lr()}:C},Bi=function(C,k){return k!==null?{type:"action",expression:C,code:k[0],codeLocation:k[1],location:lr()}:C},ha=function(C,k){return k.length>0||C.type==="labeled"&&C.pick?{type:"sequence",elements:[C].concat(k),location:lr()}:C},Fh=function(C,k,X){return X.type.startsWith("semantic_")&&ic('"@" cannot be used on a semantic predicate',C),{type:"labeled",label:k!==null?k[0]:null,labelLocation:k!==null?k[1]:C,pick:!0,expression:X,location:lr()}},Ch=function(C,k){return{type:"labeled",label:C[0],labelLocation:C[1],expression:k,location:lr()}},Qt=function(){return lr()},Jt=function(C){return oo.indexOf(C[0])>=0&&ic(`Label can't be a reserved word "${C[0]}"`,C[1]),C},Dh=function(C,k){return{type:T7[C],expression:k,location:lr()}},yh=function(C,k){return{type:x7[k],expression:C,location:lr()}},Sh=function(C){return C.type==="labeled"||C.type==="sequence"?{type:"group",expression:C,location:lr()}:C},bh=function(C){return{type:"rule_ref",name:C[0],location:lr()}},_h=function(C,k){return{type:O7[C],code:k[0],codeLocation:k[1],location:lr()}},Bh=function(C,k){return[C+k.join(""),lr()]},il=function(C,k){return{type:"literal",value:C,ignoreCase:k!==null,location:lr()}},Ih=function(C){return C.join("")},$r=function(C){return C.join("")},tc=function(C,k,X){return{type:"class",parts:k.filter(M=>M!==""),inverted:C!==null,ignoreCase:X!==null,location:lr()}},js=function(C,k){return C.charCodeAt(0)>k.charCodeAt(0)&&ic("Invalid character range: "+nc()+"."),[C,k]},sl=function(){return""},rc=function(){return"\0"},Kn=function(){return"\b"},ul=function(){return"\f"},al=function(){return`
`},ol=function(){return"\r"},cl=function(){return" "},ll=function(){return"\v"},fl=function(C){return String.fromCharCode(parseInt(C,16))},$n=function(C){return String.fromCharCode(parseInt(C,16))},$h=function(){return{type:"any",location:lr()}},Vn=function(C){return[C,lr()]},I=0,ot=0,oi=[{line:1,column:1}],Pn=0,pa=[],te=0,ci;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');u=s[t.startRule]}function nc(){return e.substring(ot,I)}function Jd(){return ot}function hl(){return{source:n,start:ot,end:I}}function lr(){return Ms(ot,I)}function Xd(C,k){throw k=k!==void 0?k:Ms(ot,I),dl([Ii(C)],e.substring(ot,I),k)}function ic(C,k){throw k=k!==void 0?k:Ms(ot,I),pl(C,k)}function Ye(C,k){return{type:"literal",text:C,ignoreCase:k}}function Pr(C,k,X){return{type:"class",parts:C,inverted:k,ignoreCase:X}}function Tu(){return{type:"any"}}function Ph(){return{type:"end"}}function Ii(C){return{type:"other",description:C}}function sc(C){var k=oi[C],X;if(k)return k;for(X=C-1;!oi[X];)X--;for(k=oi[X],k={line:k.line,column:k.column};X<C;)e.charCodeAt(X)===10?(k.line++,k.column=1):k.column++,X++;return oi[C]=k,k}function Ms(C,k){var X=sc(C),M=sc(k);return{source:n,start:{offset:C,line:X.line,column:X.column},end:{offset:k,line:M.line,column:M.column}}}function me(C){I<Pn||(I>Pn&&(Pn=I,pa=[]),pa.push(C))}function pl(C,k){return new ta(C,null,null,k)}function dl(C,k,X){return new ta(ta.buildMessage(C,k),C,k,X)}function Ja(){var C,k,X,M,ue,le,Wt,wr;if(C=I,k=kt(),X=I,M=uc(),M!==r?(ue=kt(),X=M):(I=X,X=r),X===r&&(X=null),M=I,ue=Rh(),ue!==r?(le=kt(),M=ue):(I=M,M=r),M===r&&(M=null),ue=[],le=I,Wt=ac(),Wt!==r?(wr=kt(),le=Wt):(I=le,le=r),le!==r)for(;le!==r;)ue.push(le),le=I,Wt=ac(),Wt!==r?(wr=kt(),le=Wt):(I=le,le=r);else ue=r;return ue!==r?(ot=C,C=ai(X,M,ue)):(I=C,C=r),C}function uc(){var C,k,X,M,ue;return C=I,e.charCodeAt(I)===123?(k=i,I++):(k=r,te===0&&me(qr)),k!==r?(X=Bt(),X!==r?(e.charCodeAt(I)===125?(M=o,I++):(M=r,te===0&&me(Vi)),M!==r?(ue=Gs(),ue!==r?(ot=C,C=Pu(X)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r),C}function Rh(){var C,k,X;return C=I,k=Bt(),k!==r?(X=Gs(),X!==r?(ot=C,C=In(k)):(I=C,C=r)):(I=C,C=r),C}function ac(){var C,k,X,M,ue,le,Wt,wr;return C=I,k=Qa(),k!==r?(X=kt(),M=I,ue=$i(),ue!==r?(le=kt(),M=ue):(I=M,M=r),M===r&&(M=null),e.charCodeAt(I)===61?(ue=l,I++):(ue=r,te===0&&me(bu)),ue!==r?(le=kt(),Wt=dn(),Wt!==r?(wr=Gs(),wr!==r?(ot=C,C=an(k,M,Wt)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r),C}function dn(){var C,k,X,M,ue,le,Wt,wr;if(C=I,k=da(),k!==r){for(X=[],M=I,ue=kt(),e.charCodeAt(I)===47?(le=f,I++):(le=r,te===0&&me(is)),le!==r?(Wt=kt(),wr=da(),wr!==r?M=wr:(I=M,M=r)):(I=M,M=r);M!==r;)X.push(M),M=I,ue=kt(),e.charCodeAt(I)===47?(le=f,I++):(le=r,te===0&&me(is)),le!==r?(Wt=kt(),wr=da(),wr!==r?M=wr:(I=M,M=r)):(I=M,M=r);ot=C,C=Ru(k,X)}else I=C,C=r;return C}function da(){var C,k,X,M,ue;return C=I,k=ga(),k!==r?(X=I,M=kt(),ue=Bt(),ue!==r?X=ue:(I=X,X=r),X===r&&(X=null),ot=C,C=Bi(k,X)):(I=C,C=r),C}function ga(){var C,k,X,M,ue,le;if(C=I,k=Xa(),k!==r){for(X=[],M=I,ue=kt(),le=Xa(),le!==r?M=le:(I=M,M=r);M!==r;)X.push(M),M=I,ue=kt(),le=Xa(),le!==r?M=le:(I=M,M=r);ot=C,C=ha(k,X)}else I=C,C=r;return C}function Xa(){var C,k,X,M;return C=I,k=gl(),k!==r?(X=ml(),X===r&&(X=null),M=oc(),M!==r?(ot=C,C=Fh(k,X,M)):(I=C,C=r)):(I=C,C=r),C===r&&(C=I,k=ml(),k!==r?(X=kt(),M=oc(),M!==r?(ot=C,C=Ch(k,M)):(I=C,C=r)):(I=C,C=r),C===r&&(C=oc())),C}function gl(){var C,k;return C=I,e.charCodeAt(I)===64?(k=d,I++):(k=r,te===0&&me(_u)),k!==r&&(ot=C,k=Qt()),C=k,C}function ml(){var C,k,X,M;return C=I,k=Qa(),k!==r?(X=kt(),e.charCodeAt(I)===58?(M=E,I++):(M=r,te===0&&me(ss)),M!==r?(ot=C,C=Jt(k)):(I=C,C=r)):(I=C,C=r),C}function oc(){var C,k,X,M;return C=I,k=Th(),k!==r?(X=kt(),M=vl(),M!==r?(ot=C,C=Dh(k,M)):(I=C,C=r)):(I=C,C=r),C===r&&(C=vl()),C}function Th(){var C;return e.charCodeAt(I)===36?(C=p,I++):(C=r,te===0&&me(Gi)),C===r&&(e.charCodeAt(I)===38?(C=h,I++):(C=r,te===0&&me(xt)),C===r&&(e.charCodeAt(I)===33?(C=w,I++):(C=r,te===0&&me(Hn)))),C}function vl(){var C,k,X,M;return C=I,k=qs(),k!==r?(X=kt(),M=xh(),M!==r?(ot=C,C=yh(k,M)):(I=C,C=r)):(I=C,C=r),C===r&&(C=qs()),C}function xh(){var C;return e.charCodeAt(I)===63?(C=v,I++):(C=r,te===0&&me(Bu)),C===r&&(e.charCodeAt(I)===42?(C=D,I++):(C=r,te===0&&me(Iu)),C===r&&(e.charCodeAt(I)===43?(C=A,I++):(C=r,te===0&&me($u)))),C}function qs(){var C,k,X,M,ue,le;return C=Hh(),C===r&&(C=oe(),C===r&&(C=ro(),C===r&&(C=Oh(),C===r&&(C=kh(),C===r&&(C=I,e.charCodeAt(I)===40?(k=F,I++):(k=r,te===0&&me(us)),k!==r?(X=kt(),M=dn(),M!==r?(ue=kt(),e.charCodeAt(I)===41?(le=S,I++):(le=r,te===0&&me(ra)),le!==r?(ot=C,C=Sh(M)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r)))))),C}function Oh(){var C,k,X,M,ue,le,Wt,wr;return C=I,k=Qa(),k!==r?(X=I,te++,M=I,ue=kt(),le=I,Wt=$i(),Wt!==r?(wr=kt(),Wt=[Wt,wr],le=Wt):(I=le,le=r),le===r&&(le=null),e.charCodeAt(I)===61?(Wt=l,I++):(Wt=r,te===0&&me(bu)),Wt!==r?(ue=[ue,le,Wt],M=ue):(I=M,M=r),te--,M===r?X=void 0:(I=X,X=r),X!==r?(ot=C,C=bh(k)):(I=C,C=r)):(I=C,C=r),C}function kh(){var C,k,X,M;return C=I,k=cc(),k!==r?(X=kt(),M=Bt(),M!==r?(ot=C,C=_h(k,M)):(I=C,C=r)):(I=C,C=r),C}function cc(){var C;return e.charCodeAt(I)===38?(C=h,I++):(C=r,te===0&&me(xt)),C===r&&(e.charCodeAt(I)===33?(C=w,I++):(C=r,te===0&&me(Hn))),C}function on(){var C;return e.length>I?(C=e.charAt(I),I++):(C=r,te===0&&me(as)),C}function li(){var C,k;return te++,e.charCodeAt(I)===9?(C=B,I++):(C=r,te===0&&me(Hs)),C===r&&(e.charCodeAt(I)===11?(C=_,I++):(C=r,te===0&&me(re)),C===r&&(e.charCodeAt(I)===12?(C=K,I++):(C=r,te===0&&me(fe)),C===r&&(e.charCodeAt(I)===32?(C=G,I++):(C=r,te===0&&me(Le)),C===r&&(e.charCodeAt(I)===160?(C=b,I++):(C=r,te===0&&me(ke)),C===r&&(e.charCodeAt(I)===65279?(C=P,I++):(C=r,te===0&&me(Ve)),C===r&&(C=yl())))))),te--,C===r&&(k=r,te===0&&me(na)),C}function fi(){var C;return mt.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(at)),C}function Za(){var C,k;return te++,e.charCodeAt(I)===10?(C=L,I++):(C=r,te===0&&me(yr)),C===r&&(e.substr(I,2)===j?(C=j,I+=2):(C=r,te===0&&me(Ut)),C===r&&(e.charCodeAt(I)===13?(C=V,I++):(C=r,te===0&&me(jn)),C===r&&(e.charCodeAt(I)===8232?(C=W,I++):(C=r,te===0&&me(_i)),C===r&&(e.charCodeAt(I)===8233?(C=q,I++):(C=r,te===0&&me(rn)))))),te--,C===r&&(k=r,te===0&&me(lt)),C}function Al(){var C,k;return te++,C=Nh(),C===r&&(C=Gn()),te--,C===r&&(k=r,te===0&&me(pn)),C}function Nh(){var C,k,X,M,ue,le;if(C=I,e.substr(I,2)===z?(k=z,I+=2):(k=r,te===0&&me(vr)),k!==r){for(X=[],M=I,ue=I,te++,e.substr(I,2)===J?(le=J,I+=2):(le=r,te===0&&me(nn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);M!==r;)X.push(M),M=I,ue=I,te++,e.substr(I,2)===J?(le=J,I+=2):(le=r,te===0&&me(nn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);e.substr(I,2)===J?(M=J,I+=2):(M=r,te===0&&me(nn)),M!==r?(k=[k,X,M],C=k):(I=C,C=r)}else I=C,C=r;return C}function Ks(){var C,k,X,M,ue,le;if(C=I,e.substr(I,2)===z?(k=z,I+=2):(k=r,te===0&&me(vr)),k!==r){for(X=[],M=I,ue=I,te++,e.substr(I,2)===J?(le=J,I+=2):(le=r,te===0&&me(nn)),le===r&&(le=fi()),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);M!==r;)X.push(M),M=I,ue=I,te++,e.substr(I,2)===J?(le=J,I+=2):(le=r,te===0&&me(nn)),le===r&&(le=fi()),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);e.substr(I,2)===J?(M=J,I+=2):(M=r,te===0&&me(nn)),M!==r?(k=[k,X,M],C=k):(I=C,C=r)}else I=C,C=r;return C}function Gn(){var C,k,X,M,ue,le;if(C=I,e.substr(I,2)===se?(k=se,I+=2):(k=r,te===0&&me(kr)),k!==r){for(X=[],M=I,ue=I,te++,le=fi(),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);M!==r;)X.push(M),M=I,ue=I,te++,le=fi(),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);k=[k,X],C=k}else I=C,C=r;return C}function Qa(){var C,k,X,M;if(te++,C=I,k=El(),k!==r){for(X=[],M=wl();M!==r;)X.push(M),M=wl();ot=C,C=Bh(k,X)}else I=C,C=r;return te--,C===r&&(k=r,te===0&&me(ia)),C}function El(){var C,k,X;return C=Lh(),C===r&&(e.charCodeAt(I)===36?(C=p,I++):(C=r,te===0&&me(Gi)),C===r&&(e.charCodeAt(I)===95?(C=ye,I++):(C=r,te===0&&me(os)),C===r&&(C=I,e.charCodeAt(I)===92?(k=Ce,I++):(k=r,te===0&&me(Sn)),k!==r?(X=Fl(),X!==r?C=X:(I=C,C=r)):(I=C,C=r)))),C}function wl(){var C;return C=El(),C===r&&(C=Uh(),C===r&&(C=Cl(),C===r&&(C=Dl(),C===r&&(e.charCodeAt(I)===8204?(C=Pe,I++):(C=r,te===0&&me(Pt)),C===r&&(e.charCodeAt(I)===8205?(C=Xe,I++):(C=r,te===0&&me(Ar))))))),C}function Lh(){var C;return C=so(),C===r&&(C=io(),C===r&&(C=Vh(),C===r&&(C=qh(),C===r&&(C=Kh(),C===r&&(C=ao()))))),C}function Uh(){var C;return C=uo(),C===r&&(C=ls()),C}function Hh(){var C,k,X;return te++,C=I,k=$i(),k!==r?(e.charCodeAt(I)===105?(X=ce,I++):(X=r,te===0&&me(sr)),X===r&&(X=null),ot=C,C=il(k,X)):(I=C,C=r),te--,C===r&&(k=r,te===0&&me(rt)),C}function $i(){var C,k,X,M;if(te++,C=I,e.charCodeAt(I)===34?(k=Ie,I++):(k=r,te===0&&me(ur)),k!==r){for(X=[],M=ne();M!==r;)X.push(M),M=ne();e.charCodeAt(I)===34?(M=Ie,I++):(M=r,te===0&&me(ur)),M!==r?(ot=C,C=Ih(X)):(I=C,C=r)}else I=C,C=r;if(C===r)if(C=I,e.charCodeAt(I)===39?(k=Me,I++):(k=r,te===0&&me(Ht)),k!==r){for(X=[],M=he();M!==r;)X.push(M),M=he();e.charCodeAt(I)===39?(M=Me,I++):(M=r,te===0&&me(Ht)),M!==r?(ot=C,C=$r(X)):(I=C,C=r)}else I=C,C=r;return te--,C===r&&(k=r,te===0&&me(Kr)),C}function ne(){var C,k,X,M;return C=I,k=I,X=I,te++,e.charCodeAt(I)===34?(M=Ie,I++):(M=r,te===0&&me(ur)),M===r&&(e.charCodeAt(I)===92?(M=Ce,I++):(M=r,te===0&&me(Sn)),M===r&&(M=fi())),te--,M===r?X=void 0:(I=X,X=r),X!==r?(M=on(),M!==r?(X=[X,M],k=X):(I=k,k=r)):(I=k,k=r),k!==r?C=e.substring(C,I):C=k,C===r&&(C=I,e.charCodeAt(I)===92?(k=Ce,I++):(k=r,te===0&&me(Sn)),k!==r?(X=fr(),X!==r?C=X:(I=C,C=r)):(I=C,C=r),C===r&&(C=yt())),C}function he(){var C,k,X,M;return C=I,k=I,X=I,te++,e.charCodeAt(I)===39?(M=Me,I++):(M=r,te===0&&me(Ht)),M===r&&(e.charCodeAt(I)===92?(M=Ce,I++):(M=r,te===0&&me(Sn)),M===r&&(M=fi())),te--,M===r?X=void 0:(I=X,X=r),X!==r?(M=on(),M!==r?(X=[X,M],k=X):(I=k,k=r)):(I=k,k=r),k!==r?C=e.substring(C,I):C=k,C===r&&(C=I,e.charCodeAt(I)===92?(k=Ce,I++):(k=r,te===0&&me(Sn)),k!==r?(X=fr(),X!==r?C=X:(I=C,C=r)):(I=C,C=r),C===r&&(C=yt())),C}function oe(){var C,k,X,M,ue,le;if(te++,C=I,e.charCodeAt(I)===91?(k=_r,I++):(k=r,te===0&&me(Mn)),k!==r){for(e.charCodeAt(I)===94?(X=Kt,I++):(X=r,te===0&&me(qn)),X===r&&(X=null),M=[],ue=Ne(),ue===r&&(ue=nt());ue!==r;)M.push(ue),ue=Ne(),ue===r&&(ue=nt());e.charCodeAt(I)===93?(ue=Ft,I++):(ue=r,te===0&&me(_n)),ue!==r?(e.charCodeAt(I)===105?(le=ce,I++):(le=r,te===0&&me(sr)),le===r&&(le=null),ot=C,C=tc(X,M,le)):(I=C,C=r)}else I=C,C=r;return te--,C===r&&(k=r,te===0&&me(bn)),C}function Ne(){var C,k,X,M;return C=I,k=nt(),k!==r?(e.charCodeAt(I)===45?(X=gr,I++):(X=r,te===0&&me(Ir)),X!==r?(M=nt(),M!==r?(ot=C,C=js(k,M)):(I=C,C=r)):(I=C,C=r)):(I=C,C=r),C}function nt(){var C,k,X,M;return C=I,k=I,X=I,te++,e.charCodeAt(I)===93?(M=Ft,I++):(M=r,te===0&&me(_n)),M===r&&(e.charCodeAt(I)===92?(M=Ce,I++):(M=r,te===0&&me(Sn)),M===r&&(M=fi())),te--,M===r?X=void 0:(I=X,X=r),X!==r?(M=on(),M!==r?(X=[X,M],k=X):(I=k,k=r)):(I=k,k=r),k!==r?C=e.substring(C,I):C=k,C===r&&(C=I,e.charCodeAt(I)===92?(k=Ce,I++):(k=r,te===0&&me(Sn)),k!==r?(X=fr(),X!==r?C=X:(I=C,C=r)):(I=C,C=r),C===r&&(C=yt())),C}function yt(){var C,k,X;return C=I,e.charCodeAt(I)===92?(k=Ce,I++):(k=r,te===0&&me(Sn)),k!==r?(X=Za(),X!==r?(ot=C,C=sl()):(I=C,C=r)):(I=C,C=r),C}function fr(){var C,k,X,M;return C=Yt(),C===r&&(C=I,e.charCodeAt(I)===48?(k=nr,I++):(k=r,te===0&&me(or)),k!==r?(X=I,te++,M=Vs(),te--,M===r?X=void 0:(I=X,X=r),X!==r?(ot=C,C=rc()):(I=C,C=r)):(I=C,C=r),C===r&&(C=to(),C===r&&(C=Fl()))),C}function Yt(){var C;return C=eo(),C===r&&(C=jh()),C}function eo(){var C,k;return e.charCodeAt(I)===39?(C=Me,I++):(C=r,te===0&&me(Ht)),C===r&&(e.charCodeAt(I)===34?(C=Ie,I++):(C=r,te===0&&me(ur)),C===r&&(e.charCodeAt(I)===92?(C=Ce,I++):(C=r,te===0&&me(Sn)),C===r&&(C=I,e.charCodeAt(I)===98?(k=ht,I++):(k=r,te===0&&me(ec)),k!==r&&(ot=C,k=Kn()),C=k,C===r&&(C=I,e.charCodeAt(I)===102?(k=Vt,I++):(k=r,te===0&&me(sa)),k!==r&&(ot=C,k=ul()),C=k,C===r&&(C=I,e.charCodeAt(I)===110?(k=st,I++):(k=r,te===0&&me(Vr)),k!==r&&(ot=C,k=al()),C=k,C===r&&(C=I,e.charCodeAt(I)===114?(k=ze,I++):(k=r,te===0&&me(aa)),k!==r&&(ot=C,k=ol()),C=k,C===r&&(C=I,e.charCodeAt(I)===116?(k=ir,I++):(k=r,te===0&&me(za)),k!==r&&(ot=C,k=cl()),C=k,C===r&&(C=I,e.charCodeAt(I)===118?(k=je,I++):(k=r,te===0&&me(Ya)),k!==r&&(ot=C,k=ll()),C=k)))))))),C}function jh(){var C,k,X,M;return C=I,k=I,X=I,te++,M=zn(),M===r&&(M=fi()),te--,M===r?X=void 0:(I=X,X=r),X!==r?(M=on(),M!==r?(X=[X,M],k=X):(I=k,k=r)):(I=k,k=r),k!==r?C=e.substring(C,I):C=k,C}function zn(){var C;return C=eo(),C===r&&(C=Vs(),C===r&&(e.charCodeAt(I)===120?(C=Tt,I++):(C=r,te===0&&me(oa)),C===r&&(e.charCodeAt(I)===117?(C=Zr,I++):(C=r,te===0&&me(cs))))),C}function to(){var C,k,X,M,ue,le;return C=I,e.charCodeAt(I)===120?(k=Tt,I++):(k=r,te===0&&me(oa)),k!==r?(X=I,M=I,ue=zi(),ue!==r?(le=zi(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r),M!==r?X=e.substring(X,I):X=M,X!==r?(ot=C,C=fl(X)):(I=C,C=r)):(I=C,C=r),C}function Fl(){var C,k,X,M,ue,le,Wt,wr;return C=I,e.charCodeAt(I)===117?(k=Zr,I++):(k=r,te===0&&me(cs)),k!==r?(X=I,M=I,ue=zi(),ue!==r?(le=zi(),le!==r?(Wt=zi(),Wt!==r?(wr=zi(),wr!==r?(ue=[ue,le,Wt,wr],M=ue):(I=M,M=r)):(I=M,M=r)):(I=M,M=r)):(I=M,M=r),M!==r?X=e.substring(X,I):X=M,X!==r?(ot=C,C=$n(X)):(I=C,C=r)):(I=C,C=r),C}function Vs(){var C;return Br.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(ca)),C}function zi(){var C;return ui.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(Wa)),C}function ro(){var C,k;return C=I,e.charCodeAt(I)===46?(k=Zt,I++):(k=r,te===0&&me(la)),k!==r&&(ot=C,k=$h()),C=k,C}function Bt(){var C,k,X,M;return te++,C=I,e.charCodeAt(I)===123?(k=i,I++):(k=r,te===0&&me(qr)),k!==r?(X=Mh(),e.charCodeAt(I)===125?(M=o,I++):(M=r,te===0&&me(Vi)),M!==r?C=X:(I=C,C=r)):(I=C,C=r),te--,C===r&&(k=r,te===0&&me(fa)),C}function Mh(){var C,k;return C=I,k=no(),ot=C,k=Vn(k),C=k,C}function no(){var C,k,X,M,ue,le;if(C=I,k=[],X=[],M=I,ue=I,te++,Qr.test(e.charAt(I))?(le=e.charAt(I),I++):(le=r,te===0&&me(Bn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r),M!==r)for(;M!==r;)X.push(M),M=I,ue=I,te++,Qr.test(e.charAt(I))?(le=e.charAt(I),I++):(le=r,te===0&&me(Bn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);else X=r;for(X===r&&(X=I,e.charCodeAt(I)===123?(M=i,I++):(M=r,te===0&&me(qr)),M!==r?(ue=no(),e.charCodeAt(I)===125?(le=o,I++):(le=r,te===0&&me(Vi)),le!==r?(M=[M,ue,le],X=M):(I=X,X=r)):(I=X,X=r));X!==r;){if(k.push(X),X=[],M=I,ue=I,te++,Qr.test(e.charAt(I))?(le=e.charAt(I),I++):(le=r,te===0&&me(Bn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r),M!==r)for(;M!==r;)X.push(M),M=I,ue=I,te++,Qr.test(e.charAt(I))?(le=e.charAt(I),I++):(le=r,te===0&&me(Bn)),te--,le===r?ue=void 0:(I=ue,ue=r),ue!==r?(le=on(),le!==r?(ue=[ue,le],M=ue):(I=M,M=r)):(I=M,M=r);else X=r;X===r&&(X=I,e.charCodeAt(I)===123?(M=i,I++):(M=r,te===0&&me(qr)),M!==r?(ue=no(),e.charCodeAt(I)===125?(le=o,I++):(le=r,te===0&&me(Vi)),le!==r?(M=[M,ue,le],X=M):(I=X,X=r)):(I=X,X=r))}return C=e.substring(C,I),C}function io(){var C;return Dt.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(R)),C}function qh(){var C;return Ue.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(O)),C}function Kh(){var C;return be.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(H)),C}function Vh(){var C;return mr.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(Q)),C}function so(){var C;return en.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(ve)),C}function ls(){var C;return ut.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(we)),C}function uo(){var C;return Us.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me($e)),C}function Cl(){var C;return tn.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(Oe)),C}function ao(){var C;return ge.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(zt)),C}function Dl(){var C;return ns.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(Er)),C}function yl(){var C;return _t.test(e.charAt(I))?(C=e.charAt(I),I++):(C=r,te===0&&me(sn)),C}function kt(){var C,k;for(C=[],k=li(),k===r&&(k=Za(),k===r&&(k=Al()));k!==r;)C.push(k),k=li(),k===r&&(k=Za(),k===r&&(k=Al()));return C}function Sl(){var C,k;for(C=[],k=li(),k===r&&(k=Ks());k!==r;)C.push(k),k=li(),k===r&&(k=Ks());return C}function Gs(){var C,k,X,M;return C=I,k=kt(),e.charCodeAt(I)===59?(X=Gt,I++):(X=r,te===0&&me(un)),X!==r?(k=[k,X],C=k):(I=C,C=r),C===r&&(C=I,k=Sl(),X=Gn(),X===r&&(X=null),M=Za(),M!==r?(k=[k,X,M],C=k):(I=C,C=r),C===r&&(C=I,k=kt(),X=zs(),X!==r?(k=[k,X],C=k):(I=C,C=r))),C}function zs(){var C,k;return C=I,te++,e.length>I?(k=e.charAt(I),I++):(k=r,te===0&&me(as)),te--,k===r?C=void 0:(I=C,C=r),C}let oo=t.reservedWords||[];if(ci=u(),ci!==r&&I===e.length)return ci;throw ci!==r&&I<e.length&&me(Ph()),dl(pa,Pn<e.length?e.charAt(Pn):null,Pn<e.length?Ms(Pn,Pn+1):Ms(Pn,Pn))}jE.exports={SyntaxError:ta,parse:N7}});var nl=Be((QO,qE)=>{"use strict";var L7=fh(),U7=HE(),H7=ME(),j7=Dd(),M7=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","null","true","false","enum","implements","interface","let","package","private","protected","public","static","yield","await"],rl={VERSION:j7,RESERVED_WORDS:M7,GrammarError:L7,parser:H7,compiler:U7,generate(e,t){t=t!==void 0?t:{};function r(u){let i={};return Object.keys(u).forEach(o=>{i[o]=u[o].slice()}),i}let n="plugins"in t?t.plugins:[],s={parser:rl.parser,passes:r(rl.compiler.passes),reservedWords:rl.RESERVED_WORDS.slice()};return n.forEach(u=>{u.use(s,t)}),rl.compiler.compile(s.parser.parse(e,{grammarSource:t.grammarSource,reservedWords:s.reservedWords}),s.passes,t)}};qE.exports=rl});var qd=Be((jd,Md)=>{(function(e,t){typeof jd=="object"&&typeof Md<"u"?Md.exports=t():typeof define=="function"&&define.amd?define(t):e.JSON5=t()})(jd,function(){"use strict";function e(re,fe){return fe={exports:{}},re(fe,fe.exports),fe.exports}var t=e(function(re){var fe=re.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=fe)}),r=e(function(re){var fe=re.exports={version:"2.6.5"};typeof __e=="number"&&(__e=fe)}),n=r.version,s=function(re){return typeof re=="object"?re!==null:typeof re=="function"},u=function(re){if(!s(re))throw TypeError(re+" is not an object!");return re},i=function(re){try{return!!re()}catch{return!0}},o=!i(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),l=t.document,f=s(l)&&s(l.createElement),d=function(re){return f?l.createElement(re):{}},E=!o&&!i(function(){return Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a!=7}),p=function(re,fe){if(!s(re))return re;var Le,ke;if(fe&&typeof(Le=re.toString)=="function"&&!s(ke=Le.call(re))||typeof(Le=re.valueOf)=="function"&&!s(ke=Le.call(re))||!fe&&typeof(Le=re.toString)=="function"&&!s(ke=Le.call(re)))return ke;throw TypeError("Can't convert object to primitive value")},h=Object.defineProperty,w=o?Object.defineProperty:function(fe,Le,ke){if(u(fe),Le=p(Le,!0),u(ke),E)try{return h(fe,Le,ke)}catch{}if("get"in ke||"set"in ke)throw TypeError("Accessors not supported!");return"value"in ke&&(fe[Le]=ke.value),fe},v={f:w},D=function(re,fe){return{enumerable:!(re&1),configurable:!(re&2),writable:!(re&4),value:fe}},A=o?function(re,fe,Le){return v.f(re,fe,D(1,Le))}:function(re,fe,Le){return re[fe]=Le,re},F={}.hasOwnProperty,S=function(re,fe){return F.call(re,fe)},B=0,_=Math.random(),K=function(re){return"Symbol(".concat(re===void 0?"":re,")_",(++B+_).toString(36))},G=!1,b=e(function(re){var fe="__core-js_shared__",Le=t[fe]||(t[fe]={});(re.exports=function(ke,Ve){return Le[ke]||(Le[ke]=Ve!==void 0?Ve:{})})("versions",[]).push({version:r.version,mode:G?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),P=b("native-function-to-string",Function.toString),L=e(function(re){var fe=K("src"),Le="toString",ke=(""+P).split(Le);r.inspectSource=function(Ve){return P.call(Ve)},(re.exports=function(Ve,at,lt,yr){var Ut=typeof lt=="function";Ut&&(S(lt,"name")||A(lt,"name",at)),Ve[at]!==lt&&(Ut&&(S(lt,fe)||A(lt,fe,Ve[at]?""+Ve[at]:ke.join(String(at)))),Ve===t?Ve[at]=lt:yr?Ve[at]?Ve[at]=lt:A(Ve,at,lt):(delete Ve[at],A(Ve,at,lt)))})(Function.prototype,Le,function(){return typeof this=="function"&&this[fe]||P.call(this)})}),j=function(re){if(typeof re!="function")throw TypeError(re+" is not a function!");return re},V=function(re,fe,Le){if(j(re),fe===void 0)return re;switch(Le){case 1:return function(ke){return re.call(fe,ke)};case 2:return function(ke,Ve){return re.call(fe,ke,Ve)};case 3:return function(ke,Ve,at){return re.call(fe,ke,Ve,at)}}return function(){return re.apply(fe,arguments)}},W="prototype",q=function(re,fe,Le){var ke=re&q.F,Ve=re&q.G,at=re&q.S,lt=re&q.P,yr=re&q.B,Ut=Ve?t:at?t[fe]||(t[fe]={}):(t[fe]||{})[W],jn=Ve?r:r[fe]||(r[fe]={}),_i=jn[W]||(jn[W]={}),rn,pn,vr,nn;Ve&&(Le=fe);for(rn in Le)pn=!ke&&Ut&&Ut[rn]!==void 0,vr=(pn?Ut:Le)[rn],nn=yr&&pn?V(vr,t):lt&&typeof vr=="function"?V(Function.call,vr):vr,Ut&&L(Ut,rn,vr,re&q.U),jn[rn]!=vr&&A(jn,rn,nn),lt&&_i[rn]!=vr&&(_i[rn]=vr)};t.core=r,q.F=1,q.G=2,q.S=4,q.P=8,q.B=16,q.W=32,q.U=64,q.R=128;var z=q,J=Math.ceil,se=Math.floor,ye=function(re){return isNaN(re=+re)?0:(re>0?se:J)(re)},Ce=function(re){if(re==null)throw TypeError("Can't call method on "+re);return re},Pe=function(re){return function(fe,Le){var ke=String(Ce(fe)),Ve=ye(Le),at=ke.length,lt,yr;return Ve<0||Ve>=at?re?"":void 0:(lt=ke.charCodeAt(Ve),lt<55296||lt>56319||Ve+1===at||(yr=ke.charCodeAt(Ve+1))<56320||yr>57343?re?ke.charAt(Ve):lt:re?ke.slice(Ve,Ve+2):(lt-55296<<10)+(yr-56320)+65536)}},Xe=Pe(!1);z(z.P,"String",{codePointAt:function(fe){return Xe(this,fe)}});var ce=r.String.codePointAt,Ie=Math.max,Me=Math.min,_r=function(re,fe){return re=ye(re),re<0?Ie(re+fe,0):Me(re,fe)},Kt=String.fromCharCode,Ft=String.fromCodePoint;z(z.S+z.F*(!!Ft&&Ft.length!=1),"String",{fromCodePoint:function(fe){for(var Le=arguments,ke=[],Ve=arguments.length,at=0,lt;Ve>at;){if(lt=+Le[at++],_r(lt,1114111)!==lt)throw RangeError(lt+" is not a valid code point");ke.push(lt<65536?Kt(lt):Kt(((lt-=65536)>>10)+55296,lt%1024+56320))}return ke.join("")}});var gr=r.String.fromCodePoint,nr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ht=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Vt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,st={Space_Separator:nr,ID_Start:ht,ID_Continue:Vt},ze={isSpaceSeparator:function(fe){return typeof fe=="string"&&st.Space_Separator.test(fe)},isIdStartChar:function(fe){return typeof fe=="string"&&(fe>="a"&&fe<="z"||fe>="A"&&fe<="Z"||fe==="$"||fe==="_"||st.ID_Start.test(fe))},isIdContinueChar:function(fe){return typeof fe=="string"&&(fe>="a"&&fe<="z"||fe>="A"&&fe<="Z"||fe>="0"&&fe<="9"||fe==="$"||fe==="_"||fe==="\u200C"||fe==="\u200D"||st.ID_Continue.test(fe))},isDigit:function(fe){return typeof fe=="string"&&/[0-9]/.test(fe)},isHexDigit:function(fe){return typeof fe=="string"&&/[0-9A-Fa-f]/.test(fe)}},ir,je,Tt,Zr,Zt,Gt,mt,Br,ui,Qr=function(fe,Le){ir=String(fe),je="start",Tt=[],Zr=0,Zt=1,Gt=0,mt=void 0,Br=void 0,ui=void 0;do mt=Us(),_u[je]();while(mt.type!=="eof");return typeof Le=="function"?Dt({"":ui},"",Le):ui};function Dt(re,fe,Le){var ke=re[fe];if(ke!=null&&typeof ke=="object")if(Array.isArray(ke))for(var Ve=0;Ve<ke.length;Ve++){var at=String(Ve),lt=Dt(ke,at,Le);lt===void 0?delete ke[at]:Object.defineProperty(ke,at,{value:lt,writable:!0,enumerable:!0,configurable:!0})}else for(var yr in ke){var Ut=Dt(ke,yr,Le);Ut===void 0?delete ke[yr]:Object.defineProperty(ke,yr,{value:Ut,writable:!0,enumerable:!0,configurable:!0})}return Le.call(re,fe,ke)}var Ue,be,mr,en,ut;function Us(){for(Ue="default",be="",mr=!1,en=1;;){ut=tn();var re=ns[Ue]();if(re)return re}}function tn(){if(ir[Zr])return String.fromCodePoint(ir.codePointAt(Zr))}function ge(){var re=tn();return re===`
`?(Zt++,Gt=0):re?Gt+=re.length:Gt++,re&&(Zr+=re.length),re}var ns={default:function(){switch(ut){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
`:case"\r":case"\u2028":case"\u2029":ge();return;case"/":ge(),Ue="comment";return;case void 0:return ge(),_t("eof")}if(ze.isSpaceSeparator(ut)){ge();return}return ns[je]()},comment:function(){switch(ut){case"*":ge(),Ue="multiLineComment";return;case"/":ge(),Ue="singleLineComment";return}throw xt(ge())},multiLineComment:function(){switch(ut){case"*":ge(),Ue="multiLineCommentAsterisk";return;case void 0:throw xt(ge())}ge()},multiLineCommentAsterisk:function(){switch(ut){case"*":ge();return;case"/":ge(),Ue="default";return;case void 0:throw xt(ge())}ge(),Ue="multiLineComment"},singleLineComment:function(){switch(ut){case`
`:case"\r":case"\u2028":case"\u2029":ge(),Ue="default";return;case void 0:return ge(),_t("eof")}ge()},value:function(){switch(ut){case"{":case"[":return _t("punctuator",ge());case"n":return ge(),qr("ull"),_t("null",null);case"t":return ge(),qr("rue"),_t("boolean",!0);case"f":return ge(),qr("alse"),_t("boolean",!1);case"-":case"+":ge()==="-"&&(en=-1),Ue="sign";return;case".":be=ge(),Ue="decimalPointLeading";return;case"0":be=ge(),Ue="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":be=ge(),Ue="decimalInteger";return;case"I":return ge(),qr("nfinity"),_t("numeric",1/0);case"N":return ge(),qr("aN"),_t("numeric",NaN);case'"':case"'":mr=ge()==='"',be="",Ue="string";return}throw xt(ge())},identifierNameStartEscape:function(){if(ut!=="u")throw xt(ge());ge();var fe=is();switch(fe){case"$":case"_":break;default:if(!ze.isIdStartChar(fe))throw Bu();break}be+=fe,Ue="identifierName"},identifierName:function(){switch(ut){case"$":case"_":case"\u200C":case"\u200D":be+=ge();return;case"\\":ge(),Ue="identifierNameEscape";return}if(ze.isIdContinueChar(ut)){be+=ge();return}return _t("identifier",be)},identifierNameEscape:function(){if(ut!=="u")throw xt(ge());ge();var fe=is();switch(fe){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!ze.isIdContinueChar(fe))throw Bu();break}be+=fe,Ue="identifierName"},sign:function(){switch(ut){case".":be=ge(),Ue="decimalPointLeading";return;case"0":be=ge(),Ue="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":be=ge(),Ue="decimalInteger";return;case"I":return ge(),qr("nfinity"),_t("numeric",en*(1/0));case"N":return ge(),qr("aN"),_t("numeric",NaN)}throw xt(ge())},zero:function(){switch(ut){case".":be+=ge(),Ue="decimalPoint";return;case"e":case"E":be+=ge(),Ue="decimalExponent";return;case"x":case"X":be+=ge(),Ue="hexadecimal";return}return _t("numeric",en*0)},decimalInteger:function(){switch(ut){case".":be+=ge(),Ue="decimalPoint";return;case"e":case"E":be+=ge(),Ue="decimalExponent";return}if(ze.isDigit(ut)){be+=ge();return}return _t("numeric",en*Number(be))},decimalPointLeading:function(){if(ze.isDigit(ut)){be+=ge(),Ue="decimalFraction";return}throw xt(ge())},decimalPoint:function(){switch(ut){case"e":case"E":be+=ge(),Ue="decimalExponent";return}if(ze.isDigit(ut)){be+=ge(),Ue="decimalFraction";return}return _t("numeric",en*Number(be))},decimalFraction:function(){switch(ut){case"e":case"E":be+=ge(),Ue="decimalExponent";return}if(ze.isDigit(ut)){be+=ge();return}return _t("numeric",en*Number(be))},decimalExponent:function(){switch(ut){case"+":case"-":be+=ge(),Ue="decimalExponentSign";return}if(ze.isDigit(ut)){be+=ge(),Ue="decimalExponentInteger";return}throw xt(ge())},decimalExponentSign:function(){if(ze.isDigit(ut)){be+=ge(),Ue="decimalExponentInteger";return}throw xt(ge())},decimalExponentInteger:function(){if(ze.isDigit(ut)){be+=ge();return}return _t("numeric",en*Number(be))},hexadecimal:function(){if(ze.isHexDigit(ut)){be+=ge(),Ue="hexadecimalInteger";return}throw xt(ge())},hexadecimalInteger:function(){if(ze.isHexDigit(ut)){be+=ge();return}return _t("numeric",en*Number(be))},string:function(){switch(ut){case"\\":ge(),be+=Vi();return;case'"':if(mr)return ge(),_t("string",be);be+=ge();return;case"'":if(!mr)return ge(),_t("string",be);be+=ge();return;case`
`:case"\r":throw xt(ge());case"\u2028":case"\u2029":Iu(ut);break;case void 0:throw xt(ge())}be+=ge()},start:function(){switch(ut){case"{":case"[":return _t("punctuator",ge())}Ue="value"},beforePropertyName:function(){switch(ut){case"$":case"_":be=ge(),Ue="identifierName";return;case"\\":ge(),Ue="identifierNameStartEscape";return;case"}":return _t("punctuator",ge());case'"':case"'":mr=ge()==='"',Ue="string";return}if(ze.isIdStartChar(ut)){be+=ge(),Ue="identifierName";return}throw xt(ge())},afterPropertyName:function(){if(ut===":")return _t("punctuator",ge());throw xt(ge())},beforePropertyValue:function(){Ue="value"},afterPropertyValue:function(){switch(ut){case",":case"}":return _t("punctuator",ge())}throw xt(ge())},beforeArrayValue:function(){if(ut==="]")return _t("punctuator",ge());Ue="value"},afterArrayValue:function(){switch(ut){case",":case"]":return _t("punctuator",ge())}throw xt(ge())},end:function(){throw xt(ge())}};function _t(re,fe){return{type:re,value:fe,line:Zt,column:Gt}}function qr(re){for(var fe=0,Le=re;fe<Le.length;fe+=1){var ke=Le[fe],Ve=tn();if(Ve!==ke)throw xt(ge());ge()}}function Vi(){var re=tn();switch(re){case"b":return ge(),"\b";case"f":return ge(),"\f";case"n":return ge(),`
`;case"r":return ge(),"\r";case"t":return ge()," ";case"v":return ge(),"\v";case"0":if(ge(),ze.isDigit(tn()))throw xt(ge());return"\0";case"x":return ge(),bu();case"u":return ge(),is();case`
`:case"\u2028":case"\u2029":return ge(),"";case"\r":return ge(),tn()===`
`&&ge(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw xt(ge());case void 0:throw xt(ge())}return ge()}function bu(){var re="",fe=tn();if(!ze.isHexDigit(fe)||(re+=ge(),fe=tn(),!ze.isHexDigit(fe)))throw xt(ge());return re+=ge(),String.fromCodePoint(parseInt(re,16))}function is(){for(var re="",fe=4;fe-- >0;){var Le=tn();if(!ze.isHexDigit(Le))throw xt(ge());re+=ge()}return String.fromCodePoint(parseInt(re,16))}var _u={start:function(){if(mt.type==="eof")throw Hn();ss()},beforePropertyName:function(){switch(mt.type){case"identifier":case"string":Br=mt.value,je="afterPropertyName";return;case"punctuator":Gi();return;case"eof":throw Hn()}},afterPropertyName:function(){if(mt.type==="eof")throw Hn();je="beforePropertyValue"},beforePropertyValue:function(){if(mt.type==="eof")throw Hn();ss()},beforeArrayValue:function(){if(mt.type==="eof")throw Hn();if(mt.type==="punctuator"&&mt.value==="]"){Gi();return}ss()},afterPropertyValue:function(){if(mt.type==="eof")throw Hn();switch(mt.value){case",":je="beforePropertyName";return;case"}":Gi()}},afterArrayValue:function(){if(mt.type==="eof")throw Hn();switch(mt.value){case",":je="beforeArrayValue";return;case"]":Gi()}},end:function(){}};function ss(){var re;switch(mt.type){case"punctuator":switch(mt.value){case"{":re={};break;case"[":re=[];break}break;case"null":case"boolean":case"numeric":case"string":re=mt.value;break}if(ui===void 0)ui=re;else{var fe=Tt[Tt.length-1];Array.isArray(fe)?fe.push(re):Object.defineProperty(fe,Br,{value:re,writable:!0,enumerable:!0,configurable:!0})}if(re!==null&&typeof re=="object")Tt.push(re),Array.isArray(re)?je="beforeArrayValue":je="beforePropertyName";else{var Le=Tt[Tt.length-1];Le==null?je="end":Array.isArray(Le)?je="afterArrayValue":je="afterPropertyValue"}}function Gi(){Tt.pop();var re=Tt[Tt.length-1];re==null?je="end":Array.isArray(re)?je="afterArrayValue":je="afterPropertyValue"}function xt(re){return us(re===void 0?"JSON5: invalid end of input at "+Zt+":"+Gt:"JSON5: invalid character '"+$u(re)+"' at "+Zt+":"+Gt)}function Hn(){return us("JSON5: invalid end of input at "+Zt+":"+Gt)}function Bu(){return Gt-=5,us("JSON5: invalid identifier character at "+Zt+":"+Gt)}function Iu(re){console.warn("JSON5: '"+$u(re)+"' in strings is not valid ECMAScript; consider escaping")}function $u(re){var fe={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(fe[re])return fe[re];if(re<" "){var Le=re.charCodeAt(0).toString(16);return"\\x"+("00"+Le).substring(Le.length)}return re}function us(re){var fe=new SyntaxError(re);return fe.lineNumber=Zt,fe.columnNumber=Gt,fe}var ra=function(fe,Le,ke){var Ve=[],at="",lt,yr,Ut="",jn;if(Le!=null&&typeof Le=="object"&&!Array.isArray(Le)&&(ke=Le.space,jn=Le.quote,Le=Le.replacer),typeof Le=="function")yr=Le;else if(Array.isArray(Le)){lt=[];for(var _i=0,rn=Le;_i<rn.length;_i+=1){var pn=rn[_i],vr=void 0;typeof pn=="string"?vr=pn:(typeof pn=="number"||pn instanceof String||pn instanceof Number)&&(vr=String(pn)),vr!==void 0&&lt.indexOf(vr)<0&&lt.push(vr)}}return ke instanceof Number?ke=Number(ke):ke instanceof String&&(ke=String(ke)),typeof ke=="number"?ke>0&&(ke=Math.min(10,Math.floor(ke)),Ut=" ".substr(0,ke)):typeof ke=="string"&&(Ut=ke.substr(0,10)),nn("",{"":fe});function nn(Pt,Ar){var rt=Ar[Pt];switch(rt!=null&&(typeof rt.toJSON5=="function"?rt=rt.toJSON5(Pt):typeof rt.toJSON=="function"&&(rt=rt.toJSON(Pt))),yr&&(rt=yr.call(Ar,Pt,rt)),rt instanceof Number?rt=Number(rt):rt instanceof String?rt=String(rt):rt instanceof Boolean&&(rt=rt.valueOf()),rt){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof rt=="string")return kr(rt,!1);if(typeof rt=="number")return String(rt);if(typeof rt=="object")return Array.isArray(rt)?Sn(rt):ia(rt)}function kr(Pt){for(var Ar={"'":.1,'"':.2},rt={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},sr="",Kr=0;Kr<Pt.length;Kr++){var ur=Pt[Kr];switch(ur){case"'":case'"':Ar[ur]++,sr+=ur;continue;case"\0":if(ze.isDigit(Pt[Kr+1])){sr+="\\x00";continue}}if(rt[ur]){sr+=rt[ur];continue}if(ur<" "){var Ht=ur.charCodeAt(0).toString(16);sr+="\\x"+("00"+Ht).substring(Ht.length);continue}sr+=ur}var bn=jn||Object.keys(Ar).reduce(function(Mn,qn){return Ar[Mn]<Ar[qn]?Mn:qn});return sr=sr.replace(new RegExp(bn,"g"),rt[bn]),bn+sr+bn}function ia(Pt){if(Ve.indexOf(Pt)>=0)throw TypeError("Converting circular structure to JSON5");Ve.push(Pt);var Ar=at;at=at+Ut;for(var rt=lt||Object.keys(Pt),sr=[],Kr=0,ur=rt;Kr<ur.length;Kr+=1){var Ht=ur[Kr],bn=nn(Ht,Pt);if(bn!==void 0){var Mn=os(Ht)+":";Ut!==""&&(Mn+=" "),Mn+=bn,sr.push(Mn)}}var qn;if(sr.length===0)qn="{}";else{var _n;if(Ut==="")_n=sr.join(","),qn="{"+_n+"}";else{var Ir=`,
`+at;_n=sr.join(Ir),qn=`{
`+at+_n+`,
`+Ar+"}"}}return Ve.pop(),at=Ar,qn}function os(Pt){if(Pt.length===0)return kr(Pt,!0);var Ar=String.fromCodePoint(Pt.codePointAt(0));if(!ze.isIdStartChar(Ar))return kr(Pt,!0);for(var rt=Ar.length;rt<Pt.length;rt++)if(!ze.isIdContinueChar(String.fromCodePoint(Pt.codePointAt(rt))))return kr(Pt,!0);return Pt}function Sn(Pt){if(Ve.indexOf(Pt)>=0)throw TypeError("Converting circular structure to JSON5");Ve.push(Pt);var Ar=at;at=at+Ut;for(var rt=[],sr=0;sr<Pt.length;sr++){var Kr=nn(String(sr),Pt);rt.push(Kr!==void 0?Kr:"null")}var ur;if(rt.length===0)ur="[]";else if(Ut===""){var Ht=rt.join(",");ur="["+Ht+"]"}else{var bn=`,
`+at,Mn=rt.join(bn);ur=`[
`+at+Mn+`,
`+Ar+"]"}return Ve.pop(),at=Ar,ur}},as={parse:Qr,stringify:ra},na=as,Hs=na;return Hs})});var Xl="2.20.2";var L0="schemaVersion",Nt="settings",cr="subs",er="collections",It="files",vn="modules",Mt="artifacts",Dc="rules",ki="tokens",kg="Auto Generated Sub-Store Backup",Zl="Sub-Store",ya="Sub-Store Artifacts Repository",Sa="#sub-store-cached-resource",ba="#sub-store-cached-headers-resource",Ql="#sub-store-chr-expiration-time";var _a="#sub-store-cached-script-resource",ef="#sub-store-csr-expiration-time";var Mg="3.7.7",fy=Mg,Eo=typeof Buffer=="function",Ng=typeof TextDecoder=="function"?new TextDecoder:void 0,Lg=typeof TextEncoder=="function"?new TextEncoder:void 0,hy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yc=Array.prototype.slice.call(hy),tf=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(yc),py=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ln=String.fromCharCode.bind(String),Ug=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),qg=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),Kg=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Vg=e=>{let t,r,n,s,u="",i=e.length%3;for(let o=0;o<e.length;){if((r=e.charCodeAt(o++))>255||(n=e.charCodeAt(o++))>255||(s=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|s,u+=yc[t>>18&63]+yc[t>>12&63]+yc[t>>6&63]+yc[t&63]}return i?u.slice(0,i-3)+"===".substring(i):u},j0=typeof btoa=="function"?e=>btoa(e):Eo?e=>Buffer.from(e,"binary").toString("base64"):Vg,U0=Eo?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,s=e.length;n<s;n+=4096)r.push(ln.apply(null,e.subarray(n,n+4096)));return j0(r.join(""))},rf=(e,t=!1)=>t?qg(U0(e)):U0(e),dy=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?ln(192|t>>>6)+ln(128|t&63):ln(224|t>>>12&15)+ln(128|t>>>6&63)+ln(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return ln(240|t>>>18&7)+ln(128|t>>>12&63)+ln(128|t>>>6&63)+ln(128|t&63)}},gy=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Gg=e=>e.replace(gy,dy),Hg=Eo?e=>Buffer.from(e,"utf8").toString("base64"):Lg?e=>U0(Lg.encode(e)):e=>j0(Gg(e)),Ao=(e,t=!1)=>t?qg(Hg(e)):Hg(e),jg=e=>Ao(e,!0),my=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vy=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return ln((r>>>10)+55296)+ln((r&1023)+56320);case 3:return ln((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return ln((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},zg=e=>e.replace(my,vy),Yg=e=>{if(e=e.replace(/\s+/g,""),!py.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r="",n,s;for(let u=0;u<e.length;)t=tf[e.charAt(u++)]<<18|tf[e.charAt(u++)]<<12|(n=tf[e.charAt(u++)])<<6|(s=tf[e.charAt(u++)]),r+=n===64?ln(t>>16&255):s===64?ln(t>>16&255,t>>8&255):ln(t>>16&255,t>>8&255,t&255);return r},M0=typeof atob=="function"?e=>atob(Kg(e)):Eo?e=>Buffer.from(e,"base64").toString("binary"):Yg,Wg=Eo?e=>Ug(Buffer.from(e,"base64")):e=>Ug(M0(e).split("").map(t=>t.charCodeAt(0))),Jg=e=>Wg(Xg(e)),Ay=Eo?e=>Buffer.from(e,"base64").toString("utf8"):Ng?e=>Ng.decode(Wg(e)):e=>zg(M0(e)),Xg=e=>Kg(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),H0=e=>Ay(Xg(e)),Ey=e=>{if(typeof e!="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Zg=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Qg=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Zg(r));e("fromBase64",function(){return H0(this)}),e("toBase64",function(t){return Ao(this,t)}),e("toBase64URI",function(){return Ao(this,!0)}),e("toBase64URL",function(){return Ao(this,!0)}),e("toUint8Array",function(){return Jg(this)})},em=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Zg(r));e("toBase64",function(t){return rf(this,t)}),e("toBase64URI",function(){return rf(this,!0)}),e("toBase64URL",function(){return rf(this,!0)})},wy=()=>{Qg(),em()},dt={version:Mg,VERSION:fy,atob:M0,atobPolyfill:Yg,btoa:j0,btoaPolyfill:Vg,fromBase64:H0,toBase64:Ao,encode:Ao,encodeURI:jg,encodeURL:jg,utob:Gg,btou:zg,decode:H0,isValid:Ey,fromUint8Array:rf,toUint8Array:Jg,extendString:Qg,extendUint8Array:em,extendBuiltins:wy};var Uu=typeof $task<"u",nu=typeof $loon<"u",Hu=typeof $httpClient<"u"&&!nu,gs=eval('typeof process !== "undefined"'),tm=typeof $environment<"u"&&$environment["stash-version"],rm=typeof $rocket<"u",Fy=typeof egern=="object",Cy=typeof $native<"u",ju=typeof $Plugins<"u";function nf(e){return e!==null&&typeof e=="object"&&[null,Object.prototype].includes(Object.getPrototypeOf(e))}function Dy(e){let[t,r,n,s,u,i,o]=e.match(/^socks5:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(u)u=parseInt(u,10);else throw $.error(`port is not present in line: ${e}`),new Error(`port is not present in line: ${e}`);return{type:5,host:s,port:u,userId:r!=null?decodeURIComponent(r):void 0,password:n!=null?decodeURIComponent(n):void 0}}var sf=class{constructor(name="untitled",debug=!1){if(this.name=name,this.debug=debug,this.http=iu(),this.env=zr(),gs){let dotenv=eval('require("dotenv")');dotenv.config()}this.node=(()=>{if(gs){let fs=eval("require('fs')");return{fs}}else return null})(),this.initCache();let delay=(e,t)=>new Promise(function(r){setTimeout(r.bind(null,t),e)});Promise.prototype.delay=async function(e){let t=await this;return await delay(e,t)}}initCache(){if(Uu&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(nu||Hu)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),ju&&(this.cache=JSON.parse($Plugins.SubStoreCache.get(this.name)||"{}")),gs){let basePath=eval("process.env.SUB_STORE_DATA_BASE_PATH")||".",rootPath=`${basePath}/root.json`,backupRootPath=`${basePath}/root_${Date.now()}.json`;if(this.log(`Root path: ${rootPath}`),this.node.fs.existsSync(rootPath))try{this.root=JSON.parse(this.node.fs.readFileSync(`${rootPath}`))}catch(e){this.node.fs.copyFileSync(rootPath,backupRootPath),this.error(`Failed to parse ${rootPath}: ${e.message}. Backup created at ${backupRootPath}`)}nf(this.root)||(this.node.fs.writeFileSync(rootPath,JSON.stringify({}),{flag:"w"}),this.root={});let fpath=`${basePath}/${this.name}.json`,backupPath=`${basePath}/${this.name}_${Date.now()}.json`;if(this.log(`Data path: ${fpath}`),this.node.fs.existsSync(fpath))try{if(this.cache=JSON.parse(this.node.fs.readFileSync(`${fpath}`,"utf-8")),!nf(this.cache))throw new Error("Invalid Data")}catch{try{let t=dt.decode(this.node.fs.readFileSync(`${fpath}`,"utf-8"));if(this.cache=JSON.parse(t),this.node.fs.writeFileSync(fpath,t,{flag:"w"}),!nf(this.cache))throw new Error("Invalid Data")}catch(t){this.node.fs.copyFileSync(fpath,backupPath),this.error(`Failed to parse ${fpath}: ${t.message}. Backup created at ${backupPath}`)}}nf(this.cache)||(this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"w"}),this.cache={})}}persistCache(){let data=JSON.stringify(this.cache,null,2);if(Uu&&$prefs.setValueForKey(data,this.name),(nu||Hu)&&$persistentStore.write(data,this.name),ju&&$Plugins.SubStoreCache.set(this.name,data),gs){let basePath=eval("process.env.SUB_STORE_DATA_BASE_PATH")||".";this.node.fs.writeFileSync(`${basePath}/${this.name}.json`,data,{flag:"w"},e=>console.log(e)),this.node.fs.writeFileSync(`${basePath}/root.json`,JSON.stringify(this.root,null,2),{flag:"w"},e=>console.log(e))}}write(e,t){if(this.log(`SET ${t}`),t.indexOf("#")!==-1){if(t=t.substr(1),Hu||nu)return $persistentStore.write(e,t);if(Uu)return $prefs.setValueForKey(e,t);if(gs&&(this.root[t]=e),ju)return $Plugins.SubStoreCache.set(t,e)}else this.cache[t]=e;this.persistCache()}read(e){if(this.log(`READ ${e}`),e.indexOf("#")!==-1){if(e=e.substr(1),Hu||nu)return $persistentStore.read(e);if(Uu)return $prefs.valueForKey(e);if(gs)return this.root[e];if(ju)return $Plugins.SubStoreCache.get(e)}else return this.cache[e]}delete(e){if(this.log(`DELETE ${e}`),e.indexOf("#")!==-1){if(e=e.substr(1),Hu||nu)return $persistentStore.write(null,e);if(Uu)return $prefs.removeValueForKey(e);if(gs&&delete this.root[e],ju)return $Plugins.SubStoreCache.remove(e)}else delete this.cache[e];this.persistCache()}notify(title,subtitle="",content="",options={}){let openURL=options["open-url"],mediaURL=options["media-url"];if(Uu&&$notify(title,subtitle,content,options),Hu&&$notification.post(title,subtitle,content+`${mediaURL?`
\u591A\u5A92\u4F53:`+mediaURL:""}`,{url:openURL}),nu){let e={};openURL&&(e.openUrl=openURL),mediaURL&&(e.mediaUrl=mediaURL),JSON.stringify(e)==="{}"?$notification.post(title,subtitle,content):$notification.post(title,subtitle,content,e)}if(gs){let content_=content+(openURL?`
\u70B9\u51FB\u8DF3\u8F6C: ${openURL}`:"")+(mediaURL?`
\u591A\u5A92\u4F53: ${mediaURL}`:"");console.log(`${title}
${subtitle}
${content_}
`);let push=eval("process.env.SUB_STORE_PUSH_SERVICE");if(push){let e=push.replace("[\u63A8\u9001\u6807\u9898]",encodeURIComponent(title||"Sub-Store")).replace("[\u63A8\u9001\u5185\u5BB9]",encodeURIComponent([subtitle,content_].map(r=>r).join(`
`)));iu().get({url:e}).then(r=>{console.log(`[Push Service] URL: ${e}
RES: ${r.statusCode} ${r.body}`)}).catch(r=>{console.log(`[Push Service] URL: ${e}
ERROR: ${r}`)})}}ju&&$Plugins.Notify(title,subtitle+`
`+content)}log(e){this.debug&&console.log(`[${this.name}] LOG: ${e}`)}info(e){console.log(`[${this.name}] INFO: ${e}`)}error(e){console.log(`[${this.name}] ERROR: ${e}`)}wait(e){return new Promise(t=>setTimeout(t,e))}done(e={}){Uu||nu||Hu||ju?$done(e):gs&&typeof $context<"u"&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}};function zr(){return{isQX:Uu,isLoon:nu,isSurge:Hu,isNode:gs,isStash:tm,isShadowRocket:rm,isEgern:Fy,isLanceX:Cy,isGUIforCores:ju}}function iu(defaultOptions={baseURL:""}){let{isQX,isLoon,isSurge,isNode,isGUIforCores}=zr(),methods=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],URL_REGEX=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;function send(method,options){options=typeof options=="string"?{url:options}:options;let baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options={...defaultOptions,...options};let timeout=options.timeout,events={onRequest:()=>{},onResponse:e=>e,onTimeout:()=>{},...options.events};if(events.onRequest(method,options),options.node&&isSurge){let e=$environment["surge-build"];e&&parseInt(e)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}let worker;isQX?worker=$task.fetch({method,url:options.url,headers:options.headers,body:options.body,opts:options.opts}):isLoon||isSurge||isNode?worker=new Promise(async(resolve,reject)=>{let body=options.body,opts=JSON.parse(JSON.stringify(options));if(opts.body=body,opts.timeout=opts.timeout||8e3,opts.timeout&&(opts.timeout++,isNaN(opts.timeout)&&(opts.timeout=8e3),!isNode)){let e="ms";(isSurge||tm||rm)&&(opts.timeout=Math.ceil(opts.timeout/1e3),e="s")}if(isNode){let undici=eval("require('undici')"),{socksDispatcher}=eval("require('fetch-socks')"),{ProxyAgent,EnvHttpProxyAgent,request,interceptors}=undici,agentOpts={connect:{rejectUnauthorized:!(opts.strictSSL===!1||opts.insecure===!0)},bodyTimeout:opts.timeout,headersTimeout:opts.timeout};try{let url=new URL(opts.url);(url.username||url.password)&&(opts.headers={...opts.headers||{},Authorization:`Basic ${Buffer.from(`${url.username||""}:${url.password||""}`).toString("base64")}`});let dispatcher;if(!opts.proxy){let allProxy=eval("process.env.all_proxy")||eval("process.env.ALL_PROXY");allProxy&&/^socks5:\/\//.test(allProxy)&&(opts.proxy=allProxy)}opts.proxy?/^socks5:\/\//.test(opts.proxy)?dispatcher=socksDispatcher(Dy(opts.proxy),agentOpts):dispatcher=new ProxyAgent({...agentOpts,uri:opts.proxy}):dispatcher=new EnvHttpProxyAgent(agentOpts);let response=await request(opts.url,{...opts,method:method.toUpperCase(),dispatcher:dispatcher.compose(interceptors.redirect({maxRedirections:3,throwOnMaxRedirects:!0}))});resolve({statusCode:response.statusCode,headers:response.headers,body:opts.encoding===null?await response.body.arrayBuffer():await response.body.text()})}catch(e){reject(e)}}else $httpClient[method.toLowerCase()](opts,(e,t,r)=>{e?reject(e):resolve({statusCode:t.status||t.statusCode,headers:t.headers,body:r})})}):isGUIforCores&&(worker=new Promise(async(e,t)=>{try{let r=await $Plugins.Requests({method,url:options.url,headers:options.headers,body:options.body,autoTransformBody:!1,options:{Proxy:options.proxy,Timeout:options.timeout?options.timeout/1e3:15}});e({statusCode:r.status,headers:r.headers,body:r.body})}catch(r){t(r)}}));let timeoutid,timer=timeout?new Promise((e,t)=>{timeoutid=setTimeout(()=>(events.onTimeout(),t(`${method} URL: ${options.url} exceeds the timeout ${timeout} ms`)),timeout)}):null;return(timer?Promise.race([timer,worker]).then(e=>(typeof clearTimeout<"u"&&clearTimeout(timeoutid),e)):worker).then(e=>events.onResponse(e))}let http={};return methods.forEach(e=>http[e.toLowerCase()]=t=>send(e,t)),http}var yy=new sf("sub-store"),x=yy;function wo(){Sy()}function Sy(){let e=x.read(L0);e||by(),e!=="2.0"&&x.write("2.0",L0)}function by(){x.info("Start migrating...");let e=x.read(cr)||{},t=Object.values(e).map(w=>(w.source=w.source||"remote",p(w),h(w),w));x.write(t,cr);let r=x.read(er)||{},n=Object.values(r).map(w=>(delete w.ua,p(w),h(w),w));x.write(n,er);let s=x.read(Mt)||{},u=Object.values(s);x.write(u,Mt);let i=x.read(Dc)||{},o=Object.values(i);x.write(o,Dc);let l=x.read(It)||{},f=Object.values(l);x.write(f,It);let d=x.read(ki)||{},E=Object.values(d);x.write(E,ki),delete x.cache.builtin,x.info("Migration complete!");function p(w){let v=w["display-name"];v&&(w.displayName=v,delete w["display-name"])}function h(w){let v=w.process;if(!v||v.length===0)return;let D=[],A={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}};for(let F of v)if(F.type){if(F.type==="Useless Filter")A.args.useless="ENABLED";else if(F.type==="Set Property Operator"){let{key:S,value:B}=F.args;switch(S){case"udp":A.args.udp=B?"ENABLED":"DISABLED";break;case"tfo":A.args.tfo=B?"ENABLED":"DISABLED";break;case"skip-cert-verify":A.args.scert=B?"ENABLED":"DISABLED";break;case"aead":A.args["vmess aead"]=B?"ENABLED":"DISABLED";break}}else if(F.type.indexOf("Keyword")===-1)if(F.type==="Flag Operator"){let S=typeof F.args>"u"?!0:F.args;F.args={mode:S?"add":"remove"},D.push(F)}else D.push(F)}D.unshift(A),w.process=D}}function q0({substore:$,port,host}){let{isNode}=zr(),DEFAULT_HEADERS={"Content-Type":"text/plain;charset=UTF-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST,GET,OPTIONS,PATCH,PUT,DELETE","Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept","X-Powered-By":"Sub-Store"};if(isNode){let express_=eval('require("express")'),bodyParser=eval('require("body-parser")'),app=express_(),limit=eval("process.env.SUB_STORE_BODY_JSON_LIMIT")||"1mb";return $.info(`[BACKEND] body JSON limit: ${limit}`),app.use(bodyParser.json({verify:rawBodySaver,limit})),app.use(bodyParser.urlencoded({verify:rawBodySaver,extended:!0})),app.use(bodyParser.raw({verify:rawBodySaver,type:"*/*"})),app.use((e,t,r)=>{t.set(DEFAULT_HEADERS),r()}),app.start=()=>{app.get("*",function(t,r){r.status(404).end()});let e=app.listen(port,host,()=>{let{address:t,port:r}=e.address();$.info(`[BACKEND] listening on ${t}:${r}`)})},app}let handlers=[],METHODS_NAMES=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD'","ALL"],dispatch=(e,t=0)=>{let{method:r,url:n,headers:s,body:u}=e;s=_y(s),/json/i.test(s["content-type"])&&(u=JSON.parse(u)),r=r.toUpperCase();let{path:i,query:o}=Iy(n),l=null,f,d=0;for(f=t;f<handlers.length;f++)if(handlers[f].method==="ALL"||r===handlers[f].method){let{pattern:E}=handlers[f];By(E,i)&&E.split("/").length>d&&(l=handlers[f],d=E.split("/").length)}if(l){let E=()=>{dispatch(r,n,f)},p={method:r,url:n,path:i,query:o,params:nm(l.pattern,i),headers:s,body:u},h=Response(),w=l.callback,v=D=>{h.status(500).json({status:"failed",message:`Internal Server Error: ${D}`})};if(w.constructor.name==="AsyncFunction")w(p,h,E).catch(v);else try{w(p,h,E)}catch(D){v(D)}}else Response().status(404).json({status:"failed",message:"ERROR: 404 not found"})},app={};return METHODS_NAMES.forEach(e=>{app[e.toLowerCase()]=(t,r)=>{handlers.push({method:e,pattern:t,callback:r})}}),app.route=e=>{let t={};return METHODS_NAMES.forEach(r=>{t[r.toLowerCase()]=n=>(handlers.push({method:r,pattern:e,callback:n}),t)}),t},app.start=()=>{dispatch($request)},app;function rawBodySaver(e,t,r,n){r&&r.length&&(e.rawBody=r.toString(n||"utf8"))}function Response(){let e=200,{isQX:t,isLoon:r,isSurge:n,isGUIforCores:s}=zr(),u=DEFAULT_HEADERS,i={200:"HTTP/1.1 200 OK",201:"HTTP/1.1 201 Created",302:"HTTP/1.1 302 Found",307:"HTTP/1.1 307 Temporary Redirect",308:"HTTP/1.1 308 Permanent Redirect",404:"HTTP/1.1 404 Not Found",500:"HTTP/1.1 500 Internal Server Error"};return new class{status(o){return e=o,this}send(o=""){let l={status:t?i[e]:e,body:o,headers:u};t||s?$done(l):(r||n)&&$done({response:l})}end(){this.send()}html(o){this.set("Content-Type","text/html;charset=UTF-8"),this.send(o)}json(o){this.set("Content-Type","application/json;charset=UTF-8"),this.send(JSON.stringify(o))}set(o,l){return u[o]=l,this}}}}function _y(e){let t={};for(let r of Object.keys(e))t[r.toLowerCase()]=e[r];return t}function By(e,t){if(e instanceof RegExp&&e.test(t))return!0;if(e==="/")return!0;if(e.indexOf(":")===-1){let r=t.split("/"),n=e.split("/");for(let s=0;s<n.length;s++)if(r[s]!==n[s])return!1;return!0}else if(nm(e,t))return!0;return!1}function Iy(e){let r=(e.match(/https?:\/\/[^/]+(\/[^?]*)/)||[])[1]||"/",n=e.indexOf("?"),s={};if(n!==-1){let u=e.slice(e.indexOf("?")+1).split("&");for(let i=0;i<u.length;i++){let o=u[i].split("=");s[o[0]]=decodeURIComponent(o[1])}}return{path:r,query:s}}function nm(e,t){if(e.indexOf(":")===-1)return null;{let r={};for(let n=0,s=0;n<e.length;n++,s++)if(e[n]===":"){let u=[],i=[];for(;e[++n]!=="/"&&n<e.length;)u.push(e[n]);for(;t[s]!=="/"&&s<t.length;)i.push(t[s++]);r[u.join("")]=decodeURIComponent(i.join(""))}else if(e[n]!==t[s])return null;return r}}function $t(e,t,r="name"){return e.find(n=>n[r]===t)}function im(e,t,r="name"){return e.findIndex(n=>n[r]===t)}function Ni(e,t,r="name"){let n=im(e,t,r);e.splice(n,1)}function Xi(e,t,r,n="name"){let s=im(e,t,n);e[s]=r}function Ge(e,t,r){e.status(r||200).json({status:"success",data:t})}function We(e,t,r){e.status(r||500).json({status:"failed",error:{code:t.code,type:t.type,message:t.message,details:e.req?.route?.path?.startsWith("/share/")?"\u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7":t.details}})}var Fo=class{constructor(t,r,n){this.code=t,this.message=r,this.details=n}},fn=class extends Fo{constructor(t,r,n){super(t,r,n),this.type="InternalServerError"}},Rt=class extends Fo{constructor(t,r,n){super(t,r,n),this.type="RequestInvalidError"}},Lr=class extends Fo{constructor(t,r,n){super(t,r,n),this.type="ResourceNotFoundError"}},uf=class extends Fo{constructor(t,r,n){super(t,r,n),this.type="NetworkError"}};var gf=On(vm()),t3=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,r3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function Rr(e){return t3.test(e)}function Ur(e){return r3.test(e)}function Am(e){return/^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$/.test(e)}function Fs(e){return typeof e=="string"&&e.trim().length>0}function tr(e,t){return Fs(e)?e:t}function So(e){return typeof e<"u"&&e!==null}function bo(e,t){return So(e)?e:t}function uu(e){return e?/^.+?\s*?=\s*?.+?\s*?,.+?/.test(e)?{"policy-descriptor":e}:{policy:e}:{}}function n3(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function _c(e){let t=e.split(/,|\//),r=t[Math.floor(Math.random()*t.length)];if(r.includes("-")){let[n,s]=r.split("-").map(Number);return n3(n,s)}else return Number(r)}function Em(e){return Number.isSafeInteger(e)?String(e):BigInt(e).toString()}function mf(e){return typeof e=="string"&&/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}function Mu(e,t="YYYY-MM-DD_HH-mm-ss"){let r=e instanceof Date?e:new Date(e);if(isNaN(r.getTime()))return"";let n=u=>String(u).padStart(2,"0"),s={YYYY:r.getFullYear(),MM:n(r.getMonth()+1),DD:n(r.getDate()),HH:n(r.getHours()),mm:n(r.getMinutes()),ss:n(r.getSeconds())};return t.replace(/YYYY|MM|DD|HH|mm|ss/g,u=>s[u])}function tp(e){x.read(er)||x.write({},er),e.route("/api/collection/:name").get(s3).patch(u3).delete(a3),e.route("/api/collections").get(o3).post(i3).put(c3)}function i3(e,t){let r=e.body;if(x.info(`\u6B63\u5728\u521B\u5EFA\u7EC4\u5408\u8BA2\u9605\uFF1A${r.name}`),/\//.test(r.name)){We(t,new Rt("INVALID_NAME",`Collection ${r.name} is invalid`));return}let n=x.read(er);if($t(n,r.name)){We(t,new Rt("DUPLICATE_KEY",`Collection ${r.name} already exists.`));return}n.push(r),x.write(n,er),Ge(t,r,201)}function s3(e,t){let{name:r}=e.params,{raw:n}=e.query,s=x.read(er),u=$t(s,r);u?n?t.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_collection_${r}_${Mu(new Date)}.json`)}"`).send(JSON.stringify(u)):Ge(t,u):We(t,new Lr("SUBSCRIPTION_NOT_FOUND",`Collection ${r} does not exist`,404))}function u3(e,t){let{name:r}=e.params,n=e.body,s=x.read(er),u=$t(s,r);if(u){let i={...u,...n};if(x.info(`\u6B63\u5728\u66F4\u65B0\u7EC4\u5408\u8BA2\u9605\uFF1A${r}...`),r!==i.name){let o=x.read(Mt)||[];for(let f of o)f.type==="collection"&&f.source===u.name&&(f.source=i.name);let l=x.read(It)||[];for(let f of l)f.sourceType==="collection"&&f.sourceName===u.name&&(f.sourceName=i.name);x.write(o,Mt),x.write(l,It)}Xi(s,r,i),x.write(s,er),Ge(t,i)}else We(t,new Lr("RESOURCE_NOT_FOUND",`Collection ${r} does not exist!`),404)}function a3(e,t){let{name:r}=e.params;x.info(`\u6B63\u5728\u5220\u9664\u7EC4\u5408\u8BA2\u9605\uFF1A${r}`);let n=x.read(er);Ni(n,r),x.write(n,er),Ge(t)}function o3(e,t){let r=x.read(er);Ge(t,r)}function c3(e,t){let r=e.body;x.write(r,er),Ge(t)}var rp=0;function mi(e){return f3(l3(h3(e)))}function l3(e){return d3(g3(p3(e),e.length*8))}function f3(e){try{}catch{rp=0}for(var t=rp?"0123456789ABCDEF":"0123456789abcdef",r="",n,s=0;s<e.length;s++)n=e.charCodeAt(s),r+=t.charAt(n>>>4&15)+t.charAt(n&15);return r}function h3(e){for(var t="",r=-1,n,s;++r<e.length;)n=e.charCodeAt(r),s=r+1<e.length?e.charCodeAt(r+1):0,55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n=65536+((n&1023)<<10)+(s&1023),r++),n<=127?t+=String.fromCharCode(n):n<=2047?t+=String.fromCharCode(192|n>>>6&31,128|n&63):n<=65535?t+=String.fromCharCode(224|n>>>12&15,128|n>>>6&63,128|n&63):n<=2097151&&(t+=String.fromCharCode(240|n>>>18&7,128|n>>>12&63,128|n>>>6&63,128|n&63));return t}function p3(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(var r=0;r<e.length*8;r+=8)t[r>>5]|=(e.charCodeAt(r/8)&255)<<r%32;return t}function d3(e){for(var t="",r=0;r<e.length*32;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}function g3(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var r=1732584193,n=-271733879,s=-1732584194,u=271733878,i=0;i<e.length;i+=16){var o=r,l=n,f=s,d=u;r=En(r,n,s,u,e[i+0],7,-680876936),u=En(u,r,n,s,e[i+1],12,-389564586),s=En(s,u,r,n,e[i+2],17,606105819),n=En(n,s,u,r,e[i+3],22,-1044525330),r=En(r,n,s,u,e[i+4],7,-176418897),u=En(u,r,n,s,e[i+5],12,1200080426),s=En(s,u,r,n,e[i+6],17,-1473231341),n=En(n,s,u,r,e[i+7],22,-45705983),r=En(r,n,s,u,e[i+8],7,1770035416),u=En(u,r,n,s,e[i+9],12,-1958414417),s=En(s,u,r,n,e[i+10],17,-42063),n=En(n,s,u,r,e[i+11],22,-1990404162),r=En(r,n,s,u,e[i+12],7,1804603682),u=En(u,r,n,s,e[i+13],12,-40341101),s=En(s,u,r,n,e[i+14],17,-1502002290),n=En(n,s,u,r,e[i+15],22,1236535329),r=wn(r,n,s,u,e[i+1],5,-165796510),u=wn(u,r,n,s,e[i+6],9,-1069501632),s=wn(s,u,r,n,e[i+11],14,643717713),n=wn(n,s,u,r,e[i+0],20,-373897302),r=wn(r,n,s,u,e[i+5],5,-701558691),u=wn(u,r,n,s,e[i+10],9,38016083),s=wn(s,u,r,n,e[i+15],14,-660478335),n=wn(n,s,u,r,e[i+4],20,-405537848),r=wn(r,n,s,u,e[i+9],5,568446438),u=wn(u,r,n,s,e[i+14],9,-1019803690),s=wn(s,u,r,n,e[i+3],14,-187363961),n=wn(n,s,u,r,e[i+8],20,1163531501),r=wn(r,n,s,u,e[i+13],5,-1444681467),u=wn(u,r,n,s,e[i+2],9,-51403784),s=wn(s,u,r,n,e[i+7],14,1735328473),n=wn(n,s,u,r,e[i+12],20,-1926607734),r=Fn(r,n,s,u,e[i+5],4,-378558),u=Fn(u,r,n,s,e[i+8],11,-2022574463),s=Fn(s,u,r,n,e[i+11],16,1839030562),n=Fn(n,s,u,r,e[i+14],23,-35309556),r=Fn(r,n,s,u,e[i+1],4,-1530992060),u=Fn(u,r,n,s,e[i+4],11,1272893353),s=Fn(s,u,r,n,e[i+7],16,-155497632),n=Fn(n,s,u,r,e[i+10],23,-1094730640),r=Fn(r,n,s,u,e[i+13],4,681279174),u=Fn(u,r,n,s,e[i+0],11,-358537222),s=Fn(s,u,r,n,e[i+3],16,-722521979),n=Fn(n,s,u,r,e[i+6],23,76029189),r=Fn(r,n,s,u,e[i+9],4,-640364487),u=Fn(u,r,n,s,e[i+12],11,-421815835),s=Fn(s,u,r,n,e[i+15],16,530742520),n=Fn(n,s,u,r,e[i+2],23,-995338651),r=Cn(r,n,s,u,e[i+0],6,-198630844),u=Cn(u,r,n,s,e[i+7],10,1126891415),s=Cn(s,u,r,n,e[i+14],15,-1416354905),n=Cn(n,s,u,r,e[i+5],21,-57434055),r=Cn(r,n,s,u,e[i+12],6,1700485571),u=Cn(u,r,n,s,e[i+3],10,-1894986606),s=Cn(s,u,r,n,e[i+10],15,-1051523),n=Cn(n,s,u,r,e[i+1],21,-2054922799),r=Cn(r,n,s,u,e[i+8],6,1873313359),u=Cn(u,r,n,s,e[i+15],10,-30611744),s=Cn(s,u,r,n,e[i+6],15,-1560198380),n=Cn(n,s,u,r,e[i+13],21,1309151649),r=Cn(r,n,s,u,e[i+4],6,-145523070),u=Cn(u,r,n,s,e[i+11],10,-1120210379),s=Cn(s,u,r,n,e[i+2],15,718787259),n=Cn(n,s,u,r,e[i+9],21,-343485551),r=qu(r,o),n=qu(n,l),s=qu(s,f),u=qu(u,d)}return Array(r,n,s,u)}function vf(e,t,r,n,s,u){return qu(m3(qu(qu(t,e),qu(n,u)),s),r)}function En(e,t,r,n,s,u,i){return vf(t&r|~t&n,e,t,s,u,i)}function wn(e,t,r,n,s,u,i){return vf(t&n|r&~n,e,t,s,u,i)}function Fn(e,t,r,n,s,u,i){return vf(t^r^n,e,t,s,u,i)}function Cn(e,t,r,n,s,u,i){return vf(r^(t|~n),e,t,s,u,i)}function qu(e,t){var r=(e&65535)+(t&65535),n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535}function m3(e,t){return e<<t|e>>>32-t}var np=class{constructor(){this.expires=v3(),x.read(ba)||x.write("{}",ba);try{this.resourceCache=JSON.parse(x.read(ba))}catch(t){x.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${ba} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},x.write("{}",ba)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,s]=r;s.time||(delete this.resourceCache[n],x.delete(`#${n}`),t=!0),new Date().getTime()-s.time>this.expires&&(delete this.resourceCache[n],t=!0)}),t&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){x.write(JSON.stringify(this.resourceCache),ba)}get(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].data:null}gettime(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].time:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}};function v3(){x.read(Ql)||x.write("6e4",Ql);let e=6e4;if(x.env.isLoon){let t={"1\u5206\u949F":6e4,"5\u5206\u949F":3e5,"10\u5206\u949F":6e5,"30\u5206\u949F":18e5,"1\u5C0F\u65F6":36e5,"2\u5C0F\u65F6":72e5,"3\u5C0F\u65F6":108e5,"6\u5C0F\u65F6":216e5,"12\u5C0F\u65F6":432e5,"24\u5C0F\u65F6":864e5,"48\u5C0F\u65F6":1728e5,"72\u5C0F\u65F6":2592e5,\u53C2\u6570\u4F20\u5165:"readcachets"},r=x.read("#\u54CD\u5E94\u5934\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=x.read(Ql),e}var $a=new np;function _o(e){let t=Object.keys(e),r="",n="";for(let s of t){let u=s.toLowerCase();u==="subscription-userinfo"?r=e[s]:u==="profile-web-page-url"&&(n=e[s])}return`${r||""}${n?`; app_url=${encodeURIComponent(n)}`:""}`}async function Cs(rawUrl,ua,timeout,customProxy,flowUrl){let url=flowUrl||rawUrl||"",$arguments={},rawArgs=url.split("#");if(url=url.split("#")[0],rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let t of rawArgs[1].split("&")){let r=t.split("=")[0],n=t.split("=")[1];$arguments[r]=n==null||n===""?!0:decodeURIComponent(n)}}if($arguments?.noFlow||!/^https?/.test(url))return;let{isStash,isLoon,isShadowRocket,isQX}=zr(),insecure=$arguments?.insecure?x.env.isNode?{strictSSL:!1}:{insecure:!0}:void 0,{defaultProxy,defaultFlowUserAgent,defaultTimeout}=x.read(Nt),proxy=customProxy||defaultProxy;x.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultFlowUserAgent||"clash",requestTimeout=timeout||defaultTimeout||8e3,id=mi(userAgent+url),cached=$a.get(id),flowInfo;if(!$arguments?.noCache&&cached)x.info(`\u4F7F\u7528\u7F13\u5B58\u7684\u6D41\u91CF\u4FE1\u606F: ${url}, ${userAgent}`),flowInfo=cached;else{let e=iu();if(flowUrl){x.info(`\u4F7F\u7528 GET \u65B9\u6CD5\u4ECE\u54CD\u5E94\u4F53\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${flowUrl}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{body:t}=await e.get({url:flowUrl,headers:{"User-Agent":userAgent},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},...insecure||{}});flowInfo=t}else{try{x.info(`\u4F7F\u7528 HEAD \u65B9\u6CD5\u4ECE\u54CD\u5E94\u5934\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{headers:t}=await e.head({url:url.split(/[\r\n]+/).map(r=>r.trim()).filter(r=>r.length)[0],headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},...insecure||{}});flowInfo=_o(t)}catch(t){x.error(`\u4F7F\u7528 HEAD \u65B9\u6CD5\u4ECE\u54CD\u5E94\u5934\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u5931\u8D25: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}: ${t.message??t}`)}if(!flowInfo){x.info(`\u4F7F\u7528 GET \u65B9\u6CD5\u83B7\u53D6\u6D41\u91CF\u4FE1\u606F: ${url}, User-Agent: ${userAgent||""}, Insecure: ${!!insecure}, Proxy: ${proxy}`);let{headers:t}=await e.get({url:url.split(/[\r\n]+/).map(r=>r.trim()).filter(r=>r.length)[0],headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},...insecure||{}});flowInfo=_o(t)}}flowInfo&&(flowInfo=flowInfo.trim()),flowInfo&&$a.set(id,flowInfo)}return flowInfo}function Pa(e){if(!e)return;let t=e.match(/upload=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),r=Number(t[1]+t[2]),n=e.match(/download=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),s=Number(n[1]+n[2]),u=e.match(/total=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),i=Number(u[1]+u[2]),o=e.match(/expire=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),l=o?Number(o[1]+o[2]):void 0,f=e.match(/reset_day=([0-9]+)/),d=f?Number(f[1]):void 0,E=e.match(/app_url=(.*?)\s*?(;|$)/),p=E?decodeURIComponent(E[1]):void 0,h=e.match(/plan_name=(.*?)\s*?(;|$)/),w=h?decodeURIComponent(h[1]):void 0;return{expires:l,total:i,usage:{upload:r,download:s},remainingDays:d,appUrl:p,planName:w}}function Bc(e,t="B"){let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=r.indexOf(t);return e<1024||n===r.length-1?{value:(Math.round(e*100)/100).toString(),unit:t}:Bc(e/1024,r[++n])}function Af(e){if(!e)throw new Error("\u6CA1\u6709\u6D41\u91CF\u4FE1\u606F");if(e?.expires&&e.expires*1e3<Date.now()){let t=new Date(e.expires*1e3).toLocaleDateString();throw new Error(`\u8BA2\u9605\u5DF2\u8FC7\u671F: ${t}`)}if(e?.total){let t=e.usage?.upload||0,r=e.usage?.download||0;if(e.total-t-r<0){let n=t+r,s=Bc(Math.abs(n));s.value=n<0?"-"+s.value:s.value;let u=Bc(e.total);throw new Error(`\u6D41\u91CF\u5DF2\u7528\u5B8C: ${s.value} ${s.unit} / ${u.value} ${u.unit}`)}}}function Ef(e={}){try{let{resetDay:t,startDate:r,cycleDays:n}=e;if(["string","number"].includes(typeof e)&&(t=e),r&&n){if(n=parseInt(n),isNaN(n)||n<=0)throw new Error("\u91CD\u7F6E\u5468\u671F\u5E94\u4E3A\u6B63\u6574\u6570");if(!r||!Date.parse(r))throw new Error("\u5F00\u59CB\u65E5\u671F\u4E0D\u5408\u6CD5");let s=new Date(r),u=new Date;if(s.setHours(0,0,0,0),u.setHours(0,0,0,0),s.getTime()>u.getTime())throw new Error("\u5F00\u59CB\u65E5\u671F\u5E94\u65E9\u4E8E\u73B0\u5728");let i=new Date(r);for(i.setDate(i.getDate()+n);i<u;)i.setDate(i.getDate()+n);i.setHours(0,0,0,0);let o=i.getTime()-u.getTime();return Math.ceil(o/(1e3*3600*24))}else{if(!t)return;if(t=parseInt(t),isNaN(t)||t<=0||t>31)throw new Error("\u6708\u91CD\u7F6E\u65E5\u5E94\u4E3A 1-31 \u4E4B\u95F4\u7684\u6574\u6570");let s=new Date,u=s.getDate(),i=s.getMonth(),o=s.getFullYear(),l;return t>u?l=0:l=new Date(o,i+1,0).getDate(),l-u+t}}catch(t){x.error(`getRmainingDays failed: ${t.message??t}`)}}function wf(e){try{let t=new Map;return e.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{let n=r.indexOf("=");if(n===-1)return;let s=r.slice(0,n).trim(),u=r.slice(n+1).trim();if(!t.has(s))try{let i=decodeURIComponent(u);if(["upload","download","total","expire"].includes(s))try{i=Number(i).toFixed(0),["expire"].includes(s)&&i<=0&&(i="")}catch(o){x.error(`Failed to convert value for key "${s}=${u}": ${o.message??o}`)}t.set(s,i)}catch{t.set(s,u)}}),Array.from(t.entries()).map(([r,n])=>`${r}=${encodeURIComponent(n)}`).join("; ")}catch(t){return x.error(`normalizeFlowHeader failed: ${t.message??t}`),e}}x.read(cr)||x.write({},cr);function ip(e){e.get("/api/sub/flow/:name",A3),e.route("/api/sub/:name").get(w3).patch(F3).delete(C3),e.route("/api/subs").get(D3).post(E3).put(y3)}async function A3(e,t){let{name:r}=e.params,{url:n}=e.query;n&&x.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 URL: ${n}`);let s=x.read(cr),u=$t(s,r);if(!u){We(t,new Lr("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404);return}if(u.source==="local"&&!["localFirst","remoteFirst"].includes(u.mergeSources)){if(u.subUserinfo){let i;if(/^https?:\/\//.test(u.subUserinfo))try{i=await Cs(void 0,void 0,void 0,u.proxy,u.subUserinfo)}catch(o){x.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${u.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(o)}`)}else i=u.subUserinfo;try{Ge(t,{...Pa(i)})}catch(o){x.error(`Failed to parse flow info for local subscription ${r}: ${o.message??o}`),We(t,new Rt("NO_FLOW_INFO","N/A","Failed to parse flow info"))}}else We(t,new Rt("NO_FLOW_INFO","N/A",`Local subscription ${r} has no flow information!`));return}try{n=`${n||u.url}`.split(/[\r\n]+/).map(f=>f.trim()).filter(f=>f.length)?.[0]||"";let i={},o=n.split("#");if(n=n.split("#")[0],o.length>1)try{i=JSON.parse(decodeURIComponent(o[1]))}catch{for(let d of o[1].split("&")){let E=d.split("=")[0],p=d.split("=")[1];i[E]=p==null||p===""?!0:decodeURIComponent(p)}}if(i.noFlow||!/^https?/.test(n)){We(t,new Rt("NO_FLOW_INFO","N/A",`Subscription ${r}: noFlow`));return}let l=await Cs(i?.insecure?`${n}#insecure`:n,i.flowUserAgent,void 0,u.proxy,i.flowUrl);if(!l&&!u.subUserinfo){We(t,new fn("NO_FLOW_INFO","No flow info","Failed to fetch flow headers"));return}try{let f=Ef({resetDay:i.resetDay,startDate:i.startDate,cycleDays:i.cycleDays}),d;if(/^https?:\/\//.test(u.subUserinfo))try{d=await Cs(void 0,void 0,void 0,u.proxy,u.subUserinfo)}catch(p){x.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${u.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(p)}`)}else d=u.subUserinfo;let E={...Pa([d,l].filter(p=>p).join("; "))};f!=null&&(E.remainingDays=f),Ge(t,E)}catch(f){x.error(`Failed to parse flow info for local subscription ${r}: ${f.message??f}`),We(t,new Rt("NO_FLOW_INFO","N/A","Failed to parse flow info"))}}catch{We(t,new uf("URL_NOT_ACCESSIBLE",`The URL for subscription ${r} is inaccessible.`))}}function E3(e,t){let r=e.body;if(delete r.subscriptions,x.info(`\u6B63\u5728\u521B\u5EFA\u8BA2\u9605\uFF1A ${r.name}`),/\//.test(r.name)){We(t,new Rt("INVALID_NAME",`Subscription ${r.name} is invalid`));return}let n=x.read(cr);if($t(n,r.name)){We(t,new Rt("DUPLICATE_KEY",`Subscription ${r.name} already exists.`));return}n.push(r),x.write(n,cr),Ge(t,r,201)}function w3(e,t){let{name:r}=e.params,{raw:n}=e.query,s=x.read(cr),u=$t(s,r);delete u.subscriptions,u?n?t.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_subscription_${r}_${Mu(new Date)}.json`)}"`).send(JSON.stringify(u)):Ge(t,u):We(t,new Lr("SUBSCRIPTION_NOT_FOUND",`Subscription ${r} does not exist`,404))}function F3(e,t){let{name:r}=e.params,n=e.body;delete n.subscriptions;let s=x.read(cr),u=$t(s,r);if(u){let i={...u,...n};if(x.info(`\u6B63\u5728\u66F4\u65B0\u8BA2\u9605\uFF1A ${r}`),r!==n.name){let o=x.read(er)||[];for(let d of o){let E=d.subscriptions.indexOf(r);E!==-1&&(d.subscriptions[E]=n.name)}let l=x.read(Mt)||[];for(let d of l)d.type==="subscription"&&d.source==r&&(d.source=n.name);let f=x.read(It)||[];for(let d of f)d.sourceType==="subscription"&&d.sourceName==r&&(d.sourceName=n.name);x.write(o,er),x.write(l,Mt),x.write(f,It)}Xi(s,r,i),x.write(s,cr),Ge(t,i)}else We(t,new Lr("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404)}function C3(e,t){let{name:r}=e.params;x.info(`\u5220\u9664\u8BA2\u9605\uFF1A${r}...`);let n=x.read(cr);Ni(n,r),x.write(n,cr);let s=x.read(er);for(let u of s)u.subscriptions=u.subscriptions.filter(i=>i!==r);x.write(s,er),Ge(t)}function D3(e,t){let r=x.read(cr);Ge(t,r)}function y3(e,t){let r=e.body;x.write(r,cr),Ge(t)}var Li=class{constructor({token,key,syncPlatform}){let{isStash,isLoon,isShadowRocket,isQX}=zr(),{defaultProxy,defaultTimeout:timeout,githubProxy}=x.read(Nt),proxy=defaultProxy;x.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY")),syncPlatform==="gitlab"?(this.headers={"PRIVATE-TOKEN":`${token}`,"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"},this.http=iu({baseURL:"https://gitlab.com/api/v4",headers:{...this.headers,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},timeout:timeout||8e3,events:{onResponse:e=>{if(/^[45]/.test(String(e.statusCode))){let t=JSON.parse(e.body);return Promise.reject(`ERROR: ${t.message?.error??t.message}`)}else return e}}})):(this.headers={Authorization:`token ${token}`,"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"},this.http=iu({baseURL:`${githubProxy?`${githubProxy}/`:""}https://api.github.com`,headers:{...this.headers,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},timeout:timeout||8e3,events:{onResponse:e=>/^[45]/.test(String(e.statusCode))?Promise.reject(`ERROR: ${JSON.parse(e.body).message}`):e}})),this.key=key,this.syncPlatform=syncPlatform}async locate(){return this.syncPlatform==="gitlab"?this.http.get("/snippets").then(e=>{let t=JSON.parse(e.body);for(let r of t)if(r.title===this.key)return r}):this.http.get("/gists?per_page=100&page=1").then(e=>{let t=JSON.parse(e.body);x.info(`\u83B7\u53D6\u5230\u5F53\u524D GitHub \u7528\u6237\u7684 gist: ${t.length} \u4E2A`);for(let r of t)if(r.description===this.key)return r})}async upload(e){if(Object.keys(e).length===0)return Promise.reject("\u672A\u63D0\u4F9B\u9700\u4E0A\u4F20\u7684\u6587\u4EF6");let t=await this.locate(),r=e;if(t?.id){this.syncPlatform==="gitlab"&&(t.files=t.files.reduce((u,i)=>(u[i.path]=i,u),{}));let n=[],s={...t.files};return Object.keys(r).map(u=>{s[u]?r[u].content==null||r[u].content===""?(delete s[u],n.push({action:"delete",file_path:u})):(s[u]=r[u],n.push({action:"update",file_path:u,content:r[u].content})):r[u].content==null||r[u].content===""?(delete s[u],delete r[u]):(s[u]=r[u],n.push({action:"create",file_path:u,content:r[u].content}))}),this.syncPlatform==="gitlab"?Object.keys(s).length===0?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u66F4\u65B0 snippet"):Object.keys(s).length>10?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4 snippet \u7684\u6587\u4EF6\u6570\u8D85\u8FC7 10, \u65E0\u6CD5\u66F4\u65B0 snippet"):(r=n,this.http.put({headers:{...this.headers,"Content-Type":"application/json"},url:`/snippets/${t.id}`,body:JSON.stringify({files:r})})):Object.keys(s).length===0?Promise.reject("\u672C\u6B21\u64CD\u4F5C\u5C06\u5BFC\u81F4\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u66F4\u65B0 gist"):this.http.patch({url:`/gists/${t.id}`,body:JSON.stringify({files:r})})}else return r=Object.entries(r).reduce((n,[s,u])=>(u.content!==null&&u.content!==""&&(n[s]=u),n),{}),this.syncPlatform==="gitlab"?Object.keys(r).length===0?Promise.reject("\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u521B\u5EFA snippet"):(r=Object.keys(r).map(n=>({file_path:n,content:r[n].content})),this.http.post({headers:{...this.headers,"Content-Type":"application/json"},url:"/snippets",body:JSON.stringify({title:this.key,visibility:"private",files:r})})):Object.keys(r).length===0?Promise.reject("\u6240\u6709\u6587\u4EF6\u7684\u5185\u5BB9\u90FD\u4E3A\u7A7A, \u65E0\u6CD5\u521B\u5EFA gist"):this.http.post({url:"/gists",body:JSON.stringify({description:this.key,public:!1,files:r})})}async download(e){let t=await this.locate();if(t?.id)try{let{files:r}=await this.http.get(`/gists/${t.id}`).then(s=>JSON.parse(s.body)),n=r[e].raw_url;return await this.http.get(n).then(s=>s.body)}catch(r){return Promise.reject(r)}else return Promise.reject(`\u627E\u4E0D\u5230 Sub-Store Gist (${this.key})`)}};function sp(e){x.read(Mt)||x.write({},Mt),e.get("/api/artifacts/restore",S3),e.route("/api/artifacts").get(b3).post(I3).put(_3),e.route("/api/artifact/:name").get(B3).patch($3).delete(P3)}async function S3(e,t){x.info("\u5F00\u59CB\u6062\u590D\u8FDC\u7A0B\u914D\u7F6E...");try{let{gistToken:r,syncPlatform:n}=x.read(Nt);if(!r)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let s=new Li({token:r,key:ya,syncPlatform:n});try{let u=await s.locate();if(!u?.files)throw new Error("\u627E\u4E0D\u5230 Sub-Store Gist \u6587\u4EF6\u5217\u8868");let i=x.read(Mt),o=[];Object.keys(u.files).map(l=>{let f=u.files[l]?.filename;if(f)if(encodeURIComponent(f)!==f)x.error(`\u6587\u4EF6\u540D ${f} \u672A\u7F16\u7801 \u4E0D\u4FDD\u5B58`),o.push(f);else{let d=$t(i,f);d?Xi(i,f,{...d,url:u.files[l]?.raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}):i.push({name:`${f}`,url:u.files[l]?.raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")})}}),x.write(i,Mt)}catch(u){throw x.error(`\u67E5\u627E Sub-Store Gist \u65F6\u53D1\u751F\u9519\u8BEF: ${u.message??u}`),u}Ge(t)}catch(r){x.error(`\u6062\u590D\u8FDC\u7A0B\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),We(t,new fn("FAILED_TO_RESTORE_ARTIFACTS","Failed to restore artifacts",`Reason: ${r.message??r}`))}}function b3(e,t){let r=x.read(Mt);Ge(t,r)}function _3(e,t){let r=e.body;x.write(r,Mt),Ge(t)}async function B3(e,t){let{name:r}=e.params,n=x.read(Mt),s=$t(n,r);s?Ge(t,s):We(t,new Lr("RESOURCE_NOT_FOUND",`Artifact ${r} does not exist!`),404)}function I3(e,t){let r=e.body;if(!wm(r.name)){We(t,new Rt("INVALID_ARTIFACT_NAME",`Artifact name ${r.name} is invalid.`));return}x.info(`\u6B63\u5728\u521B\u5EFA\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r.name}`);let n=x.read(Mt);$t(n,r.name)?We(t,new Rt("DUPLICATE_KEY",`Artifact ${r.name} already exists.`)):(n.push(r),x.write(n,Mt),Ge(t,r,201))}function $3(e,t){let r=x.read(Mt),n=e.params.name,s=$t(r,n);if(s){x.info(`\u6B63\u5728\u66F4\u65B0\u8FDC\u7A0B\u914D\u7F6E\uFF1A${s.name}`);let u={...s,...e.body};if(!wm(u.name)){We(t,new Rt("INVALID_ARTIFACT_NAME",`Artifact name ${u.name} is invalid.`));return}Xi(r,n,u),x.write(r,Mt),Ge(t,u)}else We(t,new Rt("DUPLICATE_KEY",`Artifact ${n} already exists.`))}async function P3(e,t){let{name:r}=e.params;x.info(`\u6B63\u5728\u5220\u9664\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}`);let n=x.read(Mt);try{let s=$t(n,r);if(!s)throw new Error(`\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}\u4E0D\u5B58\u5728\uFF01`);if(s.updated){let u={};u[encodeURIComponent(s.name)]={content:""},encodeURIComponent(s.name)!==s.name&&(u[s.name]={content:""});try{await Fm(u)}catch(i){x.error(`Function syncToGist: ${r} : ${i}`)}}Ni(n,r),x.write(n,Mt),Ge(t)}catch(s){x.error(`\u65E0\u6CD5\u5220\u9664\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}\uFF0C\u539F\u56E0\uFF1A${s}`),We(t,new fn("FAILED_TO_DELETE_ARTIFACT",`Failed to delete artifact ${r}`,`Reason: ${s}`))}}function wm(e){return/^[a-zA-Z0-9._-]*$/.test(e)}async function Fm(e){let{gistToken:t,syncPlatform:r}=x.read(Nt);if(!t)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let s=await new Li({token:t,key:ya,syncPlatform:r}).upload(e),u={};try{u=JSON.parse(s.body)}catch{}let i=u?.html_url??u?.web_url,o=x.read(Nt);return i?(x.log(`\u540C\u6B65 Gist \u540E, \u627E\u5230 Sub-Store Gist: ${i}`),o.artifactStore=i,o.artifactStoreStatus="VALID"):(x.error("\u540C\u6B65 Gist \u540E, \u627E\u4E0D\u5230 Sub-Store Gist"),o.artifactStoreStatus="NOT FOUND"),x.write(o,Nt),s}function up(e){x.read(Nt)||x.write({},Nt),e.route("/api/settings").get(R3).patch(T3)}async function R3(e,t){try{let r=x.read(Nt);r||(r={},x.write(r,Nt)),r.avatarUrl||await Ff(),r.artifactStore||await Cf(),Ge(t,r)}catch(r){x.error(`Failed to get settings: ${r.message??r}`),We(t,new fn("FAILED_TO_GET_SETTINGS","Failed to get settings",`Reason: ${r.message??r}`))}}async function T3(e,t){try{let n={...x.read(Nt),...e.body};x.write(n,Nt),await Ff(),await Cf(),Ge(t,n)}catch(r){x.error(`Failed to update settings: ${r.message??r}`),We(t,new fn("FAILED_TO_UPDATE_SETTINGS","Failed to update settings",`Reason: ${r.message??r}`))}}async function Ff(){let e=x.read(Nt),{githubUser:t,syncPlatform:r,githubProxy:n}=e;if(t)if(r==="gitlab")try{let s=await x.http.get({url:`https://gitlab.com/api/v4/users?username=${encodeURIComponent(t)}`,headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then(u=>JSON.parse(u.body));e.avatarUrl=s[0].avatar_url.replace(/(\?|&)s=\d+(&|$)/,"$1s=160$2"),x.write(e,Nt)}catch(s){x.error(`Failed to fetch GitLab avatar for User: ${t}. Reason: ${s.message??s}`)}else try{let s=await x.http.get({url:`${n?`${n}/`:""}https://api.github.com/users/${encodeURIComponent(t)}`,headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then(u=>JSON.parse(u.body));e.avatarUrl=s.avatar_url,x.write(e,Nt)}catch(s){x.error(`Failed to fetch GitHub avatar for User: ${t}. Reason: ${s.message??s}`)}}async function Cf(){x.log("Updating artifact store");let e=x.read(Nt),{gistToken:t,syncPlatform:r}=e;if(t){let n=new Li({token:t,key:ya,syncPlatform:r});try{let s=await n.locate(),u=s?.html_url??s?.web_url;u?(x.log(`\u627E\u5230 Sub-Store Gist: ${u}`),e.artifactStore=u,e.artifactStoreStatus="VALID"):(x.error(`\u627E\u4E0D\u5230 Sub-Store Gist (${ya})`),e.artifactStoreStatus="NOT FOUND")}catch(s){x.error(`\u67E5\u627E Sub-Store Gist (${ya}) \u65F6\u53D1\u751F\u9519\u8BEF: ${s.message??s}`),e.artifactStoreStatus="ERROR"}x.write(e,Nt)}}var cp=On(Df());var ap=class{constructor(t){this.expires=t,x.read(Sa)||x.write("{}",Sa);try{this.resourceCache=JSON.parse(x.read(Sa))}catch(r){x.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${Sa} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${r?.message??r}`),this.resourceCache={},x.write("{}",Sa)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,s]=r;s.time||(delete this.resourceCache[n],x.delete(`#${n}`),t=!0),new Date().getTime()-s.time>this.expires&&(delete this.resourceCache[n],t=!0)}),t&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){x.write(JSON.stringify(this.resourceCache),Sa)}get(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].data:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}},Tr=new ap(36e5);var op=class{constructor(){this.expires=O3(),x.read(_a)||x.write("{}",_a);try{this.resourceCache=JSON.parse(x.read(_a))}catch(t){x.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${_a} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},x.write("{}",_a)}this._cleanup()}_cleanup(t,r){let n=!1;Object.entries(this.resourceCache).forEach(s=>{let[u,i]=s;i.time||(delete this.resourceCache[u],x.delete(`#${u}`),n=!0),(new Date().getTime()-i.time>(r??this.expires)||t&&u.startsWith(t))&&(delete this.resourceCache[u],n=!0)}),n&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){x.write(JSON.stringify(this.resourceCache),_a)}get(t,r,n){let s=this.resourceCache[t]&&this.resourceCache[t].time;if(s){if(new Date().getTime()-s<=(r??this.expires))return this.resourceCache[t].data;n&&(delete this.resourceCache[t],this._persist())}return null}gettime(t){let r=this.resourceCache[t]&&this.resourceCache[t].time;return r&&new Date().getTime()-r<=this.expires?this.resourceCache[t].time:null}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}};function O3(){x.read(ef)||x.write("1728e5",ef);let e=1728e5;if(x.env.isLoon){let t={"1\u5206\u949F":6e4,"5\u5206\u949F":3e5,"10\u5206\u949F":6e5,"30\u5206\u949F":18e5,"1\u5C0F\u65F6":36e5,"2\u5C0F\u65F6":72e5,"3\u5C0F\u65F6":108e5,"6\u5C0F\u65F6":216e5,"12\u5C0F\u65F6":432e5,"24\u5C0F\u65F6":864e5,"48\u5C0F\u65F6":1728e5,"72\u5C0F\u65F6":2592e5,\u53C2\u6570\u4F20\u5165:"readcachets"},r=x.read("#\u8282\u70B9\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=x.read(ef),e}var $c=new op;var{isNode:Cm,isQX:k3,isLoon:N3,isSurge:L3,isStash:U3,isShadowRocket:H3,isLanceX:j3,isEgern:M3,isGUIforCores:q3}=zr(),Ds="Node";Cm&&(Ds="Node");k3&&(Ds="QX");N3&&(Ds="Loon");L3&&(Ds="Surge");U3&&(Ds="Stash");H3&&(Ds="ShadowRocket");M3&&(Ds="Egern");j3&&(Ds="LanceX");q3&&(Ds="GUI.for.Cores");var Ra={},K3={};try{if(typeof $environment<"u"&&(Ra.env=$environment),typeof $loon<"u"&&(Ra.loon=$loon),typeof $script<"u"&&(Ra.script=$script),typeof $Plugin<"u"&&(Ra.plugin=$Plugin),Cm){Ra.node={version:eval("process.version"),argv:eval("process.argv"),filename:eval("__filename"),dirname:eval("__dirname"),env:{}};let env=eval("process.env");for(let e in env)/^SUB_STORE_/.test(e)&&(Ra.node.env[e]=env[e])}}catch(e){}var Ku={backend:Ds,version:Xl,feature:K3,meta:Ra};function lp(e){e.get("/api/utils/env",Dm),e.get("/api/utils/backup",z3),e.get("/api/utils/refresh",V3),e.route("/api/storage").get((t,r)=>{r.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_data_${Mu(new Date)}.json`)}"`).send(x.env.isNode?JSON.stringify(x.cache):x.read("#sub-store"))}).post((t,r)=>{let{content:n}=t.body;try{if(n=JSON.parse(dt.decode(n)),Object.keys(n.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch{try{if(n=JSON.parse(n),Object.keys(n.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch(u){throw x.error(`\u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F
Reason: ${u.message??u}`),new Error("\u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F")}}x.write(JSON.stringify(n,null," "),"#sub-store"),x.env.isNode&&(x.cache=n,x.persistCache()),wo(),Ge(r)}),zr().isNode?e.get("/",Dm):e.get("/",async(t,r)=>{r.set("location","https://sub-store.vercel.app/").status(302).end()}),zr().isQX&&e.options("/",async(t,r)=>{r.status(200).end()}),e.all("/",(t,r)=>{r.send("Hello from sub-store, made with \u2764\uFE0F by Peng-YM")})}function Dm(e,t){e.query.share&&(Ku.feature.share=!0),t.set("Content-Type","application/json;charset=UTF-8").send(JSON.stringify({status:"success",data:{guide:"\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F \u60A8\u5F53\u524D\u770B\u5230\u7684\u662F\u540E\u7AEF\u7684\u54CD\u5E94. \u82E5\u60F3\u914D\u5408\u524D\u7AEF\u4F7F\u7528, \u53EF\u8BBF\u95EE\u5B98\u65B9\u524D\u7AEF https://sub-store.vercel.app \u540E\u81EA\u884C\u914D\u7F6E\u540E\u7AEF\u5730\u5740, \u6216\u4E00\u952E\u914D\u7F6E\u540E\u7AEF https://sub-store.vercel.app?api=https://a.com/xxx (\u5047\u8BBE https://a.com \u662F\u4F60\u540E\u7AEF\u7684\u57DF\u540D, /xxx \u662F\u81EA\u5B9A\u4E49\u8DEF\u5F84). \u9700\u6CE8\u610F HTTPS \u524D\u7AEF\u65E0\u6CD5\u8BF7\u6C42\u975E\u672C\u5730\u7684 HTTP \u540E\u7AEF(\u90E8\u5206\u6D4F\u89C8\u5668\u4E0A\u4E5F\u65E0\u6CD5\u8BBF\u95EE\u672C\u5730 HTTP \u540E\u7AEF). \u8BF7\u914D\u7F6E\u53CD\u4EE3\u6216\u5728\u5C40\u57DF\u7F51\u81EA\u5EFA HTTP \u524D\u7AEF. \u5982\u679C\u8FD8\u6709\u95EE\u9898, \u53EF\u67E5\u770B\u6B64\u6392\u67E5\u8BF4\u660E: https://t.me/zhetengsha/1068",...Ku}},null,2))}async function V3(e,t){await Ff(),await Cf(),Tr.revokeAll(),$c.revokeAll(),$a.revokeAll(),Ge(t)}async function G3(e,t,r){let{gistToken:n,syncPlatform:s}=x.read(Nt);if(!n)throw new Error("GitHub Token is required for backup!");let u=new Li({token:n,key:kg,syncPlatform:s}),i=x.read("#sub-store");i=i?JSON.parse(i):{},x.env.isNode&&(i=JSON.parse(JSON.stringify(x.cache)));let o,l=x.read(Nt),f=l.syncTime;switch(e){case"upload":try{if(o=x.read("#sub-store"),o=o?JSON.parse(o):{},x.env.isNode&&(o=JSON.parse(JSON.stringify(x.cache))),r==="plaintext"?(o.settings.gistToken="\u6062\u590D\u540E\u8BF7\u91CD\u65B0\u8BBE\u7F6E GitHub Token",o=JSON.stringify(o,null," ")):o=dt.encode(JSON.stringify(o,null," ")),x.info("\u4E0B\u8F7D\u5907\u4EFD, \u4E0E\u672C\u5730\u5185\u5BB9\u5BF9\u6BD4..."),await u.download(Zl)===o){x.info("\u5185\u5BB9\u4E00\u81F4, \u65E0\u9700\u4E0A\u4F20\u5907\u4EFD");return}}catch(d){x.error(`${d.message??d}`)}l.syncTime=new Date().getTime(),x.write(l,Nt),o=x.read("#sub-store"),o=o?JSON.parse(o):{},x.env.isNode&&(o=JSON.parse(JSON.stringify(x.cache))),r==="plaintext"?(o.settings.gistToken="\u6062\u590D\u540E\u8BF7\u91CD\u65B0\u8BBE\u7F6E GitHub Token",o=JSON.stringify(o,null," ")):o=dt.encode(JSON.stringify(o,null," ")),x.info("\u4E0A\u4F20\u5907\u4EFD\u4E2D...");try{await u.upload({[Zl]:{content:o}}),x.info("\u4E0A\u4F20\u5907\u4EFD\u5B8C\u6210")}catch(d){throw l.syncTime=f,x.write(l,Nt),d}break;case"download":x.info("\u8FD8\u539F\u5907\u4EFD\u4E2D..."),o=await u.download(Zl);try{if(o=JSON.parse(dt.decode(o)),Object.keys(o.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch{try{if(o=JSON.parse(o),Object.keys(o.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch(E){throw x.error(`Gist \u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F
Reason: ${E.message??E}`),new Error("Gist \u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F")}}t&&(x.info(`\u4FDD\u7559\u539F\u6709\u8BBE\u7F6E ${t}`),t.split(",").forEach(d=>{cp.default.set(o,d,cp.default.get(i,d))})),x.write(JSON.stringify(o,null," "),"#sub-store"),x.env.isNode&&(x.cache=o,x.persistCache()),x.info("perform migration after restoring from gist..."),wo(),x.info("migration completed"),x.info("\u8FD8\u539F\u5907\u4EFD\u5B8C\u6210");break}}async function z3(e,t){let{action:r,keep:n,encode:s}=e.query,{gistToken:u}=x.read(Nt);if(!u)We(t,new Rt("GIST_TOKEN_NOT_FOUND","GitHub Token is required for backup!"));else try{await G3(r,n,s),Ge(t)}catch(i){x.error(`Failed to ${r} gist data.
Reason: ${i.message??i}`),We(t,new fn("BACKUP_FAILED",`Failed to ${r} gist data!`,`Reason: ${i.message??i}`))}}function fp(e){e.post("/api/sort/subs",Y3),e.post("/api/sort/collections",W3),e.post("/api/sort/artifacts",J3),e.post("/api/sort/files",X3)}function Y3(e,t){let r=e.body,n=x.read(cr);n.sort((s,u)=>r.indexOf(s.name)-r.indexOf(u.name)),x.write(n,cr),Ge(t,n)}function W3(e,t){let r=e.body,n=x.read(er);n.sort((s,u)=>r.indexOf(s.name)-r.indexOf(u.name)),x.write(n,er),Ge(t,n)}function J3(e,t){let r=e.body,n=x.read(Mt);n.sort((s,u)=>r.indexOf(s.name)-r.indexOf(u.name)),x.write(n,Mt),Ge(t,n)}function X3(e,t){let r=e.body,n=x.read(It);n.sort((s,u)=>r.indexOf(s.name)-r.indexOf(u.name)),x.write(n,It),Ge(t,n)}var Lc=On(g2());function v2(e,t,...r){try{return e(t,...r)}catch{return e(A2(e(t.replace(/!<str>\s*/g,"__SubStoreJSYAMLString__"),...r)).replace(/__SubStoreJSYAMLString__/g,""),...r)}}function Nc(e,...t){return v2(Lc.default.safeLoad,JSON.parse(JSON.stringify(e)),...t)}function B8(e,...t){return v2(Lc.default.load,JSON.parse(JSON.stringify(e)),...t)}function m2(e,...t){return Lc.default.safeDump(JSON.parse(JSON.stringify(e)),...t)}function A2(e,...t){return Lc.default.dump(JSON.parse(JSON.stringify(e)),...t)}var Ss={safeLoad:Nc,load:B8,safeDump:m2,dump:A2,parse:Nc,stringify:m2};function I8(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function $8(){let e="Base64 Pre-processor",t=["dm1lc3M","c3NyOi8v","c29ja3M6Ly","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c","dmxlc3M=","aHlzdGVyaWEy","aHkyOi8v","d2lyZWd1YXJkOi8v","d2c6Ly8=","dHVpYzovLw=="];return{name:e,test:function(s){return!/^\w+:\/\/\w+/im.test(s)&&t.some(u=>s.indexOf(u)!==-1)},parse:function(s){let u=dt.decode(s);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(u)?u:(x.error("Base64 Pre-processor error: decoded line does not start with protocol"),s)}}}function P8(){return{name:"Fallback Base64 Pre-processor",test:function(n){return!0},parse:function(n){let s=dt.decode(n);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(s)?s:(x.error("Fallback Base64 Pre-processor error: decoded line does not start with protocol"),n)}}}function R8(){return{name:"Clash Pre-processor",test:function(n){if(!/proxies/.test(n))return!1;let s=Nc(n);return s.proxies&&Array.isArray(s.proxies)},parse:function(n,s){let u=n.replace(/short-id:([ \t]*[^#\n,}]*)/g,(l,f)=>{let d=f.trim();return!d||d===""?'short-id: ""':/^(['"]).*\1$/.test(d)?`short-id: ${d}`:["null"].includes(d)?`short-id: ${d}`:`short-id: "${d}"`}),{proxies:i,"global-client-fingerprint":o}=Nc(u);return(s?`proxies:
`:"")+i.map(l=>(o&&!l["client-fingerprint"]&&(l["client-fingerprint"]=o),`${s?" - ":""}${JSON.stringify(l)}
`)).join("")}}}function T8(){return{name:"SSD Pre-processor",test:function(n){return n.indexOf("ssd://")===0},parse:function(n){let s=[],u=JSON.parse(dt.decode(n.split("ssd://")[1])),i=u.port,o=u.encryption,l=u.password,f=u.servers;for(let d=0;d<f.length;d++){let E=f[d];o=E.encryption?E.encryption:o,l=E.password?E.password:l;let p=dt.encode(o+":"+l),h=E.server;i=E.port?E.port:i;let w=E.remarks?E.remarks:d,v=E.plugin_options?"/?plugin="+encodeURIComponent(E.plugin+";"+E.plugin_options):"";s[d]="ss://"+p+"@"+h+":"+i+v+"#"+w}return s.join(`
`)}}}function x8(){return{name:"Full Config Preprocessor",test:function(n){return/^(\[server_local\]|\[Proxy\])/gm.test(n)},parse:function(n){return n.match(/^\[server_local|Proxy\]([\s\S]+?)^\[.+?\](\r?\n|$)/im)?.[1]||n}}}var Of=[I8(),R8(),$8(),T8(),x8(),P8()];var Eh=On(Uf());var Xp=On(oA());function sB(e){let t=Xp.default.pemtohex(e);return Xp.default.KJUR.crypto.Util.hashHex(t,"sha256").match(/.{2}/g).join(":").toUpperCase()}var cA={generateFingerprint:sB};function Qf(e,t){return[...Array(e).keys()].map(()=>t)}var Zp={"\u{1F3F3}\uFE0F\u200D\u{1F308}":["EXP","BAND"],"\u{1F1F8}\u{1F1F1}":["TEST","SOS"],"\u{1F1E6}\u{1F1E9}":["AD","AND"],"\u{1F1E6}\u{1F1EA}":["AE","ARE"],"\u{1F1E6}\u{1F1EB}":["AF","AFG"],"\u{1F1E6}\u{1F1F1}":["AL","ALB"],"\u{1F1E6}\u{1F1F2}":["AM","ARM"],"\u{1F1E6}\u{1F1F7}":["AR","ARG"],"\u{1F1E6}\u{1F1F9}":["AT","AUT"],"\u{1F1E6}\u{1F1FA}":["AU","AUS"],"\u{1F1E6}\u{1F1FF}":["AZ","AZE"],"\u{1F1E7}\u{1F1E6}":["BA","BIH"],"\u{1F1E7}\u{1F1E9}":["BD","BGD"],"\u{1F1E7}\u{1F1EA}":["BE","BEL"],"\u{1F1E7}\u{1F1EC}":["BG","BGR"],"\u{1F1E7}\u{1F1ED}":["BH","BHR"],"\u{1F1E7}\u{1F1F4}":["BO","BOL"],"\u{1F1E7}\u{1F1F3}":["BN","BRN"],"\u{1F1E7}\u{1F1F7}":["BR","BRA"],"\u{1F1E7}\u{1F1F9}":["BT","BTN"],"\u{1F1E7}\u{1F1FE}":["BY","BLR"],"\u{1F1E8}\u{1F1E6}":["CA","CAN"],"\u{1F1E8}\u{1F1ED}":["CH","CHE"],"\u{1F1E8}\u{1F1F1}":["CL","CHL"],"\u{1F1E8}\u{1F1F4}":["CO","COL"],"\u{1F1E8}\u{1F1F7}":["CR","CRI"],"\u{1F1E8}\u{1F1FE}":["CY","CYP"],"\u{1F1E8}\u{1F1FF}":["CZ","CZE"],"\u{1F1E9}\u{1F1EA}":["DE","DEU"],"\u{1F1E9}\u{1F1F0}":["DK","DNK"],"\u{1F1EA}\u{1F1E8}":["EC","ECU"],"\u{1F1EA}\u{1F1EA}":["EE","EST"],"\u{1F1EA}\u{1F1EC}":["EG","EGY"],"\u{1F1EA}\u{1F1F8}":["ES","ESP"],"\u{1F1EA}\u{1F1FA}":["EU"],"\u{1F1EB}\u{1F1EE}":["FI","FIN"],"\u{1F1EB}\u{1F1F7}":["FR","FRA"],"\u{1F1EC}\u{1F1E7}":["GB","GBR","UK"],"\u{1F1EC}\u{1F1EA}":["GE","GEO"],"\u{1F1EC}\u{1F1F7}":["GR","GRC"],"\u{1F1EC}\u{1F1F9}":["GT","GTM"],"\u{1F1EC}\u{1F1FA}":["GU","GUM"],"\u{1F1ED}\u{1F1F0}":["HK","HKG","HKT","HKBN","HGC","WTT","CMI"],"\u{1F1ED}\u{1F1F7}":["HR","HRV"],"\u{1F1ED}\u{1F1FA}":["HU","HUN"],"\u{1F1EE}\u{1F1F6}":["IQ","IRQ"],"\u{1F1EF}\u{1F1F4}":["JO","JOR"],"\u{1F1EF}\u{1F1F5}":["JP","JPN","TYO"],"\u{1F1F0}\u{1F1EA}":["KE","KEN"],"\u{1F1F0}\u{1F1EC}":["KG","KGZ"],"\u{1F1F0}\u{1F1ED}":["KH","KGZ"],"\u{1F1F0}\u{1F1F5}":["KP","PRK"],"\u{1F1F0}\u{1F1F7}":["KR","KOR","SEL"],"\u{1F1F0}\u{1F1FF}":["KZ","KAZ"],"\u{1F1EE}\u{1F1E9}":["ID","IDN"],"\u{1F1EE}\u{1F1EA}":["IE","IRL"],"\u{1F1EE}\u{1F1F1}":["IL","ISR"],"\u{1F1EE}\u{1F1F2}":["IM","IMN"],"\u{1F1EE}\u{1F1F3}":["IN","IND"],"\u{1F1EE}\u{1F1F7}":["IR","IRN"],"\u{1F1EE}\u{1F1F8}":["IS","ISL"],"\u{1F1EE}\u{1F1F9}":["IT","ITA"],"\u{1F1F1}\u{1F1E6}":["LA","LAO"],"\u{1F1F1}\u{1F1F0}":["LK","LKA"],"\u{1F1F1}\u{1F1F9}":["LT","LTU"],"\u{1F1F1}\u{1F1FA}":["LU","LUX"],"\u{1F1F1}\u{1F1FB}":["LV","LVA"],"\u{1F1F2}\u{1F1E6}":["MA","MAR"],"\u{1F1F2}\u{1F1E9}":["MD","MDA"],"\u{1F1F3}\u{1F1EC}":["NG","NGA"],"\u{1F1F2}\u{1F1F2}":["MM","MMR"],"\u{1F1F2}\u{1F1F0}":["MK","MKD"],"\u{1F1F2}\u{1F1F3}":["MN","MNG"],"\u{1F1F2}\u{1F1F4}":["MO","MAC","CTM"],"\u{1F1F2}\u{1F1F9}":["MT","MLT"],"\u{1F1F2}\u{1F1FD}":["MX","MEX"],"\u{1F1F2}\u{1F1FE}":["MY","MYS"],"\u{1F1F3}\u{1F1F1}":["NL","NLD","AMS"],"\u{1F1F3}\u{1F1F4}":["NO","NOR"],"\u{1F1F3}\u{1F1F5}":["NP","NPL"],"\u{1F1F3}\u{1F1FF}":["NZ","NZL"],"\u{1F1F5}\u{1F1E6}":["PA","PAN"],"\u{1F1F5}\u{1F1EA}":["PE","PER"],"\u{1F1F5}\u{1F1ED}":["PH","PHL"],"\u{1F1F5}\u{1F1F0}":["PK","PAK"],"\u{1F1F5}\u{1F1F1}":["PL","POL"],"\u{1F1F5}\u{1F1F7}":["PR","PRI"],"\u{1F1F5}\u{1F1F9}":["PT","PRT"],"\u{1F1F5}\u{1F1FE}":["PY","PRY"],"\u{1F1F5}\u{1F1EC}":["PG","PNG"],"\u{1F1F7}\u{1F1F4}":["RO","ROU"],"\u{1F1F7}\u{1F1F8}":["RS","SRB"],"\u{1F1F7}\u{1F1EA}":["RE","REU"],"\u{1F1F7}\u{1F1FA}":["RU","RUS"],"\u{1F1F8}\u{1F1E6}":["SA","SAU"],"\u{1F1F8}\u{1F1EA}":["SE","SWE"],"\u{1F1F8}\u{1F1EC}":["SG","SGP"],"\u{1F1F8}\u{1F1EE}":["SI","SVN"],"\u{1F1F8}\u{1F1F0}":["SK","SVK"],"\u{1F1F9}\u{1F1EC}":["TG","TGO"],"\u{1F1F9}\u{1F1ED}":["TH","THA"],"\u{1F1F9}\u{1F1F3}":["TN","TUN"],"\u{1F1F9}\u{1F1F7}":["TR","TUR"],"\u{1F1F9}\u{1F1FC}":["TW","TWN","CHT","HINET","ROC"],"\u{1F1FA}\u{1F1E6}":["UA","UKR"],"\u{1F1FA}\u{1F1F8}":["US","USA","LAX","SFO","SJC"],"\u{1F1FA}\u{1F1FE}":["UY","URY"],"\u{1F1FB}\u{1F1EA}":["VE","VEN"],"\u{1F1FB}\u{1F1F3}":["VN","VNM"],"\u{1F1FF}\u{1F1E6}":["ZA","ZAF","JNB"],"\u{1F1E8}\u{1F1F3}":["CN","CHN","BACK"]};function zo(e){let t={"\u{1F3F3}\uFE0F\u200D\u{1F308}":["\u6D41\u91CF","\u65F6\u95F4","\u8FC7\u671F","Bandwidth","Expire"],"\u{1F1F8}\u{1F1F1}":["\u5E94\u6025","\u6D4B\u8BD5\u8282\u70B9"],"\u{1F1E6}\u{1F1E9}":["Andorra","\u5B89\u9053\u5C14"],"\u{1F1E6}\u{1F1EA}":["United Arab Emirates","\u963F\u8054\u914B","\u8FEA\u62DC"],"\u{1F1E6}\u{1F1EB}":["Afghanistan","\u963F\u5BCC\u6C57"],"\u{1F1E6}\u{1F1F1}":["Albania","\u963F\u5C14\u5DF4\u5C3C\u4E9A","\u963F\u723E\u5DF4\u5C3C\u4E9E"],"\u{1F1E6}\u{1F1F2}":["Armenia","\u4E9A\u7F8E\u5C3C\u4E9A"],"\u{1F1E6}\u{1F1F7}":["Argentina","\u963F\u6839\u5EF7"],"\u{1F1E6}\u{1F1F9}":["Austria","\u5965\u5730\u5229","\u5967\u5730\u5229","\u7EF4\u4E5F\u7EB3"],"\u{1F1E6}\u{1F1FA}":["Australia","\u6FB3\u5927\u5229\u4E9A","\u6FB3\u6D32","\u58A8\u5C14\u672C","\u6089\u5C3C","\u571F\u6FB3","\u4EAC\u6FB3","\u5EE3\u6FB3","\u6EEC\u6FB3","\u6CAA\u6FB3","\u5E7F\u6FB3","Sydney"],"\u{1F1E6}\u{1F1FF}":["Azerbaijan","\u963F\u585E\u62DC\u7586"],"\u{1F1E7}\u{1F1E6}":["Bosnia and Herzegovina","\u6CE2\u9ED1\u5171\u548C\u56FD","\u6CE2\u9ED1"],"\u{1F1E7}\u{1F1E9}":["Bangladesh","\u5B5F\u52A0\u62C9\u56FD","\u5B5F\u52A0\u62C9"],"\u{1F1E7}\u{1F1EA}":["Belgium","\u6BD4\u5229\u65F6","\u6BD4\u5229\u6642"],"\u{1F1E7}\u{1F1EC}":["Bulgaria","\u4FDD\u52A0\u5229\u4E9A","\u4FDD\u52A0\u5229\u4E9E"],"\u{1F1E7}\u{1F1ED}":["Bahrain","\u5DF4\u6797"],"\u{1F1E7}\u{1F1F7}":["Brazil","\u5DF4\u897F","\u5723\u4FDD\u7F57"],"\u{1F1E7}\u{1F1F3}":["Brunei","\u6587\u83B1","\u6C76\u840A"],"\u{1F1E7}\u{1F1FE}":["Belarus","\u767D\u4FC4\u7F57\u65AF","\u767D\u4FC4"],"\u{1F1E7}\u{1F1F4}":["Bolivia","\u73BB\u5229\u7EF4\u4E9A"],"\u{1F1E7}\u{1F1F9}":["Bhutan","\u4E0D\u4E39","\u4E0D\u4E39\u738B\u56FD"],"\u{1F1E8}\u{1F1E6}":["Canada","\u52A0\u62FF\u5927","\u8499\u7279\u5229\u5C14","\u6E29\u54E5\u534E","\u6953\u8449","\u67AB\u53F6","\u6ED1\u94C1\u5362","\u591A\u4F26\u591A","Waterloo","Toronto"],"\u{1F1E8}\u{1F1ED}":["Switzerland","\u745E\u58EB","\u82CF\u9ECE\u4E16","Zurich"],"\u{1F1E8}\u{1F1F1}":["Chile","\u667A\u5229"],"\u{1F1E8}\u{1F1F4}":["Colombia","\u54E5\u4F26\u6BD4\u4E9A"],"\u{1F1E8}\u{1F1F7}":["Costa Rica","\u54E5\u65AF\u8FBE\u9ECE\u52A0"],"\u{1F1E8}\u{1F1FE}":["Cyprus","\u585E\u6D66\u8DEF\u65AF"],"\u{1F1E8}\u{1F1FF}":["Czechia","\u6377\u514B"],"\u{1F1E9}\u{1F1EA}":["German","\u5FB7\u56FD","\u5FB7\u570B","\u4EAC\u5FB7","\u6EEC\u5FB7","\u5EE3\u5FB7","\u6CAA\u5FB7","\u5E7F\u5FB7","\u6CD5\u5170\u514B\u798F","Frankfurt","\u5FB7\u610F\u5FD7"],"\u{1F1E9}\u{1F1F0}":["Denmark","\u4E39\u9EA6","\u4E39\u9EA5"],"\u{1F1EA}\u{1F1E8}":["Ecuador","\u5384\u74DC\u591A\u5C14"],"\u{1F1EA}\u{1F1EA}":["Estonia","\u7231\u6C99\u5C3C\u4E9A"],"\u{1F1EA}\u{1F1EC}":["Egypt","\u57C3\u53CA"],"\u{1F1EA}\u{1F1F8}":["Spain","\u897F\u73ED\u7259"],"\u{1F1EA}\u{1F1FA}":["European Union","\u6B27\u76DF","\u6B27\u7F57\u5DF4"],"\u{1F1EB}\u{1F1EE}":["Finland","\u82AC\u5170","\u82AC\u862D","\u8D6B\u5C14\u8F9B\u57FA"],"\u{1F1EB}\u{1F1F7}":["France","\u6CD5\u56FD","\u6CD5\u570B","\u5DF4\u9ECE"],"\u{1F1EC}\u{1F1E7}":["Great Britain","\u82F1\u56FD","England","United Kingdom","\u4F26\u6566","\u82F1","London"],"\u{1F1EC}\u{1F1EA}":["Georgia","\u683C\u9C81\u5409\u4E9A","\u683C\u9B6F\u5409\u4E9E"],"\u{1F1EC}\u{1F1F7}":["Greece","\u5E0C\u814A","\u5E0C\u81D8"],"\u{1F1EC}\u{1F1FA}":["Guam","\u5173\u5C9B","\u95DC\u5CF6"],"\u{1F1EC}\u{1F1F9}":["Guatemala","\u5371\u5730\u9A6C\u62C9"],"\u{1F1ED}\u{1F1F0}":["Hongkong","\u9999\u6E2F","Hong Kong","HongKong","HONG KONG","\u6DF1\u6E2F","\u6CAA\u6E2F","\u547C\u6E2F","\u7A57\u6E2F","\u4EAC\u6E2F","\u6E2F"],"\u{1F1ED}\u{1F1F7}":["Croatia","\u514B\u7F57\u5730\u4E9A","\u514B\u7F85\u5730\u4E9E"],"\u{1F1ED}\u{1F1FA}":["Hungary","\u5308\u7259\u5229"],"\u{1F1EE}\u{1F1F6}":["Iraq","\u4F0A\u62C9\u514B","\u5DF4\u683C\u8FBE","Baghdad"],"\u{1F1EF}\u{1F1F4}":["Jordan","\u7EA6\u65E6"],"\u{1F1EF}\u{1F1F5}":["Japan","\u65E5\u672C","\u4E1C\u4EAC","\u5927\u962A","\u57FC\u7389","\u6CAA\u65E5","\u7A57\u65E5","\u5DDD\u65E5","\u4E2D\u65E5","\u6CC9\u65E5","\u676D\u65E5","\u6DF1\u65E5","\u8FBD\u65E5","\u5E7F\u65E5","\u5927\u5742","Osaka","Tokyo"],"\u{1F1F0}\u{1F1EA}":["Kenya","\u80AF\u5C3C\u4E9A"],"\u{1F1F0}\u{1F1EC}":["Kyrgyzstan","\u5409\u5C14\u5409\u65AF\u65AF\u5766"],"\u{1F1F0}\u{1F1ED}":["Cambodia","\u67EC\u57D4\u5BE8"],"\u{1F1F0}\u{1F1F5}":["North Korea","\u671D\u9C9C"],"\u{1F1F0}\u{1F1F7}":["Korea","\u97E9\u56FD","\u97D3\u570B","\u97E9","\u97D3","\u9996\u5C14","\u6625\u5DDD","Chuncheon","Seoul"],"\u{1F1F0}\u{1F1FF}":["Kazakhstan","\u54C8\u8428\u514B\u65AF\u5766","\u54C8\u8428\u514B"],"\u{1F1EE}\u{1F1E9}":["Indonesia","\u5370\u5C3C","\u5370\u5EA6\u5C3C\u897F\u4E9A","\u96C5\u52A0\u8FBE"],"\u{1F1EE}\u{1F1EA}":["Ireland","\u7231\u5C14\u5170","\u611B\u723E\u862D","\u90FD\u67CF\u6797"],"\u{1F1EE}\u{1F1F1}":["Israel","\u4EE5\u8272\u5217"],"\u{1F1EE}\u{1F1F2}":["Isle of Man","\u9A6C\u6069\u5C9B","\u99AC\u6069\u5CF6"],"\u{1F1EE}\u{1F1F3}":["India","\u5370\u5EA6","\u5B5F\u4E70","MFumbai","Mumbai"],"\u{1F1EE}\u{1F1F7}":["Iran","\u4F0A\u6717"],"\u{1F1EE}\u{1F1F8}":["Iceland","\u51B0\u5C9B","\u51B0\u5CF6"],"\u{1F1EE}\u{1F1F9}":["Italy","\u610F\u5927\u5229","\u7FA9\u5927\u5229","\u7C73\u5170","Nachash"],"\u{1F1F1}\u{1F1F0}":["Sri Lanka","\u65AF\u91CC\u5170\u5361","\u65AF\u91CC\u862D\u5361"],"\u{1F1F1}\u{1F1E6}":["Laos","\u8001\u631D","\u8001\u64BE"],"\u{1F1F1}\u{1F1F9}":["Lithuania","\u7ACB\u9676\u5B9B"],"\u{1F1F1}\u{1F1FA}":["Luxembourg","\u5362\u68EE\u5821"],"\u{1F1F1}\u{1F1FB}":["Latvia","\u62C9\u8131\u7EF4\u4E9A","Latvija"],"\u{1F1F2}\u{1F1E6}":["Morocco","\u6469\u6D1B\u54E5"],"\u{1F1F2}\u{1F1E9}":["Moldova","\u6469\u5C14\u591A\u74E6","\u6469\u723E\u591A\u74E6"],"\u{1F1F2}\u{1F1F2}":["Myanmar","\u7F05\u7538","\u7DEC\u7538"],"\u{1F1F3}\u{1F1EC}":["Nigeria","\u5C3C\u65E5\u5229\u4E9A","\u5C3C\u65E5\u5229\u4E9E"],"\u{1F1F2}\u{1F1F0}":["Macedonia","\u9A6C\u5176\u987F","\u99AC\u5176\u9813"],"\u{1F1F2}\u{1F1F3}":["Mongolia","\u8499\u53E4"],"\u{1F1F2}\u{1F1F4}":["Macao","\u6FB3\u95E8","\u6FB3\u9580","CTM"],"\u{1F1F2}\u{1F1F9}":["Malta","\u9A6C\u8033\u4ED6"],"\u{1F1F2}\u{1F1FD}":["Mexico","\u58A8\u897F\u54E5"],"\u{1F1F2}\u{1F1FE}":["Malaysia","\u9A6C\u6765","\u99AC\u4F86","\u5409\u9686\u5761","\u5927\u99AC"],"\u{1F1F3}\u{1F1F1}":["Netherlands","\u8377\u5170","\u8377\u862D","\u5C3C\u5FB7\u862D","\u963F\u59C6\u65AF\u7279\u4E39","Amsterdam"],"\u{1F1F3}\u{1F1F4}":["Norway","\u632A\u5A01"],"\u{1F1F3}\u{1F1F5}":["Nepal","\u5C3C\u6CCA\u5C14"],"\u{1F1F3}\u{1F1FF}":["New Zealand","\u65B0\u897F\u5170","\u65B0\u897F\u862D"],"\u{1F1F5}\u{1F1E6}":["Panama","\u5DF4\u62FF\u9A6C"],"\u{1F1F5}\u{1F1EA}":["Peru","\u79D8\u9C81","\u7955\u9B6F"],"\u{1F1F5}\u{1F1ED}":["Philippines","\u83F2\u5F8B\u5BBE","\u83F2\u5F8B\u8CD3"],"\u{1F1F5}\u{1F1F0}":["Pakistan","\u5DF4\u57FA\u65AF\u5766"],"\u{1F1F5}\u{1F1F1}":["Poland","\u6CE2\u5170","\u6CE2\u862D","\u534E\u6C99","Warsaw"],"\u{1F1F5}\u{1F1F7}":["Puerto Rico","\u6CE2\u591A\u9ECE\u5404"],"\u{1F1F5}\u{1F1F9}":["Portugal","\u8461\u8404\u7259"],"\u{1F1F5}\u{1F1EC}":["Papua New Guinea","\u5DF4\u5E03\u4E9A\u65B0\u51E0\u5185\u4E9A"],"\u{1F1F5}\u{1F1FE}":["Paraguay","\u5DF4\u62C9\u572D"],"\u{1F1F7}\u{1F1F4}":["Romania","\u7F57\u9A6C\u5C3C\u4E9A"],"\u{1F1F7}\u{1F1F8}":["Serbia","\u585E\u5C14\u7EF4\u4E9A"],"\u{1F1F7}\u{1F1EA}":["R\xE9union","\u7559\u5C3C\u6C6A","\u6CD5\u5C5E\u7559\u5C3C\u6C6A"],"\u{1F1F7}\u{1F1FA}":["Russia","\u4FC4\u7F57\u65AF","\u4FC4\u56FD","\u4FC4\u7F85\u65AF","\u4F2F\u529B","\u83AB\u65AF\u79D1","\u5723\u5F7C\u5F97\u5821","\u897F\u4F2F\u5229\u4E9A","\u4EAC\u4FC4","\u676D\u4FC4","\u5EE3\u4FC4","\u6EEC\u4FC4","\u5E7F\u4FC4","\u6CAA\u4FC4","Moscow"],"\u{1F1F8}\u{1F1E6}":["Saudi","\u6C99\u7279\u963F\u62C9\u4F2F","\u6C99\u7279","Riyadh","\u5229\u96C5\u5F97"],"\u{1F1F8}\u{1F1EA}":["Sweden","\u745E\u5178","\u65AF\u5FB7\u54E5\u5C14\u6469","Stockholm"],"\u{1F1F8}\u{1F1EC}":["Singapore","\u65B0\u52A0\u5761","\u72EE\u57CE","\u6CAA\u65B0","\u4EAC\u65B0","\u4E2D\u65B0","\u6CC9\u65B0","\u7A57\u65B0","\u6DF1\u65B0","\u676D\u65B0","\u5E7F\u65B0","\u5EE3\u65B0","\u6EEC\u65B0"],"\u{1F1F8}\u{1F1EE}":["Slovenia","\u65AF\u6D1B\u6587\u5C3C\u4E9A"],"\u{1F1F8}\u{1F1F0}":["Slovakia","\u65AF\u6D1B\u4F10\u514B"],"\u{1F1F9}\u{1F1EC}":["Togo","\u591A\u54E5","\u6D1B\u7F8E","Lom\xE9","Lome"],"\u{1F1F9}\u{1F1ED}":["Thailand","\u6CF0\u56FD","\u6CF0\u570B","\u66FC\u8C37"],"\u{1F1F9}\u{1F1F3}":["Tunisia","\u7A81\u5C3C\u65AF"],"\u{1F1F9}\u{1F1F7}":["Turkey","\u571F\u8033\u5176","\u4F0A\u65AF\u5766\u5E03\u5C14","Istanbul"],"\u{1F1F9}\u{1F1FC}":["Taiwan","\u53F0\u6E7E","\u81FA\u7063","\u53F0\u7063","\u4E2D\u83EF\u6C11\u570B","\u4E2D\u534E\u6C11\u56FD","\u53F0\u5317","\u53F0\u4E2D","\u65B0\u5317","\u5F70\u5316","\u53F0","\u81FA","Taipei","Tai Wan"],"\u{1F1FA}\u{1F1E6}":["Ukraine","\u4E4C\u514B\u5170","\u70CF\u514B\u862D"],"\u{1F1FA}\u{1F1F8}":["United States","\u7F8E\u56FD","America","\u7F8E","\u4EAC\u7F8E","\u6CE2\u7279\u5170","\u8FBE\u62C9\u65AF","\u4FC4\u52D2\u5188","Oregon","\u51E4\u51F0\u57CE","\u8D39\u5229\u8499","\u7845\u8C37","\u77FD\u8C37","\u62C9\u65AF\u7EF4\u52A0\u65AF","\u6D1B\u6749\u77F6","\u5723\u4F55\u585E","\u5723\u514B\u62C9\u62C9","\u897F\u96C5\u56FE","\u829D\u52A0\u54E5","\u6CAA\u7F8E","\u54E5\u4F26\u5E03","\u7EBD\u7EA6","New York","Los Angeles","San Jose","Sillicon Valley","Michigan","\u4FC4\u4EA5\u4FC4","Ohio","\u9A6C\u7EB3\u8428\u65AF","Manassas","\u5F17\u5409\u5C3C\u4E9A","Virginia"],"\u{1F1FA}\u{1F1FE}":["Uruguay","\u4E4C\u62C9\u572D"],"\u{1F1FB}\u{1F1EA}":["Venezuela","\u59D4\u5185\u745E\u62C9"],"\u{1F1FB}\u{1F1F3}":["Vietnam","\u8D8A\u5357","\u80E1\u5FD7\u660E"],"\u{1F1FF}\u{1F1E6}":["South Africa","\u5357\u975E"],"\u{1F1E8}\u{1F1F3}":["China","\u4E2D\u56FD","\u4E2D\u570B","\u56DE\u56FD","\u56DE\u570B","\u56FD\u5185","\u570B\u5167","\u534E\u4E1C","\u534E\u897F","\u534E\u5357","\u534E\u5317","\u534E\u4E2D","\u6C5F\u82CF","\u5317\u4EAC","\u4E0A\u6D77","\u5E7F\u5DDE","\u6DF1\u5733","\u676D\u5DDE","\u5F90\u5DDE","\u9752\u5C9B","\u5B81\u6CE2","\u9547\u6C5F"]},r=e.match(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/)?.[0]||"\u{1F3F4}\u200D\u2620\uFE0F";for(let n of Object.keys(t))if(t[n].some(u=>RegExp(`${u}`,"i").test(e)))return/内蒙古/.test(e)&&["\u{1F1F2}\u{1F1F3}"].includes(n)?r="\u{1F1E8}\u{1F1F3}":r=n;for(let n of Object.keys(Zp))if(Zp[n].some(u=>RegExp(`(^|[^a-zA-Z])${u}([^a-zA-Z]|$)`).test(e))&&!(n=="\u{1F1E8}\u{1F1F3}"&&RegExp("(^|[^a-zA-Z])CN2([^a-zA-Z]|$)").test(e)))return r=n;return r}function lA(e){return Zp[zo(e)]?.[0]}function Vc(e){return e.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]|🏴‍☠️|🏳️‍🌈/g,"").trim()}var eh=class{constructor({country,asn}={}){if(x.env.isNode){let Reader=eval('require("@maxmind/geoip2-node")').Reader,fs=eval("require('fs')"),countryFile=country||eval("process.env.SUB_STORE_MMDB_COUNTRY_PATH"),asnFile=asn||eval("process.env.SUB_STORE_MMDB_ASN_PATH");if(countryFile&&(this.countryReader=Reader.openBuffer(fs.readFileSync(countryFile))),asnFile){if(!fs.existsSync(asnFile))throw new Error("GeoLite2 ASN MMDB does not exist");this.asnReader=Reader.openBuffer(fs.readFileSync(asnFile))}}}geoip(e){return this.countryReader?.country(e)?.country?.isoCode}ipaso(e){return this.asnReader?.asn(e)?.autonomousSystemOrganization}ipasn(e){return this.asnReader?.asn(e)?.autonomousSystemNumber}};var nh=On(FA()),CA=On(Uf());async function Wo({url:e,domain:t,type:r="A",timeout:n,edns:s}){let u=nh.default.encode({type:"query",id:0,flags:nh.default.RECURSION_DESIRED,questions:[{type:r,name:t}],additionals:[{type:"OPT",name:".",udpPayloadSize:4096,flags:0,options:[{code:"CLIENT_SUBNET",ip:s,sourcePrefixLength:Rr(s)?24:56,scopePrefixLength:0}]}]}),i=await x.http.get({url:`${e}?dns=${u.toString("base64").toString("utf-8").replace(/=/g,"")}`,headers:{Accept:"application/dns-message"},"binary-mode":!0,encoding:null,timeout:n});return nh.default.decode(CA.Buffer.from(x.env.isQX?i.bodyBytes:i.body))}var ld=On(Df());function pB(e){return e&&typeof e=="object"&&!Array.isArray(e)}function zc(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function yA(e,t){let r=typeof t=="string"?JSON.parse(t):t;for(let n in r)if(pB(r[n]))if(n.endsWith("!")){let s=zc(n.slice(0,-1));e[s]=r[n]}else{let s=zc(n);e[s]||Object.assign(e,{[s]:{}}),yA(e[s],r[s])}else if(Array.isArray(r[n]))if(n.startsWith("+")){let s=zc(n.slice(1));e[s]||Object.assign(e,{[s]:[]}),e[s]=[...r[n],...e[s]]}else if(n.endsWith("+")){let s=zc(n.slice(0,-1));e[s]||Object.assign(e,{[s]:[]}),e[s]=[...e[s],...r[n]]}else{let s=zc(n);Object.assign(e,{[s]:r[n]})}else Object.assign(e,{[n]:r[n]});return e}function dB({rule:e}){return{name:"Conditional Filter",func:t=>t.map(r=>ih(e,r))}}function ih(e,t){if(!e.operator)switch(e.proposition){case"IN":return e.value.indexOf(t[e.attr])!==-1;case"CONTAINS":return typeof t[e.attr]!="string"?!1:t[e.attr].indexOf(e.value)!==-1;case"EQUALS":return t[e.attr]===e.value;case"EXISTS":return t[e.attr]!==null||typeof t[e.attr]<"u";default:throw new Error(`Unknown proposition: ${e.proposition}`)}switch(e.operator){case"AND":return e.child.every(r=>ih(r,t));case"OR":return e.child.some(r=>ih(r,t));case"NOT":return!ih(e.child,t);default:throw new Error(`Unknown operator: ${e.operator}`)}}function gB(e){return{name:"Quick Setting Operator",func:r=>{if(t(e.useless)){let s=BA().func(r);r=r.filter((u,i)=>s[i]&&u.port>0&&u.port<=65535)}return r.map(n=>(n.udp=t(e.udp,n.udp),n.tfo=t(e.tfo,n.tfo),n["fast-open"]=t(e.tfo,n["fast-open"]),n["skip-cert-verify"]=t(e.scert,n["skip-cert-verify"]),n.type==="vmess"&&(n.aead=t(e["vmess aead"],n.aead)),n))}};function t(r,n){switch(r){case"ENABLED":return!0;case"DISABLED":return!1;default:return n}}}function mB({mode:e,tw:t}){return{name:"Flag Operator",func:r=>r.map(n=>{if(e==="remove")n.name=Vc(n.name);else{let s=zo(n.name);n.name=Vc(n.name),n.name=s+" "+n.name,t=="ws"?n.name=n.name.replace(/🇹🇼/g,"\u{1F1FC}\u{1F1F8}"):t=="tw"||(n.name=n.name.replace(/🇹🇼/g,"\u{1F1E8}\u{1F1F3}"))}return n})}}function vB(e){let{action:t,template:r,link:n,position:s}={action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back",...e};return{name:"Handle Duplicate Operator",func:u=>{if(t==="delete"){let i={};return u.filter(o=>i[o.name]?!1:(i[o.name]=!0,!0))}else if(t==="rename"){let i=r.split(" "),o={},l=0;u.forEach(d=>{typeof o[d.name]>"u"?o[d.name]=1:o[d.name]++,l=Math.max(o[d.name].toString().length,l)});let f={};return u.map(d=>{if(o[d.name]>1){typeof f[d.name]>"u"&&(f[d.name]=1);let E="",p=f[d.name]++,h=0;for(;p>0;)E=i[p%10]+E,p=parseInt(p/10),h++;for(;h++<l;)E=i[0]+E;s==="front"?d.name=E+n+d.name:s==="back"&&(d.name=d.name+n+E)}return d})}}}}function AB(e="asc"){return{name:"Sort Operator",func:t=>{switch(e){case"asc":case"desc":return t.sort((r,n)=>{let s=r.name>n.name?1:-1;return s*=e==="desc"?-1:1,s});case"random":return IB(t);default:throw new Error("Unknown sort option: "+e)}}}}function EB(e){let t=e.order||"asc",r=e.expressions;return Array.isArray(e)&&(r=e),Array.isArray(r)||(r=[]),{name:"Regex Sort Operator",func:n=>(r=r.map(s=>fd(s)),n.sort((s,u)=>{let i=DA(r,s.name),o=DA(r,u.name);return i&&!o?-1:o&&!i?1:i&&o?i<o?-1:1:t==="original"?0:t==="desc"?s.name<u.name?1:-1:s.name<u.name?-1:1}))}}function DA(e,t){let r=null;for(let n=0;n<e.length;n++)if(e[n].test(t)){r=n+1;break}return r}function SA(e){return{name:"Regex Rename Operator",func:t=>t.map(r=>{for(let{expr:n,now:s}of e)r.name=r.name.replace(fd(n,"g"),s).trim();return r})}}function wB(e){let t=e.map(r=>({expr:r,now:""}));return{name:"Regex Delete Operator",func:SA(t).func}}function FB(e,t,r,n,s){return{name:"Script Operator",func:async u=>{let i=u;if(i?.$file?.type==="mihomoProfile")try{let o=Ss.safeLoad(e),l;if(i?.$content)try{l=Ss.safeLoad(i?.$content)}catch(f){x.error(f.message??f)}if(typeof o!="object")throw new Error("patch is not an object");return i.$content=dr.yaml.safeDump(yA(l||(i?.$file?.sourceType==="none"?{}:{proxies:await ks({type:i?.$file?.sourceType||"collection",name:i?.$file?.sourceName,platform:"mihomo",produceType:"internal",produceOpts:{"delete-underscore-fields":!0}})}),o)),i}catch{}return await async function(){i=sh("operator",e,r,s)(u,t,{source:n,...Ku})}(),i},nodeFunc:async u=>{let i=u;return await async function(){i=sh("operator",`async function operator(input = []) {
if (input && (input.$files || input.$content)) {
let { $content, $files, $options, $file } = input
if($file.type === 'mihomoProfile') {
${e}
if(typeof main === 'function') {
let config;
if ($content) {
try {
config = ProxyUtils.yaml.safeLoad($content);
} catch (e) {
console.log(e.message ?? e);
}
}
$content = ProxyUtils.yaml.safeDump(await main(config || ($file.sourceType === 'none' ? {} : {
proxies: await produceArtifact({
type: $file.sourceType || 'collection',
name: $file.sourceName,
platform: 'mihomo',
produceType: 'internal',
produceOpts: {
'delete-underscore-fields': true
}
}),
})))
}
} else {
${e}
}
return { $content, $files, $options, $file }
} else {
let proxies = input
let list = []
for await (let $server of proxies) {
${e}
list.push($server)
}
return list
}
}`,r,s)(u,t,{source:n,...Ku})}(),i}}}function CB(e){let t,r;try{let n=e.split(":");r=parseInt(n[2],16);let s=parseInt(n[3],16),u=parseInt(n[4],16),i=s>>8,o=s&255,l=u>>8,f=u&255;if(t=`${i}.${o}.${l}.${f}`,r<=0||r>65535)throw new Error(`Invalid port number: ${r}`);if(!Rr(t))throw new Error(`Invalid IP address: ${t}`)}catch(n){x.error(`IP4P \u89E3\u6790\u5931\u8D25: ${n}`)}return{server:t,port:r}}var bA={Custom:async function(e,t,r,n,s,u){let i=mi(`CUSTOM:${u}:${e}:${t}`),o=Tr.get(i);if(!r&&o)return o;let l=t==="IPv6"?"AAAA":"A",f=await Wo({url:u,domain:e,type:l,timeout:n,edns:s}),{answers:d}=f;if(!Array.isArray(d)||d.length===0)throw new Error("No answers");let E=d.filter(p=>p?.type===l).map(p=>p?.data).filter(p=>p);if(E.length===0)throw new Error("No answers");return Tr.set(i,E),E},Google:async function(e,t,r,n,s){let u=mi(`GOOGLE:${e}:${t}`),i=Tr.get(u);if(!r&&i)return i;let o=t==="IPv6"?"AAAA":"A",l=await Wo({url:"https://8.8.4.4/dns-query",domain:e,type:o,timeout:n,edns:s}),{answers:f}=l;if(!Array.isArray(f)||f.length===0)throw new Error("No answers");let d=f.filter(E=>E?.type===o).map(E=>E?.data).filter(E=>E);if(d.length===0)throw new Error("No answers");return Tr.set(u,d),d},"IP-API":async function(e,t,r,n){if(["IPv6"].includes(t))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 IP-API \u4E0D\u652F\u6301 ${t}`);let s=mi(`IP-API:${e}`),u=Tr.get(s);if(!r&&u)return u;let i=await x.http.get({url:`http://ip-api.com/json/${encodeURIComponent(e)}?lang=zh-CN`,timeout:n}),o=JSON.parse(i.body);if(o.status!=="success")throw new Error(`Status is ${o.status}`);if(!o.query||o.query===0)throw new Error("No answers");let l=[o.query];if(l.length===0)throw new Error("No answers");return Tr.set(s,l),l},Cloudflare:async function(e,t,r,n,s){let u=mi(`CLOUDFLARE:${e}:${t}`),i=Tr.get(u);if(!r&&i)return i;let o=t==="IPv6"?"AAAA":"A",l=await Wo({url:"https://1.0.0.1/dns-query",domain:e,type:o,timeout:n,edns:s}),{answers:f}=l;if(!Array.isArray(f)||f.length===0)throw new Error("No answers");let d=f.filter(E=>E?.type===o).map(E=>E?.data).filter(E=>E);if(d.length===0)throw new Error("No answers");return Tr.set(u,d),d},Ali:async function(e,t,r,n,s){let u=mi(`ALI:${e}:${t}`),i=Tr.get(u);if(!r&&i)return i;let o=await x.http.get({url:`http://223.6.6.6/resolve?edns_client_subnet=${s}/${Rr(s)?24:56}&name=${encodeURIComponent(e)}&type=${t==="IPv6"?"AAAA":"A"}&short=1`,headers:{accept:"application/dns-json"},timeout:n}),l=JSON.parse(o.body);if(!Array.isArray(l)||l.length===0)throw new Error("No answers");let f=l;if(f.length===0)throw new Error("No answers");return Tr.set(u,f),f},Tencent:async function(e,t,r,n,s){let u=mi(`TENCENT:${e}:${t}`),i=Tr.get(u);if(!r&&i)return i;let l=(await x.http.get({url:`http://119.28.28.28/d?ip=${s}&type=${t==="IPv6"?"AAAA":"A"}&dn=${encodeURIComponent(e)}`,headers:{accept:"application/dns-json"},timeout:n})).body.split(";").map(d=>d.split(",")[0]);if(l.length===0||String(l)==="0")throw new Error("No answers");let f=l;if(f.length===0)throw new Error("No answers");return Tr.set(u,f),f}};function _A({provider:e,type:t,filter:r,cache:n,url:s,timeout:u,edns:i}){if(["IPv6","IP4P"].includes(t)&&["IP-API"].includes(e))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 ${e} \u4E0D\u652F\u6301 ${t}`);let{defaultTimeout:o}=x.read(Nt),l=u||o||8e3,f=["IPv6","IP4P"].includes(t)?"IPv6":"IPv4",d=bA[e];if(!d)throw new Error(`\u627E\u4E0D\u5230\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9: ${e}`);let E=i||"223.6.6.6";if(!Va(E))throw new Error("\u57DF\u540D\u89E3\u6790 EDNS \u5E94\u4E3A IP");return x.info(`Domain Resolver: [${t}] ${e} ${E||""} ${s||""}`),{name:"Resolve Domain Operator",func:async p=>{p.forEach((A,F)=>{!A["_no-resolve"]&&A["no-resolve"]&&(p[F]["_no-resolve"]=A["no-resolve"])});let h={},w=15,v=[...new Set(p.filter(A=>!Va(A.server)&&!A["_no-resolve"]).map(A=>A.server))],D=Math.ceil(v.length/w);for(let A=0;A<D;A++){let F=[];for(let S of v.splice(0,w))F.push(d(S,f,n==="disabled",l,E,s).then(B=>{h[S]=B,x.info(`Successfully resolved domain: ${S} \u279F ${B}`)}).catch(B=>{x.error(`Failed to resolve domain: ${S} with resolver [${e}]: ${B}`)}));await Promise.all(F)}return p.forEach(A=>{if(!A["_no-resolve"])if(h[A.server]){A._resolved_ips=h[A.server];let F=Array.isArray(h[A.server])?h[A.server][Math.floor(Math.random()*h[A.server].length)]:h[A.server];if(f==="IPv6"&&Ur(F)){try{F=new gf.Address6(F).correctForm()}catch(S){x.error(`Failed to parse IPv6 address: ${F}: ${S}`)}if(/^2001::[^:]+:[^:]+:[^:]+$/.test(F)){A._IP4P=F;let{server:S,port:B}=CB(F);S&&B?(A._domain=A.server,A.server=S,A.port=B,A.resolved=!0,A._IPv4=A.server,Va(A._IP)||(A._IP=A.server)):A.resolved||(A.resolved=!1)}else A._domain=A.server,A.server=F,A.resolved=!0,A[`_${f}`]=A.server,Va(A._IP)||(A._IP=A.server)}else A._domain=A.server,A.server=F,A.resolved=!0,A[`_${f}`]=A.server,Va(A._IP)||(A._IP=A.server)}else A.resolved||(A.resolved=!1)}),p.filter(A=>r==="removeFailed"?Va(A.server)||A["_no-resolve"]||A.resolved:r==="IPOnly"?Va(A.server):r==="IPv4Only"?Rr(A.server):r==="IPv6Only"?Ur(A.server):!0)}}}function Va(e){return Rr(e)||Ur(e)}_A.resolver=bA;function cd(e){var t=/^[\x00-\x7F]+$/;return t.test(e)}function BA(){return{name:"Useless Filter",func:e=>e.map(t=>{if(t.cipher&&!cd(t.cipher))return!1;if(t.password&&!cd(t.password))return!1;if(t.network){let r=t[`${t.network}-opts`]?.headers?.Host||t[`${t.network}-opts`]?.headers?.host;if(r=Array.isArray(r)?r:[r],r.some(n=>n&&!cd(n)))return!1}return!/网址|流量|时间|应急|过期|Bandwidth|expire/.test(t.name)})}}function DB(e){let t=e?.value||e;Array.isArray(t)||(t=[]);let r=e?.keep??!0,n={HK:"\u{1F1ED}\u{1F1F0}",TW:"\u{1F1F9}\u{1F1FC}",US:"\u{1F1FA}\u{1F1F8}",SG:"\u{1F1F8}\u{1F1EC}",JP:"\u{1F1EF}\u{1F1F5}",UK:"\u{1F1EC}\u{1F1E7}",DE:"\u{1F1E9}\u{1F1EA}",KR:"\u{1F1F0}\u{1F1F7}"};return{name:"Region Filter",func:s=>s.map(u=>{let i=zo(u.name),o=t.some(l=>n[l]===i);return r?o:!o})}}function yB({regex:e=[],keep:t=!0}){return{name:"Regex Filter",func:r=>r.map(n=>{let s=e.some(u=>fd(u).test(n.name));return t?s:!s})}}function fd(e,...t){return t=t.join(""),e.startsWith("(?i)")?(e=e.substring(4),new RegExp(e,"i"+t)):new RegExp(e,t)}function SB(e){let t=e?.value||e;Array.isArray(t)||(t=[]);let r=e?.keep??!0;return{name:"Type Filter",func:n=>n.map(s=>{let u=t.some(i=>s.type===i);return r?u:!u})}}function bB(e,t,r,n,s){return{name:"Script Filter",func:async u=>{let i=Qf(u.length,!0);return await async function(){i=sh("filter",e,r,s)(u,t,{source:n,...Ku})}(),i},nodeFunc:async u=>{let i=Qf(u.length,!0);return await async function(){i=sh("filter",`async function filter(input = []) {
let proxies = input
let list = []
const fn = async ($server) => {
${e}
}
for await (let $server of proxies) {
list.push(await fn($server))
}
return list
}`,r,s)(u,t,{source:n,...Ku})}(),i}}}var uh={"Useless Filter":BA,"Region Filter":DB,"Regex Filter":yB,"Type Filter":SB,"Script Filter":bB,"Conditional Filter":dB,"Quick Setting Operator":gB,"Flag Operator":mB,"Sort Operator":AB,"Regex Sort Operator":EB,"Regex Rename Operator":SA,"Regex Delete Operator":wB,"Script Operator":FB,"Handle Duplicate Operator":vB,"Resolve Domain Operator":_A};async function _B(e,t){let r=Qf(t.length,!0);try{r=await e.func(t)}catch(n){let s="",u=`${n.message??n}`;u.includes("$server is not defined")?s="":(x.error(`Cannot apply filter ${e.name}(function filter)! Reason: ${n}`),s=`\u6267\u884C function filter \u5931\u8D25 ${u}; `);try{r=await e.nodeFunc(t)}catch(i){x.error(`Cannot apply filter ${e.name}(shortcut script)! Reason: ${i}`);let o="",l=`${i.message??i}`;throw s&&l===u?(o="",s=`\u6267\u884C\u5931\u8D25 ${u}`):o=`\u6267\u884C\u5FEB\u6377\u8FC7\u6EE4\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u8FC7\u6EE4 ${s}${o}`)}}return t.filter((n,s)=>r[s])}async function BB(e,t){let r=$B(t);try{let n=await e.func(r);n&&(r=n)}catch(n){let s="",u=`${n.message??n}`;u.includes("$server is not defined")||u.includes("$content is not defined")||u.includes("$files is not defined")||r?.$files||r?.$content?s="":(x.error(`Cannot apply operator ${e.name}(function operator)! Reason: ${n}`),s=`\u6267\u884C function operator \u5931\u8D25 ${u}; `);try{let i=await e.nodeFunc(r);i&&(r=i)}catch(i){x.error(`Cannot apply operator ${e.name}(shortcut script)! Reason: ${i}`);let o="",l=`${i.message??i}`;throw s&&l===u?(o="",s=`\u6267\u884C\u5931\u8D25 ${u}`):o=`\u6267\u884C\u5FEB\u6377\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u64CD\u4F5C ${s}${o}`)}}return r}async function IA(e,t){if(e.name.indexOf("Filter")!==-1)return _B(e,t);if(e.name.indexOf("Operator")!==-1)return BB(e,t)}function IB(e){let t=e.length,r,n;for(;t!==0;)n=Math.floor(Math.random()*t),t-=1,r=e[t],e[t]=e[n],e[n]=r;return e}function $B(e){return JSON.parse(JSON.stringify(e))}function sh(name,script,$arguments,$options){let flowUtils={getFlowField:_o,getFlowHeaders:Cs,parseFlowHeaders:Pa,flowTransfer:Bc,validCheck:Af,getRmainingDays:Ef,normalizeFlowHeader:wf};return x.env.isLoon?new Function("$arguments","$options","$substore","lodash","$persistentStore","$httpClient","$notification","ProxyUtils","yaml","Buffer","b64d","b64e","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
return ${name}`)($arguments,$options,x,ld.default,$persistentStore,$httpClient,$notification,dr,dr.yaml,dr.Buffer,dr.Base64.decode,dr.Base64.encode,$c,flowUtils,ks,eval('typeof require !== "undefined"')?Da:void 0):new Function("$arguments","$options","$substore","lodash","ProxyUtils","yaml","Buffer","b64d","b64e","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
return ${name}`)($arguments,$options,x,ld.default,dr,dr.yaml,dr.Buffer,dr.Base64.decode,dr.Base64.encode,$c,flowUtils,ks,eval('typeof require !== "undefined"')?Da:void 0)}var $A=On(Df()),ft=class{constructor(t){this.proxy=t,this.output=[]}append(t){if(typeof t>"u")throw new Error("required field is missing");this.output.push(t)}appendIfPresent(t,r){ae(this.proxy,r)&&this.append(t)}toString(){return this.output.join("")}};function ae(e,t){let r=$A.default.get(e,t);return typeof r<"u"&&r!==null}var PB="Surge",Mi={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function Jo(){return{produce:(t,r,n={})=>{switch(t.name=t.name.replace(/=|,/g,""),t.ports&&(t.ports=String(t.ports)),t.type){case"ss":return RB(t,n["include-unsupported-proxy"]);case"trojan":return TB(t);case"vmess":return xB(t,n["include-unsupported-proxy"]);case"http":return kB(t);case"direct":return NB(t);case"socks5":return LB(t);case"snell":return UB(t);case"tuic":return HB(t);case"wireguard-surge":return MB(t);case"hysteria2":return qB(t);case"ssh":return OB(t)}if(n["include-unsupported-proxy"]&&t.type==="wireguard")return jB(t);throw new Error(`Platform ${PB} does not support proxy type: ${t.type}`)}}}function RB(e){let t=new ft(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),e.cipher||(e.cipher="none"),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","cast5-cfb","des-cfb","idea-cfb","rc2-cfb","seed-cfb","salsa20","chacha20","chacha20-ietf","none","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=Mi[e["ip-version"]]||e["ip-version"];if(t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,s=e["plugin-opts"].host,u=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),u){if(u<2)throw new Error(`shadow-tls version ${u} is not supported`);t.append(`,shadow-tls-version=${u}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}return t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function TB(e){let t=new ft(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),PA(t,e),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function xB(e,t){let r=new ft(e);r.append(`${e.name}=${e.type},${e.server},${e.port}`),r.appendIfPresent(`,username=${e.uuid}`,"uuid");let n=Mi[e["ip-version"]]||e["ip-version"];return r.appendIfPresent(`,ip-version=${n}`,"ip-version"),r.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),PA(r,e,t),ae(e,"aead")?r.append(`,vmess-aead=${e.aead}`):r.append(`,vmess-aead=${e.alterId===0}`),r.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),r.appendIfPresent(`,tls=${e.tls}`,"tls"),r.appendIfPresent(`,sni=${e.sni}`,"sni"),r.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),r.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),r.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),r.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),r.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),r.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),r.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),r.appendIfPresent(`,tos=${e.tos}`,"tos"),r.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),r.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(r.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),r.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),r.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),r.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),r.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),r.toString()}function OB(e){let t=new ft(e);t.append(`${e.name}=ssh,${e.server},${e.port}`),t.appendIfPresent(`,username="${e.username}"`,"username"),t.appendIfPresent(`,password="${e.password}"`,"password"),t.appendIfPresent(`,private-key=${e["keystore-private-key"]}`,"keystore-private-key"),t.appendIfPresent(`,idle-timeout=${e["idle-timeout"]}`,"idle-timeout"),t.appendIfPresent(`,server-fingerprint="${e["server-fingerprint"]}"`,"server-fingerprint");let r=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function kB(e){if(e.headers&&Object.keys(e.headers).length>0)throw new Error("headers is unsupported");let t=new ft(e),r=e.tls?"https":"http";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,username="${e.username}"`,"username"),t.appendIfPresent(`,password="${e.password}"`,"password");let n=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function NB(e){let t=new ft(e);t.append(`${e.name}=direct`);let n=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function LB(e){let t=new ft(e),r=e.tls?"socks5-tls":"socks5";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,username="${e.username}"`,"username"),t.appendIfPresent(`,password="${e.password}"`,"password");let n=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),e.tfo&&x.info("Option tfo is not supported by Surge, thus omitted"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function UB(e){let t=new ft(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,version=${e.version}`,"version"),t.appendIfPresent(`,psk=${e.psk}`,"psk");let r=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,obfs=${e["obfs-opts"]?.mode}`,"obfs-opts.mode"),t.appendIfPresent(`,obfs-host=${e["obfs-opts"]?.host}`,"obfs-opts.host"),t.appendIfPresent(`,obfs-uri=${e["obfs-opts"]?.path}`,"obfs-opts.path"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,reuse=${e.reuse}`,"reuse"),t.toString()}function HB(e){let t=new ft(e),r=e.type;(!e.token||e.token.length===0)&&(r="tuic-v5"),t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,uuid=${e.uuid}`,"uuid"),t.appendIfPresent(`,password="${e.password}"`,"password"),t.appendIfPresent(`,token=${e.token}`,"token"),t.appendIfPresent(`,alpn=${Array.isArray(e.alpn)?e.alpn[0]:e.alpn}`,"alpn"),ae(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let n=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${n}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn"),t.toString()}function jB(e){Array.isArray(e.peers)&&e.peers.length>0&&(e.server=e.peers[0].server,e.port=e.peers[0].port,e.ip=e.peers[0].ip,e.ipv6=e.peers[0].ipv6,e["public-key"]=e.peers[0]["public-key"],e["preshared-key"]=e.peers[0]["pre-shared-key"],e["allowed-ips"]=e.peers[0]["allowed-ips"],e.reserved=e.peers[0].reserved);let t=new ft(e);t.append(`# > WireGuard Proxy ${e.name}
# ${e.name}=wireguard`),e["section-name"]=tr(e["section-name"],e.name),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=Mi[e["ip-version"]]||e["ip-version"];t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.append(`
# > WireGuard Section ${e.name}
[WireGuard ${e["section-name"]}]
private-key = ${e["private-key"]}`),t.appendIfPresent(`
self-ip = ${e.ip}`,"ip"),t.appendIfPresent(`
self-ip-v6 = ${e.ipv6}`,"ipv6"),e.dns&&(Array.isArray(e.dns)&&(e.dns=e.dns.join(", ")),t.append(`
dns-server = ${e.dns}`)),t.appendIfPresent(`
mtu = ${e.mtu}`,"mtu"),r==="prefer-v6"&&t.append(`
prefer-ipv6 = true`);let n=Array.isArray(e["allowed-ips"])?e["allowed-ips"].join(","):e["allowed-ips"],s=Array.isArray(e.reserved)?e.reserved.join("/"):e.reserved,u=e["preshared-key"]??e["pre-shared-key"];u&&(u=`,preshared-key="${u}"`);let i={"public-key":e["public-key"],"allowed-ips":n?`"${n}"`:void 0,endpoint:`${e.server}:${e.port}`,keepalive:e["persistent-keepalive"]||e.keepalive,"client-id":s,"preshared-key":u};return t.append(`
peer = (${Object.keys(i).filter(o=>i[o]!=null).map(o=>`${o} = ${i[o]}`).join(", ")})`),t.toString()}function MB(e){let t=new ft(e);t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function qB(e){if(e.obfs||e["obfs-password"])throw new Error("obfs is unsupported");let t=new ft(e);t.append(`${e.name}=hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password"),ae(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let r=Mi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,download-bandwidth=${`${e.down}`.match(/\d+/)?.[0]||0}`,"down"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn"),t.toString()}function PA(e,t,r){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let n=t["ws-opts"].headers,s=Object.keys(n).map(u=>{let i=n[u];return["Host"].includes(u)&&(i=`"${i}"`),`${u}:${i}`}).join("|");Fs(s)&&e.append(`,ws-headers=${s}`)}}else if(r&&["http"].includes(t.network))x.info(`Include Unsupported Proxy: nework ${t.network} -> tcp`);else throw new Error(`network ${t.network} is unsupported`)}var KB={dual:"dual","v4-only":"ipv4","v6-only":"ipv6","prefer-v4":"ipv4-prefer","prefer-v6":"ipv6-prefer"};function Fi(){return{type:"ALL",produce:(r,n,s={})=>{let u=r.filter(i=>s["include-unsupported-proxy"]?!0:i.type==="snell"&&i.version>=4||["juicity"].includes(i.type)?!1:!(["ss"].includes(i.type)&&!["aes-128-ctr","aes-192-ctr","aes-256-ctr","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-ccm","aes-192-ccm","aes-256-ccm","aes-128-gcm-siv","aes-256-gcm-siv","chacha20-ietf","chacha20","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","chacha8-ietf-poly1305","xchacha8-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm","2022-blake3-chacha20-poly1305","lea-128-gcm","lea-192-gcm","lea-256-gcm","rabbit128-poly1305","aegis-128l","aegis-256","aez-384","deoxys-ii-256-128","rc4-md5","none"].includes(i.cipher))).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(ae(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo),(!i.token||i.token.length===0)&&!ae(i,"version")&&(i.version=5)):i.type==="hysteria"?(ae(i,"auth_str")&&!ae(i,"auth-str")&&(i["auth-str"]=i.auth_str),ae(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo)):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"?ae(i,"sni")&&(i.servername=i.sni,delete i.sni):i.type==="ss"&&ae(i,"shadow-tls-password")&&!ae(i,"plugin")&&(i.plugin="shadow-tls",i["plugin-opts"]={host:i["shadow-tls-sni"],password:i["shadow-tls-password"],version:i["shadow-tls-version"]},delete i["shadow-tls-password"],delete i["shadow-tls-sni"],delete i["shadow-tls-version"]),["vmess","vless"].includes(i.type)&&i.network==="http"){let o=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(o)&&(i["http-opts"].path=[o]);let l=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let o=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(o)&&(i["h2-opts"].path=o[0]);let l=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i.network==="ws"){let o=i["ws-opts"]?.path,l=/^(.*?)(?:\?ed=(\d+))?$/,[f,d="",E=""]=l.exec(o);i["ws-opts"].path=d,E!==""&&(i["ws-opts"]["early-data-header-name"]="Sec-WebSocket-Protocol",i["ws-opts"]["max-early-data"]=parseInt(E,10))}if(i["plugin-opts"]?.tls&&ae(i,"skip-cert-verify")&&(i["plugin-opts"]["skip-cert-verify"]=i["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(i.type)&&delete i.tls,i["tls-fingerprint"]&&(i.fingerprint=i["tls-fingerprint"]),delete i["tls-fingerprint"],i["underlying-proxy"]&&(i["dialer-proxy"]=i["underlying-proxy"]),delete i["underlying-proxy"],ae(i,"tls")&&typeof i.tls!="boolean"&&delete i.tls,delete i.subName,delete i.collectionName,delete i.id,delete i.resolved,delete i["no-resolve"],n!=="internal"||s["delete-underscore-fields"])for(let o in i)(i[o]==null||/^_/i.test(o))&&delete i[o];return["grpc"].includes(i.network)&&i[`${i.network}-opts`]&&(delete i[`${i.network}-opts`]["_grpc-type"],delete i[`${i.network}-opts`]["_grpc-authority"]),i["ip-version"]&&(i["ip-version"]=KB[i["ip-version"]]||i["ip-version"]),i});return n==="internal"?u:`proxies:
`+u.map(i=>" - "+JSON.stringify(i)+`
`).join("")}}}var RA="SurgeMac",VB=Jo();function hd(){return{produce:(t,r,n={})=>{switch(t.type){case"external":return TA(t);default:try{return VB.produce(t,r,n)}catch{if(n.useMihomoExternal)return x.log(`${t.name} is not supported on ${RA}, try to use Mihomo(SurgeMac - External Proxy Program) instead`),GB(t,r,n);throw new Error("Surge for macOS \u53EF\u624B\u52A8\u6307\u5B9A\u94FE\u63A5\u53C2\u6570 target=SurgeMac \u6216\u5728 \u540C\u6B65\u914D\u7F6E \u4E2D\u6307\u5B9A SurgeMac \u6765\u542F\u7528 mihomo \u652F\u63F4 Surge \u672C\u8EAB\u4E0D\u652F\u6301\u7684\u534F\u8BAE")}}}}}function TA(e){let t=new ft(e);if(!e.exec||!e["local-port"])throw new Error(`${e.type}: exec and local-port are required`);return t.append(`${e.name}=external,exec="${e.exec}",local-port=${e["local-port"]}`),Array.isArray(e.args)&&e.args.map(r=>{t.append(`,args="${r}"`)}),Array.isArray(e.addresses)&&e.addresses.map(r=>{t.append(`,addresses=${r}`)}),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.toString()}function GB(e,t,r){let n=Fi().produce([e],"internal")?.[0];if(n){let s=r?.localPort||e._localPort||65535,u=!["ipv4","v4-only"].includes(e["ip-version"]),i={name:e.name,type:"external",exec:e._exec||"/usr/local/bin/mihomo","local-port":s,args:["-config",dt.encode(JSON.stringify({"mixed-port":s,ipv6:u,mode:"global",dns:{enable:!0,ipv6:u,"default-nameserver":r?.defaultNameserver||e._defaultNameserver||["180.76.76.76","52.80.52.52","119.28.28.28","223.6.6.6"],nameserver:r?.nameserver||e._nameserver||["https://doh.pub/dns-query","https://dns.alidns.com/dns-query","https://doh-pure.onedns.net/dns-query"]},proxies:[{...n,name:"proxy"}],"proxy-groups":[{name:"GLOBAL",type:"select",proxies:["proxy"]}]}))],addresses:[]};return zB(e.server)?i.addresses.push(e.server):x.log(`Platform ${RA}, proxy type ${e.type}: addresses should be an IP address, but got ${e.server}`),r.localPort=s-1,TA(i)}}function zB(e){return Rr(e)||Ur(e)}function pd(){return{type:"ALL",produce:(r,n,s={})=>{let u=r.filter(i=>s["include-unsupported-proxy"]?!0:!["ss","ssr","vmess","vless","socks5","http","snell","trojan","wireguard"].includes(i.type)||i.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305"].includes(i.cipher)||i.type==="snell"&&i.version>=4||i.type==="vless"&&(typeof i.flow<"u"||i["reality-opts"])?!1:i["underlying-proxy"]||i["dialer-proxy"]?(x.error(`Clash \u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${i.name}`),!1):!0).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(i.cipher)&&(i.cipher="auto")):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"&&ae(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let o=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(o)&&(i["http-opts"].path=[o]);let l=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let o=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(o)&&(i["h2-opts"].path=o[0]);let l=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i.network==="ws"){let o=i["ws-opts"]?.path,l=/^(.*?)(?:\?ed=(\d+))?$/,[f,d="",E=""]=l.exec(o);i["ws-opts"].path=d,E!==""&&(i["ws-opts"]["early-data-header-name"]="Sec-WebSocket-Protocol",i["ws-opts"]["max-early-data"]=parseInt(E,10))}if(i["plugin-opts"]?.tls&&ae(i,"skip-cert-verify")&&(i["plugin-opts"]["skip-cert-verify"]=i["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(i.type)&&delete i.tls,i["tls-fingerprint"]&&(i.fingerprint=i["tls-fingerprint"]),delete i["tls-fingerprint"],ae(i,"tls")&&typeof i.tls!="boolean"&&delete i.tls,delete i.subName,delete i.collectionName,delete i.id,delete i.resolved,delete i["no-resolve"],n!=="internal")for(let o in i)(i[o]==null||/^_/i.test(o))&&delete i[o];return["grpc"].includes(i.network)&&i[`${i.network}-opts`]&&(delete i[`${i.network}-opts`]["_grpc-type"],delete i[`${i.network}-opts`]["_grpc-authority"]),i});return n==="internal"?u:`proxies:
`+u.map(i=>" - "+JSON.stringify(i)+`
`).join("")}}}function ah(){return{type:"ALL",produce:(r,n,s={})=>{let u=r.filter(i=>!["ss","ssr","vmess","socks5","http","snell","trojan","tuic","vless","wireguard","hysteria","hysteria2","ssh","juicity"].includes(i.type)||i.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(i.cipher)||i.type==="snell"&&i.version>=4||i.type==="vless"&&i["reality-opts"]&&!["xtls-rprx-vision"].includes(i.flow)?!1:i["underlying-proxy"]||i["dialer-proxy"]?(x.error(`Stash \u6682\u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${i.name}. \u8BF7\u4F7F\u7528 \u4EE3\u7406\u7684\u8F6C\u53D1\u94FE https://stash.wiki/proxy-protocols/proxy-groups#relay`),!1):!0).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(ae(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),(!i.token||i.token.length===0)&&!ae(i,"version")&&(i.version=5)):i.type==="hysteria"?(ae(i,"auth_str")&&!ae(i,"auth-str")&&(i["auth-str"]=i.auth_str),ae(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),ae(i,"down")&&!ae(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),ae(i,"up")&&!ae(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),ae(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),ae(i,"up-speed")&&(i["up-speed"]=`${i["up-speed"]}`.match(/\d+/)?.[0]||0)):i.type==="hysteria2"?(ae(i,"password")&&!ae(i,"auth")&&(i.auth=i.password,delete i.password),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),ae(i,"down")&&!ae(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),ae(i,"up")&&!ae(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),ae(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),ae(i,"up-speed")&&(i["up-speed"]=`${i["up-speed"]}`.match(/\d+/)?.[0]||0)):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"&&ae(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let o=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(o)&&(i["http-opts"].path=[o]);let l=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let o=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(o)&&(i["h2-opts"].path=o[0]);let l=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i.network==="ws"){let o=i["ws-opts"]?.path,l=/^(.*?)(?:\?ed=(\d+))?$/,[f,d="",E=""]=l.exec(o);i["ws-opts"].path=d,E!==""&&(i["ws-opts"]["early-data-header-name"]="Sec-WebSocket-Protocol",i["ws-opts"]["max-early-data"]=parseInt(E,10))}if(i["plugin-opts"]?.tls&&ae(i,"skip-cert-verify")&&(i["plugin-opts"]["skip-cert-verify"]=i["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(i.type)&&delete i.tls,i["tls-fingerprint"]&&(i["server-cert-fingerprint"]=i["tls-fingerprint"]),delete i["tls-fingerprint"],ae(i,"tls")&&typeof i.tls!="boolean"&&delete i.tls,i["test-url"]&&(i["benchmark-url"]=i["test-url"],delete i["test-url"]),i["test-timeout"]&&(i["benchmark-timeout"]=i["test-timeout"],delete i["test-timeout"]),delete i.subName,delete i.collectionName,delete i.id,delete i.resolved,delete i["no-resolve"],n!=="internal")for(let o in i)(i[o]==null||/^_/i.test(o))&&delete i[o];return["grpc"].includes(i.network)&&i[`${i.network}-opts`]&&(delete i[`${i.network}-opts`]["_grpc-type"],delete i[`${i.network}-opts`]["_grpc-authority"]),i});return n==="internal"?u:`proxies:
`+u.map(i=>" - "+JSON.stringify(i)+`
`).join("")}}}var YB="Loon",Cu={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function dd(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return WB(t);case"ssr":return JB(t);case"trojan":return XB(t);case"vmess":return ZB(t,n["include-unsupported-proxy"]);case"vless":return QB(t,n["include-unsupported-proxy"]);case"http":return eI(t);case"socks5":return tI(t);case"wireguard":return rI(t);case"hysteria2":return nI(t)}throw new Error(`Platform ${YB} does not support proxy type: ${t.type}`)}}}function WB(e){let t=new ft(e);if(!["rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`${e.name}=shadowsocks,${e.server},${e.port},${e.cipher},"${e.password}"`),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs-name=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,s=e["plugin-opts"].host,u=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),u){if(u<2)throw new Error(`shadow-tls version ${u} is not supported`);t.append(`,shadow-tls-version=${u}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function JB(e){let t=new ft(e);if(t.append(`${e.name}=shadowsocksr,${e.server},${e.port},${e.cipher},"${e.password}"`),t.append(`,protocol=${e.protocol}`),t.appendIfPresent(`,protocol-param=${e["protocol-param"]}`,"protocol-param"),t.appendIfPresent(`,obfs=${e.obfs}`,"obfs"),t.appendIfPresent(`,obfs-param=${e["obfs-param"]}`,"obfs-param"),ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,s=e["plugin-opts"].host,u=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),u){if(u<2)throw new Error(`shadow-tls version ${u} is not supported`);t.append(`,shadow-tls-version=${u}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function XB(e){let t=new ft(e);if(t.append(`${e.name}=trojan,${e.server},${e.port},"${e.password}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")t.append(",transport=ws"),t.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),t.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else throw new Error(`network ${e.network} is unsupported`);t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tls-name=${e.sni}`,"sni"),t.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function ZB(e){let t=!!e["reality-opts"],r=new ft(e);if(r.append(`${e.name}=vmess,${e.server},${e.port},${e.cipher},"${e.uuid}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")r.append(",transport=ws"),r.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),r.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else if(e.network==="http"){r.append(",transport=http");let s=e["http-opts"]?.path,u=e["http-opts"]?.headers?.Host;r.appendIfPresent(`,path=${Array.isArray(s)?s[0]:s}`,"http-opts.path"),r.appendIfPresent(`,host=${Array.isArray(u)?u[0]:u}`,"http-opts.headers.Host")}else throw new Error(`network ${e.network} is unsupported`);else r.append(",transport=tcp");r.appendIfPresent(`,over-tls=${e.tls}`,"tls"),r.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t?(r.appendIfPresent(`,sni=${e.sni}`,"sni"),r.appendIfPresent(`,public-key="${e["reality-opts"]["public-key"]}"`,"reality-opts.public-key"),r.appendIfPresent(`,short-id=${e["reality-opts"]["short-id"]}`,"reality-opts.short-id")):(r.appendIfPresent(`,tls-name=${e.sni}`,"sni"),r.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),r.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256")),ae(e,"aead")?r.append(`,alterId=${e.aead?0:1}`):r.append(`,alterId=${e.alterId}`),r.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?r.append(",block-quic=true"):e["block-quic"]==="off"&&r.append(",block-quic=false"),e.udp&&r.append(",udp=true");let n=Cu[e["ip-version"]]||e["ip-version"];return r.appendIfPresent(`,ip-mode=${n}`,"ip-version"),r.toString()}function QB(e){let t=!1,r=!!e["reality-opts"];if(typeof e.flow<"u")if(["xtls-rprx-vision"].includes(e.flow))t=!0;else throw new Error(`VLESS flow(${e.flow}) is not supported`);let n=new ft(e);if(n.append(`${e.name}=vless,${e.server},${e.port},"${e.uuid}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")n.append(",transport=ws"),n.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),n.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else if(e.network==="http"){n.append(",transport=http");let u=e["http-opts"]?.path,i=e["http-opts"]?.headers?.Host;n.appendIfPresent(`,path=${Array.isArray(u)?u[0]:u}`,"http-opts.path"),n.appendIfPresent(`,host=${Array.isArray(i)?i[0]:i}`,"http-opts.headers.Host")}else throw new Error(`network ${e.network} is unsupported`);else n.append(",transport=tcp");n.appendIfPresent(`,over-tls=${e.tls}`,"tls"),n.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t&&n.appendIfPresent(`,flow=${e.flow}`,"flow"),r?(n.appendIfPresent(`,sni=${e.sni}`,"sni"),n.appendIfPresent(`,public-key="${e["reality-opts"]["public-key"]}"`,"reality-opts.public-key"),n.appendIfPresent(`,short-id=${e["reality-opts"]["short-id"]}`,"reality-opts.short-id")):(n.appendIfPresent(`,tls-name=${e.sni}`,"sni"),n.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256")),n.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?n.append(",block-quic=true"):e["block-quic"]==="off"&&n.append(",block-quic=false"),e.udp&&n.append(",udp=true");let s=Cu[e["ip-version"]]||e["ip-version"];return n.appendIfPresent(`,ip-mode=${s}`,"ip-version"),n.toString()}function eI(e){let t=new ft(e),r=e.tls?"https":"http";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false");let n=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${n}`,"ip-version"),t.toString()}function tI(e){let t=new ft(e);t.append(`${e.name}=socks5,${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,over-tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function rI(e){Array.isArray(e.peers)&&e.peers.length>0&&(e.server=e.peers[0].server,e.port=e.peers[0].port,e.ip=e.peers[0].ip,e.ipv6=e.peers[0].ipv6,e["public-key"]=e.peers[0]["public-key"],e["preshared-key"]=e.peers[0]["pre-shared-key"],e["allowed-ips"]=e.peers[0]["allowed-ips"],e.reserved=e.peers[0].reserved);let t=new ft(e);if(t.append(`${e.name}=wireguard`),t.appendIfPresent(`,interface-ip=${e.ip}`,"ip"),t.appendIfPresent(`,interface-ipv6=${e.ipv6}`,"ipv6"),t.appendIfPresent(`,private-key="${e["private-key"]}"`,"private-key"),t.appendIfPresent(`,mtu=${e.mtu}`,"mtu"),e.dns&&Array.isArray(e.dns)){e.dnsv6=e.dns.find(o=>Ur(o));let i=e.dns.find(o=>Rr(o));i||(i=e.dns.find(o=>!Rr(o)&&!Ur(o))),e.dns=i}t.appendIfPresent(`,dns=${e.dns}`,"dns"),t.appendIfPresent(`,dnsv6=${e.dnsv6}`,"dnsv6"),t.appendIfPresent(`,keepalive=${e["persistent-keepalive"]}`,"persistent-keepalive"),t.appendIfPresent(`,keepalive=${e.keepalive}`,"keepalive");let r=Array.isArray(e["allowed-ips"])?e["allowed-ips"].join(","):e["allowed-ips"],n=Array.isArray(e.reserved)?e.reserved.join(","):e.reserved;n&&(n=`,reserved=[${n}]`);let s=e["preshared-key"]??e["pre-shared-key"];s&&(s=`,preshared-key="${s}"`),t.append(`,peers=[{public-key="${e["public-key"]}",allowed-ips="${r??"0.0.0.0/0,::/0"}",endpoint=${e.server}:${e.port}${n??""}${s??""}}]`);let u=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${u}`,"ip-version"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),t.toString()}function nI(e){if(e["obfs-password"]&&e.obfs!="salamander")throw new Error("only salamander obfs is supported");let t=new ft(e);t.append(`${e.name}=Hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,"${e.password}"`,"password"),t.appendIfPresent(`,tls-name=${e.sni}`,"sni"),t.appendIfPresent(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),t.appendIfPresent(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),e["obfs-password"]&&e.obfs=="salamander"&&t.append(`,salamander-password=${e["obfs-password"]}`),t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true"),t.appendIfPresent(`,download-bandwidth=${`${e.down}`.match(/\d+/)?.[0]||0}`,"down"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn");let r=Cu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function Xo(){return{type:"SINGLE",produce:r=>{let n="";delete r.subName,delete r.collectionName,delete r.id,delete r.resolved,delete r["no-resolve"];for(let s in r)r[s]==null&&delete r[s];switch(["trojan","tuic","hysteria","hysteria2","juicity"].includes(r.type)&&delete r.tls,!["vmess"].includes(r.type)&&r.server&&Ur(r.server)&&(r.server=`[${r.server}]`),r.type){case"socks5":n=`socks://${encodeURIComponent(dt.encode(`${r.username??""}:${r.password??""}`))}@${r.server}:${r.port}#${r.name}`;break;case"ss":let s=`${r.cipher}:${r.password}`;if(n=`ss://${r.cipher?.startsWith("2022-blake3-")?`${encodeURIComponent(r.cipher)}:${encodeURIComponent(r.password)}`:dt.encode(s)}@${r.server}:${r.port}${r.plugin?"/":""}`,r.plugin){n+="?plugin=";let ce=r["plugin-opts"];switch(r.plugin){case"obfs":n+=encodeURIComponent(`simple-obfs;obfs=${ce.mode}${ce.host?";obfs-host="+ce.host:""}`);break;case"v2ray-plugin":n+=encodeURIComponent(`v2ray-plugin;obfs=${ce.mode}${ce.host?";obfs-host"+ce.host:""}${ce.tls?";tls":""}`);break;case"shadow-tls":n+=encodeURIComponent(`shadow-tls;host=${ce.host};password=${ce.password};version=${ce.version}`);break;default:throw new Error(`Unsupported plugin option: ${r.plugin}`)}}r["udp-over-tcp"]&&(n=`${n}${r.plugin?"&":"?"}uot=1`),r.tfo&&(n=`${n}${r.plugin||r["udp-over-tcp"]?"&":"?"}tfo=1`),n+=`#${encodeURIComponent(r.name)}`;break;case"ssr":n=`${r.server}:${r.port}:${r.protocol}:${r.cipher}:${r.obfs}:${dt.encode(r.password)}/`,n+=`?remarks=${dt.encode(r.name)}${r["obfs-param"]?"&obfsparam="+dt.encode(r["obfs-param"]):""}${r["protocol-param"]?"&protocolparam="+dt.encode(r["protocol-param"]):""}`,n="ssr://"+dt.encode(n);break;case"vmess":let u="",i=r.network||"tcp";if(r.network==="http"?(i="tcp",u="http"):r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(i="httpupgrade"),n={v:"2",ps:r.name,add:r.server,port:`${r.port}`,id:r.uuid,aid:`${r.alterId||0}`,scy:r.cipher,net:i,type:u,tls:r.tls?"tls":"",alpn:Array.isArray(r.alpn)?r.alpn.join(","):r.alpn,fp:r["client-fingerprint"]},r.tls&&r.sni&&(n.sni=r.sni),r.network){let ce=r[`${r.network}-opts`]?.path,Ie=r[`${r.network}-opts`]?.headers?.Host;["grpc"].includes(r.network)?(n.path=r[`${r.network}-opts`]?.["grpc-service-name"],n.type=r[`${r.network}-opts`]?.["_grpc-type"]||"gun",n.host=r[`${r.network}-opts`]?.["_grpc-authority"]):["kcp","quic"].includes(r.network)?(n.type=r[`${r.network}-opts`]?.[`_${r.network}-type`]||"none",n.host=r[`${r.network}-opts`]?.[`_${r.network}-host`],n.path=r[`${r.network}-opts`]?.[`_${r.network}-path`]):(ce&&(n.path=Array.isArray(ce)?ce[0]:ce),Ie&&(n.host=Array.isArray(Ie)?Ie[0]:Ie))}n="vmess://"+dt.encode(JSON.stringify(n));break;case"vless":let o="none",l=r["reality-opts"],f="",d="",E="";if(l){o="reality";let ce=r["reality-opts"]?.["public-key"];ce&&(d=`&pbk=${encodeURIComponent(ce)}`);let Ie=r["reality-opts"]?.["short-id"];Ie&&(f=`&sid=${encodeURIComponent(Ie)}`);let Me=r["reality-opts"]?.["_spider-x"];Me&&(E=`&spx=${encodeURIComponent(Me)}`)}else r.tls&&(o="tls");let p="";r.alpn&&(p=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let h="";r["skip-cert-verify"]&&(h="&allowInsecure=1");let w="";r.sni&&(w=`&sni=${encodeURIComponent(r.sni)}`);let v="";r["client-fingerprint"]&&(v=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let D="";r.flow&&(D=`&flow=${encodeURIComponent(r.flow)}`);let A="";r._extra&&(A=`&extra=${encodeURIComponent(r._extra)}`);let F="";r._mode&&(F=`&mode=${encodeURIComponent(r._mode)}`);let S=r.network;r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(S="httpupgrade");let B=`&type=${encodeURIComponent(S)}`;if(["grpc"].includes(r.network)){B+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`;let ce=r[`${r.network}-opts`]?.["_grpc-authority"];ce&&(B+=`&authority=${encodeURIComponent(ce)}`)}let _=r[`${r.network}-opts`]?.[`${r.network}-service-name`],K=r[`${r.network}-opts`]?.path,G=r[`${r.network}-opts`]?.headers?.Host;K&&(B+=`&path=${encodeURIComponent(Array.isArray(K)?K[0]:K)}`),G&&(B+=`&host=${encodeURIComponent(Array.isArray(G)?G[0]:G)}`),_&&(B+=`&serviceName=${encodeURIComponent(_)}`),r.network==="kcp"&&(r.seed&&(B+=`&seed=${encodeURIComponent(r.seed)}`),r.headerType&&(B+=`&headerType=${encodeURIComponent(r.headerType)}`)),n=`vless://${r.uuid}@${r.server}:${r.port}?security=${encodeURIComponent(o)}${B}${p}${h}${w}${v}${D}${f}${E}${d}${F}${A}#${encodeURIComponent(r.name)}`;break;case"trojan":let b="";if(r.network){let ce=r.network;if(r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(ce="httpupgrade"),b=`&type=${encodeURIComponent(ce)}`,["grpc"].includes(r.network)){let _r=r[`${r.network}-opts`]?.[`${r.network}-service-name`],Kt=r[`${r.network}-opts`]?.["_grpc-authority"];_r&&(b+=`&serviceName=${encodeURIComponent(_r)}`),Kt&&(b+=`&authority=${encodeURIComponent(Kt)}`),b+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`}let Ie=r[`${r.network}-opts`]?.path,Me=r[`${r.network}-opts`]?.headers?.Host;Ie&&(b+=`&path=${encodeURIComponent(Array.isArray(Ie)?Ie[0]:Ie)}`),Me&&(b+=`&host=${encodeURIComponent(Array.isArray(Me)?Me[0]:Me)}`)}let P="";r["client-fingerprint"]&&(P=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let L="";r.alpn&&(L=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let j=r["reality-opts"],V="",W="",q="",z="",J="",se="";if(j){z="&security=reality";let ce=r["reality-opts"]?.["public-key"];ce&&(W=`&pbk=${encodeURIComponent(ce)}`);let Ie=r["reality-opts"]?.["short-id"];Ie&&(V=`&sid=${encodeURIComponent(Ie)}`);let Me=r["reality-opts"]?.["_spider-x"];Me&&(q=`&spx=${encodeURIComponent(Me)}`),r._extra&&(se=`&extra=${encodeURIComponent(r._extra)}`),r._mode&&(J=`&mode=${encodeURIComponent(r._mode)}`)}n=`trojan://${r.password}@${r.server}:${r.port}?sni=${encodeURIComponent(r.sni||r.server)}${r["skip-cert-verify"]?"&allowInsecure=1":""}${b}${L}${P}${z}${V}${W}${q}${J}${se}#${encodeURIComponent(r.name)}`;break;case"hysteria2":let ye=[];r["hop-interval"]&&ye.push(`hop-interval=${r["hop-interval"]}`),r.keepalive&&ye.push(`keepalive=${r.keepalive}`),r["skip-cert-verify"]&&ye.push("insecure=1"),r.obfs&&(ye.push(`obfs=${encodeURIComponent(r.obfs)}`),r["obfs-password"]&&ye.push(`obfs-password=${encodeURIComponent(r["obfs-password"])}`)),r.sni&&ye.push(`sni=${encodeURIComponent(r.sni)}`),r.ports&&ye.push(`mport=${r.ports}`),r["tls-fingerprint"]&&ye.push(`pinSHA256=${encodeURIComponent(r["tls-fingerprint"])}`),r.tfo&&ye.push("fastopen=1"),n=`hysteria2://${encodeURIComponent(r.password)}@${r.server}:${r.port}?${ye.join("&")}#${encodeURIComponent(r.name)}`;break;case"hysteria":let Ce=[];Object.keys(r).forEach(ce=>{if(!["name","type","server","port"].includes(ce)){let Ie=ce.replace(/-/,"_");["alpn"].includes(ce)?r[ce]&&Ce.push(`${Ie}=${encodeURIComponent(Array.isArray(r[ce])?r[ce][0]:r[ce])}`):["skip-cert-verify"].includes(ce)?r[ce]&&Ce.push("insecure=1"):["tfo","fast-open"].includes(ce)?r[ce]&&!Ce.includes("fastopen=1")&&Ce.push("fastopen=1"):["ports"].includes(ce)?Ce.push(`mport=${r[ce]}`):["auth-str"].includes(ce)?Ce.push(`auth=${r[ce]}`):["up"].includes(ce)?Ce.push(`upmbps=${r[ce]}`):["down"].includes(ce)?Ce.push(`downmbps=${r[ce]}`):["_obfs"].includes(ce)?Ce.push(`obfs=${r[ce]}`):["obfs"].includes(ce)?Ce.push(`obfsParam=${r[ce]}`):["sni"].includes(ce)?Ce.push(`peer=${r[ce]}`):r[ce]&&!/^_/i.test(ce)&&Ce.push(`${Ie}=${encodeURIComponent(r[ce])}`)}}),n=`hysteria://${r.server}:${r.port}?${Ce.join("&")}#${encodeURIComponent(r.name)}`;break;case"tuic":if(!r.token||r.token.length===0){let ce=[];Object.keys(r).forEach(Ie=>{if(!["name","type","uuid","password","server","port","tls"].includes(Ie)){let Me=Ie.replace(/-/,"_");["alpn"].includes(Ie)?r[Ie]&&ce.push(`${Me}=${encodeURIComponent(Array.isArray(r[Ie])?r[Ie][0]:r[Ie])}`):["skip-cert-verify"].includes(Ie)?r[Ie]&&ce.push("allow_insecure=1"):["tfo","fast-open"].includes(Ie)?r[Ie]&&!ce.includes("fast_open=1")&&ce.push("fast_open=1"):["disable-sni","reduce-rtt"].includes(Ie)&&r[Ie]?ce.push(`${Me.replace(/-/g,"_")}=1`):["congestion-controller"].includes(Ie)?ce.push(`congestion_control=${r[Ie]}`):r[Ie]&&!/^_/i.test(Ie)&&ce.push(`${Me.replace(/-/g,"_")}=${encodeURIComponent(r[Ie])}`)}}),n=`tuic://${encodeURIComponent(r.uuid)}:${encodeURIComponent(r.password)}@${r.server}:${r.port}?${ce.join("&")}#${encodeURIComponent(r.name)}`}break;case"anytls":let Pe=[];Object.keys(r).forEach(ce=>{if(!["name","type","password","server","port","tls"].includes(ce)){let Ie=ce.replace(/-/,"_");["alpn"].includes(ce)?r[ce]&&Pe.push(`${Ie}=${encodeURIComponent(Array.isArray(r[ce])?r[ce][0]:r[ce])}`):["skip-cert-verify"].includes(ce)?r[ce]&&Pe.push("insecure=1"):["udp"].includes(ce)?r[ce]&&Pe.push("udp=1"):r[ce]&&!/^_/i.test(ce)&&Pe.push(`${Ie.replace(/-/g,"_")}=${encodeURIComponent(r[ce])}`)}}),n=`anytls://${encodeURIComponent(r.password)}@${r.server}:${r.port}/?${Pe.join("&")}#${encodeURIComponent(r.name)}`;break;case"wireguard":let Xe=[];Object.keys(r).forEach(ce=>{["name","type","server","port","ip","ipv6","private-key"].includes(ce)||(["public-key"].includes(ce)?Xe.push(`publickey=${r[ce]}`):["udp"].includes(ce)?r[ce]&&Xe.push(`${ce}=1`):r[ce]&&!/^_/i.test(ce)&&Xe.push(`${ce}=${encodeURIComponent(r[ce])}`))}),r.ip&&r.ipv6?Xe.push(`address=${r.ip}/32,${r.ipv6}/128`):r.ip?Xe.push(`address=${r.ip}/32`):r.ipv6&&Xe.push(`address=${r.ipv6}/128`),n=`wireguard://${encodeURIComponent(r["private-key"])}@${r.server}:${r.port}/?${Xe.join("&")}#${encodeURIComponent(r.name)}`;break}return n}}}var iI=Xo();function Yc(){return{type:"ALL",produce:r=>{let n=[];return r.map(s=>{try{n.push(iI.produce(s))}catch(u){x.error(`Cannot produce proxy: ${JSON.stringify(s,null,2)}
Reason: ${u}`)}}),dt.encode(n.join(`
`))}}}var sI="QX";function Wc(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return uI(t);case"ssr":return aI(t);case"trojan":return oI(t);case"vmess":return cI(t);case"http":return fI(t);case"socks5":return hI(t);case"vless":return lI(t)}throw new Error(`Platform ${sI} does not support proxy type: ${t.type}`)}}}function uI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(e.cipher||(e.cipher="none"),!["none","rc4-md5","rc4-md5-6","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","cast5-cfb","des-cfb","rc2-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(r(`shadowsocks=${e.server}:${e.port}`),r(`,method=${e.cipher}`),r(`,password=${e.password}`),Ci(e)&&(e.tls=!0),ae(e,"plugin")){if(e.plugin==="obfs"){let s=e["plugin-opts"];r(`,obfs=${s.mode}`)}else if(e.plugin==="v2ray-plugin"&&e["plugin-opts"].mode==="websocket")e["plugin-opts"].tls?r(",obfs=wss"):r(",obfs=ws");else throw new Error("plugin is not supported");n(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),n(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path")}return Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),e._ssr_python_uot?r(",udp-over-tcp=true"):e["udp-over-tcp"]&&(!e["udp-over-tcp-version"]||e["udp-over-tcp-version"]===1?r(",udp-over-tcp=sp.v1"):e["udp-over-tcp-version"]===2&&r(",udp-over-tcp=sp.v2")),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function aI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`shadowsocks=${e.server}:${e.port}`),r(`,method=${e.cipher}`),r(`,password=${e.password}`),r(`,ssr-protocol=${e.protocol}`),n(`,ssr-protocol-param=${e["protocol-param"]}`,"protocol-param"),n(`,obfs=${e.obfs}`,"obfs"),n(`,obfs-host=${e["obfs-param"]}`,"obfs-param"),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function oI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`trojan=${e.server}:${e.port}`),r(`,password=${e.password}`),ae(e,"network"))if(e.network==="ws")Ci(e)?r(",obfs=wss"):r(",obfs=ws"),n(`,obfs-uri=${e["ws-opts"]?.path}`,"ws-opts.path"),n(`,obfs-host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else throw new Error(`network ${e.network} is unsupported`);return e.network!=="ws"&&Ci(e)&&r(",over-tls=true"),Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function cI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);r(`vmess=${e.server}:${e.port}`);let s;if(e.cipher==="auto"?s="chacha20-ietf-poly1305":s=e.cipher,r(`,method=${s}`),r(`,password=${e.uuid}`),Ci(e)&&(e.tls=!0),ae(e,"network")){if(e.network==="ws")e.tls?r(",obfs=wss"):r(",obfs=ws");else if(e.network==="http")r(",obfs=http");else throw new Error(`network ${e.network} is unsupported`);let u=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(u)?u[0]:u}`,`${e.network}-opts.path`),n(`,obfs-host=${Array.isArray(i)?i[0]:i}`,`${e.network}-opts.headers.Host`)}else e.tls&&r(",obfs=over-tls");return Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),ae(e,"aead")?r(`,aead=${e.aead}`):r(`,aead=${e.alterId===0}`),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function lI(e){if(typeof e.flow<"u"||e["reality-opts"])throw new Error("VLESS XTLS/REALITY is not supported");let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`vless=${e.server}:${e.port}`),r(",method=none"),r(`,password=${e.uuid}`),Ci(e)&&(e.tls=!0),ae(e,"network")){if(e.network==="ws")e.tls?r(",obfs=wss"):r(",obfs=ws");else if(e.network==="http")r(",obfs=http");else if(["tcp"].includes(e.network))e.tls&&r(",obfs=over-tls");else if(!["tcp"].includes(e.network))throw new Error(`network ${e.network} is unsupported`);let u=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(u)?u[0]:u}`,`${e.network}-opts.path`),n(`,obfs-host=${Array.isArray(i)?i[0]:i}`,`${e.network}-opts.headers.Host`)}else e.tls&&r(",obfs=over-tls");return Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function fI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`http=${e.server}:${e.port}`),n(`,username=${e.username}`,"username"),n(`,password=${e.password}`,"password"),Ci(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function hI(e){let t=new ft(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`socks5=${e.server}:${e.port}`),n(`,username=${e.username}`,"username"),n(`,password=${e.password}`,"password"),Ci(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),Ci(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function Ci(e){return e.tls}function Jc(){return{type:"ALL",produce:(r,n,s={})=>{let u=r.filter(i=>s["include-unsupported-proxy"]?!0:i.type==="snell"&&i.version>=4?!1:!["mieru"].includes(i.type)).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(ae(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo),(!i.token||i.token.length===0)&&!ae(i,"version")&&(i.version=5)):i.type==="hysteria"?(ae(i,"auth_str")&&!ae(i,"auth-str")&&(i["auth-str"]=i.auth_str),ae(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo)):i.type==="hysteria2"?(i["obfs-password"]&&i.obfs=="salamander"&&(i.obfs=i["obfs-password"],delete i["obfs-password"]),ae(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo)):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"?ae(i,"sni")&&(i.servername=i.sni,delete i.sni):i.type==="ss"&&ae(i,"shadow-tls-password")&&!ae(i,"plugin")&&(i.plugin="shadow-tls",i["plugin-opts"]={host:i["shadow-tls-sni"],password:i["shadow-tls-password"],version:i["shadow-tls-version"]},delete i["shadow-tls-password"],delete i["shadow-tls-sni"],delete i["shadow-tls-version"]),["vmess","vless"].includes(i.type)&&i.network==="http"){let o=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(o)&&(i["http-opts"].path=[o]);let l=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let o=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(o)&&(i["h2-opts"].path=o[0]);let l=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i.network==="ws"){let o=i["ws-opts"]?.path,l=/^(.*?)(?:\?ed=(\d+))?$/,[f,d="",E=""]=l.exec(o);i["ws-opts"].path=d,E!==""&&(i["ws-opts"]["early-data-header-name"]="Sec-WebSocket-Protocol",i["ws-opts"]["max-early-data"]=parseInt(E,10))}if(i["plugin-opts"]?.tls&&ae(i,"skip-cert-verify")&&(i["plugin-opts"]["skip-cert-verify"]=i["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(i.type)&&delete i.tls,i["tls-fingerprint"]&&(i.fingerprint=i["tls-fingerprint"]),delete i["tls-fingerprint"],i["underlying-proxy"]&&(i["dialer-proxy"]=i["underlying-proxy"]),delete i["underlying-proxy"],ae(i,"tls")&&typeof i.tls!="boolean"&&delete i.tls,delete i.subName,delete i.collectionName,delete i.id,delete i.resolved,delete i["no-resolve"],n!=="internal")for(let o in i)(i[o]==null||/^_/i.test(o))&&delete i[o];return["grpc"].includes(i.network)&&i[`${i.network}-opts`]&&(delete i[`${i.network}-opts`]["_grpc-type"],delete i[`${i.network}-opts`]["_grpc-authority"]),i});return n==="internal"?u:`proxies:
`+u.map(i=>" - "+JSON.stringify(i)+`
`).join("")}}}var pI="Surfboard";function oh(){return{produce:t=>{switch(t.name=t.name.replace(/=|,/g,""),t.type){case"ss":return dI(t);case"trojan":return gI(t);case"vmess":return mI(t);case"http":return vI(t);case"socks5":return AI(t);case"wireguard-surge":return EI(t)}throw new Error(`Platform ${pI} does not support proxy type: ${t.type}`)}}}function dI(e){let t=new ft(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password=${e.password}`,"password"),ae(e,"plugin"))if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else throw new Error(`plugin ${e.plugin} is not supported`);return t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function gI(e){let t=new ft(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password=${e.password}`,"password"),xA(t,e),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function mI(e){let t=new ft(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,username=${e.uuid}`,"uuid"),xA(t,e),ae(e,"aead")?t.append(`,vmess-aead=${e.aead}`):t.append(`,vmess-aead=${e.alterId===0}`),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function vI(e){let t=new ft(e),r=e.tls?"https":"http";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function AI(e){let t=new ft(e),r=e.tls?"socks5-tls":"socks5";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function EI(e){let t=new ft(e);return t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.toString()}function xA(e,t){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let r=t["ws-opts"].headers,n=Object.keys(r).map(s=>{let u=r[s];return["Host"].includes(s)&&(u=`"${u}"`),`${s}:${u}`}).join("|");Fs(n)&&e.append(`,ws-headers=${n}`)}}else throw new Error(`network ${t.network} is unsupported`)}var wI={ipv4:"ipv4_only",ipv6:"ipv6_only","v4-only":"ipv4_only","v6-only":"ipv6_only","ipv4-prefer":"prefer_ipv4","ipv6-prefer":"prefer_ipv6","prefer-v4":"prefer_ipv4","prefer-v6":"prefer_ipv6"},ii=(e,t)=>{let r=wI[e["ip-version"]];e._dns_server&&r&&(t.domain_resolver={server:e._dns_server,strategy:r})},si=(e,t)=>{t.detour=e["dialer-proxy"]||e.detour},Du=(e,t)=>{["tcp","udp"].includes(e._network)&&(t.network=e._network)},Di=(e,t)=>{t.tcp_fast_open=!1,e.tfo&&(t.tcp_fast_open=!0),e.tcp_fast_open&&(t.tcp_fast_open=!0),e["tcp-fast-open"]&&(t.tcp_fast_open=!0),t.tcp_fast_open||delete t.tcp_fast_open},Ns=(e,t)=>{!e||!e.enabled||(t.multiplex={enabled:!0},t.multiplex.protocol=e.protocol,e["max-connections"]&&(t.multiplex.max_connections=parseInt(`${e["max-connections"]}`,10)),e["max-streams"]&&(t.multiplex.max_streams=parseInt(`${e["max-streams"]}`,10)),e["min-streams"]&&(t.multiplex.min_streams=parseInt(`${e["min-streams"]}`,10)),e.padding&&(t.multiplex.padding=!0),(e["brutal-opts"]?.up||e["brutal-opts"]?.down)&&(t.multiplex.brutal={enabled:!0},e["brutal-opts"]?.up&&(t.multiplex.brutal.up_mbps=parseInt(`${e["brutal-opts"]?.up}`,10)),e["brutal-opts"]?.down&&(t.multiplex.brutal.down_mbps=parseInt(`${e["brutal-opts"]?.down}`,10))))},gd=(e,t)=>{let r={type:"ws",headers:{}};if(e["ws-opts"]){let{path:n="",headers:s={},"max-early-data":u,"early-data-header-name":i}=e["ws-opts"];if(r.early_data_header_name=i,r.max_early_data=parseInt(u,10),n!==""&&(r.path=`${n}`),Object.keys(s).length>0){let o={};for(let f of Object.keys(s)){let d=s[f];d!==""&&(Array.isArray(d)||(d=[`${d}`]),d.length>0&&(o[f]=d))}let{Host:l}=o;if(l.length===1)for(let f of`Host:${l[0]}`.split(`
`)){let[d,E]=f.split(":");E.trim()!==""&&(o[d.trim()]=E.trim().split(","))}r.headers=o}}if(e["ws-headers"]){let n={};for(let u of Object.keys(e["ws-headers"])){let i=e["ws-headers"][u];i!==""&&(Array.isArray(i)||(i=[`${i}`]),i.length>0&&(n[u]=i))}let{Host:s}=n;if(s.length===1)for(let u of`Host:${s[0]}`.split(`
`)){let[i,o]=u.split(":");o.trim()!==""&&(n[i.trim()]=o.trim().split(","))}for(let u of Object.keys(n))r.headers[u]=n[u]}if(e["ws-path"]&&e["ws-path"]!==""&&(r.path=`${e["ws-path"]}`),r.path){let n=/^(.*?)(?:\?ed=(\d+))?$/,[s,u="",i=""]=n.exec(r.path);r.path=u,i!==""&&(r.early_data_header_name="Sec-WebSocket-Protocol",r.max_early_data=parseInt(i,10))}t.tls.insecure&&(t.tls.server_name=r.headers.Host[0]),e["ws-opts"]&&e["ws-opts"]["v2ray-http-upgrade"]&&(r.type="httpupgrade",r.headers.Host&&(r.host=r.headers.Host[0],delete r.headers.Host),r.max_early_data&&delete r.max_early_data,r.early_data_header_name&&delete r.early_data_header_name);for(let n of Object.keys(r.headers)){let s=r.headers[n];s.length===1&&(r.headers[n]=s[0])}t.transport=r},OA=(e,t)=>{let r={type:"http",headers:{}};if(e["http-opts"]){let{method:n="",path:s="",headers:u={}}=e["http-opts"];n!==""&&(r.method=n),Array.isArray(s)?r.path=`${s[0]}`:s!==""&&(r.path=`${s}`);for(let i of Object.keys(u)){let o=u[i];if(o!==""){if(i.toLowerCase()==="host"){let l=o;Array.isArray(l)||(l=`${l}`.split(",").map(f=>f.trim())),l.length>0&&(r.host=l);continue}Array.isArray(o)||(o=`${o}`.split(",").map(l=>l.trim())),o.length>0&&(r.headers[i]=o)}}}if(e["http-host"]&&e["http-host"]!==""){let n=e["http-host"];Array.isArray(n)||(n=`${n}`.split(",").map(s=>s.trim())),n.length>0&&(r.host=n)}if(e["http-path"]&&e["http-path"]!==""){let n=e["http-path"];Array.isArray(n)?r.path=`${n[0]}`:n!==""&&(r.path=`${n}`)}t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host?.length===1&&(r.host=r.host[0]);for(let n of Object.keys(r.headers)){let s=r.headers[n];s.length===1&&(r.headers[n]=s[0])}t.transport=r},kA=(e,t)=>{let r={type:"http"};if(e["h2-opts"]){let{host:n="",path:s=""}=e["h2-opts"];s!==""&&(r.path=`${s}`),n!==""&&(Array.isArray(n)||(n=`${n}`.split(",").map(u=>u.trim())),n.length>0&&(r.host=n))}if(e["h2-host"]&&e["h2-host"]!==""){let n=e["h2-host"];Array.isArray(n)||(n=`${n}`.split(",").map(s=>s.trim())),n.length>0&&(r.host=n)}e["h2-path"]&&e["h2-path"]!==""&&(r.path=`${e["h2-path"]}`),t.tls.enabled=!0,t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host.length===1&&(r.host=r.host[0]),t.transport=r},md=(e,t)=>{let r={type:"grpc"};if(e["grpc-opts"]){let n=e["grpc-opts"]["grpc-service-name"];n!=null&&n!==""&&(r.service_name=`${n}`)}t.transport=r},Xu=(e,t)=>{e.tls&&(t.tls.enabled=!0),e.servername&&e.servername!==""&&(t.tls.server_name=e.servername),e.peer&&e.peer!==""&&(t.tls.server_name=e.peer),e.sni&&e.sni!==""&&(t.tls.server_name=e.sni),e["skip-cert-verify"]&&(t.tls.insecure=!0),e.insecure&&(t.tls.insecure=!0),e["disable-sni"]&&(t.tls.disable_sni=!0),typeof e.alpn=="string"?t.tls.alpn=[e.alpn]:Array.isArray(e.alpn)&&(t.tls.alpn=e.alpn),e.ca&&(t.tls.certificate_path=`${e.ca}`),e.ca_str&&(t.tls.certificate=[e.ca_str]),e["ca-str"]&&(t.tls.certificate=[e["ca-str"]]),e["reality-opts"]&&(t.tls.reality={enabled:!0},e["reality-opts"]["public-key"]&&(t.tls.reality.public_key=e["reality-opts"]["public-key"]),e["reality-opts"]["short-id"]&&(t.tls.reality.short_id=e["reality-opts"]["short-id"]),t.tls.utls={enabled:!0}),!["hysteria","hysteria2","tuic"].includes(e.type)&&e["client-fingerprint"]&&e["client-fingerprint"]!==""&&(t.tls.utls={enabled:!0,fingerprint:e["client-fingerprint"]}),t.tls.enabled||delete t.tls},FI=(e={})=>{let t={tag:e.name,type:"ssh",server:e.server,server_port:parseInt(`${e.port}`,10)};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.username&&(t.user=e.username),e.password&&(t.password=e.password),e.privateKey&&(t.private_key_path=e.privateKey),e["private-key"]&&(t.private_key_path=e["private-key"]),e["private-key-passphrase"]&&(t.private_key_passphrase=e["private-key-passphrase"]),e["server-fingerprint"]&&(t.host_key=[e["server-fingerprint"]],t.host_key_algorithms=[e["server-fingerprint"].split(" ")[0]]),e["host-key"]&&(t.host_key=e["host-key"]),e["host-key-algorithms"]&&(t.host_key_algorithms=e["host-key-algorithms"]),e["fast-open"]&&(t.udp_fragment=!0),Di(e,t),si(e,t),ii(e,t),t},CI=(e={})=>{let t={tag:e.name,type:"http",server:e.server,server_port:parseInt(`${e.port}`,10),tls:{enabled:!1,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";if(e.username&&(t.username=e.username),e.password&&(t.password=e.password),e.headers){t.headers={};for(let r of Object.keys(e.headers))t.headers[r]=`${e.headers[r]}`;Object.keys(t.headers).length===0&&delete t.headers}return e["fast-open"]&&(t.udp_fragment=!0),Di(e,t),si(e,t),Xu(e,t),ii(e,t),t},DI=(e={})=>{let t={tag:e.name,type:"socks",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,version:"5"};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.username&&(t.username=e.username),e.password&&(t.password=e.password),e.uot&&(t.udp_over_tcp=!0),e["udp-over-tcp"]&&(t.udp_over_tcp=!0),e["fast-open"]&&(t.udp_fragment=!0),Du(e,t),Di(e,t),si(e,t),ii(e,t),t},yI=(e={})=>{let t={tag:e.name,type:"shadowsocks",method:e.cipher,password:e.password,detour:`${e.name}_shadowtls`};e.uot&&(t.udp_over_tcp=!0),e["udp-over-tcp"]&&(t.udp_over_tcp={enabled:!0,version:!e["udp-over-tcp-version"]||e["udp-over-tcp-version"]===1?1:2});let r={tag:`${e.name}_shadowtls`,type:"shadowtls",server:e.server,server_port:parseInt(`${e.port}`,10),version:e["plugin-opts"].version,password:e["plugin-opts"].password,tls:{enabled:!0,server_name:e["plugin-opts"].host,utls:{enabled:!0,fingerprint:e["client-fingerprint"]}}};if(r.server_port<0||r.server_port>65535)throw"\u7AEF\u53E3\u503C\u975E\u6CD5";return e["fast-open"]===!0&&(r.udp_fragment=!0),Di(e,r),si(e,r),Ns(e.smux,t),ii(e,r),{type:"ss-with-st",ssPart:t,stPart:r}},SI=(e={})=>{let t={tag:e.name,type:"shadowsocks",server:e.server,server_port:parseInt(`${e.port}`,10),method:e.cipher,password:e.password};if(t.server_port<0||t.server_port>65535)throw"invalid port";if(e.uot&&(t.udp_over_tcp=!0),e["udp-over-tcp"]&&(t.udp_over_tcp={enabled:!0,version:!e["udp-over-tcp-version"]||e["udp-over-tcp-version"]===1?1:2}),e["fast-open"]&&(t.udp_fragment=!0),Du(e,t),Di(e,t),si(e,t),Ns(e.smux,t),ii(e,t),e.plugin){let r=[];e.plugin==="obfs"&&(t.plugin="obfs-local",t.plugin_opts="",e["obfs-host"]&&(e["plugin-opts"].host=e["obfs-host"]),Object.keys(e["plugin-opts"]).forEach(n=>{switch(n){case"mode":r.push(`obfs=${e["plugin-opts"].mode}`);break;case"host":r.push(`obfs-host=${e["plugin-opts"].host}`);break;default:r.push(`${n}=${e["plugin-opts"][n]}`);break}})),e.plugin==="v2ray-plugin"&&(t.plugin="v2ray-plugin",e["ws-host"]&&(e["plugin-opts"].host=e["ws-host"]),e["ws-path"]&&(e["plugin-opts"].path=e["ws-path"]),Object.keys(e["plugin-opts"]).forEach(n=>{switch(n){case"tls":e["plugin-opts"].tls&&r.push("tls");break;case"host":r.push(`host=${e["plugin-opts"].host}`);break;case"path":r.push(`path=${e["plugin-opts"].path}`);break;case"headers":r.push(`headers=${JSON.stringify(e["plugin-opts"].headers)}`);break;case"mux":e["plugin-opts"].mux&&(t.multiplex={enabled:!0});break;default:r.push(`${n}=${e["plugin-opts"][n]}`)}})),t.plugin_opts=r.join(";")}return t},bI=(e={})=>{let t={tag:e.name,type:"shadowsocksr",server:e.server,server_port:parseInt(`${e.port}`,10),method:e.cipher,password:e.password,obfs:e.obfs,protocol:e.protocol};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["obfs-param"]&&(t.obfs_param=e["obfs-param"]),e["protocol-param"]&&e["protocol-param"]!==""&&(t.protocol_param=e["protocol-param"]),e["fast-open"]&&(t.udp_fragment=!0),Di(e,t),si(e,t),Ns(e.smux,t),ii(e,t),t},_I=(e={})=>{let t={tag:e.name,type:"vmess",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,security:e.cipher,alter_id:parseInt(`${e.alterId}`,10),tls:{enabled:!1,server_name:e.server,insecure:!1}};if(["auto","none","zero","aes-128-gcm","chacha20-poly1305","aes-128-ctr"].indexOf(t.security)===-1&&(t.security="auto"),t.server_port<0||t.server_port>65535)throw"invalid port";return e.xudp&&(t.packet_encoding="xudp"),e["fast-open"]&&(t.udp_fragment=!0),e.network==="ws"&&gd(e,t),e.network==="h2"&&kA(e,t),e.network==="http"&&OA(e,t),e.network==="grpc"&&md(e,t),Du(e,t),Di(e,t),si(e,t),Xu(e,t),Ns(e.smux,t),ii(e,t),t},BI=(e={})=>{let t={tag:e.name,type:"vless",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,tls:{enabled:!1,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.xudp&&(t.packet_encoding="xudp"),e["fast-open"]&&(t.udp_fragment=!0),e.flow!=null&&(t.flow=e.flow),e.network==="ws"&&gd(e,t),e.network==="h2"&&kA(e,t),e.network==="http"&&OA(e,t),e.network==="grpc"&&md(e,t),Du(e,t),Di(e,t),si(e,t),Ns(e.smux,t),Xu(e,t),ii(e,t),t},II=(e={})=>{let t={tag:e.name,type:"trojan",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["fast-open"]&&(t.udp_fragment=!0),e.network==="grpc"&&md(e,t),e.network==="ws"&&gd(e,t),Du(e,t),Di(e,t),si(e,t),Xu(e,t),Ns(e.smux,t),ii(e,t),t},$I=(e={})=>{let t={tag:e.name,type:"hysteria",server:e.server,server_port:parseInt(`${e.port}`,10),disable_mtu_discovery:!1,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";e.auth_str&&(t.auth_str=`${e.auth_str}`),e["auth-str"]&&(t.auth_str=`${e["auth-str"]}`),e["fast-open"]&&(t.udp_fragment=!0);let r=new RegExp("^[0-9]+[ ]*[KMGT]*[Bb]ps$");return r.test(`${e.up}`)&&!`${e.up}`.endsWith("Mbps")?t.up=`${e.up}`:t.up_mbps=parseInt(`${e.up}`,10),r.test(`${e.down}`)&&!`${e.down}`.endsWith("Mbps")?t.down=`${e.down}`:t.down_mbps=parseInt(`${e.down}`,10),e.obfs&&(t.obfs=e.obfs),e.recv_window_conn&&(t.recv_window_conn=e.recv_window_conn),e["recv-window-conn"]&&(t.recv_window_conn=e["recv-window-conn"]),e.recv_window&&(t.recv_window=e.recv_window),e["recv-window"]&&(t.recv_window=e["recv-window"]),e.disable_mtu_discovery&&(typeof e.disable_mtu_discovery=="boolean"?t.disable_mtu_discovery=e.disable_mtu_discovery:e.disable_mtu_discovery===1&&(t.disable_mtu_discovery=!0)),Du(e,t),Xu(e,t),si(e,t),Di(e,t),Ns(e.smux,t),ii(e,t),t},PI=(e={})=>{let t={tag:e.name,type:"hysteria2",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,obfs:{},tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["hop-interval"]&&(t.hop_interval=/^\d+$/.test(e["hop-interval"])?`${e["hop-interval"]}s`:e["hop-interval"]),e.ports&&(t.server_ports=e.ports.split(/\s*,\s*/).map(r=>r.replace(/\s*-\s*/g,":"))),e.up&&(t.up_mbps=parseInt(`${e.up}`,10)),e.down&&(t.down_mbps=parseInt(`${e.down}`,10)),e.obfs==="salamander"&&(t.obfs.type="salamander"),e["obfs-password"]&&(t.obfs.password=e["obfs-password"]),t.obfs.type||delete t.obfs,Du(e,t),Xu(e,t),Di(e,t),si(e,t),Ns(e.smux,t),ii(e,t),t},RI=(e={})=>{let t={tag:e.name,type:"tuic",server:e.server,server_port:parseInt(`${e.port}`,10),uuid:e.uuid,password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e["fast-open"]&&(t.udp_fragment=!0),e["congestion-controller"]&&e["congestion-controller"]!=="cubic"&&(t.congestion_control=e["congestion-controller"]),e["udp-relay-mode"]&&e["udp-relay-mode"]!=="native"&&(t.udp_relay_mode=e["udp-relay-mode"]),e["reduce-rtt"]&&(t.zero_rtt_handshake=!0),e["udp-over-stream"]&&(t.udp_over_stream=!0),e["heartbeat-interval"]&&(t.heartbeat=`${e["heartbeat-interval"]}ms`),Du(e,t),Di(e,t),si(e,t),Xu(e,t),Ns(e.smux,t),ii(e,t),t},TI=(e={})=>{let t={tag:e.name,type:"anytls",server:e.server,server_port:parseInt(`${e.port}`,10),password:e.password,tls:{enabled:!0,server_name:e.server,insecure:!1}};return/^\d+$/.test(e["idle-session-check-interval"])&&(t.idle_session_check_interval=`${e["idle-session-check-interval"]}s`),/^\d+$/.test(e["idle-session-timeout"])&&(t.idle_session_timeout=`${e["idle-session-timeout"]}s`),/^\d+$/.test(e["min-idle-session"])&&(t.min_idle_session=parseInt(`${e["min-idle-session"]}`,10)),si(e,t),Xu(e,t),ii(e,t),t},xI=(e={})=>{let t=["ip","ipv6"].map(n=>e[n]).map(n=>{if(Rr(n))return`${n}/32`;if(Ur(n))return`${n}/128`}).filter(n=>n),r={tag:e.name,type:"wireguard",server:e.server,server_port:parseInt(`${e.port}`,10),local_address:t,private_key:e["private-key"],peer_public_key:e["public-key"],pre_shared_key:e["pre-shared-key"],reserved:[]};if(r.server_port<0||r.server_port>65535)throw"invalid port";if(e["fast-open"]&&(r.udp_fragment=!0),typeof e.reserved=="string")r.reserved=e.reserved;else if(Array.isArray(e.reserved))for(let n of e.reserved)r.reserved.push(n);else delete r.reserved;if(e.peers&&e.peers.length>0){r.peers=[];for(let n of e.peers){let s={server:n.server,server_port:parseInt(`${n.port}`,10),public_key:n["public-key"],allowed_ips:n["allowed-ips"]||n.allowed_ips,reserved:[]};if(typeof n.reserved=="string")s.reserved.push(n.reserved);else if(Array.isArray(n.reserved))for(let u of n.reserved)s.reserved.push(u);else delete s.reserved;n["pre-shared-key"]&&(s.pre_shared_key=n["pre-shared-key"]),r.peers.push(s)}}return Du(e,r),Di(e,r),si(e,r),Ns(e.smux,r),ii(e,r),r};function ch(){return{type:"ALL",produce:(r,n,s={})=>{let u=[];return Fi().produce(r,"internal",{"include-unsupported-proxy":!0}).map(i=>{try{switch(i.type){case"ssh":u.push(FI(i));break;case"http":u.push(CI(i));break;case"socks5":if(i.tls)throw new Error(`Platform sing-box does not support proxy type: ${i.type} with tls`);u.push(DI(i));break;case"ss":if(i.plugin==="shadow-tls"){let{ssPart:o,stPart:l}=yI(i);u.push(o),u.push(l)}else u.push(SI(i));break;case"ssr":if(s["include-unsupported-proxy"])u.push(bI(i));else throw new Error(`Platform sing-box does not support proxy type: ${i.type}`);break;case"vmess":if(!i.network||["ws","grpc","h2","http"].includes(i.network))u.push(_I(i));else throw new Error(`Platform sing-box does not support proxy type: ${i.type} with network ${i.network}`);break;case"vless":if(!i.flow||["xtls-rprx-vision"].includes(i.flow))u.push(BI(i));else throw new Error(`Platform sing-box does not support proxy type: ${i.type} with flow ${i.flow}`);break;case"trojan":if(!i.flow)u.push(II(i));else throw new Error(`Platform sing-box does not support proxy type: ${i.type} with flow ${i.flow}`);break;case"hysteria":u.push($I(i));break;case"hysteria2":u.push(PI(i,s["include-unsupported-proxy"]));break;case"tuic":if(!i.token||i.token.length===0)u.push(RI(i));else throw new Error("Platform sing-box does not support proxy type: TUIC v4");break;case"wireguard":u.push(xI(i));break;case"anytls":u.push(TI(i));break;default:throw new Error(`Platform sing-box does not support proxy type: ${i.type}`)}}catch(o){x.error(o.message??o)}}),n==="internal"?u:JSON.stringify({outbounds:u},null,2)}}}function lh(){return{type:"ALL",produce:(r,n)=>{let s=r.filter(u=>!(!["http","socks5","ss","trojan","hysteria2","vless","vmess","tuic"].includes(u.type)||u.type==="ss"&&(u.plugin==="obfs"&&!["http","tls"].includes(u["plugin-opts"]?.mode)||!["chacha20-ietf-poly1305","chacha20-poly1305","aes-256-gcm","aes-128-gcm","none","tbale","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","cast5-cfb","des-cfb","idea-cfb","rc2-cfb","seed-cfb","salsa20","chacha20","chacha20-ietf","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(u.cipher))||u.type==="vmess"&&!["http","ws","tcp"].includes(u.network)&&u.network||u.type==="trojan"&&!["http","ws","tcp"].includes(u.network)&&u.network||u.type==="vless"&&(typeof u.flow<"u"||u["reality-opts"]||!["http","ws","tcp"].includes(u.network)&&u.network)||u.type==="tuic"&&u.token&&u.token.length!==0)).map(u=>{let i={...u};u.tls&&!u.sni&&(u.sni=u.server);let o=u.prev_hop||u["underlying-proxy"]||u["dialer-proxy"]||u.detour;if(u.type==="http")u={type:"http",name:u.name,server:u.server,port:u.port,username:u.username,password:u.password,tfo:u.tfo||u["fast-open"],next_hop:u.next_hop};else if(u.type==="socks5")u={type:"socks5",name:u.name,server:u.server,port:u.port,username:u.username,password:u.password,tfo:u.tfo||u["fast-open"],udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop};else if(u.type==="ss")u={type:"shadowsocks",name:u.name,method:u.cipher==="chacha20-ietf-poly1305"?"chacha20-poly1305":u.cipher,server:u.server,port:u.port,password:u.password,tfo:u.tfo||u["fast-open"],udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop},i.plugin==="obfs"&&(u.obfs=i["plugin-opts"].mode,u.obfs_host=i["plugin-opts"].host,u.obfs_uri=i["plugin-opts"].path);else if(u.type==="hysteria2")u={type:"hysteria2",name:u.name,server:u.server,port:u.port,auth:u.password,tfo:u.tfo||u["fast-open"],udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop,sni:u.sni,skip_tls_verify:u["skip-cert-verify"],port_hopping:u.ports,port_hopping_interval:u["hop-interval"]},i["obfs-password"]&&i.obfs=="salamander"&&(u.obfs="salamander",u.obfs_password=i["obfs-password"]);else if(u.type==="tuic")u={type:"tuic",name:u.name,server:u.server,port:u.port,uuid:u.uuid,password:u.password,next_hop:u.next_hop,sni:u.sni,alpn:Array.isArray(u.alpn)?u.alpn:[u.alpn||"h3"],skip_tls_verify:u["skip-cert-verify"],port_hopping:u.ports,port_hopping_interval:u["hop-interval"]};else if(u.type==="trojan")u.network==="ws"&&(u.websocket={path:u["ws-opts"]?.path,host:u["ws-opts"]?.headers?.Host}),u={type:"trojan",name:u.name,server:u.server,port:u.port,password:u.password,tfo:u.tfo||u["fast-open"],udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop,sni:u.sni,skip_tls_verify:u["skip-cert-verify"],websocket:u.websocket};else if(u.type==="vmess"){let l=u.cipher;l&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(l)&&(l="auto"),u.network==="ws"?u.transport={[u.tls?"wss":"ws"]:{path:u["ws-opts"]?.path,headers:{Host:u["ws-opts"]?.headers?.Host},sni:u.tls?u.sni:void 0,skip_tls_verify:u.tls?u["skip-cert-verify"]:void 0}}:u.network==="http"?u.transport={http1:{method:u["http-opts"]?.method,path:Array.isArray(u["http-opts"]?.path)?u["http-opts"]?.path[0]:u["http-opts"]?.path,headers:{Host:Array.isArray(u["http-opts"]?.headers?.Host)?u["http-opts"]?.headers?.Host[0]:u["http-opts"]?.headers?.Host},skip_tls_verify:u["skip-cert-verify"]}}:u.network==="h2"?u.transport={http2:{method:u["h2-opts"]?.method,path:Array.isArray(u["h2-opts"]?.path)?u["h2-opts"]?.path[0]:u["h2-opts"]?.path,headers:{Host:Array.isArray(u["h2-opts"]?.headers?.Host)?u["h2-opts"]?.headers?.Host[0]:u["h2-opts"]?.headers?.Host},skip_tls_verify:u["skip-cert-verify"]}}:(u.network==="tcp"||!u.network)&&u.tls&&(u.transport={tls:{sni:u.tls?u.sni:void 0,skip_tls_verify:u.tls?u["skip-cert-verify"]:void 0}}),u={type:"vmess",name:u.name,server:u.server,port:u.port,user_id:u.uuid,security:l,tfo:u.tfo||u["fast-open"],legacy:u.legacy,udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop,transport:u.transport}}else u.type==="vless"&&(u.network==="ws"?u.transport={[u.tls?"wss":"ws"]:{path:u["ws-opts"]?.path,headers:{Host:u["ws-opts"]?.headers?.Host},sni:u.tls?u.sni:void 0,skip_tls_verify:u.tls?u["skip-cert-verify"]:void 0}}:u.network==="http"?u.transport={http:{method:u["http-opts"]?.method,path:Array.isArray(u["http-opts"]?.path)?u["http-opts"]?.path[0]:u["http-opts"]?.path,headers:{Host:Array.isArray(u["http-opts"]?.headers?.Host)?u["http-opts"]?.headers?.Host[0]:u["http-opts"]?.headers?.Host},skip_tls_verify:u["skip-cert-verify"]}}:(u.network==="tcp"||!u.network)&&(u.transport={[u.tls?"tls":"tcp"]:{sni:u.tls?u.sni:void 0,skip_tls_verify:u.tls?u["skip-cert-verify"]:void 0}}),u={type:"vless",name:u.name,server:u.server,port:u.port,user_id:u.uuid,security:u.cipher,tfo:u.tfo||u["fast-open"],legacy:u.legacy,udp_relay:u.udp||u.udp_relay||u.udp_relay,next_hop:u.next_hop,transport:u.transport});if(["http","socks5","ss","trojan","vless","vmess"].includes(i.type)){if(ae(i,"shadow-tls-password")){if(i["shadow-tls-version"]!=3)throw new Error(`shadow-tls version ${i["shadow-tls-version"]} is not supported`);u.shadow_tls={password:i["shadow-tls-password"],sni:i["shadow-tls-sni"]}}else if(["shadow-tls"].includes(i.plugin)&&i["plugin-opts"]){if(i["plugin-opts"].version!=3)throw new Error(`shadow-tls version ${i["plugin-opts"].version} is not supported`);u.shadow_tls={password:i["plugin-opts"].password,sni:i["plugin-opts"].host}}}if(["ss"].includes(i.type)&&u.shadow_tls&&i["udp-port"]>0&&i["udp-port"]<=65535&&(u.udp_port=i["udp-port"]),delete u.subName,delete u.collectionName,delete u.id,delete u.resolved,delete u["no-resolve"],u.transport){for(let l in u.transport)(Object.keys(u.transport[l]).length===0||Object.values(u.transport[l]).every(f=>f==null))&&delete u.transport[l];Object.keys(u.transport).length===0&&delete u.transport}if(n!=="internal")for(let l in u)(u[l]==null||/^_/i.test(l))&&delete u[l];return{[u.type]:{...u,type:void 0,prev_hop:o}}});return n==="internal"?s:`proxies:
`+s.map(u=>" - "+JSON.stringify(u)+`
`).join("")}}}function NA(){return{type:"ALL",produce:(r,n)=>n==="internal"?r:JSON.stringify(r,null,2)}}var LA={qx:Wc(),QX:Wc(),QuantumultX:Wc(),surge:Jo(),Surge:Jo(),SurgeMac:hd(),Loon:dd(),Clash:pd(),meta:Fi(),clashmeta:Fi(),"clash.meta":Fi(),"Clash.Meta":Fi(),ClashMeta:Fi(),mihomo:Fi(),Mihomo:Fi(),uri:Xo(),URI:Xo(),v2:Yc(),v2ray:Yc(),V2Ray:Yc(),json:NA(),JSON:NA(),stash:ah(),Stash:ah(),shadowrocket:Jc(),Shadowrocket:Jc(),ShadowRocket:Jc(),surfboard:oh(),Surfboard:oh(),singbox:ch(),"sing-box":ch(),egern:lh(),Egern:lh()};var KE=On(nl()),q7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parser initializer
{
const proxy = {};
const obfs = {};
const $ = {};
function handleWebsocket() {
if (obfs.type === "ws") {
proxy.network = "ws";
$set(proxy, "ws-opts.path", obfs.path);
$set(proxy, "ws-opts.headers", obfs['ws-headers']);
if (proxy['ws-opts'] && proxy['ws-opts']['headers'] && proxy['ws-opts']['headers'].Host) {
proxy['ws-opts']['headers'].Host = proxy['ws-opts']['headers'].Host.replace(/^"(.*)"$/, '$1')
}
}
}
function handleShadowTLS() {
if (proxy['shadow-tls-password'] && !proxy['shadow-tls-version']) {
proxy['shadow-tls-version'] = 2;
}
}
}
start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v5/wireguard/hysteria2/ssh/direct) {
return proxy;
}
shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/udp_port/others)* {
proxy.type = "ss";
// handle obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts.mode", obfs.type);
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
handleShadowTLS();
}
vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
// Surfboard 与 Surge 默认不一致, 不管 Surfboard https://getsurfboard.com/docs/profile-format/proxy/external-proxy/vmess
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = 1;
}
handleWebsocket();
handleShadowTLS();
}
trojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "trojan";
handleWebsocket();
handleShadowTLS();
}
https = tag equals "https" address (username password)? (usernamek passwordk)? (sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "http";
proxy.tls = true;
handleShadowTLS();
}
http = tag equals "http" address (username password)? (usernamek passwordk)? (ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "http";
handleShadowTLS();
}
ssh = tag equals "ssh" address (username password)? (usernamek passwordk)? (server_fingerprint/idle_timeout/private_key/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "ssh";
handleShadowTLS();
}
snell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/reuse/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "snell";
// handle obfs
if (obfs.type == "http" || obfs.type === "tls") {
$set(proxy, "obfs-opts.mode", obfs.type);
$set(proxy, "obfs-opts.host", obfs.host);
$set(proxy, "obfs-opts.path", obfs.path);
}
handleShadowTLS();
}
tuic = tag equals "tuic" address (alpn/token/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "tuic";
handleShadowTLS();
}
tuic_v5 = tag equals "tuic-v5" address (alpn/passwordk/uuidk/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "tuic";
proxy.version = 5;
handleShadowTLS();
}
wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "wireguard-surge";
handleShadowTLS();
}
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "hysteria2";
handleShadowTLS();
}
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "socks5";
handleShadowTLS();
}
socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_fingerprint/tls_verification/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "socks5";
proxy.tls = true;
handleShadowTLS();
}
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
proxy.type = "direct";
}
address = comma server:server comma port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
ip = & {
const start = peg$currPos;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
j++;
}
peg$currPos = j;
$.ip = input.substring(start, j).trim();
return true;
} { return $.ip; }
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
}
port_hopping_interval = comma "port-hopping-interval" equals match:$[0-9]+ { proxy["hop-interval"] = parseInt(match.trim()); }
username = & {
let j = peg$currPos;
let start, end;
let first = true;
while (j < input.length) {
if (input[j] === ',') {
if (first) {
start = j + 1;
first = false;
} else {
end = j;
break;
}
}
j++;
}
const match = input.substring(start, end);
if (match.indexOf("=") === -1) {
$.username = match;
peg$currPos = end;
return true;
}
} { proxy.username = $.username.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
password = comma match:[^,]+ { proxy.password = match.join("").replace(/^"(.*)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
sni = comma "sni" equals sni:("off"/domain) {
if (sni === "off") {
proxy["disable-sni"] = true;
} else {
proxy.sni = sni;
}
}
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
method = comma "encrypt-method" equals cipher:cipher {
proxy.cipher = cipher;
}
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"idea-cfb"/"none"/"rc2-cfb"/"rc4-md5"/"rc4"/"salsa20"/"seed-cfb"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
ws = comma "ws" equals flag:bool { obfs.type = "ws"; }
ws_headers = comma "ws-headers" equals headers:$[^,]+ {
const pairs = headers.split("|");
const result = {};
pairs.forEach(pair => {
const [key, value] = pair.trim().split(":");
result[key.trim()] = value.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
})
obfs["ws-headers"] = result;
}
ws_path = comma "ws-path" equals path:uri { obfs.path = path.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
obfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };
obfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }
uri = $[^,]+
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
reuse = comma "reuse" equals flag:bool { proxy.reuse = flag; }
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
tfo = comma "tfo" equals flag:bool { proxy.tfo = flag; }
ip_version = comma "ip-version" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
section_name = comma "section-name" equals match:[^,]+ { proxy["section-name"] = match.join(""); }
no_error_alert = comma "no-error-alert" equals match:[^,]+ { proxy["no-error-alert"] = match.join(""); }
underlying_proxy = comma "underlying-proxy" equals match:[^,]+ { proxy["underlying-proxy"] = match.join(""); }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
test_url = comma "test-url" equals match:[^,]+ { proxy["test-url"] = match.join(""); }
test_udp = comma "test-udp" equals match:[^,]+ { proxy["test-udp"] = match.join(""); }
test_timeout = comma "test-timeout" equals match:$[0-9]+ { proxy["test-timeout"] = parseInt(match.trim()); }
tos = comma "tos" equals match:$[0-9]+ { proxy.tos = parseInt(match.trim()); }
interface = comma "interface" equals match:[^,]+ { proxy.interface = match.join(""); }
allow_other_interface = comma "allow-other-interface" equals flag:bool { proxy["allow-other-interface"] = flag; }
hybrid = comma "hybrid" equals flag:bool { proxy.hybrid = flag; }
idle_timeout = comma "idle-timeout" equals match:$[0-9]+ { proxy["idle-timeout"] = parseInt(match.trim()); }
private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
token = comma "token" equals match:[^,]+ { proxy.token = match.join(""); }
alpn = comma "alpn" equals match:[^,]+ { proxy.alpn = match.join(""); }
uuidk = comma "uuid" equals match:[^,]+ { proxy.uuid = match.join(""); }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
others = comma [^=,]+ equals [^=,]+
`,kd;function Si(){return kd||(kd=KE.generate(q7)),kd}var VE=On(nl()),K7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parser initializer
{
const proxy = {};
const obfs = {};
const transport = {};
const $ = {};
function handleTransport() {
if (transport.type === "tcp") { /* do nothing */ }
else if (transport.type === "ws") {
proxy.network = "ws";
$set(proxy, "ws-opts.path", transport.path);
$set(proxy, "ws-opts.headers.Host", transport.host);
} else if (transport.type === "http") {
proxy.network = "http";
$set(proxy, "http-opts.path", transport.path);
$set(proxy, "http-opts.headers.Host", transport.host);
}
}
}
start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2) {
return proxy;
}
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)*{
proxy.type = "ssr";
// handle ssr obfs
proxy.obfs = obfs.type;
}
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)* {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts.mode", obfs.type);
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
}
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
proxy.alterId = proxy.alterId || 0;
handleTransport();
}
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/block_quic/others)* {
proxy.type = "vless";
handleTransport();
}
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
proxy.type = "trojan";
handleTransport();
}
hysteria2 = tag equals "hysteria2"i address password (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/block_quic/others)* {
proxy.type = "hysteria2";
}
https = tag equals "https"i address (username password)? (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
proxy.type = "http";
proxy.tls = true;
}
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/block_quic/others)* {
proxy.type = "http";
}
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
proxy.type = "socks5";
}
address = comma server:server comma port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
ip = & {
const start = peg$currPos;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
j++;
}
peg$currPos = j;
$.ip = input.substring(start, j).trim();
return true;
} { return $.ip; }
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
throw new Error("Invalid domain: " + domain);
}
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
throw new Error("Invalid port number: " + port);
}
method = comma cipher:cipher {
proxy.cipher = cipher;
}
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"auto"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"rc4-md5"/"rc4"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
username = & {
let j = peg$currPos;
let start, end;
let first = true;
while (j < input.length) {
if (input[j] === ',') {
if (first) {
start = j + 1;
first = false;
} else {
end = j;
break;
}
}
j++;
}
const match = input.substring(start, end);
if (match.indexOf("=") === -1) {
$.username = match;
peg$currPos = end;
return true;
}
} { proxy.username = $.username; }
password = comma '"' match:[^"]* '"' { proxy.password = match.join(""); }
uuid = comma '"' match:[^"]+ '"' { proxy.uuid = match.join(""); }
obfs_typev = comma type:("http"/"tls") { obfs.type = type; }
obfs_hostv = comma match:[^,]+ { obfs.host = match.join(""); }
obfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }
obfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
uri = $[^,]+
transport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }
transport_host = comma "host" equals host:domain { transport.host = host; }
transport_path = comma "path" equals path:uri { transport.path = path; }
ssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }
ssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
vmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); }
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_name = comma sni:("tls-name") equals host:domain { proxy.sni = host; }
sni = comma sni:("sni") equals host:domain { proxy.sni = host; }
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
block_quic = comma "block-quic" equals flag:bool { if(flag) proxy["block-quic"] = "on"; else proxy["block-quic"] = "off"; }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
others = comma [^=,]+ equals [^=,]+
`,Nd;function Ls(){return Nd||(Nd=VE.generate(K7)),Nd}var GE=On(nl()),V7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
}}
// per-parse initializer
{
const proxy = {};
const obfs = {};
const $ = {};
function handleObfs() {
if (obfs.type === "ws" || obfs.type === "wss") {
proxy.network = "ws";
if (obfs.type === 'wss') {
proxy.tls = true;
}
$set(proxy, "ws-opts.path", obfs.path);
$set(proxy, "ws-opts.headers.Host", obfs.host);
} else if (obfs.type === "over-tls") {
proxy.tls = true;
} else if (obfs.type === "http") {
proxy.network = "http";
$set(proxy, "http-opts.path", obfs.path);
$set(proxy, "http-opts.headers.Host", obfs.host);
}
}
}
start = (trojan/shadowsocks/vmess/vless/http/socks5) {
return proxy
}
trojan = "trojan" equals address
(password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/server_check_url/others)* {
proxy.type = "trojan";
handleObfs();
}
shadowsocks = "shadowsocks" equals address
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp_new/fast_open/tag/server_check_url/others)* {
if (proxy.protocol || proxy.type === "ssr") {
proxy.type = "ssr";
if (!proxy.protocol) {
proxy.protocol = "origin";
}
// handle ssr obfs
if (obfs.host) proxy["obfs-param"] = obfs.host;
if (obfs.type) proxy.obfs = obfs.type;
} else {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
proxy.plugin = "obfs";
$set(proxy, "plugin-opts", {
mode: obfs.type
});
} else if (obfs.type === "ws" || obfs.type === "wss") {
proxy.plugin = "v2ray-plugin";
$set(proxy, "plugin-opts.mode", "websocket");
if (obfs.type === "wss") {
$set(proxy, "plugin-opts.tls", true);
}
} else if (obfs.type === 'over-tls') {
throw new Error('ss over-tls is not supported');
}
if (obfs.type) {
$set(proxy, "plugin-opts.host", obfs.host);
$set(proxy, "plugin-opts.path", obfs.path);
}
}
}
vmess = "vmess" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
if (proxy.aead === false) {
proxy.alterId = 1;
} else {
proxy.alterId = 0;
}
handleObfs();
}
vless = "vless" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vless";
proxy.cipher = proxy.cipher || "none";
handleObfs();
}
http = "http" equals address
(username/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)*{
proxy.type = "http";
}
socks5 = "socks5" equals address
(username/password/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)* {
proxy.type = "socks5";
}
address = server:server ":" port:port {
proxy.server = server;
proxy.port = port;
}
server = ip/domain
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
ip = & {
const start = peg$currPos;
let end;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
if (input[j] === ":") end = j;
j++;
}
peg$currPos = end || j;
$.ip = input.substring(start, end).trim();
return true;
} { return $.ip; }
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
}
}
username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher {
proxy.cipher = cipher;
};
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
aead = comma "aead" equals flag:bool { proxy.aead = flag; }
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
udp_over_tcp_new = comma "udp-over-tcp" equals param:$[^=,]+ { if (param === "sp.v1") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 1; } else if (param === "sp.v2") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; } else if (param === "true") { proxy["_ssr_python_uot"] = true; } else { throw new Error("Invalid value for udp-over-tcp"); } }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }
tls_verification = comma "tls-verification" equals flag:bool {
proxy["skip-cert-verify"] = !flag;
}
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals param:$[^=,]+ { proxy["tls-pubkey-sha256"] = param; }
tls_alpn = comma "tls-alpn" equals param:$[^=,]+ { proxy["tls-alpn"] = param; }
tls_no_session_ticket = comma "tls-no-session-ticket" equals flag:bool {
proxy["tls-no-session-ticket"] = flag;
}
tls_no_session_reuse = comma "tls-no-session-reuse" equals flag:bool {
proxy["tls-no-session-reuse"] = flag;
}
obfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { proxy.type = "ssr"; obfs.type = type; return type; }
obfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
ssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }
ssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
server_check_url = comma "server_check_url" equals param:$[^=,]+ { proxy["test-url"] = param; }
uri = $[^,]+
tag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }
others = comma [^=,]+ equals [^=,]+
comma = _ "," _
equals = _ "=" _
_ = [ \r\t]*
bool = b:("true"/"false") { return b === "true" }
`,Ld;function Su(){return Ld||(Ld=GE.generate(V7)),Ld}var zE=On(nl()),G7=String.raw`
// global initializer
{{
function $set(obj, path, value) {
if (Object(obj) !== obj) return obj;
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
path
.slice(0, -1)
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
path[path.length - 1]
] = value;
return obj;
}
function toBool(str) {
if (typeof str === 'undefined' || str === null) return undefined;
return /(TRUE)|1/i.test(str);
}
}}
{
const proxy = {};
const obfs = {};
const $ = {};
const params = {};
}
start = (trojan) {
return proxy
}
trojan = "trojan://" password:password "@" server:server ":" port:port "/"? params? name:name?{
proxy.type = "trojan";
proxy.password = password;
proxy.server = server;
proxy.port = port;
proxy.name = name;
// name may be empty
if (!proxy.name) {
proxy.name = server + ":" + port;
}
};
password = match:$[^@]+ {
return decodeURIComponent(match);
};
server = ip/domain;
domain = match:[0-9a-zA-z-_.]+ {
const domain = match.join("");
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
return domain;
}
}
ip = & {
const start = peg$currPos;
let end;
let j = start;
while (j < input.length) {
if (input[j] === ",") break;
if (input[j] === ":") end = j;
j++;
}
peg$currPos = end || j;
$.ip = input.substring(start, end).trim();
return true;
} { return $.ip; }
port = digits:[0-9]+ {
const port = parseInt(digits.join(""), 10);
if (port >= 0 && port <= 65535) {
return port;
} else {
throw new Error("Invalid port: " + port);
}
}
params = "?" head:param tail:("&"@param)* {
for (const [key, value] of Object.entries(params)) {
params[key] = decodeURIComponent(value);
}
proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
proxy.sni = params["sni"] || params["peer"];
proxy['client-fingerprint'] = params.fp;
proxy.alpn = params.alpn ? decodeURIComponent(params.alpn).split(',') : undefined;
if (toBool(params["ws"])) {
proxy.network = "ws";
$set(proxy, "ws-opts.path", params["wspath"]);
}
if (params["type"]) {
let httpupgrade
proxy.network = params["type"]
if(proxy.network === 'httpupgrade') {
proxy.network = 'ws'
httpupgrade = true
}
if (['grpc'].includes(proxy.network)) {
proxy[proxy.network + '-opts'] = {
'grpc-service-name': params["serviceName"],
'_grpc-type': params["mode"],
'_grpc-authority': params["authority"],
};
} else {
if (params["path"]) {
$set(proxy, proxy.network+"-opts.path", decodeURIComponent(params["path"]));
}
if (params["host"]) {
$set(proxy, proxy.network+"-opts.headers.Host", decodeURIComponent(params["host"]));
}
if (httpupgrade) {
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade", true);
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade-fast-open", true);
}
}
if (['reality'].includes(params.security)) {
const opts = {};
if (params.pbk) {
opts['public-key'] = params.pbk;
}
if (params.sid) {
opts['short-id'] = params.sid;
}
if (params.spx) {
opts['_spider-x'] = params.spx;
}
if (params.mode) {
proxy._mode = params.mode;
}
if (params.extra) {
proxy._extra = params.extra;
}
if (Object.keys(opts).length > 0) {
$set(proxy, params.security+"-opts", opts);
}
}
}
proxy.udp = toBool(params["udp"]);
proxy.tfo = toBool(params["tfo"]);
}
param = kv/single;
kv = key:$[a-z]i+ "=" value:$[^&#]i* {
params[key] = value;
}
single = key:$[a-z]i+ {
params[key] = true;
};
name = "#" + match:$.* {
return decodeURIComponent(match);
}
`,Ud;function Hd(){return Ud||(Ud=zE.generate(G7)),Ud}var Kd=On(qd());function YE(e){let[t,r]=e.match(/,\s*?port-hopping\s*?=\s*?["']?\s*?((\d+(-\d+)?)([,;]\d+(-\d+)?)*)\s*?["']?\s*?/)||[];return{port_hopping:r?r.replace(/;/g,","):void 0,line:t?e.replace(t,""):e}}function z7(){return{name:"URI PROXY Parser",test:n=>/^(socks5\+tls|socks5|http|https):\/\//.test(n),parse:n=>{let[s,u,i,o,l,f,d,E,p]=n.match(/^(socks5|http|http)(\+tls|s)?:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(d)d=parseInt(d,10);else{if(i)d=443;else if(u==="http")d=80;else throw x.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);x.info(`port is not present in line: ${n}, set to ${d}`)}return{name:p!=null?decodeURIComponent(p):`${u} ${f}:${d}`,type:u,tls:!!i,server:f,port:d,username:o!=null?decodeURIComponent(o):void 0,password:l!=null?decodeURIComponent(l):void 0}}}}function Y7(){return{name:"URI SOCKS Parser",test:n=>/^socks:\/\//.test(n),parse:n=>{let[s,u,i,o,l,f,d]=n.match(/^(socks)?:\/\/(?:(.*)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(l)l=parseInt(l,10);else throw x.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);let E,p;if(i){let w=dt.decode(decodeURIComponent(i)).split(":");E=w[0],p=w[1]}return{name:d!=null?decodeURIComponent(d):`${u} ${o}:${l}`,type:"socks5",server:o,port:l,username:E,password:p}}}}function W7(){return{name:"URI SS Parser",test:n=>/^ss:\/\//.test(n),parse:n=>{let s=n.split("ss://")[1],u=n.split("#")[1],i={type:"ss"};s=s.split("#")[0];let o=s.match(/@([^/?]*)(\/|\?|$)/),l=decodeURIComponent(s.split("@")[0]),f;l?.startsWith("2022-blake3-")?f=l:f=dt.decode(l);let d="";if(o)s.includes("?")&&(d=s.match(/(\?.*)$/)[1]);else{if(s.includes("?")){let D=s.match(/^(.*)(\?.*)$/);s=D[1],d=D[2]}if(s=dt.decode(s),d){if(/(&|\?)v2ray-plugin=/.test(d)){let A=d.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/)[2];A&&(i.plugin="v2ray-plugin",i["plugin-opts"]=JSON.parse(dt.decode(A)))}s=`${s}${d}`}f=s.match(/(^.*)@/)?.[1],o=s.match(/@([^/@]*)(\/|$)/)}let E=o[1],p=E.lastIndexOf(":");i.server=E.substring(0,p),i.port=`${E.substring(p+1)}`.match(/\d+/)?.[0];let h=f.match(/(^.*?):(.*$)/);i.cipher=h?.[1],i.password=h?.[2];let w=s.match(/[?&]plugin=([^&]+)/),v=s.match(/[?&]shadow-tls=([^&]+)/);if(w){let D=("plugin="+decodeURIComponent(w[1])).split(";"),A={};for(let F of D){let[S,B]=F.split("=");S&&(A[S]=B||!0)}switch(A.plugin){case"obfs-local":case"simple-obfs":i.plugin="obfs",i["plugin-opts"]={mode:A.obfs,host:tr(A["obfs-host"])};break;case"v2ray-plugin":i.plugin="v2ray-plugin",i["plugin-opts"]={mode:"websocket",host:tr(A["obfs-host"]),path:tr(A.path),tls:bo(A.tls)};break;case"shadow-tls":{i.plugin="shadow-tls";let F=tr(A.version);i["plugin-opts"]={host:tr(A.host),password:tr(A.password),version:F?parseInt(F,10):void 0};break}default:throw new Error(`Unsupported plugin option: ${A.plugin}`)}}if(v){let D=JSON.parse(dt.decode(v[1])),A=tr(D.version),F=tr(D.address),S=tr(D.port);i.plugin="shadow-tls",i["plugin-opts"]={host:tr(D.host),password:tr(D.password),version:A?parseInt(A,10):void 0},F&&(i.server=F),S&&(i.port=parseInt(S,10))}return/(&|\?)uot=(1|true)/i.test(d)&&(i["udp-over-tcp"]=!0),/(&|\?)tfo=(1|true)/i.test(d)&&(i.tfo=!0),u!=null&&(u=decodeURIComponent(u)),i.name=u??`SS ${i.server}:${i.port}`,i}}}function J7(){return{name:"URI SSR Parser",test:n=>/^ssr:\/\//.test(n),parse:n=>{n=dt.decode(n.split("ssr://")[1]);let s=n.indexOf(":origin");s===-1&&(s=n.indexOf(":auth_"));let u=n.substring(0,s),i=u.substring(0,u.lastIndexOf(":")),o=u.substring(u.lastIndexOf(":")+1),l=n.substring(s+1).split("/?")[0].split(":"),f={type:"ssr",server:i,port:o,protocol:l[0],cipher:l[1],obfs:l[2],password:dt.decode(l[3])},d={};if(n=n.split("/?")[1].split("&"),n.length>1)for(let E of n){let[p,h]=E.split("=");h=h.trim(),h.length>0&&h!=="(null)"&&(d[p]=h)}return f={...f,name:d.remarks?dt.decode(d.remarks):f.server,"protocol-param":tr(dt.decode(d.protoparam||"").replace(/\s/g,"")),"obfs-param":tr(dt.decode(d.obfsparam||"").replace(/\s/g,""))},f}}}function X7(){return{name:"URI VMess Parser",test:n=>/^vmess:\/\//.test(n),parse:n=>{n=n.split("vmess://")[1];let s=dt.decode(n.replace(/\?.*?$/,""));if(/=\s*vmess/.test(s)){let u=s.split(",").map(l=>l.trim()),i={};for(let l of u)if(l.indexOf("=")!==-1){let[f,d]=l.split("=");i[f.trim()]=d.trim()}let o={name:u[0].split("=")[0].trim(),type:"vmess",server:u[1],port:u[2],cipher:tr(u[3],"auto"),uuid:u[4].match(/^"(.*)"$/)[1],tls:i.obfs==="wss",udp:bo(i["udp-relay"]),tfo:bo(i["fast-open"]),"skip-cert-verify":So(i["tls-verification"])?!i["tls-verification"]:void 0};if(So(i.obfs))if(i.obfs==="ws"||i.obfs==="wss"){o.network="ws",o["ws-opts"].path=(tr(i["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];let l=i["obfs-header"];l&&l.indexOf("Host")!==-1&&(l=l.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),Fs(l)&&(o["ws-opts"].headers={Host:l})}else throw new Error(`Unsupported obfs: ${i.obfs}`);return o}else{let u={};try{u=JSON.parse(s)}catch{let[E,p,h]=/(^[^?]+?)\/?\?(.*)$/.exec(n);s=dt.decode(p);for(let S of h.split("&")){let[B,_]=S.split("="),K=_;K=decodeURIComponent(_),K.indexOf(",")===-1?u[B]=K:u[B]=K.split(",")}let[w,v,D,A,F]=/(^[^:]+?):([^:]+?)@(.*):(\d+)$/.exec(s);u.scy=v,u.id=D,u.port=F,u.add=A}let i=u.add,o=parseInt(bo(u.port),10),l={name:u.ps??u.remarks??u.remark??`VMess ${i}:${o}`,type:"vmess",server:i,port:o,cipher:["auto","aes-128-gcm","chacha20-poly1305","none"].includes(u.scy)?u.scy:"auto",uuid:u.id,alterId:parseInt(bo(u.aid??u.alterId,0),10),tls:["tls",!0,1,"1"].includes(u.tls),"skip-cert-verify":So(u.verify_cert)?!u.verify_cert:void 0};!l["skip-cert-verify"]&&So(u.allowInsecure)&&(l["skip-cert-verify"]=/(TRUE)|1/i.test(u.allowInsecure)),l.tls&&(u.sni&&u.sni!==""?l.sni=u.sni:u.peer&&u.peer!==""&&(l.sni=u.peer));let f=!1;if(u.net==="ws"||u.obfs==="websocket"?l.network="ws":["http"].includes(u.net)||["http"].includes(u.obfs)||["http"].includes(u.type)?l.network="http":["grpc","kcp","quic"].includes(u.net)?l.network=u.net:u.net==="httpupgrade"||l.network==="httpupgrade"?(l.network="ws",f=!0):(u.net==="h2"||l.network==="h2")&&(l.network="h2"),l.network){let d=u.host??u.obfsParam;try{let h=JSON.parse(d)?.Host;h&&(d=h)}catch{}let E=u.path;if(["ws"].includes(l.network)&&(E=E||"/"),l.network==="http"&&(d&&(d=d.split(",").map(p=>p.trim()),d=Array.isArray(d)?d[0]:d),E?E=Array.isArray(E)?E[0]:E:E="/"),E||d||["kcp","quic"].includes(l.network))if(["grpc"].includes(l.network))l[`${l.network}-opts`]={"grpc-service-name":tr(E),"_grpc-type":tr(u.type),"_grpc-authority":tr(u.authority)};else if(["kcp","quic"].includes(l.network))l[`${l.network}-opts`]={[`_${l.network}-type`]:tr(u.type),[`_${l.network}-host`]:tr(tr(d)),[`_${l.network}-path`]:tr(E)};else{let p={path:tr(E),headers:{Host:tr(d)}};f&&(p["v2ray-http-upgrade"]=!0,p["v2ray-http-upgrade-fast-open"]=!0),l[`${l.network}-opts`]=p}else delete l.network}return l["client-fingerprint"]=u.fp,l.alpn=u.alpn?u.alpn.split(","):void 0,l}}}}function Z7(){return{name:"URI VLESS Parser",test:n=>/^vless:\/\//.test(n),parse:n=>{n=n.split("vless://")[1];let s,u=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);if(!u){let[D,A,F]=/^(.*?)(\?.*?$)/.exec(n);n=`${dt.decode(A)}${F}`,u=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n),s=!0}let[i,o,l,f,d,E="",p]=u;s&&(o=o.replace(/^.*?:/g,"")),f=parseInt(`${f}`,10),o=decodeURIComponent(o),p!=null&&(p=decodeURIComponent(p));let h={type:"vless",name:p,server:l,port:f,uuid:o},w={};for(let D of E.split("&")){let[A,F]=D.split("="),S=F;S=decodeURIComponent(F),w[A]=S}if(h.name=p??w.remarks??w.remark??`VLESS ${l}:${f}`,h.tls=w.security&&w.security!=="none",s&&/TRUE|1/i.test(w.tls)&&(h.tls=!0,w.security=w.security??"reality"),h.sni=w.sni||w.peer,h.flow=w.flow,!h.flow&&s&&w.xtls){let D=[void 0,"xtls-rprx-direct","xtls-rprx-vision"][w.xtls];D&&(h.flow=D)}if(h["client-fingerprint"]=w.fp,h.alpn=w.alpn?w.alpn.split(","):void 0,h["skip-cert-verify"]=/(TRUE)|1/i.test(w.allowInsecure),["reality"].includes(w.security)){let D={};w.pbk&&(D["public-key"]=w.pbk),w.sid&&(D["short-id"]=w.sid),w.spx&&(D["_spider-x"]=w.spx),Object.keys(D).length>0&&(h[`${w.security}-opts`]=D)}let v=!1;if(h.network=w.type,h.network==="tcp"&&w.headerType==="http"?h.network="http":h.network==="httpupgrade"&&(h.network="ws",v=!0),!h.network&&s&&w.obfs&&(h.network=w.obfs,["none"].includes(h.network)&&(h.network="tcp")),["websocket"].includes(h.network)&&(h.network="ws"),h.network&&!["tcp","none"].includes(h.network)){let D={},A=w.host??w.obfsParam;if(A)if(w.obfsParam)try{let F=JSON.parse(A);D.headers=F}catch{D.headers={Host:A}}else D.headers={Host:A};w.serviceName?(D[`${h.network}-service-name`]=w.serviceName,["grpc"].includes(h.network)&&w.authority&&(D["_grpc-authority"]=w.authority)):s&&w.path&&(["ws","http","h2"].includes(h.network)||(D[`${h.network}-service-name`]=w.path,delete w.path)),w.path&&(D.path=w.path),["grpc"].includes(h.network)&&(D["_grpc-type"]=w.mode||"gun"),v&&(D["v2ray-http-upgrade"]=!0,D["v2ray-http-upgrade-fast-open"]=!0),Object.keys(D).length>0&&(h[`${h.network}-opts`]=D),h.network==="kcp"&&(w.seed&&(h.seed=w.seed),h.headerType=w.headerType||"none"),w.mode&&(h._mode=w.mode),w.extra&&(h._extra=w.extra)}return h}}}function Q7(){return{name:"URI AnyTLS Parser",test:n=>/^anytls:\/\//.test(n),parse:n=>{n=n.split(/anytls:\/\//)[1];let[s,u,i,o,l="",f]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);u=decodeURIComponent(u),o=parseInt(`${o}`,10),isNaN(o)&&(o=443),u=decodeURIComponent(u),f!=null&&(f=decodeURIComponent(f)),f=f??`AnyTLS ${i}:${o}`;let d={type:"anytls",name:f,server:i,port:o,password:u};for(let E of l.split("&")){let[p,h]=E.split("=");p=p.replace(/_/g,"-"),h=decodeURIComponent(h),["alpn"].includes(p)?d[p]=h?h.split(","):void 0:["insecure"].includes(p)?d["skip-cert-verify"]=/(TRUE)|1/i.test(h):["udp"].includes(p)?d[p]=/(TRUE)|1/i.test(h):d[p]=h}return d}}}function e$(){return{name:"URI Hysteria2 Parser",test:n=>/^(hysteria2|hy2):\/\//.test(n),parse:n=>{n=n.split(/(hysteria2|hy2):\/\//)[2];let s,[u,i,o,l,f,d,E,p,h,w,v="",D]=/^(.*?)@(.*?)(:((\d+(-\d+)?)([,;]\d+(-\d+)?)*))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);/^\d+$/.test(f)?(f=parseInt(`${f}`,10),isNaN(f)&&(f=443)):f?(s=f,f=_c(s)):f=443,i=decodeURIComponent(i),D!=null&&(D=decodeURIComponent(D)),D=D??`Hysteria2 ${o}:${f}`;let A={type:"hysteria2",name:D,server:o,port:f,ports:s,password:i},F={};for(let _ of v.split("&")){let[K,G]=_.split("="),b=G;b=decodeURIComponent(G),F[K]=b}A.sni=F.sni,!A.sni&&F.peer&&(A.sni=F.peer),F.obfs&&F.obfs!=="none"&&(A.obfs=F.obfs),F.mport&&(A.ports=F.mport),A["obfs-password"]=F["obfs-password"],A["skip-cert-verify"]=/(TRUE)|1/i.test(F.insecure),A.tfo=/(TRUE)|1/i.test(F.fastopen),A["tls-fingerprint"]=F.pinSHA256;let S=F["hop-interval"]||F.hop_interval;/^\d+$/.test(S)&&(A["hop-interval"]=parseInt(`${S}`,10));let B=F.keepalive;return/^\d+$/.test(B)&&(A.keepalive=parseInt(`${B}`,10)),A}}}function t$(){return{name:"URI Hysteria Parser",test:n=>/^(hysteria|hy):\/\//.test(n),parse:n=>{n=n.split(/(hysteria|hy):\/\//)[2];let[s,u,i,o,l,f="",d]=/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);o=parseInt(`${o}`,10),isNaN(o)&&(o=443),d!=null&&(d=decodeURIComponent(d)),d=d??`Hysteria ${u}:${o}`;let E={type:"hysteria",name:d,server:u,port:o},p={};for(let h of f.split("&")){let[w,v]=h.split("=");w=w.replace(/_/,"-"),v=decodeURIComponent(v),["alpn"].includes(w)?E[w]=v?v.split(","):void 0:["insecure"].includes(w)?E["skip-cert-verify"]=/(TRUE)|1/i.test(v):["auth"].includes(w)?E["auth-str"]=v:["mport"].includes(w)?E.ports=v:["obfsParam"].includes(w)?E.obfs=v:["upmbps"].includes(w)?E.up=v:["downmbps"].includes(w)?E.down=v:["obfs"].includes(w)?E._obfs=v||"":["fast-open","peer"].includes(w)?p[w]=v:E[w]=v}return!E.sni&&p.peer&&(E.sni=p.peer),!E["fast-open"]&&p.fastopen&&(E["fast-open"]=!0),E.protocol||(E.protocol="udp"),E}}}function r$(){return{name:"URI TUIC Parser",test:n=>/^tuic:\/\//.test(n),parse:n=>{n=n.split(/tuic:\/\//)[1];let[s,u,i,o,l="",f]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);u=decodeURIComponent(u);let[d,...E]=u.split(":"),p=E.join(":");o=parseInt(`${o}`,10),isNaN(o)&&(o=443),p=decodeURIComponent(p),f!=null&&(f=decodeURIComponent(f)),f=f??`TUIC ${i}:${o}`;let h={type:"tuic",name:f,server:i,port:o,password:p,uuid:d};for(let w of l.split("&")){let[v,D]=w.split("=");v=v.replace(/_/g,"-"),D=decodeURIComponent(D),["alpn"].includes(v)?h[v]=D?D.split(","):void 0:["allow-insecure"].includes(v)?h["skip-cert-verify"]=/(TRUE)|1/i.test(D):["fast-open"].includes(v)?h.tfo=!0:["disable-sni","reduce-rtt"].includes(v)?h[v]=/(TRUE)|1/i.test(D):v==="congestion-control"?(h["congestion-controller"]=D,delete h[v]):h[v]=D}return h}}}function n$(){return{name:"URI WireGuard Parser",test:n=>/^(wireguard|wg):\/\//.test(n),parse:n=>{n=n.split(/(wireguard|wg):\/\//)[2];let[s,u,i,o,l,f,d,E="",p]=/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);f=parseInt(`${f}`,10),isNaN(f)&&(f=51820),i=decodeURIComponent(i),p!=null&&(p=decodeURIComponent(p)),p=p??`WireGuard ${o}:${f}`;let h={type:"wireguard",name:p,server:o,port:f,"private-key":i,udp:!0};for(let w of E.split("&")){let[v,D]=w.split("=");if(v=v.replace(/_/,"-"),D=decodeURIComponent(D),["reserved"].includes(v)){let A=D.split(",").map(F=>parseInt(F.trim(),10)).filter(F=>Number.isInteger(F));A.length===3&&(h[v]=A)}else if(["address","ip"].includes(v))D.split(",").map(A=>{let F=A.trim().replace(/\/\d+$/,"").replace(/^\[/,"").replace(/\]$/,"");Rr(F)?h.ip=F:Ur(F)&&(h.ipv6=F)});else if(["mtu"].includes(v)){let A=parseInt(D.trim(),10);Number.isInteger(A)&&(h[v]=A)}else/publickey/i.test(v)?h["public-key"]=D:/privatekey/i.test(v)?h["private-key"]=D:["udp"].includes(v)?h[v]=/(TRUE)|1/i.test(D):["flag"].includes(v)||(h[v]=D)}return h}}}function i$(){return{name:"URI Trojan Parser",test:n=>/^trojan:\/\//.test(n),parse:n=>{let s=/^(trojan:\/\/.*?@.*?)(:(\d+))?\/?(\?.*?)?$/.exec(n);s?.[2]||(n=n.replace(s[1],`${s[1]}:443`));let[i,o]=n.split(/#(.+)/,2),f=Hd().parse(i);if(Fs(o))try{f.name=decodeURIComponent(o)}catch(d){console.log(d)}return f}}}function s$(){return{name:"Clash Parser",test:n=>{let s;try{s=Kd.default.parse(n)}catch{s=Ss.parse(n)}return!!s?.type},parse:n=>{let s;try{s=Kd.default.parse(n)}catch{s=Ss.parse(n)}if(!["anytls","mieru","juicity","ss","ssr","vmess","socks5","http","snell","trojan","tuic","vless","hysteria","hysteria2","wireguard","ssh","direct"].includes(s.type))throw new Error(`Clash does not support proxy with type: ${s.type}`);return["vmess","vless"].includes(s.type)&&(s.sni=s.servername,delete s.servername),s["server-cert-fingerprint"]&&(s["tls-fingerprint"]=s["server-cert-fingerprint"]),s.fingerprint&&(s["tls-fingerprint"]=s.fingerprint),s["dialer-proxy"]&&(s["underlying-proxy"]=s["dialer-proxy"]),s["benchmark-url"]&&(s["test-url"]=s["benchmark-url"]),s["benchmark-timeout"]&&(s["test-timeout"]=s["benchmark-timeout"]),s}}}function u$(){return{name:"QX SS Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")===-1,parse:n=>Su().parse(n)}}function a$(){return{name:"QX SSR Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")!==-1,parse:n=>Su().parse(n)}}function o$(){return{name:"QX VMess Parser",test:n=>/^vmess\s*=/.test(n.split(",")[0].trim()),parse:n=>Su().parse(n)}}function c$(){return{name:"QX VLESS Parser",test:n=>/^vless\s*=/.test(n.split(",")[0].trim()),parse:n=>Su().parse(n)}}function l$(){return{name:"QX Trojan Parser",test:n=>/^trojan\s*=/.test(n.split(",")[0].trim()),parse:n=>Su().parse(n)}}function f$(){return{name:"QX HTTP Parser",test:n=>/^http\s*=/.test(n.split(",")[0].trim()),parse:n=>Su().parse(n)}}function h$(){return{name:"QX Socks5 Parser",test:n=>/^socks5\s*=/.test(n.split(",")[0].trim()),parse:n=>Su().parse(n)}}function p$(){return{name:"Loon SS Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocks",parse:n=>Ls().parse(n)}}function d$(){return{name:"Loon SSR Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocksr",parse:n=>Ls().parse(n)}}function g$(){return{name:"Loon VMess Parser",test:n=>/^.*=\s*vmess/i.test(n.split(",")[0])&&n.indexOf("username")===-1,parse:n=>Ls().parse(n)}}function m$(){return{name:"Loon Vless Parser",test:n=>/^.*=\s*vless/i.test(n.split(",")[0]),parse:n=>Ls().parse(n)}}function v$(){return{name:"Loon Trojan Parser",test:n=>/^.*=\s*trojan/i.test(n.split(",")[0]),parse:n=>Ls().parse(n)}}function A$(){return{name:"Loon Hysteria2 Parser",test:n=>/^.*=\s*Hysteria2/i.test(n.split(",")[0]),parse:n=>Ls().parse(n)}}function E$(){return{name:"Loon HTTP Parser",test:n=>/^.*=\s*http/i.test(n.split(",")[0]),parse:n=>Ls().parse(n)}}function w$(){return{name:"Loon SOCKS5 Parser",test:n=>/^.*=\s*socks5/i.test(n.split(",")[0]),parse:n=>Ls().parse(n)}}function F$(){return{name:"Loon WireGuard Parser",test:n=>/^.*=\s*wireguard/i.test(n.split(",")[0]),parse:n=>{let s=n.match(/(^.*?)\s*?=\s*?wireguard\s*?,.+?\s*?=\s*?.+?/i)?.[1];n=n.replace(s,"").replace(/^\s*?=\s*?wireguard\s*/i,"");let u=n.match(/,\s*?peers\s*?=\s*?\[\s*?\{\s*?(.+?)\s*?\}\s*?\]/i)?.[1],i=u.match(/(,|^)\s*?endpoint\s*?=\s*?"?(.+?):(\d+)"?\s*?(,|$)/i),o=i?.[2],l=parseInt(i?.[3],10),f=n.match(/(,|^)\s*?mtu\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];f&&(f=parseInt(f,10));let d=n.match(/(,|^)\s*?keepalive\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];d&&(d=parseInt(d,10));let E=u.match(/(,|^)\s*?reserved\s*?=\s*?"?(\[\s*?.+?\s*?\])"?\s*?(,|$)/i)?.[2];E&&(E=JSON.parse(E));let p,h=n.match(/(,|^)\s*?dns\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],w=n.match(/(,|^)\s*?dnsv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2];(h||w)&&(p=[],h&&p.push(h),w&&p.push(w));let v=u.match(/(,|^)\s*?allowed-ips\s*?=\s*?"(.+?)"\s*?(,|$)/i)?.[2]?.split(",").map(_=>_.trim()),D=u.match(/(,|^)\s*?preshared-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],A=n.match(/(,|^)\s*?interface-ip\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],F=n.match(/(,|^)\s*?interface-ipv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],S=u.match(/(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],B={type:"wireguard",name:s,server:o,port:l,ip:A,ipv6:F,"private-key":n.match(/(,|^)\s*?private-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],"public-key":S,mtu:f,keepalive:d,reserved:E,"allowed-ips":v,"preshared-key":D,dns:p,udp:!0,peers:[{server:o,port:l,ip:A,ipv6:F,"public-key":S,"pre-shared-key":D,"allowed-ips":v,reserved:E}]};return Array.isArray(B.dns)&&B.dns.length>0&&(B["remote-dns-resolve"]=!0),B}}}function C$(){return{name:"Surge Direct Parser",test:n=>/^.*=\s*direct/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function D$(){return{name:"Surge SSH Parser",test:n=>/^.*=\s*ssh/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function y$(){return{name:"Surge SS Parser",test:n=>/^.*=\s*ss/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function S$(){return{name:"Surge VMess Parser",test:n=>/^.*=\s*vmess/.test(n.split(",")[0])&&n.indexOf("username")!==-1,parse:n=>Si().parse(n)}}function b$(){return{name:"Surge Trojan Parser",test:n=>/^.*=\s*trojan/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function _$(){return{name:"Surge HTTP Parser",test:n=>/^.*=\s*https?/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function B$(){return{name:"Surge Socks5 Parser",test:n=>/^.*=\s*socks5(-tls)?/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function I$(){return{name:"Surge External Parser",test:n=>/^.*=\s*external/.test(n.split(",")[0]),parse:n=>{let s=/^\s*(.*?)\s*?=\s*?external\s*?,\s*(.*?)\s*$/.exec(n),[u,i,o]=s;n=o;let l=/(,|^)\s*?exec\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];l||(l=/(,|^)\s*?exec\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let f=/(,|^)\s*?local-port\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];f||(f=/(,|^)\s*?local-port\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let d=/(,|^)\s*?args\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,E,p=[];for(;(E=d.exec(n))!==null;)E[3]!=null?p.push(E[3]):E[4]!=null&&p.push(E[4]);let h=/(,|^)\s*?addresses\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,w,v=[];for(;(w=h.exec(n))!==null;){let A;w[3]!=null?A=w[3]:w[4]!=null&&(A=w[4]),A!=null&&(A=`${A}`.trim().replace(/^\[/,"").replace(/\]$/,"")),x$(A)&&v.push(A)}return{type:"external",name:i,exec:l,"local-port":f,args:p,addresses:v}}}}function $$(){return{name:"Surge Snell Parser",test:n=>/^.*=\s*snell/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function P$(){return{name:"Surge Tuic Parser",test:n=>/^.*=\s*tuic(-v5)?/.test(n.split(",")[0]),parse:n=>{let{port_hopping:s,line:u}=YE(n),i=Si().parse(u);return i.ports=s,i}}}function R$(){return{name:"Surge WireGuard Parser",test:n=>/^.*=\s*wireguard/.test(n.split(",")[0]),parse:n=>Si().parse(n)}}function T$(){return{name:"Surge Hysteria2 Parser",test:n=>/^.*=\s*hysteria2/.test(n.split(",")[0]),parse:n=>{let{port_hopping:s,line:u}=YE(n),i=Si().parse(u);return i.ports=s,i}}}function x$(e){return Rr(e)||Ur(e)}var WE=[z7(),Y7(),W7(),J7(),X7(),Z7(),r$(),n$(),t$(),e$(),i$(),Q7(),s$(),C$(),D$(),y$(),S$(),b$(),_$(),$$(),P$(),R$(),T$(),B$(),I$(),p$(),d$(),g$(),m$(),A$(),v$(),E$(),w$(),F$(),u$(),a$(),o$(),c$(),l$(),f$(),h$()];var QE=On(qd());function O$(e){for(let t of Of)try{if(t.test(e))return x.info(`Pre-processor [${t.name}] activated`),t.parse(e)}catch(r){x.error(`Parser [${t.name}] failed
Reason: ${r}`)}return e}function k$(e){e=O$(e);let t=e.split(`
`),r=[],n;for(let s of t){if(s=s.trim(),s.length===0)continue;let u=!1;if(n){let[i,o]=JE(n,s);o||(r.push(ZE(i)),u=!0)}if(!u)for(let i of WE){let[o,l]=JE(i,s);if(!l){r.push(ZE(o)),n=i,u=!0,x.info(`${i.name} is activated`);break}}u||x.error(`Failed to parse line: ${s}`)}return r.filter(s=>(["vless","vmess"].includes(s.type)&&(mf(s.uuid)||x.error(`UUID may be invalid: ${s.name} ${s.uuid}`)),!0))}async function N$(proxies,operators=[],targetPlatform,source,$options){for(let item of operators){if(item.disabled){x.log(`Skipping disabled operator: "${item.type}" with arguments:
>>> ${JSON.stringify(item.args,null,2)||"None"}`);continue}let script,$arguments={};if(item.type.indexOf("Script")!==-1){let{mode,content}=item.args;if(mode==="link"){let url=content||"",rawArgs=url.split("#");if(rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let t of rawArgs[1].split("&")){let r=t.split("=")[0],n=t.split("=")[1];$arguments[r]=n==null||n===""?!0:decodeURIComponent(n)}}url=`${url.split("#")[0]}${rawArgs[2]?`#${rawArgs[2]}`:$arguments?.noCache!=null||$arguments?.insecure!=null?`#${rawArgs[1]}`:""}`;let downloadUrlMatch=url.split("#")[0].match(/^\/api\/(file|module)\/(.+)/);if(downloadUrlMatch){let e="";try{e=downloadUrlMatch?.[1];let t=downloadUrlMatch?.[2];if(t==null)throw new Error(`\u672C\u5730 ${e} URL \u65E0\u6548: ${url}`);t=decodeURIComponent(t);let r=e==="module"?vn:It,n=$t(x.read(r),t);if(!n)throw new Error(`\u627E\u4E0D\u5230 ${e}: ${t}`);e==="module"?script=n.content:script=await ks({type:"file",name:t})}catch(t){throw x.error(`Error when loading ${e}: ${item.args.content}.
Reason: ${t}`),new Error(`\u65E0\u6CD5\u52A0\u8F7D ${e}: ${url}`)}}else if(url?.startsWith("/"))try{let fs=eval('require("fs")');script=fs.readFileSync(url.split("#")[0],"utf8")}catch(e){throw x.error(`Error when reading local script: ${item.args.content}.
Reason: ${e}`),new Error(`\u65E0\u6CD5\u4ECE\u8BE5\u8DEF\u5F84\u8BFB\u53D6\u811A\u672C\u6587\u4EF6: ${url}`)}else try{script=await bi(url)}catch(e){throw x.error(`Error when downloading remote script: ${item.args.content}.
Reason: ${e}`),new Error(`\u65E0\u6CD5\u4E0B\u8F7D\u811A\u672C: ${url}`)}}else script=content,$arguments=item.args.arguments||{}}if(!uh[item.type]){x.error(`Unknown operator: "${item.type}"`);continue}x.log(`Applying "${item.type}" with arguments:
>>> ${JSON.stringify(item.args,null,2)||"None"}`);let processor;item.type.indexOf("Script")!==-1?processor=uh[item.type](script,targetPlatform,$arguments,source,$options):processor=uh[item.type](item.args||{}),proxies=await IA(processor,proxies)}return proxies}function L$(e,t,r,n={}){let s=LA[t];if(!s)throw new Error(`Target platform: ${t} is not supported!`);let u=/Surge|SurgeMac|Shadowrocket/i.test(t);if(e=e.filter(i=>i.supported&&i.supported[t]===!1?!1:(["vless","vmess"].includes(i.type)&&(mf(i.uuid)||x.error(`UUID may be invalid: ${i.name} ${i.uuid}`)),!0)),e=e.map(i=>(i._resolved=i.resolved,Fs(i.name)||(i.name=`${i.type} ${i.server}:${i.port}`),i["disable-sni"]&&(u?i.sni="off":["tuic"].includes(i.type)||(x.error(`Target platform ${t} does not support sni off. Proxy's fields (sni, tls-fingerprint and skip-cert-verify) will be modified.`),i.sni="",i["skip-cert-verify"]=!0,delete i["tls-fingerprint"])),i.ports&&(i.ports=String(i.ports),["ClashMeta"].includes(t)||(i.ports=i.ports.replace(/\//g,",")),i.port||(i.port=_c(i.ports))),i)),x.log(`Producing proxies for target: ${t}`),typeof s.type>"u"||s.type==="SINGLE"){let i=e.map(o=>{try{return s.produce(o,r,n)}catch(l){return x.error(`Cannot produce proxy: ${JSON.stringify(o,null,2)}
Reason: ${l}`),""}}).filter(o=>o.length>0);return i=r==="internal"?i:i.join(`
`),t.startsWith("Surge")&&e.length>0&&e.every(o=>o.type==="wireguard")&&(i=`#!name=${e[0]?._subName}
#!desc=${e[0]?._desc??""}
#!category=${e[0]?._category??""}
${i}`),i}else if(s.type==="ALL")return s.produce(e,r,n)}var dr={parse:k$,process:N$,produce:L$,ipAddress:gf,getRandomPort:_c,isIPv4:Rr,isIPv6:Ur,isIP:Vd,yaml:Ss,getFlag:zo,removeFlag:Vc,getISO:lA,MMDB:eh,Gist:Li,download:bi,downloadFile:ew,isValidUUID:mf,doh:Wo,Buffer:Eh.Buffer,Base64:dt,JSON5:QE.default};function JE(e,t){if(!U$(e,t))return[null,new Error("Parser mismatch")];try{return[e.parse(t),null]}catch(r){return[null,r]}}function U$(e,t){try{return e.test(t)}catch{return!1}}function XE(e){if(typeof e=="string"||typeof e=="number"){if(e=String(e).trim(),e==="")return"/";if(!e.startsWith("/"))return"/"+e}return e}function ZE(e){typeof e.cipher=="string"&&(e.cipher=e.cipher.toLowerCase()),typeof e.password=="number"&&(e.password=Em(e.password)),["ss"].includes(e.type)&&e.cipher==="none"&&!e.password&&(e.password=""),e.interface&&(e["interface-name"]=e.interface,delete e.interface),Am(e.port)&&(e.port=parseInt(e.port,10)),e.server&&(e.server=`${e.server}`.trim().replace(/^\[/,"").replace(/\]$/,"")),e.network==="ws"&&(!e["ws-opts"]&&(e["ws-path"]||e["ws-headers"])&&(e["ws-opts"]={},e["ws-path"]&&(e["ws-opts"].path=e["ws-path"]),e["ws-headers"]&&(e["ws-opts"].headers=e["ws-headers"])),delete e["ws-path"],delete e["ws-headers"]);let t=e[`${e.network}-opts`]?.path;if(Array.isArray(t)?e[`${e.network}-opts`].path=t.map(n=>XE(n)):t!=null&&(e[`${e.network}-opts`].path=XE(t)),e.type==="trojan"&&e.network==="tcp"&&delete e.network,["vless"].includes(e.type)&&(e.network||(e.network="tcp")),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(e.type)&&(e.tls=!0),e.network){let n=e[`${e.network}-opts`]?.headers?.Host,s=e[`${e.network}-opts`]?.headers?.host;e.network==="h2"?!s&&n&&(e[`${e.network}-opts`].headers.host=n,delete e[`${e.network}-opts`].headers.Host):s&&!n&&(e[`${e.network}-opts`].headers.Host=s,delete e[`${e.network}-opts`].headers.host)}if(e.network==="h2"){let n=e["h2-opts"]?.headers?.host,s=e["h2-opts"]?.path;n&&!Array.isArray(n)&&(e["h2-opts"].headers.host=[n]),Array.isArray(s)&&(e["h2-opts"].path=s[0])}if(!e.tls&&["ws","http"].includes(e.network)&&!e[`${e.network}-opts`]?.headers?.Host&&!Vd(e.server)&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].headers=e[`${e.network}-opts`].headers||{},e[`${e.network}-opts`].headers.Host=["vmess","vless"].includes(e.type)&&e.network==="http"?[e.server]:e.server),["vmess","vless"].includes(e.type)&&e.network==="http"){let n=e[`${e.network}-opts`]?.path,s=e[`${e.network}-opts`]?.headers?.Host;s&&!Array.isArray(s)&&(e[`${e.network}-opts`].headers.Host=[s]),n&&!Array.isArray(n)&&(e[`${e.network}-opts`].path=[n])}if(e.tls&&!e.sni&&(Vd(e.server)||(e.sni=e.server),!e.sni&&e.network)){let n=e[`${e.network}-opts`]?.headers?.Host;n=Array.isArray(n)?n[0]:n,n&&(e.sni=n)}if(e.ports?e.ports=String(e.ports).replace(/\//g,","):delete e.ports,["hysteria2"].includes(e.type)&&e.obfs&&!["salamander"].includes(e.obfs)&&!e["obfs-password"]&&(e["obfs-password"]=e.obfs,e.obfs="salamander"),["hysteria2"].includes(e.type)&&!e["obfs-password"]&&e.obfs_password&&(e["obfs-password"]=e.obfs_password,delete e.obfs_password),["vless"].includes(e.type)&&(e["reality-opts"]&&Object.keys(e["reality-opts"]).length===0&&delete e["reality-opts"],e["grpc-opts"]&&Object.keys(e["grpc-opts"]).length===0&&delete e["grpc-opts"],!e["reality-opts"]&&!e.flow&&delete e.flow,["http"].includes(e.network)&&(e[`${e.network}-opts`]?.path||(e[`${e.network}-opts`]||(e[`${e.network}-opts`]={}),e[`${e.network}-opts`].path=["/"]))),typeof e.name!="string")if(/^\d+$/.test(e.name))e.name=`${e.name}`;else try{e.name?.data?e.name=Eh.Buffer.from(e.name.data).toString("utf8"):e.name=Eh.Buffer.from(e.name).toString("utf8")}catch(n){x.error(`proxy.name decode failed
Reason: ${n}`),e.name=`${e.type} ${e.server}:${e.port}`}["ws","http","h2"].includes(e.network)&&(["ws","h2"].includes(e.network)&&!e[`${e.network}-opts`]?.path?(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path="/"):e.network==="http"&&(!Array.isArray(e[`${e.network}-opts`]?.path)||e[`${e.network}-opts`]?.path.every(n=>!n))&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path=["/"])),["","off"].includes(e.sni)&&(e["disable-sni"]=!0);let r=e.ca_str;e["ca-str"]?r=e["ca-str"]:r&&(delete e.ca_str,e["ca-str"]=r);try{x.env.isNode&&!r&&e._ca&&(r=x.node.fs.readFileSync(e._ca,{encoding:"utf8"}))}catch(n){x.error(`Read ca file failed
Reason: ${n}`)}return!e["tls-fingerprint"]&&r&&(e["tls-fingerprint"]=cA.generateFingerprint(r)),["ss"].includes(e.type)&&ae(e,"shadow-tls-password")&&(e.plugin="shadow-tls",e["plugin-opts"]={host:e["shadow-tls-sni"],password:e["shadow-tls-password"],version:e["shadow-tls-version"]},delete e["shadow-tls-sni"],delete e["shadow-tls-password"],delete e["shadow-tls-version"]),e}function Vd(e){return Rr(e)||Ur(e)}var tw=Of.find(e=>e.name==="Clash Pre-processor"),Gd=new Map;async function bi(rawUrl="",ua,timeout,customProxy,skipCustomCache,awaitCustomCache,noCache,preprocess){let $arguments={},url=rawUrl.replace(/#noFlow$/,""),rawArgs=url.split("#");if(url=url.split("#")[0],rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let t of rawArgs[1].split("&")){let r=t.split("=")[0],n=t.split("=")[1];$arguments[r]=n==null||n===""?!0:decodeURIComponent(n)}}let{isNode,isStash,isLoon,isShadowRocket,isQX}=zr(),{defaultProxy,defaultUserAgent,defaultTimeout,cacheThreshold:defaultCacheThreshold}=x.read(Nt),cacheThreshold=defaultCacheThreshold||1024,proxy=customProxy||defaultProxy;x.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultUserAgent||"clash.meta",requestTimeout=timeout||defaultTimeout||8e3,id=mi(userAgent+url);$arguments?.cacheKey===!0&&(x.error("\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58\u65F6 cacheKey \u7684\u503C\u4E0D\u80FD\u4E3A\u7A7A"),$arguments.cacheKey=void 0);let customCacheKey=$arguments?.cacheKey?`#sub-store-cached-custom-${$arguments?.cacheKey}`:void 0;if(customCacheKey&&!skipCustomCache){let e=x.read(customCacheKey),t=Tr.get(id);if(!noCache&&!$arguments?.noCache&&t)return x.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u5B58\u5728\u6709\u6548\u7684\u5E38\u89C4\u7F13\u5B58
\u4F7F\u7528\u5E38\u89C4\u7F13\u5B58\u4EE5\u907F\u514D\u91CD\u590D\u8BF7\u6C42`),t;if(e){if(awaitCustomCache){x.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u672C\u6B21\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u66F4\u65B0\u7F13\u5B58`);try{await bi(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess)}catch(r){x.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`),x.info("\u4F7F\u7528\u4E50\u89C2\u7F13\u5B58\u7684\u6570\u636E\u5237\u65B0\u7F13\u5B58, \u9632\u6B62\u540E\u7EED\u8BF7\u6C42"),Tr.set(id,e)}}else x.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
\u672C\u6B21\u8FD4\u56DE\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}
\u5E76\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u5F02\u6B65\u66F4\u65B0\u7F13\u5B58`),bi(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess).catch(r=>{x.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u5F02\u6B65\u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`)});return e}}let downloadUrlMatch=url.split("#")[0].match(/^\/api\/(file|module)\/(.+)/);if(downloadUrlMatch){let e="";try{e=downloadUrlMatch?.[1];let t=downloadUrlMatch?.[2];if(t==null)throw new Error(`\u672C\u5730 ${e} URL \u65E0\u6548: ${url}`);t=decodeURIComponent(t);let r=e==="module"?vn:It,n=$t(x.read(r),t);if(!n)throw new Error(`\u627E\u4E0D\u5230 ${e}: ${t}`);return e==="module"?n.content:await ks({type:"file",name:t})}catch(t){throw x.error(`Error when loading ${e}: ${url.split("#")[0]}.
Reason: ${t}`),new Error(`\u65E0\u6CD5\u52A0\u8F7D ${e}: ${url}`)}}else if(url?.startsWith("/"))try{let fs=eval('require("fs")');return fs.readFileSync(url.split("#")[0],"utf8")}catch(e){throw x.error(`Error when reading local file: ${url.split("#")[0]}.
Reason: ${e}`),new Error(`\u65E0\u6CD5\u4ECE\u8BE5\u8DEF\u5F84\u8BFB\u53D6\u6587\u672C\u5185\u5BB9: ${url}`)}if(!isNode&&Gd.has(id))return Gd.get(id);let http=iu({headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout}),result,cached=Tr.get(id);if(!noCache&&!$arguments?.noCache&&cached)x.info(`\u4F7F\u7528\u7F13\u5B58: ${url}, ${userAgent}`),result=cached,customCacheKey&&(x.info(`URL ${url}
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),x.write(cached,customCacheKey));else{let e=$arguments?.insecure?isNode?{strictSSL:!1}:{insecure:!0}:void 0;x.info(`Downloading...
User-Agent: ${userAgent}
Timeout: ${requestTimeout}
Proxy: ${proxy}
Insecure: ${!!e}
Preprocess: ${preprocess}
URL: ${url}`);try{let{body:t,headers:r,statusCode:n}=await http.get({url,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?uu(proxy):{},...e||{}});if(x.info(`statusCode: ${n}`),n<200||n>=400)throw new Error(`statusCode: ${n}`);if(r){let u=_o(r);u&&$a.set(id,u)}if(t.replace(/\s/g,"").length===0)throw new Error(new Error("\u8FDC\u7A0B\u8D44\u6E90\u5185\u5BB9\u4E3A\u7A7A"));if(preprocess)try{tw.test(t)&&(t=tw.parse(t,!0))}catch(u){x.error(`Clash Pre-processor error: ${u}`)}let s=!0;if(cacheThreshold){let u=t.length/1024;u>cacheThreshold&&(x.info(`\u8D44\u6E90\u5927\u5C0F ${u.toFixed(2)} KB \u8D85\u8FC7\u4E86 ${cacheThreshold} KB, \u4E0D\u7F13\u5B58`),s=!1)}if(preprocess)try{let u=dr.parse(t);(!Array.isArray(u)||u.length===0)&&(x.error(`URL ${url} \u4E0D\u5305\u542B\u6709\u6548\u8282\u70B9, \u4E0D\u7F13\u5B58`),s=!1)}catch(u){x.error(`URL ${url} \u5C1D\u8BD5\u89E3\u6790\u8282\u70B9\u5931\u8D25 ${u.message??u}, \u4E0D\u7F13\u5B58`),s=!1}s&&(Tr.set(id,t),customCacheKey&&(x.info(`URL ${url}
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),x.write(t,customCacheKey))),result=t}catch(t){if(customCacheKey){let r=x.read(customCacheKey);if(r)return x.info(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}
\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),r}throw new Error(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}`)}}return $arguments?.validCheck&&await Af(Pa(await Cs(url,$arguments.flowUserAgent,void 0,proxy,$arguments.flowUrl))),isNode||Gd.set(id,result),result}async function ew(url,file){let undici=eval("require('undici')"),fs=eval("require('fs')"),{pipeline}=eval("require('stream/promises')"),{Agent,interceptors,request}=undici;x.info(`Downloading file...
URL: ${url}
File: ${file}`);let{body,statusCode}=await request(url,{dispatcher:new Agent().compose(interceptors.redirect({maxRedirections:3,throwOnRedirect:!0}))});if(statusCode!==200)throw new Error(`Failed to download file from ${url}`);let fileStream=fs.createWriteStream(file);return await pipeline(body,fileStream),x.info(`File downloaded from ${url} to ${file}`),file}function H$(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function j$(){return{name:"Clash Provider",test:n=>/^payload:/gm.exec(n).index>=0,parse:n=>n.replace("payload:","").replace(/^\s*-\s*/gm,"")}}var rw=[H$(),j$()];function M$(){return{type:"SINGLE",func:r=>["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL","GEOSITE","GEOIP"].indexOf(r.type)!==-1?null:`${{"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[r.type]||r.type},${r.content},SUB-STORE`}}function nw(){return{type:"SINGLE",func:r=>{if(["GEOSITE","GEOIP"].indexOf(r.type)!==-1)return null;let s=`${r.type},${r.content}`;return["IP-CIDR","IP-CIDR6"].includes(r.type)&&(s+=r.options?.length>0?`,${r.options.join(",")}`:""),s}}}function q$(){return{type:"SINGLE",func:r=>["SRC-IP","GEOSITE","GEOIP"].indexOf(r.type)!==-1?null:(["IP-CIDR","IP-CIDR6"].includes(r.type)&&r.options&&(r.options=r.options.filter(s=>["no-resolve"].includes(s))),nw().func(r))}}function K$(){return{type:"ALL",func:r=>{let n={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},s={payload:r.map(u=>{let i=`${n[u.type]||u.type},${u.content}`;return["IP-CIDR","IP-CIDR6","GEOIP"].includes(u.type)&&(u.options&&(u.options=u.options.filter(o=>["no-resolve"].includes(o))),i+=u.options?.length>0?`,${u.options.join(",")}`:""),i})};return Ss.dump(s)}}}var iw={QX:M$(),Surge:nw(),Loon:q$(),Clash:K$()};var V$=[[/^(DOMAIN|host|HOST)$/,"DOMAIN"],[/^(DOMAIN-KEYWORD|host-keyword|HOST-KEYWORD)$/,"DOMAIN-KEYWORD"],[/^(DOMAIN-SUFFIX|host-suffix|HOST-SUFFIX)$/,"DOMAIN-SUFFIX"],[/^USER-AGENT$/i,"USER-AGENT"],[/^PROCESS-NAME$/,"PROCESS-NAME"],[/^(DEST-PORT|DST-PORT)$/,"DST-PORT"],[/^SRC-IP(-CIDR)?$/,"SRC-IP"],[/^(IN|SRC)-PORT$/,"IN-PORT"],[/^PROTOCOL$/,"PROTOCOL"],[/^IP-CIDR$/i,"IP-CIDR"],[/^(IP-CIDR6|ip6-cidr|IP6-CIDR)$/,"IP-CIDR6"],[/^GEOIP$/i,"GEOIP"],[/^GEOSITE$/i,"GEOSITE"]];function G$(){return{name:"Universal Rule Parser",test:()=>!0,parse:n=>{let s=n.split(`
`),u=[];for(let i of s)if(i=i.trim(),i.length!==0&&!/\s*#/.test(i))try{let o=i.split(",").map(d=>d.trim()),l=o[0],f=!1;for(let d of V$)if(d[0].test(l)){f=!0;let p={type:d[1],content:o[1]};["IP-CIDR","IP-CIDR6","GEOIP"].includes(p.type)&&(p.options=o.slice(2)),u.push(p)}if(!f)throw new Error("Invalid rule type: "+l)}catch(o){console.log(`Failed to parse line: ${i}
Reason: ${o}`)}return u}}}var sw=[G$()];var wh=function(){function e(n){for(let s of rw)try{if(s.test(n))return x.info(`Pre-processor [${s.name}] activated`),s.parse(n)}catch(u){x.error(`Parser [${s.name}] failed
Reason: ${u}`)}return n}function t(n){n=e(n);for(let s of sw){let u;try{u=s.test(n)}catch{u=!1}if(u)return x.info(`Rule parser [${s.name}] is activated!`),s.parse(n)}}function r(n,s){let u=iw[s];if(!u)throw new Error(`Target platform: ${s} is not supported!`);if(typeof u.type>"u"||u.type==="SINGLE")return n.map(i=>{try{return u.func(i)}catch(o){return console.log(`ERROR: cannot produce rule: ${JSON.stringify(i)}
Reason: ${o}`),""}}).filter(i=>i.length>0).join(`
`);if(u.type==="ALL")return u.func(n)}return{parse:t,produce:r}}();async function ks({type:e,name:t,platform:r,url:n,ua:s,content:u,mergeSources:i,ignoreFailedRemoteSub:o,ignoreFailedRemoteFile:l,produceType:f,produceOpts:d={},subscription:E,awaitCustomCache:p,$options:h,proxy:w,noCache:v,all:D}){if(r=r||"JSON",["subscription","sub"].includes(e)){let A;if(t){let _=x.read(cr);if(A=$t(_,t),!A)throw new Error(`\u627E\u4E0D\u5230\u8BA2\u9605 ${t}`)}else if(E)A=E;else throw new Error("\u672A\u63D0\u4F9B\u8BA2\u9605\u540D\u79F0\u6216\u8BA2\u9605\u6570\u636E");let F;if(u&&!["localFirst","remoteFirst"].includes(i))F=u;else if(n){let _={};F=await Promise.all(n.split(/[\r\n]+/).map(G=>G.trim()).filter(G=>G.length).map(async G=>{try{return await bi(G,s||A.ua,void 0,w||A.proxy,void 0,p,v||A.noCache,!0)}catch(b){return _[G]=b,x.error(`\u8BA2\u9605 ${A.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${G} \u53D1\u751F\u9519\u8BEF: ${b}`),""}}));let K=A.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(K=o),Object.keys(_).length>0)if(K)K==="enabled"&&x.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${A.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(_).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u8BA2\u9605 ${A.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(_).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);i==="localFirst"?F.unshift(u):i==="remoteFirst"&&F.push(u)}else if(A.source==="local"&&!["localFirst","remoteFirst"].includes(A.mergeSources))F=A.content;else{let _={};F=await Promise.all(A.url.split(/[\r\n]+/).map(G=>G.trim()).filter(G=>G.length).map(async G=>{try{return await bi(G,s||A.ua,void 0,w||A.proxy,void 0,p,v||A.noCache,!0)}catch(b){return _[G]=b,x.error(`\u8BA2\u9605 ${A.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${G} \u53D1\u751F\u9519\u8BEF: ${b}`),""}}));let K=A.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(K=o),Object.keys(_).length>0)if(K)K==="enabled"&&x.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${A.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(_).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u8BA2\u9605 ${A.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(_).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);A.mergeSources==="localFirst"?F.unshift(A.content):A.mergeSources==="remoteFirst"&&F.push(A.content)}if(f==="raw")return JSON.stringify((Array.isArray(F)?F:[F]).flat());let S=(Array.isArray(F)?F:[F]).map(_=>dr.parse(_)).flat();if(S.forEach(_=>{_._subName=A.name,_._subDisplayName=A.displayName}),S=await dr.process(S,A.process||[],r,{[A.name]:A},h),S.length===0)throw new Error(`\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let B={};for(let _ of S){if(B[_.name]){x.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${_.name}\uFF01`,"\u8BF7\u4ED4\u7EC6\u68C0\u6D4B\u914D\u7F6E\uFF01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"});break}B[_.name]=!0}return dr.produce(S,r,f,d)}else if(["collection","col"].includes(e)){let A=x.read(cr),F=x.read(er),S=$t(F,t);if(!S)throw new Error(`\u627E\u4E0D\u5230\u7EC4\u5408\u8BA2\u9605 ${t}`);let B=[...S.subscriptions],_=S.subscriptionTags;Array.isArray(_)&&_.length>0&&A.forEach(V=>{Array.isArray(V.tag)&&V.tag.length>0&&!B.includes(V.name)&&V.tag.some(W=>_.includes(W))&&B.push(V.name)});let K={},G={},b=0;await Promise.all(B.map(async V=>{let W=$t(A,V),q=W.passThroughUA,z=W.ua;q&&(x.info(`\u8BA2\u9605\u5F00\u542F\u4E86\u900F\u4F20 User-Agent, \u4F7F\u7528\u8BF7\u6C42\u7684 User-Agent: ${s}`),z=s);try{x.info(`\u6B63\u5728\u5904\u7406\u5B50\u8BA2\u9605\uFF1A${W.name}...`);let J;if(W.source==="local"&&!["localFirst","remoteFirst"].includes(W.mergeSources))J=W.content;else{let ye={};if(J=await await Promise.all(W.url.split(/[\r\n]+/).map(Ce=>Ce.trim()).filter(Ce=>Ce.length).map(async Ce=>{try{return await bi(Ce,z,void 0,w||W.proxy||S.proxy,void 0,void 0,v||W.noCache,!0)}catch(Pe){return ye[Ce]=Pe,x.error(`\u8BA2\u9605 ${W.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Ce} \u53D1\u751F\u9519\u8BEF: ${Pe}`),""}})),Object.keys(ye).length>0)if(W.ignoreFailedRemoteSub)W.ignoreFailedRemoteSub==="enabled"&&x.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${W.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(ye).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u8BA2\u9605 ${W.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(ye).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);W.mergeSources==="localFirst"?J.unshift(W.content):W.mergeSources==="remoteFirst"&&J.push(W.content)}let se=(Array.isArray(J)?J:[J]).map(ye=>dr.parse(ye)).flat();se.forEach(ye=>{ye._subName=W.name,ye._subDisplayName=W.displayName,ye._collectionName=S.name,ye._collectionDisplayName=S.displayName}),se=await dr.process(se,W.process||[],r,{[W.name]:W,_collection:S,$options:h}),K[V]=se,b++,x.info(`\u2705 \u5B50\u8BA2\u9605\uFF1A${W.name}\u52A0\u8F7D\u6210\u529F\uFF0C\u8FDB\u5EA6--${100*(b/B.length).toFixed(1)}% `)}catch(J){b++,G[V]=J,x.error(`\u274C \u5904\u7406\u7EC4\u5408\u8BA2\u9605\u4E2D\u7684\u5B50\u8BA2\u9605: ${W.name}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${J}\uFF01\u8FDB\u5EA6--${100*(b/B.length).toFixed(1)}%`)}}));let P=S.ignoreFailedRemoteSub;if(o!=null&&o!==""&&(P=o),Object.keys(G).length>0)if(P)P==="enabled"&&x.notify("\u{1F30D} Sub-Store \u5904\u7406\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C ${S.name}`,`\u5B50\u8BA2\u9605 ${Object.keys(G).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${S.name} \u7684\u5B50\u8BA2\u9605 ${Object.keys(G).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);let L=Array.prototype.concat.apply([],B.map(V=>K[V]||[]));if(L.forEach(V=>{V._collectionName=S.name,V._collectionDisplayName=S.displayName}),L=await dr.process(L,S.process||[],r,{_collection:S},h),L.length===0)throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let j={};for(let V of L){if(j[V.name]){x.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u7EC4\u5408\u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${V.name}\uFF01`,"\u8BF7\u4ED4\u7EC6\u68C0\u6D4B\u914D\u7F6E\uFF01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"});break}j[V.name]=!0}return dr.produce(L,r,f,d)}else if(e==="rule"){let A=x.read(Dc),F=$t(A,t);if(!F)throw new Error(`\u627E\u4E0D\u5230\u89C4\u5219 ${t}`);let S=[];for(let B=0;B<F.urls.length;B++){let _=F.urls[B];x.info(`\u6B63\u5728\u5904\u7406URL\uFF1A${_}\uFF0C\u8FDB\u5EA6--${100*((B+1)/F.urls.length).toFixed(1)}% `);try{let{body:K}=await bi(_),G=wh.parse(K);S=S.concat(G)}catch(K){x.error(`\u5904\u7406\u5206\u6D41\u8BA2\u9605\u4E2D\u7684URL: ${_}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${K}! \u8BE5\u8BA2\u9605\u5DF2\u88AB\u8DF3\u8FC7\u3002`)}}return S=await wh.process(S,[{type:"Remove Duplicate Filter"}]),wh.produce(S,r)}else if(e==="file"){let A=x.read(It),F=$t(A,t);if(!F)throw new Error(`\u627E\u4E0D\u5230\u6587\u4EF6 ${t}`);let S="";if(F.type!=="mihomoProfile")if(u&&!["localFirst","remoteFirst"].includes(i))S=u;else if(n){let G={};S=await Promise.all(n.split(/[\r\n]+/).map(P=>P.trim()).filter(P=>P.length).map(async P=>{try{return await bi(P,s||F.ua,void 0,F.proxy||w,void 0,void 0,v)}catch(L){return G[P]=L,x.error(`\u6587\u4EF6 ${F.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${P} \u53D1\u751F\u9519\u8BEF: ${L}`),""}}));let b=F.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(b=l),!b&&Object.keys(G).length>0)throw new Error(`\u6587\u4EF6 ${F.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(G).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);i==="localFirst"?S.unshift(u):i==="remoteFirst"&&S.push(u)}else if(F.source==="local"&&!["localFirst","remoteFirst"].includes(F.mergeSources))S=F.content;else{let G={};S=await Promise.all(F.url.split(/[\r\n]+/).map(P=>P.trim()).filter(P=>P.length).map(async P=>{try{return await bi(P,s||F.ua,void 0,F.proxy||w,void 0,void 0,v)}catch(L){return G[P]=L,x.error(`\u6587\u4EF6 ${F.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${P} \u53D1\u751F\u9519\u8BEF: ${L}`),""}}));let b=F.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(b=l),Object.keys(G).length>0)if(b)b==="enabled"&&x.notify("\u{1F30D} Sub-Store \u5904\u7406\u6587\u4EF6\u5931\u8D25",`\u274C ${F.name}`,`\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(G).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u6587\u4EF6 ${F.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(G).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);F.mergeSources==="localFirst"?S.unshift(F.content):F.mergeSources==="remoteFirst"&&S.push(F.content)}if(f==="raw")return JSON.stringify((Array.isArray(S)?S:[S]).flat());let B=(Array.isArray(S)?S:[S]).flat(),_=B.filter(G=>G!=null&&G!=="").join(`
`),K=Array.isArray(F.process)&&F.process.length>0?await dr.process({$files:B,$content:_,$options:h,$file:F},F.process):{$content:_,$files:B,$options:h};return(D?K:K?.$content)??""}}function zd(e){x.read(It)||x.write([],It),e.get("/share/file/:name",uw),e.route("/api/file/:name").get(uw).patch(W$).delete(J$),e.route("/api/wholeFile/:name").get(Y$),e.route("/api/files").get(X$).post(z$).put(Q$),e.route("/api/wholeFiles").get(Z$)}function z$(e,t){let r=e.body;r.name=`${r.name??Date.now()}`,x.info(`\u6B63\u5728\u521B\u5EFA\u6587\u4EF6\uFF1A${r.name}`);let n=x.read(It);if($t(n,r.name))return We(t,new Rt("DUPLICATE_KEY",e.body.name?`\u5DF2\u5B58\u5728 name \u4E3A ${r.name} \u7684\u6587\u4EF6`:"\u65E0\u6CD5\u540C\u65F6\u521B\u5EFA\u76F8\u540C\u7684\u6587\u4EF6 \u53EF\u7A0D\u540E\u91CD\u8BD5"));n.push(r),x.write(n,It),Ge(t,r,201)}async function uw(e,t){let{name:r}=e.params,n=e.headers["user-agent"]||e.headers["User-Agent"];x.info(`\u6B63\u5728\u4E0B\u8F7D\u6587\u4EF6\uFF1A${r}
\u8BF7\u6C42 User-Agent: ${n}`);let{url:s,subInfoUrl:u,subInfoUserAgent:i,ua:o,content:l,mergeSources:f,ignoreFailedRemoteFile:d,proxy:E,noCache:p,produceType:h}=e.query,w={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{w=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let F of e.query.$options.split("&")){let S=F.split("=")[0],B=F.split("=")[1];w[S]=B==null||B===""?!0:decodeURIComponent(B)}}x.info(`\u4F20\u5165 $options: ${JSON.stringify(w)}`)}s&&x.info(`\u6307\u5B9A\u8FDC\u7A0B\u6587\u4EF6 URL: ${s}`),E&&x.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${E}`),o&&x.info(`\u6307\u5B9A\u8FDC\u7A0B\u6587\u4EF6 User-Agent: ${o}`),u&&x.info(`\u6307\u5B9A\u83B7\u53D6\u6D41\u91CF\u7684 subInfoUrl: ${u}`),i&&x.info(`\u6307\u5B9A\u83B7\u53D6\u6D41\u91CF\u7684 subInfoUserAgent: ${i}`),l&&x.info(`\u6307\u5B9A\u672C\u5730\u6587\u4EF6: ${l}`),f&&x.info(`\u6307\u5B9A\u5408\u5E76\u6765\u6E90: ${f}`),d!=null&&d!==""&&x.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u6587\u4EF6: ${d}`),p&&x.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${p}`),h&&x.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${h}`);let v=x.read(It),D=$t(v,r);if(D)try{let A=await ks({type:"file",name:r,url:s,ua:o,content:l,mergeSources:f,ignoreFailedRemoteFile:d,$options:w,proxy:E,noCache:p,produceType:h,all:!0});try{if(u=u||D.subInfoUrl,u){let F=await Cs(u,i||D.subInfoUserAgent,void 0,E||D.proxy);F&&t.set("subscription-userinfo",wf(F))}}catch(F){x.error(`\u6587\u4EF6 ${r} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(F)}`)}D.download&&t.set("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(D.displayName||D.name)}`),t.set("Content-Type","text/plain; charset=utf-8"),A?.$options?._res?.headers&&Object.entries(A.$options._res.headers).forEach(([F,S])=>{t.set(F,S)}),t.send(A?.$content??"")}catch(A){x.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",`\u274C \u65E0\u6CD5\u4E0B\u8F7D\u6587\u4EF6\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${A.message??A}`),x.error(A.message??A),We(t,new fn("INTERNAL_SERVER_ERROR",`Failed to download file: ${r}`,`Reason: ${A.message??A}`))}else x.error(`\u{1F30D} Sub-Store \u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25
\u274C \u672A\u627E\u5230\u6587\u4EF6\uFF1A${r}\uFF01`),We(t,new Lr("RESOURCE_NOT_FOUND",`File ${r} does not exist!`),404)}function Y$(e,t){let{name:r}=e.params,{raw:n}=e.query,s=x.read(It),u=$t(s,r);u?n?t.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_file_${r}_${Mu(new Date)}.json`)}"`).send(JSON.stringify(u)):Ge(t,u):We(t,new Lr("FILE_NOT_FOUND",`File ${r} does not exist`,404))}function W$(e,t){let{name:r}=e.params,n=e.body,s=x.read(It),u=$t(s,r);if(u){let i={...u,...n};if(x.info(`\u6B63\u5728\u66F4\u65B0\u6587\u4EF6\uFF1A${r}...`),r!==i.name){let o=x.read(Mt)||[];for(let l of o)l.type==="file"&&l.source===u.name&&(l.source=i.name);x.write(o,Mt)}Xi(s,r,i),x.write(s,It),Ge(t,i)}else We(t,new Lr("RESOURCE_NOT_FOUND",`File ${r} does not exist!`),404)}function J$(e,t){let{name:r}=e.params;x.info(`\u6B63\u5728\u5220\u9664\u6587\u4EF6\uFF1A${r}`);let n=x.read(It);Ni(n,r),x.write(n,It),Ge(t)}function X$(e,t){let r=x.read(It);Ge(t,r.map(({content:n,...s})=>s))}function Z$(e,t){let r=x.read(It);Ge(t,r)}function Q$(e,t){let r=e.body;x.write(r,It),Ge(t)}function Yd(e){x.read(ki)||x.write([],ki),e.post("/api/token",rP),e.route("/api/token/:token").delete(eP),e.route("/api/tokens").get(tP)}function eP(e,t){let{token:r}=e.params;x.info(`\u6B63\u5728\u5220\u9664\uFF1A${r}`);let n=x.read(ki);Ni(n,r,"token"),x.write(n,ki),Ge(t)}function tP(e,t){let{type:r,name:n}=e.query,s=x.read(ki)||[];Ge(t,r||n?s.filter(u=>(r?u.type===r:!0)&&(n?u.name===n:!0)):s)}async function rP(req,res){if(!zr().isNode)return We(res,new Rt("INVALID_ENV","This endpoint is only available in Node.js environment"));try{let{payload,options}=req.body,ms=eval('require("ms")'),type=payload?.type,name=payload?.name;if(!type||!name)return We(res,new Rt("INVALID_PAYLOAD","payload type and name are required"));let token=payload?.token;if(token!=null){if(typeof token!="string"||token.length<1)return We(res,new Rt("INVALID_CUSTOM_TOKEN",`Invalid custom token: ${token}`));if((x.read(ki)||[]).find(t=>t.token===token&&t.type===type&&t.name===name))return We(res,new Rt("DUPLICATE_TOKEN",`Token ${token} already exists`))}if(type==="col"){if(!(x.read(er)||[]).find(r=>r.name===name))return We(res,new Rt("INVALID_COLLECTION",`collection ${name} not found`))}else if(type==="file"){if(!(x.read(It)||[]).find(r=>r.name===name))return We(res,new Rt("INVALID_FILE",`file ${name} not found`))}else if(type==="sub"){if(!(x.read(cr)||[]).find(r=>r.name===name))return We(res,new Rt("INVALID_SUB",`sub ${name} not found`))}else return We(res,new Rt("INVALID_TYPE",`type ${name} not supported`));let expiresIn=options?.expiresIn;if(options?.expiresIn!=null&&(expiresIn=ms(options.expiresIn),expiresIn==null||isNaN(expiresIn)||expiresIn<=0))return We(res,new Rt("INVALID_EXPIRES_IN",`Invalid expiresIn option: ${options.expiresIn}`));let nanoid=eval('require("nanoid")'),tokens=x.read(ki)||[];if(!token)do token=nanoid.customAlphabet(nanoid.urlAlphabet)();while(tokens.find(e=>e.token===token&&e.type===type&&e.name===name));return tokens.push({...payload,token,createdAt:Date.now(),expiresIn:expiresIn>0?options?.expiresIn:void 0,exp:expiresIn>0?Date.now()+expiresIn:void 0}),x.write(tokens,ki),Ge(res,{token})}catch(e){return We(res,new fn("TOKEN_SIGN_FAILED","Failed to sign token",`Reason: ${e.message??e}`))}}function Wd(e){x.read(vn)||x.write([],vn),e.route("/api/module/:name").get(iP).patch(sP).delete(uP),e.route("/api/modules").get(aP).post(nP).put(oP)}function nP(e,t){let r=e.body;r.name=`${r.name??mi(JSON.stringify(r))}`,x.info(`\u6B63\u5728\u521B\u5EFA\u6A21\u5757\uFF1A${r.name}`);let n=x.read(vn);if($t(n,r.name))return We(t,new Rt("DUPLICATE_KEY",e.body.name?`\u5DF2\u5B58\u5728 name \u4E3A ${r.name} \u7684\u6A21\u5757`:"\u5DF2\u5B58\u5728\u76F8\u540C\u7684\u6A21\u5757 \u8BF7\u52FF\u91CD\u590D\u6DFB\u52A0"));n.push(r),x.write(n,vn),Ge(t,r,201)}function iP(e,t){let{name:r}=e.params,n=x.read(vn),s=$t(n,r);s?t.set("Content-Type","text/plain; charset=utf-8").send(s.content):We(t,new Lr("MODULE_NOT_FOUND",`Module ${r} does not exist`,404))}function sP(e,t){let{name:r}=e.params,n=e.body,s=x.read(vn),u=$t(s,r);if(u){let i={...u,...n};x.info(`\u6B63\u5728\u66F4\u65B0\u6A21\u5757\uFF1A${r}...`),Xi(s,r,i),x.write(s,vn),Ge(t,i)}else We(t,new Lr("RESOURCE_NOT_FOUND",`Module ${r} does not exist!`),404)}function uP(e,t){let{name:r}=e.params;x.info(`\u6B63\u5728\u5220\u9664\u6A21\u5757\uFF1A${r}`);let n=x.read(vn);Ni(n,r),x.write(n,vn),Ge(t)}function aP(e,t){let r=x.read(vn);Ge(t,r.map(({content:n,...s})=>s))}function oP(e,t){let r=e.body;x.write(r,vn),Ge(t)}console.log(`
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
Sub-Store -- v${Xl}
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
`);wo();cP();function cP(){let e=q0({substore:x});tp(e),ip(e),Yd(e),zd(e),Wd(e),sp(e),up(e),fp(e),lp(e),e.start()}})();
/*! Bundled license information:
lodash/lodash.js:
(**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
jsrsasign/lib/jsrsasign.js:
(*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
*)
(*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*)
(*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/
*)
(*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
*)
(*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
*)
*/