mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
1156 lines
868 KiB
JavaScript
1156 lines
868 KiB
JavaScript
(()=>{var m3=Object.create;var J1=Object.defineProperty;var v3=Object.getOwnPropertyDescriptor;var w3=Object.getOwnPropertyNames;var A3=Object.getPrototypeOf,E3=Object.prototype.hasOwnProperty;var Sa=(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 y3=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of w3(t))!E3.call(e,s)&&s!==r&&J1(e,s,{get:()=>t[s],enumerable:!(n=v3(t,s))||n.enumerable});return e};var jn=(e,t,r)=>(r=e!=null?m3(A3(e)):{},y3(t||!e||!e.__esModule?J1(r,"default",{value:e,enumerable:!0}):r,e));var dp=be(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.isCorrect=Pu.isInSubnet=void 0;function T3(e){return this.subnetMask<e.subnetMask?!1:this.mask(e.subnetMask)===e.mask()}Pu.isInSubnet=T3;function x3(e){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}Pu.isCorrect=x3});var gp=be(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.RE_SUBNET_STRING=mi.RE_ADDRESS=mi.GROUPS=mi.BITS=void 0;mi.BITS=32;mi.GROUPS=4;mi.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;mi.RE_SUBNET_STRING=/\/\d{1,2}$/});var Ll=be(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.AddressError=void 0;var mp=class extends Error{constructor(t,r){super(t),this.name="AddressError",r!==null&&(this.parseMessage=r)}};Nl.AddressError=mp});var vp=be((Ul,ng)=>{(function(){var e,t=0xdeadbeefcafe,r=(t&16777215)==15715070;function n($,T,L){$!=null&&(typeof $=="number"?this.fromNumber($,T,L):T==null&&typeof $!="string"?this.fromString($,256):this.fromString($,T))}function s(){return new n(null)}function a($,T,L,Z,pe,me){for(;--me>=0;){var Fe=T*this[$++]+L[Z]+pe;pe=Math.floor(Fe/67108864),L[Z++]=Fe&67108863}return pe}function i($,T,L,Z,pe,me){for(var Fe=T&32767,Pe=T>>15;--me>=0;){var wt=this[$]&32767,Nt=this[$++]>>15,mr=Pe*wt+Nt*Fe;wt=Fe*wt+((mr&32767)<<15)+L[Z]+(pe&1073741823),pe=(wt>>>30)+(mr>>>15)+Pe*Nt+(pe>>>30),L[Z++]=wt&1073741823}return pe}function c($,T,L,Z,pe,me){for(var Fe=T&16383,Pe=T>>14;--me>=0;){var wt=this[$]&16383,Nt=this[$++]>>14,mr=Pe*wt+Nt*Fe;wt=Fe*wt+((mr&16383)<<14)+L[Z]+pe,pe=(wt>>28)+(mr>>14)+Pe*Nt,L[Z++]=wt&268435455}return pe}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=a,e=26):(n.prototype.am=c,e=28),n.prototype.DB=e,n.prototype.DM=(1<<e)-1,n.prototype.DV=1<<e;var h=52;n.prototype.FV=Math.pow(2,h),n.prototype.F1=h-e,n.prototype.F2=2*e-h;var m="0123456789abcdefghijklmnopqrstuvwxyz",A=new Array,p,f;for(p=48,f=0;f<=9;++f)A[p++]=f;for(p=97,f=10;f<36;++f)A[p++]=f;for(p=65,f=10;f<36;++f)A[p++]=f;function E($){return m.charAt($)}function v($,T){var L=A[$.charCodeAt(T)];return L??-1}function b($){for(var T=this.t-1;T>=0;--T)$[T]=this[T];$.t=this.t,$.s=this.s}function w($){this.t=1,this.s=$<0?-1:0,$>0?this[0]=$:$<-1?this[0]=$+this.DV:this.t=0}function S($){var T=s();return T.fromInt($),T}function F($,T){var L;if(T==16)L=4;else if(T==8)L=3;else if(T==256)L=8;else if(T==2)L=1;else if(T==32)L=5;else if(T==4)L=2;else{this.fromRadix($,T);return}this.t=0,this.s=0;for(var Z=$.length,pe=!1,me=0;--Z>=0;){var Fe=L==8?$[Z]&255:v($,Z);if(Fe<0){$.charAt(Z)=="-"&&(pe=!0);continue}pe=!1,me==0?this[this.t++]=Fe:me+L>this.DB?(this[this.t-1]|=(Fe&(1<<this.DB-me)-1)<<me,this[this.t++]=Fe>>this.DB-me):this[this.t-1]|=Fe<<me,me+=L,me>=this.DB&&(me-=this.DB)}L==8&&$[0]&128&&(this.s=-1,me>0&&(this[this.t-1]|=(1<<this.DB-me)-1<<me)),this.clamp(),pe&&n.ZERO.subTo(this,this)}function D(){for(var $=this.s&this.DM;this.t>0&&this[this.t-1]==$;)--this.t}function I($){if(this.s<0)return"-"+this.negate().toString($);var T;if($==16)T=4;else if($==8)T=3;else if($==2)T=1;else if($==32)T=5;else if($==4)T=2;else return this.toRadix($);var L=(1<<T)-1,Z,pe=!1,me="",Fe=this.t,Pe=this.DB-Fe*this.DB%T;if(Fe-- >0)for(Pe<this.DB&&(Z=this[Fe]>>Pe)>0&&(pe=!0,me=E(Z));Fe>=0;)Pe<T?(Z=(this[Fe]&(1<<Pe)-1)<<T-Pe,Z|=this[--Fe]>>(Pe+=this.DB-T)):(Z=this[Fe]>>(Pe-=T)&L,Pe<=0&&(Pe+=this.DB,--Fe)),Z>0&&(pe=!0),pe&&(me+=E(Z));return pe?me:"0"}function j(){var $=s();return n.ZERO.subTo(this,$),$}function q(){return this.s<0?this.negate():this}function _($){var T=this.s-$.s;if(T!=0)return T;var L=this.t;if(T=L-$.t,T!=0)return this.s<0?-T:T;for(;--L>=0;)if((T=this[L]-$[L])!=0)return T;return 0}function P($){var T=1,L;return(L=$>>>16)!=0&&($=L,T+=16),(L=$>>8)!=0&&($=L,T+=8),(L=$>>4)!=0&&($=L,T+=4),(L=$>>2)!=0&&($=L,T+=2),(L=$>>1)!=0&&($=L,T+=1),T}function k(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)}function U($,T){var L;for(L=this.t-1;L>=0;--L)T[L+$]=this[L];for(L=$-1;L>=0;--L)T[L]=0;T.t=this.t+$,T.s=this.s}function M($,T){for(var L=$;L<this.t;++L)T[L-$]=this[L];T.t=Math.max(this.t-$,0),T.s=this.s}function W($,T){var L=$%this.DB,Z=this.DB-L,pe=(1<<Z)-1,me=Math.floor($/this.DB),Fe=this.s<<L&this.DM,Pe;for(Pe=this.t-1;Pe>=0;--Pe)T[Pe+me+1]=this[Pe]>>Z|Fe,Fe=(this[Pe]&pe)<<L;for(Pe=me-1;Pe>=0;--Pe)T[Pe]=0;T[me]=Fe,T.t=this.t+me+1,T.s=this.s,T.clamp()}function K($,T){T.s=this.s;var L=Math.floor($/this.DB);if(L>=this.t){T.t=0;return}var Z=$%this.DB,pe=this.DB-Z,me=(1<<Z)-1;T[0]=this[L]>>Z;for(var Fe=L+1;Fe<this.t;++Fe)T[Fe-L-1]|=(this[Fe]&me)<<pe,T[Fe-L]=this[Fe]>>Z;Z>0&&(T[this.t-L-1]|=(this.s&me)<<pe),T.t=this.t-L,T.clamp()}function V($,T){for(var L=0,Z=0,pe=Math.min($.t,this.t);L<pe;)Z+=this[L]-$[L],T[L++]=Z&this.DM,Z>>=this.DB;if($.t<this.t){for(Z-=$.s;L<this.t;)Z+=this[L],T[L++]=Z&this.DM,Z>>=this.DB;Z+=this.s}else{for(Z+=this.s;L<$.t;)Z-=$[L],T[L++]=Z&this.DM,Z>>=this.DB;Z-=$.s}T.s=Z<0?-1:0,Z<-1?T[L++]=this.DV+Z:Z>0&&(T[L++]=Z),T.t=L,T.clamp()}function z($,T){var L=this.abs(),Z=$.abs(),pe=L.t;for(T.t=pe+Z.t;--pe>=0;)T[pe]=0;for(pe=0;pe<Z.t;++pe)T[pe+L.t]=L.am(0,Z[pe],T,pe,0,L.t);T.s=0,T.clamp(),this.s!=$.s&&n.ZERO.subTo(T,T)}function ne($){for(var T=this.abs(),L=$.t=2*T.t;--L>=0;)$[L]=0;for(L=0;L<T.t-1;++L){var Z=T.am(L,T[L],$,2*L,0,1);($[L+T.t]+=T.am(L+1,2*T[L],$,2*L+1,Z,T.t-L-1))>=T.DV&&($[L+T.t]-=T.DV,$[L+T.t+1]=1)}$.t>0&&($[$.t-1]+=T.am(L,T[L],$,2*L,0,1)),$.s=0,$.clamp()}function Ee($,T,L){var Z=$.abs();if(!(Z.t<=0)){var pe=this.abs();if(pe.t<Z.t){T?.fromInt(0),L!=null&&this.copyTo(L);return}L==null&&(L=s());var me=s(),Fe=this.s,Pe=$.s,wt=this.DB-P(Z[Z.t-1]);wt>0?(Z.lShiftTo(wt,me),pe.lShiftTo(wt,L)):(Z.copyTo(me),pe.copyTo(L));var Nt=me.t,mr=me[Nt-1];if(mr!=0){var vr=mr*(1<<this.F1)+(Nt>1?me[Nt-2]>>this.F2:0),pn=this.FV/vr,Is=(1<<this.F1)/vr,Nr=1<<this.F2,wr=L.t,Bs=wr-Nt,Tn=T??s();for(me.dlShiftTo(Bs,Tn),L.compareTo(Tn)>=0&&(L[L.t++]=1,L.subTo(Tn,L)),n.ONE.dlShiftTo(Nt,Tn),Tn.subTo(me,me);me.t<Nt;)me[me.t++]=0;for(;--Bs>=0;){var fa=L[--wr]==mr?this.DM:Math.floor(L[wr]*pn+(L[wr-1]+Nr)*Is);if((L[wr]+=me.am(0,fa,L,Bs,0,Nt))<fa)for(me.dlShiftTo(Bs,Tn),L.subTo(Tn,L);L[wr]<--fa;)L.subTo(Tn,L)}T!=null&&(L.drShiftTo(Nt,T),Fe!=Pe&&n.ZERO.subTo(T,T)),L.t=Nt,L.clamp(),wt>0&&L.rShiftTo(wt,L),Fe<0&&n.ZERO.subTo(L,L)}}}function we($){var T=s();return this.abs().divRemTo($,null,T),this.s<0&&T.compareTo(n.ZERO)>0&&$.subTo(T,T),T}function _e($){this.m=$}function He($){return $.s<0||$.compareTo(this.m)>=0?$.mod(this.m):$}function ue($){return $}function Ce($){$.divRemTo(this.m,null,$)}function Oe($,T,L){$.multiplyTo(T,L),this.reduce(L)}function sr($,T){$.squareTo(T),this.reduce(T)}_e.prototype.convert=He,_e.prototype.revert=ue,_e.prototype.reduce=Ce,_e.prototype.mulTo=Oe,_e.prototype.sqrTo=sr;function _t(){if(this.t<1)return 0;var $=this[0];if(!($&1))return 0;var T=$&3;return T=T*(2-($&15)*T)&15,T=T*(2-($&255)*T)&255,T=T*(2-(($&65535)*T&65535))&65535,T=T*(2-$*T%this.DV)%this.DV,T>0?this.DV-T:-T}function lt($){this.m=$,this.mp=$.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<$.DB-15)-1,this.mt2=2*$.t}function Mt($){var T=s();return $.abs().dlShiftTo(this.m.t,T),T.divRemTo(this.m,null,T),$.s<0&&T.compareTo(n.ZERO)>0&&this.m.subTo(T,T),T}function Pt($){var T=s();return $.copyTo(T),this.reduce(T),T}function Qe($){for(;$.t<=this.mt2;)$[$.t++]=0;for(var T=0;T<this.m.t;++T){var L=$[T]&32767,Z=L*this.mpl+((L*this.mph+($[T]>>15)*this.mpl&this.um)<<15)&$.DM;for(L=T+this.m.t,$[L]+=this.m.am(0,Z,$,T,0,this.m.t);$[L]>=$.DV;)$[L]-=$.DV,$[++L]++}$.clamp(),$.drShiftTo(this.m.t,$),$.compareTo(this.m)>=0&&$.subTo(this.m,$)}function bt($,T){$.squareTo(T),this.reduce(T)}function Je($,T,L){$.multiplyTo(T,L),this.reduce(L)}lt.prototype.convert=Mt,lt.prototype.revert=Pt,lt.prototype.reduce=Qe,lt.prototype.mulTo=Je,lt.prototype.sqrTo=bt;function ht(){return(this.t>0?this[0]&1:this.s)==0}function qt($,T){if($>4294967295||$<1)return n.ONE;var L=s(),Z=s(),pe=T.convert(this),me=P($)-1;for(pe.copyTo(L);--me>=0;)if(T.sqrTo(L,Z),($&1<<me)>0)T.mulTo(Z,pe,L);else{var Fe=L;L=Z,Z=Fe}return T.revert(L)}function ze($,T){var L;return $<256||T.isEven()?L=new _e(T):L=new lt(T),this.exp($,L)}n.prototype.copyTo=b,n.prototype.fromInt=w,n.prototype.fromString=F,n.prototype.clamp=D,n.prototype.dlShiftTo=U,n.prototype.drShiftTo=M,n.prototype.lShiftTo=W,n.prototype.rShiftTo=K,n.prototype.subTo=V,n.prototype.multiplyTo=z,n.prototype.squareTo=ne,n.prototype.divRemTo=Ee,n.prototype.invDigit=_t,n.prototype.isEven=ht,n.prototype.exp=qt,n.prototype.toString=I,n.prototype.negate=j,n.prototype.abs=q,n.prototype.compareTo=_,n.prototype.bitLength=k,n.prototype.mod=we,n.prototype.modPowInt=ze,n.ZERO=S(0),n.ONE=S(1);function Ot(){var $=s();return this.copyTo($),$}function Rn(){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 ar(){return this.t==0?this.s:this[0]<<24>>24}function gr(){return this.t==0?this.s:this[0]<<16>>16}function zt($){return Math.floor(Math.LN2*this.DB/Math.log($))}function br(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Xs($){if($==null&&($=10),this.signum()==0||$<2||$>36)return"0";var T=this.chunkSize($),L=Math.pow($,T),Z=S(L),pe=s(),me=s(),Fe="";for(this.divRemTo(Z,pe,me);pe.signum()>0;)Fe=(L+me.intValue()).toString($).substr(1)+Fe,pe.divRemTo(Z,pe,me);return me.intValue().toString($)+Fe}function Or($,T){this.fromInt(0),T==null&&(T=10);for(var L=this.chunkSize(T),Z=Math.pow(T,L),pe=!1,me=0,Fe=0,Pe=0;Pe<$.length;++Pe){var wt=v($,Pe);if(wt<0){$.charAt(Pe)=="-"&&this.signum()==0&&(pe=!0);continue}Fe=T*Fe+wt,++me>=L&&(this.dMultiply(Z),this.dAddOffset(Fe,0),me=0,Fe=0)}me>0&&(this.dMultiply(Math.pow(T,me)),this.dAddOffset(Fe,0)),pe&&n.ZERO.subTo(this,this)}function pt($,T,L){if(typeof T=="number")if($<2)this.fromInt(1);else for(this.fromNumber($,L),this.testBit($-1)||this.bitwiseTo(n.ONE.shiftLeft($-1),Oi,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(T);)this.dAddOffset(2,0),this.bitLength()>$&&this.subTo(n.ONE.shiftLeft($-1),this);else{var Z=new Array,pe=$&7;Z.length=($>>3)+1,T.nextBytes(Z),pe>0?Z[0]&=(1<<pe)-1:Z[0]=0,this.fromString(Z,256)}}function Wt(){var $=this.t,T=new Array;T[0]=this.s;var L=this.DB-$*this.DB%8,Z,pe=0;if($-- >0)for(L<this.DB&&(Z=this[$]>>L)!=(this.s&this.DM)>>L&&(T[pe++]=Z|this.s<<this.DB-L);$>=0;)L<8?(Z=(this[$]&(1<<L)-1)<<8-L,Z|=this[--$]>>(L+=this.DB-8)):(Z=this[$]>>(L-=8)&255,L<=0&&(L+=this.DB,--$)),Z&128&&(Z|=-256),pe==0&&(this.s&128)!=(Z&128)&&++pe,(pe>0||Z!=this.s)&&(T[pe++]=Z);return T}function We($){return this.compareTo($)==0}function Cr($){return this.compareTo($)<0?this:$}function Js($){return this.compareTo($)>0?this:$}function Zs($,T,L){var Z,pe,me=Math.min($.t,this.t);for(Z=0;Z<me;++Z)L[Z]=T(this[Z],$[Z]);if($.t<this.t){for(pe=$.s&this.DM,Z=me;Z<this.t;++Z)L[Z]=T(this[Z],pe);L.t=this.t}else{for(pe=this.s&this.DM,Z=me;Z<$.t;++Z)L[Z]=T(pe,$[Z]);L.t=$.t}L.s=T(this.s,$.s),L.clamp()}function Qs($,T){return $&T}function ea($){var T=s();return this.bitwiseTo($,Qs,T),T}function Oi($,T){return $|T}function ta($){var T=s();return this.bitwiseTo($,Oi,T),T}function bs($,T){return $^T}function si($){var T=s();return this.bitwiseTo($,bs,T),T}function ki($,T){return $&~T}function Va($){var T=s();return this.bitwiseTo($,ki,T),T}function Ga(){for(var $=s(),T=0;T<this.t;++T)$[T]=this.DM&~this[T];return $.t=this.t,$.s=~this.s,$}function za($){var T=s();return $<0?this.rShiftTo(-$,T):this.lShiftTo($,T),T}function Wa($){var T=s();return $<0?this.lShiftTo(-$,T):this.rShiftTo($,T),T}function Ya($){if($==0)return-1;var T=0;return $&65535||($>>=16,T+=16),$&255||($>>=8,T+=8),$&15||($>>=4,T+=4),$&3||($>>=2,T+=2),$&1||++T,T}function Xa(){for(var $=0;$<this.t;++$)if(this[$]!=0)return $*this.DB+Ya(this[$]);return this.s<0?this.t*this.DB:-1}function Ja($){for(var T=0;$!=0;)$&=$-1,++T;return T}function lo(){for(var $=0,T=this.s&this.DM,L=0;L<this.t;++L)$+=Ja(this[L]^T);return $}function Za($){var T=Math.floor($/this.DB);return T>=this.t?this.s!=0:(this[T]&1<<$%this.DB)!=0}function fo($,T){var L=n.ONE.shiftLeft($);return this.bitwiseTo(L,T,L),L}function ho($){return this.changeBit($,Oi)}function po($){return this.changeBit($,ki)}function Cs($){return this.changeBit($,bs)}function go($,T){for(var L=0,Z=0,pe=Math.min($.t,this.t);L<pe;)Z+=this[L]+$[L],T[L++]=Z&this.DM,Z>>=this.DB;if($.t<this.t){for(Z+=$.s;L<this.t;)Z+=this[L],T[L++]=Z&this.DM,Z>>=this.DB;Z+=this.s}else{for(Z+=this.s;L<$.t;)Z+=$[L],T[L++]=Z&this.DM,Z>>=this.DB;Z+=$.s}T.s=Z<0?-1:0,Z>0?T[L++]=Z:Z<-1&&(T[L++]=this.DV+Z),T.t=L,T.clamp()}function ra($){var T=s();return this.addTo($,T),T}function mo($){var T=s();return this.subTo($,T),T}function vo($){var T=s();return this.multiplyTo($,T),T}function wo(){var $=s();return this.squareTo($),$}function Ao($){var T=s();return this.divRemTo($,T,null),T}function Eo($){var T=s();return this.divRemTo($,null,T),T}function yo($){var T=s(),L=s();return this.divRemTo($,T,L),new Array(T,L)}function So($){this[this.t]=this.am(0,$-1,this,0,0,this.t),++this.t,this.clamp()}function bo($,T){if($!=0){for(;this.t<=T;)this[this.t++]=0;for(this[T]+=$;this[T]>=this.DV;)this[T]-=this.DV,++T>=this.t&&(this[this.t++]=0),++this[T]}}function ai(){}function Qa($){return $}function Co($,T,L){$.multiplyTo(T,L)}function Fo($,T){$.squareTo(T)}ai.prototype.convert=Qa,ai.prototype.revert=Qa,ai.prototype.mulTo=Co,ai.prototype.sqrTo=Fo;function _o($){return this.exp($,new ai)}function eu($,T,L){var Z=Math.min(this.t+$.t,T);for(L.s=0,L.t=Z;Z>0;)L[--Z]=0;var pe;for(pe=L.t-this.t;Z<pe;++Z)L[Z+this.t]=this.am(0,$[Z],L,Z,0,this.t);for(pe=Math.min($.t,T);Z<pe;++Z)this.am(0,$[Z],L,Z,0,T-Z);L.clamp()}function ui($,T,L){--T;var Z=L.t=this.t+$.t-T;for(L.s=0;--Z>=0;)L[Z]=0;for(Z=Math.max(T-this.t,0);Z<$.t;++Z)L[this.t+Z-T]=this.am(T-Z,$[Z],L,0,0,this.t+Z-T);L.clamp(),L.drShiftTo(1,L)}function Wr($){this.r2=s(),this.q3=s(),n.ONE.dlShiftTo(2*$.t,this.r2),this.mu=this.r2.divide($),this.m=$}function Io($){if($.s<0||$.t>2*this.m.t)return $.mod(this.m);if($.compareTo(this.m)<0)return $;var T=s();return $.copyTo(T),this.reduce(T),T}function Fs($){return $}function hn($){for($.drShiftTo(this.m.t-1,this.r2),$.t>this.m.t+1&&($.t=this.m.t+1,$.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);$.compareTo(this.r2)<0;)$.dAddOffset(1,this.m.t+1);for($.subTo(this.r2,$);$.compareTo(this.m)>=0;)$.subTo(this.m,$)}function Bo($,T){$.squareTo(T),this.reduce(T)}function Do($,T,L){$.multiplyTo(T,L),this.reduce(L)}Wr.prototype.convert=Io,Wr.prototype.revert=Fs,Wr.prototype.reduce=hn,Wr.prototype.mulTo=Do,Wr.prototype.sqrTo=Bo;function tu($,T){var L=$.bitLength(),Z,pe=S(1),me;if(L<=0)return pe;L<18?Z=1:L<48?Z=3:L<144?Z=4:L<768?Z=5:Z=6,L<8?me=new _e(T):T.isEven()?me=new Wr(T):me=new lt(T);var Fe=new Array,Pe=3,wt=Z-1,Nt=(1<<Z)-1;if(Fe[1]=me.convert(this),Z>1){var mr=s();for(me.sqrTo(Fe[1],mr);Pe<=Nt;)Fe[Pe]=s(),me.mulTo(mr,Fe[Pe-2],Fe[Pe]),Pe+=2}var vr=$.t-1,pn,Is=!0,Nr=s(),wr;for(L=P($[vr])-1;vr>=0;){for(L>=wt?pn=$[vr]>>L-wt&Nt:(pn=($[vr]&(1<<L+1)-1)<<wt-L,vr>0&&(pn|=$[vr-1]>>this.DB+L-wt)),Pe=Z;!(pn&1);)pn>>=1,--Pe;if((L-=Pe)<0&&(L+=this.DB,--vr),Is)Fe[pn].copyTo(pe),Is=!1;else{for(;Pe>1;)me.sqrTo(pe,Nr),me.sqrTo(Nr,pe),Pe-=2;Pe>0?me.sqrTo(pe,Nr):(wr=pe,pe=Nr,Nr=wr),me.mulTo(Nr,Fe[pn],pe)}for(;vr>=0&&!($[vr]&1<<L);)me.sqrTo(pe,Nr),wr=pe,pe=Nr,Nr=wr,--L<0&&(L=this.DB-1,--vr)}return me.revert(pe)}function na($){var T=this.s<0?this.negate():this.clone(),L=$.s<0?$.negate():$.clone();if(T.compareTo(L)<0){var Z=T;T=L,L=Z}var pe=T.getLowestSetBit(),me=L.getLowestSetBit();if(me<0)return T;for(pe<me&&(me=pe),me>0&&(T.rShiftTo(me,T),L.rShiftTo(me,L));T.signum()>0;)(pe=T.getLowestSetBit())>0&&T.rShiftTo(pe,T),(pe=L.getLowestSetBit())>0&&L.rShiftTo(pe,L),T.compareTo(L)>=0?(T.subTo(L,T),T.rShiftTo(1,T)):(L.subTo(T,L),L.rShiftTo(1,L));return me>0&&L.lShiftTo(me,L),L}function ru($){if($<=0)return 0;var T=this.DV%$,L=this.s<0?$-1:0;if(this.t>0)if(T==0)L=this[0]%$;else for(var Z=this.t-1;Z>=0;--Z)L=(T*L+this[Z])%$;return L}function _s($){var T=$.isEven();if(this.isEven()&&T||$.signum()==0)return n.ZERO;for(var L=$.clone(),Z=this.clone(),pe=S(1),me=S(0),Fe=S(0),Pe=S(1);L.signum()!=0;){for(;L.isEven();)L.rShiftTo(1,L),T?((!pe.isEven()||!me.isEven())&&(pe.addTo(this,pe),me.subTo($,me)),pe.rShiftTo(1,pe)):me.isEven()||me.subTo($,me),me.rShiftTo(1,me);for(;Z.isEven();)Z.rShiftTo(1,Z),T?((!Fe.isEven()||!Pe.isEven())&&(Fe.addTo(this,Fe),Pe.subTo($,Pe)),Fe.rShiftTo(1,Fe)):Pe.isEven()||Pe.subTo($,Pe),Pe.rShiftTo(1,Pe);L.compareTo(Z)>=0?(L.subTo(Z,L),T&&pe.subTo(Fe,pe),me.subTo(Pe,me)):(Z.subTo(L,Z),T&&Fe.subTo(pe,Fe),Pe.subTo(me,Pe))}if(Z.compareTo(n.ONE)!=0)return n.ZERO;if(Pe.compareTo($)>=0)return Pe.subtract($);if(Pe.signum()<0)Pe.addTo($,Pe);else return Pe;return Pe.signum()<0?Pe.add($):Pe}var kt=[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],Po=(1<<26)/kt[kt.length-1];function $o($){var T,L=this.abs();if(L.t==1&&L[0]<=kt[kt.length-1]){for(T=0;T<kt.length;++T)if(L[0]==kt[T])return!0;return!1}if(L.isEven())return!1;for(T=1;T<kt.length;){for(var Z=kt[T],pe=T+1;pe<kt.length&&Z<Po;)Z*=kt[pe++];for(Z=L.modInt(Z);T<pe;)if(Z%kt[T++]==0)return!1}return L.millerRabin($)}function nu($){var T=this.subtract(n.ONE),L=T.getLowestSetBit();if(L<=0)return!1;var Z=T.shiftRight(L);$=$+1>>1,$>kt.length&&($=kt.length);for(var pe=s(),me=0;me<$;++me){pe.fromInt(kt[Math.floor(Math.random()*kt.length)]);var Fe=pe.modPow(Z,this);if(Fe.compareTo(n.ONE)!=0&&Fe.compareTo(T)!=0){for(var Pe=1;Pe++<L&&Fe.compareTo(T)!=0;)if(Fe=Fe.modPowInt(2,this),Fe.compareTo(n.ONE)==0)return!1;if(Fe.compareTo(T)!=0)return!1}}return!0}n.prototype.chunkSize=zt,n.prototype.toRadix=Xs,n.prototype.fromRadix=Or,n.prototype.fromNumber=pt,n.prototype.bitwiseTo=Zs,n.prototype.changeBit=fo,n.prototype.addTo=go,n.prototype.dMultiply=So,n.prototype.dAddOffset=bo,n.prototype.multiplyLowerTo=eu,n.prototype.multiplyUpperTo=ui,n.prototype.modInt=ru,n.prototype.millerRabin=nu,n.prototype.clone=Ot,n.prototype.intValue=Rn,n.prototype.byteValue=ar,n.prototype.shortValue=gr,n.prototype.signum=br,n.prototype.toByteArray=Wt,n.prototype.equals=We,n.prototype.min=Cr,n.prototype.max=Js,n.prototype.and=ea,n.prototype.or=ta,n.prototype.xor=si,n.prototype.andNot=Va,n.prototype.not=Ga,n.prototype.shiftLeft=za,n.prototype.shiftRight=Wa,n.prototype.getLowestSetBit=Xa,n.prototype.bitCount=lo,n.prototype.testBit=Za,n.prototype.setBit=ho,n.prototype.clearBit=po,n.prototype.flipBit=Cs,n.prototype.add=ra,n.prototype.subtract=mo,n.prototype.multiply=vo,n.prototype.divide=Ao,n.prototype.remainder=Eo,n.prototype.divideAndRemainder=yo,n.prototype.modPow=tu,n.prototype.modInverse=_s,n.prototype.pow=_o,n.prototype.gcd=na,n.prototype.isProbablePrime=$o,n.prototype.square=wo,n.prototype.Barrett=Wr;var oi,ur,Dt;function Ro($){ur[Dt++]^=$&255,ur[Dt++]^=$>>8&255,ur[Dt++]^=$>>16&255,ur[Dt++]^=$>>24&255,Dt>=kr&&(Dt-=kr)}function ia(){Ro(new Date().getTime())}if(ur==null){ur=new Array,Dt=0;var or;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var sa=new Uint8Array(32);for(window.crypto.getRandomValues(sa),or=0;or<32;++or)ur[Dt++]=sa[or]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var iu=window.crypto.random(32);for(or=0;or<iu.length;++or)ur[Dt++]=iu.charCodeAt(or)&255}}for(;Dt<kr;)or=Math.floor(65536*Math.random()),ur[Dt++]=or>>>8,ur[Dt++]=or&255;Dt=0,ia()}function su(){if(oi==null){for(ia(),oi=la(),oi.init(ur),Dt=0;Dt<ur.length;++Dt)ur[Dt]=0;Dt=0}return oi.next()}function aa($){var T;for(T=0;T<$.length;++T)$[T]=su()}function ci(){}ci.prototype.nextBytes=aa;function oa(){this.i=0,this.j=0,this.S=new Array}function au($){var T,L,Z;for(T=0;T<256;++T)this.S[T]=T;for(L=0,T=0;T<256;++T)L=L+this.S[T]+$[T%$.length]&255,Z=this.S[T],this.S[T]=this.S[L],this.S[L]=Z;this.i=0,this.j=0}function ca(){var $;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,$=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=$,this.S[$+this.S[this.i]&255]}oa.prototype.init=au,oa.prototype.next=ca;function la(){return new oa}var kr=256;typeof Ul<"u"?Ul=ng.exports={default:n,BigInteger:n,SecureRandom:ci}:this.jsbn={BigInteger:n,SecureRandom:ci}}).call(Ul)});var rc=be(Hl=>{(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(a(i),arguments)}function r(i,c){return t.apply(null,[i].concat(c||[]))}function n(i,c){var l=1,h=i.length,m,A="",p,f,E,v,b,w,S,F;for(p=0;p<h;p++)if(typeof i[p]=="string")A+=i[p];else if(typeof i[p]=="object"){if(E=i[p],E.keys)for(m=c[l],f=0;f<E.keys.length;f++){if(m==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',E.keys[f],E.keys[f-1]));m=m[E.keys[f]]}else E.param_no?m=c[E.param_no]:m=c[l++];if(e.not_type.test(E.type)&&e.not_primitive.test(E.type)&&m instanceof Function&&(m=m()),e.numeric_arg.test(E.type)&&typeof m!="number"&&isNaN(m))throw new TypeError(t("[sprintf] expecting number but found %T",m));switch(e.number.test(E.type)&&(S=m>=0),E.type){case"b":m=parseInt(m,10).toString(2);break;case"c":m=String.fromCharCode(parseInt(m,10));break;case"d":case"i":m=parseInt(m,10);break;case"j":m=JSON.stringify(m,null,E.width?parseInt(E.width):0);break;case"e":m=E.precision?parseFloat(m).toExponential(E.precision):parseFloat(m).toExponential();break;case"f":m=E.precision?parseFloat(m).toFixed(E.precision):parseFloat(m);break;case"g":m=E.precision?String(Number(m.toPrecision(E.precision))):parseFloat(m);break;case"o":m=(parseInt(m,10)>>>0).toString(8);break;case"s":m=String(m),m=E.precision?m.substring(0,E.precision):m;break;case"t":m=String(!!m),m=E.precision?m.substring(0,E.precision):m;break;case"T":m=Object.prototype.toString.call(m).slice(8,-1).toLowerCase(),m=E.precision?m.substring(0,E.precision):m;break;case"u":m=parseInt(m,10)>>>0;break;case"v":m=m.valueOf(),m=E.precision?m.substring(0,E.precision):m;break;case"x":m=(parseInt(m,10)>>>0).toString(16);break;case"X":m=(parseInt(m,10)>>>0).toString(16).toUpperCase();break}e.json.test(E.type)?A+=m:(e.number.test(E.type)&&(!S||E.sign)?(F=S?"+":"-",m=m.toString().replace(e.sign,"")):F="",b=E.pad_char?E.pad_char==="0"?"0":E.pad_char.charAt(1):" ",w=E.width-(F+m).length,v=E.width&&w>0?b.repeat(w):"",A+=E.align?F+m+v:b==="0"?F+v+m:v+F+m)}return A}var s=Object.create(null);function a(i){if(s[i])return s[i];for(var c=i,l,h=[],m=0;c;){if((l=e.text.exec(c))!==null)h.push(l[0]);else if((l=e.modulo.exec(c))!==null)h.push("%");else if((l=e.placeholder.exec(c))!==null){if(l[2]){m|=1;var A=[],p=l[2],f=[];if((f=e.key.exec(p))!==null)for(A.push(f[1]);(p=p.substring(f[0].length))!=="";)if((f=e.key_access.exec(p))!==null)A.push(f[1]);else if((f=e.index_access.exec(p))!==null)A.push(f[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]=A}else m|=2;if(m===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");h.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");c=c.substring(l[0].length)}return s[i]=h}typeof Hl<"u"&&(Hl.sprintf=t,Hl.vsprintf=r),typeof window<"u"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var Ap=be(vi=>{"use strict";var O3=vi&&vi.__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]}),k3=vi&&vi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ag=vi&&vi.__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)&&O3(t,e,r);return k3(t,e),t};Object.defineProperty(vi,"__esModule",{value:!0});vi.Address4=void 0;var ig=ag(dp()),ei=ag(gp()),sg=Ll(),nc=vp(),$u=rc(),wp=class e{constructor(t){this.groups=ei.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=ig.isCorrect(ei.BITS),this.isInSubnet=ig.isInSubnet,this.address=t;let r=ei.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>ei.BITS)throw new sg.AddressError("Invalid subnet mask.");t=t.replace(ei.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(ei.RE_ADDRESS))throw new sg.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 a=r.slice(s,s+2);n.push(parseInt(a,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,$u.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],r;for(r=0;r<ei.GROUPS;r+=2){let n=(0,$u.sprintf)("%02x%02x",parseInt(this.parsedAddress[r],10),parseInt(this.parsedAddress[r+1],10));t.push((0,$u.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new nc.BigInteger(this.parsedAddress.map(t=>(0,$u.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new nc.BigInteger(this.mask()+"0".repeat(ei.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new nc.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new nc.BigInteger(this.mask()+"1".repeat(ei.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new nc.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,$u.sprintf)("%s.in-addr.arpa.",r)}isMulticast(){return this.isInSubnet(new e("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(ei.BITS,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(ei.RE_ADDRESS,(0,$u.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(".")))}};vi.Address4=wp});var Ep=be(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.RE_URL_WITH_PORT=Ht.RE_URL=Ht.RE_ZONE_STRING=Ht.RE_SUBNET_STRING=Ht.RE_BAD_ADDRESS=Ht.RE_BAD_CHARACTERS=Ht.TYPES=Ht.SCOPES=Ht.GROUPS=Ht.BITS=void 0;Ht.BITS=128;Ht.GROUPS=8;Ht.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Ht.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"};Ht.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Ht.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Ht.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Ht.RE_ZONE_STRING=/%.*$/;Ht.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);Ht.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var yp=be(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.simpleGroup=wi.spanLeadingZeroes=wi.spanAll=wi.spanAllZeroes=void 0;var ug=rc();function og(e){return e.replace(/(0+)/g,'<span class="zero">$1</span>')}wi.spanAllZeroes=og;function N3(e,t=0){return e.split("").map((n,s)=>(0,ug.sprintf)('<span class="digit value-%s position-%d">%s</span>',n,s+t,og(n))).join("")}wi.spanAll=N3;function cg(e){return e.replace(/^(0+)/,'<span class="zero">$1</span>')}function L3(e){return e.split(":").map(r=>cg(r)).join(":")}wi.spanLeadingZeroes=L3;function U3(e,t=0){return e.split(":").map((n,s)=>/group-v4/.test(n)?n:(0,ug.sprintf)('<span class="hover-group group-%d">%s</span>',s+t,cg(n)))}wi.simpleGroup=U3});var lg=be(lr=>{"use strict";var H3=lr&&lr.__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]}),j3=lr&&lr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M3=lr&&lr.__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)&&H3(t,e,r);return j3(t,e),t};Object.defineProperty(lr,"__esModule",{value:!0});lr.possibleElisions=lr.simpleRegularExpression=lr.ADDRESS_BOUNDARY=lr.padGroup=lr.groupPossibilities=void 0;var q3=M3(Ep()),Ru=rc();function Ml(e){return(0,Ru.sprintf)("(%s)",e.join("|"))}lr.groupPossibilities=Ml;function jl(e){return e.length<4?(0,Ru.sprintf)("0{0,%d}%s",4-e.length,e):e}lr.padGroup=jl;lr.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function K3(e){let t=[];e.forEach((n,s)=>{parseInt(n,16)===0&&t.push(s)});let r=t.map(n=>e.map((s,a)=>{if(a===n){let i=a===0||a===q3.GROUPS-1?":":"";return Ml([jl(s),i])}return jl(s)}).join(":"));return r.push(e.map(jl).join(":")),Ml(r)}lr.simpleRegularExpression=K3;function V3(e,t,r){let n=t?"":":",s=r?"":":",a=[];!t&&!r&&a.push("::"),t&&r&&a.push(""),(r&&!t||!r&&t)&&a.push(":"),a.push((0,Ru.sprintf)("%s(:0{1,4}){1,%d}",n,e-1)),a.push((0,Ru.sprintf)("(0{1,4}:){1,%d}%s",e-1,s)),a.push((0,Ru.sprintf)("(0{1,4}:){%d}0{1,4}",e-1));for(let i=1;i<e-1;i++)for(let c=1;c<e-i;c++)a.push((0,Ru.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",c,e-c-i-1));return Ml(a)}lr.possibleElisions=V3});var dg=be(Ai=>{"use strict";var G3=Ai&&Ai.__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]}),z3=Ai&&Ai.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kl=Ai&&Ai.__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)&&G3(t,e,r);return z3(t,e),t};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Address6=void 0;var fg=Kl(dp()),Sp=Kl(gp()),It=Kl(Ep()),bp=Kl(yp()),_a=Ap(),Ia=lg(),ts=Ll(),Kr=vp(),Vr=rc();function ql(e){if(!e)throw new Error("Assertion failed.")}function W3(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function Y3(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 X3(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 hg(e){return(0,Vr.sprintf)("%04x",parseInt(e,16))}function pg(e){return e&255}var Cp=class e{constructor(t,r){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=fg.isInSubnet,this.isCorrect=fg.isCorrect(It.BITS),r===void 0?this.groups=It.GROUPS:this.groups=r,this.address=t;let n=It.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>It.BITS)throw new ts.AddressError("Invalid subnet mask.");t=t.replace(It.RE_SUBNET_STRING,"")}else if(/\//.test(t))throw new ts.AddressError("Invalid subnet mask.");let s=It.RE_ZONE_STRING.exec(t);s&&(this.zone=s[0],t=t.replace(It.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<It.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=It.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=It.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 _a.Address4(t),n=It.BITS-(Sp.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 ts.AddressError("Invalid 'ip6.arpa' form.");let s=r.split(".").reverse();for(let a=n;a>0;a--){let i=a*4;s.splice(i,0,":")}return r=s.join(""),new e(r)}microsoftTranscription(){return(0,Vr.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let r=It.BITS-this.subnetMask,n=Math.abs(t-It.BITS),s=r-n;return s<0?"0":W3(new Kr.BigInteger("2",10).pow(s).toString(10))}_startAddress(){return new Kr.BigInteger(this.mask()+"0".repeat(It.BITS-this.subnetMask),2)}startAddress(){return e.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new Kr.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new Kr.BigInteger(this.mask()+"1".repeat(It.BITS-this.subnetMask),2)}endAddress(){return e.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new Kr.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=It.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(It.TYPES))if(this.isInSubnet(new e(t)))return It.TYPES[t];return"Global unicast"}getBits(t,r){return new Kr.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,It.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,Vr.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 c=parseInt(this.parsedAddress[t],16);c===0&&n++,c!==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 a=s.map(c=>c[1]-c[0]+1);if(s.length>0){let c=a.indexOf(Math.max(...a));r=X3(this.parsedAddress,s[c])}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(It.BITS,"0")}parse4in6(t){let r=t.split(":"),s=r.slice(-1)[0].match(Sp.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new _a.Address4(this.parsedAddress4);for(let a=0;a<this.address4.groups;a++)if(/^0[0-9]+/.test(this.address4.parsedAddress[a]))throw new ts.AddressError("IPv4 addresses can't have leading zeroes.",t.replace(Sp.RE_ADDRESS,this.address4.parsedAddress.map(Y3).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(It.RE_BAD_CHARACTERS);if(r)throw new ts.AddressError((0,Vr.sprintf)("Bad character%s detected in address: %s",r.length>1?"s":"",r.join("")),t.replace(It.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let n=t.match(It.RE_BAD_ADDRESS);if(n)throw new ts.AddressError((0,Vr.sprintf)("Address failed regex: %s",n.join("")),t.replace(It.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let s=[],a=t.split("::");if(a.length===2){let i=a[0].split(":"),c=a[1].split(":");i.length===1&&i[0]===""&&(i=[]),c.length===1&&c[0]===""&&(c=[]);let l=this.groups-(i.length+c.length);if(!l)throw new ts.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=i.length,this.elisionEnd=i.length+this.elidedGroups,s=s.concat(i);for(let h=0;h<l;h++)s.push("0");s=s.concat(c)}else if(a.length===1)s=t.split(":"),this.elidedGroups=0;else throw new ts.AddressError("Too many :: groups found");if(s=s.map(i=>(0,Vr.sprintf)("%x",parseInt(i,16))),s.length!==this.groups)throw new ts.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(hg).join(":")}decimal(){return this.parsedAddress.map(t=>(0,Vr.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new Kr.BigInteger(this.parsedAddress.map(hg).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return _a.Address4.fromHex(new Kr.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 Kr.BigInteger("ffff",16)).toString(),n=_a.Address4.fromHex(this.getBitsBase16(32,64)),s=_a.Address4.fromHex(this.getBits(96,128).xor(new Kr.BigInteger("ffffffff",16)).toString(16)),a=this.getBits(64,80),i=this.getBitsBase2(64,80),c=a.testBit(15),l=a.testBit(14),h=a.testBit(8),m=a.testBit(9),A=new Kr.BigInteger(i.slice(2,6)+i.slice(8,16),2).toString(10);return{prefix:(0,Vr.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:s.address,flags:i,coneNat:c,microsoft:{reserved:l,universalLocal:m,groupIndividual:h,nonce:A},udpPort:r}}inspect6to4(){let t=this.getBitsBase16(0,16),r=_a.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,Vr.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(pg)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(pg))}static fromUnsignedByteArray(t){let r=new Kr.BigInteger("256",10),n=new Kr.BigInteger("0",10),s=new Kr.BigInteger("1",10);for(let a=t.length-1;a>=0;a--)n=n.add(s.multiply(new Kr.BigInteger(t[a].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,Vr.sprintf)(":%s",t),(0,Vr.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,Vr.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,r.call(this),t.className):(0,Vr.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,r.call(this))}group(){if(this.elidedGroups===0)return bp.simpleGroup(this.address).join(":");ql(typeof this.elidedGroups=="number"),ql(typeof this.elisionBegin=="number");let t=[],[r,n]=this.address.split("::");r.length?t.push(...bp.simpleGroup(r)):t.push("");let s=["hover-group"];for(let a=this.elisionBegin;a<this.elisionBegin+this.elidedGroups;a++)s.push((0,Vr.sprintf)("group-%d",a));return t.push((0,Vr.sprintf)('<span class="%s"></span>',s.join(" "))),n.length?t.push(...bp.simpleGroup(n,this.elisionEnd)):t.push(""),this.is4()&&(ql(this.address4 instanceof _a.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===It.GROUPS)r.push((0,Ia.possibleElisions)(It.GROUPS));else{let s=n.address.split("::");s[0].length&&r.push((0,Ia.simpleRegularExpression)(s[0].split(":"))),ql(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")}};Ai.Address6=Cp});var gg=be(Rr=>{"use strict";var J3=Rr&&Rr.__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]}),Z3=Rr&&Rr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Q3=Rr&&Rr.__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)&&J3(t,e,r);return Z3(t,e),t};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.v6=Rr.AddressError=Rr.Address6=Rr.Address4=void 0;var eS=Ap();Object.defineProperty(Rr,"Address4",{enumerable:!0,get:function(){return eS.Address4}});var tS=dg();Object.defineProperty(Rr,"Address6",{enumerable:!0,get:function(){return tS.Address6}});var rS=Ll();Object.defineProperty(Rr,"AddressError",{enumerable:!0,get:function(){return rS.AddressError}});var nS=Q3(yp());Rr.v6={helpers:nS}});var Da=be((cP,Ba)=>{"use strict";function Eg(e){return typeof e>"u"||e===null}function cS(e){return typeof e=="object"&&e!==null}function lS(e){return Array.isArray(e)?e:Eg(e)?[]:[e]}function fS(e,t){var r,n,s,a;if(t)for(a=Object.keys(t),r=0,n=a.length;r<n;r+=1)s=a[r],e[s]=t[s];return e}function hS(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function pS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Ba.exports.isNothing=Eg;Ba.exports.isObject=cS;Ba.exports.toArray=lS;Ba.exports.repeat=hS;Ba.exports.isNegativeZero=pS;Ba.exports.extend=fS});var ku=be((lP,yg)=>{"use strict";function uc(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||""}uc.prototype=Object.create(Error.prototype);uc.prototype.constructor=uc;uc.prototype.toString=function(t){var r=this.name+": ";return r+=this.reason||"(unknown reason)",!t&&this.mark&&(r+=" "+this.mark.toString()),r};yg.exports=uc});var Cg=be((fP,bg)=>{"use strict";var Sg=Da();function Ip(e,t,r,n,s){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=s}Ip.prototype.getSnippet=function(t,r){var n,s,a,i,c;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(a="",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){a=" ... ",i-=5;break}return c=this.buffer.slice(s,i),Sg.repeat(" ",t)+n+c+a+`
|
||
`+Sg.repeat(" ",t+this.position-s+n.length)+"^"};Ip.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};bg.exports=Ip});var rr=be((hP,_g)=>{"use strict";var Fg=ku(),dS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],gS=["scalar","sequence","mapping"];function mS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function vS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(dS.indexOf(r)===-1)throw new Fg('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=mS(t.styleAliases||null),gS.indexOf(this.kind)===-1)throw new Fg('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}_g.exports=vS});var Pa=be((pP,Bg)=>{"use strict";var Ig=Da(),Xl=ku(),wS=rr();function Bp(e,t,r){var n=[];return e.include.forEach(function(s){r=Bp(s,t,r)}),e[t].forEach(function(s){r.forEach(function(a,i){a.tag===s.tag&&a.kind===s.kind&&n.push(i)}),r.push(s)}),r.filter(function(s,a){return n.indexOf(a)===-1})}function AS(){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 Nu(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 Xl("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Bp(this,"implicit",[]),this.compiledExplicit=Bp(this,"explicit",[]),this.compiledTypeMap=AS(this.compiledImplicit,this.compiledExplicit)}Nu.DEFAULT=null;Nu.create=function(){var t,r;switch(arguments.length){case 1:t=Nu.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new Xl("Wrong number of arguments for Schema.create function")}if(t=Ig.toArray(t),r=Ig.toArray(r),!t.every(function(n){return n instanceof Nu}))throw new Xl("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(n){return n instanceof wS}))throw new Xl("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Nu({include:t,explicit:r})};Bg.exports=Nu});var Pg=be((dP,Dg)=>{"use strict";var ES=rr();Dg.exports=new ES("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var Rg=be((gP,$g)=>{"use strict";var yS=rr();$g.exports=new yS("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var xg=be((mP,Tg)=>{"use strict";var SS=rr();Tg.exports=new SS("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var Jl=be((vP,Og)=>{"use strict";var bS=Pa();Og.exports=new bS({explicit:[Pg(),Rg(),xg()]})});var Ng=be((wP,kg)=>{"use strict";var CS=rr();function FS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function _S(){return null}function IS(e){return e===null}kg.exports=new CS("tag:yaml.org,2002:null",{kind:"scalar",resolve:FS,construct:_S,predicate:IS,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var Ug=be((AP,Lg)=>{"use strict";var BS=rr();function DS(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 PS(e){return e==="true"||e==="True"||e==="TRUE"}function $S(e){return Object.prototype.toString.call(e)==="[object Boolean]"}Lg.exports=new BS("tag:yaml.org,2002:bool",{kind:"scalar",resolve:DS,construct:PS,predicate:$S,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 jg=be((EP,Hg)=>{"use strict";var RS=Da(),TS=rr();function xS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function OS(e){return 48<=e&&e<=55}function kS(e){return 48<=e&&e<=57}function NS(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(!xS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}for(;r<t;r++)if(s=e[r],s!=="_"){if(!OS(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(!kS(e.charCodeAt(r)))return!1;n=!0}return!n||s==="_"?!1:s!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(r))}function LS(e){var t=e,r=1,n,s,a=[];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){a.unshift(parseInt(i,10))}),t=0,s=1,a.forEach(function(i){t+=i*s,s*=60}),r*t):r*parseInt(t,10)}function US(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!RS.isNegativeZero(e)}Hg.exports=new TS("tag:yaml.org,2002:int",{kind:"scalar",resolve:NS,construct:LS,predicate:US,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 Kg=be((yP,qg)=>{"use strict";var Mg=Da(),HS=rr(),jS=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 MS(e){return!(e===null||!jS.test(e)||e[e.length-1]==="_")}function qS(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(a){s.unshift(parseFloat(a,10))}),t=0,n=1,s.forEach(function(a){t+=a*n,n*=60}),r*t):r*parseFloat(t,10)}var KS=/^[-+]?[0-9]+e/;function VS(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(Mg.isNegativeZero(e))return"-0.0";return r=e.toString(10),KS.test(r)?r.replace("e",".e"):r}function GS(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Mg.isNegativeZero(e))}qg.exports=new HS("tag:yaml.org,2002:float",{kind:"scalar",resolve:MS,construct:qS,predicate:GS,represent:VS,defaultStyle:"lowercase"})});var Dp=be((SP,Vg)=>{"use strict";var zS=Pa();Vg.exports=new zS({include:[Jl()],implicit:[Ng(),Ug(),jg(),Kg()]})});var Pp=be((bP,Gg)=>{"use strict";var WS=Pa();Gg.exports=new WS({include:[Dp()]})});var Xg=be((CP,Yg)=>{"use strict";var YS=rr(),zg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wg=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 XS(e){return e===null?!1:zg.exec(e)!==null||Wg.exec(e)!==null}function JS(e){var t,r,n,s,a,i,c,l=0,h=null,m,A,p;if(t=zg.exec(e),t===null&&(t=Wg.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(a=+t[4],i=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(m=+t[10],A=+(t[11]||0),h=(m*60+A)*6e4,t[9]==="-"&&(h=-h)),p=new Date(Date.UTC(r,n,s,a,i,c,l)),h&&p.setTime(p.getTime()-h),p}function ZS(e){return e.toISOString()}Yg.exports=new YS("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:XS,construct:JS,instanceOf:Date,represent:ZS})});var Zg=be((FP,Jg)=>{"use strict";var QS=rr();function eb(e){return e==="<<"||e===null}Jg.exports=new QS("tag:yaml.org,2002:merge",{kind:"scalar",resolve:eb})});var tm=be((_P,em)=>{"use strict";var $a;try{Qg=Sa,$a=Qg("buffer").Buffer}catch{}var Qg,tb=rr(),$p=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
||
\r`;function rb(e){if(e===null)return!1;var t,r,n=0,s=e.length,a=$p;for(r=0;r<s;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function nb(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,a=$p,i=0,c=[];for(t=0;t<s;t++)t%4===0&&t&&(c.push(i>>16&255),c.push(i>>8&255),c.push(i&255)),i=i<<6|a.indexOf(n.charAt(t));return r=s%4*6,r===0?(c.push(i>>16&255),c.push(i>>8&255),c.push(i&255)):r===18?(c.push(i>>10&255),c.push(i>>2&255)):r===12&&c.push(i>>4&255),$a?$a.from?$a.from(c):new $a(c):c}function ib(e){var t="",r=0,n,s,a=e.length,i=$p;for(n=0;n<a;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=a%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 sb(e){return $a&&$a.isBuffer(e)}em.exports=new tb("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rb,construct:nb,predicate:sb,represent:ib})});var nm=be((BP,rm)=>{"use strict";var ab=rr(),ub=Object.prototype.hasOwnProperty,ob=Object.prototype.toString;function cb(e){if(e===null)return!0;var t=[],r,n,s,a,i,c=e;for(r=0,n=c.length;r<n;r+=1){if(s=c[r],i=!1,ob.call(s)!=="[object Object]")return!1;for(a in s)if(ub.call(s,a))if(!i)i=!0;else return!1;if(!i)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function lb(e){return e!==null?e:[]}rm.exports=new ab("tag:yaml.org,2002:omap",{kind:"sequence",resolve:cb,construct:lb})});var sm=be((DP,im)=>{"use strict";var fb=rr(),hb=Object.prototype.toString;function pb(e){if(e===null)return!0;var t,r,n,s,a,i=e;for(a=new Array(i.length),t=0,r=i.length;t<r;t+=1){if(n=i[t],hb.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;a[t]=[s[0],n[s[0]]]}return!0}function db(e){if(e===null)return[];var t,r,n,s,a,i=e;for(a=new Array(i.length),t=0,r=i.length;t<r;t+=1)n=i[t],s=Object.keys(n),a[t]=[s[0],n[s[0]]];return a}im.exports=new fb("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pb,construct:db})});var um=be((PP,am)=>{"use strict";var gb=rr(),mb=Object.prototype.hasOwnProperty;function vb(e){if(e===null)return!0;var t,r=e;for(t in r)if(mb.call(r,t)&&r[t]!==null)return!1;return!0}function wb(e){return e!==null?e:{}}am.exports=new gb("tag:yaml.org,2002:set",{kind:"mapping",resolve:vb,construct:wb})});var Lu=be(($P,om)=>{"use strict";var Ab=Pa();om.exports=new Ab({include:[Pp()],implicit:[Xg(),Zg()],explicit:[tm(),nm(),sm(),um()]})});var lm=be((RP,cm)=>{"use strict";var Eb=rr();function yb(){return!0}function Sb(){}function bb(){return""}function Cb(e){return typeof e>"u"}cm.exports=new Eb("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:yb,construct:Sb,predicate:Cb,represent:bb})});var hm=be((TP,fm)=>{"use strict";var Fb=rr();function _b(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 Ib(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 Bb(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function Db(e){return Object.prototype.toString.call(e)==="[object RegExp]"}fm.exports=new Fb("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:_b,construct:Ib,predicate:Db,represent:Bb})});var gm=be((xP,dm)=>{"use strict";var Zl;try{pm=Sa,Zl=pm("esprima")}catch{typeof window<"u"&&(Zl=window.esprima)}var pm,Pb=rr();function $b(e){if(e===null)return!1;try{var t="("+e+")",r=Zl.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 Rb(e){var t="("+e+")",r=Zl.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(a){n.push(a.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 Tb(e){return e.toString()}function xb(e){return Object.prototype.toString.call(e)==="[object Function]"}dm.exports=new Pb("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:$b,construct:Rb,predicate:xb,represent:Tb})});var oc=be((kP,vm)=>{"use strict";var mm=Pa();vm.exports=mm.DEFAULT=new mm({include:[Lu()],explicit:[lm(),hm(),gm()]})});var km=be((NP,cc)=>{"use strict";var ns=Da(),Cm=ku(),Ob=Cg(),Fm=Lu(),kb=oc(),Hs=Object.prototype.hasOwnProperty,Ql=1,_m=2,Im=3,ef=4,Rp=1,Nb=2,wm=3,Lb=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ub=/[\x85\u2028\u2029]/,Hb=/[,\[\]\{\}]/,Bm=/^(?:!|!!|![a-z\-]+!)$/i,Dm=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Am(e){return Object.prototype.toString.call(e)}function yi(e){return e===10||e===13}function Ta(e){return e===9||e===32}function sn(e){return e===9||e===32||e===10||e===13}function Uu(e){return e===44||e===91||e===93||e===123||e===125}function jb(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Mb(e){return e===120?2:e===117?4:e===85?8:0}function qb(e){return 48<=e&&e<=57?e-48:-1}function Em(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 Kb(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Pm=new Array(256),$m=new Array(256);for(Ra=0;Ra<256;Ra++)Pm[Ra]=Em(Ra)?1:0,$m[Ra]=Em(Ra);var Ra;function Vb(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kb,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 Rm(e,t){return new Cm(t,new Ob(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Ue(e,t){throw Rm(e,t)}function tf(e,t){e.onWarning&&e.onWarning.call(null,Rm(e,t))}var ym={YAML:function(t,r,n){var s,a,i;t.version!==null&&Ue(t,"duplication of %YAML directive"),n.length!==1&&Ue(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),s===null&&Ue(t,"ill-formed argument of the YAML directive"),a=parseInt(s[1],10),i=parseInt(s[2],10),a!==1&&Ue(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&tf(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var s,a;n.length!==2&&Ue(t,"TAG directive accepts exactly two arguments"),s=n[0],a=n[1],Bm.test(s)||Ue(t,"ill-formed tag handle (first argument) of the TAG directive"),Hs.call(t.tagMap,s)&&Ue(t,'there is a previously declared suffix for "'+s+'" tag handle'),Dm.test(a)||Ue(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[s]=a}};function Us(e,t,r,n){var s,a,i,c;if(t<r){if(c=e.input.slice(t,r),n)for(s=0,a=c.length;s<a;s+=1)i=c.charCodeAt(s),i===9||32<=i&&i<=1114111||Ue(e,"expected valid JSON character");else Lb.test(c)&&Ue(e,"the stream contains non-printable characters");e.result+=c}}function Sm(e,t,r,n){var s,a,i,c;for(ns.isObject(r)||Ue(e,"cannot merge mappings; the provided source object is unacceptable"),s=Object.keys(r),i=0,c=s.length;i<c;i+=1)a=s[i],Hs.call(t,a)||(t[a]=r[a],n[a]=!0)}function Hu(e,t,r,n,s,a,i,c){var l,h;if(Array.isArray(s))for(s=Array.prototype.slice.call(s),l=0,h=s.length;l<h;l+=1)Array.isArray(s[l])&&Ue(e,"nested arrays are not supported inside keys"),typeof s=="object"&&Am(s[l])==="[object Object]"&&(s[l]="[object Object]");if(typeof s=="object"&&Am(s)==="[object Object]"&&(s="[object Object]"),s=String(s),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(l=0,h=a.length;l<h;l+=1)Sm(e,t,a[l],r);else Sm(e,t,a,r);else!e.json&&!Hs.call(r,s)&&Hs.call(t,s)&&(e.line=i||e.line,e.position=c||e.position,Ue(e,"duplicated mapping key")),t[s]=a,delete r[s];return t}function Tp(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++):Ue(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function Jt(e,t,r){for(var n=0,s=e.input.charCodeAt(e.position);s!==0;){for(;Ta(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(yi(s))for(Tp(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&&tf(e,"deficient indentation"),n}function rf(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||sn(r)))}function xp(e,t){t===1?e.result+=" ":t>1&&(e.result+=ns.repeat(`
|
||
`,t-1))}function Gb(e,t,r){var n,s,a,i,c,l,h,m,A=e.kind,p=e.result,f;if(f=e.input.charCodeAt(e.position),sn(f)||Uu(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(s=e.input.charCodeAt(e.position+1),sn(s)||r&&Uu(s)))return!1;for(e.kind="scalar",e.result="",a=i=e.position,c=!1;f!==0;){if(f===58){if(s=e.input.charCodeAt(e.position+1),sn(s)||r&&Uu(s))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),sn(n))break}else{if(e.position===e.lineStart&&rf(e)||r&&Uu(f))break;if(yi(f))if(l=e.line,h=e.lineStart,m=e.lineIndent,Jt(e,!1,-1),e.lineIndent>=t){c=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=l,e.lineStart=h,e.lineIndent=m;break}}c&&(Us(e,a,i,!1),xp(e,e.line-l),a=i=e.position,c=!1),Ta(f)||(i=e.position+1),f=e.input.charCodeAt(++e.position)}return Us(e,a,i,!1),e.result?!0:(e.kind=A,e.result=p,!1)}function zb(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(Us(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 yi(r)?(Us(e,n,s,!0),xp(e,Jt(e,!1,t)),n=s=e.position):e.position===e.lineStart&&rf(e)?Ue(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);Ue(e,"unexpected end of the stream within a single quoted scalar")}function Wb(e,t){var r,n,s,a,i,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Us(e,r,e.position,!0),e.position++,!0;if(c===92){if(Us(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),yi(c))Jt(e,!1,t);else if(c<256&&Pm[c])e.result+=$m[c],e.position++;else if((i=Mb(c))>0){for(s=i,a=0;s>0;s--)c=e.input.charCodeAt(++e.position),(i=jb(c))>=0?a=(a<<4)+i:Ue(e,"expected hexadecimal character");e.result+=Kb(a),e.position++}else Ue(e,"unknown escape sequence");r=n=e.position}else yi(c)?(Us(e,r,n,!0),xp(e,Jt(e,!1,t)),r=n=e.position):e.position===e.lineStart&&rf(e)?Ue(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Ue(e,"unexpected end of the stream within a double quoted scalar")}function Yb(e,t){var r=!0,n,s=e.tag,a,i=e.anchor,c,l,h,m,A,p={},f,E,v,b;if(b=e.input.charCodeAt(e.position),b===91)l=93,A=!1,a=[];else if(b===123)l=125,A=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),b=e.input.charCodeAt(++e.position);b!==0;){if(Jt(e,!0,t),b=e.input.charCodeAt(e.position),b===l)return e.position++,e.tag=s,e.anchor=i,e.kind=A?"mapping":"sequence",e.result=a,!0;r||Ue(e,"missed comma between flow collection entries"),E=f=v=null,h=m=!1,b===63&&(c=e.input.charCodeAt(e.position+1),sn(c)&&(h=m=!0,e.position++,Jt(e,!0,t))),n=e.line,ju(e,t,Ql,!1,!0),E=e.tag,f=e.result,Jt(e,!0,t),b=e.input.charCodeAt(e.position),(m||e.line===n)&&b===58&&(h=!0,b=e.input.charCodeAt(++e.position),Jt(e,!0,t),ju(e,t,Ql,!1,!0),v=e.result),A?Hu(e,a,p,E,f,v):h?a.push(Hu(e,null,p,E,f,v)):a.push(f),Jt(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}Ue(e,"unexpected end of the stream within a flow collection")}function Xb(e,t){var r,n,s=Rp,a=!1,i=!1,c=t,l=0,h=!1,m,A;if(A=e.input.charCodeAt(e.position),A===124)n=!1;else if(A===62)n=!0;else return!1;for(e.kind="scalar",e.result="";A!==0;)if(A=e.input.charCodeAt(++e.position),A===43||A===45)Rp===s?s=A===43?wm:Nb:Ue(e,"repeat of a chomping mode identifier");else if((m=qb(A))>=0)m===0?Ue(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?Ue(e,"repeat of an indentation width identifier"):(c=t+m-1,i=!0);else break;if(Ta(A)){do A=e.input.charCodeAt(++e.position);while(Ta(A));if(A===35)do A=e.input.charCodeAt(++e.position);while(!yi(A)&&A!==0)}for(;A!==0;){for(Tp(e),e.lineIndent=0,A=e.input.charCodeAt(e.position);(!i||e.lineIndent<c)&&A===32;)e.lineIndent++,A=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>c&&(c=e.lineIndent),yi(A)){l++;continue}if(e.lineIndent<c){s===wm?e.result+=ns.repeat(`
|
||
`,a?1+l:l):s===Rp&&a&&(e.result+=`
|
||
`);break}for(n?Ta(A)?(h=!0,e.result+=ns.repeat(`
|
||
`,a?1+l:l)):h?(h=!1,e.result+=ns.repeat(`
|
||
`,l+1)):l===0?a&&(e.result+=" "):e.result+=ns.repeat(`
|
||
`,l):e.result+=ns.repeat(`
|
||
`,a?1+l:l),a=!0,i=!0,l=0,r=e.position;!yi(A)&&A!==0;)A=e.input.charCodeAt(++e.position);Us(e,r,e.position,!1)}return!0}function bm(e,t){var r,n=e.tag,s=e.anchor,a=[],i,c=!1,l;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&!(l!==45||(i=e.input.charCodeAt(e.position+1),!sn(i)));){if(c=!0,e.position++,Jt(e,!0,-1)&&e.lineIndent<=t){a.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,ju(e,t,Im,!1,!0),a.push(e.result),Jt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Ue(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=n,e.anchor=s,e.kind="sequence",e.result=a,!0):!1}function Jb(e,t,r){var n,s,a,i,c=e.tag,l=e.anchor,h={},m={},A=null,p=null,f=null,E=!1,v=!1,b;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),b=e.input.charCodeAt(e.position);b!==0;){if(n=e.input.charCodeAt(e.position+1),a=e.line,i=e.position,(b===63||b===58)&&sn(n))b===63?(E&&(Hu(e,h,m,A,p,null),A=p=f=null),v=!0,E=!0,s=!0):E?(E=!1,s=!0):Ue(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,b=n;else if(ju(e,r,_m,!1,!0))if(e.line===a){for(b=e.input.charCodeAt(e.position);Ta(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),sn(b)||Ue(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Hu(e,h,m,A,p,null),A=p=f=null),v=!0,E=!1,s=!1,A=e.tag,p=e.result;else if(v)Ue(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=l,!0}else if(v)Ue(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=l,!0;else break;if((e.line===a||e.lineIndent>t)&&(ju(e,t,ef,!0,s)&&(E?p=e.result:f=e.result),E||(Hu(e,h,m,A,p,f,a,i),A=p=f=null),Jt(e,!0,-1),b=e.input.charCodeAt(e.position)),e.lineIndent>t&&b!==0)Ue(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&Hu(e,h,m,A,p,null),v&&(e.tag=c,e.anchor=l,e.kind="mapping",e.result=h),v}function Zb(e){var t,r=!1,n=!1,s,a,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&Ue(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?(a=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):Ue(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!sn(i);)i===33&&(n?Ue(e,"tag suffix cannot contain exclamation marks"):(s=e.input.slice(t-1,e.position+1),Bm.test(s)||Ue(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Hb.test(a)&&Ue(e,"tag suffix cannot contain flow indicator characters")}return a&&!Dm.test(a)&&Ue(e,"tag name cannot contain such characters: "+a),r?e.tag=a:Hs.call(e.tagMap,s)?e.tag=e.tagMap[s]+a:s==="!"?e.tag="!"+a:s==="!!"?e.tag="tag:yaml.org,2002:"+a:Ue(e,'undeclared tag handle "'+s+'"'),!0}function Qb(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Ue(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!sn(r)&&!Uu(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Ue(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function eC(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&&!sn(n)&&!Uu(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ue(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Hs.call(e.anchorMap,r)||Ue(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Jt(e,!0,-1),!0}function ju(e,t,r,n,s){var a,i,c,l=1,h=!1,m=!1,A,p,f,E,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=i=c=ef===r||Im===r,n&&Jt(e,!0,-1)&&(h=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Zb(e)||Qb(e);)Jt(e,!0,-1)?(h=!0,c=a,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=h||s),(l===1||ef===r)&&(Ql===r||_m===r?E=t:E=t+1,v=e.position-e.lineStart,l===1?c&&(bm(e,v)||Jb(e,v,E))||Yb(e,E)?m=!0:(i&&Xb(e,E)||zb(e,E)||Wb(e,E)?m=!0:eC(e)?(m=!0,(e.tag!==null||e.anchor!==null)&&Ue(e,"alias node should not have any properties")):Gb(e,E,Ql===r)&&(m=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(m=c&&bm(e,v))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Ue(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),A=0,p=e.implicitTypes.length;A<p;A+=1)if(f=e.implicitTypes[A],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Hs.call(e.typeMap[e.kind||"fallback"],e.tag)?(f=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&f.kind!==e.kind&&Ue(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result)?(e.result=f.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Ue(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):Ue(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||m}function tC(e){var t=e.position,r,n,s,a=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(i=e.input.charCodeAt(e.position))!==0&&(Jt(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(a=!0,i=e.input.charCodeAt(++e.position),r=e.position;i!==0&&!sn(i);)i=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),s=[],n.length<1&&Ue(e,"directive name must not be less than one character in length");i!==0;){for(;Ta(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!yi(i));break}if(yi(i))break;for(r=e.position;i!==0&&!sn(i);)i=e.input.charCodeAt(++e.position);s.push(e.input.slice(r,e.position))}i!==0&&Tp(e),Hs.call(ym,n)?ym[n](e,n,s):tf(e,'unknown document directive "'+n+'"')}if(Jt(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,Jt(e,!0,-1)):a&&Ue(e,"directives end mark is expected"),ju(e,e.lineIndent-1,ef,!1,!0),Jt(e,!0,-1),e.checkLineBreaks&&Ub.test(e.input.slice(t,e.position))&&tf(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&rf(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Jt(e,!0,-1));return}if(e.position<e.length-1)Ue(e,"end of the stream or a document separator is expected");else return}function Tm(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 Vb(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Ue(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;)tC(r);return r.documents}function xm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=Tm(e,r);if(typeof t!="function")return n;for(var s=0,a=n.length;s<a;s+=1)t(n[s])}function Om(e,t){var r=Tm(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Cm("expected a single document in the stream, but found more")}}function rC(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),xm(e,t,ns.extend({schema:Fm},r))}function nC(e,t){return Om(e,ns.extend({schema:Fm},t))}cc.exports.loadAll=xm;cc.exports.load=Om;cc.exports.safeLoadAll=rC;cc.exports.safeLoad=nC});var sv=be((LP,Lp)=>{"use strict";var fc=Da(),hc=ku(),iC=oc(),sC=Lu(),Km=Object.prototype.toString,Vm=Object.prototype.hasOwnProperty,aC=9,lc=10,uC=13,oC=32,cC=33,lC=34,Gm=35,fC=37,hC=38,pC=39,dC=42,zm=44,gC=45,Wm=58,mC=61,vC=62,wC=63,AC=64,Ym=91,Xm=93,EC=96,Jm=123,yC=124,Zm=125,Tr={};Tr[0]="\\0";Tr[7]="\\a";Tr[8]="\\b";Tr[9]="\\t";Tr[10]="\\n";Tr[11]="\\v";Tr[12]="\\f";Tr[13]="\\r";Tr[27]="\\e";Tr[34]='\\"';Tr[92]="\\\\";Tr[133]="\\N";Tr[160]="\\_";Tr[8232]="\\L";Tr[8233]="\\P";var SC=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function bC(e,t){var r,n,s,a,i,c,l;if(t===null)return{};for(r={},n=Object.keys(t),s=0,a=n.length;s<a;s+=1)i=n[s],c=String(t[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),l=e.compiledTypeMap.fallback[i],l&&Vm.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[i]=c;return r}function Nm(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 hc("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+fc.repeat("0",n-t.length)+t}function CC(e){this.schema=e.schema||iC,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=fc.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=bC(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 Lm(e,t){for(var r=fc.repeat(" ",t),n=0,s=-1,a="",i,c=e.length;n<c;)s=e.indexOf(`
|
||
`,n),s===-1?(i=e.slice(n),n=c):(i=e.slice(n,s+1),n=s+1),i.length&&i!==`
|
||
`&&(a+=r),a+=i;return a}function Op(e,t){return`
|
||
`+fc.repeat(" ",e.indent*t)}function FC(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 Np(e){return e===oC||e===aC}function Mu(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 _C(e){return Mu(e)&&!Np(e)&&e!==65279&&e!==uC&&e!==lc}function Um(e,t){return Mu(e)&&e!==65279&&e!==zm&&e!==Ym&&e!==Xm&&e!==Jm&&e!==Zm&&e!==Wm&&(e!==Gm||t&&_C(t))}function IC(e){return Mu(e)&&e!==65279&&!Np(e)&&e!==gC&&e!==wC&&e!==Wm&&e!==zm&&e!==Ym&&e!==Xm&&e!==Jm&&e!==Zm&&e!==Gm&&e!==hC&&e!==dC&&e!==cC&&e!==yC&&e!==mC&&e!==vC&&e!==pC&&e!==lC&&e!==fC&&e!==AC&&e!==EC}function Qm(e){var t=/^\n* /;return t.test(e)}var ev=1,tv=2,rv=3,nv=4,nf=5;function BC(e,t,r,n,s){var a,i,c,l=!1,h=!1,m=n!==-1,A=-1,p=IC(e.charCodeAt(0))&&!Np(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(i=e.charCodeAt(a),!Mu(i))return nf;c=a>0?e.charCodeAt(a-1):null,p=p&&Um(i,c)}else{for(a=0;a<e.length;a++){if(i=e.charCodeAt(a),i===lc)l=!0,m&&(h=h||a-A-1>n&&e[A+1]!==" ",A=a);else if(!Mu(i))return nf;c=a>0?e.charCodeAt(a-1):null,p=p&&Um(i,c)}h=h||m&&a-A-1>n&&e[A+1]!==" "}return!l&&!h?p&&!s(e)?ev:tv:r>9&&Qm(e)?nf:h?nv:rv}function DC(e,t,r,n){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&SC.indexOf(t)!==-1)return"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),i=n||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return FC(e,l)}switch(BC(t,i,e.indent,a,c)){case ev:return t;case tv:return"'"+t.replace(/'/g,"''")+"'";case rv:return"|"+Hm(t,e.indent)+jm(Lm(t,s));case nv:return">"+Hm(t,e.indent)+jm(Lm(PC(t,a),s));case nf:return'"'+$C(t,a)+'"';default:throw new hc("impossible error: invalid scalar style")}}()}function Hm(e,t){var r=Qm(e)?String(t):"",n=e[e.length-1]===`
|
||
`,s=n&&(e[e.length-2]===`
|
||
`||e===`
|
||
`),a=s?"+":n?"":"-";return r+a+`
|
||
`}function jm(e){return e[e.length-1]===`
|
||
`?e.slice(0,-1):e}function PC(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var h=e.indexOf(`
|
||
`);return h=h!==-1?h:e.length,r.lastIndex=h,Mm(e.slice(0,h),t)}(),s=e[0]===`
|
||
`||e[0]===" ",a,i;i=r.exec(e);){var c=i[1],l=i[2];a=l[0]===" ",n+=c+(!s&&!a&&l!==""?`
|
||
`:"")+Mm(l,t),s=a}return n}function Mm(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,s=0,a,i=0,c=0,l="";n=r.exec(e);)c=n.index,c-s>t&&(a=i>s?i:c,l+=`
|
||
`+e.slice(s,a),s=a+1),i=c;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 $C(e){for(var t="",r,n,s,a=0;a<e.length;a++){if(r=e.charCodeAt(a),r>=55296&&r<=56319&&(n=e.charCodeAt(a+1),n>=56320&&n<=57343)){t+=Nm((r-55296)*1024+n-56320+65536),a++;continue}s=Tr[r],t+=!s&&Mu(r)?e[a]:s||Nm(r)}return t}function RC(e,t,r){var n="",s=e.tag,a,i;for(a=0,i=r.length;a<i;a+=1)xa(e,t,r[a],!1,!1)&&(a!==0&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}function TC(e,t,r,n){var s="",a=e.tag,i,c;for(i=0,c=r.length;i<c;i+=1)xa(e,t+1,r[i],!0,!0)&&((!n||i!==0)&&(s+=Op(e,t)),e.dump&&lc===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=a,e.dump=s||"[]"}function xC(e,t,r){var n="",s=e.tag,a=Object.keys(r),i,c,l,h,m;for(i=0,c=a.length;i<c;i+=1)m="",i!==0&&(m+=", "),e.condenseFlow&&(m+='"'),l=a[i],h=r[l],xa(e,t,l,!1,!1)&&(e.dump.length>1024&&(m+="? "),m+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),xa(e,t,h,!1,!1)&&(m+=e.dump,n+=m));e.tag=s,e.dump="{"+n+"}"}function OC(e,t,r,n){var s="",a=e.tag,i=Object.keys(r),c,l,h,m,A,p;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new hc("sortKeys must be a boolean or a function");for(c=0,l=i.length;c<l;c+=1)p="",(!n||c!==0)&&(p+=Op(e,t)),h=i[c],m=r[h],xa(e,t+1,h,!0,!0,!0)&&(A=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,A&&(e.dump&&lc===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,A&&(p+=Op(e,t)),xa(e,t+1,m,!0,A)&&(e.dump&&lc===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,s+=p));e.tag=a,e.dump=s||"{}"}function qm(e,t,r){var n,s,a,i,c,l;for(s=r?e.explicitTypes:e.implicitTypes,a=0,i=s.length;a<i;a+=1)if(c=s[a],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(e.tag=r?c.tag:"?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,Km.call(c.represent)==="[object Function]")n=c.represent(t,l);else if(Vm.call(c.represent,l))n=c.represent[l](t,l);else throw new hc("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}function xa(e,t,r,n,s,a){e.tag=null,e.dump=r,qm(e,r,!1)||qm(e,r,!0);var i=Km.call(e.dump);n&&(n=e.flowLevel<0||e.flowLevel>t);var c=i==="[object Object]"||i==="[object Array]",l,h;if(c&&(l=e.duplicates.indexOf(r),h=l!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(s=!1),h&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(c&&h&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),i==="[object Object]")n&&Object.keys(e.dump).length!==0?(OC(e,t,e.dump,s),h&&(e.dump="&ref_"+l+e.dump)):(xC(e,t,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump));else if(i==="[object Array]"){var m=e.noArrayIndent&&t>0?t-1:t;n&&e.dump.length!==0?(TC(e,m,e.dump,s),h&&(e.dump="&ref_"+l+e.dump)):(RC(e,m,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump))}else if(i==="[object String]")e.tag!=="?"&&DC(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new hc("unacceptable kind of an object to dump "+i)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function kC(e,t){var r=[],n=[],s,a;for(kp(e,r,n),s=0,a=n.length;s<a;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(a)}function kp(e,t,r){var n,s,a;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,a=e.length;s<a;s+=1)kp(e[s],t,r);else for(n=Object.keys(e),s=0,a=n.length;s<a;s+=1)kp(e[n[s]],t,r)}function iv(e,t){t=t||{};var r=new CC(t);return r.noRefs||kC(e,r),xa(r,0,e,!0,!0)?r.dump+`
|
||
`:""}function NC(e,t){return iv(e,fc.extend({schema:sC},t))}Lp.exports.dump=iv;Lp.exports.safeDump=NC});var uv=be((UP,jt)=>{"use strict";var sf=km(),av=sv();function af(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}jt.exports.Type=rr();jt.exports.Schema=Pa();jt.exports.FAILSAFE_SCHEMA=Jl();jt.exports.JSON_SCHEMA=Dp();jt.exports.CORE_SCHEMA=Pp();jt.exports.DEFAULT_SAFE_SCHEMA=Lu();jt.exports.DEFAULT_FULL_SCHEMA=oc();jt.exports.load=sf.load;jt.exports.loadAll=sf.loadAll;jt.exports.safeLoad=sf.safeLoad;jt.exports.safeLoadAll=sf.safeLoadAll;jt.exports.dump=av.dump;jt.exports.safeDump=av.safeDump;jt.exports.YAMLException=ku();jt.exports.MINIMAL_SCHEMA=Jl();jt.exports.SAFE_SCHEMA=Lu();jt.exports.DEFAULT_SCHEMA=oc();jt.exports.scan=af("scan");jt.exports.parse=af("parse");jt.exports.compose=af("compose");jt.exports.addConstructor=af("addConstructor")});var cv=be((HP,ov)=>{"use strict";var LC=uv();ov.exports=LC});var fv=be((jP,lv)=>{"use strict";var uf=cv();lv.exports={safeLoad:uf.safeLoad,load:uf.load,safeDump:uf.safeDump,dump:uf.dump}});var Nv=be(ff=>{"use strict";ff.byteLength=nF;ff.toByteArray=sF;ff.fromByteArray=oF;var Si=[],qn=[],rF=typeof Uint8Array<"u"?Uint8Array:Array,Kp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ka=0,Ov=Kp.length;ka<Ov;++ka)Si[ka]=Kp[ka],qn[Kp.charCodeAt(ka)]=ka;var ka,Ov;qn[45]=62;qn[95]=63;function kv(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 nF(e){var t=kv(e),r=t[0],n=t[1];return(r+n)*3/4-n}function iF(e,t,r){return(t+r)*3/4-r}function sF(e){var t,r=kv(e),n=r[0],s=r[1],a=new rF(iF(e,n,s)),i=0,c=s>0?n-4:n,l;for(l=0;l<c;l+=4)t=qn[e.charCodeAt(l)]<<18|qn[e.charCodeAt(l+1)]<<12|qn[e.charCodeAt(l+2)]<<6|qn[e.charCodeAt(l+3)],a[i++]=t>>16&255,a[i++]=t>>8&255,a[i++]=t&255;return s===2&&(t=qn[e.charCodeAt(l)]<<2|qn[e.charCodeAt(l+1)]>>4,a[i++]=t&255),s===1&&(t=qn[e.charCodeAt(l)]<<10|qn[e.charCodeAt(l+1)]<<4|qn[e.charCodeAt(l+2)]>>2,a[i++]=t>>8&255,a[i++]=t&255),a}function aF(e){return Si[e>>18&63]+Si[e>>12&63]+Si[e>>6&63]+Si[e&63]}function uF(e,t,r){for(var n,s=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),s.push(aF(n));return s.join("")}function oF(e){for(var t,r=e.length,n=r%3,s=[],a=16383,i=0,c=r-n;i<c;i+=a)s.push(uF(e,i,i+a>c?c:i+a));return n===1?(t=e[r-1],s.push(Si[t>>2]+Si[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],s.push(Si[t>>10]+Si[t>>4&63]+Si[t<<2&63]+"=")),s.join("")}});var Lv=be(Vp=>{Vp.read=function(e,t,r,n,s){var a,i,c=s*8-n-1,l=(1<<c)-1,h=l>>1,m=-7,A=r?s-1:0,p=r?-1:1,f=e[t+A];for(A+=p,a=f&(1<<-m)-1,f>>=-m,m+=c;m>0;a=a*256+e[t+A],A+=p,m-=8);for(i=a&(1<<-m)-1,a>>=-m,m+=n;m>0;i=i*256+e[t+A],A+=p,m-=8);if(a===0)a=1-h;else{if(a===l)return i?NaN:(f?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-h}return(f?-1:1)*i*Math.pow(2,a-n)};Vp.write=function(e,t,r,n,s,a){var i,c,l,h=a*8-s-1,m=(1<<h)-1,A=m>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,E=n?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,i=m):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+A>=1?t+=p/l:t+=p*Math.pow(2,1-A),t*l>=2&&(i++,l/=2),i+A>=m?(c=0,i=m):i+A>=1?(c=(t*l-1)*Math.pow(2,s),i=i+A):(c=t*Math.pow(2,A-1)*Math.pow(2,s),i=0));s>=8;e[r+f]=c&255,f+=E,c/=256,s-=8);for(i=i<<s|c,h+=s;h>0;e[r+f]=i&255,f+=E,i/=256,h-=8);e[r+f-E]|=v*128}});var df=be(Wu=>{"use strict";var Gp=Nv(),Gu=Lv(),Uv=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wu.Buffer=le;Wu.SlowBuffer=dF;Wu.INSPECT_MAX_BYTES=50;var hf=2147483647;Wu.kMaxLength=hf;le.TYPED_ARRAY_SUPPORT=cF();!le.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 cF(){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(le.prototype,"parent",{enumerable:!0,get:function(){if(le.isBuffer(this))return this.buffer}});Object.defineProperty(le.prototype,"offset",{enumerable:!0,get:function(){if(le.isBuffer(this))return this.byteOffset}});function is(e){if(e>hf)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,le.prototype),t}function le(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 Xp(e)}return qv(e,t,r)}le.poolSize=8192;function qv(e,t,r){if(typeof e=="string")return fF(e,t);if(ArrayBuffer.isView(e))return hF(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(bi(e,ArrayBuffer)||e&&bi(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(bi(e,SharedArrayBuffer)||e&&bi(e.buffer,SharedArrayBuffer)))return Wp(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 le.from(n,t,r);let s=pF(e);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return le.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)}le.from=function(e,t,r){return qv(e,t,r)};Object.setPrototypeOf(le.prototype,Uint8Array.prototype);Object.setPrototypeOf(le,Uint8Array);function Kv(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 lF(e,t,r){return Kv(e),e<=0?is(e):t!==void 0?typeof r=="string"?is(e).fill(t,r):is(e).fill(t):is(e)}le.alloc=function(e,t,r){return lF(e,t,r)};function Xp(e){return Kv(e),is(e<0?0:Jp(e)|0)}le.allocUnsafe=function(e){return Xp(e)};le.allocUnsafeSlow=function(e){return Xp(e)};function fF(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!le.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Vv(e,t)|0,n=is(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}function zp(e){let t=e.length<0?0:Jp(e.length)|0,r=is(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function hF(e){if(bi(e,Uint8Array)){let t=new Uint8Array(e);return Wp(t.buffer,t.byteOffset,t.byteLength)}return zp(e)}function Wp(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,le.prototype),n}function pF(e){if(le.isBuffer(e)){let t=Jp(e.length)|0,r=is(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Qp(e.length)?is(0):zp(e);if(e.type==="Buffer"&&Array.isArray(e.data))return zp(e.data)}function Jp(e){if(e>=hf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+hf.toString(16)+" bytes");return e|0}function dF(e){return+e!=e&&(e=0),le.alloc(+e)}le.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==le.prototype};le.compare=function(t,r){if(bi(t,Uint8Array)&&(t=le.from(t,t.offset,t.byteLength)),bi(r,Uint8Array)&&(r=le.from(r,r.offset,r.byteLength)),!le.isBuffer(t)||!le.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 a=0,i=Math.min(n,s);a<i;++a)if(t[a]!==r[a]){n=t[a],s=r[a];break}return n<s?-1:s<n?1:0};le.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}};le.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return le.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let s=le.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){let i=t[n];if(bi(i,Uint8Array))a+i.length>s.length?(le.isBuffer(i)||(i=le.from(i)),i.copy(s,a)):Uint8Array.prototype.set.call(s,i,a);else if(le.isBuffer(i))i.copy(s,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=i.length}return s};function Vv(e,t){if(le.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||bi(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 Yp(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return e2(e).length;default:if(s)return n?-1:Yp(e).length;t=(""+t).toLowerCase(),s=!0}}le.byteLength=Vv;function gF(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 FF(this,t,r);case"utf8":case"utf-8":return zv(this,t,r);case"ascii":return bF(this,t,r);case"latin1":case"binary":return CF(this,t,r);case"base64":return yF(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}le.prototype._isBuffer=!0;function Na(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}le.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)Na(this,r,r+1);return this};le.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)Na(this,r,r+3),Na(this,r+1,r+2);return this};le.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)Na(this,r,r+7),Na(this,r+1,r+6),Na(this,r+2,r+5),Na(this,r+3,r+4);return this};le.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?zv(this,0,t):gF.apply(this,arguments)};le.prototype.toLocaleString=le.prototype.toString;le.prototype.equals=function(t){if(!le.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:le.compare(this,t)===0};le.prototype.inspect=function(){let t="",r=Wu.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Uv&&(le.prototype[Uv]=le.prototype.inspect);le.prototype.compare=function(t,r,n,s,a){if(bi(t,Uint8Array)&&(t=le.from(t,t.offset,t.byteLength)),!le.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),a===void 0&&(a=this.length),r<0||n>t.length||s<0||a>this.length)throw new RangeError("out of range index");if(s>=a&&r>=n)return 0;if(s>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,s>>>=0,a>>>=0,this===t)return 0;let i=a-s,c=n-r,l=Math.min(i,c),h=this.slice(s,a),m=t.slice(r,n);for(let A=0;A<l;++A)if(h[A]!==m[A]){i=h[A],c=m[A];break}return i<c?-1:c<i?1:0};function Gv(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,Qp(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=le.from(t,n)),le.isBuffer(t))return t.length===0?-1:Hv(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):Hv(e,[t],r,n,s);throw new TypeError("val must be string, number or Buffer")}function Hv(e,t,r,n,s){let a=1,i=e.length,c=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;a=2,i/=2,c/=2,r/=2}function l(m,A){return a===1?m[A]:m.readUInt16BE(A*a)}let h;if(s){let m=-1;for(h=r;h<i;h++)if(l(e,h)===l(t,m===-1?0:h-m)){if(m===-1&&(m=h),h-m+1===c)return m*a}else m!==-1&&(h-=h-m),m=-1}else for(r+c>i&&(r=i-c),h=r;h>=0;h--){let m=!0;for(let A=0;A<c;A++)if(l(e,h+A)!==l(t,A)){m=!1;break}if(m)return h}return-1}le.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};le.prototype.indexOf=function(t,r,n){return Gv(this,t,r,n,!0)};le.prototype.lastIndexOf=function(t,r,n){return Gv(this,t,r,n,!1)};function mF(e,t,r,n){r=Number(r)||0;let s=e.length-r;n?(n=Number(n),n>s&&(n=s)):n=s;let a=t.length;n>a/2&&(n=a/2);let i;for(i=0;i<n;++i){let c=parseInt(t.substr(i*2,2),16);if(Qp(c))return i;e[r+i]=c}return i}function vF(e,t,r,n){return pf(Yp(t,e.length-r),e,r,n)}function wF(e,t,r,n){return pf(PF(t),e,r,n)}function AF(e,t,r,n){return pf(e2(t),e,r,n)}function EF(e,t,r,n){return pf($F(t,e.length-r),e,r,n)}le.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 a=this.length-r;if((n===void 0||n>a)&&(n=a),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 mF(this,t,r,n);case"utf8":case"utf-8":return vF(this,t,r,n);case"ascii":case"latin1":case"binary":return wF(this,t,r,n);case"base64":return AF(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return EF(this,t,r,n);default:if(i)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),i=!0}};le.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yF(e,t,r){return t===0&&r===e.length?Gp.fromByteArray(e):Gp.fromByteArray(e.slice(t,r))}function zv(e,t,r){r=Math.min(e.length,r);let n=[],s=t;for(;s<r;){let a=e[s],i=null,c=a>239?4:a>223?3:a>191?2:1;if(s+c<=r){let l,h,m,A;switch(c){case 1:a<128&&(i=a);break;case 2:l=e[s+1],(l&192)===128&&(A=(a&31)<<6|l&63,A>127&&(i=A));break;case 3:l=e[s+1],h=e[s+2],(l&192)===128&&(h&192)===128&&(A=(a&15)<<12|(l&63)<<6|h&63,A>2047&&(A<55296||A>57343)&&(i=A));break;case 4:l=e[s+1],h=e[s+2],m=e[s+3],(l&192)===128&&(h&192)===128&&(m&192)===128&&(A=(a&15)<<18|(l&63)<<12|(h&63)<<6|m&63,A>65535&&A<1114112&&(i=A))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),s+=c}return SF(n)}var jv=4096;function SF(e){let t=e.length;if(t<=jv)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=jv));return r}function bF(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 CF(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 FF(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let s="";for(let a=t;a<r;++a)s+=RF[e[a]];return s}function _F(e,t,r){let n=e.slice(t,r),s="";for(let a=0;a<n.length-1;a+=2)s+=String.fromCharCode(n[a]+n[a+1]*256);return s}le.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,le.prototype),s};function hr(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")}le.prototype.readUintLE=le.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||hr(t,r,this.length);let s=this[t],a=1,i=0;for(;++i<r&&(a*=256);)s+=this[t+i]*a;return s};le.prototype.readUintBE=le.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||hr(t,r,this.length);let s=this[t+--r],a=1;for(;r>0&&(a*=256);)s+=this[t+--r]*a;return s};le.prototype.readUint8=le.prototype.readUInt8=function(t,r){return t=t>>>0,r||hr(t,1,this.length),this[t]};le.prototype.readUint16LE=le.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||hr(t,2,this.length),this[t]|this[t+1]<<8};le.prototype.readUint16BE=le.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||hr(t,2,this.length),this[t]<<8|this[t+1]};le.prototype.readUint32LE=le.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};le.prototype.readUint32BE=le.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};le.prototype.readBigUInt64LE=js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&mc(t,this.length-8);let s=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(s)+(BigInt(a)<<BigInt(32))});le.prototype.readBigUInt64BE=js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&mc(t,this.length-8);let s=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(s)<<BigInt(32))+BigInt(a)});le.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||hr(t,r,this.length);let s=this[t],a=1,i=0;for(;++i<r&&(a*=256);)s+=this[t+i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};le.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||hr(t,r,this.length);let s=r,a=1,i=this[t+--s];for(;s>0&&(a*=256);)i+=this[t+--s]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};le.prototype.readInt8=function(t,r){return t=t>>>0,r||hr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};le.prototype.readInt16LE=function(t,r){t=t>>>0,r||hr(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};le.prototype.readInt16BE=function(t,r){t=t>>>0,r||hr(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};le.prototype.readInt32LE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};le.prototype.readInt32BE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};le.prototype.readBigInt64LE=js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&mc(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)});le.prototype.readBigInt64BE=js(function(t){t=t>>>0,zu(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&mc(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)});le.prototype.readFloatLE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),Gu.read(this,t,!0,23,4)};le.prototype.readFloatBE=function(t,r){return t=t>>>0,r||hr(t,4,this.length),Gu.read(this,t,!1,23,4)};le.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||hr(t,8,this.length),Gu.read(this,t,!0,52,8)};le.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||hr(t,8,this.length),Gu.read(this,t,!1,52,8)};function an(e,t,r,n,s,a){if(!le.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}le.prototype.writeUintLE=le.prototype.writeUIntLE=function(t,r,n,s){if(t=+t,r=r>>>0,n=n>>>0,!s){let c=Math.pow(2,8*n)-1;an(this,t,r,n,c,0)}let a=1,i=0;for(this[r]=t&255;++i<n&&(a*=256);)this[r+i]=t/a&255;return r+n};le.prototype.writeUintBE=le.prototype.writeUIntBE=function(t,r,n,s){if(t=+t,r=r>>>0,n=n>>>0,!s){let c=Math.pow(2,8*n)-1;an(this,t,r,n,c,0)}let a=n-1,i=1;for(this[r+a]=t&255;--a>=0&&(i*=256);)this[r+a]=t/i&255;return r+n};le.prototype.writeUint8=le.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,1,255,0),this[r]=t&255,r+1};le.prototype.writeUint16LE=le.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};le.prototype.writeUint16BE=le.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};le.prototype.writeUint32LE=le.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||an(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};le.prototype.writeUint32BE=le.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||an(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 Wv(e,t,r,n,s){Qv(t,n,s,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;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 Yv(e,t,r,n,s){Qv(t,n,s,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;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}le.prototype.writeBigUInt64LE=js(function(t,r=0){return Wv(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});le.prototype.writeBigUInt64BE=js(function(t,r=0){return Yv(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});le.prototype.writeIntLE=function(t,r,n,s){if(t=+t,r=r>>>0,!s){let l=Math.pow(2,8*n-1);an(this,t,r,n,l-1,-l)}let a=0,i=1,c=0;for(this[r]=t&255;++a<n&&(i*=256);)t<0&&c===0&&this[r+a-1]!==0&&(c=1),this[r+a]=(t/i>>0)-c&255;return r+n};le.prototype.writeIntBE=function(t,r,n,s){if(t=+t,r=r>>>0,!s){let l=Math.pow(2,8*n-1);an(this,t,r,n,l-1,-l)}let a=n-1,i=1,c=0;for(this[r+a]=t&255;--a>=0&&(i*=256);)t<0&&c===0&&this[r+a+1]!==0&&(c=1),this[r+a]=(t/i>>0)-c&255;return r+n};le.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};le.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};le.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||an(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};le.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||an(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};le.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||an(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};le.prototype.writeBigInt64LE=js(function(t,r=0){return Wv(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});le.prototype.writeBigInt64BE=js(function(t,r=0){return Yv(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Xv(e,t,r,n,s,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Jv(e,t,r,n,s){return t=+t,r=r>>>0,s||Xv(e,t,r,4,34028234663852886e22,-34028234663852886e22),Gu.write(e,t,r,n,23,4),r+4}le.prototype.writeFloatLE=function(t,r,n){return Jv(this,t,r,!0,n)};le.prototype.writeFloatBE=function(t,r,n){return Jv(this,t,r,!1,n)};function Zv(e,t,r,n,s){return t=+t,r=r>>>0,s||Xv(e,t,r,8,17976931348623157e292,-17976931348623157e292),Gu.write(e,t,r,n,52,8),r+8}le.prototype.writeDoubleLE=function(t,r,n){return Zv(this,t,r,!0,n)};le.prototype.writeDoubleBE=function(t,r,n){return Zv(this,t,r,!1,n)};le.prototype.copy=function(t,r,n,s){if(!le.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 a=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),a};le.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"&&!le.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 a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{let i=le.isBuffer(t)?t:le.from(t,s),c=i.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=i[a%c]}return this};var Vu={};function Zp(e,t,r){Vu[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}`}}}Zp("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zp("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);Zp("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=Mv(String(r)):typeof r=="bigint"&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=Mv(s)),s+="n"),n+=` It must be ${t}. Received ${s}`,n},RangeError);function Mv(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 IF(e,t,r){zu(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&mc(t,e.length-(r+1))}function Qv(e,t,r,n,s,a){if(e>r||e<t){let i=typeof t=="bigint"?"n":"",c;throw a>3?t===0||t===BigInt(0)?c=`>= 0${i} and < 2${i} ** ${(a+1)*8}${i}`:c=`>= -(2${i} ** ${(a+1)*8-1}${i}) and < 2 ** ${(a+1)*8-1}${i}`:c=`>= ${t}${i} and <= ${r}${i}`,new Vu.ERR_OUT_OF_RANGE("value",c,e)}IF(n,s,a)}function zu(e,t){if(typeof e!="number")throw new Vu.ERR_INVALID_ARG_TYPE(t,"number",e)}function mc(e,t,r){throw Math.floor(e)!==e?(zu(e,r),new Vu.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Vu.ERR_BUFFER_OUT_OF_BOUNDS:new Vu.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var BF=/[^+/0-9A-Za-z-_]/g;function DF(e){if(e=e.split("=")[0],e=e.trim().replace(BF,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Yp(e,t){t=t||1/0;let r,n=e.length,s=null,a=[];for(let i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!s){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&a.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function PF(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function $F(e,t){let r,n,s,a=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,s=r%256,a.push(s),a.push(n);return a}function e2(e){return Gp.toByteArray(DF(e))}function pf(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 bi(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Qp(e){return e!==e}var RF=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 js(e){return typeof BigInt>"u"?TF:e}function TF(){throw new Error("BigInt not supported")}});var C2=be(ye=>{var vc={};vc.userAgent=!1;var Yu={},xF="11.1.0",OF="jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license";var Se=Se||function(e,t){var r={},n=r.lib={},s=n.Base=function(){function f(){}return{extend:function(E){f.prototype=this;var v=new f;return E&&v.mixIn(E),v.hasOwnProperty("init")||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var v in E)E.hasOwnProperty(v)&&(this[v]=E[v]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=n.WordArray=s.extend({init:function(f,E){f=this.words=f||[],E!=t?this.sigBytes=E:this.sigBytes=f.length*4},toString:function(f){return(f||c).stringify(this)},concat:function(f){var E=this.words,v=f.words,b=this.sigBytes,w=f.sigBytes;if(this.clamp(),b%4)for(var S=0;S<w;S++){var F=v[S>>>2]>>>24-S%4*8&255;E[b+S>>>2]|=F<<24-(b+S)%4*8}else for(var S=0;S<w;S+=4)E[b+S>>>2]=v[S>>>2];return this.sigBytes+=w,this},clamp:function(){var f=this.words,E=this.sigBytes;f[E>>>2]&=4294967295<<32-E%4*8,f.length=e.ceil(E/4)},clone:function(){var f=s.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var E=[],v=0;v<f;v+=4)E.push(e.random()*4294967296|0);return new a.init(E,f)}}),i=r.enc={},c=i.Hex={stringify:function(f){for(var E=f.words,v=f.sigBytes,b=[],w=0;w<v;w++){var S=E[w>>>2]>>>24-w%4*8&255;b.push((S>>>4).toString(16)),b.push((S&15).toString(16))}return b.join("")},parse:function(f){for(var E=f.length,v=[],b=0;b<E;b+=2)v[b>>>3]|=parseInt(f.substr(b,2),16)<<24-b%8*4;return new a.init(v,E/2)}},l=i.Latin1={stringify:function(f){for(var E=f.words,v=f.sigBytes,b=[],w=0;w<v;w++){var S=E[w>>>2]>>>24-w%4*8&255;b.push(String.fromCharCode(S))}return b.join("")},parse:function(f){for(var E=f.length,v=[],b=0;b<E;b++)v[b>>>2]|=(f.charCodeAt(b)&255)<<24-b%4*8;return new a.init(v,E)}},h=i.Utf8={stringify:function(f){try{return decodeURIComponent(escape(l.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return l.parse(unescape(encodeURIComponent(f)))}},m=n.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=h.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var E=this._data,v=E.words,b=E.sigBytes,w=this.blockSize,S=w*4,F=b/S;f?F=e.ceil(F):F=e.max((F|0)-this._minBufferSize,0);var D=F*w,I=e.min(D*4,b);if(D){for(var j=0;j<D;j+=w)this._doProcessBlock(v,j);var q=v.splice(0,D);E.sigBytes-=I}return new a.init(q,I)},clone:function(){var f=s.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0}),A=n.Hasher=m.extend({cfg:s.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var E=this._doFinalize();return E},blockSize:512/32,_createHelper:function(f){return function(E,v){return new f.init(v).finalize(E)}},_createHmacHelper:function(f){return function(E,v){return new p.HMAC.init(f,v).finalize(E)}}}),p=r.algo={};return r}(Math);(function(e){var s=Se,t=s.lib,r=t.Base,n=t.WordArray,s=s.x64={};s.Word=r.extend({init:function(a,i){this.high=a,this.low=i}}),s.WordArray=r.extend({init:function(a,i){a=this.words=a||[],this.sigBytes=i!=e?i:8*a.length},toX32:function(){for(var a=this.words,i=a.length,c=[],l=0;l<i;l++){var h=a[l];c.push(h.high),c.push(h.low)}return n.create(c,this.sigBytes)},clone:function(){for(var a=r.clone.call(this),i=a.words=this.words.slice(0),c=i.length,l=0;l<c;l++)i[l]=i[l].clone();return a}})})();Se.lib.Cipher||function(e){var f=Se,t=f.lib,r=t.Base,n=t.WordArray,s=t.BufferedBlockAlgorithm,a=f.enc.Base64,i=f.algo.EvpKDF,c=t.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(v,b){return this.create(this._ENC_XFORM_MODE,v,b)},createDecryptor:function(v,b){return this.create(this._DEC_XFORM_MODE,v,b)},init:function(v,b,w){this.cfg=this.cfg.extend(w),this._xformMode=v,this._key=b,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(b,w,S){return(typeof w=="string"?E:p).encrypt(v,b,w,S)},decrypt:function(b,w,S){return(typeof w=="string"?E:p).decrypt(v,b,w,S)}}}});t.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var A=f.mode={},l=function(v,b,w){var S=this._iv;S?this._iv=e:S=this._prevBlock;for(var F=0;F<w;F++)v[b+F]^=S[F]},h=(t.BlockCipherMode=r.extend({createEncryptor:function(v,b){return this.Encryptor.create(v,b)},createDecryptor:function(v,b){return this.Decryptor.create(v,b)},init:function(v,b){this._cipher=v,this._iv=b}})).extend();h.Encryptor=h.extend({processBlock:function(v,b){var w=this._cipher,S=w.blockSize;l.call(this,v,b,S),w.encryptBlock(v,b),this._prevBlock=v.slice(b,b+S)}}),h.Decryptor=h.extend({processBlock:function(v,b){var w=this._cipher,S=w.blockSize,F=v.slice(b,b+S);w.decryptBlock(v,b),l.call(this,v,b,S),this._prevBlock=F}}),A=A.CBC=h,h=(f.pad={}).Pkcs7={pad:function(v,b){for(var w=4*b,w=w-v.sigBytes%w,S=w<<24|w<<16|w<<8|w,F=[],D=0;D<w;D+=4)F.push(S);w=n.create(F,w),v.concat(w)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=c.extend({cfg:c.cfg.extend({mode:A,padding:h}),reset:function(){c.reset.call(this);var b=this.cfg,v=b.iv,b=b.mode;if(this._xformMode==this._ENC_XFORM_MODE)var w=b.createEncryptor;else w=b.createDecryptor,this._minBufferSize=1;this._mode=w.call(b,this,v&&v.words)},_doProcessBlock:function(v,b){this._mode.processBlock(v,b)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),v.unpad(b);return b},blockSize:4});var m=t.CipherParams=r.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),A=(f.format={}).OpenSSL={stringify:function(v){var b=v.ciphertext;return v=v.salt,(v?n.create([1398893684,1701076831]).concat(v).concat(b):b).toString(a)},parse:function(v){v=a.parse(v);var b=v.words;if(b[0]==1398893684&&b[1]==1701076831){var w=n.create(b.slice(2,4));b.splice(0,4),v.sigBytes-=16}return m.create({ciphertext:v,salt:w})}},p=t.SerializableCipher=r.extend({cfg:r.extend({format:A}),encrypt:function(v,b,w,S){S=this.cfg.extend(S);var F=v.createEncryptor(w,S);return b=F.finalize(b),F=F.cfg,m.create({ciphertext:b,key:w,iv:F.iv,algorithm:v,mode:F.mode,padding:F.padding,blockSize:v.blockSize,formatter:S.format})},decrypt:function(v,b,w,S){return S=this.cfg.extend(S),b=this._parse(b,S.format),v.createDecryptor(w,S).finalize(b.ciphertext)},_parse:function(v,b){return typeof v=="string"?b.parse(v,this):v}}),f=(f.kdf={}).OpenSSL={execute:function(v,b,w,S){return S||(S=n.random(8)),v=i.create({keySize:b+w}).compute(v,S),w=n.create(v.words.slice(b),4*w),v.sigBytes=4*b,m.create({key:v,iv:w,salt:S})}},E=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:f}),encrypt:function(v,b,w,S){return S=this.cfg.extend(S),w=S.kdf.execute(w,v.keySize,v.ivSize),S.iv=w.iv,v=p.encrypt.call(this,v,b,w.key,S),v.mixIn(w),v},decrypt:function(v,b,w,S){return S=this.cfg.extend(S),b=this._parse(b,S.format),w=S.kdf.execute(w,v.keySize,v.ivSize,b.salt),S.iv=w.iv,p.decrypt.call(this,v,b,w.key,S)}})}();(function(){for(var e=Se,t=e.lib.BlockCipher,j=e.algo,r=[],n=[],s=[],a=[],i=[],c=[],l=[],h=[],m=[],A=[],p=[],f=0;256>f;f++)p[f]=128>f?f<<1:f<<1^283;for(var E=0,v=0,f=0;256>f;f++){var b=v^v<<1^v<<2^v<<3^v<<4,b=b>>>8^b&255^99;r[E]=b,n[b]=E;var w=p[E],S=p[w],F=p[S],D=257*p[b]^16843008*b;s[E]=D<<24|D>>>8,a[E]=D<<16|D>>>16,i[E]=D<<8|D>>>24,c[E]=D,D=16843009*F^65537*S^257*w^16843008*E,l[b]=D<<24|D>>>8,h[b]=D<<16|D>>>16,m[b]=D<<8|D>>>24,A[b]=D,E?(E=w^p[p[p[F^w]]],v^=p[p[v]]):E=v=1}var I=[0,1,2,4,8,16,32,64,128,27,54],j=j.AES=t.extend({_doReset:function(){for(var P=this._key,q=P.words,_=P.sigBytes/4,P=4*((this._nRounds=_+6)+1),k=this._keySchedule=[],U=0;U<P;U++)if(U<_)k[U]=q[U];else{var M=k[U-1];U%_?6<_&&U%_==4&&(M=r[M>>>24]<<24|r[M>>>16&255]<<16|r[M>>>8&255]<<8|r[M&255]):(M=M<<8|M>>>24,M=r[M>>>24]<<24|r[M>>>16&255]<<16|r[M>>>8&255]<<8|r[M&255],M^=I[U/_|0]<<24),k[U]=k[U-_]^M}for(q=this._invKeySchedule=[],_=0;_<P;_++)U=P-_,M=_%4?k[U]:k[U-4],q[_]=4>_||4>=U?M:l[r[M>>>24]]^h[r[M>>>16&255]]^m[r[M>>>8&255]]^A[r[M&255]]},encryptBlock:function(q,_){this._doCryptBlock(q,_,this._keySchedule,s,a,i,c,r)},decryptBlock:function(q,_){var P=q[_+1];q[_+1]=q[_+3],q[_+3]=P,this._doCryptBlock(q,_,this._invKeySchedule,l,h,m,A,n),P=q[_+1],q[_+1]=q[_+3],q[_+3]=P},_doCryptBlock:function(q,_,P,k,U,M,W,K){for(var V=this._nRounds,ue=q[_]^P[0],Ce=q[_+1]^P[1],Oe=q[_+2]^P[2],He=q[_+3]^P[3],z=4,ne=1;ne<V;ne++)var Ee=k[ue>>>24]^U[Ce>>>16&255]^M[Oe>>>8&255]^W[He&255]^P[z++],we=k[Ce>>>24]^U[Oe>>>16&255]^M[He>>>8&255]^W[ue&255]^P[z++],_e=k[Oe>>>24]^U[He>>>16&255]^M[ue>>>8&255]^W[Ce&255]^P[z++],He=k[He>>>24]^U[ue>>>16&255]^M[Ce>>>8&255]^W[Oe&255]^P[z++],ue=Ee,Ce=we,Oe=_e;Ee=(K[ue>>>24]<<24|K[Ce>>>16&255]<<16|K[Oe>>>8&255]<<8|K[He&255])^P[z++],we=(K[Ce>>>24]<<24|K[Oe>>>16&255]<<16|K[He>>>8&255]<<8|K[ue&255])^P[z++],_e=(K[Oe>>>24]<<24|K[He>>>16&255]<<16|K[ue>>>8&255]<<8|K[Ce&255])^P[z++],He=(K[He>>>24]<<24|K[ue>>>16&255]<<16|K[Ce>>>8&255]<<8|K[Oe&255])^P[z++],q[_]=Ee,q[_+1]=we,q[_+2]=_e,q[_+3]=He},keySize:8});e.AES=t._createHelper(j)})();(function(){function e(p,f){var E=(this._lBlock>>>p^this._rBlock)&f;this._rBlock^=E,this._lBlock^=E<<p}function t(p,f){var E=(this._rBlock>>>p^this._lBlock)&f;this._lBlock^=E,this._rBlock^=E<<p}var r=Se,s=r.lib,n=s.WordArray,s=s.BlockCipher,a=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],c=[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],h=[{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}],m=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],A=a.DES=s.extend({_doReset:function(){for(var p=this._key.words,f=[],E=0;56>E;E++){var v=i[E]-1;f[E]=p[v>>>5]>>>31-v%32&1}for(p=this._subKeys=[],v=0;16>v;v++){for(var b=p[v]=[],w=l[v],E=0;24>E;E++)b[E/6|0]|=f[(c[E]-1+w)%28]<<31-E%6,b[4+(E/6|0)]|=f[28+(c[E+24]-1+w)%28]<<31-E%6;for(b[0]=b[0]<<1|b[0]>>>31,E=1;7>E;E++)b[E]>>>=4*(E-1)+3;b[7]=b[7]<<5|b[7]>>>27}for(f=this._invSubKeys=[],E=0;16>E;E++)f[E]=p[15-E]},encryptBlock:function(p,f){this._doCryptBlock(p,f,this._subKeys)},decryptBlock:function(p,f){this._doCryptBlock(p,f,this._invSubKeys)},_doCryptBlock:function(p,f,E){this._lBlock=p[f],this._rBlock=p[f+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 b=E[v],w=this._lBlock,S=this._rBlock,F=0,D=0;8>D;D++)F|=h[D][((S^b[D])&m[D])>>>0];this._lBlock=S,this._rBlock=w^F}E=this._lBlock,this._lBlock=this._rBlock,this._rBlock=E,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[f]=this._lBlock,p[f+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=s._createHelper(A),a=a.TripleDES=s.extend({_doReset:function(){var p=this._key.words;this._des1=A.createEncryptor(n.create(p.slice(0,2))),this._des2=A.createEncryptor(n.create(p.slice(2,4))),this._des3=A.createEncryptor(n.create(p.slice(4,6)))},encryptBlock:function(p,f){this._des1.encryptBlock(p,f),this._des2.decryptBlock(p,f),this._des3.encryptBlock(p,f)},decryptBlock:function(p,f){this._des3.decryptBlock(p,f),this._des2.encryptBlock(p,f),this._des1.decryptBlock(p,f)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=s._createHelper(a)})();(function(){var e=Se,t=e.lib.WordArray;e.enc.Base64={stringify:function(r){var n=r.words,s=r.sigBytes,a=this._map;r.clamp(),r=[];for(var i=0;i<s;i+=3)for(var c=(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(a.charAt(c>>>6*(3-l)&63));if(n=a.charAt(64))for(;r.length%4;)r.push(n);return r.join("")},parse:function(r){var n=r.length,s=this._map,a=s.charAt(64);a&&(a=r.indexOf(a),a!=-1&&(n=a));for(var a=[],i=0,c=0;c<n;c++)if(c%4){var l=s.indexOf(r.charAt(c-1))<<2*(c%4),h=s.indexOf(r.charAt(c))>>>6-2*(c%4);a[i>>>2]|=(l|h)<<24-8*(i%4),i++}return t.create(a,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(e){function t(A,p,f,E,v,b,w){return A=A+(p&f|~p&E)+v+w,(A<<b|A>>>32-b)+p}function r(A,p,f,E,v,b,w){return A=A+(p&E|f&~E)+v+w,(A<<b|A>>>32-b)+p}function n(A,p,f,E,v,b,w){return A=A+(p^f^E)+v+w,(A<<b|A>>>32-b)+p}function s(A,p,f,E,v,b,w){return A=A+(f^(p|~E))+v+w,(A<<b|A>>>32-b)+p}for(var a=Se,l=a.lib,i=l.WordArray,c=l.Hasher,l=a.algo,h=[],m=0;64>m;m++)h[m]=4294967296*e.abs(e.sin(m+1))|0;l=l.MD5=c.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(A,p){for(var f=0;16>f;f++){var E=p+f,v=A[E];A[E]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360}var f=this._hash.words,E=A[p+0],v=A[p+1],b=A[p+2],w=A[p+3],S=A[p+4],F=A[p+5],D=A[p+6],I=A[p+7],j=A[p+8],q=A[p+9],_=A[p+10],P=A[p+11],k=A[p+12],U=A[p+13],M=A[p+14],W=A[p+15],K=f[0],ne=f[1],z=f[2],V=f[3],K=t(K,ne,z,V,E,7,h[0]),V=t(V,K,ne,z,v,12,h[1]),z=t(z,V,K,ne,b,17,h[2]),ne=t(ne,z,V,K,w,22,h[3]),K=t(K,ne,z,V,S,7,h[4]),V=t(V,K,ne,z,F,12,h[5]),z=t(z,V,K,ne,D,17,h[6]),ne=t(ne,z,V,K,I,22,h[7]),K=t(K,ne,z,V,j,7,h[8]),V=t(V,K,ne,z,q,12,h[9]),z=t(z,V,K,ne,_,17,h[10]),ne=t(ne,z,V,K,P,22,h[11]),K=t(K,ne,z,V,k,7,h[12]),V=t(V,K,ne,z,U,12,h[13]),z=t(z,V,K,ne,M,17,h[14]),ne=t(ne,z,V,K,W,22,h[15]),K=r(K,ne,z,V,v,5,h[16]),V=r(V,K,ne,z,D,9,h[17]),z=r(z,V,K,ne,P,14,h[18]),ne=r(ne,z,V,K,E,20,h[19]),K=r(K,ne,z,V,F,5,h[20]),V=r(V,K,ne,z,_,9,h[21]),z=r(z,V,K,ne,W,14,h[22]),ne=r(ne,z,V,K,S,20,h[23]),K=r(K,ne,z,V,q,5,h[24]),V=r(V,K,ne,z,M,9,h[25]),z=r(z,V,K,ne,w,14,h[26]),ne=r(ne,z,V,K,j,20,h[27]),K=r(K,ne,z,V,U,5,h[28]),V=r(V,K,ne,z,b,9,h[29]),z=r(z,V,K,ne,I,14,h[30]),ne=r(ne,z,V,K,k,20,h[31]),K=n(K,ne,z,V,F,4,h[32]),V=n(V,K,ne,z,j,11,h[33]),z=n(z,V,K,ne,P,16,h[34]),ne=n(ne,z,V,K,M,23,h[35]),K=n(K,ne,z,V,v,4,h[36]),V=n(V,K,ne,z,S,11,h[37]),z=n(z,V,K,ne,I,16,h[38]),ne=n(ne,z,V,K,_,23,h[39]),K=n(K,ne,z,V,U,4,h[40]),V=n(V,K,ne,z,E,11,h[41]),z=n(z,V,K,ne,w,16,h[42]),ne=n(ne,z,V,K,D,23,h[43]),K=n(K,ne,z,V,q,4,h[44]),V=n(V,K,ne,z,k,11,h[45]),z=n(z,V,K,ne,W,16,h[46]),ne=n(ne,z,V,K,b,23,h[47]),K=s(K,ne,z,V,E,6,h[48]),V=s(V,K,ne,z,I,10,h[49]),z=s(z,V,K,ne,M,15,h[50]),ne=s(ne,z,V,K,F,21,h[51]),K=s(K,ne,z,V,k,6,h[52]),V=s(V,K,ne,z,w,10,h[53]),z=s(z,V,K,ne,_,15,h[54]),ne=s(ne,z,V,K,v,21,h[55]),K=s(K,ne,z,V,j,6,h[56]),V=s(V,K,ne,z,W,10,h[57]),z=s(z,V,K,ne,D,15,h[58]),ne=s(ne,z,V,K,U,21,h[59]),K=s(K,ne,z,V,S,6,h[60]),V=s(V,K,ne,z,P,10,h[61]),z=s(z,V,K,ne,b,15,h[62]),ne=s(ne,z,V,K,q,21,h[63]);f[0]=f[0]+K|0,f[1]=f[1]+ne|0,f[2]=f[2]+z|0,f[3]=f[3]+V|0},_doFinalize:function(){var A=this._data,p=A.words,f=8*this._nDataBytes,E=8*A.sigBytes;p[E>>>5]|=128<<24-E%32;var v=e.floor(f/4294967296);for(p[(E+64>>>9<<4)+15]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,p[(E+64>>>9<<4)+14]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,A.sigBytes=4*(p.length+1),this._process(),A=this._hash,p=A.words,f=0;4>f;f++)E=p[f],p[f]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360;return A},clone:function(){var A=c.clone.call(this);return A._hash=this._hash.clone(),A}}),a.MD5=c._createHelper(l),a.HmacMD5=c._createHmacHelper(l)})(Math);(function(){var e=Se,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(a,i){for(var c=this._hash.words,l=c[0],h=c[1],m=c[2],A=c[3],p=c[4],f=0;80>f;f++){if(16>f)n[f]=a[i+f]|0;else{var E=n[f-3]^n[f-8]^n[f-14]^n[f-16];n[f]=E<<1|E>>>31}E=(l<<5|l>>>27)+p+n[f],E=20>f?E+((h&m|~h&A)+1518500249):40>f?E+((h^m^A)+1859775393):60>f?E+((h&m|h&A|m&A)-1894007588):E+((h^m^A)-899497514),p=A,A=m,m=h<<30|h>>>2,h=l,l=E}c[0]=c[0]+l|0,c[1]=c[1]+h|0,c[2]=c[2]+m|0,c[3]=c[3]+A|0,c[4]=c[4]+p|0},_doFinalize:function(){var a=this._data,i=a.words,c=8*this._nDataBytes,l=8*a.sigBytes;return i[l>>>5]|=128<<24-l%32,i[(l+64>>>9<<4)+14]=Math.floor(c/4294967296),i[(l+64>>>9<<4)+15]=c,a.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var a=r.clone.call(this);return a._hash=this._hash.clone(),a}});e.SHA1=r._createHelper(s),e.HmacSHA1=r._createHmacHelper(s)})();(function(e){for(var t=Se,f=t.lib,r=f.WordArray,n=f.Hasher,f=t.algo,s=[],a=[],i=function(v){return 4294967296*(v-(v|0))|0},c=2,l=0;64>l;){var h;e:{h=c;for(var m=e.sqrt(h),A=2;A<=m;A++)if(!(h%A)){h=!1;break e}h=!0}h&&(8>l&&(s[l]=i(e.pow(c,.5))),a[l]=i(e.pow(c,1/3)),l++),c++}var p=[],f=f.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(E,v){for(var b=this._hash.words,w=b[0],S=b[1],F=b[2],D=b[3],I=b[4],j=b[5],q=b[6],_=b[7],P=0;64>P;P++){if(16>P)p[P]=E[v+P]|0;else{var k=p[P-15],U=p[P-2];p[P]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+p[P-7]+((U<<15|U>>>17)^(U<<13|U>>>19)^U>>>10)+p[P-16]}k=_+((I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25))+(I&j^~I&q)+a[P]+p[P],U=((w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22))+(w&S^w&F^S&F),_=q,q=j,j=I,I=D+k|0,D=F,F=S,S=w,w=k+U|0}b[0]=b[0]+w|0,b[1]=b[1]+S|0,b[2]=b[2]+F|0,b[3]=b[3]+D|0,b[4]=b[4]+I|0,b[5]=b[5]+j|0,b[6]=b[6]+q|0,b[7]=b[7]+_|0},_doFinalize:function(){var E=this._data,v=E.words,b=8*this._nDataBytes,w=8*E.sigBytes;return v[w>>>5]|=128<<24-w%32,v[(w+64>>>9<<4)+14]=e.floor(b/4294967296),v[(w+64>>>9<<4)+15]=b,E.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var E=n.clone.call(this);return E._hash=this._hash.clone(),E}});t.SHA256=n._createHelper(f),t.HmacSHA256=n._createHmacHelper(f)})(Math);(function(){var e=Se,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=Se,r=t.lib.Hasher,a=t.x64,n=a.Word,s=a.WordArray,a=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)],c=[],l=0;80>l;l++)c[l]=e();a=a.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(h,m){for(var S=this._hash.words,A=S[0],p=S[1],f=S[2],E=S[3],v=S[4],b=S[5],w=S[6],S=S[7],F=A.high,D=A.low,I=p.high,j=p.low,q=f.high,_=f.low,P=E.high,k=E.low,U=v.high,M=v.low,W=b.high,K=b.low,V=w.high,z=w.low,ne=S.high,Ee=S.low,we=F,_e=D,He=I,ue=j,Ce=q,Oe=_,sr=P,_t=k,lt=U,Mt=M,Pt=W,Qe=K,bt=V,Je=z,ht=ne,qt=Ee,ze=0;80>ze;ze++){var Cr=c[ze];if(16>ze)var Ot=Cr.high=h[m+2*ze]|0,We=Cr.low=h[m+2*ze+1]|0;else{var Ot=c[ze-15],We=Ot.high,zt=Ot.low,Ot=(We>>>1|zt<<31)^(We>>>8|zt<<24)^We>>>7,zt=(zt>>>1|We<<31)^(zt>>>8|We<<24)^(zt>>>7|We<<25),br=c[ze-2],We=br.high,pt=br.low,br=(We>>>19|pt<<13)^(We<<3|pt>>>29)^We>>>6,pt=(pt>>>19|We<<13)^(pt<<3|We>>>29)^(pt>>>6|We<<26),We=c[ze-7],Rn=We.high,ar=c[ze-16],Wt=ar.high,ar=ar.low,We=zt+We.low,Ot=Ot+Rn+(We>>>0<zt>>>0?1:0),We=We+pt,Ot=Ot+br+(We>>>0<pt>>>0?1:0),We=We+ar,Ot=Ot+Wt+(We>>>0<ar>>>0?1:0);Cr.high=Ot,Cr.low=We}var Rn=lt&Pt^~lt&bt,ar=Mt&Qe^~Mt&Je,Cr=we&He^we&Ce^He&Ce,gr=_e&ue^_e&Oe^ue&Oe,zt=(we>>>28|_e<<4)^(we<<30|_e>>>2)^(we<<25|_e>>>7),br=(_e>>>28|we<<4)^(_e<<30|we>>>2)^(_e<<25|we>>>7),pt=i[ze],Xs=pt.high,Or=pt.low,pt=qt+((Mt>>>14|lt<<18)^(Mt>>>18|lt<<14)^(Mt<<23|lt>>>9)),Wt=ht+((lt>>>14|Mt<<18)^(lt>>>18|Mt<<14)^(lt<<23|Mt>>>9))+(pt>>>0<qt>>>0?1:0),pt=pt+ar,Wt=Wt+Rn+(pt>>>0<ar>>>0?1:0),pt=pt+Or,Wt=Wt+Xs+(pt>>>0<Or>>>0?1:0),pt=pt+We,Wt=Wt+Ot+(pt>>>0<We>>>0?1:0),We=br+gr,Cr=zt+Cr+(We>>>0<br>>>0?1:0),ht=bt,qt=Je,bt=Pt,Je=Qe,Pt=lt,Qe=Mt,Mt=_t+pt|0,lt=sr+Wt+(Mt>>>0<_t>>>0?1:0)|0,sr=Ce,_t=Oe,Ce=He,Oe=ue,He=we,ue=_e,_e=pt+We|0,we=Wt+Cr+(_e>>>0<pt>>>0?1:0)|0}D=A.low=D+_e,A.high=F+we+(D>>>0<_e>>>0?1:0),j=p.low=j+ue,p.high=I+He+(j>>>0<ue>>>0?1:0),_=f.low=_+Oe,f.high=q+Ce+(_>>>0<Oe>>>0?1:0),k=E.low=k+_t,E.high=P+sr+(k>>>0<_t>>>0?1:0),M=v.low=M+Mt,v.high=U+lt+(M>>>0<Mt>>>0?1:0),K=b.low=K+Qe,b.high=W+Pt+(K>>>0<Qe>>>0?1:0),z=w.low=z+Je,w.high=V+bt+(z>>>0<Je>>>0?1:0),Ee=S.low=Ee+qt,S.high=ne+ht+(Ee>>>0<qt>>>0?1:0)},_doFinalize:function(){var h=this._data,m=h.words,A=8*this._nDataBytes,p=8*h.sigBytes;return m[p>>>5]|=128<<24-p%32,m[(p+128>>>10<<5)+30]=Math.floor(A/4294967296),m[(p+128>>>10<<5)+31]=A,h.sigBytes=4*m.length,this._process(),this._hash.toX32()},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:32}),t.SHA512=r._createHelper(a),t.HmacSHA512=r._createHmacHelper(a)})();(function(){var e=Se,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 a=n._doFinalize.call(this);return a.sigBytes-=16,a}});e.SHA384=n._createHelper(s),e.HmacSHA384=n._createHmacHelper(s)})();(function(){var e=Se,h=e.lib,t=h.WordArray,r=h.Hasher,h=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]),a=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]),c=t.create([0,1518500249,1859775393,2400959708,2840853838]),l=t.create([1352829926,1548603684,1836072691,2053994217,0]),h=h.RIPEMD160=r.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(m,A){for(var p=0;16>p;p++){var f=A+p,E=m[f];m[f]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var f=this._hash.words,E=c.words,v=l.words,b=n.words,w=s.words,S=a.words,F=i.words,D,I,j,q,_,P,k,U,M,W;P=D=f[0],k=I=f[1],U=j=f[2],M=q=f[3],W=_=f[4];for(var K,p=0;80>p;p+=1)K=D+m[A+b[p]]|0,K=16>p?K+((I^j^q)+E[0]):32>p?K+((I&j|~I&q)+E[1]):48>p?K+(((I|~j)^q)+E[2]):64>p?K+((I&q|j&~q)+E[3]):K+((I^(j|~q))+E[4]),K|=0,K=K<<S[p]|K>>>32-S[p],K=K+_|0,D=_,_=q,q=j<<10|j>>>22,j=I,I=K,K=P+m[A+w[p]]|0,K=16>p?K+((k^(U|~M))+v[0]):32>p?K+((k&M|U&~M)+v[1]):48>p?K+(((k|~U)^M)+v[2]):64>p?K+((k&U|~k&M)+v[3]):K+((k^U^M)+v[4]),K|=0,K=K<<F[p]|K>>>32-F[p],K=K+W|0,P=W,W=M,M=U<<10|U>>>22,U=k,k=K;K=f[1]+j+M|0,f[1]=f[2]+q+W|0,f[2]=f[3]+_+P|0,f[3]=f[4]+D+k|0,f[4]=f[0]+I+U|0,f[0]=K},_doFinalize:function(){var m=this._data,A=m.words,p=8*this._nDataBytes,f=8*m.sigBytes;for(A[f>>>5]|=128<<24-f%32,A[(f+64>>>9<<4)+14]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,m.sigBytes=4*(A.length+1),this._process(),m=this._hash,A=m.words,p=0;5>p;p++)f=A[p],A[p]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360;return m},clone:function(){var m=r.clone.call(this);return m._hash=this._hash.clone(),m}});e.RIPEMD160=r._createHelper(h),e.HmacRIPEMD160=r._createHmacHelper(h)})(Math);(function(){var e=Se,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,a=4*s;n.sigBytes>a&&(n=r.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),c=this._iKey=n.clone(),l=i.words,h=c.words,m=0;m<s;m++)l[m]^=1549556828,h[m]^=909522486;i.sigBytes=c.sigBytes=a,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=Se,n=e.lib,t=n.Base,r=n.WordArray,n=e.algo,s=n.HMAC,a=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,c){for(var E=this.cfg,l=s.create(E.hasher,i),h=r.create(),m=r.create([1]),A=h.words,p=m.words,f=E.keySize,E=E.iterations;A.length<f;){var v=l.update(c).finalize(m);l.reset();for(var b=v.words,w=b.length,S=v,F=1;F<E;F++){S=l.finalize(S),l.reset();for(var D=S.words,I=0;I<w;I++)b[I]^=D[I]}h.concat(v),p[0]++}return h.sigBytes=4*f,h}});e.PBKDF2=function(i,c,l){return a.create(l).compute(i,c)}})();var Xu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n0="=";function as(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=Xu.charAt(r>>6)+Xu.charAt(r&63);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=Xu.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=Xu.charAt(r>>2)+Xu.charAt((r&3)<<4)),n0)for(;(n.length&3)>0;)n+=n0;return n}function Zu(e){var t="",r,n=0,s,a;for(r=0;r<e.length&&e.charAt(r)!=n0;++r)a=Xu.indexOf(e.charAt(r)),!(a<0)&&(n==0?(t+=ss(a>>2),s=a&3,n=1):n==1?(t+=ss(s<<2|a>>4),s=a&15,n=2):n==2?(t+=ss(s),t+=ss(a>>2),s=a&3,n=3):(t+=ss(s<<2|a>>4),t+=ss(a&15),n=0));return n==1&&(t+=ss(s<<2)),t}function i2(e){var t=Zu(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 qs,kF=0xdeadbeefcafe,t2=(kF&16777215)==15715070;function Q(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 ut(){return new Q(null)}function NF(e,t,r,n,s,a){for(;--a>=0;){var i=t*this[e++]+r[n]+s;s=Math.floor(i/67108864),r[n++]=i&67108863}return s}function LF(e,t,r,n,s,a){for(var i=t&32767,c=t>>15;--a>=0;){var l=this[e]&32767,h=this[e++]>>15,m=c*l+h*i;l=i*l+((m&32767)<<15)+r[n]+(s&1073741823),s=(l>>>30)+(m>>>15)+c*h+(s>>>30),r[n++]=l&1073741823}return s}function UF(e,t,r,n,s,a){for(var i=t&16383,c=t>>14;--a>=0;){var l=this[e]&16383,h=this[e++]>>14,m=c*l+h*i;l=i*l+((m&16383)<<14)+r[n]+s,s=(l>>28)+(m>>14)+c*h,r[n++]=l&268435455}return s}t2&&vc.appName=="Microsoft Internet Explorer"?(Q.prototype.am=LF,qs=30):t2&&vc.appName!="Netscape"?(Q.prototype.am=NF,qs=26):(Q.prototype.am=UF,qs=28);Q.prototype.DB=qs;Q.prototype.DM=(1<<qs)-1;Q.prototype.DV=1<<qs;var o0=52;Q.prototype.FV=Math.pow(2,o0);Q.prototype.F1=o0-qs;Q.prototype.F2=2*qs-o0;var HF="0123456789abcdefghijklmnopqrstuvwxyz",Af=new Array,Qu,Vn;Qu=48;for(Vn=0;Vn<=9;++Vn)Af[Qu++]=Vn;Qu=97;for(Vn=10;Vn<36;++Vn)Af[Qu++]=Vn;Qu=65;for(Vn=10;Vn<36;++Vn)Af[Qu++]=Vn;function ss(e){return HF.charAt(e)}function s2(e,t){var r=Af[e.charCodeAt(t)];return r??-1}function jF(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function MF(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 Ms(e){var t=ut();return t.fromInt(e),t}function qF(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,a=0;--n>=0;){var i=r==8?e[n]&255:s2(e,n);if(i<0){e.charAt(n)=="-"&&(s=!0);continue}s=!1,a==0?this[this.t++]=i:a+r>this.DB?(this[this.t-1]|=(i&(1<<this.DB-a)-1)<<a,this[this.t++]=i>>this.DB-a):this[this.t-1]|=i<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&e[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),s&&Q.ZERO.subTo(this,this)}function KF(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function VF(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,a="",i=this.t,c=this.DB-i*this.DB%t;if(i-- >0)for(c<this.DB&&(n=this[i]>>c)>0&&(s=!0,a=ss(n));i>=0;)c<t?(n=(this[i]&(1<<c)-1)<<t-c,n|=this[--i]>>(c+=this.DB-t)):(n=this[i]>>(c-=t)&r,c<=0&&(c+=this.DB,--i)),n>0&&(s=!0),s&&(a+=ss(n));return s?a:"0"}function GF(){var e=ut();return Q.ZERO.subTo(this,e),e}function zF(){return this.s<0?this.negate():this}function WF(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 Ef(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 YF(){return this.t<=0?0:this.DB*(this.t-1)+Ef(this[this.t-1]^this.s&this.DM)}function XF(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 JF(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 ZF(e,t){var r=e%this.DB,n=this.DB-r,s=(1<<n)-1,a=Math.floor(e/this.DB),i=this.s<<r&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+a+1]=this[c]>>n|i,i=(this[c]&s)<<r;for(c=a-1;c>=0;--c)t[c]=0;t[a]=i,t.t=this.t+a+1,t.s=this.s,t.clamp()}function QF(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,a=(1<<n)-1;t[0]=this[r]>>n;for(var i=r+1;i<this.t;++i)t[i-r-1]|=(this[i]&a)<<s,t[i-r]=this[i]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<s),t.t=this.t-r,t.clamp()}function e8(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 t8(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&&Q.ZERO.subTo(t,t)}function r8(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 n8(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=ut());var a=ut(),i=this.s,c=e.s,l=this.DB-Ef(n[n.t-1]);l>0?(n.lShiftTo(l,a),s.lShiftTo(l,r)):(n.copyTo(a),s.copyTo(r));var h=a.t,m=a[h-1];if(m!=0){var A=m*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),p=this.FV/A,f=(1<<this.F1)/A,E=1<<this.F2,v=r.t,b=v-h,w=t??ut();for(a.dlShiftTo(b,w),r.compareTo(w)>=0&&(r[r.t++]=1,r.subTo(w,r)),Q.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--b>=0;){var S=r[--v]==m?this.DM:Math.floor(r[v]*p+(r[v-1]+E)*f);if((r[v]+=a.am(0,S,r,b,0,h))<S)for(a.dlShiftTo(b,w),r.subTo(w,r);r[v]<--S;)r.subTo(w,r)}t!=null&&(r.drShiftTo(h,t),i!=c&&Q.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),i<0&&Q.ZERO.subTo(r,r)}}}function i8(e){var t=ut();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Q.ZERO)>0&&e.subTo(t,t),t}function La(e){this.m=e}function s8(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function a8(e){return e}function u8(e){e.divRemTo(this.m,null,e)}function o8(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function c8(e,t){e.squareTo(t),this.reduce(t)}La.prototype.convert=s8;La.prototype.revert=a8;La.prototype.reduce=u8;La.prototype.mulTo=o8;La.prototype.sqrTo=c8;function l8(){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 Ua(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 f8(e){var t=ut();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Q.ZERO)>0&&this.m.subTo(t,t),t}function h8(e){var t=ut();return e.copyTo(t),this.reduce(t),t}function p8(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 d8(e,t){e.squareTo(t),this.reduce(t)}function g8(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Ua.prototype.convert=f8;Ua.prototype.revert=h8;Ua.prototype.reduce=p8;Ua.prototype.mulTo=g8;Ua.prototype.sqrTo=d8;function m8(){return(this.t>0?this[0]&1:this.s)==0}function v8(e,t){if(e>4294967295||e<1)return Q.ONE;var r=ut(),n=ut(),s=t.convert(this),a=Ef(e)-1;for(s.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,s,r);else{var i=r;r=n,n=i}return t.revert(r)}function w8(e,t){var r;return e<256||t.isEven()?r=new La(t):r=new Ua(t),this.exp(e,r)}Q.prototype.copyTo=jF;Q.prototype.fromInt=MF;Q.prototype.fromString=qF;Q.prototype.clamp=KF;Q.prototype.dlShiftTo=XF;Q.prototype.drShiftTo=JF;Q.prototype.lShiftTo=ZF;Q.prototype.rShiftTo=QF;Q.prototype.subTo=e8;Q.prototype.multiplyTo=t8;Q.prototype.squareTo=r8;Q.prototype.divRemTo=n8;Q.prototype.invDigit=l8;Q.prototype.isEven=m8;Q.prototype.exp=v8;Q.prototype.toString=VF;Q.prototype.negate=GF;Q.prototype.abs=zF;Q.prototype.compareTo=WF;Q.prototype.bitLength=YF;Q.prototype.mod=i8;Q.prototype.modPowInt=w8;Q.ZERO=Ms(0);Q.ONE=Ms(1);function A8(){var e=ut();return this.copyTo(e),e}function E8(){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 y8(){return this.t==0?this.s:this[0]<<24>>24}function S8(){return this.t==0?this.s:this[0]<<16>>16}function b8(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function C8(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function F8(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=Ms(r),s=ut(),a=ut(),i="";for(this.divRemTo(n,s,a);s.signum()>0;)i=(r+a.intValue()).toString(e).substr(1)+i,s.divRemTo(n,s,a);return a.intValue().toString(e)+i}function _8(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),s=!1,a=0,i=0,c=0;c<e.length;++c){var l=s2(e,c);if(l<0){e.charAt(c)=="-"&&this.signum()==0&&(s=!0);continue}i=t*i+l,++a>=r&&(this.dMultiply(n),this.dAddOffset(i,0),a=0,i=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(i,0)),s&&Q.ZERO.subTo(this,this)}function I8(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(Q.ONE.shiftLeft(e-1),c0,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Q.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 B8(){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 D8(e){return this.compareTo(e)==0}function P8(e){return this.compareTo(e)<0?this:e}function $8(e){return this.compareTo(e)>0?this:e}function R8(e,t,r){var n,s,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(s=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],s);r.t=this.t}else{for(s=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(s,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function T8(e,t){return e&t}function x8(e){var t=ut();return this.bitwiseTo(e,T8,t),t}function c0(e,t){return e|t}function O8(e){var t=ut();return this.bitwiseTo(e,c0,t),t}function a2(e,t){return e^t}function k8(e){var t=ut();return this.bitwiseTo(e,a2,t),t}function u2(e,t){return e&~t}function N8(e){var t=ut();return this.bitwiseTo(e,u2,t),t}function L8(){for(var e=ut(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function U8(e){var t=ut();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function H8(e){var t=ut();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function j8(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 M8(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+j8(this[e]);return this.s<0?this.t*this.DB:-1}function q8(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function K8(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=q8(this[r]^t);return e}function V8(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function G8(e,t){var r=Q.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function z8(e){return this.changeBit(e,c0)}function W8(e){return this.changeBit(e,u2)}function Y8(e){return this.changeBit(e,a2)}function X8(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 J8(e){var t=ut();return this.addTo(e,t),t}function Z8(e){var t=ut();return this.subTo(e,t),t}function Q8(e){var t=ut();return this.multiplyTo(e,t),t}function e_(){var e=ut();return this.squareTo(e),e}function t_(e){var t=ut();return this.divRemTo(e,t,null),t}function r_(e){var t=ut();return this.divRemTo(e,null,t),t}function n_(e){var t=ut(),r=ut();return this.divRemTo(e,t,r),new Array(t,r)}function i_(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function s_(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 Ac(){}function o2(e){return e}function a_(e,t,r){e.multiplyTo(t,r)}function u_(e,t){e.squareTo(t)}Ac.prototype.convert=o2;Ac.prototype.revert=o2;Ac.prototype.mulTo=a_;Ac.prototype.sqrTo=u_;function o_(e){return this.exp(e,new Ac)}function c_(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 l_(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 eo(e){this.r2=ut(),this.q3=ut(),Q.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function f_(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=ut();return e.copyTo(t),this.reduce(t),t}function h_(e){return e}function p_(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 d_(e,t){e.squareTo(t),this.reduce(t)}function g_(e,t,r){e.multiplyTo(t,r),this.reduce(r)}eo.prototype.convert=f_;eo.prototype.revert=h_;eo.prototype.reduce=p_;eo.prototype.mulTo=g_;eo.prototype.sqrTo=d_;function m_(e,t){var r=e.bitLength(),n,s=Ms(1),a;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?a=new La(t):t.isEven()?a=new eo(t):a=new Ua(t);var i=new Array,c=3,l=n-1,h=(1<<n)-1;if(i[1]=a.convert(this),n>1){var m=ut();for(a.sqrTo(i[1],m);c<=h;)i[c]=ut(),a.mulTo(m,i[c-2],i[c]),c+=2}var A=e.t-1,p,f=!0,E=ut(),v;for(r=Ef(e[A])-1;A>=0;){for(r>=l?p=e[A]>>r-l&h:(p=(e[A]&(1<<r+1)-1)<<l-r,A>0&&(p|=e[A-1]>>this.DB+r-l)),c=n;!(p&1);)p>>=1,--c;if((r-=c)<0&&(r+=this.DB,--A),f)i[p].copyTo(s),f=!1;else{for(;c>1;)a.sqrTo(s,E),a.sqrTo(E,s),c-=2;c>0?a.sqrTo(s,E):(v=s,s=E,E=v),a.mulTo(E,i[p],s)}for(;A>=0&&!(e[A]&1<<r);)a.sqrTo(s,E),v=s,s=E,E=v,--r<0&&(r=this.DB-1,--A)}return a.revert(s)}function v_(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(),a=r.getLowestSetBit();if(a<0)return t;for(s<a&&(a=s),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r}function w_(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 A_(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return Q.ZERO;for(var r=e.clone(),n=this.clone(),s=Ms(1),a=Ms(0),i=Ms(0),c=Ms(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!a.isEven())&&(s.addTo(this,s),a.subTo(e,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!c.isEven())&&(i.addTo(this,i),c.subTo(e,c)),i.rShiftTo(1,i)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&s.subTo(i,s),a.subTo(c,a)):(n.subTo(r,n),t&&i.subTo(s,i),c.subTo(a,c))}if(n.compareTo(Q.ONE)!=0)return Q.ZERO;if(c.compareTo(e)>=0)return c.subtract(e);if(c.signum()<0)c.addTo(e,c);else return c;return c.signum()<0?c.add(e):c}var Gr=[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],E_=(1<<26)/Gr[Gr.length-1];function y_(e){var t,r=this.abs();if(r.t==1&&r[0]<=Gr[Gr.length-1]){for(t=0;t<Gr.length;++t)if(r[0]==Gr[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Gr.length;){for(var n=Gr[t],s=t+1;s<Gr.length&&n<E_;)n*=Gr[s++];for(n=r.modInt(n);t<s;)if(n%Gr[t++]==0)return!1}return r.millerRabin(e)}function S_(e){var t=this.subtract(Q.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Gr.length&&(e=Gr.length);for(var s=ut(),a=0;a<e;++a){s.fromInt(Gr[Math.floor(Math.random()*Gr.length)]);var i=s.modPow(n,this);if(i.compareTo(Q.ONE)!=0&&i.compareTo(t)!=0){for(var c=1;c++<r&&i.compareTo(t)!=0;)if(i=i.modPowInt(2,this),i.compareTo(Q.ONE)==0)return!1;if(i.compareTo(t)!=0)return!1}}return!0}Q.prototype.chunkSize=b8;Q.prototype.toRadix=F8;Q.prototype.fromRadix=_8;Q.prototype.fromNumber=I8;Q.prototype.bitwiseTo=R8;Q.prototype.changeBit=G8;Q.prototype.addTo=X8;Q.prototype.dMultiply=i_;Q.prototype.dAddOffset=s_;Q.prototype.multiplyLowerTo=c_;Q.prototype.multiplyUpperTo=l_;Q.prototype.modInt=w_;Q.prototype.millerRabin=S_;Q.prototype.clone=A8;Q.prototype.intValue=E8;Q.prototype.byteValue=y8;Q.prototype.shortValue=S8;Q.prototype.signum=C8;Q.prototype.toByteArray=B8;Q.prototype.equals=D8;Q.prototype.min=P8;Q.prototype.max=$8;Q.prototype.and=x8;Q.prototype.or=O8;Q.prototype.xor=k8;Q.prototype.andNot=N8;Q.prototype.not=L8;Q.prototype.shiftLeft=U8;Q.prototype.shiftRight=H8;Q.prototype.getLowestSetBit=M8;Q.prototype.bitCount=K8;Q.prototype.testBit=V8;Q.prototype.setBit=z8;Q.prototype.clearBit=W8;Q.prototype.flipBit=Y8;Q.prototype.add=J8;Q.prototype.subtract=Z8;Q.prototype.multiply=Q8;Q.prototype.divide=t_;Q.prototype.remainder=r_;Q.prototype.divideAndRemainder=n_;Q.prototype.modPow=m_;Q.prototype.modInverse=A_;Q.prototype.pow=o_;Q.prototype.gcd=v_;Q.prototype.isProbablePrime=y_;Q.prototype.square=e_;function l0(){this.i=0,this.j=0,this.S=new Array}function b_(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 C_(){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]}l0.prototype.init=b_;l0.prototype.next=C_;function F_(){return new l0}var i0=256;var gf,bn,pr;function __(e){bn[pr++]^=e&255,bn[pr++]^=e>>8&255,bn[pr++]^=e>>16&255,bn[pr++]^=e>>24&255,pr>=i0&&(pr-=i0)}function f0(){__(new Date().getTime())}if(bn==null){if(bn=new Array,pr=0,Yu!==void 0&&(Yu.crypto!==void 0||Yu.msCrypto!==void 0)){if(e0=Yu.crypto||Yu.msCrypto,e0.getRandomValues)for(t0=new Uint8Array(32),e0.getRandomValues(t0),Kn=0;Kn<32;++Kn)bn[pr++]=t0[Kn];else if(vc.appName=="Netscape"&&vc.appVersion<"5")for(r0=Yu.crypto.random(32),Kn=0;Kn<r0.length;++Kn)bn[pr++]=r0.charCodeAt(Kn)&255}for(;pr<i0;)Kn=Math.floor(65536*Math.random()),bn[pr++]=Kn>>>8,bn[pr++]=Kn&255;pr=0,f0()}var Kn,e0,t0,r0;function I_(){if(gf==null){for(f0(),gf=F_(),gf.init(bn),pr=0;pr<bn.length;++pr)bn[pr]=0;pr=0}return gf.next()}function B_(e){var t;for(t=0;t<e.length;++t)e[t]=I_()}function to(){}to.prototype.nextBytes=B_;function un(e,t){return new Q(e,t)}function Ke(){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 D_(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=un(e,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function P_(e){return e.modPowInt(this.e,this.n)}Ke.prototype.doPublic=P_;Ke.prototype.setPublic=D_;Ke.prototype.type="RSA";function $_(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=un(e,16),this.e=parseInt(t,16),this.d=un(r,16);else throw"Invalid RSA private key"}function R_(e,t,r,n,s,a,i,c){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=un(e,16),this.e=parseInt(t,16),this.d=un(r,16),this.p=un(n,16),this.q=un(s,16),this.dmp1=un(a,16),this.dmq1=un(i,16),this.coeff=un(c,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function T_(e,t){var r=new to,n=e>>1;this.e=parseInt(t,16);for(var s=new Q(t,16),a=e/2-100,i=Q.ONE.shiftLeft(a);;){for(;this.p=new Q(e-n,1,r),!(this.p.subtract(Q.ONE).gcd(s).compareTo(Q.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new Q(n,1,r),!(this.q.subtract(Q.ONE).gcd(s).compareTo(Q.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var c=this.p;this.p=this.q,this.q=c}var l=this.q.subtract(this.p).abs();if(!(l.bitLength()<a||l.compareTo(i)<=0)){var h=this.p.subtract(Q.ONE),m=this.q.subtract(Q.ONE),A=h.multiply(m);if(A.gcd(s).compareTo(Q.ONE)==0&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=s.modInverse(A),this.dmp1=this.d.mod(h),this.dmq1=this.d.mod(m),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0}function x_(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)}Ke.prototype.doPrivate=x_;Ke.prototype.setPrivate=$_;Ke.prototype.setPrivateEx=R_;Ke.prototype.generate=T_;function ir(e,t){this.x=t,this.q=e}function O_(e){return e==this?!0:this.q.equals(e.q)&&this.x.equals(e.x)}function k_(){return this.x}function N_(){return new ir(this.q,this.x.negate().mod(this.q))}function L_(e){return new ir(this.q,this.x.add(e.toBigInteger()).mod(this.q))}function U_(e){return new ir(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}function H_(e){return new ir(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}function j_(){return new ir(this.q,this.x.square().mod(this.q))}function M_(e){return new ir(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}ir.prototype.equals=O_;ir.prototype.toBigInteger=k_;ir.prototype.negate=N_;ir.prototype.add=L_;ir.prototype.subtract=U_;ir.prototype.multiply=H_;ir.prototype.square=j_;ir.prototype.divide=M_;ir.prototype.sqrt=function(){return new ir(this.q,this.x.sqrt().mod(this.q))};function ft(e,t,r,n){this.curve=e,this.x=t,this.y=r,n==null?this.z=Q.ONE:this.z=n,this.zinv=null}function q_(){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 K_(){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 V_(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(Q.ZERO)?(r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q),r.equals(Q.ZERO)):!1}function G_(){return this.x==null&&this.y==null?!0:this.z.equals(Q.ZERO)&&!this.y.toBigInteger().equals(Q.ZERO)}function z_(){return new ft(this.curve,this.x,this.y.negate(),this.z)}function W_(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(Q.ZERO.equals(r))return Q.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new Q("3"),s=this.x.toBigInteger(),a=this.y.toBigInteger(),i=e.x.toBigInteger(),c=e.y.toBigInteger(),l=r.square(),h=l.multiply(r),m=s.multiply(l),A=t.square().multiply(this.z),p=A.subtract(m.shiftLeft(1)).multiply(e.z).subtract(h).multiply(r).mod(this.curve.q),f=m.multiply(n).multiply(t).subtract(a.multiply(h)).subtract(A.multiply(t)).multiply(e.z).add(t.multiply(h)).mod(this.curve.q),E=h.multiply(this.z).multiply(e.z).mod(this.curve.q);return new ft(this.curve,this.curve.fromBigInteger(p),this.curve.fromBigInteger(f),E)}function Y_(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=new Q("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),s=n.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),i=t.square().multiply(e);Q.ZERO.equals(a)||(i=i.add(this.z.square().multiply(a))),i=i.mod(this.curve.q);var c=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),h=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new ft(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(l),h)}function X_(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new Q("3")),n=this.negate(),s=this,a=this.curve.q.subtract(e),i=a.multiply(new Q("3")),c=new ft(this.curve,this.x,this.y),l=c.negate(),h;for(h=r.bitLength()-2;h>0;--h){s=s.twice();var m=r.testBit(h),A=t.testBit(h);m!=A&&(s=s.add(m?this:n))}for(h=i.bitLength()-2;h>0;--h){c=c.twice();var p=i.testBit(h),f=a.testBit(h);p!=f&&(c=c.add(p?c:l))}return s}function J_(e,t,r){var n;e.bitLength()>r.bitLength()?n=e.bitLength()-1:n=r.bitLength()-1;for(var s=this.curve.getInfinity(),a=this.add(t);n>=0;)s=s.twice(),e.testBit(n)?r.testBit(n)?s=s.add(a):s=s.add(this):r.testBit(n)&&(s=s.add(t)),--n;return s}ft.prototype.getX=q_;ft.prototype.getY=K_;ft.prototype.equals=V_;ft.prototype.isInfinity=G_;ft.prototype.negate=z_;ft.prototype.add=W_;ft.prototype.twice=Y_;ft.prototype.multiply=X_;ft.prototype.multiplyTwo=J_;function us(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new ft(this,null,null)}function Z_(){return this.q}function Q_(){return this.a}function eI(){return this.b}function tI(e){return e==this?!0:this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}function rI(){return this.infinity}function nI(e){return new ir(this.q,e)}function iI(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 Q(h,16)),s=this.getA(),a=this.getB(),i=n.square().add(s).multiply(n).add(a),c=i.sqrt();return t=="03"&&(c=c.negate()),new ft(this,n,c);case 4:case 6:case 7:var l=(e.length-2)/2,h=e.substr(2,l),m=e.substr(l+2,l);return new ft(this,this.fromBigInteger(new Q(h,16)),this.fromBigInteger(new Q(m,16)));default:return null}}us.prototype.getQ=Z_;us.prototype.getA=Q_;us.prototype.getB=eI;us.prototype.equals=tI;us.prototype.getInfinity=rI;us.prototype.fromBigInteger=nI;us.prototype.decodePointHex=iI;ir.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)};ft.prototype.getEncoded=function(e){var t=function(a,i){var c=a.toByteArrayUnsigned();if(i<c.length)c=c.slice(c.length-i);else for(;i>c.length;)c.unshift(0);return c},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};ft.decodeFrom=function(e,t){var r=t[0],n=t.length-1,s=t.slice(1,1+n/2),a=t.slice(1+n/2,1+n);s.unshift(0),a.unshift(0);var i=new Q(s),c=new Q(a);return new ft(e,e.fromBigInteger(i),e.fromBigInteger(c))};ft.decodeFromHex=function(e,t){var r=t.substr(0,2),n=t.length-2,s=t.substr(2,n/2),a=t.substr(2+n/2,n/2),i=new Q(s,16),c=new Q(a,16);return new ft(e,e.fromBigInteger(i),e.fromBigInteger(c))};ft.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),a=n.multiply(this.x.subtract(s)).subtract(this.y);return new ft(this.curve,s,a)};ft.prototype.twice2D=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=this.curve.fromBigInteger(Q.valueOf(2)),t=this.curve.fromBigInteger(Q.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 ft(this.curve,n,s)};ft.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t=e,r=t.multiply(new Q("3")),n=this.negate(),s=this,a;for(a=r.bitLength()-2;a>0;--a){s=s.twice();var i=r.testBit(a),c=t.testBit(a);i!=c&&(s=s.add2D(i?this:n))}return s};ft.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(),a=t.multiply(t).mod(s),i=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(s);return a.equals(i)};ft.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};ft.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(Q.ONE)<0||t.compareTo(e.subtract(Q.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(Q.ONE)<0||r.compareTo(e.subtract(Q.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 c2=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"),a={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:`
|
||
`,r:"\r",t:" "};function i(A,p,f){return p?a[p]:String.fromCharCode(parseInt(f,16))}var c=new String(""),l="\\",h={"{":Object,"[":Array},m=Object.hasOwnProperty;return function(A,p){var f=A.match(n),E,v=f[0],b=!1;v==="{"?E={}:v==="["?E=[]:(E=[],b=!0);for(var w,S=[E],F=1-b,D=f.length;F<D;++F){v=f[F];var I;switch(v.charCodeAt(0)){default:I=S[0],I[w||I.length]=+v,w=void 0;break;case 34:if(v=v.substring(1,v.length-1),v.indexOf(l)!==-1&&(v=v.replace(s,i)),I=S[0],!w)if(I instanceof Array)w=I.length;else{w=v||c;break}I[w]=v,w=void 0;break;case 91:I=S[0],S.unshift(I[w||I.length]=[]),w=void 0;break;case 93:S.shift();break;case 102:I=S[0],I[w||I.length]=!1,w=void 0;break;case 110:I=S[0],I[w||I.length]=null,w=void 0;break;case 116:I=S[0],I[w||I.length]=!0,w=void 0;break;case 123:I=S[0],S.unshift(I[w||I.length]={}),w=void 0;break;case 125:S.shift();break}}if(b){if(S.length!==1)throw new Error;E=E[0]}else if(S.length)throw new Error;if(p){var j=function(q,_){var P=q[_];if(P&&typeof P=="object"){var k=null;for(var U in P)if(m.call(P,U)&&P!==q){var M=j(P,U);M!==void 0?P[U]=M:(k||(k=[]),k.push(U))}if(k)for(var W=k.length;--W>=0;)delete P[k[W]]}return p.call(q,_,P)};E=j({"":E},"")}return E}}();(typeof d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});d.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 yc(e)},this.getPEMStringFromHex=function(e,t){return xr(e,t)},this.newObject=function(e){var t=d,r=t.asn1,n=r.ASN1Object,s=r.DERBoolean,a=r.DERInteger,i=r.DERBitString,c=r.DEROctetString,l=r.DERNull,h=r.DERObjectIdentifier,m=r.DEREnumerated,A=r.DERUTF8String,p=r.DERNumericString,f=r.DERPrintableString,E=r.DERTeletexString,v=r.DERIA5String,b=r.DERUTCTime,w=r.DERGeneralizedTime,S=r.DERVisibleString,F=r.DERBMPString,D=r.DERSequence,I=r.DERSet,j=r.DERTaggedObject,q=r.ASN1Util.newObject;if(e instanceof r.ASN1Object)return e;var _=Object.keys(e);if(_.length!=1)throw new Error("key of param shall be only one.");var P=_[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 a(e[P]);if(P=="bitstr")return new i(e[P]);if(P=="octstr")return new c(e[P]);if(P=="null")return new l(e[P]);if(P=="oid")return new h(e[P]);if(P=="enum")return new m(e[P]);if(P=="utf8str")return new A(e[P]);if(P=="numstr")return new p(e[P]);if(P=="prnstr")return new f(e[P]);if(P=="telstr")return new E(e[P]);if(P=="ia5str")return new v(e[P]);if(P=="utctime")return new b(e[P]);if(P=="gentime")return new w(e[P]);if(P=="visstr")return new S(e[P]);if(P=="bmpstr")return new F(e[P]);if(P=="asn1")return new n(e[P]);if(P=="seq"){for(var k=e[P],U=[],M=0;M<k.length;M++){var W=q(k[M]);U.push(W)}return new D({array:U})}if(P=="set"){for(var k=e[P],U=[],M=0;M<k.length;M++){var W=q(k[M]);U.push(W)}return new I({array:U})}if(P=="tag"){var K=e[P];if(Object.prototype.toString.call(K)==="[object Array]"&&K.length==3){var V=q(K[2]);return new j({tag:K[0],explicit:K[1],obj:V})}else return new j(K)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.tohex()}};d.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,a="",i=2;i<e.length;i+=2){var c=parseInt(e.substr(i,2),16),l=("00000000"+c.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var h=new Q(a,2);s=s+"."+h.toString(10),a=""}}return s};d.asn1.ASN1Util.oidIntToHex=function(e){var t=function(c){var l=c.toString(16);return l.length==1&&(l="0"+l),l},r=function(c){var l="",h=new Q(c,10),m=h.toString(2),A=7-m.length%7;A==7&&(A=0);for(var p="",f=0;f<A;f++)p+="0";m=p+m;for(var f=0;f<m.length-1;f+=7){var E=m.substr(f,7);f!=m.length-7&&(E="1"+E),l+=t(parseInt(E,2))}return l};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",s=e.split("."),a=parseInt(s[0])*40+parseInt(s[1]);n+=t(a),s.splice(0,2);for(var i=0;i<s.length;i++)n+=r(s[i]);return n};d.asn1.ASN1Object=function(e){var t=!0,r=null,n="00",s="00",a="";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="+a.length+",v="+this.hV);var i=this.hV.length/2,c=i.toString(16);if(c.length%2==1&&(c="0"+c),i<128)return c;var l=c.length/2;if(l>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+i.toString(16));var h=128+l;return h.toString(16)+c},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)};d.asn1.DERAbstractString=function(e){d.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=Sf(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))};fe(d.asn1.DERAbstractString,d.asn1.ASN1Object);d.asn1.DERAbstractTime=function(e){d.asn1.DERAbstractTime.superclass.constructor.call(this);var t=null,r=null;this.localDateToUTC=function(n){var s=n.getTime()+n.getTimezoneOffset()*6e4,a=new Date(s);return a},this.formatDate=function(n,s,a){var i=this.zeroPadding,c=this.localDateToUTC(n),l=String(c.getFullYear());s=="utc"&&(l=l.substr(2,2));var h=i(String(c.getMonth()+1),2),m=i(String(c.getDate()),2),A=i(String(c.getHours()),2),p=i(String(c.getMinutes()),2),f=i(String(c.getSeconds()),2),E=l+h+m+A+p+f;if(a===!0){var v=c.getMilliseconds();if(v!=0){var b=i(String(v),3);b=b.replace(/[0]+$/,""),E=E+"."+b}}return E+"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,a,i,c,l){var h=new Date(Date.UTC(n,s-1,a,i,c,l,0));this.setByDate(h)},this.getFreshValueHex=function(){return this.hV}};fe(d.asn1.DERAbstractTime,d.asn1.ASN1Object);d.asn1.DERAbstractStructured=function(e){d.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)};fe(d.asn1.DERAbstractStructured,d.asn1.ASN1Object);d.asn1.DERBoolean=function(e){d.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",e==!1?this.hTLV="010100":this.hTLV="0101ff"};fe(d.asn1.DERBoolean,d.asn1.ASN1Object);d.asn1.DERInteger=function(e){d.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=yc;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 Q(String(r),10);else if(r.int!=null)n=new Q(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)};fe(d.asn1.DERInteger,d.asn1.ASN1Object);d.asn1.DERBitString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=d.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}d.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="",a=0;a<r.length-1;a+=8){var i=r.substr(a,8),c=parseInt(i,2).toString(16);c.length==1&&(c="0"+c),s+=c}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))};fe(d.asn1.DERBitString,d.asn1.ASN1Object);d.asn1.DEROctetString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=d.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}d.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"};fe(d.asn1.DEROctetString,d.asn1.DERAbstractString);d.asn1.DERNull=function(){d.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};fe(d.asn1.DERNull,d.asn1.ASN1Object);d.asn1.DERObjectIdentifier=function(e){d.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=m2(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=d.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)};fe(d.asn1.DERObjectIdentifier,d.asn1.ASN1Object);d.asn1.DEREnumerated=function(e){d.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=yc(t)},this.setByInteger=function(t){var r=new Q(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))};fe(d.asn1.DEREnumerated,d.asn1.ASN1Object);d.asn1.DERUTF8String=function(e){d.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"};fe(d.asn1.DERUTF8String,d.asn1.DERAbstractString);d.asn1.DERNumericString=function(e){d.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"};fe(d.asn1.DERNumericString,d.asn1.DERAbstractString);d.asn1.DERPrintableString=function(e){d.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"};fe(d.asn1.DERPrintableString,d.asn1.DERAbstractString);d.asn1.DERTeletexString=function(e){d.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"};fe(d.asn1.DERTeletexString,d.asn1.DERAbstractString);d.asn1.DERIA5String=function(e){d.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"};fe(d.asn1.DERIA5String,d.asn1.DERAbstractString);d.asn1.DERVisibleString=function(e){d.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"};fe(d.asn1.DERVisibleString,d.asn1.DERAbstractString);d.asn1.DERBMPString=function(e){d.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"};fe(d.asn1.DERBMPString,d.asn1.DERAbstractString);d.asn1.DERUTCTime=function(e){d.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=on(t);else throw new Error("malformed string for UTCTime: "+t);else if(t.str!=null)this.hV=on(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=on(this.formatDate(r,"utc",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=on(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=on(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)};fe(d.asn1.DERUTCTime,d.asn1.DERAbstractTime);d.asn1.DERGeneralizedTime=function(e){d.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=on(t);else throw new Error("malformed string for GeneralizedTime: "+t);else if(t.str!=null)this.hV=on(t.str);else if(t.date==null&&t.millis==!0){var r=new Date;this.hV=on(this.formatDate(r,"gen",!0))}else if(t.date!=null&&t.date instanceof Date){var n=t.millis===!0;this.hV=on(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=on(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)};fe(d.asn1.DERGeneralizedTime,d.asn1.DERAbstractTime);d.asn1.DERSequence=function(e){d.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}};fe(d.asn1.DERSequence,d.asn1.DERAbstractStructured);d.asn1.DERSet=function(e){d.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)};fe(d.asn1.DERSet,d.asn1.DERAbstractStructured);d.asn1.DERTaggedObject=function(e){d.asn1.DERTaggedObject.superclass.constructor.call(this);var t=d.asn1,r=Ae,n=r.getV,s=r.isASN1HEX,a=t.ASN1Util.newObject;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(i,c,l){this.params={tag:c,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=Sf(i.str);else if(i.hex!=null)this.hV=i.hex;else if(i.obj!=null){var c;i.obj instanceof t.ASN1Object?c=i.obj.tohex():typeof i.obj=="object"&&(c=a(i.obj).tohex()),i.explicit?this.hV=c:this.hV=n(c,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)};fe(d.asn1.DERTaggedObject,d.asn1.ASN1Object);var Ae=new function(){};Ae.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};Ae.getL=function(e,t){var r=Ae.getLblen(e,t);return r<1?"":e.substr(t+2,r*2)};Ae.getVblen=function(e,t){var r,n;return r=Ae.getL(e,t),r==""?-1:(r.substr(0,1)==="8"?n=new Q(r.substr(2),16):n=new Q(r,16),n.intValue())};Ae.getVidx=function(e,t){var r=Ae.getLblen(e,t);return r<0?r:t+(r+1)*2};Ae.getV=function(e,t){var r=Ae.getVidx(e,t),n=Ae.getVblen(e,t);return e.substr(r,n*2)};Ae.getTLV=function(e,t){return e.substr(t,2)+Ae.getL(e,t)+Ae.getV(e,t)};Ae.getTLVblen=function(e,t){return 2+Ae.getLblen(e,t)*2+Ae.getVblen(e,t)*2};Ae.getNextSiblingIdx=function(e,t){var r=Ae.getVidx(e,t),n=Ae.getVblen(e,t);return r+n*2};Ae.getChildIdx=function(e,t){var r=Ae,n=[],s,a,i;s=r.getVidx(e,t),a=r.getVblen(e,t)*2,e.substr(t,2)=="03"&&(s+=2,a-=2),i=0;for(var c=s;i<=a;){var l=r.getTLVblen(e,c);if(i+=l,i<=a&&n.push(c),c+=l,i>=a)break}return n};Ae.getNthChildIdx=function(e,t,r){var n=Ae.getChildIdx(e,t);return n[r]};Ae.getIdxbyList=function(e,t,r,n){var s=Ae,a,i;return r.length==0?n!==void 0&&e.substr(t,2)!==n?-1:t:(a=r.shift(),i=s.getChildIdx(e,t),a>=i.length?-1:s.getIdxbyList(e,i[a],r,n))};Ae.getIdxbyListEx=function(e,t,r,n){var s=Ae,a,i;if(r.length==0)return n!==void 0&&e.substr(t,2)!==n?-1:t;a=r.shift(),i=s.getChildIdx(e,t);for(var c=0,l=0;l<i.length;l++){var h=e.substr(i[l],2);if(typeof a=="number"&&!s.isContextTag(h)&&c==a||typeof a=="string"&&s.isContextTag(h,a))return s.getIdxbyListEx(e,i[l],r,n);s.isContextTag(h)||c++}return-1};Ae.getTLVbyList=function(e,t,r,n){var s=Ae,a=s.getIdxbyList(e,t,r,n);return a==-1||a>=e.length?null:s.getTLV(e,a)};Ae.getTLVbyListEx=function(e,t,r,n){var s=Ae,a=s.getIdxbyListEx(e,t,r,n);return a==-1?null:s.getTLV(e,a)};Ae.getVbyList=function(e,t,r,n,s){var a=Ae,i,c;return i=a.getIdxbyList(e,t,r,n),i==-1||i>=e.length?null:(c=a.getV(e,i),s===!0&&(c=c.substr(2)),c)};Ae.getVbyListEx=function(e,t,r,n,s){var a=Ae,i,c,l;return i=a.getIdxbyListEx(e,t,r,n),i==-1?null:(l=a.getV(e,i),e.substr(i,2)=="03"&&s!==!1&&(l=l.substr(2)),l)};Ae.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=Ae.getV(e,t);return n=="02"?parseInt(s,16):w2(s)}catch{return r}};Ae.getOID=function(e,t,r){r==null&&(r=null);try{if(e.substr(t,2)!="06")return r;var n=Ae.getV(e,t);return If(n)}catch{return r}};Ae.getOIDName=function(e,t,r){r==null&&(r=null);try{var n=Ae.getOID(e,t,r);if(n==r)return r;var s=d.asn1.x509.OID.oid2name(n);return s==""?n:s}catch{return r}};Ae.getString=function(e,t,r){r==null&&(r=null);try{var n=Ae.getV(e,t);return cn(n)}catch{return r}};Ae.hextooidstr=function(e){var t=function(A,p){return A.length>=p?A:new Array(p-A.length+1).join("0")+A},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 a=e.substr(2),i=[],c=0;c<a.length/2;c++)i.push(parseInt(a.substr(c*2,2),16));for(var l=[],h="",c=0;c<i.length;c++)i[c]&128?h=h+t((i[c]&127).toString(2),7):(h=h+t((i[c]&127).toString(2),7),l.push(new String(parseInt(h,2))),h="");var m=r.join(".");return l.length>0&&(m=m+"."+l.join(".")),m};Ae.dump=function(e,t,r,n){var s=Ae,a=s.getV,i=s.dump,c=s.getChildIdx,l=e;e instanceof d.asn1.ASN1Object&&(l=e.tohex());var h=function(q,_){if(q.length<=_*2)return q;var P=q.substr(0,_)+"..(total "+q.length/2+"bytes).."+q.substr(q.length-_,_);return P};t===void 0&&(t={ommit_long_octet:32}),r===void 0&&(r=0),n===void 0&&(n="");var m=t.ommit_long_octet,I=l.substr(r,2);if(I=="01"){var A=a(l,r);return A=="00"?n+`BOOLEAN FALSE
|
||
`:n+`BOOLEAN TRUE
|
||
`}if(I=="02"){var A=a(l,r);return n+"INTEGER "+h(A,m)+`
|
||
`}if(I=="03"){var A=a(l,r);if(s.isASN1HEX(A.substr(2))){var p=n+`BITSTRING, encapsulates
|
||
`;return p=p+i(A.substr(2),t,0,n+" "),p}else return n+"BITSTRING "+h(A,m)+`
|
||
`}if(I=="04"){var A=a(l,r);if(s.isASN1HEX(A)){var p=n+`OCTETSTRING, encapsulates
|
||
`;return p=p+i(A,t,0,n+" "),p}else return n+"OCTETSTRING "+h(A,m)+`
|
||
`}if(I=="05")return n+`NULL
|
||
`;if(I=="06"){var f=a(l,r),E=d.asn1.ASN1Util.oidHexToInt(f),v=d.asn1.x509.OID.oid2name(E),b=E.replace(/\./g," ");return v!=""?n+"ObjectIdentifier "+v+" ("+b+`)
|
||
`:n+"ObjectIdentifier ("+b+`)
|
||
`}if(I=="0a")return n+"ENUMERATED "+parseInt(a(l,r))+`
|
||
`;if(I=="0c")return n+"UTF8String '"+vt(a(l,r))+`'
|
||
`;if(I=="13")return n+"PrintableString '"+vt(a(l,r))+`'
|
||
`;if(I=="14")return n+"TeletexString '"+vt(a(l,r))+`'
|
||
`;if(I=="16")return n+"IA5String '"+vt(a(l,r))+`'
|
||
`;if(I=="17")return n+"UTCTime "+vt(a(l,r))+`
|
||
`;if(I=="18")return n+"GeneralizedTime "+vt(a(l,r))+`
|
||
`;if(I=="1a")return n+"VisualString '"+vt(a(l,r))+`'
|
||
`;if(I=="1e")return n+"BMPString '"+g0(a(l,r))+`'
|
||
`;if(I=="30"){if(l.substr(r,4)=="3000")return n+`SEQUENCE {}
|
||
`;var p=n+`SEQUENCE
|
||
`,w=c(l,r),S=t;if((w.length==2||w.length==3)&&l.substr(w[0],2)=="06"&&l.substr(w[w.length-1],2)=="04"){var v=s.oidname(a(l,w[0])),F=JSON.parse(JSON.stringify(t));F.x509ExtName=v,S=F}for(var D=0;D<w.length;D++)p=p+i(l,S,w[D],n+" ");return p}if(I=="31"){for(var p=n+`SET
|
||
`,w=c(l,r),D=0;D<w.length;D++)p=p+i(l,t,w[D],n+" ");return p}var I=parseInt(I,16);if(I&128){var j=I&31;if(I&32){for(var p=n+"["+j+`]
|
||
`,w=c(l,r),D=0;D<w.length;D++)p=p+i(l,t,w[D],n+" ");return p}else{var A=a(l,r);if(Ae.isASN1HEX(A)){var p=n+"["+j+`]
|
||
`;return p=p+i(A,t,0,n+" "),p}else(A.substr(0,8)=="68747470"||t.x509ExtName==="subjectAltName"&&j==2)&&(A=vt(A));var p=n+"["+j+"] "+A+`
|
||
`;return p}}return n+"UNKNOWN("+I+") "+a(l,r)+`
|
||
`};Ae.parse=function(e){var t=Ae,r=t.parse,n=t.isASN1HEX,s=t.getV,a=t.getTLV,i=t.getChildIdx,c=d.asn1,l=c.ASN1Util.oidHexToInt,h=c.x509.OID.oid2name,m=vt,A=g0,p=lI,f={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},E=function(P){for(var k=[],U=i(P,0),M=0;M<U.length;M++){var W=U[M],K=a(P,W),V=r(K);k.push(V)}return k},v=e.substr(0,2),b={},w=s(e,0);if(v=="01")return e=="0101ff"?{bool:!0}:{bool:!1};if(v=="02")return{int:{hex:w}};if(v=="03")try{if(w.substr(0,2)!="00")throw"not encap";var S=w.substr(2);if(!n(S))throw"not encap";return{bitstr:{obj:r(S)}}}catch{var F=null;return w.length<=10&&(F=E2(w)),F==null?{bitstr:{hex:w}}:{bitstr:{bin:F}}}else if(v=="04")try{if(!n(w))throw"not encap";return{octstr:{obj:r(w)}}}catch{return{octstr:{hex:w}}}else{if(v=="05")return{null:""};if(v=="06"){var D=l(w),I=h(D);return I==""?{oid:D}:{oid:I}}else{if(v=="0a")return w.length>4?{enum:{hex:w}}:{enum:parseInt(w,16)};if(v=="30"||v=="31")return b[f[v]]=E(e),b;if(v=="14"){var j=p(w);return b[f[v]]={str:j},b}else if(v=="1e"){var j=A(w);return b[f[v]]={str:j},b}else if(":0c:12:13:16:17:18:1a:".indexOf(v)!=-1){var j=m(w);return b[f[v]]={str:j},b}else if(v.match(/^8[0-9]$/)){var j=m(w);return j==null|j==""?{tag:{tag:v,explicit:!1,hex:w}}:j.match(/[\x00-\x1F\x7F-\x9F]/)!=null||j.match(/[\u0000-\u001F\u0080–\u009F]/)!=null?{tag:{tag:v,explicit:!1,hex:w}}:{tag:{tag:v,explicit:!1,str:j}}}else if(v.match(/^a[0-9]$/))try{if(!n(w))throw new Error("not encap");return{tag:{tag:v,explicit:!0,obj:r(w)}}}catch{return{tag:{tag:v,explicit:!0,hex:w}}}else{var q=new d.asn1.ASN1Object;q.hV=w;var _=q.getLengthHexFromValue();return{asn1:{tlv:v+_+w}}}}}};Ae.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}};Ae.isASN1HEX=function(e){var t=Ae;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),s=t.getL(e,0),a=e.length-n.length-s.length;return a==r*2};Ae.checkStrictDER=function(e,t,r,n,s){var a=Ae;if(r===void 0){if(typeof e!="string")throw new Error("not hex string");if(e=e.toLowerCase(),!d.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=a.getL(e,t);if(i.length>s*2)throw new Error("L of TLV too long: idx="+t);var c=a.getVblen(e,t);if(c>n)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(e,t),h=l.length-2-a.getL(e,t).length;if(h!==c*2)throw new Error("V string length and L's value not the same:"+h+"/"+c*2);if(t===0&&e.length!=l.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+l.length);var m=e.substr(t,2);if(m==="02"){var A=a.getVidx(e,t);if(e.substr(A,2)=="00"&&e.charCodeAt(A+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(m,16)&32){for(var p=a.getVblen(e,t),f=0,E=a.getChildIdx(e,t),v=0;v<E.length;v++){var b=a.getTLV(e,E[v]);f+=b.length,a.checkStrictDER(e,E[v],r,n,s)}if(p*2!=f)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+f)}};Ae.oidname=function(e){var t=d.asn1;d.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return r===""&&(r=e),r};(typeof d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});(typeof d.asn1.x509>"u"||!d.asn1.x509)&&(d.asn1.x509={});d.asn1.x509.Certificate=function(e){d.asn1.x509.Certificate.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERBitString,s=r.DERSequence,a=r.x509,i=a.TBSCertificate,c=a.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=this.params,h=l.sigalg;l.sigalg.name!=null&&(h=l.sigalg.name);var m=l.tbsobj.tohex(),A=new d.crypto.Signature({alg:h});A.init(l.cakey),A.updateHex(m),l.sighex=A.sign()},this.getPEM=function(){return xr(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 h=[];h.push(l.tbsobj),h.push(new c({name:l.sigalg})),h.push(new n({hex:"00"+l.sighex}));var m=new s({array:h});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};fe(d.asn1.x509.Certificate,d.asn1.ASN1Object);d.asn1.x509.TBSCertificate=function(e){d.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.x509,s=r.DERTaggedObject,a=r.DERInteger,i=r.DERSequence,c=n.AlgorithmIdentifier,l=n.Time,h=n.X500Name,m=n.Extensions,A=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(p){this.params=p},this.tohex=function(){var p=[],f=this.params;if(f.version!=null||f.version!=1){var E=2;f.version!=null&&(E=f.version-1);var v=new s({obj:new a({int:E})});p.push(v)}p.push(new a(f.serial)),p.push(new c({name:f.sigalg})),p.push(new h(f.issuer)),p.push(new i({array:[new l(f.notbefore),new l(f.notafter)]})),p.push(new h(f.subject)),p.push(new A(rt.getKey(f.sbjpubkey))),f.ext!==void 0&&f.ext.length>0&&p.push(new s({tag:"a3",obj:new m(f.ext)}));var b=new d.asn1.DERSequence({array:p});return b.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.TBSCertificate,d.asn1.ASN1Object);d.asn1.x509.Extensions=function(e){d.asn1.x509.Extensions.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERSequence,s=r.x509;this.aParam=[],this.setByParam=function(a){this.aParam=a},this.tohex=function(){for(var a=[],i=0;i<this.aParam.length;i++){var c=this.aParam[i],l=c.extname,h=null;if(c.extn!=null)h=new s.PrivateExtension(c);else if(l=="subjectKeyIdentifier")h=new s.SubjectKeyIdentifier(c);else if(l=="keyUsage")h=new s.KeyUsage(c);else if(l=="subjectAltName")h=new s.SubjectAltName(c);else if(l=="issuerAltName")h=new s.IssuerAltName(c);else if(l=="basicConstraints")h=new s.BasicConstraints(c);else if(l=="nameConstraints")h=new s.NameConstraints(c);else if(l=="cRLDistributionPoints")h=new s.CRLDistributionPoints(c);else if(l=="certificatePolicies")h=new s.CertificatePolicies(c);else if(l=="policyMappings")h=new s.PolicyMappings(c);else if(l=="policyConstraints")h=new s.PolicyConstraints(c);else if(l=="inhibitAnyPolicy")h=new s.InhibitAnyPolicy(c);else if(l=="authorityKeyIdentifier")h=new s.AuthorityKeyIdentifier(c);else if(l=="extKeyUsage")h=new s.ExtKeyUsage(c);else if(l=="authorityInfoAccess")h=new s.AuthorityInfoAccess(c);else if(l=="cRLNumber")h=new s.CRLNumber(c);else if(l=="cRLReason")h=new s.CRLReason(c);else if(l=="ocspNonce")h=new s.OCSPNonce(c);else if(l=="ocspNoCheck")h=new s.OCSPNoCheck(c);else if(l=="adobeTimeStamp")h=new s.AdobeTimeStamp(c);else if(l=="subjectDirectoryAttributes")h=new s.SubjectDirectoryAttributes(c);else throw new Error("extension not supported:"+JSON.stringify(c));h!=null&&a.push(h)}var m=new n({array:a});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.x509.Extensions,d.asn1.ASN1Object);d.asn1.x509.Extension=function(e){d.asn1.x509.Extension.superclass.constructor.call(this);var t=null,r=d,n=r.asn1,s=n.DERObjectIdentifier,a=n.DEROctetString,i=n.DERBitString,c=n.DERBoolean,l=n.DERSequence;this.tohex=function(){var h=new s({oid:this.oid}),m=new a({hex:this.getExtnValueHex()}),A=new Array;A.push(h),this.critical&&A.push(new c),A.push(m);var p=new l({array:A});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,e!==void 0&&e.critical!==void 0&&(this.critical=e.critical)};fe(d.asn1.x509.Extension,d.asn1.ASN1Object);d.asn1.x509.KeyUsage=function(e){d.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 d.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 wf(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)};fe(d.asn1.x509.KeyUsage,d.asn1.x509.Extension);d.asn1.x509.BasicConstraints=function(e){d.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=d.asn1,r=t.DERBoolean,n=t.DERInteger,s=t.DERSequence,a=!1,i=-1;this.getExtnValueHex=function(){var c=new Array;this.cA&&c.push(new r),this.pathLen>-1&&c.push(new n({int:this.pathLen}));var l=new s({array:c});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))};fe(d.asn1.x509.BasicConstraints,d.asn1.x509.Extension);d.asn1.x509.CRLDistributionPoints=function(e){d.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(s){for(var a=[],i=0;i<s.length;i++)if(s[i]instanceof d.asn1.ASN1Object)a.push(s[i]);else{var c=new n.DistributionPoint(s[i]);a.push(c)}this.asn1ExtnValue=new r.DERSequence({array:a})},this.setByOneURI=function(s){var a=new n.DistributionPoint({fulluri:s});this.setByDPArray([a])},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))};fe(d.asn1.x509.CRLDistributionPoints,d.asn1.x509.Extension);d.asn1.x509.DistributionPoint=function(e){d.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=null,r=d,n=r.asn1,s=n.x509.DistributionPointName;this.tohex=function(){var a=new n.DERSequence;if(this.asn1DP!=null){var i=new n.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});a.appendASN1Object(i)}return this.hTLV=a.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}]})))};fe(d.asn1.x509.DistributionPoint,d.asn1.ASN1Object);d.asn1.x509.DistributionPointName=function(e){d.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=null,r=null,n=null,s=null,a=d,i=a.asn1,c=i.DERTaggedObject;if(this.tohex=function(){if(this.type!="full")throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new c({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")};fe(d.asn1.x509.DistributionPointName,d.asn1.ASN1Object);d.asn1.x509.CertificatePolicies=function(e){d.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.x509,s=r.DERSequence,a=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var i=[],c=0;c<this.params.array.length;c++)i.push(new a(this.params.array[c]));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)};fe(d.asn1.x509.CertificatePolicies,d.asn1.x509.Extension);d.asn1.x509.PolicyInformation=function(e){d.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=d.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 a=[new n(this.params.policyoid)];if(this.params.array!==void 0){for(var i=[],c=0;c<this.params.array.length;c++)i.push(new s(this.params.array[c]));i.length>0&&a.push(new r({array:i}))}var l=new r({array:a});return l.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};fe(d.asn1.x509.PolicyInformation,d.asn1.ASN1Object);d.asn1.x509.PolicyQualifierInfo=function(e){d.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=d.asn1,r=t.DERSequence,n=t.DERIA5String,s=t.DERObjectIdentifier,a=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 a(this.params.unotice)]});return i.tohex()}},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};fe(d.asn1.x509.PolicyQualifierInfo,d.asn1.ASN1Object);d.asn1.x509.UserNotice=function(e){d.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=d.asn1.DERInteger,n=d.asn1.x509.DisplayText,s=d.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var a=[];this.params.noticeref!==void 0&&a.push(new s(this.params.noticeref)),this.params.exptext!==void 0&&a.push(new n(this.params.exptext));var i=new t({array:a});return i.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&(this.params=e)};fe(d.asn1.x509.UserNotice,d.asn1.ASN1Object);d.asn1.x509.NoticeReference=function(e){d.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=d.asn1.DERInteger,n=d.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 a=[],i=this.params.noticenum,c=0;c<i.length;c++)a.push(new r(i[c]));s.push(new t({array:a}))}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)};fe(d.asn1.x509.NoticeReference,d.asn1.ASN1Object);d.asn1.x509.DisplayText=function(e){d.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"))};fe(d.asn1.x509.DisplayText,d.asn1.DERAbstractString);d.asn1.x509.PolicyMappings=function(e){d.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){for(var a=this.params,i=[],c=0;c<a.array.length;c++){var l=a.array[c];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)};fe(d.asn1.x509.PolicyMappings,d.asn1.x509.Extension);d.asn1.x509.PolicyConstraints=function(e){d.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){var a=this.params,i=[];return a.reqexp!=null&&i.push({tag:{tagi:"80",obj:{int:a.reqexp}}}),a.inhibit!=null&&i.push({tag:{tagi:"81",obj:{int:a.inhibit}}}),this.asn1ExtnValue=s({seq:i}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",e!==void 0&&(this.params=e)};fe(d.asn1.x509.PolicyConstraints,d.asn1.x509.Extension);d.asn1.x509.InhibitAnyPolicy=function(e){d.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=d,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)};fe(d.asn1.x509.InhibitAnyPolicy,d.asn1.x509.Extension);d.asn1.x509.NameConstraints=function(e){d.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.x509,s=r.ASN1Util.newObject,a=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var i=this.params,c=[];if(i.permit!=null&&i.permit.length!=null){for(var l=[],h=0;h<i.permit.length;h++)l.push(new a(i.permit[h]));c.push({tag:{tagi:"a0",obj:{seq:l}}})}if(i.exclude!=null&&i.exclude.length!=null){for(var m=[],h=0;h<i.exclude.length;h++)m.push(new a(i.exclude[h]));c.push({tag:{tagi:"a1",obj:{seq:m}}})}return this.asn1ExtnValue=s({seq:c}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",e!==void 0&&(this.params=e)};fe(d.asn1.x509.NameConstraints,d.asn1.x509.Extension);d.asn1.x509.GeneralSubtree=function(e){d.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=d.asn1,r=t.x509,n=r.GeneralName,s=t.ASN1Util.newObject;this.params=null,this.setByParam=function(a){this.params=a},this.tohex=function(){var a=this.params,i=[new n(a)];a.min!=null&&i.push({tag:{tagi:"80",obj:{int:a.min}}}),a.max!=null&&i.push({tag:{tagi:"81",obj:{int:a.max}}});var c=s({seq:i});return c.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.GeneralSubtree,d.asn1.ASN1Object);d.asn1.x509.ExtKeyUsage=function(e){d.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=d,r=t.asn1;this.setPurposeArray=function(n){this.asn1ExtnValue=new r.DERSequence;for(var s=0;s<n.length;s++){var a=new r.DERObjectIdentifier(n[s]);this.asn1ExtnValue.appendASN1Object(a)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",e!==void 0&&e.array!==void 0&&this.setPurposeArray(e.array)};fe(d.asn1.x509.ExtKeyUsage,d.asn1.x509.Extension);d.asn1.x509.AuthorityKeyIdentifier=function(e){d.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.DERTaggedObject,s=r.x509.GeneralNames,a=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 c=new r.DERSequence({array:i});return this.asn1ExtnValue=c,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(i){if(i.str!==void 0||i.hex!==void 0)this.asn1KID=new d.asn1.DEROctetString(i);else if(typeof i=="object"&&d.crypto.Util.isKey(i)||typeof i=="string"&&i.indexOf("BEGIN ")!=-1){var c=i;typeof i=="string"&&(c=rt.getKey(i));var l=rt.getKeyID(c);this.asn1KID=new d.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 d.asn1.x509.X500Name(i):typeof i=="string"&&i.indexOf("BEGIN ")!=-1&&i.indexOf("CERTIFICATE")!=-1&&(this.asn1CertIssuer=new d.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 d.asn1.DERInteger(i);else if(typeof i=="string"&&i.indexOf("BEGIN ")!=-1&&i.indexOf("CERTIFICATE")){var c=new Ne;c.readCertPEM(i);var l=c.getSerialNumberHex();this.asn1CertSN=new d.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)))};fe(d.asn1.x509.AuthorityKeyIdentifier,d.asn1.x509.Extension);d.asn1.x509.SubjectKeyIdentifier=function(e){d.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=d,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"&&d.crypto.Util.isKey(s)||typeof s=="string"&&s.indexOf("BEGIN")!=-1){var a=s;typeof s=="string"&&(a=rt.getKey(s));var i=rt.getKeyID(a);this.asn1KID=new d.asn1.DEROctetString({hex:i})}},this.oid="2.5.29.14",e!==void 0&&e.kid!==void 0&&this.setKIDByParam(e.kid)};fe(d.asn1.x509.SubjectKeyIdentifier,d.asn1.x509.Extension);d.asn1.x509.AuthorityInfoAccess=function(e){d.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(t){for(var r=new Array,n=d,s=n.asn1,a=s.DERSequence,i=s.DERObjectIdentifier,c=s.x509.GeneralName,l=0;l<t.length;l++){var h,m=t[l];if(m.ocsp!==void 0)h=new a({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new c({uri:m.ocsp})]});else if(m.caissuer!==void 0)h=new a({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new c({uri:m.caissuer})]});else throw new Error("unknown AccessMethod parameter: "+JSON.stringify(m));r.push(h)}this.asn1ExtnValue=new a({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)};fe(d.asn1.x509.AuthorityInfoAccess,d.asn1.x509.Extension);d.asn1.x509.SubjectAltName=function(e){d.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new d.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)};fe(d.asn1.x509.SubjectAltName,d.asn1.x509.Extension);d.asn1.x509.IssuerAltName=function(e){d.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(t){this.asn1ExtnValue=new d.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)};fe(d.asn1.x509.IssuerAltName,d.asn1.x509.Extension);d.asn1.x509.SubjectDirectoryAttributes=function(e){d.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=d.asn1,r=t.DERSequence,n=t.ASN1Util.newObject,s=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var a=[],i=0;i<this.params.array.length;i++){var c=this.params.array[i];if(c.attr!=null&&c.array!=null){var l={seq:[{oid:c.attr},{set:c.array}]};a.push(n(l));continue}var h={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if(c.attr=="dateOfBirth")h.seq[0].oid=s(c.attr),h.seq[1].set[0]={gentime:c.str};else if(c.attr=="placeOfBirth")h.seq[0].oid=s(c.attr),h.seq[1].set[0]={utf8str:c.str};else if(c.attr=="gender")h.seq[0].oid=s(c.attr),h.seq[1].set[0]={prnstr:c.str};else if(c.attr=="countryOfCitizenship")h.seq[0].oid=s(c.attr),h.seq[1].set[0]={prnstr:c.str};else if(c.attr=="countryOfResidence")h.seq[0].oid=s(c.attr),h.seq[1].set[0]={prnstr:c.str};else throw new Error("unsupported attribute: "+c.attr);a.push(new n(h))}var m=new r({array:a});return this.asn1ExtnValue=m,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",e!==void 0&&(this.params=e)};fe(d.asn1.x509.SubjectDirectoryAttributes,d.asn1.x509.Extension);d.asn1.x509.PrivateExtension=function(e){d.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=d,r=t.lang.String.isHex,n=t.asn1,s=n.x509.OID.name2oid,a=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 a(i).tohex()}catch{}throw new Error("unsupported extn value")},e!=null&&this.setByParam(e)};fe(d.asn1.x509.PrivateExtension,d.asn1.x509.Extension);d.asn1.x509.CRL=function(e){d.asn1.x509.CRL.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERSequence,s=r.DERBitString,a=r.x509,i=a.AlgorithmIdentifier,c=a.TBSCertList;this.params=void 0,this.setByParam=function(l){this.params=l},this.sign=function(){var l=new c(this.params).tohex(),h=new d.crypto.Signature({alg:this.params.sigalg});h.init(this.params.cakey),h.updateHex(l);var m=h.sign();this.params.sighex=m},this.getPEM=function(){return xr(this.tohex(),"X509 CRL")},this.tohex=function(){var l=this.params;if(l.tbsobj==null&&(l.tbsobj=new c(l)),l.sighex==null&&l.cakey!=null&&this.sign(),l.sighex==null)throw new Error("sighex or cakey parameter not defined");var h=[];h.push(l.tbsobj),h.push(new i({name:l.sigalg})),h.push(new s({hex:"00"+l.sighex}));var m=new n({array:h});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&(this.params=e)};fe(d.asn1.x509.CRL,d.asn1.ASN1Object);d.asn1.x509.TBSCertList=function(e){d.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERInteger,s=r.DERSequence,a=r.DERTaggedObject,i=r.DERObjectIdentifier,c=r.x509,l=c.AlgorithmIdentifier,h=c.Time,m=c.Extensions,A=c.X500Name;this.params=null,this.setByParam=function(p){this.params=p},this.getRevCertSequence=function(){for(var p=[],f=this.params.revcert,E=0;E<f.length;E++){var v=[new n(f[E].sn),new h(f[E].date)];f[E].ext!=null&&v.push(new m(f[E].ext)),p.push(new s({array:v}))}return new s({array:p})},this.tohex=function(){var p=[],f=this.params;if(f.version!=null){var E=f.version-1,v=new n({int:E});p.push(v)}if(p.push(new l({name:f.sigalg})),p.push(new A(f.issuer)),p.push(new h(f.thisupdate)),f.nextupdate!=null&&p.push(new h(f.nextupdate)),f.revcert!=null&&p.push(this.getRevCertSequence()),f.ext!=null){var b=new m(f.ext);p.push(new a({tag:"a0",explicit:!0,obj:b}))}var w=new s({array:p});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.TBSCertList,d.asn1.ASN1Object);d.asn1.x509.CRLEntry=function(e){d.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=null,r=null,n=d,s=n.asn1;this.setCertSerial=function(a){this.sn=new s.DERInteger(a)},this.setRevocationDate=function(a){this.time=new s.x509.Time(a)},this.tohex=function(){var a=new s.DERSequence({array:[this.sn,this.time]});return this.TLV=a.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))};fe(d.asn1.x509.CRLEntry,d.asn1.ASN1Object);d.asn1.x509.CRLNumber=function(e){d.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new d.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",e!=null&&(this.params=e)};fe(d.asn1.x509.CRLNumber,d.asn1.x509.Extension);d.asn1.x509.CRLReason=function(e){d.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new d.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",e!=null&&(this.params=e)};fe(d.asn1.x509.CRLReason,d.asn1.x509.Extension);d.asn1.x509.OCSPNonce=function(e){d.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new d.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",e!=null&&(this.params=e)};fe(d.asn1.x509.OCSPNonce,d.asn1.x509.Extension);d.asn1.x509.OCSPNoCheck=function(e){d.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new d.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",e!=null&&(this.params=e)};fe(d.asn1.x509.OCSPNoCheck,d.asn1.x509.Extension);d.asn1.x509.AdobeTimeStamp=function(e){d.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=d,r=t.asn1,n=r.DERInteger,s=r.DERBoolean,a=r.DERSequence,i=r.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var c=this.params,l=[new n(1)];return l.push(new i({uri:c.uri})),c.reqauth!=null&&l.push(new s(c.reqauth)),this.asn1ExtnValue=new a({array:l}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.AdobeTimeStamp,d.asn1.x509.Extension);d.asn1.x509.X500Name=function(e){d.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=d,r=t.asn1,n=r.x509,s=n.RDN,a=xt;this.setByString=function(i,c){c!==void 0&&(this.sRule=c);var l=i.split("/");l.shift();for(var h=[],m=0;m<l.length;m++)if(l[m].match(/^[^=]+=.+$/))h.push(l[m]);else{var A=h.length-1;h[A]=h[A]+"/"+l[m]}for(var m=0;m<h.length;m++)this.asn1Array.push(new s({str:h[m],rule:this.sRule}))},this.setByLdapString=function(i,c){c!==void 0&&(this.sRule=c);var l=n.X500Name.ldapToCompat(i);this.setByString(l,c)},this.setByObject=function(i,c){c!==void 0&&(this.sRule=c);for(var l in i)if(i.hasOwnProperty(l)){var h=new s({str:l+"="+i[l],rule:this.sRule});this.asn1Array?this.asn1Array.push(h):this.asn1Array=[h]}},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 c=new Ne;c.readCertPEM(i.certissuer),this.hTLV=c.getIssuerHex()}else if(i.certsubject!==void 0){var c=new Ne;c.readCertPEM(i.certsubject),this.hTLV=c.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 c={array:this.paramArray[i]};this.sRule!="utf8"&&(c.rule=this.sRule);var l=new s(c);this.asn1Array.push(l)}var h=new r.DERSequence({array:this.asn1Array});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.X500Name,d.asn1.ASN1Object);d.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(",")};d.asn1.x509.X500Name.onelineToLDAP=function(e){return d.asn1.x509.X500Name.compatToLDAP(e)};d.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),r=!1,n=[],s=0;t.length>0;s++){var a=t.shift();if(r===!0){var i=n.pop(),c=(i+","+a).replace(/\\,/g,",");n.push(c),r=!1}else n.push(a);a.substr(-1,1)==="\\"&&(r=!0)}return n=n.map(function(l){return l.replace("/","\\/")}),n.reverse(),"/"+n.join("/")};d.asn1.x509.X500Name.ldapToOneline=function(e){return d.asn1.x509.X500Name.ldapToCompat(e)};d.asn1.x509.RDN=function(e){d.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=d.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 d.asn1.x509.AttributeTypeAndValue({str:r,rule:this.sRule}))},this.addByMultiValuedString=function(r){for(var n=d.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 a=new d.asn1.DERSet({array:this.asn1Array});return this.TLV=a.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.RDN,d.asn1.ASN1Object);d.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),r=!1,n=[],s=0;t.length>0;s++){var a=t.shift();if(r===!0){var i=n.pop(),c=(i+"+"+a).replace(/\\\+/g,"+");n.push(c),r=!1}else n.push(a);a.substr(-1,1)==="\\"&&(r=!0)}for(var l=!1,h=[],s=0;n.length>0;s++){var a=n.shift();if(l===!0){var m=h.pop();if(a.match(/"$/)){var c=(m+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2");h.push(c),l=!1}else h.push(m+"+"+a)}else h.push(a);a.match(/^[^=]+="/)&&(l=!0)}return h};d.asn1.x509.AttributeTypeAndValue=function(e){d.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=d,r=t.asn1,n=r.DERSequence,s=r.DERUTF8String,a=r.DERPrintableString,i=r.DERTeletexString,c=r.DERIA5String,l=r.DERVisibleString,h=r.DERBMPString,m=t.lang.String.isMail,A=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 f=p.str,E=f.match(/^([^=]+)=(.+)$/);if(E)this.sType=E[1],this.sValue=E[2];else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}else this.sType=p.type,this.sValue=p.value},this.setByString=function(p,f){f!==void 0&&(this.sRule=f);var E=p.match(/^([^=]+)=(.+)$/);if(E)this.setByAttrTypeAndValueStr(E[1],E[2]);else throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)},this._getDsType=function(){var p=this.sType,f=this.sValue,E=this.sRule;return E==="prn"?p=="CN"&&m(f)?"ia5":A(f)?"prn":"utf8":E==="utf8"?p=="CN"&&m(f)?"ia5":p=="C"?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(p,f,E){E!==void 0&&(this.sRule=E),this.sType=p,this.sValue=f},this.getValueObj=function(p,f){if(p=="utf8")return new s({str:f});if(p=="prn")return new a({str:f});if(p=="tel")return new i({str:f});if(p=="ia5")return new c({str:f});if(p=="vis")return new l({str:f});if(p=="bmp")return new h({str:f});throw new Error("unsupported directory string type: type="+p+" value="+f)},this.tohex=function(){this.dsType==null&&(this.dsType=this._getDsType());var p=d.asn1.x509.OID.atype2obj(this.sType),f=this.getValueObj(this.dsType,this.sValue),E=new n({array:[p,f]});return this.TLV=E.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.AttributeTypeAndValue,d.asn1.ASN1Object);d.asn1.x509.SubjectPublicKeyInfo=function(e){d.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=null,r=null,n=d,s=n.asn1,a=s.DERInteger,i=s.DERBitString,c=s.DERObjectIdentifier,l=s.DERSequence,h=s.ASN1Util.newObject,m=s.x509,A=m.AlgorithmIdentifier,p=n.crypto,f=p.ECDSA,E=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 Ke){var b=h({seq:[{int:{bigint:v.n}},{int:{int:v.e}}]}),w=b.tohex();this.asn1AlgId=new A({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+w})}}catch{}try{if(v instanceof d.crypto.ECDSA){var S=new c({name:v.curveName});this.asn1AlgId=new A({name:"ecPublicKey",asn1params:S}),this.asn1SubjPKey=new i({hex:"00"+v.pubKeyHex})}}catch{}try{if(v instanceof d.crypto.DSA){var S=new h({seq:[{int:{bigint:v.p}},{int:{bigint:v.q}},{int:{bigint:v.g}}]});this.asn1AlgId=new A({name:"dsa",asn1params:S});var F=new a({bigint:v.y});this.asn1SubjPKey=new i({hex:"00"+F.tohex()})}}catch{}},e!==void 0&&this.setPubKey(e)};fe(d.asn1.x509.SubjectPublicKeyInfo,d.asn1.ASN1Object);d.asn1.x509.Time=function(e){d.asn1.x509.Time.superclass.constructor.call(this);var t=null,r=null,n=d,s=n.asn1,a=s.DERUTCTime,i=s.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(c){this.timeParams=c},this.setByParam=function(c){this.params=c},this.getType=function(c){return c.match(/^[0-9]{12}Z$/)?"utc":c.match(/^[0-9]{14}Z$/)?"gen":c.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":c.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var c=this.params,l=null;if(typeof c=="string"&&(c={str:c}),c!=null&&c.str&&(c.type==null||c.type==null)&&(c.type=this.getType(c.str)),c!=null&&c.str?(c.type=="utc"&&(l=new a(c.str)),c.type=="gen"&&(l=new i(c.str))):this.type=="gen"?l=new i:l=new a,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)};d.asn1.x509.Time_bak=function(e){d.asn1.x509.Time_bak.superclass.constructor.call(this);var t=null,r=null,n=d,s=n.asn1,a=s.DERUTCTime,i=s.DERGeneralizedTime;this.setTimeParams=function(c){this.timeParams=c},this.tohex=function(){var c=null;return this.timeParams!=null?this.type=="utc"?c=new a(this.timeParams):c=new i(this.timeParams):this.type=="utc"?c=new a:c=new i,this.TLV=c.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)};fe(d.asn1.x509.Time,d.asn1.ASN1Object);d.asn1.x509.AlgorithmIdentifier=function(e){d.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=d,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 a=null;for(var i in n)i===this.nameAlg&&(a=n[i]);if(a!==null)return this.hTLV=a,this.hTLV}this.nameAlg!==null&&this.asn1Alg===null&&(this.asn1Alg=r.x509.OID.name2obj(this.nameAlg));var c=[this.asn1Alg];this.asn1Params!==null&&c.push(this.asn1Params);var l=new r.DERSequence({array:c});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)}};fe(d.asn1.x509.AlgorithmIdentifier,d.asn1.ASN1Object);d.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};d.asn1.x509.GeneralName=function(e){d.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87",otherName:"a0"},r=d,n=r.asn1,s=n.x509,a=s.X500Name,i=s.OtherName,c=n.DERIA5String,l=n.DERPrintableString,h=n.DEROctetString,m=n.DERTaggedObject,A=n.ASN1Object,p=Error;this.params=null,this.setByParam=function(f){this.params=f},this.tohex=function(){var f=this.params,E,b,v,b=!1;if(f.other!==void 0)E="a0",v=new i(f.other);else if(f.rfc822!==void 0)E="81",v=new c({str:f.rfc822});else if(f.dns!==void 0)E="82",v=new c({str:f.dns});else if(f.dn!==void 0)E="a4",b=!0,typeof f.dn=="string"?v=new a({str:f.dn}):f.dn instanceof d.asn1.x509.X500Name?v=f.dn:v=new a(f.dn);else if(f.ldapdn!==void 0)E="a4",b=!0,v=new a({ldapstr:f.ldapdn});else if(f.certissuer!==void 0||f.certsubj!==void 0){E="a4",b=!0;var w,S,F=null;if(f.certsubj!==void 0?(w=!1,S=f.certsubj):(w=!0,S=f.certissuer),S.match(/^[0-9A-Fa-f]+$/)&&F==S,S.indexOf("-----BEGIN ")!=-1&&(F=xt(S)),F==null)throw new Error("certsubj/certissuer not cert");var D=new Ne;D.hex=F;var I;w?I=D.getIssuerHex():I=D.getSubjectHex(),v=new A,v.hTLV=I}else if(f.uri!==void 0)E="86",v=new c({str:f.uri});else if(f.ip!==void 0){E="87";var j,q=f.ip;try{if(q.match(/^[0-9a-f]+$/)){var _=q.length;if(_==8||_==16||_==32||_==64)j=q;else throw"err"}else j=d0(q)}catch(k){throw new p("malformed IP address: "+f.ip+":"+k.message)}v=new h({hex:j})}else throw new p("improper params");var P=new m({tag:E,explicit:b,obj:v});return P.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.GeneralName,d.asn1.ASN1Object);d.asn1.x509.GeneralNames=function(e){d.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=null,r=d,n=r.asn1;this.setByParamArray=function(s){for(var a=0;a<s.length;a++){var i=new n.x509.GeneralName(s[a]);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)};fe(d.asn1.x509.GeneralNames,d.asn1.ASN1Object);d.asn1.x509.OtherName=function(e){d.asn1.x509.OtherName.superclass.constructor.call(this);var t=null,r=null,n=d,s=n.asn1,a=s.DERObjectIdentifier,i=s.DERSequence,c=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 h=new a({oid:l.oid}),m=c({tag:{tag:"a0",explicit:!0,obj:l.value}}),A=new i({array:[h,m]});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.x509.OtherName,d.asn1.ASN1Object);d.asn1.x509.OID=new function(){var e=d.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,a){var i=this[n];if(!i.match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch{return!1}}};d.asn1.x509.OID.oid2name=function(e){var t=d.asn1.x509.OID.name2oidList;for(var r in t)if(t[r]==e)return r;return""};d.asn1.x509.OID.oid2atype=function(e){var t=d.asn1.x509.OID.atype2oidList;for(var r in t)if(t[r]==e)return r;return e};d.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=d.asn1.x509.OID.name2oidList;return t[e]===void 0?"":t[e]};d.asn1.x509.X509Util={};d.asn1.x509.X509Util.newCertPEM=function(e){var t=d.asn1.x509,r=t.TBSCertificate,n=t.Certificate,s=new n(e);return s.getPEM()};(typeof d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});(typeof d.asn1.cms>"u"||!d.asn1.cms)&&(d.asn1.cms={});d.asn1.cms.Attribute=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.DERSet,i=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(c){this.params=c},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var c=new i({oid:this.typeOid}),l=new a({array:this.getValueArray()}),h=new s({array:[c,l]});return h.tohex()},this.getEncodedHex=function(){return this.tohex()}};fe(d.asn1.cms.Attribute,d.asn1.ASN1Object);d.asn1.cms.ContentType=function(e){var t=d,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)};fe(d.asn1.cms.ContentType,d.asn1.cms.Attribute);d.asn1.cms.MessageDigest=function(e){var t=d,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 a=new n(this.params);return[a]},e!=null&&this.setByParam(e)};fe(d.asn1.cms.MessageDigest,d.asn1.cms.Attribute);d.asn1.cms.SigningTime=function(e){var t=d,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)};fe(d.asn1.cms.SigningTime,d.asn1.cms.Attribute);d.asn1.cms.SigningCertificate=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.cms,i=a.ESSCertID,c=r.crypto;a.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,h=[],m=0;m<l.length;m++){var A=l[m];e.hasis==!1&&typeof A=="string"&&(A.indexOf("-----BEGIN")!=-1||Ae.isASN1HEX(A))&&(A={cert:A}),A.hasis!=!1&&e.hasis==!1&&(A.hasis=!1),h.push(new i(A))}var p=new s({array:h}),f=new s({array:[p]});return[f]},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SigningCertificate,d.asn1.cms.Attribute);d.asn1.cms.ESSCertID=function(e){d.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,r=d,n=r.asn1,s=n.DEROctetString,a=n.DERSequence,i=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(c,l){if(c.hash!=null)return c.hash;if(typeof c=="string"&&c.indexOf("-----BEGIN")==-1&&!Ae.isASN1HEX(c))return c;var h;if(typeof c=="string")h=c;else if(c.cert!=null)h=c.cert;else throw new t("hash nor cert unspecified");var m;h.indexOf("-----BEGIN")!=-1?m=xt(h):m=h,typeof c=="string"&&(c.indexOf("-----BEGIN")!=-1?m=xt(c):Ae.isASN1HEX(c)&&(m=c));var A;if(c.alg!=null)A=c.alg;else if(l!=null)A=l;else throw new t("hash alg unspecified");return r.crypto.Util.hashHex(m,A)},this.tohex=function(){var c=this.params,l=this.getCertHash(c,"sha1"),h=[];h.push(new s({hex:l})),(typeof c=="string"&&c.indexOf("-----BEGIN")!=-1||c.cert!=null&&c.hasis!=!1||c.issuer!=null&&c.serial!=null)&&h.push(new i(c));var m=new a({array:h});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.ESSCertID,d.asn1.ASN1Object);d.asn1.cms.SigningCertificateV2=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.x509,i=n.cms,c=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 h=this.params.array,m=[],A=0;A<h.length;A++){var p=h[A];(e.alg!=null||e.hasis==!1)&&typeof p=="string"&&(p.indexOf("-----BEGIN")!=-1||Ae.isASN1HEX(p))&&(p={cert:p}),p.alg==null&&e.alg!=null&&(p.alg=e.alg),p.hasis!=!1&&e.hasis==!1&&(p.hasis=!1),m.push(new c(p))}var f=new s({array:m}),E=new s({array:[f]});return[E]},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SigningCertificateV2,d.asn1.cms.Attribute);d.asn1.cms.ESSCertIDv2=function(e){d.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);var t=Error,r=d,n=r.asn1,s=n.DEROctetString,a=n.DERSequence,i=n.cms.IssuerSerial,c=n.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var l=this.params,h=this.getCertHash(l,"sha256"),m=[];l.alg!=null&&l.alg!="sha256"&&m.push(new c({name:l.alg})),m.push(new s({hex:h})),(typeof l=="string"&&l.indexOf("-----BEGIN")!=-1||l.cert!=null&&l.hasis!=!1||l.issuer!=null&&l.serial!=null)&&m.push(new i(l));var A=new a({array:m});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.ESSCertIDv2,d.asn1.cms.ESSCertID);d.asn1.cms.IssuerSerial=function(e){var t=Error,r=d,n=r.asn1,s=n.DERInteger,a=n.DERSequence,i=n.cms,c=n.x509,l=c.GeneralNames,h=Ne;i.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(m){this.params=m},this.tohex=function(){var m=this.params,A,p;if(typeof m=="string"&&m.indexOf("-----BEGIN")!=-1||m.cert!=null){var f;m.cert!=null?f=m.cert:f=m;var E=new h;E.readCertPEM(f),A=E.getIssuer(),p={hex:E.getSerialNumberHex()}}else if(m.issuer!=null&&m.serial)A=m.issuer,p=m.serial;else throw new t("cert or issuer and serial parameter not specified");var v=new l([{dn:A}]),b=new s(p),w=new a({array:[v,b]});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.IssuerSerial,d.asn1.ASN1Object);d.asn1.cms.SignerIdentifier=function(e){var t=d,r=t.asn1,n=r.DERInteger,s=r.DERSequence,a=r.cms,i=a.IssuerAndSerialNumber,c=a.SubjectKeyIdentifier,l=r.x509,h=l.X500Name,m=Ne,A=Error;a.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params;if(p.type=="isssn"){var f=new i(p);return f.tohex()}else if(p.type=="skid"){var E=new c(p);return E.tohex()}else throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SignerIdentifier,d.asn1.ASN1Object);d.asn1.cms.IssuerAndSerialNumber=function(e){var t=d,r=t.asn1,n=r.DERInteger,s=r.DERSequence,a=r.cms,i=r.x509,c=i.X500Name,l=Ne,h=Error;a.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var m=this.params,A,p;if(typeof m=="string"&&m.indexOf("-----BEGIN")!=-1||m.cert!=null){var f;m.cert!=null?f=m.cert:f=m;var E=new l;E.readCertPEM(f),A=E.getIssuer(),p={hex:E.getSerialNumberHex()}}else if(m.issuer!=null&&m.serial)A=m.issuer,p=m.serial;else throw new h("cert or issuer and serial parameter not specified");var v=new c(A),b=new n(p),w=new s({array:[v,b]});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(m){this.params=m},e!=null&&this.setByParam(e)};fe(d.asn1.cms.IssuerAndSerialNumber,d.asn1.ASN1Object);d.asn1.cms.SubjectKeyIdentifier=function(e){var t=d,r=t.asn1,n=r.DERInteger,s=r.DERSequence,a=r.ASN1Util.newObject,i=r.cms,c=i.IssuerAndSerialName,l=i.SubjectKeyIdentifier,h=r.x509,m=h.X500Name,A=Ne,p=Error;i.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var f=this.params;if(f.cert==null&&f.skid==null)throw new p("property cert nor skid undefined");var E;if(f.cert!=null){var v=new A(f.cert),b=v.getExtSubjectKeyIdentifier();E=b.kid.hex}else f.skid!=null&&(E=f.skid);var w=a({tag:{tage:"a0",obj:{octstr:{hex:E}}}});return w.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SubjectKeyIdentifier,d.asn1.ASN1Object);d.asn1.cms.AttributeList=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSet,a=n.cms;a.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 c=!0;i.sortflag!=null&&(c=i.sortflag);for(var l=i.array,h=[],m=0;m<l.length;m++){var A=l[m],p=A.attr;if(p=="contentType")h.push(new a.ContentType(A));else if(p=="messageDigest")h.push(new a.MessageDigest(A));else if(p=="signingTime")h.push(new a.SigningTime(A));else if(p=="signingCertificate")h.push(new a.SigningCertificate(A));else if(p=="signingCertificateV2")h.push(new a.SigningCertificateV2(A));else if(p=="signaturePolicyIdentifier")h.push(new d.asn1.cades.SignaturePolicyIdentifier(A));else if(p=="signatureTimeStamp"||p=="timeStampToken")h.push(new d.asn1.cades.SignatureTimeStamp(A));else throw new t("unknown attr: "+p)}var f=new s({array:h,sortflag:c});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.AttributeList,d.asn1.ASN1Object);d.asn1.cms.SignerInfo=function(e){var t=Error,r=d,n=r.asn1,s=n.DERInteger,a=n.DEROctetString,i=n.DERSequence,c=n.DERTaggedObject,l=n.cms,h=l.SignerIdentifier,m=l.AttributeList,A=l.ContentType,p=l.EncapsulatedContentInfo,f=l.MessageDigest,E=l.SignedData,v=n.x509,b=v.AlgorithmIdentifier,w=r.crypto,S=rt;l.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var F=this.params,D=F.sigalg,I=new m(F.sattrs).tohex(),j=S.getKey(F.signkey),q=new w.Signature({alg:D});q.init(j),q.updateHex(I);var _=q.sign();F.sighex=_},this.tohex=function(){var F=this.params,D=[];if(D.push(new s({int:F.version})),D.push(new h(F.id)),D.push(new b({name:F.hashalg})),F.sattrs!=null){var I=new m(F.sattrs);try{D.push(new c({tag:"a0",explicit:!1,obj:I}))}catch(q){throw new t("si sattr error: "+q)}}if(F.sigalgfield!=null?D.push(new b({name:F.sigalgfield})):D.push(new b({name:F.sigalg})),F.sighex==null&&F.signkey!=null&&this.sign(),D.push(new a({hex:F.sighex})),F.uattrs!=null){var I=new m(F.uattrs);try{D.push(new c({tag:"a1",explicit:!1,obj:I}))}catch(_){throw new t("si uattr error: "+_)}}var j=new i({array:D});return j.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SignerInfo,d.asn1.ASN1Object);d.asn1.cms.EncapsulatedContentInfo=function(e){var t=d,r=t.asn1,n=r.DERTaggedObject,s=r.DERSequence,a=r.DERObjectIdentifier,i=r.DEROctetString,c=r.cms;c.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,h=[];if(h.push(new a(l.type)),l.content!=null&&(l.content.hex!=null||l.content.str!=null)&&l.isDetached!=!0){var m=new i(l.content),A=new n({tag:"a0",explicit:!0,obj:m});h.push(A)}var p=new s({array:h});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};fe(d.asn1.cms.EncapsulatedContentInfo,d.asn1.ASN1Object);d.asn1.cms.ContentInfo=function(e){var t=d,r=t.asn1,n=r.DERTaggedObject,s=r.DERSequence,a=r.DERObjectIdentifier,i=r.x509,c=i.OID.name2obj;d.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var l=this.params,h=[];h.push(new a(l.type));var m=new n({tag:"a0",explicit:!0,obj:l.obj});h.push(m);var A=new s({array:h});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(l){this.params=l},e!=null&&this.setByParam(e)};fe(d.asn1.cms.ContentInfo,d.asn1.ASN1Object);d.asn1.cms.SignedData=function(e){var t=Error,r=d,n=r.asn1,s=n.ASN1Object,a=n.DERInteger,i=n.DERSet,c=n.DERSequence,l=n.DERTaggedObject,h=n.cms,m=h.EncapsulatedContentInfo,A=h.SignerInfo,p=h.ContentInfo,f=h.CertificateSet,E=h.RevocationInfoChoices,v=n.x509,b=v.AlgorithmIdentifier;d.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var w=this.params;this._setDigestAlgs(w),this._setContentTypeByEContent(w),this._setMessageDigestByEContent(w),this._setSignerInfoVersion(w),this._setSignedDataVersion(w)},this._setDigestAlgs=function(w){for(var S={},F=w.sinfos,D=0;D<F.length;D++){var I=F[D];S[I.hashalg]=1}w.hashalgs=Object.keys(S).sort()},this._setContentTypeByEContent=function(w){for(var S=w.econtent.type,F=w.sinfos,D=0;D<F.length;D++){var I=F[D],j=this._getAttrParamByName(I,"contentType");j.type=S}},this._setMessageDigestByEContent=function(w){var S=w.econtent,F=w.econtent.type,D=S.content.hex;D==null&&S.type=="data"&&S.content.str!=null&&(D=Ci(S.content.str));for(var I=w.sinfos,j=0;j<I.length;j++){var q=I[j],_=q.hashalg,P=this._getAttrParamByName(q,"messageDigest"),k=d.crypto.Util.hashHex(D,_);P.hex=k}},this._getAttrParamByName=function(w,S){for(var F=w.sattrs.array,D=0;D<F.length;D++)if(F[D].attr==S)return F[D]},this._setSignerInfoVersion=function(w){for(var S=w.sinfos,F=0;F<S.length;F++){var D=S[F],I=1;D.id.type=="skid"&&(I=3),D.version=I}},this._setSignedDataVersion=function(w){var S=this._getSignedDataVersion(w);w.version=S},this._getSignedDataVersion=function(w){if(w.revinfos!=null)for(var S=w.revinfos,F=0;F<S.length;F++){var D=S[F];if(D.ocsp!=null)return 5}for(var I=w.sinfos,F=0;F<I.length;F++){var j=w.sinfos[F];if(j.version==3)return 3}return w.econtent.type!="data"?3:1},this.tohex=function(){var w=this.params;this.getEncodedHexPrepare!=null&&this.getEncodedHexPrepare(),w.fixed!=!0&&this.checkAndFixParam();var S=[];S.push(new a({int:w.version}));for(var F=[],D=0;D<w.hashalgs.length;D++){var I=w.hashalgs[D];F.push(new b({name:I}))}S.push(new i({array:F})),S.push(new m(w.econtent)),w.certs!=null&&S.push(new f(w.certs)),w.revinfos!=null&&S.push(new E(w.revinfos));for(var j=[],D=0;D<w.sinfos.length;D++){var q=w.sinfos[D];j.push(new A(q))}S.push(new i({array:j}));var _=new c({array:S});return _.tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){var w=new p({type:"signed-data",obj:this});return w},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.SignedData,d.asn1.ASN1Object);d.asn1.cms.CertificateSet=function(e){d.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,r=d.asn1,n=r.DERTaggedObject,s=r.DERSet,a=r.ASN1Object;this.params=null,this.tohex=function(){var i=this.params,c=[],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 h=0;h<l.length;h++){var m=l[h],A=xt(m),p=new a;p.hTLV=A,c.push(p)}var f={array:c};i.sortflag==!1&&(f.sortflag=!1);var E=new s(f),v=new n({tag:"a0",explicit:!1,obj:E});return v.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.CertificateSet,d.asn1.ASN1Object);d.asn1.cms.RevocationInfoChoices=function(e){d.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 d.asn1.cms.RevocationInfoChoice(t[n]));var s=d.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:r}}});return s.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.RevocationInfoChoices,d.asn1.ASN1Object);d.asn1.cms.RevocationInfoChoice=function(e){d.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=xt(t.crl)),r}else if(t.ocsp!=null){var n=d.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new d.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)};fe(d.asn1.cms.RevocationInfoChoice,d.asn1.ASN1Object);d.asn1.cms.OtherRevocationFormat=function(e){d.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,r=d,n=r.asn1,s=n.ASN1Util.newObject,a=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(!a(i.ocsp)||!Ae.isASN1HEX(i.ocsp))throw new t("ocsp value not ASN.1 hex string");var c=s({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:i.ocsp}}]});return c.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cms.OtherRevocationFormat,d.asn1.ASN1Object);d.asn1.cms.CMSUtil=new function(){};d.asn1.cms.CMSUtil.newSignedData=function(e){return new d.asn1.cms.SignedData(e)};d.asn1.cms.CMSUtil.verifySignedData=function(e){var t=d,r=t.asn1,n=r.cms,s=n.SignerInfo,a=n.SignedData,i=n.SigningTime,c=n.SigningCertificate,l=n.SigningCertificateV2,h=r.cades,m=h.SignaturePolicyIdentifier,A=t.lang.String.isHex,p=Ae,f=p.getVbyList,E=p.getTLVbyList,v=p.getIdxbyList,b=p.getChildIdx,w=p.getTLV,S=p.oidname,F=t.crypto.Util.hashHex;e.cms===void 0&&A(e.cms);var D=e.cms,I=function(V,z){for(var ne,Ee=3;Ee<6;Ee++)if(ne=v(V,0,[1,0,Ee]),ne!==void 0){var we=V.substr(ne,2);we==="a0"&&(z.certsIdx=ne),we==="a1"&&(z.revinfosIdx=ne),we==="31"&&(z.signerinfosIdx=ne)}},j=function(V,z){var ne=z.signerinfosIdx;if(ne!==void 0){var Ee=b(V,ne);z.signerInfoIdxList=Ee;for(var we=0;we<Ee.length;we++){var _e=Ee[we],He={idx:_e};q(V,He),z.signerInfos.push(He)}}},q=function(V,z){var ne=z.idx;z.signerid_issuer1=E(V,ne,[1,0],"30"),z.signerid_serial1=f(V,ne,[1,1],"02"),z.hashalg=S(f(V,ne,[2,0],"06"));var Ee=v(V,ne,[3],"a0");z.idxSignedAttrs=Ee,_(V,z,Ee);var we=b(V,ne),_e=we.length;if(_e<6)throw"malformed SignerInfo";z.sigalg=S(f(V,ne,[_e-2,0],"06")),z.sigval=f(V,ne,[_e-1],"04")},_=function(V,z,ne){var Ee=b(V,ne);z.signedAttrIdxList=Ee;for(var we=0;we<Ee.length;we++){var _e=Ee[we],He=f(V,_e,[0],"06"),ue;He==="2a864886f70d010905"?(ue=vt(f(V,_e,[1,0])),z.saSigningTime=ue):He==="2a864886f70d010904"&&(ue=f(V,_e,[1,0],"04"),z.saMessageDigest=ue)}},P=function(V,z){if(f(V,0,[0],"06")!=="2a864886f70d010702")return z;z.cmsType="signedData",z.econtent=f(V,0,[1,0,2,1,0]),I(V,z),z.signerInfos=[],j(V,z)},k=function(V,z){for(var ne=z.parse.signerInfos,Ee=ne.length,we=!0,_e=0;_e<Ee;_e++){var He=ne[_e];M(V,z,He,_e),He.isValid||(we=!1)}z.isValid=we},U=function(V,z,ne,Ee){var we=z.parse.certsIdx,_e;if(z.certs===void 0){_e=[],z.certkeys=[];for(var He=b(V,we),ue=0;ue<He.length;ue++){var Ce=w(V,He[ue]),Oe=new Ne;Oe.readCertHex(Ce),_e[ue]=Oe,z.certkeys[ue]=Oe.getPublicKey()}z.certs=_e}else _e=z.certs;z.cccc=_e.length,z.cccci=He.length;for(var ue=0;ue<_e.length;ue++){var sr=Oe.getIssuerHex(),_t=Oe.getSerialNumberHex();ne.signerid_issuer1===sr&&ne.signerid_serial1===_t&&(ne.certkey_idx=ue)}},M=function(V,z,ne,Ee){ne.verifyDetail={};var we=ne.verifyDetail,_e=z.parse.econtent,He=ne.hashalg,ue=ne.saMessageDigest;we.validMessageDigest=!1,F(_e,He)===ue&&(we.validMessageDigest=!0),U(V,z,ne,Ee),we.validSignatureValue=!1;var Ce=ne.sigalg,Oe="31"+w(V,ne.idxSignedAttrs).substr(2);ne.signedattrshex=Oe;var sr=z.certs[ne.certkey_idx].getPublicKey(),_t=new d.crypto.Signature({alg:Ce});_t.init(sr),_t.updateHex(Oe);var lt=_t.verify(ne.sigval);we.validSignatureValue_isValid=lt,lt===!0&&(we.validSignatureValue=!0),ne.isValid=!1,we.validMessageDigest&&we.validSignatureValue&&(ne.isValid=!0)},W=function(){},K={isValid:!1,parse:{}};return P(D,K.parse),k(D,K),K};d.asn1.cms.CMSParser=function(){var e=Error,t=Ne,r=new t,n=Ae,s=n.getV,a=n.getTLV,i=n.getIdxbyList,c=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getVbyList,m=n.getVbyListEx,A=n.getChildIdx;this.getCMSSignedData=function(p){var f=c(p,0,[1,0]),E=this.getSignedData(f);return E},this.getSignedData=function(p){var f=A(p,0),E={},v=s(p,f[0]),b=parseInt(v,16);E.version=b;var w=a(p,f[1]);E.hashalgs=this.getHashAlgArray(w);var S=a(p,f[2]);E.econtent=this.getEContent(S);var F=l(p,0,["[0]"]);F!=null&&(E.certs=this.getCertificateSet(F));var D=l(p,0,["[1]"]);D!=null;var I=l(p,0,[3]);return E.sinfos=this.getSignerInfos(I),E},this.getHashAlgArray=function(p){for(var f=A(p,0),E=new t,v=[],b=0;b<f.length;b++){var w=a(p,f[b]),S=E.getAlgorithmIdentifierName(w);v.push(S)}return v},this.getEContent=function(p){var f={},E=h(p,0,[0]),v=h(p,0,[1,0]);return f.type=d.asn1.x509.OID.oid2name(Ae.hextooidstr(E)),f.content={hex:v},f},this.getSignerInfos=function(p){for(var f=[],E=A(p,0),v=0;v<E.length;v++){var b=a(p,E[v]),w=this.getSignerInfo(b);f.push(w)}return f},this.getSignerInfo=function(p){var f={},E=A(p,0),v=n.getInt(p,E[0],-1);v!=-1&&(f.version=v);var b=a(p,E[1]),w=this.getIssuerAndSerialNumber(b);f.id=w;var S=a(p,E[2]),F=r.getAlgorithmIdentifierName(S);f.hashalg=F;var D=l(p,0,["[0]"]);if(D!=null){var I=this.getAttributeList(D);f.sattrs=I}var j=l(p,0,[3]),q=r.getAlgorithmIdentifierName(j);f.sigalg=q;var _=m(p,0,[4]);f.sighex=_;var P=l(p,0,["[1]"]);if(P!=null){var k=this.getAttributeList(P);f.uattrs=k}return f},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 f={type:"isssn"},E=A(p,0),v=a(p,E[0]);f.issuer=r.getX500Name(v);var b=s(p,E[1]);return f.serial={hex:b},f},this.getAttributeList=function(p){for(var f=[],E=A(p,0),v=0;v<E.length;v++){var b=a(p,E[v]),w=this.getAttribute(b);f.push(w)}return{array:f}},this.getAttribute=function(p){var f={},E=A(p,0),v=n.getOID(p,E[0]),b=d.asn1.x509.OID.oid2name(v);f.attr=b;var w=a(p,E[1]),S=A(w,0);if(S.length==1)f.valhex=a(w,S[0]);else{for(var F=[],D=0;D<S.length;D++)F.push(a(w,S[D]));f.valhex=F}return b=="contentType"?this.setContentType(f):b=="messageDigest"?this.setMessageDigest(f):b=="signingTime"?this.setSigningTime(f):b=="signingCertificate"?this.setSigningCertificate(f):b=="signingCertificateV2"?this.setSigningCertificateV2(f):b=="signaturePolicyIdentifier"&&this.setSignaturePolicyIdentifier(f),f},this.setContentType=function(p){var f=n.getOIDName(p.valhex,0,null);f!=null&&(p.type=f,delete p.valhex)},this.setSigningTime=function(p){var f=s(p.valhex,0),E=vt(f);p.str=E,delete p.valhex},this.setMessageDigest=function(p){var f=s(p.valhex,0);p.hex=f,delete p.valhex},this.setSigningCertificate=function(p){var f=A(p.valhex,0);if(f.length>0){for(var E=a(p.valhex,f[0]),v=A(E,0),b=[],w=0;w<v.length;w++){var S=a(E,v[w]),F=this.getESSCertID(S);b.push(F)}p.array=b}if(f.length>1){var D=a(p.valhex,f[1]);p.polhex=D}delete p.valhex},this.setSignaturePolicyIdentifier=function(p){var f=A(p.valhex,0);if(f.length>0){var E=n.getOID(p.valhex,f[0]);p.oid=E}if(f.length>1){var v=new t,b=A(p.valhex,f[1]),w=a(p.valhex,b[0]),S=v.getAlgorithmIdentifierName(w);p.alg=S;var F=s(p.valhex,b[1]);p.hash=F}delete p.valhex},this.setSigningCertificateV2=function(p){var f=A(p.valhex,0);if(f.length>0){for(var E=a(p.valhex,f[0]),v=A(E,0),b=[],w=0;w<v.length;w++){var S=a(E,v[w]),F=this.getESSCertIDv2(S);b.push(F)}p.array=b}if(f.length>1){var D=a(p.valhex,f[1]);p.polhex=D}delete p.valhex},this.getESSCertID=function(p){var f={},E=A(p,0);if(E.length>0){var v=s(p,E[0]);f.hash=v}if(E.length>1){var b=a(p,E[1]),w=this.getIssuerSerial(b);w.serial!=null&&(f.serial=w.serial),w.issuer!=null&&(f.issuer=w.issuer)}return f},this.getESSCertIDv2=function(p){var f={},E=A(p,0);if(E.length<1||3<E.length)throw new e("wrong number of elements");var v=0;if(p.substr(E[0],2)=="30"){var b=a(p,E[0]);f.alg=r.getAlgorithmIdentifierName(b),v++}else f.alg="sha256";var w=s(p,E[v]);if(f.hash=w,E.length>v+1){var S=a(p,E[v+1]),F=this.getIssuerSerial(S);f.issuer=F.issuer,f.serial=F.serial}return f},this.getIssuerSerial=function(p){var f={},E=A(p,0),v=a(p,E[0]),b=r.getGeneralNames(v),w=b[0].dn;f.issuer=w;var S=s(p,E[1]);return f.serial={hex:S},f},this.getCertificateSet=function(p){for(var f=A(p,0),E=[],v=0;v<f.length;v++){var b=a(p,f[v]);if(b.substr(0,2)=="30"){var w=xr(b,"CERTIFICATE");E.push(w)}}return{array:E,sortflag:!1}}};(typeof d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});(typeof d.asn1.tsp>"u"||!d.asn1.tsp)&&(d.asn1.tsp={});d.asn1.tsp.TimeStampToken=function(e){var t=d,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)};fe(d.asn1.tsp.TimeStampToken,d.asn1.cms.SignedData);d.asn1.tsp.TSTInfo=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.DERInteger,i=n.DERBoolean,c=n.DERGeneralizedTime,l=n.DERObjectIdentifier,h=n.DERTaggedObject,m=n.tsp,A=m.MessageImprint,p=m.Accuracy,f=n.x509.X500Name,E=n.x509.GeneralName;if(m.TSTInfo.superclass.constructor.call(this),this.dVersion=new a({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 b=new s({array:v});return this.hTLV=b.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 A(e.messageImprint)),e.serial!==void 0&&(this.dSerial=new a(e.serial)),e.genTime!==void 0&&(this.dGenTime=new c(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 a(e.nonce)),e.tsa!==void 0&&(this.dTsa=new h({tag:"a0",explicit:!0,obj:new E({dn:e.tsa})}))}};fe(d.asn1.tsp.TSTInfo,d.asn1.ASN1Object);d.asn1.tsp.Accuracy=function(e){var t=d,r=t.asn1,n=r.ASN1Util.newObject;r.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var s=this.params,a=[];return s.seconds!=null&&typeof s.seconds=="number"&&a.push({int:s.seconds}),s.millis!=null&&typeof s.millis=="number"&&a.push({tag:{tagi:"80",obj:{int:s.millis}}}),s.micros!=null&&typeof s.micros=="number"&&a.push({tag:{tagi:"81",obj:{int:s.micros}}}),n({seq:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.Accuracy,d.asn1.ASN1Object);d.asn1.tsp.MessageImprint=function(e){var t=d,r=t.asn1,n=r.DERSequence,s=r.DEROctetString,a=r.x509,i=a.AlgorithmIdentifier;r.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var c=this.params,l=new i({name:c.alg}),h=new s({hex:c.hash}),m=new n({array:[l,h]});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.tsp.MessageImprint,d.asn1.ASN1Object);d.asn1.tsp.TimeStampReq=function(e){var t=d,r=t.asn1,n=r.DERSequence,s=r.DERInteger,a=r.DERBoolean,i=r.ASN1Object,c=r.DERObjectIdentifier,l=r.tsp,h=l.MessageImprint;l.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var m=this.params,A=[];A.push(new s({int:1})),m.messageImprint instanceof d.asn1.ASN1Object?A.push(m.messageImprint):A.push(new h(m.messageImprint)),m.policy!=null&&A.push(new c(m.policy)),m.nonce!=null&&A.push(new s(m.nonce)),m.certreq==!0&&A.push(new a);var p=new n({array:A});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.TimeStampReq,d.asn1.ASN1Object);d.asn1.tsp.TimeStampResp=function(e){var t=d,r=t.asn1,n=r.DERSequence,s=r.ASN1Object,a=r.tsp,i=a.PKIStatusInfo;a.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var c=this.params,l=[];if(c.econtent!=null||c.tst!=null)if(c.statusinfo!=null?l.push(new i(c.statusinfo)):l.push(new i("granted")),c.econtent!=null)l.push(new a.TimeStampToken(c).getContentInfo());else if(c.tst instanceof r.ASN1Object)l.push(c.tst);else throw new Error("improper member tst value");else if(c.statusinfo!=null)l.push(new i(c.statusinfo));else throw new Error("parameter for token nor statusinfo not specified");var h=new n({array:l});return h.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.TimeStampResp,d.asn1.ASN1Object);d.asn1.tsp.PKIStatusInfo=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.tsp,i=a.PKIStatus,c=a.PKIFreeText,l=a.PKIFailureInfo;a.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var h=this.params,m=[];if(typeof h=="string")m.push(new i(h));else{if(h.status==null)throw new t("property 'status' unspecified");m.push(new i(h.status)),h.statusstr!=null&&m.push(new c(h.statusstr)),h.failinfo!=null&&m.push(new l(h.failinfo))}var A=new s({array:m});return A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.PKIStatusInfo,d.asn1.ASN1Object);d.asn1.tsp.PKIStatus=function(e){var t=Error,r=d,n=r.asn1,s=n.DERInteger,a=n.tsp;a.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 c=this.params,l,h;if(typeof c=="string")try{h=i[c]}catch{throw new t("undefined name: "+c)}else if(typeof c=="number")h=c;else throw new t("unsupported params");return new s({int:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.PKIStatus,d.asn1.ASN1Object);d.asn1.tsp.PKIFreeText=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.DERUTF8String,i=n.tsp;i.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var c=this.params;if(!c instanceof Array)throw new t("wrong params: not array");for(var l=[],h=0;h<c.length;h++)l.push(new a({str:c[h]}));var m=new s({array:l});return m.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.PKIFreeText,d.asn1.ASN1Object);d.asn1.tsp.PKIFailureInfo=function(e){var t=Error,r=d,n=r.asn1,s=n.DERBitString,a=n.tsp,i=a.PKIFailureInfo,c={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,h=0;if(typeof l=="number"&&0<=l&&l<=25){h|=1<<l;for(var m=h.toString(2),A="",p=m.length-1;p>=0;p--)A+=m[p];return A}else{if(typeof l=="string"&&c[l]!=null)return wf([l],c);if(typeof l=="object"&&l.length!=null)return wf(l,c);throw new t("wrong params")}},this.tohex=function(){var l=this.params,h=this.getBinValue();return new s({bin:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.tsp.PKIFailureInfo,d.asn1.ASN1Object);d.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(t,r){throw"not implemented yet"}};d.asn1.tsp.SimpleTSAAdapter=function(e){var t=d,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(a,i){var c=s(a,i);this.params.econtent.content.messageImprint={alg:i,hash:c},this.params.econtent.content.serial={int:this.serial++};var l=Math.floor(Math.random()*1e9);this.params.econtent.content.nonce={int:l};var h=new n.TimeStampToken(this.params);return h.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};fe(d.asn1.tsp.SimpleTSAAdapter,d.asn1.tsp.AbstractTSAAdapter);d.asn1.tsp.FixedTSAAdapter=function(e){var t=d,r=t.asn1,n=r.tsp,s=t.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(a,i){var c=s(a,i);this.params.econtent.content.messageImprint={alg:i,hash:c};var l=new n.TimeStampToken(this.params);return l.getContentInfoEncodedHex()},e!==void 0&&(this.params=e)};fe(d.asn1.tsp.FixedTSAAdapter,d.asn1.tsp.AbstractTSAAdapter);d.asn1.tsp.TSPUtil=new function(){};d.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new d.asn1.tsp.TimeStampToken(e)};d.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){var t=new d.asn1.tsp.TSPParser;return t.getTimeStampReq(e)};d.asn1.tsp.TSPUtil.parseMessageImprint=function(e){var t=new d.asn1.tsp.TSPParser;return t.getMessageImprint(e)};d.asn1.tsp.TSPParser=function(){var e=Error,t=Ne,r=new t,n=Ae,s=n.getV,a=n.getTLV,i=n.getIdxbyList,c=n.getTLVbyListEx,l=n.getChildIdx,h=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],m={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(A){var p=l(A,0);if(p.length==1)return this.getPKIStatusInfo(a(A,p[0]));if(p.length>1){var f=this.getPKIStatusInfo(a(A,p[0])),E=a(A,p[1]),v=this.getToken(E);return v.statusinfo=f,v}},this.getToken=function(A){var p=new d.asn1.cms.CMSParser,f=p.getCMSSignedData(A);return this.setTSTInfo(f),f},this.setTSTInfo=function(A){var p=A.econtent;if(p.type=="tstinfo"){var f=p.content.hex,E=this.getTSTInfo(f);p.content=E}},this.getTSTInfo=function(A){var p={},f=l(A,0),E=s(A,f[1]);p.policy=If(E);var v=a(A,f[2]);p.messageImprint=this.getMessageImprint(v);var b=s(A,f[3]);p.serial={hex:b};var w=s(A,f[4]);p.genTime={str:vt(w)};var S=0;if(f.length>5&&A.substr(f[5],2)=="30"){var F=a(A,f[5]);p.accuracy=this.getAccuracy(F),S++}if(f.length>5+S&&A.substr(f[5+S],2)=="01"){var D=s(A,f[5+S]);D=="ff"&&(p.ordering=!0),S++}if(f.length>5+S&&A.substr(f[5+S],2)=="02"){var I=s(A,f[5+S]);p.nonce={hex:I},S++}if(f.length>5+S&&A.substr(f[5+S],2)=="a0"){var j=a(A,f[5+S]);j="30"+j.substr(2),pGeneralNames=r.getGeneralNames(j);var q=pGeneralNames[0].dn;p.tsa=q,S++}if(f.length>5+S&&A.substr(f[5+S],2)=="a1"){var _=a(A,f[5+S]);_="30"+_.substr(2);var P=r.getExtParamArray(_);p.ext=P,S++}return p},this.getAccuracy=function(A){for(var p={},f=l(A,0),E=0;E<f.length;E++){var v=A.substr(f[E],2),b=s(A,f[E]),w=parseInt(b,16);v=="02"?p.seconds=w:v=="80"?p.millis=w:v=="81"&&(p.micros=w)}return p},this.getMessageImprint=function(A){if(A.substr(0,2)!="30")throw new Error("head of messageImprint hex shall be x30");var p={},f=l(A,0),E=i(A,0,[0,0]),v=s(A,E),b=n.hextooidstr(v),w=d.asn1.x509.OID.oid2name(b);if(w=="")throw new Error("hashAlg name undefined: "+b);var S=w,F=i(A,0,[1]);return p.alg=S,p.hash=s(A,F),p},this.getPKIStatusInfo=function(A){var p={},f=l(A,0),E=0;try{var v=s(A,f[0]),b=parseInt(v,16);p.status=h[b]}catch{}if(f.length>1&&A.substr(f[1],2)=="30"){var w=a(A,f[1]);p.statusstr=this.getPKIFreeText(w),E++}if(f.length>E&&A.substr(f[1+E],2)=="03"){var S=a(A,f[1+E]);p.failinfo=this.getPKIFailureInfo(S)}return p},this.getPKIFreeText=function(A){for(var p=[],f=l(A,0),E=0;E<f.length;E++)p.push(n.getString(A,f[E]));return p},this.getPKIFailureInfo=function(A){var p=n.getInt(A,0);return m[p]!=null?m[p]:p},this.getTimeStampReq=function(A){var p={};p.certreq=!1;var f=l(A,0);if(f.length<2)throw new Error("TimeStampReq must have at least 2 items");var E=a(A,f[1]);p.messageImprint=d.asn1.tsp.TSPUtil.parseMessageImprint(E);for(var v=2;v<f.length;v++){var b=f[v],w=A.substr(b,2);if(w=="06"){var S=s(A,b);p.policy=n.hextooidstr(S)}w=="02"&&(p.nonce=s(A,b)),w=="01"&&(p.certreq=!0)}return p}};(typeof d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});(typeof d.asn1.cades>"u"||!d.asn1.cades)&&(d.asn1.cades={});d.asn1.cades.SignaturePolicyIdentifier=function(e){var t=d,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(a){this.params=a},e!=null&&this.setByParam(e)};fe(d.asn1.cades.SignaturePolicyIdentifier,d.asn1.cms.Attribute);d.asn1.cades.SignaturePolicyId=function(e){var t=d,r=t.asn1,n=r.DERSequence,s=r.DERObjectIdentifier,a=r.x509,i=a.AlgorithmIdentifier,c=r.cades,l=c.SignaturePolicyId,h=c.OtherHashAlgAndValue;l.superclass.constructor.call(this),this.params=null,this.tohex=function(){var m=this.params,A=[];A.push(new s(m.oid)),A.push(new h(m));var p=new n({array:A});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(m){this.params=m},e!=null&&this.setByParam(e)};fe(d.asn1.cades.SignaturePolicyId,d.asn1.ASN1Object);d.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.DEROctetString,i=n.x509,c=i.AlgorithmIdentifier,l=n.cades,h=l.OtherHashAlgAndValue;h.superclass.constructor.call(this),this.params=null,this.tohex=function(){var m=this.params;if(m.alg==null)throw new t("property 'alg' not specified");if(m.hash==null&&m.cert==null)throw new t("property 'hash' nor 'cert' not specified");var A=null;if(m.hash!=null)A=m.hash;else if(m.cert!=null){if(typeof m.cert!="string")throw new t("cert not string");var p=m.cert;m.cert.indexOf("-----BEGIN")!=-1&&(p=xt(m.cert)),A=d.crypto.Util.hashHex(p,m.alg)}var f=[];f.push(new c({name:m.alg})),f.push(new a({hex:A}));var E=new s({array:f});return E.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cades.OtherHashAlgAndValue,d.asn1.ASN1Object);d.asn1.cades.OtherHashValue=function(e){d.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,r=d,n=r.lang.String.isHex,s=r.asn1,a=s.DEROctetString,i=r.crypto.Util.hashHex;this.params=null,this.tohex=function(){var c=this.params;if(c.hash==null&&c.cert==null)throw new t("hash or cert not specified");var l=null;if(c.hash!=null)l=c.hash;else if(c.cert!=null){if(typeof c.cert!="string")throw new t("cert not string");var h=c.cert;c.cert.indexOf("-----BEGIN")!=-1&&(h=xt(c.cert)),l=d.crypto.Util.hashHex(h,"sha1")}return new a({hex:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cades.OtherHashValue,d.asn1.ASN1Object);d.asn1.cades.SignatureTimeStamp=function(e){var t=Error,r=d,n=r.lang.String.isHex,s=r.asn1,a=s.ASN1Object,i=s.x509,c=s.cades;c.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 h=new a;return h.hTLV=l.tst,[h]}else{if(l.tst instanceof a)return[l.tst];throw new t("params.tst has wrong value")}else if(l.res!=null){var m=l.res;if(m instanceof a&&(m=m.tohex()),typeof m!="string"||!n(m))throw new t("params.res has wrong value");var A=Ae.getTLVbyList(m,0,[1]),h=new a;return h.hTLV=l.tst,[h]}},e!=null&&this.setByParam(e)};fe(d.asn1.cades.SignatureTimeStamp,d.asn1.cms.Attribute);d.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.cades,i=a.OtherCertID,c=r.lang.String.isHex;a.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,h=[],m=0;m<l.array.length;m++){var A=l.array[m];if(typeof A=="string")if(A.indexOf("-----BEGIN")!=-1)A={cert:A};else if(c(A))A={hash:A};else throw new t("unsupported value: "+A);l.alg!=null&&A.alg==null&&(A.alg=l.alg),l.hasis!=null&&A.hasis==null&&(A.hasis=l.hasis);var p=new i(A);h.push(p)}var f=new s({array:h});return[f]},e!=null&&this.setByParam(e)};fe(d.asn1.cades.CompleteCertificateRefs,d.asn1.cms.Attribute);d.asn1.cades.OtherCertID=function(e){var t=d,r=t.asn1,n=r.DERSequence,s=r.cms,a=s.IssuerSerial,i=r.cades,c=i.OtherHashValue,l=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var h=this.params;typeof h=="string"&&(h.indexOf("-----BEGIN")!=-1?h={cert:h}:_isHex(h)&&(h={hash:h}));var m=[],A=null;if(h.alg!=null?A=new l(h):A=new c(h),m.push(A),h.cert!=null&&h.hasis==!0||h.issuer!=null&&h.serial!=null){var p=new a(h);m.push(p)}var f=new n({array:m});return f.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cades.OtherCertID,d.asn1.ASN1Object);d.asn1.cades.OtherHash=function(e){var t=Error,r=d,n=r.asn1,s=n.cms,a=n.cades,i=a.OtherHashAlgAndValue,c=a.OtherHashValue,l=r.crypto.Util.hashHex,h=r.lang.String.isHex;a.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var m=this.params;typeof m=="string"&&(m.indexOf("-----BEGIN")!=-1?m={cert:m}:h(m)&&(m={hash:m}));var A=null;return m.alg!=null?A=new i(m):A=new c(m),A.tohex()},this.getEncodedHex=function(){return this.tohex()},e!=null&&this.setByParam(e)};fe(d.asn1.cades.OtherHash,d.asn1.ASN1Object);d.asn1.cades.CAdESUtil=new function(){};d.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){var t=new d.asn1.cms.CMSParser,r=t.getCMSSignedData(e);return r};d.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,r){var n=Ae,s=n.getChildIdx,a=n.getTLV,i=n.getV,c=d,l=c.asn1,h=l.ASN1Object,m=l.cms,A=m.AttributeList,p=m.SignerInfo,f={},E=s(e,t);if(E.length!=6)throw"not supported items for SignerInfo (!=6)";var v=E.shift();f.version=a(e,v);var b=E.shift();f.si=a(e,b);var w=E.shift();f.digalg=a(e,w);var S=E.shift();f.sattrs=a(e,S);var F=E.shift();f.sigalg=a(e,F);var D=E.shift();f.sig=a(e,D),f.sigval=i(e,D);var I=null;return f.obj=new p,I=new h,I.hTLV=f.version,f.obj.dCMSVersion=I,I=new h,I.hTLV=f.si,f.obj.dSignerIdentifier=I,I=new h,I.hTLV=f.digalg,f.obj.dDigestAlgorithm=I,I=new h,I.hTLV=f.sattrs,f.obj.dSignedAttrs=I,I=new h,I.hTLV=f.sigalg,f.obj.dSigAlg=I,I=new h,I.hTLV=f.sig,f.obj.dSig=I,f.obj.dUnsignedAttrs=new A,f};(typeof d.asn1.csr>"u"||!d.asn1.csr)&&(d.asn1.csr={});d.asn1.csr.CertificationRequest=function(e){var t=d,r=t.asn1,n=r.DERBitString,s=r.DERSequence,a=r.csr,i=r.x509,c=a.CertificationRequestInfo;a.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(l){this.params=l},this.sign=function(){var l=new c(this.params).tohex(),h=new d.crypto.Signature({alg:this.params.sigalg});h.init(this.params.sbjprvkey),h.updateHex(l);var m=h.sign();this.params.sighex=m},this.getPEM=function(){return xr(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var l=this.params,h=new d.asn1.csr.CertificationRequestInfo(this.params),m=new d.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 A=new n({hex:"00"+l.sighex}),p=new s({array:[h,m,A]});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.csr.CertificationRequest,d.asn1.ASN1Object);d.asn1.csr.CertificationRequestInfo=function(e){var t=d,r=t.asn1,n=r.DERBitString,s=r.DERSequence,a=r.DERInteger,i=r.DERUTF8String,c=r.DERTaggedObject,l=r.ASN1Util.newObject,h=r.csr,m=r.x509,A=m.X500Name,p=m.Extensions,f=m.SubjectPublicKeyInfo,E=h.AttributeList;h.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(b){b!=null&&(this.params=b)},this.tohex=function(){var b=this.params,w=[];if(w.push(new a({int:0})),w.push(new A(b.subject)),w.push(new f(rt.getKey(b.sbjpubkey))),b.attrs!=null){var S=v(b.attrs),F=l({tag:{tage:"a0",obj:S}});w.push(F)}else if(b.extreq!=null){var D=new p(b.extreq),F=l({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[D]}]}}});w.push(F)}else w.push(new c({tag:"a0",explicit:!1,obj:new i({str:""})}));var I=new s({array:w});return I.tohex()},this.getEncodedHex=function(){return this.tohex()};function v(b){for(var w=Error,S=d.asn1.x509.Extensions,F=[],D=0;D<b.length;D++){var I=b[D],j=I.attr;if(j=="extensionRequest"){var q=new S(I.ext),_={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[q]}]};F.push(_)}else if(j=="unstructuredName"){var _={seq:[{oid:"1.2.840.113549.1.9.2"},{set:I.names}]};F.push(_)}else if(j=="challengePassword"){var _={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:I.password}]}]};F.push(_)}else throw new w("unknown CSR attribute")}return{set:F}}e!=null&&this.setByParam(e)};fe(d.asn1.csr.CertificationRequestInfo,d.asn1.ASN1Object);d.asn1.csr.AttributeList=function(e){function t(r){}};fe(d.asn1.csr.AttributeList,d.asn1.ASN1Object);d.asn1.csr.CSRUtil=new function(){};d.asn1.csr.CSRUtil.newCSRPEM=function(e){var t=rt,r=d.asn1.csr,n=new r.CertificationRequest(e),s=n.getPEM();return s};d.asn1.csr.CSRUtil.getParam=function(e,t){var r=Ae,n=r.getV,s=r.getIdxbyList,a=r.getTLVbyList,i=r.getTLVbyListEx,c=r.getVbyListEx,l=function(S){var F=s(S,0,[0,3,0,0],"06");return n(S,F)!="2a864886f70d01090e"?null:a(S,0,[0,3,0,1,0],"30")},h={};if(e.indexOf("-----BEGIN CERTIFICATE REQUEST")==-1)throw new Error("argument is not PEM file");var m=xt(e,"CERTIFICATE REQUEST");t&&(h.tbs=a(m,0,[0]));try{var A=i(m,0,[0,1]);if(A=="3000")h.subject={};else{var v=new Ne;h.subject=v.getX500Name(A)}}catch{}var p=i(m,0,[0,2]),f=rt.getKey(p,null,"pkcs8pub");h.sbjpubkey=rt.getPEM(f,"PKCS8PUB");var E=l(m),v=new Ne;E!=null&&(h.extreq=v.getExtParamArray(E));try{var b=i(m,0,[1],"30"),v=new Ne;h.sigalg=v.getAlgorithmIdentifierName(b)}catch{}try{var w=c(m,0,[2]);h.sighex=w}catch{}return h};d.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if(typeof e=="string"&&e.indexOf("-----BEGIN CERTIFICATE REQUEST")!=-1?t=d.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 d.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 d>"u"||!d)&&(d={});(typeof d.asn1>"u"||!d.asn1)&&(d.asn1={});(typeof d.asn1.ocsp>"u"||!d.asn1.ocsp)&&(d.asn1.ocsp={});d.asn1.ocsp.DEFAULT_HASH="sha1";d.asn1.ocsp.OCSPResponse=function(e){d.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);var t=d.asn1.DEREnumerated,r=d.asn1.ASN1Util.newObject,n=d.asn1.ocsp.ResponseBytes,s=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var a=this.params.resstatus;return typeof a=="number"?a:typeof a!="string"?-1:s.indexOf(a)},this.setByParam=function(a){this.params=a},this.tohex=function(){var a=this.params,i=this._getStatusCode();if(i==-1)throw new Error("responseStatus not supported: "+a.resstatus);if(i!=0)return r({seq:[{enum:{int:i}}]}).tohex();var c=new n(a);return r({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:c}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.OCSPResponse,d.asn1.ASN1Object);d.asn1.ocsp.ResponseBytes=function(e){d.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=d.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,s=t.DEROctetString,a=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 c=new a(i),l=[];l.push(new n({name:"ocspBasic"})),l.push(new s({hex:c.tohex()}));var h=new r({array:l});return h.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.ResponseBytes,d.asn1.ASN1Object);d.asn1.ocsp.BasicOCSPResponse=function(e){d.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,r=d.asn1,n=r.ASN1Object,s=r.DERSequence,a=r.DERGeneralizedTime,i=r.DERTaggedObject,c=r.DERBitString,l=r.x509.Extensions,h=r.x509.AlgorithmIdentifier,m=r.ocsp,A=m.ResponderID;_SingleResponseList=m.SingleResponseList,_ResponseData=m.ResponseData,this.params=null,this.setByParam=function(p){this.params=p},this.sign=function(){var p=this.params,f=p.tbsresp.tohex(),E=new d.crypto.Signature({alg:p.sigalg});E.init(p.reskey),E.updateHex(f),p.sighex=E.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 f=[];if(f.push(p.tbsresp),f.push(new h({name:p.sigalg})),f.push(new c({hex:"00"+p.sighex})),p.certs!=null&&p.certs.length!=null){for(var E=[],v=0;v<p.certs.length;v++){var b=p.certs[v],w=null;if(Ae.isASN1HEX(b))w=b;else if(b.match(/-----BEGIN/))w=xt(b);else throw new t("certs["+v+"] not hex or PEM");E.push(new n({tlv:w}))}var S=new s({array:E});f.push(new i({tag:"a0",explicit:!0,obj:S}))}var F=new s({array:f});return F.tohex()},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.BasicOCSPResponse,d.asn1.ASN1Object);d.asn1.ocsp.ResponseData=function(e){d.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,r=d.asn1,n=r.DERSequence,s=r.DERGeneralizedTime,a=r.DERTaggedObject,i=r.x509.Extensions,c=r.ocsp,l=c.ResponderID;_SingleResponseList=c.SingleResponseList,this.params=null,this.tohex=function(){var h=this.params;h.respid!=null&&new t("respid not specified"),h.prodat!=null&&new t("prodat not specified"),h.array!=null&&new t("array not specified");var m=[];if(m.push(new l(h.respid)),m.push(new s(h.prodat)),m.push(new _SingleResponseList(h.array)),h.ext!=null){var A=new i(h.ext);m.push(new a({tag:"a1",explicit:!0,obj:A}))}var p=new n({array:m});return p.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(h){this.params=h},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.ResponseData,d.asn1.ASN1Object);d.asn1.ocsp.ResponderID=function(e){d.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.ASN1Util.newObject,s=r.x509.X500Name,a=t.lang.String.isHex,i=Error;this.params=null,this.tohex=function(){var c=this.params;if(c.key!=null){var l=null;if(typeof c.key=="string"){if(a(c.key)&&(l=c.key),c.key.match(/-----BEGIN CERTIFICATE/)){var h=new Ne(c.key),m=h.getExtSubjectKeyIdentifier();m!=null&&(l=m.kid.hex)}}else if(c.key instanceof Ne){var m=c.key.getExtSubjectKeyIdentifier();m!=null&&(l=m.kid.hex)}if(l==null)throw new i("wrong key member value");var A=n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:l}}}});return A.tohex()}else if(c.name!=null){var p=null;if(typeof c.name=="string"&&c.name.match(/-----BEGIN CERTIFICATE/)){var h=new Ne(c.name);p=h.getSubject()}else c.name instanceof Ne?p=c.name.getSubject():typeof c.name=="object"&&(c.name.array!=null||c.name.str!=null)&&(p=c.name);if(p==null)throw new i("wrong name member value");var A=n({tag:{tag:"a1",explicit:!0,obj:new s(p)}});return A.tohex()}throw new i("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(c){this.params=c},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.ResponderID,d.asn1.ASN1Object);d.asn1.ocsp.SingleResponseList=function(e){d.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=d.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 a=[],i=0;i<s.length;i++)a.push(new n(s[i]));var c=new r({array:a});return c.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(s){this.params=s},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.SingleResponseList,d.asn1.ASN1Object);d.asn1.ocsp.SingleResponse=function(e){var t=Error,r=d,n=r.asn1,s=n.DERSequence,a=n.DERGeneralizedTime,i=n.DERTaggedObject,c=n.ocsp,l=c.CertID,h=c.CertStatus,m=n.x509,A=m.Extensions;c.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var p=this.params,f=[];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(f.push(new l(p.certid)),f.push(new h(p.status)),f.push(new a(p.thisupdate)),p.nextupdate!=null){var E=new a(p.nextupdate);f.push(new i({tag:"a0",explicit:!0,obj:E}))}if(p.ext!=null){var v=new A(p.ext);f.push(new i({tag:"a1",explicit:!0,obj:v}))}var b=new s({array:f});return b.tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(p){this.params=p},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.SingleResponse,d.asn1.ASN1Object);d.asn1.ocsp.CertID=function(e){var t=d,r=t.asn1,n=r.DEROctetString,s=r.DERInteger,a=r.DERSequence,i=r.x509,c=i.AlgorithmIdentifier,l=r.ocsp,h=l.DEFAULT_HASH,m=t.crypto,A=m.Util.hashHex,p=Ne,f=Ae,E=f.getVbyList;l.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(v,b,w,S){S==null&&(S=this.DEFAULT_HASH),this.params={alg:S,issname:v,isskey:b,sbjsn:w}},this.setByCert=function(v,b,w){w==null&&(w=this.DEFAULT_HASH),this.params={alg:w,issuerCert:v,subjectCert:b}},this.getParamByCerts=function(v,b,w){w==null&&(w=this.DEFAULT_HASH);var S=new p(v),F=new p(b),D=A(S.getSubjectHex(),w),I=S.getPublicKeyHex(),j=A(E(I,0,[1],"03",!0),w),q=F.getSerialNumberHex(),_={alg:w,issname:D,isskey:j,sbjsn:q};return _},this.tohex=function(){if(typeof this.params!="object")throw new Error("params not set");var v=this.params,b,w,S,F;if(v.alg==null?F=this.DEFAULT_HASH:F=v.alg,v.issuerCert!=null&&v.subjectCert!=null){var D=this.getParamByCerts(v.issuerCert,v.subjectCert,F);b=D.issname,w=D.isskey,S=D.sbjsn}else if(v.issname!=null&&v.isskey!=null&&v.sbjsn!=null)b=v.issname,w=v.isskey,S=v.sbjsn;else throw new Error("required param members not defined");var I=new c({name:F}),j=new n({hex:b}),q=new n({hex:w}),_=new s({hex:S}),P=new a({array:[I,j,q,_]});return this.hTLV=P.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&this.setByParam(e)};fe(d.asn1.ocsp.CertID,d.asn1.ASN1Object);d.asn1.ocsp.CertStatus=function(e){d.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 d.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)};fe(d.asn1.ocsp.CertStatus,d.asn1.ASN1Object);d.asn1.ocsp.Request=function(e){var t=d,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 c=new n({array:i});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},typeof e<"u"){var a=new s.CertID(e);this.dReqCert=a}};fe(d.asn1.ocsp.Request,d.asn1.ASN1Object);d.asn1.ocsp.TBSRequest=function(e){var t=d,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(a){for(var i=[],c=0;c<a.length;c++){var l=new s.Request(a[0]);i.push(l)}this.dRequestList=i},this.tohex=function(){var a=[];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(a.push(i),this.dRequestExt!==null)throw"requestExtensions not supported";var c=new n({array:a});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0&&this.setRequestListByParam(e.reqList)};fe(d.asn1.ocsp.TBSRequest,d.asn1.ASN1Object);d.asn1.ocsp.OCSPRequest=function(e){var t=d,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 c=new n({array:i});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},e!==void 0&&e.reqList!==void 0){var a=new s.TBSRequest(e);this.dTbsRequest=a}};fe(d.asn1.ocsp.OCSPRequest,d.asn1.ASN1Object);d.asn1.ocsp.OCSPUtil={};d.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,r){var n=d,s=n.asn1,a=s.ocsp;r===void 0&&(r=a.DEFAULT_HASH);var i={alg:r,issuerCert:e,subjectCert:t},c=new a.OCSPRequest({reqList:[i]});return c.tohex()};d.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=Ae,r=t.getVbyList,n=t.getVbyListEx,s=t.getIdxbyList,a=t.getIdxbyListEx,i=t.getV,c={};try{var l=n(e,0,[0],"0a");c.responseStatus=parseInt(l,16)}catch{}if(c.responseStatus!==0)return c;try{var h=s(e,0,[1,0,1,0,0,2,0,1]);e.substr(h,2)==="80"?c.certStatus="good":e.substr(h,2)==="a1"?(c.certStatus="revoked",c.revocationTime=vt(r(e,h,[0]))):e.substr(h,2)==="82"&&(c.certStatus="unknown")}catch{}try{var m=s(e,0,[1,0,1,0,0,2,0,2]);c.thisUpdate=vt(i(e,m))}catch{}try{var A=s(e,0,[1,0,1,0,0,2,0,3]);e.substr(A,2)==="a0"&&(c.nextUpdate=vt(r(e,A,[0])))}catch{}return c};d.asn1.ocsp.OCSPParser=function(){var e=Error,t=Ne,r=new t,n=Ae,s=n.getV,a=n.getTLV,i=n.getIdxbyList,c=n.getVbyList,l=n.getTLVbyList,h=n.getVbyListEx,m=n.getTLVbyListEx,A=n.getChildIdx;this.getOCSPRequest=function(p){var f=A(p,0);if(f.length!=1&&f.length!=2)throw new e("wrong number elements: "+f.length);var E=this.getTBSRequest(a(p,f[0]));return E},this.getTBSRequest=function(p){var f={},E=m(p,0,[0],"30");f.array=this.getRequestList(E);var v=m(p,0,["[2]",0],"30");return v!=null&&(f.ext=r.getExtParamArray(v)),f},this.getRequestList=function(p){for(var f=[],E=A(p,0),v=0;v<E.length;v++){var p=a(p,E[v]);f.push(this.getRequest(p))}return f},this.getRequest=function(p){var f=A(p,0);if(f.length!=1&&f.length!=2)throw new e("wrong number elements: "+f.length);var E=this.getCertID(a(p,f[0]));if(f.length==2){var v=i(p,0,[1,0]);E.ext=r.getExtParamArray(a(p,v))}return E},this.getCertID=function(p){var f=A(p,0);if(f.length!=4)throw new e("wrong number elements: "+f.length);var E=new t,v={};return v.alg=E.getAlgorithmIdentifierName(a(p,f[0])),v.issname=s(p,f[1]),v.isskey=s(p,f[2]),v.sbjsn=s(p,f[3]),v},this.getOCSPResponse=function(p){var f=A(p,0),E,v=s(p,f[0]),b=parseInt(v);if(f.length==1)return{resstatus:b};var w=l(p,0,[1,0]);return E=this.getResponseBytes(w),E.resstatus=b,E},this.getResponseBytes=function(p){var f=A(p,0),E,v=l(p,0,[1,0]);E=this.getBasicOCSPResponse(v);var b=s(p,f[0]);return E.restype=d.asn1.x509.OID.oid2name(If(b)),E},this.getBasicOCSPResponse=function(p){var f=A(p,0),E;E=this.getResponseData(a(p,f[0]));var v=new Ne;E.alg=v.getAlgorithmIdentifierName(a(p,f[1]));var b=s(p,f[2]);E.sighex=b.substr(2);var w=h(p,0,["[0]"]);if(w!=null){for(var S=A(w,0),F=[],D=0;D<S.length;D++){var I=a(w,S[D]);F.push(I)}E.certs=F}return E},this.getResponseData=function(p){var f=A(p,0),E=f.length,v={},b=0;p.substr(f[0],2)=="a0"&&b++,v.respid=this.getResponderID(a(p,f[b++]));var w=s(p,f[b++]);if(v.prodat=vt(w),v.array=this.getSingleResponseList(a(p,f[b++])),p.substr(f[E-1],2)=="a1"){var S=l(p,f[E-1],[0]),F=new Ne;v.ext=F.getExtParamArray(S)}return v},this.getResponderID=function(p){var f={};if(p.substr(0,2)=="a2"){var E=c(p,0,[0]);f.key=E}if(p.substr(0,2)=="a1"){var v=l(p,0,[0]),b=new Ne;f.name=b.getX500Name(v)}return f},this.getSingleResponseList=function(p){for(var f=A(p,0),E=[],v=0;v<f.length;v++){var b=this.getSingleResponse(a(p,f[v]));E.push(b)}return E},this.getSingleResponse=function(p){var f=A(p,0),E={},v=this.getCertID(a(p,f[0]));E.certid=v;var b=this.getCertStatus(a(p,f[1]));if(E.status=b,p.substr(f[2],2)=="18"){var w=s(p,f[2]);E.thisupdate=vt(w)}for(var S=3;S<f.length;S++){if(p.substr(f[S],2)=="a0"){var F=c(p,f[S],[0],"18");E.nextupdate=vt(F)}if(p.substr(f[S],2)=="a1"){var D=new Ne,I=l(p,0,[S,0]);E.ext=D.getExtParamArray(I)}}return E},this.getCertStatus=function(p){var f={};if(p=="8000")return{status:"good"};if(p=="8200")return{status:"unknown"};if(p.substr(0,2)=="a1"){f.status="revoked";var E=c(p,0,[0]),v=vt(E);f.time=v}return f}};var d;(typeof d>"u"||!d)&&(d={});(typeof d.lang>"u"||!d.lang)&&(d.lang={});d.lang.String=function(){};function l2(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function f2(e){for(var t="",r=0;r<e.length;r++)t=t+String.fromCharCode(e[r]);return t}function yf(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 on(e){return yf(l2(e))}function sI(e){return as(on(e))}function aI(e){return Ju(as(on(e)))}function uI(e){return f2(i2(Ec(e)))}function Ju(e){return e=e.replace(/\=/g,""),e=e.replace(/\+/g,"-"),e=e.replace(/\//g,"_"),e}function Ec(e){return e.length%4==2?e=e+"==":e.length%4==3&&(e=e+"="),e=e.replace(/-/g,"+"),e=e.replace(/_/g,"/"),e}function nr(e){return e.length%2==1&&(e="0"+e),Ju(as(e))}function Bt(e){return Zu(Ec(e))}var wc,ti;typeof Buffer=="function"?(wc=function(e){return Ju(Buffer.from(e,"utf8").toString("base64"))},ti=function(e){return Buffer.from(Ec(e),"base64").toString("utf8")}):(wc=function(e){return nr(Cf(_f(e)))},ti=function(e){return decodeURIComponent(Ff(Bt(e)))});function oI(e){return as(Cf(_f(e)))}function cI(e){return decodeURIComponent(Ff(Zu(e)))}function Sf(e){return Cf(_f(e)).toLowerCase()}function vt(e){try{return decodeURIComponent(Ff(e))}catch{return null}}function lI(e){return vt(fI(e))}function fI(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 cn(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Ci(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function h0(e){return as(e)}function hI(e){return bf(h0(e),64)}function bf(e,t){return e=e.replace(new RegExp("(.{"+t+"})","g"),`$1\r
|
||
`),e=e.replace(/\s+$/,""),e}function h2(e){var t=e.replace(/[^0-9A-Za-z\/+=]*/g,""),r=Zu(t);return r}function pI(e,t){return"-----BEGIN "+t+`-----\r
|
||
`+bf(e,64)+`\r
|
||
-----END `+t+`-----\r
|
||
`}function xr(e,t){return"-----BEGIN "+t+`-----\r
|
||
`+bf(h0(e),64)+`\r
|
||
-----END `+t+`-----\r
|
||
`}function xt(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 [^-]+-----[^]*$/,"")),h2(e)}function dI(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 gI(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 mI(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 p0(e){var t,r,n,s,a,i,c,l,h,m,A,p;if(e=d2(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]),a=parseInt(p[5]),i=parseInt(p[6]),c=0,m=p[7],m!==""&&(A=(m.substr(1)+"00").substr(0,3),c=parseInt(A)),Date.UTC(t,r,n,s,a,i,c);throw new Error("unsupported zulu format: "+e)}function vI(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),a=("00"+t.getUTCHours()).slice(-2),i=("00"+t.getUTCMinutes()).slice(-2),c=("00"+t.getUTCSeconds()).slice(-2),l=("000"+t.getUTCMilliseconds()).slice(-3);return l=l.replace(/0+$/,""),l=l!=""?"."+l:l,r+n+s+a+i+c+l+"Z"}function p2(e){return Math.round(p0(e)/1e3)}function wI(e){return new Date(p0(e))}function AI(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 a=e.getUTCMilliseconds();a!==0&&(a=("00"+a).slice(-3),a=a.replace(/0+$/g,""),n+="."+a)}return n+="Z",n}function d2(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 Cf(e){return e.replace(/%/g,"")}function Ff(e){return e.replace(/(..)/g,"%$1")}function s0(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 a=0;a<8;a++)s[a]=("0000"+s[a]).slice(-4);return s.join("")}function a0(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 mf(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 mf(e.substr(0,8))+"/"+r2(e.substr(8))}catch{throw t}else{if(e.length==32)return a0(e);if(e.length==64){try{return a0(e.substr(0,32))+"/"+r2(e.substr(32))}catch{throw t}return}else return e}}function r2(e){var t=new Error("malformed mask"),r;try{r=new Q(e,16).toString(2)}catch{throw t}if(!r.match(/^1*0*$/))throw t;return r.replace(/0+$/,"").length}function d0(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 a=parseInt(r[s]);n+=("0"+a.toString(16)).slice(-2)}return n}catch{throw t}}else if(e.match(/^[0-9.]+\/[0-9]+$/)){var i=e.split("/");return d0(i[0])+n2(parseInt(i[1]),32)}else{if(e.match(/^[0-9a-f:]+$/)&&e.indexOf(":")!==-1)return s0(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&e.indexOf(":")!==-1){var i=e.split("/");return s0(i[0])+n2(parseInt(i[1]),128)}else throw t}}function n2(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 Q(r,2).toString(16)}function g0(e){function t(s){var a=parseInt(s.substr(0,2),16),i=parseInt(s.substr(2),16);if(a==0&i<128)return String.fromCharCode(i);if(a<8){var c=192|(a&7)<<3|(i&192)>>6,l=128|i&63;return vt(c.toString(16)+l.toString(16))}var c=224|(a&240)>>4,l=128|(a&15)<<2|(i&192)>>6,h=128|i&63;return vt(c.toString(16)+l.toString(16)+h.toString(16))}var r=e.match(/.{4}/g),n=r.map(t);return n.join("")}function _f(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+"%"+on(t[n]);return r}function EI(e){return e=e.replace(/\r\n/mg,`
|
||
`),e}function yI(e){return e=e.replace(/\r\n/mg,`
|
||
`),e=e.replace(/\n/mg,`\r
|
||
`),e}d.lang.String.isInteger=function(e){return e.match(/^[0-9]+$/)?!0:!!e.match(/^-[0-9]+$/)};d.lang.String.isHex=function(e){return g2(e)};function g2(e){return!!(e.length%2==0&&(e.match(/^[0-9a-f]+$/)||e.match(/^[0-9A-F]+$/)))}d.lang.String.isBase64=function(e){return e=e.replace(/\s+/g,""),!!(e.match(/^[0-9A-Za-z+\/]+={0,3}$/)&&e.length%4==0)};d.lang.String.isBase64URL=function(e){return e.match(/[+/=]/)?!1:(e=Ec(e),d.lang.String.isBase64(e))};function m0(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}d.lang.String.isIntegerArray=function(e){return e=e.replace(/\s+/g,""),!!e.match(/^\[[0-9,]+\]$/)};d.lang.String.isPrintable=function(e){return e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null};d.lang.String.isIA5=function(e){return e.match(/^[\x20-\x21\x23-\x7f]*$/)!==null};d.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 u0(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}function SI(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 a=parseInt(r);if(a<0||255<a)throw"integer not in range 0-255";var i=("00"+a.toString(16)).slice(-2);return i}).join("");return t}catch(r){throw"malformed integer array string: "+r}}var bI=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 m2(e){var t=function(c){var l=c.toString(16);return l.length==1&&(l="0"+l),l},r=function(c){var l="",h=parseInt(c,10),m=h.toString(2),A=7-m.length%7;A==7&&(A=0);for(var p="",f=0;f<A;f++)p+="0";m=p+m;for(var f=0;f<m.length-1;f+=7){var E=m.substr(f,7);f!=m.length-7&&(E="1"+E),l+=t(parseInt(E,2))}return l};try{if(!e.match(/^[0-9.]+$/))return null;var n="",s=e.split("."),a=parseInt(s[0],10)*40+parseInt(s[1],10);n+=t(a),s.splice(0,2);for(var i=0;i<s.length;i++)n+=r(s[i]);return n}catch{return null}}function If(e){if(!g2(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),a=[],i=0;i<s.length/2;i++)a.push(parseInt(s.substr(i*2,2),16));for(var c=[],l="",i=0;i<a.length;i++)a[i]&128?l=l+vf((a[i]&127).toString(2),7):(l=l+vf((a[i]&127).toString(2),7),c.push(new String(parseInt(l,2))),l="");var h=t.join(".");return c.length>0&&(h=h+"."+c.join(".")),h}catch{return null}}function v2(e){var t=new Q(String(e),10);return yc(t)}function yc(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="",a=0;a<n;a++)s+="f";var i=new Q(s,16),c=i.xor(e).add(Q.ONE);return t=c.toString(16).replace(/^-/,""),t}var vf=function(e,t,r){return r==null&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};function w2(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 a=parseInt(s,2);return a==NaN?-1:a}catch{return-1}}function A2(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+vf("",r,"0");var n=parseInt(t,2).toString(16);n.length%2==1&&(n="0"+n);var s="0"+r;return s+n}function E2(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 a=r.substr(s,2),i=parseInt(a,16).toString(2);i=("0000000"+i).slice(-8),n+=i}return n.substr(0,n.length-t)}catch{return null}}function CI(e){if(typeof e!="string"||e.match(/^[01]+$/)==null)return null;try{var t=parseInt(e,2);return A2(t)}catch{return null}}function wf(e,t){for(var r=0,n=0;n<e.length;n++)r|=1<<t[e[n]];for(var s=r.toString(2),a="",n=s.length-1;n>=0;n--)a+=s[n];return a}function St(e,n,r){if(typeof e=="object"){for(var n=String(n).split("."),s=0;s<n.length&&e;s++){var a=n[s];a.match(/^[0-9]+$/)&&(a=parseInt(a)),e=e[a]}return e||e===!1?e:r}}function fe(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 d>"u"||!d)&&(d={});(typeof d.crypto>"u"||!d.crypto)&&(d.crypto={});d.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:Se.algo.MD5,sha1:Se.algo.SHA1,sha224:Se.algo.SHA224,sha256:Se.algo.SHA256,sha384:Se.algo.SHA384,sha512:Se.algo.SHA512,ripemd160:Se.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 a="0001",i="00"+n,c="",l=s-a.length-i.length,h=0;h<l;h+=2)c+="ff";var m=a+c+i;return m},this.hashString=function(e,t){var r=new d.crypto.MessageDigest({alg:t});return r.digestString(e)},this.hashHex=function(e,t){var r=new d.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 Ke||e instanceof d.crypto.DSA||e instanceof d.crypto.ECDSA}};d.crypto.Util.md5=function(e){var t=new d.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return t.digestString(e)};d.crypto.Util.ripemd160=function(e){var t=new d.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return t.digestString(e)};d.crypto.Util.SECURERANDOMGEN=new to;d.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return d.crypto.Util.SECURERANDOMGEN.nextBytes(t),yf(t)};d.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new Q(d.crypto.Util.getRandomHexOfNbytes(e),16)};d.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=(e-t)/8,n=new Array(r+1);return d.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],yf(n)};d.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new Q(d.crypto.Util.getRandomHexOfNbits(e),16)};d.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=d.crypto.Util.getRandomBigIntegerOfNbits(t);if(e.compareTo(r)!=-1)return r}};d.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=d.crypto.Util.getRandomBigIntegerZeroToMax(n);return s.add(e)};d.crypto.MessageDigest=function(e){var t=null,r=null,n=null;this.setAlgAndProvider=function(s,a){if(s=d.crypto.MessageDigest.getCanonicalAlgName(s),s!==null&&a===void 0&&(a=d.crypto.Util.DEFAULTPROVIDER[s]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(s)!=-1&&a=="cryptojs"){try{this.md=d.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 c=Se.enc.Hex.parse(i);this.md.update(c)},this.digest=function(){var i=this.md.finalize();return i.toString(Se.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&&a=="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 c=sjcl.codec.hex.toBits(i);this.md.update(c)},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=d.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};d.crypto.MessageDigest.getCanonicalAlgName=function(e){return typeof e=="string"&&(e=e.toLowerCase(),e=e.replace(/-/,"")),e};d.crypto.MessageDigest.getHashLength=function(e){var t=d.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(t.HASHLENGTH[r]===void 0)throw"not supported algorithm: "+e;return t.HASHLENGTH[r]};d.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};d.crypto.Mac=function(e){var t=null,r=null,n=null,s=null,a=null;this.setAlgAndProvider=function(i,c){if(i=i.toLowerCase(),i==null&&(i="hmacsha1"),i=i.toLowerCase(),i.substr(0,4)!="hmac")throw"setAlgAndProvider unsupported HMAC alg: "+i;c===void 0&&(c=d.crypto.Util.DEFAULTPROVIDER[i]),this.algProv=i+"/"+c;var l=i.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(l)!=-1&&c=="cryptojs"){try{var h=d.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[l];this.mac=Se.algo.HMAC.create(h,this.pass)}catch(m){throw"setAlgAndProvider hash alg set fail hashAlg="+l+"/"+m}this.updateString=function(m){this.mac.update(m)},this.updateHex=function(m){var A=Se.enc.Hex.parse(m);this.mac.update(A)},this.doFinal=function(){var m=this.mac.finalize();return m.toString(Se.enc.Hex)},this.doFinalString=function(m){return this.updateString(m),this.doFinal()},this.doFinalHex=function(m){return this.updateHex(m),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 c=i;(i.length%2==1||!i.match(/^[0-9A-Fa-f]+$/))&&(c=Ci(i)),this.pass=Se.enc.Hex.parse(c);return}if(typeof i!="object")throw"KJUR.crypto.Mac unsupported password type: "+i;var c=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;c=i.hex}if(i.utf8!==void 0&&(c=Sf(i.utf8)),i.rstr!==void 0&&(c=Ci(i.rstr)),i.b64!==void 0&&(c=Zu(i.b64)),i.b64u!==void 0&&(c=Bt(i.b64u)),c==null)throw"KJUR.crypto.Mac unsupported password type: "+i;this.pass=Se.enc.Hex.parse(c)},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=d.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))};d.crypto.Signature=function(e){var t=null,r=null,n=null,s=null,a=null,i=null,c=null,l=null,h=null,m=null,A=-1,p=null,f=null,E=null,v=null,b=null;if(this._setAlgNames=function(){var w=this.algName.match(/^(.+)with(.+)$/);w&&(this.mdAlgName=w[1].toLowerCase(),this.pubkeyAlgName=w[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(w,S){for(var F="",D=S/4-w.length,I=0;I<D;I++)F=F+"0";return F+w},this.setAlgAndProvider=function(w,S){if(this._setAlgNames(),S!="cryptojs/jsrsa")throw new Error("provider not supported: "+S);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new d.crypto.MessageDigest({alg:this.mdAlgName})}catch(F){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+F)}this.init=function(F,D){var I=null;try{D===void 0?I=rt.getKey(F):I=rt.getKey(F,D)}catch(j){throw"init failed:"+j}if(I.isPrivate===!0)this.prvKey=I,this.state="SIGN";else if(I.isPublic===!0)this.pubKey=I,this.state="VERIFY";else throw"init failed.:"+I},this.updateString=function(F){this.md.updateString(F)},this.updateHex=function(F){this.md.updateHex(F)},this.sign=function(){if(this.sHashHex=this.md.digest(),this.prvKey===void 0&&this.ecprvhex!==void 0&&this.eccurvename!==void 0&&d.crypto.ECDSA!==void 0&&(this.prvKey=new d.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof Ke&&this.pubkeyAlgName==="rsaandmgf1")this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof Ke&&this.pubkeyAlgName==="rsa")this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof d.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else if(this.prvKey instanceof d.crypto.DSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;return this.hSign},this.signString=function(F){return this.updateString(F),this.sign()},this.signHex=function(F){return this.updateHex(F),this.sign()},this.verify=function(F){if(this.sHashHex=this.md.digest(),this.pubKey===void 0&&this.ecpubhex!==void 0&&this.eccurvename!==void 0&&d.crypto.ECDSA!==void 0&&(this.pubKey=new d.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof Ke&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,F,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Ke&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,F);if(d.crypto.ECDSA!==void 0&&this.pubKey instanceof d.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,F);if(d.crypto.DSA!==void 0&&this.pubKey instanceof d.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,F);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(w,S){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(w){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(w){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(w){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(w){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(w){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=d.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=rt.getKey(e.prvkeypem);this.init(t)}catch(w){throw"fatal error to load pem private key: "+w}}};d.crypto.Cipher=function(e){};d.crypto.Cipher.encrypt=function(e,t,r,n){if(St(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var s=t,a=e;St(n,"key")!=null&&(s=n.key),St(n,"enc")!=null&&(hEnc=n.enc);var i=Se.enc.Hex.parse(s),c=Se.enc.Hex.parse(a),l=Se.enc.Hex.parse(n.iv),h;if(r=="des-EDE3-CBC")h=Se.TripleDES.encrypt(c,i,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")h=Se.AES.encrypt(c,i,{iv:l});else throw new Error("unsupported algorithm: "+r);return h+""}else throw new Error("Cipher.encrypt: unsupported key or algorithm")};d.crypto.Cipher.decrypt=function(e,t,r,n){if(St(n,"enclag")!=null&&(r=n.encalg),typeof r=="string"&&r.substr(-4)=="-CBC"){var s=t,a=e;St(n,"key")!=null&&(s=n.key),St(n,"enc")!=null&&(a=n.enc);var i=Se.enc.Hex.parse(s),c=Se.enc.Hex.parse(a),l=Se.enc.Hex.parse(n.iv),h;if(r=="des-EDE3-CBC")h=Se.TripleDES.decrypt({ciphertext:c},i,{iv:l});else if(r=="aes128-CBC"||r=="aes256-CBC")h=Se.AES.decrypt({ciphertext:c},i,{iv:l});else throw new Error("unsupported algorithm: "+r);return Se.enc.Hex.stringify(h)}else throw new Error("Cipher.decrypt: unsupported key or algorithm")};d.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 d>"u"||!d)&&(d={});(typeof d.crypto>"u"||!d.crypto)&&(d.crypto={});d.crypto.ECDSA=function(e){var t="secp256r1",r=null,n=null,s=null,a=Error,i=Q,c=ft,l=d.crypto.ECDSA,h=d.crypto.ECParameterDB,m=l.getName,A=Ae,p=A.getVbyListEx,f=A.isASN1HEX,E=new to,v=null;this.type="EC",this.isPrivate=!1,this.isPublic=!1;function b(w,S,F,D){for(var I=Math.max(S.bitLength(),D.bitLength()),j=w.add2D(F),q=w.curve.getInfinity(),_=I-1;_>=0;--_)q=q.twice2D(),q.z=i.ONE,S.testBit(_)?D.testBit(_)?q=q.add2D(j):q=q.add2D(w):D.testBit(_)&&(q=q.add2D(F));return q}this.getBigRandom=function(w){return new i(w.bitLength(),E).mod(w.subtract(i.ONE)).add(i.ONE)},this.setNamedCurve=function(w){this.ecparams=h.getByName(w),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=w},this.setPrivateKeyHex=function(w){this.isPrivate=!0,this.prvKeyHex=w},this.setPublicKeyHex=function(w){this.isPublic=!0,this.pubKeyHex=w},this.getPublicKeyXYHex=function(){var w=this.pubKeyHex;if(w.substr(0,2)!=="04")throw"this method supports uncompressed format(04) only";var S=this.ecparams.keycharlen;if(w.length!==2+S*2)throw"malformed public key hex length";var F={};return F.x=w.substr(2,S),F.y=w.substr(2+S),F},this.getShortNISTPCurveName=function(){var w=this.curveName;return w==="secp256r1"||w==="NIST P-256"||w==="P-256"||w==="prime256v1"?"P-256":w==="secp384r1"||w==="NIST P-384"||w==="P-384"?"P-384":w==="secp521r1"||w==="NIST P-521"||w==="P-521"?"P-521":null},this.generateKeyPairHex=function(){var w=this.ecparams.n,S=this.getBigRandom(w),F=this.ecparams.keycharlen,D=("0000000000"+S.toString(16)).slice(-F);this.setPrivateKeyHex(D);var I=this.generatePublicKeyHex();return{ecprvhex:D,ecpubhex:I}},this.generatePublicKeyHex=function(){var w=new i(this.prvKeyHex,16),S=this.ecparams.G.multiply(w),F=S.getX().toBigInteger(),D=S.getY().toBigInteger(),I=this.ecparams.keycharlen,j=("0000000000"+F.toString(16)).slice(-I),q=("0000000000"+D.toString(16)).slice(-I),_="04"+j+q;return this.setPublicKeyHex(_),_},this.signWithMessageHash=function(w){return this.signHex(w,this.prvKeyHex)},this.signHex=function(w,S){var F=new i(S,16),D=this.ecparams.n,I=new i(w.substring(0,this.ecparams.keycharlen),16);do var j=this.getBigRandom(D),q=this.ecparams.G,_=q.multiply(j),P=_.getX().toBigInteger().mod(D);while(P.compareTo(i.ZERO)<=0);var k=j.modInverse(D).multiply(I.add(F.multiply(P))).mod(D);return l.biRSSigToASN1Sig(P,k)},this.sign=function(w,S){var F=S,D=this.ecparams.n,I=i.fromByteArrayUnsigned(w);do var j=this.getBigRandom(D),q=this.ecparams.G,_=q.multiply(j),P=_.getX().toBigInteger().mod(D);while(P.compareTo(Q.ZERO)<=0);var k=j.modInverse(D).multiply(I.add(F.multiply(P))).mod(D);return this.serializeSig(P,k)},this.verifyWithMessageHash=function(w,S){return this.verifyHex(w,S,this.pubKeyHex)},this.verifyHex=function(w,S,F){try{var D,I,j=l.parseSigHex(S);D=j.r,I=j.s;var q=c.decodeFromHex(this.ecparams.curve,F),_=new i(w.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(_,D,I,q)}catch{return!1}},this.verify=function(w,S,F){var D,I;if(Bitcoin.Util.isArray(S)){var j=this.parseSig(S);D=j.r,I=j.s}else if(typeof S=="object"&&S.r&&S.s)D=S.r,I=S.s;else throw"Invalid value for signature";var q;if(F instanceof ft)q=F;else if(Bitcoin.Util.isArray(F))q=c.decodeFrom(this.ecparams.curve,F);else throw"Invalid format for pubkey value, must be byte array or ECPointFp";var _=i.fromByteArrayUnsigned(w);return this.verifyRaw(_,D,I,q)},this.verifyRaw=function(w,S,F,D){var I=this.ecparams.n,j=this.ecparams.G;if(S.compareTo(i.ONE)<0||S.compareTo(I)>=0||F.compareTo(i.ONE)<0||F.compareTo(I)>=0)return!1;var q=F.modInverse(I),_=w.multiply(q).mod(I),P=S.multiply(q).mod(I),k=j.multiply(_).add(D.multiply(P)),U=k.getX().toBigInteger().mod(I);return U.equals(S)},this.serializeSig=function(w,S){var F=w.toByteArraySigned(),D=S.toByteArraySigned(),I=[];return I.push(2),I.push(F.length),I=I.concat(F),I.push(2),I.push(D.length),I=I.concat(D),I.unshift(I.length),I.unshift(48),I},this.parseSig=function(w){var S;if(w[0]!=48)throw new Error("Signature not a valid DERSequence");if(S=2,w[S]!=2)throw new Error("First element in signature must be a DERInteger");var F=w.slice(S+2,S+2+w[S+1]);if(S+=2+w[S+1],w[S]!=2)throw new Error("Second element in signature must be a DERInteger");var D=w.slice(S+2,S+2+w[S+1]);S+=2+w[S+1];var I=i.fromByteArrayUnsigned(F),j=i.fromByteArrayUnsigned(D);return{r:I,s:j}},this.parseSigCompact=function(w){if(w.length!==65)throw"Signature has the wrong length";var S=w[0]-27;if(S<0||S>7)throw"Invalid signature type";var F=this.ecparams.n,D=i.fromByteArrayUnsigned(w.slice(1,33)).mod(F),I=i.fromByteArrayUnsigned(w.slice(33,65)).mod(F);return{r:D,s:I,i:S}},this.readPKCS5PrvKeyHex=function(w){if(f(w)===!1)throw new Error("not ASN.1 hex string");var S,F,D;try{S=p(w,0,["[0]",0],"06"),F=p(w,0,[1],"04");try{D=p(w,0,["[1]",0],"03")}catch{}}catch{throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=m(S),this.curveName===void 0)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(D),this.setPrivateKeyHex(F),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(w){if(f(w)===!1)throw new a("not ASN.1 hex string");var S,F,D,I;try{S=p(w,0,[1,0],"06"),F=p(w,0,[1,1],"06"),D=p(w,0,[2,0,1],"04");try{I=p(w,0,[2,0,"[1]",0],"03")}catch{}}catch{throw new a("malformed PKCS#8 plain ECC private key")}if(this.curveName=m(F),this.curveName===void 0)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(I),this.setPrivateKeyHex(D),this.isPublic=!1},this.readPKCS8PubKeyHex=function(w){if(f(w)===!1)throw new a("not ASN.1 hex string");var S,F,D;try{S=p(w,0,[0,0],"06"),F=p(w,0,[0,1],"06"),D=p(w,0,[1],"03")}catch{throw new a("malformed PKCS#8 ECC public key")}if(this.curveName=m(F),this.curveName===null)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(D)},this.readCertPubKeyHex=function(w,S){if(f(w)===!1)throw new a("not ASN.1 hex string");var F,D;try{F=p(w,0,[0,5,0,1],"06"),D=p(w,0,[0,5,1],"03")}catch{throw new a("malformed X.509 certificate ECC public key")}if(this.curveName=m(F),this.curveName===null)throw new a("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(D)},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))};d.crypto.ECDSA.parseSigHex=function(e){var t=d.crypto.ECDSA.parseSigHexInHexRS(e),r=new Q(t.r,16),n=new Q(t.s,16);return{r,s:n}};d.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=Ae,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 a=s[0],i=s[1];if(e.substr(a,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 c=n(e,a),l=n(e,i);return{r:c,s:l}};d.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=d.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};d.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 d.crypto.ECDSA.hexRSSigToASN1Sig(t,r)};d.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new Q(e,16),n=new Q(t,16);return d.crypto.ECDSA.biRSSigToASN1Sig(r,n)};d.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=d.asn1,n=new r.DERInteger({bigint:e}),s=new r.DERInteger({bigint:t}),a=new r.DERSequence({array:[n,s]});return a.tohex()};d.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 d>"u"||!d)&&(d={});(typeof d.crypto>"u"||!d.crypto)&&(d.crypto={});d.crypto.ECParameterDB=new function(){var e={},t={};function r(n){return new Q(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,a,i,c,l,h,m,A,p,f,E){e[n]={};var v=r(a),b=r(i),w=r(c),S=r(l),F=r(h),D=new us(v,b,w),I=D.decodePointHex("04"+m+A);e[n].name=n,e[n].keylen=s,e[n].keycharlen=Math.ceil(s/8)*2,e[n].curve=D,e[n].G=I,e[n].n=S,e[n].h=F,e[n].oid=f,e[n].info=E;for(var j=0;j<p.length;j++)t[p[j]]=n}};d.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field");d.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field");d.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field");d.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]);d.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]);d.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]);d.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]);d.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]);d.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]);d.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);(typeof d>"u"||!d)&&(d={});(typeof d.crypto>"u"||!d.crypto)&&(d.crypto={});d.crypto.DSA=function(){var e=Ae,t=e.getVbyList,r=e.getVbyListEx,n=e.isASN1HEX,s=Q;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(a,i,c,l,h){this.isPrivate=!0,this.p=a,this.q=i,this.g=c,this.y=l,this.x=h},this.setPrivateHex=function(a,i,c,l,h){var m,A,p,f,E;m=new Q(a,16),A=new Q(i,16),p=new Q(c,16),typeof l=="string"&&l.length>1?f=new Q(l,16):f=null,E=new Q(h,16),this.setPrivate(m,A,p,f,E)},this.setPublic=function(a,i,c,l){this.isPublic=!0,this.p=a,this.q=i,this.g=c,this.y=l,this.x=null},this.setPublicHex=function(a,i,c,l){var h,m,A,p;h=new Q(a,16),m=new Q(i,16),A=new Q(c,16),p=new Q(l,16),this.setPublic(h,m,A,p)},this.signWithMessageHash=function(a){var i=this.p,c=this.q,l=this.g,h=this.y,m=this.x,A=d.crypto.Util.getRandomBigIntegerMinToMax(Q.ONE.add(Q.ONE),c.subtract(Q.ONE)),p=a.substr(0,c.bitLength()/4),f=new Q(p,16),E=l.modPow(A,i).mod(c),v=A.modInverse(c).multiply(f.add(m.multiply(E))).mod(c),b=d.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:E}},{int:{bigint:v}}]});return b},this.verifyWithMessageHash=function(a,i){var c=this.p,l=this.q,h=this.g,m=this.y,A=this.parseASN1Signature(i),p=A[0],f=A[1],E=a.substr(0,l.bitLength()/4),v=new Q(E,16);if(Q.ZERO.compareTo(p)>0||p.compareTo(l)>0||Q.ZERO.compareTo(f)>=0||f.compareTo(l)>0)throw"invalid DSA signature";var b=f.modInverse(l),w=v.multiply(b).mod(l),S=p.multiply(b).mod(l),F=h.modPow(w,c).multiply(m.modPow(S,c)).mod(c).mod(l);return F.compareTo(p)==0},this.parseASN1Signature=function(a){try{var i=new s(r(a,0,[0],"02"),16),c=new s(r(a,0,[1],"02"),16);return[i,c]}catch{throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(a){var i,c,l,h,m;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{i=r(a,0,[1],"02"),c=r(a,0,[2],"02"),l=r(a,0,[3],"02"),h=r(a,0,[4],"02"),m=r(a,0,[5],"02")}catch{throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(i,c,l,h,m)},this.readPKCS8PrvKeyHex=function(a){var i,c,l,h;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{i=r(a,0,[1,1,0],"02"),c=r(a,0,[1,1,1],"02"),l=r(a,0,[1,1,2],"02"),h=r(a,0,[2,0],"02")}catch{throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(i,c,l,null,h)},this.readPKCS8PubKeyHex=function(a){var i,c,l,h;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{i=r(a,0,[0,1,0],"02"),c=r(a,0,[0,1,1],"02"),l=r(a,0,[0,1,2],"02"),h=r(a,0,[1,0],"02")}catch{throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(i,c,l,h)},this.readCertPubKeyHex=function(a,i){var c,l,h,m;if(n(a)===!1)throw new Error("not ASN.1 hex string");try{c=r(a,0,[0,5,0,1,0],"02"),l=r(a,0,[0,5,0,1,1],"02"),h=r(a,0,[0,5,0,1,2],"02"),m=r(a,0,[0,5,1,0],"02")}catch{throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(c,l,h,m)}};var rt=function(){var e=function(v,b,w){return n(Se.AES,v,b,w)},t=function(v,b,w){return n(Se.TripleDES,v,b,w)},r=function(v,b,w){return n(Se.DES,v,b,w)},n=function(v,b,w,S){var F=Se.enc.Hex.parse(b),D=Se.enc.Hex.parse(w),I=Se.enc.Hex.parse(S),j={};j.key=D,j.iv=I,j.ciphertext=F;var q=v.decrypt(j,D,{iv:I});return Se.enc.Hex.stringify(q)},s=function(v,b,w){return c(Se.AES,v,b,w)},a=function(v,b,w){return c(Se.TripleDES,v,b,w)},i=function(v,b,w){return c(Se.DES,v,b,w)},c=function(v,b,w,S){var F=Se.enc.Hex.parse(b),D=Se.enc.Hex.parse(w),I=Se.enc.Hex.parse(S),j=v.encrypt(F,D,{iv:I}),q=Se.enc.Hex.parse(j.toString()),_=Se.enc.Base64.stringify(q);return _},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:a,keylen:24,ivlen:8},"DES-CBC":{proc:r,eproc:i,keylen:8,ivlen:8}},h=function(v){return l[v].proc},m=function(v){var b=Se.lib.WordArray.random(v),w=Se.enc.Hex.stringify(b);return w},A=function(v){var b={},w=v.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));w&&(b.cipher=w[1],b.ivsalt=w[2]);var S=v.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));S&&(b.type=S[1]);var F=-1,D=0;v.indexOf(`\r
|
||
\r
|
||
`)!=-1&&(F=v.indexOf(`\r
|
||
\r
|
||
`),D=2),v.indexOf(`
|
||
|
||
`)!=-1&&(F=v.indexOf(`
|
||
|
||
`),D=1);var I=v.indexOf("-----END");if(F!=-1&&I!=-1){var j=v.substring(F+D*2,I-D);j=j.replace(/\s+/g,""),b.data=j}return b},p=function(v,b,w){for(var S=w.substring(0,16),F=Se.enc.Hex.parse(S),D=Se.enc.Utf8.parse(b),I=l[v].keylen+l[v].ivlen,j="",q=null;;){var _=Se.algo.MD5.create();if(q!=null&&_.update(q),_.update(D),_.update(F),q=_.finalize(),j=j+Se.enc.Hex.stringify(q),j.length>=I*2)break}var P={};return P.keyhex=j.substr(0,l[v].keylen*2),P.ivhex=j.substr(l[v].keylen*2,l[v].ivlen*2),P},f=function(v,b,w,S){var F=Se.enc.Base64.parse(v),D=Se.enc.Hex.stringify(F),I=l[b].proc,j=I(D,w,S);return j},E=function(v,b,w,S){var F=l[b].eproc,D=F(v,w,S);return D};return{version:"1.0.0",parsePKCS5PEM:function(v){return A(v)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(v,b,w){return p(v,b,w)},decryptKeyB64:function(v,b,w,S){return f(v,b,w,S)},getDecryptedKeyHex:function(v,b){var w=A(v),S=w.type,F=w.cipher,D=w.ivsalt,I=w.data,j=p(F,b,D),q=j.keyhex,_=f(I,F,q,D);return _},getEncryptedPKCS5PEMFromPrvKeyHex:function(v,b,w,S,F){var k="";if((typeof S>"u"||S==null)&&(S="AES-256-CBC"),typeof l[S]>"u")throw new Error("KEYUTIL unsupported algorithm: "+S);if(typeof F>"u"||F==null){var D=l[S].ivlen,I=m(D);F=I.toUpperCase()}var j=p(S,w,F),q=j.keyhex,_=E(b,S,q,F),P=_.replace(/(.{64})/g,`$1\r
|
||
`),k="-----BEGIN "+v+` PRIVATE KEY-----\r
|
||
`;return k+=`Proc-Type: 4,ENCRYPTED\r
|
||
`,k+="DEK-Info: "+S+","+F+`\r
|
||
`,k+=`\r
|
||
`,k+=P,k+=`\r
|
||
-----END `+v+` PRIVATE KEY-----\r
|
||
`,k},getEncryptedPKCS8PEM:function(v,b,w){var S=this.getEncryptedPKCS8Hex(v,b,w);return xr(S,"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(v,b,w){var S;w==null||w==null?S={}:S=JSON.parse(JSON.stringify(w)),S.plain=v,this.initPBES2Param(S),this.encryptPBES2Param(S,b);var F=this.generatePBES2ASN1Param(S);return d.asn1.ASN1Util.newObject(F).tohex()},initPBES2Param:function(v){if(St(v,"encalg")==null&&(v.encalg="aes256-CBC"),St(v,"iter")==null&&(v.iter=2048),St(v,"prf")==null&&(v.prf="hmacWithSHA256"),St(v,"salt")==null&&(v.salt=Se.enc.Hex.stringify(Se.lib.WordArray.random(8))),St(v,"enciv")==null){var b;v.encalg=="des-EDE3-CBC"&&(b=8),v.encalg=="aes128-CBC"&&(b=16),v.encalg=="aes256-CBC"&&(b=16),v.enciv=Se.enc.Hex.stringify(Se.lib.WordArray.random(b))}},encryptPBES2Param:function(v,b){var w=rt.getDKFromPBES2Param(v,b);try{var S=d.crypto.Cipher.encrypt(v.plain,w,v.encalg,{iv:v.enciv})}catch{throw new Error("encrypt error: "+v.plain+" "+w+" "+v.encalg+" "+v.enciv)}v.enc=S},generatePBES2ASN1Param:function(v){var b={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:v.salt}},{int:{hex:v2(v.iter)}}]}]},{seq:[{oid:v.encalg},{octstr:{hex:v.enciv}}]}]}]},{octstr:{hex:v.enc}}]};return v.prf!="hmacWithSHA1"&&b.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:v.prf},{null:""}]}),b},parseHexOfEncryptedPKCS8:function(v){var b=Ae,w=b.getChildIdx,S=b.getV,F={},D=w(v,0);if(D.length!=2)throw new Error("malformed format: SEQUENCE(0).items != 2: "+D.length);F.ciphertext=S(v,D[1]);var I=w(v,D[0]);if(I.length!=2)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+I.length);if(S(v,I[0])!="2a864886f70d01050d")throw new Error("this only supports pkcs5PBES2");var j=w(v,I[1]);if(I.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+j.length);var q=w(v,j[1]);if(q.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+q.length);if(S(v,q[0])!="2a864886f70d0307")throw"this only supports TripleDES";F.encryptionSchemeAlg="TripleDES",F.encryptionSchemeIV=S(v,q[1]);var _=w(v,j[0]);if(_.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+_.length);if(S(v,_[0])!="2a864886f70d01050c")throw new Error("this only supports pkcs5PBKDF2");var P=w(v,_[1]);if(P.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+P.length);F.pbkdf2Salt=S(v,P[0]);var k=S(v,P[1]);try{F.pbkdf2Iter=parseInt(k,16)}catch{throw new Error("malformed format pbkdf2Iter: "+k)}return F},getPBKDF2KeyHexFromParam:function(v,b){var w=Se.enc.Hex.parse(v.pbkdf2Salt),S=v.pbkdf2Iter,F=Se.PBKDF2(b,w,{keySize:192/32,iterations:S}),D=Se.enc.Hex.stringify(F);return D},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(v,b){var w=xt(v,"ENCRYPTED PRIVATE KEY"),S=this.parseHexOfEncryptedPKCS8(w),F=rt.getPBKDF2KeyHexFromParam(S,b),D={};D.ciphertext=Se.enc.Hex.parse(S.ciphertext);var I=Se.enc.Hex.parse(F),j=Se.enc.Hex.parse(S.encryptionSchemeIV),q=Se.TripleDES.decrypt(D,I,{iv:j}),_=Se.enc.Hex.stringify(q);return _},parsePBES2:function(v){var b=Ae.parse(v);if(St(b,"seq.0.seq.0.oid")!="pkcs5PBES2"||St(b,"seq.0.seq.1.seq.0.seq.0.oid")!="pkcs5PBKDF2")throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var w=St(b,"seq.0.seq.1.seq.0.seq.1.seq");if(w==null)throw new Error("PBKDF2 parameter not found");var S=St(w,"0.octstr.hex"),F=St(w,"1.int.hex"),D=St(w,"2.seq.0.oid","hmacWithSHA1"),I=-1;try{I=parseInt(F,16)}catch{throw new Error("iter not proper value")}var j=St(b,"seq.0.seq.1.seq.1.seq.0.oid"),q=St(b,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),_=St(b,"seq.1.octstr.hex");if(j==null||q==null||_==null)throw new Error("encalg, enciv or enc is undefined");var P={salt:S,iter:I,prf:D,encalg:j,enciv:q,enc:_};return P},getDKFromPBES2Param:function(v,b){var w={hmacWithSHA1:Se.algo.SHA1,hmacWithSHA224:Se.algo.SHA224,hmacWithSHA256:Se.algo.SHA256,hmacWithSHA384:Se.algo.SHA384,hmacWithSHA512:Se.algo.SHA512},S={"des-EDE3-CBC":192/32,"aes128-CBC":128/32,"aes256-CBC":256/32},F=w[v.prf];if(F==null)throw new Error("unsupported prf");var D=S[v.encalg];if(D==null)throw new Error("unsupported encalg");var I=Se.enc.Hex.parse(v.salt),j=v.iter;try{var q=Se.PBKDF2(b,I,{keySize:D,iterations:j,hasher:F});return Se.enc.Hex.stringify(q)}catch(_){throw new Error("PBKDF2 error: "+_+" "+JSON.stringify(v)+" "+b)}},getPlainHexFromEncryptedPKCS8PEM:function(v,b){if(v.indexOf("BEGIN ENCRYPTED PRIVATE KEY")==-1)throw new Error("not Encrypted PKCS#8 PEM string");var w=xt(v),S;try{S=rt.parsePBES2(w)}catch(D){throw new Error("malformed PBES2 format: "+D.message)}var F=rt.getDKFromPBES2Param(S,b);return d.crypto.Cipher.decrypt(S.enc,F,S.encalg,{iv:S.enciv})},getKeyFromEncryptedPKCS8PEM:function(v,b){var w=this.getPlainHexFromEncryptedPKCS8PEM(v,b),S=this.getKeyFromPlainPrivatePKCS8Hex(w);return S},parsePlainPrivatePKCS8Hex:function(v){var b=Ae,w=b.getChildIdx,S=b.getV,F={};if(F.algparam=null,v.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var D=w(v,0);if(D.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(v.substr(D[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var I=w(v,D[1]);if(I.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(v.substr(I[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(F.algoid=S(v,I[0]),v.substr(I[1],2)=="06"&&(F.algparam=S(v,I[1])),v.substr(D[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return F.keyidx=b.getVidx(v,D[2]),F},getKeyFromPlainPrivatePKCS8PEM:function(v){var b=xt(v,"PRIVATE KEY"),w=this.getKeyFromPlainPrivatePKCS8Hex(b);return w},getKeyFromPlainPrivatePKCS8Hex:function(v){var b=this.parsePlainPrivatePKCS8Hex(v),w;if(b.algoid=="2a864886f70d010101")w=new Ke;else if(b.algoid=="2a8648ce380401")w=new d.crypto.DSA;else if(b.algoid=="2a8648ce3d0201")w=new d.crypto.ECDSA;else throw new Error("unsupported private key algorithm");return w.readPKCS8PrvKeyHex(v),w},_getKeyFromPublicPKCS8Hex:function(v){var b,w=Ae.getVbyList(v,0,[0,0],"06");if(w==="2a864886f70d010101")b=new Ke;else if(w==="2a8648ce380401")b=new d.crypto.DSA;else if(w==="2a8648ce3d0201")b=new d.crypto.ECDSA;else throw new Error("unsupported PKCS#8 public key hex");return b.readPKCS8PubKeyHex(v),b},parsePublicRawRSAKeyHex:function(v){var b=Ae,w=b.getChildIdx,S=b.getV,F={};if(v.substr(0,2)!="30")throw new Error("malformed RSA key(code:001)");var D=w(v,0);if(D.length!=2)throw new Error("malformed RSA key(code:002)");if(v.substr(D[0],2)!="02")throw new Error("malformed RSA key(code:003)");if(F.n=S(v,D[0]),v.substr(D[1],2)!="02")throw new Error("malformed RSA key(code:004)");return F.e=S(v,D[1]),F},parsePublicPKCS8Hex:function(v){var b=Ae,w=b.getChildIdx,S=b.getV,F={};F.algparam=null;var D=w(v,0);if(D.length!=2)throw new Error("outer DERSequence shall have 2 elements: "+D.length);var I=D[0];if(v.substr(I,2)!="30")throw new Error("malformed PKCS8 public key(code:001)");var j=w(v,I);if(j.length!=2)throw new Error("malformed PKCS8 public key(code:002)");if(v.substr(j[0],2)!="06")throw new Error("malformed PKCS8 public key(code:003)");if(F.algoid=S(v,j[0]),v.substr(j[1],2)=="06"?F.algparam=S(v,j[1]):v.substr(j[1],2)=="30"&&(F.algparam={},F.algparam.p=b.getVbyList(v,j[1],[0],"02"),F.algparam.q=b.getVbyList(v,j[1],[1],"02"),F.algparam.g=b.getVbyList(v,j[1],[2],"02")),v.substr(D[1],2)!="03")throw new Error("malformed PKCS8 public key(code:004)");return F.key=S(v,D[1]).substr(2),F}}}();rt.getKey=function(e,t,r){var n=Ae,s=n.getChildIdx,a=n.getV,i=n.getVbyList,c=d.crypto,l=c.ECDSA,h=c.DSA,m=Ke,A=xt,p=rt;if(typeof m<"u"&&e instanceof m||typeof l<"u"&&e instanceof l||typeof h<"u"&&e instanceof h)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 f=new m;return f.setPublic(e.n,e.e),f}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 f=new m;return f.setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),f}if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p===void 0){var f=new m;return f.setPrivate(e.n,e.e,e.d),f}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x===void 0){var f=new h;return f.setPublic(e.p,e.q,e.g,e.y),f}if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x!==void 0){var f=new h;return f.setPrivate(e.p,e.q,e.g,e.y,e.x),f}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d===void 0){var f=new m;return f.setPublic(Bt(e.n),Bt(e.e)),f}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 f=new m;return f.setPrivateEx(Bt(e.n),Bt(e.e),Bt(e.d),Bt(e.p),Bt(e.q),Bt(e.dp),Bt(e.dq),Bt(e.qi)),f}if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0){var f=new m;return f.setPrivate(Bt(e.n),Bt(e.e),Bt(e.d)),f}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d===void 0){var E=new l({curve:e.crv}),v=E.ecparams.keycharlen,b=("0000000000"+Bt(e.x)).slice(-v),w=("0000000000"+Bt(e.y)).slice(-v),S="04"+b+w;return E.setPublicKeyHex(S),E}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d!==void 0){var E=new l({curve:e.crv}),v=E.ecparams.keycharlen,b=("0000000000"+Bt(e.x)).slice(-v),w=("0000000000"+Bt(e.y)).slice(-v),S="04"+b+w,F=("0000000000"+Bt(e.d)).slice(-v);return E.setPublicKeyHex(S),E.setPrivateKeyHex(F),E}if(r==="pkcs5prv"){var D=e,n=Ae,I,f;if(I=s(D,0),I.length===9)f=new m,f.readPKCS5PrvKeyHex(D);else if(I.length===6)f=new h,f.readPKCS5PrvKeyHex(D);else if(I.length>2&&D.substr(I[1],2)==="04")f=new l,f.readPKCS5PrvKeyHex(D);else throw new Error("unsupported PKCS#1/5 hexadecimal key");return f}if(r==="pkcs8prv"){var f=p.getKeyFromPlainPrivatePKCS8Hex(e);return f}if(r==="pkcs8pub")return p._getKeyFromPublicPKCS8Hex(e);if(r==="x509pub")return Ne.getPublicKeyFromCertHex(e);if(e.indexOf("-END CERTIFICATE-",0)!=-1||e.indexOf("-END X509 CERTIFICATE-",0)!=-1||e.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ne.getPublicKeyFromCertPEM(e);if(e.indexOf("-END PUBLIC KEY-")!=-1){var j=xt(e,"PUBLIC KEY");return p._getKeyFromPublicPKCS8Hex(j)}if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var q=A(e,"RSA PRIVATE KEY");return p.getKey(q,null,"pkcs5prv")}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var _=A(e,"DSA PRIVATE KEY"),P=i(_,0,[1],"02"),k=i(_,0,[2],"02"),U=i(_,0,[3],"02"),M=i(_,0,[4],"02"),W=i(_,0,[5],"02"),f=new h;return f.setPrivate(new Q(P,16),new Q(k,16),new Q(U,16),new Q(M,16),new Q(W,16)),f}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var q=A(e,"EC PRIVATE KEY");return p.getKey(q,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 K=p.getDecryptedKeyHex(e,t),V=new Ke;return V.readPKCS5PrvKeyHex(K),V}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var _=p.getDecryptedKeyHex(e,t),f=i(_,0,[1],"04"),z=i(_,0,[2,0],"06"),ne=i(_,0,[3,0],"03").substr(2),Ee="";if(d.crypto.OID.oidhex2name[z]!==void 0)Ee=d.crypto.OID.oidhex2name[z];else throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+z);var E=new l({curve:Ee});return E.setPublicKeyHex(ne),E.setPrivateKeyHex(f),E.isPublic=!1,E}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var _=p.getDecryptedKeyHex(e,t),P=i(_,0,[1],"02"),k=i(_,0,[2],"02"),U=i(_,0,[3],"02"),M=i(_,0,[4],"02"),W=i(_,0,[5],"02"),f=new h;return f.setPrivate(new Q(P,16),new Q(k,16),new Q(U,16),new Q(M,16),new Q(W,16)),f}if(e.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return p.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")};rt.generateKeypair=function(e,t){if(e=="RSA"){var r=t,n=new Ke;n.generate(r,"10001"),n.isPrivate=!0,n.isPublic=!0;var s=new Ke,a=n.n.toString(16),i=n.e.toString(16);s.setPublic(a,i),s.isPrivate=!1,s.isPublic=!0;var c={};return c.prvKeyObj=n,c.pubKeyObj=s,c}else if(e=="EC"){var l=t,h=new d.crypto.ECDSA({curve:l}),m=h.generateKeyPairHex(),n=new d.crypto.ECDSA({curve:l});n.setPublicKeyHex(m.ecpubhex),n.setPrivateKeyHex(m.ecprvhex),n.isPrivate=!0,n.isPublic=!1;var s=new d.crypto.ECDSA({curve:l});s.setPublicKeyHex(m.ecpubhex),s.isPrivate=!1,s.isPublic=!0;var c={};return c.prvKeyObj=n,c.pubKeyObj=s,c}else throw new Error("unknown algorithm: "+e)};rt.getPEM=function(e,t,r,n,s,a){var i=d,c=i.asn1,l=c.DERObjectIdentifier,h=c.DERInteger,m=c.ASN1Util.newObject,A=c.x509,p=A.SubjectPublicKeyInfo,f=i.crypto,E=f.DSA,v=f.ECDSA,b=Ke;function w(V){var z=m({seq:[{int:0},{int:{bigint:V.n}},{int:V.e},{int:{bigint:V.d}},{int:{bigint:V.p}},{int:{bigint:V.q}},{int:{bigint:V.dmp1}},{int:{bigint:V.dmq1}},{int:{bigint:V.coeff}}]});return z}function S(V){var z=m({seq:[{int:1},{octstr:{hex:V.prvKeyHex}},{tag:["a0",!0,{oid:{name:V.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+V.pubKeyHex}}]}]});return z}function F(V){var z=m({seq:[{int:0},{int:{bigint:V.p}},{int:{bigint:V.q}},{int:{bigint:V.g}},{int:{bigint:V.y}},{int:{bigint:V.x}}]});return z}if((b!==void 0&&e instanceof b||E!==void 0&&e instanceof E||v!==void 0&&e instanceof v)&&e.isPublic==!0&&(t===void 0||t=="PKCS8PUB")){var D=new p(e),I=D.tohex();return xr(I,"PUBLIC KEY")}if(t=="PKCS1PRV"&&b!==void 0&&e instanceof b&&(r===void 0||r==null)&&e.isPrivate==!0){var D=w(e),I=D.tohex();return xr(I,"RSA PRIVATE KEY")}if(t=="PKCS1PRV"&&v!==void 0&&e instanceof v&&(r===void 0||r==null)&&e.isPrivate==!0){var j=new l({name:e.curveName}),q=j.tohex(),_=S(e),P=_.tohex(),k="";return k+=xr(q,"EC PARAMETERS"),k+=xr(P,"EC PRIVATE KEY"),k}if(t=="PKCS1PRV"&&E!==void 0&&e instanceof E&&(r===void 0||r==null)&&e.isPrivate==!0){var D=F(e),I=D.tohex();return xr(I,"DSA PRIVATE KEY")}if(t=="PKCS5PRV"&&b!==void 0&&e instanceof b&&r!==void 0&&r!=null&&e.isPrivate==!0){var D=w(e),I=D.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",I,r,n,a)}if(t=="PKCS5PRV"&&v!==void 0&&e instanceof v&&r!==void 0&&r!=null&&e.isPrivate==!0){var D=S(e),I=D.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",I,r,n,a)}if(t=="PKCS5PRV"&&E!==void 0&&e instanceof E&&r!==void 0&&r!=null&&e.isPrivate==!0){var D=F(e),I=D.tohex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",I,r,n,a)}var U=function(V,z){if(typeof z=="string")return rt.getEncryptedPKCS8PEM(V,z);if(typeof z=="object"&&St(z,"passcode")!=null){var ne=JSON.parse(JSON.stringify(z)),Ee=ne.passcode;return delete ne.passcode,rt.getEncryptedPKCS8PEM(V,Ee,ne)}};if(t=="PKCS8PRV"&&b!=null&&e instanceof b&&e.isPrivate==!0){var M=w(e),W=M.tohex(),D=m({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:W}}]}),I=D.tohex();return r===void 0||r==null?xr(I,"PRIVATE KEY"):U(I,r)}if(t=="PKCS8PRV"&&v!==void 0&&e instanceof v&&e.isPrivate==!0){var K={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};typeof e.pubKeyHex=="string"&&K.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});var M=new m(K),W=M.tohex(),D=m({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:W}}]}),I=D.tohex();return r===void 0||r==null?xr(I,"PRIVATE KEY"):U(I,r)}if(t=="PKCS8PRV"&&E!==void 0&&e instanceof E&&e.isPrivate==!0){var M=new h({bigint:e.x}),W=M.tohex(),D=m({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:W}}]}),I=D.tohex();return r===void 0||r==null?xr(I,"PRIVATE KEY"):U(I,r)}throw new Error("unsupported object nor format")};rt.getKeyFromCSRPEM=function(e){var t=xt(e,"CERTIFICATE REQUEST"),r=rt.getKeyFromCSRHex(t);return r};rt.getKeyFromCSRHex=function(e){var t=rt.parseCSRHex(e),r=rt.getKey(t.p8pubkeyhex,null,"pkcs8pub");return r};rt.parseCSRHex=function(e){var t=Ae,r=t.getChildIdx,n=t.getTLV,s={},a=e;if(a.substr(0,2)!="30")throw new Error("malformed CSR(code:001)");var i=r(a,0);if(i.length<1)throw new Error("malformed CSR(code:002)");if(a.substr(i[0],2)!="30")throw new Error("malformed CSR(code:003)");var c=r(a,i[0]);if(c.length<3)throw new Error("malformed CSR(code:004)");return s.p8pubkeyhex=n(a,c[2]),s};rt.getKeyID=function(e){var t=rt,r=Ae;typeof e=="string"&&e.indexOf("BEGIN ")!=-1&&(e=t.getKey(e));var n=xt(t.getPEM(e)),s=r.getIdxbyList(n,0,[1]),a=r.getV(n,s).substring(2);return d.crypto.Util.hashHex(a,"sha1")};rt.getJWK=function(e,t,r,n,s){var a,i={},c,l=d.crypto.Util.hashHex;if(typeof e=="string")a=rt.getKey(e),e.indexOf("CERTIFICATE")!=-1&&(c=xt(e));else if(typeof e=="object")e instanceof Ne?(a=e.getPublicKey(),c=e.hex):a=e;else throw new Error("unsupported keyinfo type");if(a instanceof Ke&&a.isPrivate)i.kty="RSA",i.n=nr(a.n.toString(16)),i.e=nr(a.e.toString(16)),i.d=nr(a.d.toString(16)),i.p=nr(a.p.toString(16)),i.q=nr(a.q.toString(16)),i.dp=nr(a.dmp1.toString(16)),i.dq=nr(a.dmq1.toString(16)),i.qi=nr(a.coeff.toString(16));else if(a instanceof Ke&&a.isPublic)i.kty="RSA",i.n=nr(a.n.toString(16)),i.e=nr(a.e.toString(16));else if(a instanceof d.crypto.ECDSA&&a.isPrivate){var h=a.getShortNISTPCurveName();if(h!=="P-256"&&h!=="P-384"&&h!=="P-521")throw new Error("unsupported curve name for JWT: "+h);var m=a.getPublicKeyXYHex();i.kty="EC",i.crv=h,i.x=nr(m.x),i.y=nr(m.y),i.d=nr(a.prvKeyHex)}else if(a instanceof d.crypto.ECDSA&&a.isPublic){var h=a.getShortNISTPCurveName();if(h!=="P-256"&&h!=="P-384"&&h!=="P-521")throw new Error("unsupported curve name for JWT: "+h);var m=a.getPublicKeyXYHex();i.kty="EC",i.crv=h,i.x=nr(m.x),i.y=nr(m.y)}if(i.kty==null)throw new Error("unsupported keyinfo");return!a.isPrivate&&t!=!0&&(i.kid=d.jws.JWS.getJWKthumbprint(i)),c!=null&&r!=!0&&(i.x5c=[as(c)]),c!=null&&n!=!0&&(i.x5t=Ju(as(l(c,"sha1")))),c!=null&&s!=!0&&(i["x5t#S256"]=Ju(as(l(c,"sha256")))),i};rt.getJWKFromKey=function(e){return rt.getJWK(e,!0,!0,!0,!0)};Ke.getPosArrayOfChildrenFromHex=function(e){return Ae.getChildIdx(e,0)};Ke.getHexValueArrayOfChildrenFromHex=function(e){var t=Ae,r=t.getV,p=Ke.getPosArrayOfChildrenFromHex(e),n=r(e,p[0]),s=r(e,p[1]),a=r(e,p[2]),i=r(e,p[3]),c=r(e,p[4]),l=r(e,p[5]),h=r(e,p[6]),m=r(e,p[7]),A=r(e,p[8]),p=new Array;return p.push(n,s,a,i,c,l,h,m,A),p};Ke.prototype.readPrivateKeyFromPEMString=function(e){var t=xt(e),r=Ke.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])};Ke.prototype.readPKCS5PrvKeyHex=function(e){var t=Ke.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ke.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,s,a,i,c,l,h=Ae,m=h.getVbyListEx;if(h.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");try{t=m(e,0,[2,0,1],"02"),r=m(e,0,[2,0,2],"02"),n=m(e,0,[2,0,3],"02"),s=m(e,0,[2,0,4],"02"),a=m(e,0,[2,0,5],"02"),i=m(e,0,[2,0,6],"02"),c=m(e,0,[2,0,7],"02"),l=m(e,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,s,a,i,c,l)};Ke.prototype.readPKCS5PubKeyHex=function(e){var t=Ae,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]),a=r(e,n[1]);this.setPublic(s,a)};Ke.prototype.readPKCS8PubKeyHex=function(e){var t=Ae;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)};Ke.prototype.readCertPubKeyHex=function(e,t){var r,n;r=new Ne,r.readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var l$=new RegExp("[^0-9a-f]","gi");function y2(e,t){for(var r="",n=t/4-e.length,s=0;s<n;s++)r=r+"0";return r+e}Ke.prototype.sign=function(e,t){var r=function(s){return d.crypto.Util.hashString(s,t)},n=r(e);return this.signWithMessageHash(n,t)};Ke.prototype.signWithMessageHash=function(e,t){var r=d.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),n=un(r,16),s=this.doPrivate(n),a=s.toString(16);return y2(a,this.n.bitLength())};function S2(e,t,r){for(var n="",s=0;n.length<t;)n+=cn(r(Ci(e+String.fromCharCode.apply(String,[(s&4278190080)>>24,(s&16711680)>>16,(s&65280)>>8,s&255])))),s+=1;return n}Ke.prototype.signPSS=function(e,t,r){var n=function(a){return d.crypto.Util.hashHex(a,t)},s=n(Ci(e));return r===void 0&&(r=-1),this.signWithMessageHashPSS(s,t,r)};Ke.prototype.signWithMessageHashPSS=function(e,t,r){var n=cn(e),s=n.length,a=this.n.bitLength()-1,i=Math.ceil(a/8),c,l=function(b){return d.crypto.Util.hashHex(b,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 h="";r>0&&(h=new Array(r),new to().nextBytes(h),h=String.fromCharCode.apply(String,h));var m=cn(l(Ci("\0\0\0\0\0\0\0\0"+n+h))),A=[];for(c=0;c<i-r-s-2;c+=1)A[c]=0;var p=String.fromCharCode.apply(String,A)+""+h,f=S2(m,p.length,l),E=[];for(c=0;c<p.length;c+=1)E[c]=p.charCodeAt(c)^f.charCodeAt(c);var v=65280>>8*i-a&255;for(E[0]&=~v,c=0;c<s;c++)E.push(m.charCodeAt(c));return E.push(188),y2(this.doPrivate(new Q(E)).toString(16),this.n.bitLength())};function b2(e){for(var t in d.crypto.Util.DIGESTINFOHEAD){var r=d.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r){var s=[t,e.substring(n)];return s}}return[]}Ke.prototype.verify=function(e,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var r=un(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var s=this.doPublic(r),a=s.toString(16);if(a.length+3!=n/4)return!1;var i=a.replace(/^1f+00/,""),c=b2(i);if(c.length==0)return!1;var l=c[0],h=c[1],m=function(p){return d.crypto.Util.hashString(p,l)},A=m(e);return h==A};Ke.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=un(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=this.doPublic(r),s=n.toString(16).replace(/^1f+00/,""),a=b2(s);if(a.length==0)return!1;var i=a[0],c=a[1];return c==e};Ke.prototype.verifyPSS=function(e,t,r,n){var s=function(i){return d.crypto.Util.hashHex(i,r)},a=s(Ci(e));return n===void 0&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)};Ke.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var s=new Q(t,16),a=function(S){return d.crypto.Util.hashHex(S,r)},i=cn(e),c=i.length,l=this.n.bitLength()-1,h=Math.ceil(l/8),m;if(n===-1||n===void 0)n=c;else if(n===-2)n=h-c-2;else if(n<-2)throw new Error("invalid salt length");if(h<c+n+2)throw new Error("data too long");var A=this.doPublic(s).toByteArray();for(m=0;m<A.length;m+=1)A[m]&=255;for(;A.length<h;)A.unshift(0);if(A[h-1]!==188)throw new Error("encoded message does not end in 0xbc");A=String.fromCharCode.apply(String,A);var p=A.substr(0,h-c-1),f=A.substr(p.length,c),E=65280>>8*h-l&255;if(p.charCodeAt(0)&E)throw new Error("bits beyond keysize not zero");var v=S2(f,p.length,a),b=[];for(m=0;m<p.length;m+=1)b[m]=p.charCodeAt(m)^v.charCodeAt(m);b[0]&=~E;var w=h-c-n-2;for(m=0;m<w;m+=1)if(b[m]!==0)throw new Error("leftmost octets not zero");if(b[w]!==1)throw new Error("0x01 marker not found");return f===cn(a(Ci("\0\0\0\0\0\0\0\0"+i+String.fromCharCode.apply(String,b.slice(-n)))))};Ke.SALT_LEN_HLEN=-1;Ke.SALT_LEN_MAX=-2;Ke.SALT_LEN_RECOVER=-2;function Ne(e){var t=Ae,r=t.getChildIdx,n=t.getV,s=t.dump,a=t.parse,i=t.getTLV,c=t.getVbyList,l=t.getVbyListEx,h=t.getTLVbyList,m=t.getTLVbyListEx,A=t.getIdxbyList,p=t.getIdxbyListEx,f=t.getVidx,E=t.getInt,v=t.oidname,b=t.hextooidstr,w=Ne,S=xt,F,D=Error;try{F=d.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 _=h(this.hex,0,[0,0]);if(_.substr(0,2)=="a0"){var P=h(_,0,[0]),k=E(P,0);if(k<0||2<k)throw new Error("malformed version field");return this.version=k+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 _=m(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(_)},this.getAlgorithmIdentifierName=function(_){for(var P in F)if(_===F[P])return P;return v(l(_,0,[0],"06"))},this.getIssuer=function(_,P){return this.getX500Name(this.getIssuerHex(),_,P)},this.getIssuerHex=function(){return h(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var _=this.getIssuer();return _.str},this.getSubject=function(_,P){return this.getX500Name(this.getSubjectHex(),_,P)},this.getSubjectHex=function(){return h(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var _=this.getSubject();return _.str},this.getNotBefore=function(){var _=c(this.hex,0,[0,4+this.foffset,0]);return _=_.replace(/(..)/g,"%$1"),_=decodeURIComponent(_),_},this.getNotAfter=function(){var _=c(this.hex,0,[0,4+this.foffset,1]);return _=_.replace(/(..)/g,"%$1"),_=decodeURIComponent(_),_},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var _=this.getSPKI();return _==null?null:c(_,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return A(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var _=this.getPublicKeyIdx();return A(this.hex,_,[1,0],"30")},this.getPublicKey=function(){return rt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var _=h(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(_)},this.getSignatureValueHex=function(){return c(this.hex,0,[2],"03",!0)},this.verifySignature=function(_){var P=this.getSignatureAlgorithmField(),k=this.getSignatureValueHex(),U=h(this.hex,0,[0],"30"),M=new d.crypto.Signature({alg:P});return M.init(_),M.updateHex(U),M.verify(k)},this.parseExt=function(_){var P,k,U;if(_===void 0){if(U=this.hex,this.version!==3)return-1;P=A(U,0,[0,7,0],"30"),k=r(U,P)}else{U=xt(_);var M=A(U,0,[0,3,0,0],"06");if(n(U,M)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}P=A(U,0,[0,3,0,1,0],"30"),k=r(U,P),this.hex=U}this.aExtInfo=new Array;for(var W=0;W<k.length;W++){var K={};K.critical=!1;var V=r(U,k[W]),z=0;V.length===3&&(K.critical=!0,z=1),K.oid=t.hextooidstr(c(U,k[W],[0],"06"));var ne=A(U,k[W],[1+z]);K.vidx=f(U,ne),this.aExtInfo.push(K)}},this.getExtInfo=function(_){var P=this.aExtInfo,k=_;if(_.match(/^[0-9.]+$/)||(k=d.asn1.x509.OID.name2oid(_)),k!==""){for(var U=0;U<P.length;U++)if(P[U].oid===k)return P[U]}},this.getCriticalExtV=function(_,P,k){if(P!=null)return[P,k];var U=this.getExtInfo(_);return U==null?[null,null]:[i(this.hex,U.vidx),U.critical]},this.getExtBasicConstraints=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("basicConstraints");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"basicConstraints"};if(P&&(U.critical=!0),_==="3000")return U;if(_==="30030101ff")return U.cA=!0,U;if(_.substr(0,12)==="30060101ff02"){var M=n(_,10),W=parseInt(M,16);return U.cA=!0,U.pathLen=W,U}throw new Error("hExtV parse error: "+_)},this.getExtNameConstraints=function(_,P){var k=this.getCriticalExtV("nameConstraints",_,P);if(_=k[0],P=k[1],_!=null){var U={extname:"nameConstraints"};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++){for(var K=[],V=r(_,M[W]),z=0;z<V.length;z++){var ne=i(_,V[z]),Ee=this.getGeneralSubtree(ne);K.push(Ee)}var we=_.substr(M[W],2);we=="a0"?U.permit=K:we=="a1"&&(U.exclude=K)}return U}},this.getGeneralSubtree=function(_){var P=r(_,0),k=P.length;if(k<1||2<k)throw new Error("wrong num elements");for(var U=this.getGeneralName(i(_,P[0])),M=1;M<k;M++){var W=_.substr(P[M],2),K=n(_,P[M]),V=parseInt(K,16);W=="80"&&(U.min=V),W=="81"&&(U.max=V)}return U},this.getExtKeyUsage=function(_,P){var k=this.getCriticalExtV("keyUsage",_,P);if(_=k[0],P=k[1],_!=null){var U={extname:"keyUsage"};return P&&(U.critical=!0),U.names=this.getExtKeyUsageString(_).split(","),U}},this.getExtKeyUsageBin=function(_){if(_===void 0){var P=this.getExtInfo("keyUsage");if(P===void 0)return"";_=i(this.hex,P.vidx)}if(_.length!=8&&_.length!=10)throw new Error("malformed key usage value: "+_);var k="000000000000000"+parseInt(_.substr(6),16).toString(2);return _.length==8&&(k=k.slice(-8)),_.length==10&&(k=k.slice(-16)),k=k.replace(/0+$/,""),k==""&&(k="0"),k},this.getExtKeyUsageString=function(_){for(var P=this.getExtKeyUsageBin(_),k=new Array,U=0;U<P.length;U++)P.substr(U,1)=="1"&&k.push(Ne.KEYUSAGE_NAME[U]);return k.join(",")},this.getExtSubjectKeyIdentifier=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("subjectKeyIdentifier");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"subjectKeyIdentifier"};P&&(U.critical=!0);var M=n(_,0);return U.kid={hex:M},U},this.getExtAuthorityKeyIdentifier=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("authorityKeyIdentifier");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"authorityKeyIdentifier"};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++){var K=_.substr(M[W],2);if(K==="80"&&(U.kid={hex:n(_,M[W])}),K==="a1"){var V=i(_,M[W]),z=this.getGeneralNames(V);U.issuer=z[0].dn}K==="82"&&(U.sn={hex:n(_,M[W])})}return U},this.getExtExtKeyUsage=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("extKeyUsage");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"extKeyUsage",array:[]};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++)U.array.push(v(n(_,M[W])));return U},this.getExtExtKeyUsageName=function(){var _=this.getExtInfo("extKeyUsage");if(_===void 0)return _;var P=new Array,k=i(this.hex,_.vidx);if(k==="")return P;for(var U=r(k,0),M=0;M<U.length;M++)P.push(v(n(k,U[M])));return P},this.getExtSubjectAltName=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("subjectAltName");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"subjectAltName",array:[]};return P&&(U.critical=!0),U.array=this.getGeneralNames(_),U},this.getExtIssuerAltName=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("issuerAltName");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"issuerAltName",array:[]};return P&&(U.critical=!0),U.array=this.getGeneralNames(_),U},this.getGeneralNames=function(_){for(var P=r(_,0),k=[],U=0;U<P.length;U++){var M=this.getGeneralName(i(_,P[U]));M!==void 0&&k.push(M)}return k},this.getGeneralName=function(_){var P=_.substr(0,2),k=n(_,0),U=cn(k);if(P=="81")return{rfc822:U};if(P=="82")return{dns:U};if(P=="86")return{uri:U};if(P=="87")return{ip:mf(k)};if(P=="a4")return{dn:this.getX500Name(k)};if(P=="a0")return{other:this.getOtherName(_)}},this.getExtSubjectAltName2=function(){var _,P,k,U=this.getExtInfo("subjectAltName");if(U===void 0)return U;for(var M=new Array,W=i(this.hex,U.vidx),K=r(W,0),V=0;V<K.length;V++)k=W.substr(K[V],2),_=n(W,K[V]),k==="81"&&(P=vt(_),M.push(["MAIL",P])),k==="82"&&(P=vt(_),M.push(["DNS",P])),k==="84"&&(P=Ne.hex2dn(_,0),M.push(["DN",P])),k==="86"&&(P=vt(_),M.push(["URI",P])),k==="87"&&(P=mf(_),M.push(["IP",P]));return M},this.getExtCRLDistributionPoints=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("cRLDistributionPoints");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"cRLDistributionPoints",array:[]};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++){var K=i(_,M[W]);U.array.push(this.getDistributionPoint(K))}return U},this.getDistributionPoint=function(_){for(var P={},k=r(_,0),U=0;U<k.length;U++){var M=_.substr(k[U],2),W=i(_,k[U]);M=="a0"&&(P.dpname=this.getDistributionPointName(W))}return P},this.getDistributionPointName=function(_){for(var P={},k=r(_,0),U=0;U<k.length;U++){var M=_.substr(k[U],2),W=i(_,k[U]);M=="a0"&&(P.full=this.getGeneralNames(W))}return P},this.getExtCRLDistributionPointsURI=function(){var _=this.getExtCRLDistributionPoints();if(_==null)return _;for(var P=_.array,k=[],U=0;U<P.length;U++)try{P[U].dpname.full[0].uri!=null&&k.push(P[U].dpname.full[0].uri)}catch{}return k},this.getExtAIAInfo=function(){var _=this.getExtInfo("authorityInfoAccess");if(_===void 0)return _;for(var P={ocsp:[],caissuer:[]},k=r(this.hex,_.vidx),U=0;U<k.length;U++){var M=c(this.hex,k[U],[0],"06"),W=c(this.hex,k[U],[1],"86");M==="2b06010505073001"&&P.ocsp.push(vt(W)),M==="2b06010505073002"&&P.caissuer.push(vt(W))}return P},this.getExtAuthorityInfoAccess=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("authorityInfoAccess");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"authorityInfoAccess",array:[]};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++){var K=l(_,M[W],[0],"06"),V=c(_,M[W],[1],"86"),z=vt(V);if(K=="2b06010505073001")U.array.push({ocsp:z});else if(K=="2b06010505073002")U.array.push({caissuer:z});else throw new Error("unknown method: "+K)}return U},this.getExtCertificatePolicies=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("certificatePolicies");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"certificatePolicies",array:[]};P&&(U.critical=!0);for(var M=r(_,0),W=0;W<M.length;W++){var K=i(_,M[W]),V=this.getPolicyInformation(K);U.array.push(V)}return U},this.getPolicyInformation=function(_){var P={},k=c(_,0,[0],"06");P.policyoid=v(k);var U=p(_,0,[1],"30");if(U!=-1){P.array=[];for(var M=r(_,U),W=0;W<M.length;W++){var K=i(_,M[W]),V=this.getPolicyQualifierInfo(K);P.array.push(V)}}return P},this.getOtherName=function(_){var P={},k=r(_,0),U=c(_,k[0],[],"06"),M=c(_,k[1],[]);return P.oid=v(U),P.value=a(M),P},this.getPolicyQualifierInfo=function(_){var P={},k=c(_,0,[0],"06");if(k==="2b06010505070201"){var U=l(_,0,[1],"16");P.cps=cn(U)}else if(k==="2b06010505070202"){var M=h(_,0,[1],"30");P.unotice=this.getUserNotice(M)}return P},this.getUserNotice=function(_){var P=null,k={};try{P=t.parse(_);var U=this._asn1ToUnotice(P);return U}catch{return}},this._asn1ToUnotice=function(_){try{for(var P={},k=St(_,"seq"),U=0;U<k.length;U++){var M=this._asn1ToNoticeRef(k[U]);M!=null&&(P.noticeref=M);var W=this.asn1ToDisplayText(k[U]);W!=null&&(P.exptext=W)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeRef=function(_){try{for(var P={},k=St(_,"seq"),U=0;U<k.length;U++){var M=this._asn1ToNoticeNum(k[U]);M!=null&&(P.noticenum=M);var W=this.asn1ToDisplayText(k[U]);W!=null&&(P.org=W)}return Object.keys(P).length>0?P:void 0}catch{return}},this._asn1ToNoticeNum=function(_){try{for(var P=St(_,"seq"),k=[],U=0;U<P.length;U++){var M=P[U];k.push(parseInt(St(M,"int.hex"),16))}return k}catch{return}},this.getDisplayText=function(_){var P={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},k={};return k.type=P[_.substr(0,2)],k.str=cn(n(_,0)),k},this.asn1ToDisplayText=function(_){if(_.utf8str!=null)return{type:"utf8",str:_.utf8str.str};if(_.ia5str!=null)return{type:"ia5",str:_.ia5str.str};if(_.visstr!=null)return{type:"vis",str:_.visstr.str};if(_.bmpstr!=null)return{type:"bmp",str:_.bmpstr.str};if(_.prnstr!=null)return{type:"prn",str:_.prnstr.str}},this.getExtPolicyMappings=function(_,P){var k=this.getCriticalExtV("policyMappings",_,P);if(_=k[0],P=k[1],_!=null){var U={extname:"policyMappings"};P&&(U.critical=!0);try{for(var M=a(_),W=M.seq,K=[],V=0;V<W.length;V++){var z=W[V].seq;K.push([z[0].oid,z[1].oid])}U.array=K}catch{throw new D("malformed policyMappings")}return U}},this.getExtPolicyConstraints=function(_,P){var k=this.getCriticalExtV("policyConstraints",_,P);if(_=k[0],P=k[1],_!=null){var U={extname:"policyConstraints"};P&&(U.critical=!0);var M=a(_);try{for(var W=M.seq,K=0;K<W.length;K++){var V=W[K].tag;V.explicit==!1&&(V.tag=="80"&&(U.reqexp=parseInt(V.hex,16)),V.tag=="81"&&(U.inhibit=parseInt(V.hex,16)))}}catch{return new D("malformed policyConstraints value")}return U}},this.getExtInhibitAnyPolicy=function(_,P){var k=this.getCriticalExtV("inhibitAnyPolicy",_,P);if(_=k[0],P=k[1],_!=null){var U={extname:"inhibitAnyPolicy"};P&&(U.critical=!0);var M=E(_,0);return M==-1?new D("wrong value"):(U.skip=M,U)}},this.getExtCRLNumber=function(_,P){var k={extname:"cRLNumber"};if(P&&(k.critical=!0),_.substr(0,2)=="02")return k.num={hex:n(_,0)},k;throw new D("hExtV parse error: "+_)},this.getExtCRLReason=function(_,P){var k={extname:"cRLReason"};if(P&&(k.critical=!0),_.substr(0,2)=="0a")return k.code=parseInt(n(_,0),16),k;throw new Error("hExtV parse error: "+_)},this.getExtOcspNonce=function(_,P){var k={extname:"ocspNonce"};P&&(k.critical=!0);var U=n(_,0);return k.hex=U,k},this.getExtOcspNoCheck=function(_,P){var k={extname:"ocspNoCheck"};return P&&(k.critical=!0),k},this.getExtAdobeTimeStamp=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("adobeTimeStamp");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"adobeTimeStamp"};P&&(U.critical=!0);var M=r(_,0);if(M.length>1){var W=i(_,M[1]),K=this.getGeneralName(W);K.uri!=null&&(U.uri=K.uri)}if(M.length>2){var V=i(_,M[2]);V=="0101ff"&&(U.reqauth=!0),V=="010100"&&(U.reqauth=!1)}return U},this.getExtSubjectDirectoryAttributes=function(_,P){if(_===void 0&&P===void 0){var k=this.getExtInfo("subjectDirectoryAttributes");if(k===void 0)return;_=i(this.hex,k.vidx),P=k.critical}var U={extname:"subjectDirectoryAttributes"};P&&(U.critical=!0);try{for(var M=a(_),W=[],K=0;K<M.seq.length;K++){var V=M.seq[K],z=St(V,"seq.0.oid"),ne=St(V,"seq.1.set");if(z==null||ne==null)throw"error";W.push({attr:z,array:ne})}return U.array=W,U}catch{throw new Error("malformed subjectDirectoryAttributes extension value")}};var I=function(_){var P={};try{var k=_.seq[0].oid,U=d.asn1.x509.OID.name2oid(k);P.type=d.asn1.x509.OID.oid2atype(U);var M=_.seq[1];if(M.utf8str!=null)P.ds="utf8",P.value=M.utf8str.str;else if(M.numstr!=null)P.ds="num",P.value=M.numstr.str;else if(M.telstr!=null)P.ds="tel",P.value=M.telstr.str;else if(M.prnstr!=null)P.ds="prn",P.value=M.prnstr.str;else if(M.ia5str!=null)P.ds="ia5",P.value=M.ia5str.str;else if(M.visstr!=null)P.ds="vis",P.value=M.visstr.str;else if(M.bmpstr!=null)P.ds="bmp",P.value=M.bmpstr.str;else throw"error";return P}catch{throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},j=function(_){try{return _.set.map(function(P){return I(P)})}catch(P){throw new Error("improper ASN.1 parsed RDN: "+P)}},q=function(_){try{return _.seq.map(function(P){return j(P)})}catch(P){throw new Error("improper ASN.1 parsed X500Name: "+P)}};this.getX500NameRule=function(_){for(var P=!0,k=!0,U=!1,M="",W="",K=null,V=[],z=0;z<_.length;z++)for(var ne=_[z],Ee=0;Ee<ne.length;Ee++)V.push(ne[Ee]);for(var z=0;z<V.length;z++){var we=V[z],_e=we.ds,He=we.value,ue=we.type;if(M+=":"+_e,_e!="prn"&&_e!="utf8"&&_e!="ia5")return"mixed";if(_e=="ia5"){if(ue!="CN")return"mixed";if(d.lang.String.isMail(He))continue;return"mixed"}if(ue=="C"){if(_e=="prn")continue;return"mixed"}if(W+=":"+_e,K==null)K=_e;else if(K!==_e)return"mixed"}return K??"prn"},this.getAttrTypeAndValue=function(_){var P=a(_);return I(P)},this.getRDN=function(_){var P=a(_);return j(P)},this.getX500NameArray=function(_){var P=a(_);return q(P)},this.getX500Name=function(_,P,k){var U=this.getX500NameArray(_),M=this.dnarraytostr(U),W={str:M};return W.array=U,k==!0&&(W.hex=_),P==!0&&(W.canon=this.c14nRDNArray(U)),W},this.readCertPEM=function(_){this.readCertHex(S(_))},this.readCertHex=function(_){this.hex=_,this.getVersion();try{A(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(_){var P={};return _==null&&(_={}),P.version=this.getVersion(),P.serial={hex:this.getSerialNumberHex()},P.sigalg=this.getSignatureAlgorithmField(),P.issuer=this.getIssuer(_.dncanon,_.dnhex),P.notbefore=this.getNotBefore(),P.notafter=this.getNotAfter(),P.subject=this.getSubject(_.dncanon,_.dnhex),P.sbjpubkey=xr(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo!=null&&this.aExtInfo.length>0&&(P.ext=this.getExtParamArray()),P.sighex=this.getSignatureValueHex(),_.tbshex==!0&&(P.tbshex=h(this.hex,0,[0])),_.nodnarray==!0&&(delete P.issuer.array,delete P.subject.array),P},this.getExtParamArray=function(_){if(_==null){var P=p(this.hex,0,[0,"[3]"]);P!=-1&&(_=m(this.hex,0,[0,"[3]",0],"30"))}for(var k=[],U=r(_,0),M=0;M<U.length;M++){var W=i(_,U[M]),K=this.getExtParam(W);K!=null&&k.push(K)}return k},this.getExtParam=function(_){var P={},k=r(_,0),U=k.length;if(U!=2&&U!=3)throw new Error("wrong number elements in Extension: "+U+" "+_);var M=b(c(_,0,[0],"06")),W=!1;U==3&&h(_,0,[1])=="0101ff"&&(W=!0);var K=h(_,0,[U-1,0]),V=void 0;if(M=="2.5.29.14"?V=this.getExtSubjectKeyIdentifier(K,W):M=="2.5.29.15"?V=this.getExtKeyUsage(K,W):M=="2.5.29.17"?V=this.getExtSubjectAltName(K,W):M=="2.5.29.18"?V=this.getExtIssuerAltName(K,W):M=="2.5.29.19"?V=this.getExtBasicConstraints(K,W):M=="2.5.29.30"?V=this.getExtNameConstraints(K,W):M=="2.5.29.31"?V=this.getExtCRLDistributionPoints(K,W):M=="2.5.29.32"?V=this.getExtCertificatePolicies(K,W):M=="2.5.29.33"?V=this.getExtPolicyMappings(K,W):M=="2.5.29.35"?V=this.getExtAuthorityKeyIdentifier(K,W):M=="2.5.29.36"?V=this.getExtPolicyConstraints(K,W):M=="2.5.29.37"?V=this.getExtExtKeyUsage(K,W):M=="2.5.29.54"?V=this.getExtInhibitAnyPolicy(K,W):M=="1.3.6.1.5.5.7.1.1"?V=this.getExtAuthorityInfoAccess(K,W):M=="2.5.29.20"?V=this.getExtCRLNumber(K,W):M=="2.5.29.21"?V=this.getExtCRLReason(K,W):M=="2.5.29.9"?V=this.getExtSubjectDirectoryAttributes(K,W):M=="1.3.6.1.5.5.7.48.1.2"?V=this.getExtOcspNonce(K,W):M=="1.3.6.1.5.5.7.48.1.5"?V=this.getExtOcspNoCheck(K,W):M=="1.2.840.113583.1.1.9.1"?V=this.getExtAdobeTimeStamp(K,W):Ne.EXT_PARSER[M]!=null&&(V=Ne.EXT_PARSER[M](M,W,K)),V!=null)return V;var z={extname:M,extn:K};try{z.extn=a(K)}catch{}return W&&(z.critical=!0),z},this.findExt=function(_,P){for(var k=0;k<_.length;k++)if(_[k].extname==P)return _[k];return null},this.updateExtCDPFullURI=function(_,P){var k=this.findExt(_,"cRLDistributionPoints");if(k!=null&&k.array!=null){for(var U=k.array,M=0;M<U.length;M++)if(U[M].dpname!=null&&U[M].dpname.full!=null)for(var W=U[M].dpname.full,K=0;K<W.length;K++){var V=W[M];V.uri!=null&&(V.uri=P)}}},this.updateExtAIAOCSP=function(_,P){var k=this.findExt(_,"authorityInfoAccess");if(k!=null&&k.array!=null)for(var U=k.array,M=0;M<U.length;M++)U[M].ocsp!=null&&(U[M].ocsp=P)},this.updateExtAIACAIssuer=function(_,P){var k=this.findExt(_,"authorityInfoAccess");if(k!=null&&k.array!=null)for(var U=k.array,M=0;M<U.length;M++)U[M].caissuer!=null&&(U[M].caissuer=P)},this.dnarraytostr=function(_){function P(U){return U.map(function(M){return k(M).replace(/\+/,"\\+")}).join("+")}function k(U){return U.type+"="+U.value}return"/"+_.map(function(U){return P(U).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(_){var P;if(_.str!=null&&_.array==null){var k=new d.asn1.x509.X500Name({str:_.str}),U=k.tohex();P=this.getX500NameArray(U)}else P=_.array;_.canon==null&&(_.canon=this.c14nRDNArray(P))},this.c14nRDNArray=function(_){for(var P=[],k=0;k<_.length;k++){for(var U=_[k],M=[],W=0;W<U.length;W++){var K=U[W],V=K.value;V=V.replace(/^\s*/,""),V=V.replace(/\s*$/,""),V=V.replace(/\s+/g," "),V=V.toLowerCase(),M.push(K.type.toLowerCase()+"="+V)}P.push(M.join("+"))}return"/"+P.join("/")},this.getInfo=function(){var _=function(Pt){for(var Qe="",bt=" ",Je=`
|
||
`,ht=Pt.array,qt=0;qt<ht.length;qt++){var ze=ht[qt];if(ze.dn!=null&&(Qe+=bt+"dn: "+ze.dn.str+Je),ze.ip!=null&&(Qe+=bt+"ip: "+ze.ip+Je),ze.rfc822!=null&&(Qe+=bt+"rfc822: "+ze.rfc822+Je),ze.dns!=null&&(Qe+=bt+"dns: "+ze.dns+Je),ze.uri!=null&&(Qe+=bt+"uri: "+ze.uri+Je),ze.other!=null){var Ot=ze.other.oid,Rn=JSON.stringify(ze.other.value).replace(/\"/g,"");Qe+=bt+"other: "+Ot+"="+Rn+Je}}return Qe=Qe.replace(/\n$/,""),Qe},P=function(Pt){for(var Qe="",bt=Pt.array,Je=0;Je<bt.length;Je++){var ht=bt[Je];if(Qe+=" policy oid: "+ht.policyoid+`
|
||
`,ht.array!==void 0)for(var qt=0;qt<ht.array.length;qt++){var ze=ht.array[qt];ze.cps!==void 0&&(Qe+=" cps: "+ze.cps+`
|
||
`)}}return Qe},k=function(Pt){for(var Qe="",bt=Pt.array,Je=0;Je<bt.length;Je++){var ht=bt[Je];try{ht.dpname.full[0].uri!==void 0&&(Qe+=" "+ht.dpname.full[0].uri+`
|
||
`)}catch{}try{ht.dname.full[0].dn.hex!==void 0&&(Qe+=" "+Ne.hex2dn(ht.dpname.full[0].dn.hex)+`
|
||
`)}catch{}}return Qe},U=function(Pt){for(var Qe="",bt=Pt.array,Je=0;Je<bt.length;Je++){var ht=bt[Je];ht.caissuer!==void 0&&(Qe+=" caissuer: "+ht.caissuer+`
|
||
`),ht.ocsp!==void 0&&(Qe+=" ocsp: "+ht.ocsp+`
|
||
`)}return Qe},M=Ne,W,K,V;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:
|
||
`,K=this.getPublicKey(),W+=" key algorithm: "+K.type+`
|
||
`,K.type==="RSA"&&(W+=" n="+u0(K.n.toString(16)).substr(0,16)+`...
|
||
`,W+=" e="+u0(K.e.toString(16))+`
|
||
`),V=this.aExtInfo,V!=null){W+=`X509v3 Extensions:
|
||
`;for(var z=0;z<V.length;z++){var ne=V[z],Ee=d.asn1.x509.OID.oid2name(ne.oid);Ee===""&&(Ee=ne.oid);var we="";if(ne.critical===!0&&(we="CRITICAL"),W+=" "+Ee+" "+we+`:
|
||
`,Ee==="basicConstraints"){var _e=this.getExtBasicConstraints();_e.cA===void 0?W+=` {}
|
||
`:(W+=" cA=true",_e.pathLen!==void 0&&(W+=", pathLen="+_e.pathLen),W+=`
|
||
`)}else if(Ee=="policyMappings"){var He=this.getExtPolicyMappings().array,ue=He.map(function(Pt){var Qe=Pt;return Qe[0]+":"+Qe[1]}).join(", ");W+=" "+ue+`
|
||
`}else if(Ee=="policyConstraints"){var Ce=this.getExtPolicyConstraints();W+=" ",Ce.reqexp!=null&&(W+=" reqexp="+Ce.reqexp),Ce.inhibit!=null&&(W+=" inhibit="+Ce.inhibit),W+=`
|
||
`}else if(Ee=="inhibitAnyPolicy"){var Ce=this.getExtInhibitAnyPolicy();W+=" skip="+Ce.skip+`
|
||
`}else if(Ee=="keyUsage")W+=" "+this.getExtKeyUsageString()+`
|
||
`;else if(Ee=="subjectKeyIdentifier")W+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
|
||
`;else if(Ee=="authorityKeyIdentifier"){var Oe=this.getExtAuthorityKeyIdentifier();Oe.kid!==void 0&&(W+=" kid="+Oe.kid.hex+`
|
||
`)}else if(Ee=="extKeyUsage"){var sr=this.getExtExtKeyUsage().array;W+=" "+sr.join(", ")+`
|
||
`}else if(Ee=="subjectAltName"){var _t=_(this.getExtSubjectAltName());W+=_t+`
|
||
`}else if(Ee=="cRLDistributionPoints"){var lt=this.getExtCRLDistributionPoints();W+=k(lt)}else if(Ee=="authorityInfoAccess"){var Mt=this.getExtAuthorityInfoAccess();W+=U(Mt)}else Ee=="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):d.lang.String.isHex(e)&&this.readCertHex(e))}Ne.EXT_PARSER={};Ne.registExtParser=function(e,t){Ne.EXT_PARSER[e]=t};Ne.hex2dn=function(e,t){t===void 0&&(t=0);var r=new Ne,n=Ae.getTLV(e,t),s=r.getX500Name(e);return s.str};Ne.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=Ae.getChildIdx(e,t),s=0;s<n.length;s++)r.push(Ne.hex2attrTypeValue(e,n[s]));return r=r.map(function(a){return a.replace("+","\\+")}),r.join("+")};Ne.hex2attrTypeValue=function(e,t){var r=Ae,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 a=n(e,s[0]),i=d.asn1.ASN1Util.oidHexToInt(a),c=d.asn1.x509.OID.oid2atype(i),l=n(e,s[1]),h=cn(l);return c+"="+h};Ne.getPublicKeyFromCertHex=function(e){var t=new Ne;return t.readCertHex(e),t.getPublicKey()};Ne.getPublicKeyFromCertPEM=function(e){var t=new Ne;return t.readCertPEM(e),t.getPublicKey()};Ne.getPublicKeyInfoPropOfCertPEM=function(e){var t=Ae,r=t.getVbyList,n={},s,a,i;return n.algparam=null,s=new Ne,s.readCertPEM(e),a=s.getPublicKeyHex(),n.keyhex=r(a,0,[1],"03").substr(2),n.algoid=r(a,0,[0,0],"06"),n.algoid==="2a8648ce3d0201"&&(n.algparam=r(a,0,[0,1],"06")),n};Ne.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var FI=function(e){var t=d,r=t.lang.String.isHex,n=Ae,s=n.getV,a=n.getTLV,i=n.getVbyList,c=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getIdxbyList,m=n.getIdxbyListEx,A=n.getChildIdx,p=new Ne;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var f=h(this.hex,0,[0,0]),E=this.hex.substr(f,2);if(E=="02")this.posSigAlg=1;else if(E=="30")this.posSigAlg=0;else throw new Error("malformed 1st item of TBSCertList: "+E);var v=h(this.hex,0,[0,this.posSigAlg+3]),b=this.hex.substr(v,2);if(b=="17"||b=="18"){var w,S;w=h(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,w!=-1&&(S=this.hex.substr(w,2),S=="30"&&(this.posRevCert=this.posSigAlg+4))}else if(b=="30")this.posRevCert=this.posSigAlg+3;else if(b=="a0")this.posRevCert=null;else throw new Error("malformed nextUpdate or revCert tag: "+b)},this.getVersion=function(){return this.posSigAlg==0?null:parseInt(i(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var f=c(this.hex,0,[0,this.posSigAlg],"30");return p.getAlgorithmIdentifierName(f)},this.getIssuer=function(){return p.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var f=i(this.hex,0,[0,this.posSigAlg+2]);return result=cn(f)},this.getNextUpdate=function(){var f=h(this.hex,0,[0,this.posSigAlg+3]),E=this.hex.substr(f,2);return E!="17"&&E!="18"?null:cn(s(this.hex,f))},this.getRevCertArray=function(){if(this.posRevCert==null)return null;for(var f=[],E=h(this.hex,0,[0,this.posRevCert]),v=A(this.hex,E),b=0;b<v.length;b++){var w=a(this.hex,v[b]);f.push(this.getRevCert(w))}return f},this.getRevCert=function(f){var E={},v=A(f,0);return E.sn={hex:i(f,0,[0],"02")},E.date=cn(i(f,0,[1])),v.length==3&&(E.ext=p.getExtParamArray(c(f,0,[2]))),E},this.findRevCert=function(f){var E=new Ne(f),v=E.getSerialNumberHex();return this.findRevCertBySN(v)},this.findRevCertBySN=function(f){if(this.parsed==null&&this.getParam(),this.parsed.revcert==null)return null;for(var E=this.parsed.revcert,v=0;v<E.length;v++)if(f==E[v].sn.hex)return E[v];return null},this.getSignatureValueHex=function(){return i(this.hex,0,[2],"03",!0)},this.verifySignature=function(f){var E=this.getSignatureAlgorithmField(),v=this.getSignatureValueHex(),b=c(this.hex,0,[0],"30"),w=new d.crypto.Signature({alg:E});return w.init(f),w.updateHex(b),w.verify(v)},this.getParam=function(f){var E={},v=this.getVersion();v!=null&&(E.version=v),E.sigalg=this.getSignatureAlgorithmField(),E.issuer=this.getIssuer(),E.thisupdate=this.getThisUpdate();var b=this.getNextUpdate();b!=null&&(E.nextupdate=b);var w=this.getRevCertArray();w!=null&&(E.revcert=w);var S=m(this.hex,0,[0,"[0]"]);if(S!=-1){var F=l(this.hex,0,[0,"[0]",0]);E.ext=p.getExtParamArray(F)}return E.sighex=this.getSignatureValueHex(),this.parsed=E,typeof f=="object"&&(f.tbshex==!0&&(E.tbshex=c(this.hex,0,[0])),f.nodnarray==!0&&delete E.issuer.array),E},typeof e=="string"&&(r(e)?this.hex=e:e.match(/-----BEGIN X509 CRL/)&&(this.hex=xt(e)),this._setPos())};(typeof d>"u"||!d)&&(d={});(typeof d.jws>"u"||!d.jws)&&(d.jws={});d.jws.JWS=function(){var e=d,t=e.jws.JWS,r=t.isSafeJSONString;this.parseJWS=function(n,s){if(!(this.parsedJWS!==void 0&&(s||this.parsedJWS.sigvalH!==void 0))){var a=n.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(a==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=a[1],c=a[2],l=a[3],h=i+"."+c;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=c,this.parsedJWS.sigvalB64U=l,this.parsedJWS.si=h,!s){var m=Bt(l),A=un(m,16);this.parsedJWS.sigvalH=m,this.parsedJWS.sigvalBI=A}var p=ti(i),f=ti(c);if(this.parsedJWS.headS=p,this.parsedJWS.payloadS=f,!r(p,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+p}}};d.jws.JWS.sign=function(e,t,r,n,s){var a=d,i=a.jws,c=i.JWS,l=c.readSafeJSONString,h=c.isSafeJSONString,m=a.crypto,A=m.ECDSA,p=m.Mac,f=m.Signature,E=JSON,v,b,w;if(typeof t!="string"&&typeof t!="object")throw"spHeader must be JSON string or object: "+t;if(typeof t=="object"&&(b=t,v=E.stringify(b)),typeof t=="string"){if(v=t,!h(v))throw"JWS Head is not safe JSON string: "+v;b=l(v)}if(w=r,typeof r=="object"&&(w=E.stringify(r)),(e==""||e==null)&&b.alg!==void 0&&(e=b.alg),e!=""&&e!=null&&b.alg===void 0&&(b.alg=e,v=E.stringify(b)),e!==b.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+b.alg;var S=null;if(c.jwsalg2sigalg[e]===void 0)throw"unsupported alg name: "+e;S=c.jwsalg2sigalg[e];var F=wc(v),D=wc(w),I=F+"."+D,j="";if(S.substr(0,4)=="Hmac"){if(n===void 0)throw"mac key shall be specified for HS* alg";var q=new p({alg:S,prov:"cryptojs",pass:n});q.updateString(I),j=q.doFinal()}else if(S.indexOf("withECDSA")!=-1){var _=new f({alg:S});_.init(n,s),_.updateString(I);var P=_.sign();j=d.crypto.ECDSA.asn1SigToConcatSig(P)}else if(S!="none"){var _=new f({alg:S});_.init(n,s),_.updateString(I),j=_.sign()}var k=nr(j);return I+"."+k};d.jws.JWS.verify=function(e,t,r){var n=d,s=n.jws,a=s.JWS,i=a.readSafeJSONString,c=n.crypto,l=c.ECDSA,h=c.Mac,m=c.Signature,A;if(typeof Ke!==void 0&&(A=Ke),!m0(e))return!1;var p=e.split(".");if(p.length!==3)return!1;var f=p[0],E=p[1],v=f+"."+E,b=Bt(p[2]),w=i(ti(p[0])),S=null,F=null;if(w.alg===void 0)throw"algorithm not specified in header";if(S=w.alg,F=S.substr(0,2),r!=null&&Object.prototype.toString.call(r)==="[object Array]"&&r.length>0){var D=":"+r.join(":")+":";if(D.indexOf(":"+S+":")==-1)throw"algorithm '"+S+"' not accepted in the list"}if(S!="none"&&t===null)throw"key shall be specified to verify.";if(typeof t=="string"&&t.indexOf("-----BEGIN ")!=-1&&(t=rt.getKey(t)),(F=="RS"||F=="PS")&&!(t instanceof A))throw"key shall be a RSAKey obj for RS* and PS* algs";if(F=="ES"&&!(t instanceof l))throw"key shall be a ECDSA obj for ES* algs";S=="none";var I=null;if(a.jwsalg2sigalg[w.alg]===void 0)throw"unsupported alg name: "+S;if(I=a.jwsalg2sigalg[S],I=="none")throw"not supported";if(I.substr(0,4)=="Hmac"){var j=null;if(t===void 0)throw"hexadecimal key shall be specified for HMAC";var q=new h({alg:I,pass:t});return q.updateString(v),j=q.doFinal(),b==j}else if(I.indexOf("withECDSA")!=-1){var _=null;try{_=l.concatSigToASN1Sig(b)}catch{return!1}var P=new m({alg:I});return P.init(t),P.updateString(v),P.verify(_)}else{var P=new m({alg:I});return P.init(t),P.updateString(v),P.verify(b)}};d.jws.JWS.parse=function(e){var t=e.split("."),r={},n,s,a;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&&(a=t[2]),r.headerObj=d.jws.JWS.readSafeJSONString(ti(n)),r.payloadObj=d.jws.JWS.readSafeJSONString(ti(s)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadObj==null?r.payloadPP=ti(s):r.payloadPP=JSON.stringify(r.payloadObj,null," "),a!==void 0&&(r.sigHex=Bt(a)),r};d.jws.JWS.verifyJWT=function(e,t,r){var n=d,s=n.jws,a=s.JWS,i=a.readSafeJSONString,c=a.inArray,l=a.includedArray;if(!m0(e))return!1;var h=e.split(".");if(h.length!=3)return!1;var m=h[0],A=h[1],p=m+"."+A,f=Bt(h[2]),E=i(ti(m)),v=i(ti(A));if(E.alg===void 0)return!1;if(r.alg===void 0)throw"acceptField.alg shall be specified";if(!c(E.alg,r.alg)||v.iss!==void 0&&typeof r.iss=="object"&&!c(v.iss,r.iss)||v.sub!==void 0&&typeof r.sub=="object"&&!c(v.sub,r.sub))return!1;if(v.aud!==void 0&&typeof r.aud=="object"){if(typeof v.aud=="string"){if(!c(v.aud,r.aud))return!1}else if(typeof v.aud=="object"&&!l(v.aud,r.aud))return!1}var b=s.IntDate.getNow();return r.verifyAt!==void 0&&typeof r.verifyAt=="number"&&(b=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<b||v.nbf!==void 0&&typeof v.nbf=="number"&&b<v.nbf-r.gracePeriod||v.iat!==void 0&&typeof v.iat=="number"&&b<v.iat-r.gracePeriod||v.jti!==void 0&&r.jti!==void 0&&v.jti!==r.jti||!a.verify(e,t,r.alg))};d.jws.JWS.includedArray=function(e,t){var r=d.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};d.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};d.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"};d.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return n=c2(e),typeof n!="object"||n.constructor===Array?0:(t&&(t[r]=n),1)}catch{return 0}};d.jws.JWS.readSafeJSONString=function(e){var t=null;try{return t=c2(e),typeof t!="object"||t.constructor===Array?null:t}catch{return null}};d.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]};d.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=Ci(t),n=d.crypto.Util.hashHex(r,"sha256"),s=nr(n);return s};d.jws.IntDate={};d.jws.IntDate.get=function(e){var t=d.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};d.jws.IntDate.getZulu=function(e){return p2(e)};d.jws.IntDate.getNow=function(){var e=~~(new Date/1e3);return e};d.jws.IntDate.intDate2UTCString=function(e){var t=new Date(e*1e3);return t.toUTCString()};d.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),a=("00"+t.getUTCHours()).slice(-2),i=("00"+t.getUTCMinutes()).slice(-2),c=("00"+t.getUTCSeconds()).slice(-2);return r+n+s+a+i+c+"Z"};(typeof d>"u"||!d)&&(d={});(typeof d.jws>"u"||!d.jws)&&(d.jws={});d.jws.JWSJS=function(){var e=d,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 a=s.split(".");if(a.length!=3)throw"malformed input JWS";this.aHeader.push(a[0]),this.sPayload=a[1],this.aSignature.push(a[2])},this.addSignature=function(s,a,i,c){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 h=d.jws.JWS.sign(s,a,this.sPayload,i,c),m=h.split("."),A=m[0],p=m[2];this.aHeader.push(m[0]),this.aSignature.push(m[2])}catch(f){throw this.aHeader.length>l&&this.aHeader.pop(),this.aSignature.length>l&&this.aSignature.pop(),"addSignature failed: "+f}},this.verifyAll=function(s){if(this.aHeader.length!==s.length||this.aSignature.length!==s.length)return!1;for(var a=0;a<s.length;a++){var i=s[a];if(i.length!==2)return!1;var c=this.verifyNth(a,i[0],i[1]);if(c===!1)return!1}return!0},this.verifyNth=function(s,a,i){if(this.aHeader.length<=s||this.aSignature.length<=s)return!1;var c=this.aHeader[s],l=this.aSignature[s],h=c+"."+this.sPayload+"."+l,m=!1;try{m=r.verify(h,a,i)}catch{return!1}return m},this.readJWSJS=function(s){if(typeof s=="string"){var a=n(s);if(a==null)throw"argument is not safe JSON object string";this.aHeader=a.headers,this.sPayload=a.payload,this.aSignature=a.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}};ye.SecureRandom=to;ye.rng_seed_time=f0;ye.BigInteger=Q;ye.RSAKey=Ke;ye.ECDSA=d.crypto.ECDSA;ye.DSA=d.crypto.DSA;ye.Signature=d.crypto.Signature;ye.MessageDigest=d.crypto.MessageDigest;ye.Mac=d.crypto.Mac;ye.KEYUTIL=rt;ye.ASN1HEX=Ae;ye.X509=Ne;ye.X509CRL=FI;ye.CryptoJS=Se;ye.b64tohex=Zu;ye.b64toBA=i2;ye.ECFieldElementFp=ir;ye.ECPointFp=ft;ye.ECCurveFp=us;ye.stoBA=l2;ye.BAtos=f2;ye.BAtohex=yf;ye.stohex=on;ye.stob64=sI;ye.stob64u=aI;ye.b64utos=uI;ye.b64tob64u=Ju;ye.b64utob64=Ec;ye.hex2b64=as;ye.hextob64u=nr;ye.b64utohex=Bt;ye.utf8tob64u=wc;ye.b64utoutf8=ti;ye.utf8tob64=oI;ye.b64toutf8=cI;ye.utf8tohex=Sf;ye.hextoutf8=vt;ye.hextorstr=cn;ye.rstrtohex=Ci;ye.hextob64=h0;ye.hextob64nl=hI;ye.b64nltohex=h2;ye.hextopem=xr;ye.pemtohex=xt;ye.hextoArrayBuffer=gI;ye.ArrayBuffertohex=mI;ye.zulutomsec=p0;ye.msectozulu=vI;ye.zulutosec=p2;ye.zulutodate=wI;ye.datetozulu=AI;ye.uricmptohex=Cf;ye.hextouricmp=Ff;ye.ipv6tohex=s0;ye.hextoipv6=a0;ye.hextoip=mf;ye.iptohex=d0;ye.ucs2hextoutf8=g0;ye.encodeURIComponentAll=_f;ye.newline_toUnix=EI;ye.newline_toDos=yI;ye.hextoposhex=u0;ye.intarystrtohex=SI;ye.strdiffidx=bI;ye.oidtohex=m2;ye.hextooid=If;ye.strpad=vf;ye.bitstrtoint=w2;ye.inttobitstr=A2;ye.bitstrtobinstr=E2;ye.binstrtobitstr=CI;ye.isBase64URLDot=m0;ye.namearraytobinstr=wf;ye.extendClass=fe;ye.foldnl=bf;ye.b64topem=pI;ye.pemtob64=dI;ye.timeogen=d2;ye.aryval=St;ye.inttohex=v2;ye.twoscompl=yc;ye.KJUR=d;ye.crypto=d.crypto;ye.asn1=d.asn1;ye.jws=d.jws;ye.lang=d.lang;ye.VERSION=xF;ye.VERSION_FULL=OF});var I2=be(y0=>{"use strict";y0.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};y0.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 B2=be(S0=>{"use strict";S0.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};S0.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 D2=be(b0=>{"use strict";b0.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};b0.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 P2=be(C0=>{"use strict";C0.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};C0.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 $2=be(F0=>{"use strict";F0.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}`};F0.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 x2=be((T2,_0)=>{var R2=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=A,e.encode=m,e.familyOf=h,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,a={name:"v4",size:r,isFormat:p=>t.test(p),encode(p,f,E){E=~~E,f=f||new Uint8Array(E+r);let v=p.length,b=0;for(let w=0;w<v;){let S=p.charCodeAt(w++);S===46?(f[E++]=b,b=0):b=b*10+(S-48)}return f[E]=b,f},decode(p,f){return f=~~f,`${p[f++]}.${p[f++]}.${p[f++]}.${p[f]}`}};e.v4=a;let i={name:"v6",size:s,isFormat:p=>p.length>0&&n.test(p),encode(p,f,E){E=~~E;let v=E+s,b=-1,w=0,S=0,F=!0,D=!1;f=f||new Uint8Array(E+s);for(let I=0;I<p.length;I++){let j=p.charCodeAt(I);j===58?(F?b!==-1?(E<v&&(f[E]=0),E<v-1&&(f[E+1]=0),E+=2):E<v&&(b=E):(D===!0?(E<v&&(f[E]=S),E++):(E<v&&(f[E]=w>>8),E<v-1&&(f[E+1]=w&255),E+=2),w=0,S=0),F=!0,D=!1):j===46?(E<v&&(f[E]=S),E++,S=0,w=0,F=!1,D=!0):(F=!1,j>=97?j-=87:j>=65?j-=55:(j-=48,S=S*10+j),w=(w<<4)+j)}if(F===!1)D===!0?(E<v&&(f[E]=S),E++):(E<v&&(f[E]=w>>8),E<v-1&&(f[E+1]=w&255),E+=2);else if(b===0)E<v&&(f[E]=0),E<v-1&&(f[E+1]=0),E+=2;else if(b!==-1){E+=2;for(let I=Math.min(E-1,v-1);I>=b+2;I--)f[I]=f[I-2];f[b]=0,f[b+1]=0,b=E}if(b!==E&&b!==-1)for(E>v-2&&(E=v-2);v>b;)f[--v]=E<v&&E>b?f[--E]:0;else for(;E<v;)f[E++]=0;return f},decode(p,f){f=~~f;let E="";for(let v=0;v<s;v+=2)v!==0&&(E+=":"),E+=(p[f+v]<<8|p[f+v+1]).toString(16);return E.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=i;let c="ip";e.name=c;function l(p){if(a.isFormat(p))return a.size;if(i.isFormat(p))return i.size;throw Error(`Invalid ip address: ${p}`)}function h(p){return l(p)===a.size?1:2}function m(p,f,E){E=~~E;let v=l(p);return typeof f=="function"&&(f=f(E+v)),v===a.size?a.encode(p,f,E):i.encode(p,f,E)}function A(p,f,E){if(f=~~f,E=E||p.length-f,E===a.size)return a.decode(p,f,E);if(E===i.size)return i.decode(p,f,E);throw Error(`Invalid buffer size needs to be ${a.size} for v4 or ${i.size} for v6.`)}return"default"in e?e.default:e}({});typeof define=="function"&&define.amd?define([],function(){return R2}):typeof _0=="object"&&typeof T2=="object"&&(_0.exports=R2)});var N2=be(Te=>{"use strict";var xe=df().Buffer,ws=I2(),BI=B2(),DI=D2(),$f=P2(),I0=$2(),Ha=x2(),PI=0,O2=32768,B0=32768,$I=~B0,k2=32768,RI=~k2,Be=Te.name={};Be.encode=function(e,t,r,{mail:n=!1}={}){t||(t=xe.alloc(Be.encodingLength(e))),r||(r=0);let s=r,a=e.replace(/^\.|\.$/gm,"");if(a.length){let i=[];if(n){let c="";a.split(".").forEach(l=>{l.endsWith("\\")?c+=(c.length?".":"")+l.slice(0,-1):i.length===0&&c.length?i.push(c+"."+l):i.push(l)})}else i=a.split(".");for(let c=0;c<i.length;c++){let l=t.write(i[c],r+1);t[r]=l,r+=l+1}}return t[r++]=0,Be.encode.bytes=r-s,t};Be.encode.bytes=0;Be.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let n=[],s=t,a=0,i=0,c=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(i+=c?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 h=e.readUInt16BE(t-1)-49152;if(h>=s)throw new Error("Cannot decode name (bad pointer)");t=h,s=h,i+=c?0:1,c=!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(a+=l+1,a>254)throw new Error("Cannot decode name (name too long)");let h=e.toString("utf-8",t,t+l);r&&(h=h.replace(/\./g,"\\.")),n.push(h),t+=l,i+=c?0:l}}return Be.decode.bytes=i,n.length===0?".":n.join(".")};Be.decode.bytes=0;Be.encodingLength=function(e){return e==="."||e===".."?1:xe.byteLength(e.replace(/^\.|\.$/gm,""))+2};var tt={};tt.encode=function(e,t,r){t||(t=xe.alloc(tt.encodingLength(e))),r||(r=0);let n=t.write(e,r+1);return t[r]=n,tt.encode.bytes=n+1,t};tt.encode.bytes=0;tt.decode=function(e,t){t||(t=0);let r=e[t],n=e.toString("utf-8",t+1,t+1+r);return tt.decode.bytes=r+1,n};tt.decode.bytes=0;tt.encodingLength=function(e){return xe.byteLength(e)+1};var ii={};ii.encode=function(e,t,r){t||(t=ii.encodingLength(e)),r||(r=0);let n=(e.flags||0)&32767,s=e.type==="response"?O2:PI;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};ii.encode.bytes=12;ii.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&O2?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:DI.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:BI.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))}};ii.decode.bytes=12;ii.encodingLength=function(){return 12};var os=Te.unknown={};os.encode=function(e,t,r){return t||(t=xe.alloc(os.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),os.encode.bytes=e.length+2,t};os.encode.bytes=0;os.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=e.slice(t+2,t+2+r);return os.decode.bytes=r+2,n};os.decode.bytes=0;os.encodingLength=function(e){return e.length+2};var cs=Te.ns={};cs.encode=function(e,t,r){return t||(t=xe.alloc(cs.encodingLength(e))),r||(r=0),Be.encode(e,t,r+2),t.writeUInt16BE(Be.encode.bytes,r),cs.encode.bytes=Be.encode.bytes+2,t};cs.encode.bytes=0;cs.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),n=Be.decode(e,t+2);return cs.decode.bytes=r+2,n};cs.decode.bytes=0;cs.encodingLength=function(e){return Be.encodingLength(e)+2};var ls=Te.soa={};ls.encode=function(e,t,r){t||(t=xe.alloc(ls.encodingLength(e))),r||(r=0);let n=r;return r+=2,Be.encode(e.mname,t,r),r+=Be.encode.bytes,Be.encode(e.rname,t,r,{mail:!0}),r+=Be.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),ls.encode.bytes=r-n,t};ls.encode.bytes=0;ls.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mname=Be.decode(e,t),t+=Be.decode.bytes,n.rname=Be.decode(e,t,{mail:!0}),t+=Be.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,ls.decode.bytes=t-r,n};ls.decode.bytes=0;ls.encodingLength=function(e){return 22+Be.encodingLength(e.mname)+Be.encodingLength(e.rname)};var hs=Te.txt={};hs.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]=xe.from(e[s])),!xe.isBuffer(e[s]))throw new Error("Must be a Buffer");t||(t=xe.alloc(hs.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),hs.encode.bytes=r-n,t};hs.encode.bytes=0;hs.decode=function(e,t){t||(t=0);let r=t,n=e.readUInt16BE(t);t+=2;let s=[];for(;n>0;){let a=e[t++];if(--n,n<a)throw new Error("Buffer overflow");s.push(e.slice(t,t+a)),t+=a,n-=a}return hs.decode.bytes=t-r,s};hs.decode.bytes=0;hs.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=xe.byteLength(r)+1:t+=r.length+1}),t};var ps=Te.null={};ps.encode=function(e,t,r){t||(t=xe.alloc(ps.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=xe.from(e)),e||(e=xe.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),ps.encode.bytes=r-n,t};ps.encode.bytes=0;ps.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,ps.decode.bytes=t-r,s};ps.decode.bytes=0;ps.encodingLength=function(e){return e?(xe.isBuffer(e)?e.length:xe.byteLength(e))+2:2};var ds=Te.hinfo={};ds.encode=function(e,t,r){t||(t=xe.alloc(ds.encodingLength(e))),r||(r=0);let n=r;return r+=2,tt.encode(e.cpu,t,r),r+=tt.encode.bytes,tt.encode(e.os,t,r),r+=tt.encode.bytes,t.writeUInt16BE(r-n-2,n),ds.encode.bytes=r-n,t};ds.encode.bytes=0;ds.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.cpu=tt.decode(e,t),t+=tt.decode.bytes,n.os=tt.decode(e,t),t+=tt.decode.bytes,ds.decode.bytes=t-r,n};ds.decode.bytes=0;ds.encodingLength=function(e){return tt.encodingLength(e.cpu)+tt.encodingLength(e.os)+2};var ri=Te.ptr={},TI=Te.cname=ri,xI=Te.dname=ri;ri.encode=function(e,t,r){return t||(t=xe.alloc(ri.encodingLength(e))),r||(r=0),Be.encode(e,t,r+2),t.writeUInt16BE(Be.encode.bytes,r),ri.encode.bytes=Be.encode.bytes+2,t};ri.encode.bytes=0;ri.decode=function(e,t){t||(t=0);let r=Be.decode(e,t+2);return ri.decode.bytes=Be.decode.bytes+2,r};ri.decode.bytes=0;ri.encodingLength=function(e){return Be.encodingLength(e)+2};var gs=Te.srv={};gs.encode=function(e,t,r){t||(t=xe.alloc(gs.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),Be.encode(e.target,t,r+8);let n=Be.encode.bytes+6;return t.writeUInt16BE(n,r),gs.encode.bytes=n+2,t};gs.encode.bytes=0;gs.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=Be.decode(e,t+8),gs.decode.bytes=r+2,n};gs.decode.bytes=0;gs.encodingLength=function(e){return 8+Be.encodingLength(e.target)};var Cn=Te.caa={};Cn.ISSUER_CRITICAL=128;Cn.encode=function(e,t,r){let n=Cn.encodingLength(e);return t||(t=xe.alloc(Cn.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=Cn.ISSUER_CRITICAL),t.writeUInt16BE(n-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,tt.encode(e.tag,t,r),r+=tt.encode.bytes,t.write(e.value,r),r+=xe.byteLength(e.value),Cn.encode.bytes=n,t};Cn.encode.bytes=0;Cn.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=tt.decode(e,t),t+=tt.decode.bytes,s.value=e.toString("utf-8",t,n+r),s.issuerCritical=!!(s.flags&Cn.ISSUER_CRITICAL),Cn.decode.bytes=r+2,s};Cn.decode.bytes=0;Cn.encodingLength=function(e){return tt.encodingLength(e.tag)+tt.encodingLength(e.value)+2};var Ks=Te.mx={};Ks.encode=function(e,t,r){t||(t=xe.alloc(Ks.encodingLength(e))),r||(r=0);let n=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,Be.encode(e.exchange,t,r),r+=Be.encode.bytes,t.writeUInt16BE(r-n-2,n),Ks.encode.bytes=r-n,t};Ks.encode.bytes=0;Ks.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.preference=e.readUInt16BE(t),t+=2,n.exchange=Be.decode(e,t),t+=Be.decode.bytes,Ks.decode.bytes=t-r,n};Ks.encodingLength=function(e){return 4+Be.encodingLength(e.exchange)};var ms=Te.a={};ms.encode=function(e,t,r){return t||(t=xe.alloc(ms.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,Ha.v4.encode(e,t,r),ms.encode.bytes=6,t};ms.encode.bytes=0;ms.decode=function(e,t){t||(t=0),t+=2;let r=Ha.v4.decode(e,t);return ms.decode.bytes=6,r};ms.decode.bytes=0;ms.encodingLength=function(){return 6};var vs=Te.aaaa={};vs.encode=function(e,t,r){return t||(t=xe.alloc(vs.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,Ha.v6.encode(e,t,r),vs.encode.bytes=18,t};vs.encode.bytes=0;vs.decode=function(e,t){t||(t=0),t+=2;let r=Ha.v6.decode(e,t);return vs.decode.bytes=18,r};vs.decode.bytes=0;vs.encodingLength=function(){return 18};var ln=Te.option={};ln.encode=function(e,t,r){t||(t=xe.alloc(ln.encodingLength(e))),r||(r=0);let n=r,s=I0.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 a=e.sourcePrefixLength||0,i=e.family||Ha.familyOf(e.ip),c=Ha.encode(e.ip,xe.alloc),l=Math.ceil(a/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(i,r),r+=2,t.writeUInt8(a,r++),t.writeUInt8(e.scopePrefixLength||0,r++),c.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 h=e.length||0;t.writeUInt16BE(h,r),r+=2,t.fill(0,r,r+h),r+=h;break;case 14:let m=e.tags.length*2;t.writeUInt16BE(m,r),r+=2;for(let A of e.tags)t.writeUInt16BE(A,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return ln.encode.bytes=r-n,t};ln.encode.bytes=0;ln.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=I0.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=xe.alloc(r.family===1?4:16);e.copy(s,0,t,t+n-4),r.ip=Ha.decode(s);break;case 11:n>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let a=0;a<n;a+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return ln.decode.bytes=n+4,r};ln.decode.bytes=0;ln.encodingLength=function(e){if(e.data)return e.data.length+4;switch(I0.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 _n=Te.opt={};_n.encode=function(e,t,r){t||(t=xe.alloc(_n.encodingLength(e))),r||(r=0);let n=r,s=no(e,ln);return t.writeUInt16BE(s,r),r=bc(e,ln,t,r+2),_n.encode.bytes=r-n,t};_n.encode.bytes=0;_n.decode=function(e,t){t||(t=0);let r=t,n=[],s=e.readUInt16BE(t);t+=2;let a=0;for(;s>0;)n[a++]=ln.decode(e,t),t+=ln.decode.bytes,s-=ln.decode.bytes;return _n.decode.bytes=t-r,n};_n.decode.bytes=0;_n.encodingLength=function(e){return 2+no(e||[],ln)};var zr=Te.dnskey={};zr.PROTOCOL_DNSSEC=3;zr.ZONE_KEY=128;zr.SECURE_ENTRYPOINT=32768;zr.encode=function(e,t,r){t||(t=xe.alloc(zr.encodingLength(e))),r||(r=0);let n=r,s=e.key;if(!xe.isBuffer(s))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(zr.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,zr.encode.bytes=r-n,t.writeUInt16BE(zr.encode.bytes-2,n),t};zr.encode.bytes=0;zr.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)!==zr.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,zr.decode.bytes=t-r,n};zr.decode.bytes=0;zr.encodingLength=function(e){return 6+xe.byteLength(e.key)};var Fi=Te.rrsig={};Fi.encode=function(e,t,r){t||(t=xe.alloc(Fi.encodingLength(e))),r||(r=0);let n=r,s=e.signature;if(!xe.isBuffer(s))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(ws.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,Be.encode(e.signersName,t,r),r+=Be.encode.bytes,s.copy(t,r,0,s.length),r+=s.length,Fi.encode.bytes=r-n,t.writeUInt16BE(Fi.encode.bytes-2,n),t};Fi.encode.bytes=0;Fi.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);return t+=2,n.typeCovered=ws.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=Be.decode(e,t),t+=Be.decode.bytes,n.signature=e.slice(t,r+s+2),t+=n.signature.length,Fi.decode.bytes=t-r,n};Fi.decode.bytes=0;Fi.encodingLength=function(e){return 20+Be.encodingLength(e.signersName)+xe.byteLength(e.signature)};var _i=Te.rp={};_i.encode=function(e,t,r){t||(t=xe.alloc(_i.encodingLength(e))),r||(r=0);let n=r;return r+=2,Be.encode(e.mbox||".",t,r,{mail:!0}),r+=Be.encode.bytes,Be.encode(e.txt||".",t,r),r+=Be.encode.bytes,_i.encode.bytes=r-n,t.writeUInt16BE(_i.encode.bytes-2,n),t};_i.encode.bytes=0;_i.decode=function(e,t){t||(t=0);let r=t,n={};return t+=2,n.mbox=Be.decode(e,t,{mail:!0})||".",t+=Be.decode.bytes,n.txt=Be.decode(e,t)||".",t+=Be.decode.bytes,_i.decode.bytes=t-r,n};_i.decode.bytes=0;_i.encodingLength=function(e){return 2+Be.encodingLength(e.mbox||".")+Be.encodingLength(e.txt||".")};var dr={};dr.encode=function(e,t,r){t||(t=xe.alloc(dr.encodingLength(e))),r||(r=0);let n=r;for(var s=[],a=0;a<e.length;a++){var i=ws.toType(e[a]);s[i>>8]===void 0&&(s[i>>8]=[]),s[i>>8][i>>3&31]|=1<<7-(i&7)}for(a=0;a<s.length;a++)if(s[a]!==void 0){var c=xe.from(s[a]);t.writeUInt8(a,r),r+=1,t.writeUInt8(c.length,r),r+=1,c.copy(t,r),r+=c.length}return dr.encode.bytes=r-n,t};dr.encode.bytes=0;dr.decode=function(e,t,r){t||(t=0);let n=t;for(var s=[];t-n<r;){var a=e.readUInt8(t);t+=1;var i=e.readUInt8(t);t+=1;for(var c=0;c<i;c++)for(var l=e.readUInt8(t+c),h=0;h<8;h++)if(l&1<<7-h){var m=ws.toString(a<<8|c<<3|h);s.push(m)}t+=i}return dr.decode.bytes=t-n,s};dr.decode.bytes=0;dr.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var n=ws.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 Ii=Te.nsec={};Ii.encode=function(e,t,r){t||(t=xe.alloc(Ii.encodingLength(e))),r||(r=0);let n=r;return r+=2,Be.encode(e.nextDomain,t,r),r+=Be.encode.bytes,dr.encode(e.rrtypes,t,r),r+=dr.encode.bytes,Ii.encode.bytes=r-n,t.writeUInt16BE(Ii.encode.bytes-2,n),t};Ii.encode.bytes=0;Ii.decode=function(e,t){t||(t=0);let r=t;var n={},s=e.readUInt16BE(t);return t+=2,n.nextDomain=Be.decode(e,t),t+=Be.decode.bytes,n.rrtypes=dr.decode(e,t,s-(t-r)),t+=dr.decode.bytes,Ii.decode.bytes=t-r,n};Ii.decode.bytes=0;Ii.encodingLength=function(e){return 2+Be.encodingLength(e.nextDomain)+dr.encodingLength(e.rrtypes)};var Bi=Te.nsec3={};Bi.encode=function(e,t,r){t||(t=xe.alloc(Bi.encodingLength(e))),r||(r=0);let n=r,s=e.salt;if(!xe.isBuffer(s))throw new Error("salt must be a Buffer");let a=e.nextDomain;if(!xe.isBuffer(a))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(a.length,r),r+=1,a.copy(t,r,0,a.length),r+=a.length,dr.encode(e.rrtypes,t,r),r+=dr.encode.bytes,Bi.encode.bytes=r-n,t.writeUInt16BE(Bi.encode.bytes-2,n),t};Bi.encode.bytes=0;Bi.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 a=e.readUInt8(t);t+=1,n.salt=e.slice(t,t+a),t+=a;let i=e.readUInt8(t);return t+=1,n.nextDomain=e.slice(t,t+i),t+=i,n.rrtypes=dr.decode(e,t,s-(t-r)),t+=dr.decode.bytes,Bi.decode.bytes=t-r,n};Bi.decode.bytes=0;Bi.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+dr.encodingLength(e.rrtypes)};var Di=Te.ds={};Di.encode=function(e,t,r){t||(t=xe.alloc(Di.encodingLength(e))),r||(r=0);let n=r,s=e.digest;if(!xe.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,Di.encode.bytes=r-n,t.writeUInt16BE(Di.encode.bytes-2,n),t};Di.encode.bytes=0;Di.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,Di.decode.bytes=t-r,n};Di.decode.bytes=0;Di.encodingLength=function(e){return 6+xe.byteLength(e.digest)};var Fn=Te.sshfp={};Fn.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};Fn.encode=function(t,r,n){r||(r=xe.alloc(Fn.encodingLength(t))),n||(n=0);let s=n;n+=2,r[n]=t.algorithm,n+=1,r[n]=t.hash,n+=1;let a=xe.from(t.fingerprint.toUpperCase(),"hex");if(a.length!==Fn.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return a.copy(r,n),n+=a.byteLength,Fn.encode.bytes=n-s,r.writeUInt16BE(Fn.encode.bytes-2,s),r};Fn.encode.bytes=0;Fn.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 a=Fn.getFingerprintLengthForHashType(s.hash);return s.fingerprint=t.slice(r,r+a).toString("hex").toUpperCase(),r+=a,Fn.decode.bytes=r-n,s};Fn.decode.bytes=0;Fn.encodingLength=function(e){return 4+xe.from(e.fingerprint,"hex").byteLength};var Pi=Te.naptr={};Pi.encode=function(e,t,r){t||(t=xe.alloc(Pi.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,tt.encode(e.flags,t,r),r+=tt.encode.bytes,tt.encode(e.services,t,r),r+=tt.encode.bytes,tt.encode(e.regexp,t,r),r+=tt.encode.bytes,Be.encode(e.replacement,t,r),r+=Be.encode.bytes,Pi.encode.bytes=r-n,t.writeUInt16BE(Pi.encode.bytes-2,n),t};Pi.encode.bytes=0;Pi.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=tt.decode(e,t),t+=tt.decode.bytes,n.services=tt.decode(e,t),t+=tt.decode.bytes,n.regexp=tt.decode(e,t),t+=tt.decode.bytes,n.replacement=Be.decode(e,t),t+=Be.decode.bytes,Pi.decode.bytes=t-r,n};Pi.decode.bytes=0;Pi.encodingLength=function(e){return tt.encodingLength(e.flags)+tt.encodingLength(e.services)+tt.encodingLength(e.regexp)+Be.encodingLength(e.replacement)+6};var $i=Te.tlsa={};$i.encode=function(e,t,r){t||(t=xe.alloc($i.encodingLength(e))),r||(r=0);let n=r,s=e.certificate;if(!xe.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,$i.encode.bytes=r-n,t.writeUInt16BE($i.encode.bytes-2,n),t};$i.encode.bytes=0;$i.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,$i.decode.bytes=t-r,n};$i.decode.bytes=0;$i.encodingLength=function(e){return 5+xe.byteLength(e.certificate)};var D0=Te.record=function(e){switch(e.toUpperCase()){case"A":return ms;case"PTR":return ri;case"CNAME":return TI;case"DNAME":return xI;case"TXT":return hs;case"NULL":return ps;case"AAAA":return vs;case"SRV":return gs;case"HINFO":return ds;case"CAA":return Cn;case"NS":return cs;case"SOA":return ls;case"MX":return Ks;case"OPT":return _n;case"DNSKEY":return zr;case"RRSIG":return Fi;case"RP":return _i;case"NSEC":return Ii;case"NSEC3":return Bi;case"SSHFP":return Fn;case"DS":return Di;case"NAPTR":return Pi;case"TLSA":return $i}return os},Sr=Te.answer={};Sr.encode=function(e,t,r){t||(t=xe.alloc(Sr.encodingLength(e))),r||(r=0);let n=r;if(Be.encode(e.name,t,r),r+=Be.encode.bytes,t.writeUInt16BE(ws.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,_n.encode(e.options||[],t,r),r+=_n.encode.bytes}else{let s=$f.toClass(e.class===void 0?"IN":e.class);e.flush&&(s|=B0),t.writeUInt16BE(s,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let a=D0(e.type);a.encode(e.data,t,r),r+=a.encode.bytes}return Sr.encode.bytes=r-n,t};Sr.encode.bytes=0;Sr.decode=function(e,t){t||(t=0);let r={},n=t;if(r.name=Be.decode(e,t),t+=Be.decode.bytes,r.type=ws.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=_n.decode(e,t+8),t+=8+_n.decode.bytes;else{let s=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=$f.toString(s&$I),r.flush=!!(s&B0);let a=D0(r.type);r.data=a.decode(e,t+8),t+=8+a.decode.bytes}return Sr.decode.bytes=t-n,r};Sr.decode.bytes=0;Sr.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return Be.encodingLength(e.name)+8+D0(e.type).encodingLength(t)};var ni=Te.question={};ni.encode=function(e,t,r){t||(t=xe.alloc(ni.encodingLength(e))),r||(r=0);let n=r;return Be.encode(e.name,t,r),r+=Be.encode.bytes,t.writeUInt16BE(ws.toType(e.type),r),r+=2,t.writeUInt16BE($f.toClass(e.class===void 0?"IN":e.class),r),r+=2,ni.encode.bytes=r-n,e};ni.encode.bytes=0;ni.decode=function(e,t){t||(t=0);let r=t,n={};return n.name=Be.decode(e,t),t+=Be.decode.bytes,n.type=ws.toString(e.readUInt16BE(t)),t+=2,n.class=$f.toString(e.readUInt16BE(t)),t+=2,!!(n.class&k2)&&(n.class&=RI),ni.decode.bytes=t-r,n};ni.decode.bytes=0;ni.encodingLength=function(e){return Be.encodingLength(e.name)+4};Te.AUTHORITATIVE_ANSWER=1024;Te.TRUNCATED_RESPONSE=512;Te.RECURSION_DESIRED=256;Te.RECURSION_AVAILABLE=128;Te.AUTHENTIC_DATA=32;Te.CHECKING_DISABLED=16;Te.DNSSEC_OK=32768;Te.encode=function(e,t,r){let n=!t;n&&(t=xe.alloc(Te.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=[]),ii.encode(e,t,r),r+=ii.encode.bytes,r=bc(e.questions,ni,t,r),r=bc(e.answers,Sr,t,r),r=bc(e.authorities,Sr,t,r),r=bc(e.additionals,Sr,t,r),Te.encode.bytes=r-s,n&&Te.encode.bytes!==t.length?t.slice(0,Te.encode.bytes):t};Te.encode.bytes=0;Te.decode=function(e,t){t||(t=0);let r=t,n=ii.decode(e,t);return t+=ii.decode.bytes,t=Pf(n.questions,ni,e,t),t=Pf(n.answers,Sr,e,t),t=Pf(n.authorities,Sr,e,t),t=Pf(n.additionals,Sr,e,t),Te.decode.bytes=t-r,n};Te.decode.bytes=0;Te.encodingLength=function(e){return ii.encodingLength(e)+no(e.questions||[],ni)+no(e.answers||[],Sr)+no(e.authorities||[],Sr)+no(e.additionals||[],Sr)};Te.streamEncode=function(e){let t=Te.encode(e),r=xe.alloc(2);r.writeUInt16BE(t.byteLength);let n=xe.concat([r,t]);return Te.streamEncode.bytes=n.byteLength,n};Te.streamEncode.bytes=0;Te.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=Te.decode(e.slice(2));return Te.streamDecode.bytes=Te.decode.bytes,r};Te.streamDecode.bytes=0;function no(e,t){let r=0;for(let n=0;n<e.length;n++)r+=t.encodingLength(e[n]);return r}function bc(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 Pf(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 P0=be((so,Cc)=>{(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",a="Invalid `variable` option passed into `_.template`",i="__lodash_hash_undefined__",c=500,l="__lodash_placeholder__",h=1,m=2,A=4,p=1,f=2,E=1,v=2,b=4,w=8,S=16,F=32,D=64,I=128,j=256,q=512,_=30,P="...",k=800,U=16,M=1,W=2,K=3,V=1/0,z=9007199254740991,ne=17976931348623157e292,Ee=NaN,we=4294967295,_e=we-1,He=we>>>1,ue=[["ary",I],["bind",E],["bindKey",v],["curry",w],["curryRight",S],["flip",q],["partial",F],["partialRight",D],["rearg",j]],Ce="[object Arguments]",Oe="[object Array]",sr="[object AsyncFunction]",_t="[object Boolean]",lt="[object Date]",Mt="[object DOMException]",Pt="[object Error]",Qe="[object Function]",bt="[object GeneratorFunction]",Je="[object Map]",ht="[object Number]",qt="[object Null]",ze="[object Object]",Ot="[object Promise]",Rn="[object Proxy]",ar="[object RegExp]",gr="[object Set]",zt="[object String]",br="[object Symbol]",Xs="[object Undefined]",Or="[object WeakMap]",pt="[object WeakSet]",Wt="[object ArrayBuffer]",We="[object DataView]",Cr="[object Float32Array]",Js="[object Float64Array]",Zs="[object Int8Array]",Qs="[object Int16Array]",ea="[object Int32Array]",Oi="[object Uint8Array]",ta="[object Uint8ClampedArray]",bs="[object Uint16Array]",si="[object Uint32Array]",ki=/\b__p \+= '';/g,Va=/\b(__p \+=) '' \+/g,Ga=/(__e\(.*?\)|\b__t\)) \+\n'';/g,za=/&(?:amp|lt|gt|quot|#39);/g,Wa=/[&<>"']/g,Ya=RegExp(za.source),Xa=RegExp(Wa.source),Ja=/<%-([\s\S]+?)%>/g,lo=/<%([\s\S]+?)%>/g,Za=/<%=([\s\S]+?)%>/g,fo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ho=/^\w*$/,po=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cs=/[\\^$.*+?()[\]{}|]/g,go=RegExp(Cs.source),ra=/^\s+/,mo=/\s/,vo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,wo=/\{\n\/\* \[wrapped with (.+)\] \*/,Ao=/,? & /,Eo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yo=/[()=,{}\[\]\/\s]/,So=/\\(\\)?/g,bo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ai=/\w*$/,Qa=/^[-+]0x[0-9a-f]+$/i,Co=/^0b[01]+$/i,Fo=/^\[object .+?Constructor\]$/,_o=/^0o[0-7]+$/i,eu=/^(?:0|[1-9]\d*)$/,ui=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wr=/($^)/,Io=/['\n\r\u2028\u2029\\]/g,Fs="\\ud800-\\udfff",hn="\\u0300-\\u036f",Bo="\\ufe20-\\ufe2f",Do="\\u20d0-\\u20ff",tu=hn+Bo+Do,na="\\u2700-\\u27bf",ru="a-z\\xdf-\\xf6\\xf8-\\xff",_s="\\xac\\xb1\\xd7\\xf7",kt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Po="\\u2000-\\u206f",$o=" \\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",nu="A-Z\\xc0-\\xd6\\xd8-\\xde",oi="\\ufe0e\\ufe0f",ur=_s+kt+Po+$o,Dt="['\u2019]",Ro="["+Fs+"]",ia="["+ur+"]",or="["+tu+"]",sa="\\d+",iu="["+na+"]",su="["+ru+"]",aa="[^"+Fs+ur+sa+na+ru+nu+"]",ci="\\ud83c[\\udffb-\\udfff]",oa="(?:"+or+"|"+ci+")",au="[^"+Fs+"]",ca="(?:\\ud83c[\\udde6-\\uddff]){2}",la="[\\ud800-\\udbff][\\udc00-\\udfff]",kr="["+nu+"]",$="\\u200d",T="(?:"+su+"|"+aa+")",L="(?:"+kr+"|"+aa+")",Z="(?:"+Dt+"(?:d|ll|m|re|s|t|ve))?",pe="(?:"+Dt+"(?:D|LL|M|RE|S|T|VE))?",me=oa+"?",Fe="["+oi+"]?",Pe="(?:"+$+"(?:"+[au,ca,la].join("|")+")"+Fe+me+")*",wt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mr=Fe+me+Pe,vr="(?:"+[iu,ca,la].join("|")+")"+mr,pn="(?:"+[au+or+"?",or,ca,la,Ro].join("|")+")",Is=RegExp(Dt,"g"),Nr=RegExp(or,"g"),wr=RegExp(ci+"(?="+ci+")|"+pn+mr,"g"),Bs=RegExp([kr+"?"+su+"+"+Z+"(?="+[ia,kr,"$"].join("|")+")",L+"+"+pe+"(?="+[ia,kr+T,"$"].join("|")+")",kr+"?"+T+"+"+Z,kr+"+"+pe,Nt,wt,sa,vr].join("|"),"g"),Tn=RegExp("["+$+Fs+tu+oi+"]"),fa=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xf=["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"],Jf=-1,Ct={};Ct[Cr]=Ct[Js]=Ct[Zs]=Ct[Qs]=Ct[ea]=Ct[Oi]=Ct[ta]=Ct[bs]=Ct[si]=!0,Ct[Ce]=Ct[Oe]=Ct[Wt]=Ct[_t]=Ct[We]=Ct[lt]=Ct[Pt]=Ct[Qe]=Ct[Je]=Ct[ht]=Ct[ze]=Ct[ar]=Ct[gr]=Ct[zt]=Ct[Or]=!1;var yt={};yt[Ce]=yt[Oe]=yt[Wt]=yt[We]=yt[_t]=yt[lt]=yt[Cr]=yt[Js]=yt[Zs]=yt[Qs]=yt[ea]=yt[Je]=yt[ht]=yt[ze]=yt[ar]=yt[gr]=yt[zt]=yt[br]=yt[Oi]=yt[ta]=yt[bs]=yt[si]=!0,yt[Pt]=yt[Qe]=yt[Or]=!1;var Zf={\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"},Qf={"&":"&","<":"<",">":">",'"':""","'":"'"},eh={"&":"&","<":"<",">":">",""":'"',"'":"'"},th={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rh=parseFloat,nh=parseInt,Nc=typeof global=="object"&&global&&global.Object===Object&&global,ih=typeof self=="object"&&self&&self.Object===Object&&self,Yt=Nc||ih||Function("return this")(),To=typeof so=="object"&&so&&!so.nodeType&&so,Ni=To&&typeof Cc=="object"&&Cc&&!Cc.nodeType&&Cc,Lc=Ni&&Ni.exports===To,xo=Lc&&Nc.process,Yr=function(){try{var te=Ni&&Ni.require&&Ni.require("util").types;return te||xo&&xo.binding&&xo.binding("util")}catch{}}(),Uc=Yr&&Yr.isArrayBuffer,Hc=Yr&&Yr.isDate,jc=Yr&&Yr.isMap,Mc=Yr&&Yr.isRegExp,qc=Yr&&Yr.isSet,Kc=Yr&&Yr.isTypedArray;function Lr(te,ce,ae){switch(ae.length){case 0:return te.call(ce);case 1:return te.call(ce,ae[0]);case 2:return te.call(ce,ae[0],ae[1]);case 3:return te.call(ce,ae[0],ae[1],ae[2])}return te.apply(ce,ae)}function sh(te,ce,ae,$e){for(var qe=-1,st=te==null?0:te.length;++qe<st;){var Rt=te[qe];ce($e,Rt,ae(Rt),te)}return $e}function Xr(te,ce){for(var ae=-1,$e=te==null?0:te.length;++ae<$e&&ce(te[ae],ae,te)!==!1;);return te}function B(te,ce){for(var ae=te==null?0:te.length;ae--&&ce(te[ae],ae,te)!==!1;);return te}function Ve(te,ce){for(var ae=-1,$e=te==null?0:te.length;++ae<$e;)if(!ce(te[ae],ae,te))return!1;return!0}function dn(te,ce){for(var ae=-1,$e=te==null?0:te.length,qe=0,st=[];++ae<$e;){var Rt=te[ae];ce(Rt,ae,te)&&(st[qe++]=Rt)}return st}function Ur(te,ce){var ae=te==null?0:te.length;return!!ae&&Ds(te,ce,0)>-1}function ha(te,ce,ae){for(var $e=-1,qe=te==null?0:te.length;++$e<qe;)if(ae(ce,te[$e]))return!0;return!1}function ee(te,ce){for(var ae=-1,$e=te==null?0:te.length,qe=Array($e);++ae<$e;)qe[ae]=ce(te[ae],ae,te);return qe}function gn(te,ce){for(var ae=-1,$e=ce.length,qe=te.length;++ae<$e;)te[qe+ae]=ce[ae];return te}function Oo(te,ce,ae,$e){var qe=-1,st=te==null?0:te.length;for($e&&st&&(ae=te[++qe]);++qe<st;)ae=ce(ae,te[qe],qe,te);return ae}function hd(te,ce,ae,$e){var qe=te==null?0:te.length;for($e&&qe&&(ae=te[--qe]);qe--;)ae=ce(ae,te[qe],qe,te);return ae}function Vc(te,ce){for(var ae=-1,$e=te==null?0:te.length;++ae<$e;)if(ce(te[ae],ae,te))return!0;return!1}var $t=Li("length");function pd(te){return te.split("")}function ko(te){return te.match(Eo)||[]}function ke(te,ce,ae){var $e;return ae(te,function(qe,st,Rt){if(ce(qe,st,Rt))return $e=st,!1}),$e}function Xt(te,ce,ae,$e){for(var qe=te.length,st=ae+($e?1:-1);$e?st--:++st<qe;)if(ce(te[st],st,te))return st;return-1}function Ds(te,ce,ae){return ce===ce?Jc(te,ce,ae):Xt(te,xn,ae)}function ah(te,ce,ae,$e){for(var qe=ae-1,st=te.length;++qe<st;)if($e(te[qe],ce))return qe;return-1}function xn(te){return te!==te}function No(te,ce){var ae=te==null?0:te.length;return ae?uu(te,ce)/ae:Ee}function Li(te){return function(ce){return ce==null?e:ce[te]}}function he(te){return function(ce){return te==null?e:te[ce]}}function Gc(te,ce,ae,$e,qe){return qe(te,function(st,Rt,At){ae=$e?($e=!1,st):ce(ae,st,Rt,At)}),ae}function zc(te,ce){var ae=te.length;for(te.sort(ce);ae--;)te[ae]=te[ae].value;return te}function uu(te,ce){for(var ae,$e=-1,qe=te.length;++$e<qe;){var st=ce(te[$e]);st!==e&&(ae=ae===e?st:ae+st)}return ae}function Lo(te,ce){for(var ae=-1,$e=Array(te);++ae<te;)$e[ae]=ce(ae);return $e}function uh(te,ce){return ee(ce,function(ae){return[ae,te[ae]]})}function Uo(te){return te&&te.slice(0,lu(te)+1).replace(ra,"")}function Fr(te){return function(ce){return te(ce)}}function pa(te,ce){return ee(ce,function(ae){return te[ae]})}function da(te,ce){return te.has(ce)}function ou(te,ce){for(var ae=-1,$e=te.length;++ae<$e&&Ds(ce,te[ae],0)>-1;);return ae}function Wc(te,ce){for(var ae=te.length;ae--&&Ds(ce,te[ae],0)>-1;);return ae}function Yc(te,ce){for(var ae=te.length,$e=0;ae--;)te[ae]===ce&&++$e;return $e}var Ho=he(Zf),oh=he(Qf);function Xc(te){return"\\"+th[te]}function ch(te,ce){return te==null?e:te[ce]}function Ui(te){return Tn.test(te)}function lh(te){return fa.test(te)}function fh(te){for(var ce,ae=[];!(ce=te.next()).done;)ae.push(ce.value);return ae}function jo(te){var ce=-1,ae=Array(te.size);return te.forEach(function($e,qe){ae[++ce]=[qe,$e]}),ae}function Ar(te,ce){return function(ae){return te(ce(ae))}}function mn(te,ce){for(var ae=-1,$e=te.length,qe=0,st=[];++ae<$e;){var Rt=te[ae];(Rt===ce||Rt===l)&&(te[ae]=l,st[qe++]=ae)}return st}function vn(te){var ce=-1,ae=Array(te.size);return te.forEach(function($e){ae[++ce]=$e}),ae}function cu(te){var ce=-1,ae=Array(te.size);return te.forEach(function($e){ae[++ce]=[$e,$e]}),ae}function Jc(te,ce,ae){for(var $e=ae-1,qe=te.length;++$e<qe;)if(te[$e]===ce)return $e;return-1}function hh(te,ce,ae){for(var $e=ae+1;$e--;)if(te[$e]===ce)return $e;return $e}function Hi(te){return Ui(te)?Qc(te):$t(te)}function Jr(te){return Ui(te)?ph(te):pd(te)}function lu(te){for(var ce=te.length;ce--&&mo.test(te.charAt(ce)););return ce}var Zc=he(eh);function Qc(te){for(var ce=wr.lastIndex=0;wr.test(te);)++ce;return ce}function ph(te){return te.match(wr)||[]}function dh(te){return te.match(Bs)||[]}var gh=function te(ce){ce=ce==null?Yt:On.defaults(Yt.Object(),ce,On.pick(Yt,Xf));var ae=ce.Array,$e=ce.Date,qe=ce.Error,st=ce.Function,Rt=ce.Math,At=ce.Object,fu=ce.RegExp,mh=ce.String,Zr=ce.TypeError,hu=ae.prototype,el=st.prototype,ji=At.prototype,Yn=ce["__core-js_shared__"],pu=el.toString,ot=ji.hasOwnProperty,vh=0,du=function(){var u=/[^.]+$/.exec(Yn&&Yn.keys&&Yn.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),gu=ji.toString,wh=pu.call(At),Ah=Yt._,Eh=fu("^"+pu.call(ot).replace(Cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mu=Lc?ce.Buffer:e,li=ce.Symbol,vu=ce.Uint8Array,tl=mu?mu.allocUnsafe:e,wu=Ar(At.getPrototypeOf,At),rl=At.create,nl=ji.propertyIsEnumerable,dt=hu.splice,il=li?li.isConcatSpreadable:e,Mi=li?li.iterator:e,qi=li?li.toStringTag:e,Au=function(){try{var u=Aa(At,"defineProperty");return u({},"",{}),u}catch{}}(),y=ce.clearTimeout!==Yt.clearTimeout&&ce.clearTimeout,x=$e&&$e.now!==Yt.Date.now&&$e.now,Y=ce.setTimeout!==Yt.setTimeout&&ce.setTimeout,H=Rt.ceil,ie=Rt.floor,oe=At.getOwnPropertySymbols,Et=mu?mu.isBuffer:e,Lt=ce.isFinite,AA=hu.join,EA=Ar(At.keys,At),Qt=Rt.max,_r=Rt.min,yA=$e.now,SA=ce.parseInt,dd=Rt.random,bA=hu.reverse,yh=Aa(ce,"DataView"),Mo=Aa(ce,"Map"),Sh=Aa(ce,"Promise"),Eu=Aa(ce,"Set"),qo=Aa(ce,"WeakMap"),Ko=Aa(At,"create"),sl=qo&&new qo,yu={},CA=Ea(yh),FA=Ea(Mo),_A=Ea(Sh),IA=Ea(Eu),BA=Ea(qo),al=li?li.prototype:e,Vo=al?al.valueOf:e,gd=al?al.toString:e;function O(u){if(Ut(u)&&!Ge(u)&&!(u instanceof it)){if(u instanceof kn)return u;if(ot.call(u,"__wrapped__"))return m1(u)}return new kn(u)}var Su=function(){function u(){}return function(o){if(!Tt(o))return{};if(rl)return rl(o);u.prototype=o;var g=new u;return u.prototype=e,g}}();function ul(){}function kn(u,o){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=e}O.templateSettings={escape:Ja,evaluate:lo,interpolate:Za,variable:"",imports:{_:O}},O.prototype=ul.prototype,O.prototype.constructor=O,kn.prototype=Su(ul.prototype),kn.prototype.constructor=kn;function it(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=we,this.__views__=[]}function DA(){var u=new it(this.__wrapped__);return u.__actions__=Qr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Qr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Qr(this.__views__),u}function PA(){if(this.__filtered__){var u=new it(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function $A(){var u=this.__wrapped__.value(),o=this.__dir__,g=Ge(u),C=o<0,R=g?u.length:0,N=qE(0,R,this.__views__),G=N.start,X=N.end,re=X-G,de=C?X:G-1,ge=this.__iteratees__,ve=ge.length,Ie=0,Re=_r(re,this.__takeCount__);if(!g||!C&&R==re&&Re==re)return Ud(u,this.__actions__);var je=[];e:for(;re--&&Ie<Re;){de+=o;for(var Ze=-1,Me=u[de];++Ze<ve;){var nt=ge[Ze],at=nt.iteratee,En=nt.type,Mr=at(Me);if(En==W)Me=Mr;else if(!Mr){if(En==M)continue e;break e}}je[Ie++]=Me}return je}it.prototype=Su(ul.prototype),it.prototype.constructor=it;function ga(u){var o=-1,g=u==null?0:u.length;for(this.clear();++o<g;){var C=u[o];this.set(C[0],C[1])}}function RA(){this.__data__=Ko?Ko(null):{},this.size=0}function TA(u){var o=this.has(u)&&delete this.__data__[u];return this.size-=o?1:0,o}function xA(u){var o=this.__data__;if(Ko){var g=o[u];return g===i?e:g}return ot.call(o,u)?o[u]:e}function OA(u){var o=this.__data__;return Ko?o[u]!==e:ot.call(o,u)}function kA(u,o){var g=this.__data__;return this.size+=this.has(u)?0:1,g[u]=Ko&&o===e?i:o,this}ga.prototype.clear=RA,ga.prototype.delete=TA,ga.prototype.get=xA,ga.prototype.has=OA,ga.prototype.set=kA;function Ki(u){var o=-1,g=u==null?0:u.length;for(this.clear();++o<g;){var C=u[o];this.set(C[0],C[1])}}function NA(){this.__data__=[],this.size=0}function LA(u){var o=this.__data__,g=ol(o,u);if(g<0)return!1;var C=o.length-1;return g==C?o.pop():dt.call(o,g,1),--this.size,!0}function UA(u){var o=this.__data__,g=ol(o,u);return g<0?e:o[g][1]}function HA(u){return ol(this.__data__,u)>-1}function jA(u,o){var g=this.__data__,C=ol(g,u);return C<0?(++this.size,g.push([u,o])):g[C][1]=o,this}Ki.prototype.clear=NA,Ki.prototype.delete=LA,Ki.prototype.get=UA,Ki.prototype.has=HA,Ki.prototype.set=jA;function Vi(u){var o=-1,g=u==null?0:u.length;for(this.clear();++o<g;){var C=u[o];this.set(C[0],C[1])}}function MA(){this.size=0,this.__data__={hash:new ga,map:new(Mo||Ki),string:new ga}}function qA(u){var o=El(this,u).delete(u);return this.size-=o?1:0,o}function KA(u){return El(this,u).get(u)}function VA(u){return El(this,u).has(u)}function GA(u,o){var g=El(this,u),C=g.size;return g.set(u,o),this.size+=g.size==C?0:1,this}Vi.prototype.clear=MA,Vi.prototype.delete=qA,Vi.prototype.get=KA,Vi.prototype.has=VA,Vi.prototype.set=GA;function ma(u){var o=-1,g=u==null?0:u.length;for(this.__data__=new Vi;++o<g;)this.add(u[o])}function zA(u){return this.__data__.set(u,i),this}function WA(u){return this.__data__.has(u)}ma.prototype.add=ma.prototype.push=zA,ma.prototype.has=WA;function Xn(u){var o=this.__data__=new Ki(u);this.size=o.size}function YA(){this.__data__=new Ki,this.size=0}function XA(u){var o=this.__data__,g=o.delete(u);return this.size=o.size,g}function JA(u){return this.__data__.get(u)}function ZA(u){return this.__data__.has(u)}function QA(u,o){var g=this.__data__;if(g instanceof Ki){var C=g.__data__;if(!Mo||C.length<r-1)return C.push([u,o]),this.size=++g.size,this;g=this.__data__=new Vi(C)}return g.set(u,o),this.size=g.size,this}Xn.prototype.clear=YA,Xn.prototype.delete=XA,Xn.prototype.get=JA,Xn.prototype.has=ZA,Xn.prototype.set=QA;function md(u,o){var g=Ge(u),C=!g&&ya(u),R=!g&&!C&&xs(u),N=!g&&!C&&!R&&_u(u),G=g||C||R||N,X=G?Lo(u.length,mh):[],re=X.length;for(var de in u)(o||ot.call(u,de))&&!(G&&(de=="length"||R&&(de=="offset"||de=="parent")||N&&(de=="buffer"||de=="byteLength"||de=="byteOffset")||Yi(de,re)))&&X.push(de);return X}function vd(u){var o=u.length;return o?u[Th(0,o-1)]:e}function eE(u,o){return yl(Qr(u),va(o,0,u.length))}function tE(u){return yl(Qr(u))}function bh(u,o,g){(g!==e&&!Jn(u[o],g)||g===e&&!(o in u))&&Gi(u,o,g)}function Go(u,o,g){var C=u[o];(!(ot.call(u,o)&&Jn(C,g))||g===e&&!(o in u))&&Gi(u,o,g)}function ol(u,o){for(var g=u.length;g--;)if(Jn(u[g][0],o))return g;return-1}function rE(u,o,g,C){return Ps(u,function(R,N,G){o(C,R,g(R),G)}),C}function wd(u,o){return u&&hi(o,cr(o),u)}function nE(u,o){return u&&hi(o,tn(o),u)}function Gi(u,o,g){o=="__proto__"&&Au?Au(u,o,{configurable:!0,enumerable:!0,value:g,writable:!0}):u[o]=g}function Ch(u,o){for(var g=-1,C=o.length,R=ae(C),N=u==null;++g<C;)R[g]=N?e:ip(u,o[g]);return R}function va(u,o,g){return u===u&&(g!==e&&(u=u<=g?u:g),o!==e&&(u=u>=o?u:o)),u}function Nn(u,o,g,C,R,N){var G,X=o&h,re=o&m,de=o&A;if(g&&(G=R?g(u,C,R,N):g(u)),G!==e)return G;if(!Tt(u))return u;var ge=Ge(u);if(ge){if(G=VE(u),!X)return Qr(u,G)}else{var ve=Ir(u),Ie=ve==Qe||ve==bt;if(xs(u))return Md(u,X);if(ve==ze||ve==Ce||Ie&&!R){if(G=re||Ie?{}:u1(u),!X)return re?xE(u,nE(G,u)):TE(u,wd(G,u))}else{if(!yt[ve])return R?u:{};G=GE(u,ve,X)}}N||(N=new Xn);var Re=N.get(u);if(Re)return Re;N.set(u,G),k1(u)?u.forEach(function(Me){G.add(Nn(Me,o,g,Me,u,N))}):x1(u)&&u.forEach(function(Me,nt){G.set(nt,Nn(Me,o,g,nt,u,N))});var je=de?re?Kh:qh:re?tn:cr,Ze=ge?e:je(u);return Xr(Ze||u,function(Me,nt){Ze&&(nt=Me,Me=u[nt]),Go(G,nt,Nn(Me,o,g,nt,u,N))}),G}function iE(u){var o=cr(u);return function(g){return Ad(g,u,o)}}function Ad(u,o,g){var C=g.length;if(u==null)return!C;for(u=At(u);C--;){var R=g[C],N=o[R],G=u[R];if(G===e&&!(R in u)||!N(G))return!1}return!0}function Ed(u,o,g){if(typeof u!="function")throw new Zr(s);return Qo(function(){u.apply(e,g)},o)}function zo(u,o,g,C){var R=-1,N=Ur,G=!0,X=u.length,re=[],de=o.length;if(!X)return re;g&&(o=ee(o,Fr(g))),C?(N=ha,G=!1):o.length>=r&&(N=da,G=!1,o=new ma(o));e:for(;++R<X;){var ge=u[R],ve=g==null?ge:g(ge);if(ge=C||ge!==0?ge:0,G&&ve===ve){for(var Ie=de;Ie--;)if(o[Ie]===ve)continue e;re.push(ge)}else N(o,ve,C)||re.push(ge)}return re}var Ps=zd(fi),yd=zd(_h,!0);function sE(u,o){var g=!0;return Ps(u,function(C,R,N){return g=!!o(C,R,N),g}),g}function cl(u,o,g){for(var C=-1,R=u.length;++C<R;){var N=u[C],G=o(N);if(G!=null&&(X===e?G===G&&!An(G):g(G,X)))var X=G,re=N}return re}function aE(u,o,g,C){var R=u.length;for(g=Xe(g),g<0&&(g=-g>R?0:R+g),C=C===e||C>R?R:Xe(C),C<0&&(C+=R),C=g>C?0:L1(C);g<C;)u[g++]=o;return u}function Sd(u,o){var g=[];return Ps(u,function(C,R,N){o(C,R,N)&&g.push(C)}),g}function Er(u,o,g,C,R){var N=-1,G=u.length;for(g||(g=WE),R||(R=[]);++N<G;){var X=u[N];o>0&&g(X)?o>1?Er(X,o-1,g,C,R):gn(R,X):C||(R[R.length]=X)}return R}var Fh=Wd(),bd=Wd(!0);function fi(u,o){return u&&Fh(u,o,cr)}function _h(u,o){return u&&bd(u,o,cr)}function ll(u,o){return dn(o,function(g){return Xi(u[g])})}function wa(u,o){o=Rs(o,u);for(var g=0,C=o.length;u!=null&&g<C;)u=u[pi(o[g++])];return g&&g==C?u:e}function Cd(u,o,g){var C=o(u);return Ge(u)?C:gn(C,g(u))}function Hr(u){return u==null?u===e?Xs:qt:qi&&qi in At(u)?ME(u):t4(u)}function Ih(u,o){return u>o}function uE(u,o){return u!=null&&ot.call(u,o)}function oE(u,o){return u!=null&&o in At(u)}function cE(u,o,g){return u>=_r(o,g)&&u<Qt(o,g)}function Bh(u,o,g){for(var C=g?ha:Ur,R=u[0].length,N=u.length,G=N,X=ae(N),re=1/0,de=[];G--;){var ge=u[G];G&&o&&(ge=ee(ge,Fr(o))),re=_r(ge.length,re),X[G]=!g&&(o||R>=120&&ge.length>=120)?new ma(G&&ge):e}ge=u[0];var ve=-1,Ie=X[0];e:for(;++ve<R&&de.length<re;){var Re=ge[ve],je=o?o(Re):Re;if(Re=g||Re!==0?Re:0,!(Ie?da(Ie,je):C(de,je,g))){for(G=N;--G;){var Ze=X[G];if(!(Ze?da(Ze,je):C(u[G],je,g)))continue e}Ie&&Ie.push(je),de.push(Re)}}return de}function lE(u,o,g,C){return fi(u,function(R,N,G){o(C,g(R),N,G)}),C}function Wo(u,o,g){o=Rs(o,u),u=f1(u,o);var C=u==null?u:u[pi(Un(o))];return C==null?e:Lr(C,u,g)}function Fd(u){return Ut(u)&&Hr(u)==Ce}function fE(u){return Ut(u)&&Hr(u)==Wt}function hE(u){return Ut(u)&&Hr(u)==lt}function Yo(u,o,g,C,R){return u===o?!0:u==null||o==null||!Ut(u)&&!Ut(o)?u!==u&&o!==o:pE(u,o,g,C,Yo,R)}function pE(u,o,g,C,R,N){var G=Ge(u),X=Ge(o),re=G?Oe:Ir(u),de=X?Oe:Ir(o);re=re==Ce?ze:re,de=de==Ce?ze:de;var ge=re==ze,ve=de==ze,Ie=re==de;if(Ie&&xs(u)){if(!xs(o))return!1;G=!0,ge=!1}if(Ie&&!ge)return N||(N=new Xn),G||_u(u)?i1(u,o,g,C,R,N):HE(u,o,re,g,C,R,N);if(!(g&p)){var Re=ge&&ot.call(u,"__wrapped__"),je=ve&&ot.call(o,"__wrapped__");if(Re||je){var Ze=Re?u.value():u,Me=je?o.value():o;return N||(N=new Xn),R(Ze,Me,g,C,N)}}return Ie?(N||(N=new Xn),jE(u,o,g,C,R,N)):!1}function dE(u){return Ut(u)&&Ir(u)==Je}function Dh(u,o,g,C){var R=g.length,N=R,G=!C;if(u==null)return!N;for(u=At(u);R--;){var X=g[R];if(G&&X[2]?X[1]!==u[X[0]]:!(X[0]in u))return!1}for(;++R<N;){X=g[R];var re=X[0],de=u[re],ge=X[1];if(G&&X[2]){if(de===e&&!(re in u))return!1}else{var ve=new Xn;if(C)var Ie=C(de,ge,re,u,o,ve);if(!(Ie===e?Yo(ge,de,p|f,C,ve):Ie))return!1}}return!0}function _d(u){if(!Tt(u)||XE(u))return!1;var o=Xi(u)?Eh:Fo;return o.test(Ea(u))}function gE(u){return Ut(u)&&Hr(u)==ar}function mE(u){return Ut(u)&&Ir(u)==gr}function vE(u){return Ut(u)&&Il(u.length)&&!!Ct[Hr(u)]}function Id(u){return typeof u=="function"?u:u==null?rn:typeof u=="object"?Ge(u)?Pd(u[0],u[1]):Dd(u):Y1(u)}function Ph(u){if(!Zo(u))return EA(u);var o=[];for(var g in At(u))ot.call(u,g)&&g!="constructor"&&o.push(g);return o}function wE(u){if(!Tt(u))return e4(u);var o=Zo(u),g=[];for(var C in u)C=="constructor"&&(o||!ot.call(u,C))||g.push(C);return g}function $h(u,o){return u<o}function Bd(u,o){var g=-1,C=en(u)?ae(u.length):[];return Ps(u,function(R,N,G){C[++g]=o(R,N,G)}),C}function Dd(u){var o=Gh(u);return o.length==1&&o[0][2]?c1(o[0][0],o[0][1]):function(g){return g===u||Dh(g,u,o)}}function Pd(u,o){return Wh(u)&&o1(o)?c1(pi(u),o):function(g){var C=ip(g,u);return C===e&&C===o?sp(g,u):Yo(o,C,p|f)}}function fl(u,o,g,C,R){u!==o&&Fh(o,function(N,G){if(R||(R=new Xn),Tt(N))AE(u,o,G,g,fl,C,R);else{var X=C?C(Xh(u,G),N,G+"",u,o,R):e;X===e&&(X=N),bh(u,G,X)}},tn)}function AE(u,o,g,C,R,N,G){var X=Xh(u,g),re=Xh(o,g),de=G.get(re);if(de){bh(u,g,de);return}var ge=N?N(X,re,g+"",u,o,G):e,ve=ge===e;if(ve){var Ie=Ge(re),Re=!Ie&&xs(re),je=!Ie&&!Re&&_u(re);ge=re,Ie||Re||je?Ge(X)?ge=X:Kt(X)?ge=Qr(X):Re?(ve=!1,ge=Md(re,!0)):je?(ve=!1,ge=qd(re,!0)):ge=[]:ec(re)||ya(re)?(ge=X,ya(X)?ge=U1(X):(!Tt(X)||Xi(X))&&(ge=u1(re))):ve=!1}ve&&(G.set(re,ge),R(ge,re,C,N,G),G.delete(re)),bh(u,g,ge)}function $d(u,o){var g=u.length;if(g)return o+=o<0?g:0,Yi(o,g)?u[o]:e}function Rd(u,o,g){o.length?o=ee(o,function(N){return Ge(N)?function(G){return wa(G,N.length===1?N[0]:N)}:N}):o=[rn];var C=-1;o=ee(o,Fr(Le()));var R=Bd(u,function(N,G,X){var re=ee(o,function(de){return de(N)});return{criteria:re,index:++C,value:N}});return zc(R,function(N,G){return RE(N,G,g)})}function EE(u,o){return Td(u,o,function(g,C){return sp(u,C)})}function Td(u,o,g){for(var C=-1,R=o.length,N={};++C<R;){var G=o[C],X=wa(u,G);g(X,G)&&Xo(N,Rs(G,u),X)}return N}function yE(u){return function(o){return wa(o,u)}}function Rh(u,o,g,C){var R=C?ah:Ds,N=-1,G=o.length,X=u;for(u===o&&(o=Qr(o)),g&&(X=ee(u,Fr(g)));++N<G;)for(var re=0,de=o[N],ge=g?g(de):de;(re=R(X,ge,re,C))>-1;)X!==u&&dt.call(X,re,1),dt.call(u,re,1);return u}function xd(u,o){for(var g=u?o.length:0,C=g-1;g--;){var R=o[g];if(g==C||R!==N){var N=R;Yi(R)?dt.call(u,R,1):kh(u,R)}}return u}function Th(u,o){return u+ie(dd()*(o-u+1))}function SE(u,o,g,C){for(var R=-1,N=Qt(H((o-u)/(g||1)),0),G=ae(N);N--;)G[C?N:++R]=u,u+=g;return G}function xh(u,o){var g="";if(!u||o<1||o>z)return g;do o%2&&(g+=u),o=ie(o/2),o&&(u+=u);while(o);return g}function et(u,o){return Jh(l1(u,o,rn),u+"")}function bE(u){return vd(Iu(u))}function CE(u,o){var g=Iu(u);return yl(g,va(o,0,g.length))}function Xo(u,o,g,C){if(!Tt(u))return u;o=Rs(o,u);for(var R=-1,N=o.length,G=N-1,X=u;X!=null&&++R<N;){var re=pi(o[R]),de=g;if(re==="__proto__"||re==="constructor"||re==="prototype")return u;if(R!=G){var ge=X[re];de=C?C(ge,re,X):e,de===e&&(de=Tt(ge)?ge:Yi(o[R+1])?[]:{})}Go(X,re,de),X=X[re]}return u}var Od=sl?function(u,o){return sl.set(u,o),u}:rn,FE=Au?function(u,o){return Au(u,"toString",{configurable:!0,enumerable:!1,value:up(o),writable:!0})}:rn;function _E(u){return yl(Iu(u))}function Ln(u,o,g){var C=-1,R=u.length;o<0&&(o=-o>R?0:R+o),g=g>R?R:g,g<0&&(g+=R),R=o>g?0:g-o>>>0,o>>>=0;for(var N=ae(R);++C<R;)N[C]=u[C+o];return N}function IE(u,o){var g;return Ps(u,function(C,R,N){return g=o(C,R,N),!g}),!!g}function hl(u,o,g){var C=0,R=u==null?C:u.length;if(typeof o=="number"&&o===o&&R<=He){for(;C<R;){var N=C+R>>>1,G=u[N];G!==null&&!An(G)&&(g?G<=o:G<o)?C=N+1:R=N}return R}return Oh(u,o,rn,g)}function Oh(u,o,g,C){var R=0,N=u==null?0:u.length;if(N===0)return 0;o=g(o);for(var G=o!==o,X=o===null,re=An(o),de=o===e;R<N;){var ge=ie((R+N)/2),ve=g(u[ge]),Ie=ve!==e,Re=ve===null,je=ve===ve,Ze=An(ve);if(G)var Me=C||je;else de?Me=je&&(C||Ie):X?Me=je&&Ie&&(C||!Re):re?Me=je&&Ie&&!Re&&(C||!Ze):Re||Ze?Me=!1:Me=C?ve<=o:ve<o;Me?R=ge+1:N=ge}return _r(N,_e)}function kd(u,o){for(var g=-1,C=u.length,R=0,N=[];++g<C;){var G=u[g],X=o?o(G):G;if(!g||!Jn(X,re)){var re=X;N[R++]=G===0?0:G}}return N}function Nd(u){return typeof u=="number"?u:An(u)?Ee:+u}function wn(u){if(typeof u=="string")return u;if(Ge(u))return ee(u,wn)+"";if(An(u))return gd?gd.call(u):"";var o=u+"";return o=="0"&&1/u==-V?"-0":o}function $s(u,o,g){var C=-1,R=Ur,N=u.length,G=!0,X=[],re=X;if(g)G=!1,R=ha;else if(N>=r){var de=o?null:LE(u);if(de)return vn(de);G=!1,R=da,re=new ma}else re=o?[]:X;e:for(;++C<N;){var ge=u[C],ve=o?o(ge):ge;if(ge=g||ge!==0?ge:0,G&&ve===ve){for(var Ie=re.length;Ie--;)if(re[Ie]===ve)continue e;o&&re.push(ve),X.push(ge)}else R(re,ve,g)||(re!==X&&re.push(ve),X.push(ge))}return X}function kh(u,o){return o=Rs(o,u),u=f1(u,o),u==null||delete u[pi(Un(o))]}function Ld(u,o,g,C){return Xo(u,o,g(wa(u,o)),C)}function pl(u,o,g,C){for(var R=u.length,N=C?R:-1;(C?N--:++N<R)&&o(u[N],N,u););return g?Ln(u,C?0:N,C?N+1:R):Ln(u,C?N+1:0,C?R:N)}function Ud(u,o){var g=u;return g instanceof it&&(g=g.value()),Oo(o,function(C,R){return R.func.apply(R.thisArg,gn([C],R.args))},g)}function Nh(u,o,g){var C=u.length;if(C<2)return C?$s(u[0]):[];for(var R=-1,N=ae(C);++R<C;)for(var G=u[R],X=-1;++X<C;)X!=R&&(N[R]=zo(N[R]||G,u[X],o,g));return $s(Er(N,1),o,g)}function Hd(u,o,g){for(var C=-1,R=u.length,N=o.length,G={};++C<R;){var X=C<N?o[C]:e;g(G,u[C],X)}return G}function Lh(u){return Kt(u)?u:[]}function Uh(u){return typeof u=="function"?u:rn}function Rs(u,o){return Ge(u)?u:Wh(u,o)?[u]:g1(mt(u))}var BE=et;function Ts(u,o,g){var C=u.length;return g=g===e?C:g,!o&&g>=C?u:Ln(u,o,g)}var jd=y||function(u){return Yt.clearTimeout(u)};function Md(u,o){if(o)return u.slice();var g=u.length,C=tl?tl(g):new u.constructor(g);return u.copy(C),C}function Hh(u){var o=new u.constructor(u.byteLength);return new vu(o).set(new vu(u)),o}function DE(u,o){var g=o?Hh(u.buffer):u.buffer;return new u.constructor(g,u.byteOffset,u.byteLength)}function PE(u){var o=new u.constructor(u.source,ai.exec(u));return o.lastIndex=u.lastIndex,o}function $E(u){return Vo?At(Vo.call(u)):{}}function qd(u,o){var g=o?Hh(u.buffer):u.buffer;return new u.constructor(g,u.byteOffset,u.length)}function Kd(u,o){if(u!==o){var g=u!==e,C=u===null,R=u===u,N=An(u),G=o!==e,X=o===null,re=o===o,de=An(o);if(!X&&!de&&!N&&u>o||N&&G&&re&&!X&&!de||C&&G&&re||!g&&re||!R)return 1;if(!C&&!N&&!de&&u<o||de&&g&&R&&!C&&!N||X&&g&&R||!G&&R||!re)return-1}return 0}function RE(u,o,g){for(var C=-1,R=u.criteria,N=o.criteria,G=R.length,X=g.length;++C<G;){var re=Kd(R[C],N[C]);if(re){if(C>=X)return re;var de=g[C];return re*(de=="desc"?-1:1)}}return u.index-o.index}function Vd(u,o,g,C){for(var R=-1,N=u.length,G=g.length,X=-1,re=o.length,de=Qt(N-G,0),ge=ae(re+de),ve=!C;++X<re;)ge[X]=o[X];for(;++R<G;)(ve||R<N)&&(ge[g[R]]=u[R]);for(;de--;)ge[X++]=u[R++];return ge}function Gd(u,o,g,C){for(var R=-1,N=u.length,G=-1,X=g.length,re=-1,de=o.length,ge=Qt(N-X,0),ve=ae(ge+de),Ie=!C;++R<ge;)ve[R]=u[R];for(var Re=R;++re<de;)ve[Re+re]=o[re];for(;++G<X;)(Ie||R<N)&&(ve[Re+g[G]]=u[R++]);return ve}function Qr(u,o){var g=-1,C=u.length;for(o||(o=ae(C));++g<C;)o[g]=u[g];return o}function hi(u,o,g,C){var R=!g;g||(g={});for(var N=-1,G=o.length;++N<G;){var X=o[N],re=C?C(g[X],u[X],X,g,u):e;re===e&&(re=u[X]),R?Gi(g,X,re):Go(g,X,re)}return g}function TE(u,o){return hi(u,zh(u),o)}function xE(u,o){return hi(u,s1(u),o)}function dl(u,o){return function(g,C){var R=Ge(g)?sh:rE,N=o?o():{};return R(g,u,Le(C,2),N)}}function bu(u){return et(function(o,g){var C=-1,R=g.length,N=R>1?g[R-1]:e,G=R>2?g[2]:e;for(N=u.length>3&&typeof N=="function"?(R--,N):e,G&&jr(g[0],g[1],G)&&(N=R<3?e:N,R=1),o=At(o);++C<R;){var X=g[C];X&&u(o,X,C,N)}return o})}function zd(u,o){return function(g,C){if(g==null)return g;if(!en(g))return u(g,C);for(var R=g.length,N=o?R:-1,G=At(g);(o?N--:++N<R)&&C(G[N],N,G)!==!1;);return g}}function Wd(u){return function(o,g,C){for(var R=-1,N=At(o),G=C(o),X=G.length;X--;){var re=G[u?X:++R];if(g(N[re],re,N)===!1)break}return o}}function OE(u,o,g){var C=o&E,R=Jo(u);function N(){var G=this&&this!==Yt&&this instanceof N?R:u;return G.apply(C?g:this,arguments)}return N}function Yd(u){return function(o){o=mt(o);var g=Ui(o)?Jr(o):e,C=g?g[0]:o.charAt(0),R=g?Ts(g,1).join(""):o.slice(1);return C[u]()+R}}function Cu(u){return function(o){return Oo(z1(G1(o).replace(Is,"")),u,"")}}function Jo(u){return function(){var o=arguments;switch(o.length){case 0:return new u;case 1:return new u(o[0]);case 2:return new u(o[0],o[1]);case 3:return new u(o[0],o[1],o[2]);case 4:return new u(o[0],o[1],o[2],o[3]);case 5:return new u(o[0],o[1],o[2],o[3],o[4]);case 6:return new u(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new u(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var g=Su(u.prototype),C=u.apply(g,o);return Tt(C)?C:g}}function kE(u,o,g){var C=Jo(u);function R(){for(var N=arguments.length,G=ae(N),X=N,re=Fu(R);X--;)G[X]=arguments[X];var de=N<3&&G[0]!==re&&G[N-1]!==re?[]:mn(G,re);if(N-=de.length,N<g)return e1(u,o,gl,R.placeholder,e,G,de,e,e,g-N);var ge=this&&this!==Yt&&this instanceof R?C:u;return Lr(ge,this,G)}return R}function Xd(u){return function(o,g,C){var R=At(o);if(!en(o)){var N=Le(g,3);o=cr(o),g=function(X){return N(R[X],X,R)}}var G=u(o,g,C);return G>-1?R[N?o[G]:G]:e}}function Jd(u){return Wi(function(o){var g=o.length,C=g,R=kn.prototype.thru;for(u&&o.reverse();C--;){var N=o[C];if(typeof N!="function")throw new Zr(s);if(R&&!G&&Al(N)=="wrapper")var G=new kn([],!0)}for(C=G?C:g;++C<g;){N=o[C];var X=Al(N),re=X=="wrapper"?Vh(N):e;re&&Yh(re[0])&&re[1]==(I|w|F|j)&&!re[4].length&&re[9]==1?G=G[Al(re[0])].apply(G,re[3]):G=N.length==1&&Yh(N)?G[X]():G.thru(N)}return function(){var de=arguments,ge=de[0];if(G&&de.length==1&&Ge(ge))return G.plant(ge).value();for(var ve=0,Ie=g?o[ve].apply(this,de):ge;++ve<g;)Ie=o[ve].call(this,Ie);return Ie}})}function gl(u,o,g,C,R,N,G,X,re,de){var ge=o&I,ve=o&E,Ie=o&v,Re=o&(w|S),je=o&q,Ze=Ie?e:Jo(u);function Me(){for(var nt=arguments.length,at=ae(nt),En=nt;En--;)at[En]=arguments[En];if(Re)var Mr=Fu(Me),yn=Yc(at,Mr);if(C&&(at=Vd(at,C,R,Re)),N&&(at=Gd(at,N,G,Re)),nt-=yn,Re&&nt<de){var Vt=mn(at,Mr);return e1(u,o,gl,Me.placeholder,g,at,Vt,X,re,de-nt)}var Zn=ve?g:this,Zi=Ie?Zn[u]:u;return nt=at.length,X?at=r4(at,X):je&&nt>1&&at.reverse(),ge&&re<nt&&(at.length=re),this&&this!==Yt&&this instanceof Me&&(Zi=Ze||Jo(Zi)),Zi.apply(Zn,at)}return Me}function Zd(u,o){return function(g,C){return lE(g,u,o(C),{})}}function ml(u,o){return function(g,C){var R;if(g===e&&C===e)return o;if(g!==e&&(R=g),C!==e){if(R===e)return C;typeof g=="string"||typeof C=="string"?(g=wn(g),C=wn(C)):(g=Nd(g),C=Nd(C)),R=u(g,C)}return R}}function jh(u){return Wi(function(o){return o=ee(o,Fr(Le())),et(function(g){var C=this;return u(o,function(R){return Lr(R,C,g)})})})}function vl(u,o){o=o===e?" ":wn(o);var g=o.length;if(g<2)return g?xh(o,u):o;var C=xh(o,H(u/Hi(o)));return Ui(o)?Ts(Jr(C),0,u).join(""):C.slice(0,u)}function NE(u,o,g,C){var R=o&E,N=Jo(u);function G(){for(var X=-1,re=arguments.length,de=-1,ge=C.length,ve=ae(ge+re),Ie=this&&this!==Yt&&this instanceof G?N:u;++de<ge;)ve[de]=C[de];for(;re--;)ve[de++]=arguments[++X];return Lr(Ie,R?g:this,ve)}return G}function Qd(u){return function(o,g,C){return C&&typeof C!="number"&&jr(o,g,C)&&(g=C=e),o=Ji(o),g===e?(g=o,o=0):g=Ji(g),C=C===e?o<g?1:-1:Ji(C),SE(o,g,C,u)}}function wl(u){return function(o,g){return typeof o=="string"&&typeof g=="string"||(o=Hn(o),g=Hn(g)),u(o,g)}}function e1(u,o,g,C,R,N,G,X,re,de){var ge=o&w,ve=ge?G:e,Ie=ge?e:G,Re=ge?N:e,je=ge?e:N;o|=ge?F:D,o&=~(ge?D:F),o&b||(o&=~(E|v));var Ze=[u,o,R,Re,ve,je,Ie,X,re,de],Me=g.apply(e,Ze);return Yh(u)&&h1(Me,Ze),Me.placeholder=C,p1(Me,u,o)}function Mh(u){var o=Rt[u];return function(g,C){if(g=Hn(g),C=C==null?0:_r(Xe(C),292),C&&Lt(g)){var R=(mt(g)+"e").split("e"),N=o(R[0]+"e"+(+R[1]+C));return R=(mt(N)+"e").split("e"),+(R[0]+"e"+(+R[1]-C))}return o(g)}}var LE=Eu&&1/vn(new Eu([,-0]))[1]==V?function(u){return new Eu(u)}:lp;function t1(u){return function(o){var g=Ir(o);return g==Je?jo(o):g==gr?cu(o):uh(o,u(o))}}function zi(u,o,g,C,R,N,G,X){var re=o&v;if(!re&&typeof u!="function")throw new Zr(s);var de=C?C.length:0;if(de||(o&=~(F|D),C=R=e),G=G===e?G:Qt(Xe(G),0),X=X===e?X:Xe(X),de-=R?R.length:0,o&D){var ge=C,ve=R;C=R=e}var Ie=re?e:Vh(u),Re=[u,o,g,C,R,ge,ve,N,G,X];if(Ie&&QE(Re,Ie),u=Re[0],o=Re[1],g=Re[2],C=Re[3],R=Re[4],X=Re[9]=Re[9]===e?re?0:u.length:Qt(Re[9]-de,0),!X&&o&(w|S)&&(o&=~(w|S)),!o||o==E)var je=OE(u,o,g);else o==w||o==S?je=kE(u,o,X):(o==F||o==(E|F))&&!R.length?je=NE(u,o,g,C):je=gl.apply(e,Re);var Ze=Ie?Od:h1;return p1(Ze(je,Re),u,o)}function r1(u,o,g,C){return u===e||Jn(u,ji[g])&&!ot.call(C,g)?o:u}function n1(u,o,g,C,R,N){return Tt(u)&&Tt(o)&&(N.set(o,u),fl(u,o,e,n1,N),N.delete(o)),u}function UE(u){return ec(u)?e:u}function i1(u,o,g,C,R,N){var G=g&p,X=u.length,re=o.length;if(X!=re&&!(G&&re>X))return!1;var de=N.get(u),ge=N.get(o);if(de&&ge)return de==o&&ge==u;var ve=-1,Ie=!0,Re=g&f?new ma:e;for(N.set(u,o),N.set(o,u);++ve<X;){var je=u[ve],Ze=o[ve];if(C)var Me=G?C(Ze,je,ve,o,u,N):C(je,Ze,ve,u,o,N);if(Me!==e){if(Me)continue;Ie=!1;break}if(Re){if(!Vc(o,function(nt,at){if(!da(Re,at)&&(je===nt||R(je,nt,g,C,N)))return Re.push(at)})){Ie=!1;break}}else if(!(je===Ze||R(je,Ze,g,C,N))){Ie=!1;break}}return N.delete(u),N.delete(o),Ie}function HE(u,o,g,C,R,N,G){switch(g){case We:if(u.byteLength!=o.byteLength||u.byteOffset!=o.byteOffset)return!1;u=u.buffer,o=o.buffer;case Wt:return!(u.byteLength!=o.byteLength||!N(new vu(u),new vu(o)));case _t:case lt:case ht:return Jn(+u,+o);case Pt:return u.name==o.name&&u.message==o.message;case ar:case zt:return u==o+"";case Je:var X=jo;case gr:var re=C&p;if(X||(X=vn),u.size!=o.size&&!re)return!1;var de=G.get(u);if(de)return de==o;C|=f,G.set(u,o);var ge=i1(X(u),X(o),C,R,N,G);return G.delete(u),ge;case br:if(Vo)return Vo.call(u)==Vo.call(o)}return!1}function jE(u,o,g,C,R,N){var G=g&p,X=qh(u),re=X.length,de=qh(o),ge=de.length;if(re!=ge&&!G)return!1;for(var ve=re;ve--;){var Ie=X[ve];if(!(G?Ie in o:ot.call(o,Ie)))return!1}var Re=N.get(u),je=N.get(o);if(Re&&je)return Re==o&&je==u;var Ze=!0;N.set(u,o),N.set(o,u);for(var Me=G;++ve<re;){Ie=X[ve];var nt=u[Ie],at=o[Ie];if(C)var En=G?C(at,nt,Ie,o,u,N):C(nt,at,Ie,u,o,N);if(!(En===e?nt===at||R(nt,at,g,C,N):En)){Ze=!1;break}Me||(Me=Ie=="constructor")}if(Ze&&!Me){var Mr=u.constructor,yn=o.constructor;Mr!=yn&&"constructor"in u&&"constructor"in o&&!(typeof Mr=="function"&&Mr instanceof Mr&&typeof yn=="function"&&yn instanceof yn)&&(Ze=!1)}return N.delete(u),N.delete(o),Ze}function Wi(u){return Jh(l1(u,e,A1),u+"")}function qh(u){return Cd(u,cr,zh)}function Kh(u){return Cd(u,tn,s1)}var Vh=sl?function(u){return sl.get(u)}:lp;function Al(u){for(var o=u.name+"",g=yu[o],C=ot.call(yu,o)?g.length:0;C--;){var R=g[C],N=R.func;if(N==null||N==u)return R.name}return o}function Fu(u){var o=ot.call(O,"placeholder")?O:u;return o.placeholder}function Le(){var u=O.iteratee||op;return u=u===op?Id:u,arguments.length?u(arguments[0],arguments[1]):u}function El(u,o){var g=u.__data__;return YE(o)?g[typeof o=="string"?"string":"hash"]:g.map}function Gh(u){for(var o=cr(u),g=o.length;g--;){var C=o[g],R=u[C];o[g]=[C,R,o1(R)]}return o}function Aa(u,o){var g=ch(u,o);return _d(g)?g:e}function ME(u){var o=ot.call(u,qi),g=u[qi];try{u[qi]=e;var C=!0}catch{}var R=gu.call(u);return C&&(o?u[qi]=g:delete u[qi]),R}var zh=oe?function(u){return u==null?[]:(u=At(u),dn(oe(u),function(o){return nl.call(u,o)}))}:fp,s1=oe?function(u){for(var o=[];u;)gn(o,zh(u)),u=wu(u);return o}:fp,Ir=Hr;(yh&&Ir(new yh(new ArrayBuffer(1)))!=We||Mo&&Ir(new Mo)!=Je||Sh&&Ir(Sh.resolve())!=Ot||Eu&&Ir(new Eu)!=gr||qo&&Ir(new qo)!=Or)&&(Ir=function(u){var o=Hr(u),g=o==ze?u.constructor:e,C=g?Ea(g):"";if(C)switch(C){case CA:return We;case FA:return Je;case _A:return Ot;case IA:return gr;case BA:return Or}return o});function qE(u,o,g){for(var C=-1,R=g.length;++C<R;){var N=g[C],G=N.size;switch(N.type){case"drop":u+=G;break;case"dropRight":o-=G;break;case"take":o=_r(o,u+G);break;case"takeRight":u=Qt(u,o-G);break}}return{start:u,end:o}}function KE(u){var o=u.match(wo);return o?o[1].split(Ao):[]}function a1(u,o,g){o=Rs(o,u);for(var C=-1,R=o.length,N=!1;++C<R;){var G=pi(o[C]);if(!(N=u!=null&&g(u,G)))break;u=u[G]}return N||++C!=R?N:(R=u==null?0:u.length,!!R&&Il(R)&&Yi(G,R)&&(Ge(u)||ya(u)))}function VE(u){var o=u.length,g=new u.constructor(o);return o&&typeof u[0]=="string"&&ot.call(u,"index")&&(g.index=u.index,g.input=u.input),g}function u1(u){return typeof u.constructor=="function"&&!Zo(u)?Su(wu(u)):{}}function GE(u,o,g){var C=u.constructor;switch(o){case Wt:return Hh(u);case _t:case lt:return new C(+u);case We:return DE(u,g);case Cr:case Js:case Zs:case Qs:case ea:case Oi:case ta:case bs:case si:return qd(u,g);case Je:return new C;case ht:case zt:return new C(u);case ar:return PE(u);case gr:return new C;case br:return $E(u)}}function zE(u,o){var g=o.length;if(!g)return u;var C=g-1;return o[C]=(g>1?"& ":"")+o[C],o=o.join(g>2?", ":" "),u.replace(vo,`{
|
||
/* [wrapped with `+o+`] */
|
||
`)}function WE(u){return Ge(u)||ya(u)||!!(il&&u&&u[il])}function Yi(u,o){var g=typeof u;return o=o??z,!!o&&(g=="number"||g!="symbol"&&eu.test(u))&&u>-1&&u%1==0&&u<o}function jr(u,o,g){if(!Tt(g))return!1;var C=typeof o;return(C=="number"?en(g)&&Yi(o,g.length):C=="string"&&o in g)?Jn(g[o],u):!1}function Wh(u,o){if(Ge(u))return!1;var g=typeof u;return g=="number"||g=="symbol"||g=="boolean"||u==null||An(u)?!0:ho.test(u)||!fo.test(u)||o!=null&&u in At(o)}function YE(u){var o=typeof u;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?u!=="__proto__":u===null}function Yh(u){var o=Al(u),g=O[o];if(typeof g!="function"||!(o in it.prototype))return!1;if(u===g)return!0;var C=Vh(g);return!!C&&u===C[0]}function XE(u){return!!du&&du in u}var JE=Yn?Xi:hp;function Zo(u){var o=u&&u.constructor,g=typeof o=="function"&&o.prototype||ji;return u===g}function o1(u){return u===u&&!Tt(u)}function c1(u,o){return function(g){return g==null?!1:g[u]===o&&(o!==e||u in At(g))}}function ZE(u){var o=Fl(u,function(C){return g.size===c&&g.clear(),C}),g=o.cache;return o}function QE(u,o){var g=u[1],C=o[1],R=g|C,N=R<(E|v|I),G=C==I&&g==w||C==I&&g==j&&u[7].length<=o[8]||C==(I|j)&&o[7].length<=o[8]&&g==w;if(!(N||G))return u;C&E&&(u[2]=o[2],R|=g&E?0:b);var X=o[3];if(X){var re=u[3];u[3]=re?Vd(re,X,o[4]):X,u[4]=re?mn(u[3],l):o[4]}return X=o[5],X&&(re=u[5],u[5]=re?Gd(re,X,o[6]):X,u[6]=re?mn(u[5],l):o[6]),X=o[7],X&&(u[7]=X),C&I&&(u[8]=u[8]==null?o[8]:_r(u[8],o[8])),u[9]==null&&(u[9]=o[9]),u[0]=o[0],u[1]=R,u}function e4(u){var o=[];if(u!=null)for(var g in At(u))o.push(g);return o}function t4(u){return gu.call(u)}function l1(u,o,g){return o=Qt(o===e?u.length-1:o,0),function(){for(var C=arguments,R=-1,N=Qt(C.length-o,0),G=ae(N);++R<N;)G[R]=C[o+R];R=-1;for(var X=ae(o+1);++R<o;)X[R]=C[R];return X[o]=g(G),Lr(u,this,X)}}function f1(u,o){return o.length<2?u:wa(u,Ln(o,0,-1))}function r4(u,o){for(var g=u.length,C=_r(o.length,g),R=Qr(u);C--;){var N=o[C];u[C]=Yi(N,g)?R[N]:e}return u}function Xh(u,o){if(!(o==="constructor"&&typeof u[o]=="function")&&o!="__proto__")return u[o]}var h1=d1(Od),Qo=Y||function(u,o){return Yt.setTimeout(u,o)},Jh=d1(FE);function p1(u,o,g){var C=o+"";return Jh(u,zE(C,n4(KE(C),g)))}function d1(u){var o=0,g=0;return function(){var C=yA(),R=U-(C-g);if(g=C,R>0){if(++o>=k)return arguments[0]}else o=0;return u.apply(e,arguments)}}function yl(u,o){var g=-1,C=u.length,R=C-1;for(o=o===e?C:o;++g<o;){var N=Th(g,R),G=u[N];u[N]=u[g],u[g]=G}return u.length=o,u}var g1=ZE(function(u){var o=[];return u.charCodeAt(0)===46&&o.push(""),u.replace(po,function(g,C,R,N){o.push(R?N.replace(So,"$1"):C||g)}),o});function pi(u){if(typeof u=="string"||An(u))return u;var o=u+"";return o=="0"&&1/u==-V?"-0":o}function Ea(u){if(u!=null){try{return pu.call(u)}catch{}try{return u+""}catch{}}return""}function n4(u,o){return Xr(ue,function(g){var C="_."+g[0];o&g[1]&&!Ur(u,C)&&u.push(C)}),u.sort()}function m1(u){if(u instanceof it)return u.clone();var o=new kn(u.__wrapped__,u.__chain__);return o.__actions__=Qr(u.__actions__),o.__index__=u.__index__,o.__values__=u.__values__,o}function i4(u,o,g){(g?jr(u,o,g):o===e)?o=1:o=Qt(Xe(o),0);var C=u==null?0:u.length;if(!C||o<1)return[];for(var R=0,N=0,G=ae(H(C/o));R<C;)G[N++]=Ln(u,R,R+=o);return G}function s4(u){for(var o=-1,g=u==null?0:u.length,C=0,R=[];++o<g;){var N=u[o];N&&(R[C++]=N)}return R}function a4(){var u=arguments.length;if(!u)return[];for(var o=ae(u-1),g=arguments[0],C=u;C--;)o[C-1]=arguments[C];return gn(Ge(g)?Qr(g):[g],Er(o,1))}var u4=et(function(u,o){return Kt(u)?zo(u,Er(o,1,Kt,!0)):[]}),o4=et(function(u,o){var g=Un(o);return Kt(g)&&(g=e),Kt(u)?zo(u,Er(o,1,Kt,!0),Le(g,2)):[]}),c4=et(function(u,o){var g=Un(o);return Kt(g)&&(g=e),Kt(u)?zo(u,Er(o,1,Kt,!0),e,g):[]});function l4(u,o,g){var C=u==null?0:u.length;return C?(o=g||o===e?1:Xe(o),Ln(u,o<0?0:o,C)):[]}function f4(u,o,g){var C=u==null?0:u.length;return C?(o=g||o===e?1:Xe(o),o=C-o,Ln(u,0,o<0?0:o)):[]}function h4(u,o){return u&&u.length?pl(u,Le(o,3),!0,!0):[]}function p4(u,o){return u&&u.length?pl(u,Le(o,3),!0):[]}function d4(u,o,g,C){var R=u==null?0:u.length;return R?(g&&typeof g!="number"&&jr(u,o,g)&&(g=0,C=R),aE(u,o,g,C)):[]}function v1(u,o,g){var C=u==null?0:u.length;if(!C)return-1;var R=g==null?0:Xe(g);return R<0&&(R=Qt(C+R,0)),Xt(u,Le(o,3),R)}function w1(u,o,g){var C=u==null?0:u.length;if(!C)return-1;var R=C-1;return g!==e&&(R=Xe(g),R=g<0?Qt(C+R,0):_r(R,C-1)),Xt(u,Le(o,3),R,!0)}function A1(u){var o=u==null?0:u.length;return o?Er(u,1):[]}function g4(u){var o=u==null?0:u.length;return o?Er(u,V):[]}function m4(u,o){var g=u==null?0:u.length;return g?(o=o===e?1:Xe(o),Er(u,o)):[]}function v4(u){for(var o=-1,g=u==null?0:u.length,C={};++o<g;){var R=u[o];C[R[0]]=R[1]}return C}function E1(u){return u&&u.length?u[0]:e}function w4(u,o,g){var C=u==null?0:u.length;if(!C)return-1;var R=g==null?0:Xe(g);return R<0&&(R=Qt(C+R,0)),Ds(u,o,R)}function A4(u){var o=u==null?0:u.length;return o?Ln(u,0,-1):[]}var E4=et(function(u){var o=ee(u,Lh);return o.length&&o[0]===u[0]?Bh(o):[]}),y4=et(function(u){var o=Un(u),g=ee(u,Lh);return o===Un(g)?o=e:g.pop(),g.length&&g[0]===u[0]?Bh(g,Le(o,2)):[]}),S4=et(function(u){var o=Un(u),g=ee(u,Lh);return o=typeof o=="function"?o:e,o&&g.pop(),g.length&&g[0]===u[0]?Bh(g,e,o):[]});function b4(u,o){return u==null?"":AA.call(u,o)}function Un(u){var o=u==null?0:u.length;return o?u[o-1]:e}function C4(u,o,g){var C=u==null?0:u.length;if(!C)return-1;var R=C;return g!==e&&(R=Xe(g),R=R<0?Qt(C+R,0):_r(R,C-1)),o===o?hh(u,o,R):Xt(u,xn,R,!0)}function F4(u,o){return u&&u.length?$d(u,Xe(o)):e}var _4=et(y1);function y1(u,o){return u&&u.length&&o&&o.length?Rh(u,o):u}function I4(u,o,g){return u&&u.length&&o&&o.length?Rh(u,o,Le(g,2)):u}function B4(u,o,g){return u&&u.length&&o&&o.length?Rh(u,o,e,g):u}var D4=Wi(function(u,o){var g=u==null?0:u.length,C=Ch(u,o);return xd(u,ee(o,function(R){return Yi(R,g)?+R:R}).sort(Kd)),C});function P4(u,o){var g=[];if(!(u&&u.length))return g;var C=-1,R=[],N=u.length;for(o=Le(o,3);++C<N;){var G=u[C];o(G,C,u)&&(g.push(G),R.push(C))}return xd(u,R),g}function Zh(u){return u==null?u:bA.call(u)}function $4(u,o,g){var C=u==null?0:u.length;return C?(g&&typeof g!="number"&&jr(u,o,g)?(o=0,g=C):(o=o==null?0:Xe(o),g=g===e?C:Xe(g)),Ln(u,o,g)):[]}function R4(u,o){return hl(u,o)}function T4(u,o,g){return Oh(u,o,Le(g,2))}function x4(u,o){var g=u==null?0:u.length;if(g){var C=hl(u,o);if(C<g&&Jn(u[C],o))return C}return-1}function O4(u,o){return hl(u,o,!0)}function k4(u,o,g){return Oh(u,o,Le(g,2),!0)}function N4(u,o){var g=u==null?0:u.length;if(g){var C=hl(u,o,!0)-1;if(Jn(u[C],o))return C}return-1}function L4(u){return u&&u.length?kd(u):[]}function U4(u,o){return u&&u.length?kd(u,Le(o,2)):[]}function H4(u){var o=u==null?0:u.length;return o?Ln(u,1,o):[]}function j4(u,o,g){return u&&u.length?(o=g||o===e?1:Xe(o),Ln(u,0,o<0?0:o)):[]}function M4(u,o,g){var C=u==null?0:u.length;return C?(o=g||o===e?1:Xe(o),o=C-o,Ln(u,o<0?0:o,C)):[]}function q4(u,o){return u&&u.length?pl(u,Le(o,3),!1,!0):[]}function K4(u,o){return u&&u.length?pl(u,Le(o,3)):[]}var V4=et(function(u){return $s(Er(u,1,Kt,!0))}),G4=et(function(u){var o=Un(u);return Kt(o)&&(o=e),$s(Er(u,1,Kt,!0),Le(o,2))}),z4=et(function(u){var o=Un(u);return o=typeof o=="function"?o:e,$s(Er(u,1,Kt,!0),e,o)});function W4(u){return u&&u.length?$s(u):[]}function Y4(u,o){return u&&u.length?$s(u,Le(o,2)):[]}function X4(u,o){return o=typeof o=="function"?o:e,u&&u.length?$s(u,e,o):[]}function Qh(u){if(!(u&&u.length))return[];var o=0;return u=dn(u,function(g){if(Kt(g))return o=Qt(g.length,o),!0}),Lo(o,function(g){return ee(u,Li(g))})}function S1(u,o){if(!(u&&u.length))return[];var g=Qh(u);return o==null?g:ee(g,function(C){return Lr(o,e,C)})}var J4=et(function(u,o){return Kt(u)?zo(u,o):[]}),Z4=et(function(u){return Nh(dn(u,Kt))}),Q4=et(function(u){var o=Un(u);return Kt(o)&&(o=e),Nh(dn(u,Kt),Le(o,2))}),ey=et(function(u){var o=Un(u);return o=typeof o=="function"?o:e,Nh(dn(u,Kt),e,o)}),ty=et(Qh);function ry(u,o){return Hd(u||[],o||[],Go)}function ny(u,o){return Hd(u||[],o||[],Xo)}var iy=et(function(u){var o=u.length,g=o>1?u[o-1]:e;return g=typeof g=="function"?(u.pop(),g):e,S1(u,g)});function b1(u){var o=O(u);return o.__chain__=!0,o}function sy(u,o){return o(u),u}function Sl(u,o){return o(u)}var ay=Wi(function(u){var o=u.length,g=o?u[0]:0,C=this.__wrapped__,R=function(N){return Ch(N,u)};return o>1||this.__actions__.length||!(C instanceof it)||!Yi(g)?this.thru(R):(C=C.slice(g,+g+(o?1:0)),C.__actions__.push({func:Sl,args:[R],thisArg:e}),new kn(C,this.__chain__).thru(function(N){return o&&!N.length&&N.push(e),N}))});function uy(){return b1(this)}function oy(){return new kn(this.value(),this.__chain__)}function cy(){this.__values__===e&&(this.__values__=N1(this.value()));var u=this.__index__>=this.__values__.length,o=u?e:this.__values__[this.__index__++];return{done:u,value:o}}function ly(){return this}function fy(u){for(var o,g=this;g instanceof ul;){var C=m1(g);C.__index__=0,C.__values__=e,o?R.__wrapped__=C:o=C;var R=C;g=g.__wrapped__}return R.__wrapped__=u,o}function hy(){var u=this.__wrapped__;if(u instanceof it){var o=u;return this.__actions__.length&&(o=new it(this)),o=o.reverse(),o.__actions__.push({func:Sl,args:[Zh],thisArg:e}),new kn(o,this.__chain__)}return this.thru(Zh)}function py(){return Ud(this.__wrapped__,this.__actions__)}var dy=dl(function(u,o,g){ot.call(u,g)?++u[g]:Gi(u,g,1)});function gy(u,o,g){var C=Ge(u)?Ve:sE;return g&&jr(u,o,g)&&(o=e),C(u,Le(o,3))}function my(u,o){var g=Ge(u)?dn:Sd;return g(u,Le(o,3))}var vy=Xd(v1),wy=Xd(w1);function Ay(u,o){return Er(bl(u,o),1)}function Ey(u,o){return Er(bl(u,o),V)}function yy(u,o,g){return g=g===e?1:Xe(g),Er(bl(u,o),g)}function C1(u,o){var g=Ge(u)?Xr:Ps;return g(u,Le(o,3))}function F1(u,o){var g=Ge(u)?B:yd;return g(u,Le(o,3))}var Sy=dl(function(u,o,g){ot.call(u,g)?u[g].push(o):Gi(u,g,[o])});function by(u,o,g,C){u=en(u)?u:Iu(u),g=g&&!C?Xe(g):0;var R=u.length;return g<0&&(g=Qt(R+g,0)),Bl(u)?g<=R&&u.indexOf(o,g)>-1:!!R&&Ds(u,o,g)>-1}var Cy=et(function(u,o,g){var C=-1,R=typeof o=="function",N=en(u)?ae(u.length):[];return Ps(u,function(G){N[++C]=R?Lr(o,G,g):Wo(G,o,g)}),N}),Fy=dl(function(u,o,g){Gi(u,g,o)});function bl(u,o){var g=Ge(u)?ee:Bd;return g(u,Le(o,3))}function _y(u,o,g,C){return u==null?[]:(Ge(o)||(o=o==null?[]:[o]),g=C?e:g,Ge(g)||(g=g==null?[]:[g]),Rd(u,o,g))}var Iy=dl(function(u,o,g){u[g?0:1].push(o)},function(){return[[],[]]});function By(u,o,g){var C=Ge(u)?Oo:Gc,R=arguments.length<3;return C(u,Le(o,4),g,R,Ps)}function Dy(u,o,g){var C=Ge(u)?hd:Gc,R=arguments.length<3;return C(u,Le(o,4),g,R,yd)}function Py(u,o){var g=Ge(u)?dn:Sd;return g(u,_l(Le(o,3)))}function $y(u){var o=Ge(u)?vd:bE;return o(u)}function Ry(u,o,g){(g?jr(u,o,g):o===e)?o=1:o=Xe(o);var C=Ge(u)?eE:CE;return C(u,o)}function Ty(u){var o=Ge(u)?tE:_E;return o(u)}function xy(u){if(u==null)return 0;if(en(u))return Bl(u)?Hi(u):u.length;var o=Ir(u);return o==Je||o==gr?u.size:Ph(u).length}function Oy(u,o,g){var C=Ge(u)?Vc:IE;return g&&jr(u,o,g)&&(o=e),C(u,Le(o,3))}var ky=et(function(u,o){if(u==null)return[];var g=o.length;return g>1&&jr(u,o[0],o[1])?o=[]:g>2&&jr(o[0],o[1],o[2])&&(o=[o[0]]),Rd(u,Er(o,1),[])}),Cl=x||function(){return Yt.Date.now()};function Ny(u,o){if(typeof o!="function")throw new Zr(s);return u=Xe(u),function(){if(--u<1)return o.apply(this,arguments)}}function _1(u,o,g){return o=g?e:o,o=u&&o==null?u.length:o,zi(u,I,e,e,e,e,o)}function I1(u,o){var g;if(typeof o!="function")throw new Zr(s);return u=Xe(u),function(){return--u>0&&(g=o.apply(this,arguments)),u<=1&&(o=e),g}}var ep=et(function(u,o,g){var C=E;if(g.length){var R=mn(g,Fu(ep));C|=F}return zi(u,C,o,g,R)}),B1=et(function(u,o,g){var C=E|v;if(g.length){var R=mn(g,Fu(B1));C|=F}return zi(o,C,u,g,R)});function D1(u,o,g){o=g?e:o;var C=zi(u,w,e,e,e,e,e,o);return C.placeholder=D1.placeholder,C}function P1(u,o,g){o=g?e:o;var C=zi(u,S,e,e,e,e,e,o);return C.placeholder=P1.placeholder,C}function $1(u,o,g){var C,R,N,G,X,re,de=0,ge=!1,ve=!1,Ie=!0;if(typeof u!="function")throw new Zr(s);o=Hn(o)||0,Tt(g)&&(ge=!!g.leading,ve="maxWait"in g,N=ve?Qt(Hn(g.maxWait)||0,o):N,Ie="trailing"in g?!!g.trailing:Ie);function Re(Vt){var Zn=C,Zi=R;return C=R=e,de=Vt,G=u.apply(Zi,Zn),G}function je(Vt){return de=Vt,X=Qo(nt,o),ge?Re(Vt):G}function Ze(Vt){var Zn=Vt-re,Zi=Vt-de,X1=o-Zn;return ve?_r(X1,N-Zi):X1}function Me(Vt){var Zn=Vt-re,Zi=Vt-de;return re===e||Zn>=o||Zn<0||ve&&Zi>=N}function nt(){var Vt=Cl();if(Me(Vt))return at(Vt);X=Qo(nt,Ze(Vt))}function at(Vt){return X=e,Ie&&C?Re(Vt):(C=R=e,G)}function En(){X!==e&&jd(X),de=0,C=re=R=X=e}function Mr(){return X===e?G:at(Cl())}function yn(){var Vt=Cl(),Zn=Me(Vt);if(C=arguments,R=this,re=Vt,Zn){if(X===e)return je(re);if(ve)return jd(X),X=Qo(nt,o),Re(re)}return X===e&&(X=Qo(nt,o)),G}return yn.cancel=En,yn.flush=Mr,yn}var Ly=et(function(u,o){return Ed(u,1,o)}),Uy=et(function(u,o,g){return Ed(u,Hn(o)||0,g)});function Hy(u){return zi(u,q)}function Fl(u,o){if(typeof u!="function"||o!=null&&typeof o!="function")throw new Zr(s);var g=function(){var C=arguments,R=o?o.apply(this,C):C[0],N=g.cache;if(N.has(R))return N.get(R);var G=u.apply(this,C);return g.cache=N.set(R,G)||N,G};return g.cache=new(Fl.Cache||Vi),g}Fl.Cache=Vi;function _l(u){if(typeof u!="function")throw new Zr(s);return function(){var o=arguments;switch(o.length){case 0:return!u.call(this);case 1:return!u.call(this,o[0]);case 2:return!u.call(this,o[0],o[1]);case 3:return!u.call(this,o[0],o[1],o[2])}return!u.apply(this,o)}}function jy(u){return I1(2,u)}var My=BE(function(u,o){o=o.length==1&&Ge(o[0])?ee(o[0],Fr(Le())):ee(Er(o,1),Fr(Le()));var g=o.length;return et(function(C){for(var R=-1,N=_r(C.length,g);++R<N;)C[R]=o[R].call(this,C[R]);return Lr(u,this,C)})}),tp=et(function(u,o){var g=mn(o,Fu(tp));return zi(u,F,e,o,g)}),R1=et(function(u,o){var g=mn(o,Fu(R1));return zi(u,D,e,o,g)}),qy=Wi(function(u,o){return zi(u,j,e,e,e,o)});function Ky(u,o){if(typeof u!="function")throw new Zr(s);return o=o===e?o:Xe(o),et(u,o)}function Vy(u,o){if(typeof u!="function")throw new Zr(s);return o=o==null?0:Qt(Xe(o),0),et(function(g){var C=g[o],R=Ts(g,0,o);return C&&gn(R,C),Lr(u,this,R)})}function Gy(u,o,g){var C=!0,R=!0;if(typeof u!="function")throw new Zr(s);return Tt(g)&&(C="leading"in g?!!g.leading:C,R="trailing"in g?!!g.trailing:R),$1(u,o,{leading:C,maxWait:o,trailing:R})}function zy(u){return _1(u,1)}function Wy(u,o){return tp(Uh(o),u)}function Yy(){if(!arguments.length)return[];var u=arguments[0];return Ge(u)?u:[u]}function Xy(u){return Nn(u,A)}function Jy(u,o){return o=typeof o=="function"?o:e,Nn(u,A,o)}function Zy(u){return Nn(u,h|A)}function Qy(u,o){return o=typeof o=="function"?o:e,Nn(u,h|A,o)}function e6(u,o){return o==null||Ad(u,o,cr(o))}function Jn(u,o){return u===o||u!==u&&o!==o}var t6=wl(Ih),r6=wl(function(u,o){return u>=o}),ya=Fd(function(){return arguments}())?Fd:function(u){return Ut(u)&&ot.call(u,"callee")&&!nl.call(u,"callee")},Ge=ae.isArray,n6=Uc?Fr(Uc):fE;function en(u){return u!=null&&Il(u.length)&&!Xi(u)}function Kt(u){return Ut(u)&&en(u)}function i6(u){return u===!0||u===!1||Ut(u)&&Hr(u)==_t}var xs=Et||hp,s6=Hc?Fr(Hc):hE;function a6(u){return Ut(u)&&u.nodeType===1&&!ec(u)}function u6(u){if(u==null)return!0;if(en(u)&&(Ge(u)||typeof u=="string"||typeof u.splice=="function"||xs(u)||_u(u)||ya(u)))return!u.length;var o=Ir(u);if(o==Je||o==gr)return!u.size;if(Zo(u))return!Ph(u).length;for(var g in u)if(ot.call(u,g))return!1;return!0}function o6(u,o){return Yo(u,o)}function c6(u,o,g){g=typeof g=="function"?g:e;var C=g?g(u,o):e;return C===e?Yo(u,o,e,g):!!C}function rp(u){if(!Ut(u))return!1;var o=Hr(u);return o==Pt||o==Mt||typeof u.message=="string"&&typeof u.name=="string"&&!ec(u)}function l6(u){return typeof u=="number"&&Lt(u)}function Xi(u){if(!Tt(u))return!1;var o=Hr(u);return o==Qe||o==bt||o==sr||o==Rn}function T1(u){return typeof u=="number"&&u==Xe(u)}function Il(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=z}function Tt(u){var o=typeof u;return u!=null&&(o=="object"||o=="function")}function Ut(u){return u!=null&&typeof u=="object"}var x1=jc?Fr(jc):dE;function f6(u,o){return u===o||Dh(u,o,Gh(o))}function h6(u,o,g){return g=typeof g=="function"?g:e,Dh(u,o,Gh(o),g)}function p6(u){return O1(u)&&u!=+u}function d6(u){if(JE(u))throw new qe(n);return _d(u)}function g6(u){return u===null}function m6(u){return u==null}function O1(u){return typeof u=="number"||Ut(u)&&Hr(u)==ht}function ec(u){if(!Ut(u)||Hr(u)!=ze)return!1;var o=wu(u);if(o===null)return!0;var g=ot.call(o,"constructor")&&o.constructor;return typeof g=="function"&&g instanceof g&&pu.call(g)==wh}var np=Mc?Fr(Mc):gE;function v6(u){return T1(u)&&u>=-z&&u<=z}var k1=qc?Fr(qc):mE;function Bl(u){return typeof u=="string"||!Ge(u)&&Ut(u)&&Hr(u)==zt}function An(u){return typeof u=="symbol"||Ut(u)&&Hr(u)==br}var _u=Kc?Fr(Kc):vE;function w6(u){return u===e}function A6(u){return Ut(u)&&Ir(u)==Or}function E6(u){return Ut(u)&&Hr(u)==pt}var y6=wl($h),S6=wl(function(u,o){return u<=o});function N1(u){if(!u)return[];if(en(u))return Bl(u)?Jr(u):Qr(u);if(Mi&&u[Mi])return fh(u[Mi]());var o=Ir(u),g=o==Je?jo:o==gr?vn:Iu;return g(u)}function Ji(u){if(!u)return u===0?u:0;if(u=Hn(u),u===V||u===-V){var o=u<0?-1:1;return o*ne}return u===u?u:0}function Xe(u){var o=Ji(u),g=o%1;return o===o?g?o-g:o:0}function L1(u){return u?va(Xe(u),0,we):0}function Hn(u){if(typeof u=="number")return u;if(An(u))return Ee;if(Tt(u)){var o=typeof u.valueOf=="function"?u.valueOf():u;u=Tt(o)?o+"":o}if(typeof u!="string")return u===0?u:+u;u=Uo(u);var g=Co.test(u);return g||_o.test(u)?nh(u.slice(2),g?2:8):Qa.test(u)?Ee:+u}function U1(u){return hi(u,tn(u))}function b6(u){return u?va(Xe(u),-z,z):u===0?u:0}function mt(u){return u==null?"":wn(u)}var C6=bu(function(u,o){if(Zo(o)||en(o)){hi(o,cr(o),u);return}for(var g in o)ot.call(o,g)&&Go(u,g,o[g])}),H1=bu(function(u,o){hi(o,tn(o),u)}),Dl=bu(function(u,o,g,C){hi(o,tn(o),u,C)}),F6=bu(function(u,o,g,C){hi(o,cr(o),u,C)}),_6=Wi(Ch);function I6(u,o){var g=Su(u);return o==null?g:wd(g,o)}var B6=et(function(u,o){u=At(u);var g=-1,C=o.length,R=C>2?o[2]:e;for(R&&jr(o[0],o[1],R)&&(C=1);++g<C;)for(var N=o[g],G=tn(N),X=-1,re=G.length;++X<re;){var de=G[X],ge=u[de];(ge===e||Jn(ge,ji[de])&&!ot.call(u,de))&&(u[de]=N[de])}return u}),D6=et(function(u){return u.push(e,n1),Lr(j1,e,u)});function P6(u,o){return ke(u,Le(o,3),fi)}function $6(u,o){return ke(u,Le(o,3),_h)}function R6(u,o){return u==null?u:Fh(u,Le(o,3),tn)}function T6(u,o){return u==null?u:bd(u,Le(o,3),tn)}function x6(u,o){return u&&fi(u,Le(o,3))}function O6(u,o){return u&&_h(u,Le(o,3))}function k6(u){return u==null?[]:ll(u,cr(u))}function N6(u){return u==null?[]:ll(u,tn(u))}function ip(u,o,g){var C=u==null?e:wa(u,o);return C===e?g:C}function L6(u,o){return u!=null&&a1(u,o,uE)}function sp(u,o){return u!=null&&a1(u,o,oE)}var U6=Zd(function(u,o,g){o!=null&&typeof o.toString!="function"&&(o=gu.call(o)),u[o]=g},up(rn)),H6=Zd(function(u,o,g){o!=null&&typeof o.toString!="function"&&(o=gu.call(o)),ot.call(u,o)?u[o].push(g):u[o]=[g]},Le),j6=et(Wo);function cr(u){return en(u)?md(u):Ph(u)}function tn(u){return en(u)?md(u,!0):wE(u)}function M6(u,o){var g={};return o=Le(o,3),fi(u,function(C,R,N){Gi(g,o(C,R,N),C)}),g}function q6(u,o){var g={};return o=Le(o,3),fi(u,function(C,R,N){Gi(g,R,o(C,R,N))}),g}var K6=bu(function(u,o,g){fl(u,o,g)}),j1=bu(function(u,o,g,C){fl(u,o,g,C)}),V6=Wi(function(u,o){var g={};if(u==null)return g;var C=!1;o=ee(o,function(N){return N=Rs(N,u),C||(C=N.length>1),N}),hi(u,Kh(u),g),C&&(g=Nn(g,h|m|A,UE));for(var R=o.length;R--;)kh(g,o[R]);return g});function G6(u,o){return M1(u,_l(Le(o)))}var z6=Wi(function(u,o){return u==null?{}:EE(u,o)});function M1(u,o){if(u==null)return{};var g=ee(Kh(u),function(C){return[C]});return o=Le(o),Td(u,g,function(C,R){return o(C,R[0])})}function W6(u,o,g){o=Rs(o,u);var C=-1,R=o.length;for(R||(R=1,u=e);++C<R;){var N=u==null?e:u[pi(o[C])];N===e&&(C=R,N=g),u=Xi(N)?N.call(u):N}return u}function Y6(u,o,g){return u==null?u:Xo(u,o,g)}function X6(u,o,g,C){return C=typeof C=="function"?C:e,u==null?u:Xo(u,o,g,C)}var q1=t1(cr),K1=t1(tn);function J6(u,o,g){var C=Ge(u),R=C||xs(u)||_u(u);if(o=Le(o,4),g==null){var N=u&&u.constructor;R?g=C?new N:[]:Tt(u)?g=Xi(N)?Su(wu(u)):{}:g={}}return(R?Xr:fi)(u,function(G,X,re){return o(g,G,X,re)}),g}function Z6(u,o){return u==null?!0:kh(u,o)}function Q6(u,o,g){return u==null?u:Ld(u,o,Uh(g))}function e5(u,o,g,C){return C=typeof C=="function"?C:e,u==null?u:Ld(u,o,Uh(g),C)}function Iu(u){return u==null?[]:pa(u,cr(u))}function t5(u){return u==null?[]:pa(u,tn(u))}function r5(u,o,g){return g===e&&(g=o,o=e),g!==e&&(g=Hn(g),g=g===g?g:0),o!==e&&(o=Hn(o),o=o===o?o:0),va(Hn(u),o,g)}function n5(u,o,g){return o=Ji(o),g===e?(g=o,o=0):g=Ji(g),u=Hn(u),cE(u,o,g)}function i5(u,o,g){if(g&&typeof g!="boolean"&&jr(u,o,g)&&(o=g=e),g===e&&(typeof o=="boolean"?(g=o,o=e):typeof u=="boolean"&&(g=u,u=e)),u===e&&o===e?(u=0,o=1):(u=Ji(u),o===e?(o=u,u=0):o=Ji(o)),u>o){var C=u;u=o,o=C}if(g||u%1||o%1){var R=dd();return _r(u+R*(o-u+rh("1e-"+((R+"").length-1))),o)}return Th(u,o)}var s5=Cu(function(u,o,g){return o=o.toLowerCase(),u+(g?V1(o):o)});function V1(u){return ap(mt(u).toLowerCase())}function G1(u){return u=mt(u),u&&u.replace(ui,Ho).replace(Nr,"")}function a5(u,o,g){u=mt(u),o=wn(o);var C=u.length;g=g===e?C:va(Xe(g),0,C);var R=g;return g-=o.length,g>=0&&u.slice(g,R)==o}function u5(u){return u=mt(u),u&&Xa.test(u)?u.replace(Wa,oh):u}function o5(u){return u=mt(u),u&&go.test(u)?u.replace(Cs,"\\$&"):u}var c5=Cu(function(u,o,g){return u+(g?"-":"")+o.toLowerCase()}),l5=Cu(function(u,o,g){return u+(g?" ":"")+o.toLowerCase()}),f5=Yd("toLowerCase");function h5(u,o,g){u=mt(u),o=Xe(o);var C=o?Hi(u):0;if(!o||C>=o)return u;var R=(o-C)/2;return vl(ie(R),g)+u+vl(H(R),g)}function p5(u,o,g){u=mt(u),o=Xe(o);var C=o?Hi(u):0;return o&&C<o?u+vl(o-C,g):u}function d5(u,o,g){u=mt(u),o=Xe(o);var C=o?Hi(u):0;return o&&C<o?vl(o-C,g)+u:u}function g5(u,o,g){return g||o==null?o=0:o&&(o=+o),SA(mt(u).replace(ra,""),o||0)}function m5(u,o,g){return(g?jr(u,o,g):o===e)?o=1:o=Xe(o),xh(mt(u),o)}function v5(){var u=arguments,o=mt(u[0]);return u.length<3?o:o.replace(u[1],u[2])}var w5=Cu(function(u,o,g){return u+(g?"_":"")+o.toLowerCase()});function A5(u,o,g){return g&&typeof g!="number"&&jr(u,o,g)&&(o=g=e),g=g===e?we:g>>>0,g?(u=mt(u),u&&(typeof o=="string"||o!=null&&!np(o))&&(o=wn(o),!o&&Ui(u))?Ts(Jr(u),0,g):u.split(o,g)):[]}var E5=Cu(function(u,o,g){return u+(g?" ":"")+ap(o)});function y5(u,o,g){return u=mt(u),g=g==null?0:va(Xe(g),0,u.length),o=wn(o),u.slice(g,g+o.length)==o}function S5(u,o,g){var C=O.templateSettings;g&&jr(u,o,g)&&(o=e),u=mt(u),o=Dl({},o,C,r1);var R=Dl({},o.imports,C.imports,r1),N=cr(R),G=pa(R,N),X,re,de=0,ge=o.interpolate||Wr,ve="__p += '",Ie=fu((o.escape||Wr).source+"|"+ge.source+"|"+(ge===Za?bo:Wr).source+"|"+(o.evaluate||Wr).source+"|$","g"),Re="//# sourceURL="+(ot.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jf+"]")+`
|
||
`;u.replace(Ie,function(Me,nt,at,En,Mr,yn){return at||(at=En),ve+=u.slice(de,yn).replace(Io,Xc),nt&&(X=!0,ve+=`' +
|
||
__e(`+nt+`) +
|
||
'`),Mr&&(re=!0,ve+=`';
|
||
`+Mr+`;
|
||
__p += '`),at&&(ve+=`' +
|
||
((__t = (`+at+`)) == null ? '' : __t) +
|
||
'`),de=yn+Me.length,Me}),ve+=`';
|
||
`;var je=ot.call(o,"variable")&&o.variable;if(!je)ve=`with (obj) {
|
||
`+ve+`
|
||
}
|
||
`;else if(yo.test(je))throw new qe(a);ve=(re?ve.replace(ki,""):ve).replace(Va,"$1").replace(Ga,"$1;"),ve="function("+(je||"obj")+`) {
|
||
`+(je?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(re?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+ve+`return __p
|
||
}`;var Ze=W1(function(){return st(N,Re+"return "+ve).apply(e,G)});if(Ze.source=ve,rp(Ze))throw Ze;return Ze}function b5(u){return mt(u).toLowerCase()}function C5(u){return mt(u).toUpperCase()}function F5(u,o,g){if(u=mt(u),u&&(g||o===e))return Uo(u);if(!u||!(o=wn(o)))return u;var C=Jr(u),R=Jr(o),N=ou(C,R),G=Wc(C,R)+1;return Ts(C,N,G).join("")}function _5(u,o,g){if(u=mt(u),u&&(g||o===e))return u.slice(0,lu(u)+1);if(!u||!(o=wn(o)))return u;var C=Jr(u),R=Wc(C,Jr(o))+1;return Ts(C,0,R).join("")}function I5(u,o,g){if(u=mt(u),u&&(g||o===e))return u.replace(ra,"");if(!u||!(o=wn(o)))return u;var C=Jr(u),R=ou(C,Jr(o));return Ts(C,R).join("")}function B5(u,o){var g=_,C=P;if(Tt(o)){var R="separator"in o?o.separator:R;g="length"in o?Xe(o.length):g,C="omission"in o?wn(o.omission):C}u=mt(u);var N=u.length;if(Ui(u)){var G=Jr(u);N=G.length}if(g>=N)return u;var X=g-Hi(C);if(X<1)return C;var re=G?Ts(G,0,X).join(""):u.slice(0,X);if(R===e)return re+C;if(G&&(X+=re.length-X),np(R)){if(u.slice(X).search(R)){var de,ge=re;for(R.global||(R=fu(R.source,mt(ai.exec(R))+"g")),R.lastIndex=0;de=R.exec(ge);)var ve=de.index;re=re.slice(0,ve===e?X:ve)}}else if(u.indexOf(wn(R),X)!=X){var Ie=re.lastIndexOf(R);Ie>-1&&(re=re.slice(0,Ie))}return re+C}function D5(u){return u=mt(u),u&&Ya.test(u)?u.replace(za,Zc):u}var P5=Cu(function(u,o,g){return u+(g?" ":"")+o.toUpperCase()}),ap=Yd("toUpperCase");function z1(u,o,g){return u=mt(u),o=g?e:o,o===e?lh(u)?dh(u):ko(u):u.match(o)||[]}var W1=et(function(u,o){try{return Lr(u,e,o)}catch(g){return rp(g)?g:new qe(g)}}),$5=Wi(function(u,o){return Xr(o,function(g){g=pi(g),Gi(u,g,ep(u[g],u))}),u});function R5(u){var o=u==null?0:u.length,g=Le();return u=o?ee(u,function(C){if(typeof C[1]!="function")throw new Zr(s);return[g(C[0]),C[1]]}):[],et(function(C){for(var R=-1;++R<o;){var N=u[R];if(Lr(N[0],this,C))return Lr(N[1],this,C)}})}function T5(u){return iE(Nn(u,h))}function up(u){return function(){return u}}function x5(u,o){return u==null||u!==u?o:u}var O5=Jd(),k5=Jd(!0);function rn(u){return u}function op(u){return Id(typeof u=="function"?u:Nn(u,h))}function N5(u){return Dd(Nn(u,h))}function L5(u,o){return Pd(u,Nn(o,h))}var U5=et(function(u,o){return function(g){return Wo(g,u,o)}}),H5=et(function(u,o){return function(g){return Wo(u,g,o)}});function cp(u,o,g){var C=cr(o),R=ll(o,C);g==null&&!(Tt(o)&&(R.length||!C.length))&&(g=o,o=u,u=this,R=ll(o,cr(o)));var N=!(Tt(g)&&"chain"in g)||!!g.chain,G=Xi(u);return Xr(R,function(X){var re=o[X];u[X]=re,G&&(u.prototype[X]=function(){var de=this.__chain__;if(N||de){var ge=u(this.__wrapped__),ve=ge.__actions__=Qr(this.__actions__);return ve.push({func:re,args:arguments,thisArg:u}),ge.__chain__=de,ge}return re.apply(u,gn([this.value()],arguments))})}),u}function j5(){return Yt._===this&&(Yt._=Ah),this}function lp(){}function M5(u){return u=Xe(u),et(function(o){return $d(o,u)})}var q5=jh(ee),K5=jh(Ve),V5=jh(Vc);function Y1(u){return Wh(u)?Li(pi(u)):yE(u)}function G5(u){return function(o){return u==null?e:wa(u,o)}}var z5=Qd(),W5=Qd(!0);function fp(){return[]}function hp(){return!1}function Y5(){return{}}function X5(){return""}function J5(){return!0}function Z5(u,o){if(u=Xe(u),u<1||u>z)return[];var g=we,C=_r(u,we);o=Le(o),u-=we;for(var R=Lo(C,o);++g<u;)o(g);return R}function Q5(u){return Ge(u)?ee(u,pi):An(u)?[u]:Qr(g1(mt(u)))}function e3(u){var o=++vh;return mt(u)+o}var t3=ml(function(u,o){return u+o},0),r3=Mh("ceil"),n3=ml(function(u,o){return u/o},1),i3=Mh("floor");function s3(u){return u&&u.length?cl(u,rn,Ih):e}function a3(u,o){return u&&u.length?cl(u,Le(o,2),Ih):e}function u3(u){return No(u,rn)}function o3(u,o){return No(u,Le(o,2))}function c3(u){return u&&u.length?cl(u,rn,$h):e}function l3(u,o){return u&&u.length?cl(u,Le(o,2),$h):e}var f3=ml(function(u,o){return u*o},1),h3=Mh("round"),p3=ml(function(u,o){return u-o},0);function d3(u){return u&&u.length?uu(u,rn):0}function g3(u,o){return u&&u.length?uu(u,Le(o,2)):0}return O.after=Ny,O.ary=_1,O.assign=C6,O.assignIn=H1,O.assignInWith=Dl,O.assignWith=F6,O.at=_6,O.before=I1,O.bind=ep,O.bindAll=$5,O.bindKey=B1,O.castArray=Yy,O.chain=b1,O.chunk=i4,O.compact=s4,O.concat=a4,O.cond=R5,O.conforms=T5,O.constant=up,O.countBy=dy,O.create=I6,O.curry=D1,O.curryRight=P1,O.debounce=$1,O.defaults=B6,O.defaultsDeep=D6,O.defer=Ly,O.delay=Uy,O.difference=u4,O.differenceBy=o4,O.differenceWith=c4,O.drop=l4,O.dropRight=f4,O.dropRightWhile=h4,O.dropWhile=p4,O.fill=d4,O.filter=my,O.flatMap=Ay,O.flatMapDeep=Ey,O.flatMapDepth=yy,O.flatten=A1,O.flattenDeep=g4,O.flattenDepth=m4,O.flip=Hy,O.flow=O5,O.flowRight=k5,O.fromPairs=v4,O.functions=k6,O.functionsIn=N6,O.groupBy=Sy,O.initial=A4,O.intersection=E4,O.intersectionBy=y4,O.intersectionWith=S4,O.invert=U6,O.invertBy=H6,O.invokeMap=Cy,O.iteratee=op,O.keyBy=Fy,O.keys=cr,O.keysIn=tn,O.map=bl,O.mapKeys=M6,O.mapValues=q6,O.matches=N5,O.matchesProperty=L5,O.memoize=Fl,O.merge=K6,O.mergeWith=j1,O.method=U5,O.methodOf=H5,O.mixin=cp,O.negate=_l,O.nthArg=M5,O.omit=V6,O.omitBy=G6,O.once=jy,O.orderBy=_y,O.over=q5,O.overArgs=My,O.overEvery=K5,O.overSome=V5,O.partial=tp,O.partialRight=R1,O.partition=Iy,O.pick=z6,O.pickBy=M1,O.property=Y1,O.propertyOf=G5,O.pull=_4,O.pullAll=y1,O.pullAllBy=I4,O.pullAllWith=B4,O.pullAt=D4,O.range=z5,O.rangeRight=W5,O.rearg=qy,O.reject=Py,O.remove=P4,O.rest=Ky,O.reverse=Zh,O.sampleSize=Ry,O.set=Y6,O.setWith=X6,O.shuffle=Ty,O.slice=$4,O.sortBy=ky,O.sortedUniq=L4,O.sortedUniqBy=U4,O.split=A5,O.spread=Vy,O.tail=H4,O.take=j4,O.takeRight=M4,O.takeRightWhile=q4,O.takeWhile=K4,O.tap=sy,O.throttle=Gy,O.thru=Sl,O.toArray=N1,O.toPairs=q1,O.toPairsIn=K1,O.toPath=Q5,O.toPlainObject=U1,O.transform=J6,O.unary=zy,O.union=V4,O.unionBy=G4,O.unionWith=z4,O.uniq=W4,O.uniqBy=Y4,O.uniqWith=X4,O.unset=Z6,O.unzip=Qh,O.unzipWith=S1,O.update=Q6,O.updateWith=e5,O.values=Iu,O.valuesIn=t5,O.without=J4,O.words=z1,O.wrap=Wy,O.xor=Z4,O.xorBy=Q4,O.xorWith=ey,O.zip=ty,O.zipObject=ry,O.zipObjectDeep=ny,O.zipWith=iy,O.entries=q1,O.entriesIn=K1,O.extend=H1,O.extendWith=Dl,cp(O,O),O.add=t3,O.attempt=W1,O.camelCase=s5,O.capitalize=V1,O.ceil=r3,O.clamp=r5,O.clone=Xy,O.cloneDeep=Zy,O.cloneDeepWith=Qy,O.cloneWith=Jy,O.conformsTo=e6,O.deburr=G1,O.defaultTo=x5,O.divide=n3,O.endsWith=a5,O.eq=Jn,O.escape=u5,O.escapeRegExp=o5,O.every=gy,O.find=vy,O.findIndex=v1,O.findKey=P6,O.findLast=wy,O.findLastIndex=w1,O.findLastKey=$6,O.floor=i3,O.forEach=C1,O.forEachRight=F1,O.forIn=R6,O.forInRight=T6,O.forOwn=x6,O.forOwnRight=O6,O.get=ip,O.gt=t6,O.gte=r6,O.has=L6,O.hasIn=sp,O.head=E1,O.identity=rn,O.includes=by,O.indexOf=w4,O.inRange=n5,O.invoke=j6,O.isArguments=ya,O.isArray=Ge,O.isArrayBuffer=n6,O.isArrayLike=en,O.isArrayLikeObject=Kt,O.isBoolean=i6,O.isBuffer=xs,O.isDate=s6,O.isElement=a6,O.isEmpty=u6,O.isEqual=o6,O.isEqualWith=c6,O.isError=rp,O.isFinite=l6,O.isFunction=Xi,O.isInteger=T1,O.isLength=Il,O.isMap=x1,O.isMatch=f6,O.isMatchWith=h6,O.isNaN=p6,O.isNative=d6,O.isNil=m6,O.isNull=g6,O.isNumber=O1,O.isObject=Tt,O.isObjectLike=Ut,O.isPlainObject=ec,O.isRegExp=np,O.isSafeInteger=v6,O.isSet=k1,O.isString=Bl,O.isSymbol=An,O.isTypedArray=_u,O.isUndefined=w6,O.isWeakMap=A6,O.isWeakSet=E6,O.join=b4,O.kebabCase=c5,O.last=Un,O.lastIndexOf=C4,O.lowerCase=l5,O.lowerFirst=f5,O.lt=y6,O.lte=S6,O.max=s3,O.maxBy=a3,O.mean=u3,O.meanBy=o3,O.min=c3,O.minBy=l3,O.stubArray=fp,O.stubFalse=hp,O.stubObject=Y5,O.stubString=X5,O.stubTrue=J5,O.multiply=f3,O.nth=F4,O.noConflict=j5,O.noop=lp,O.now=Cl,O.pad=h5,O.padEnd=p5,O.padStart=d5,O.parseInt=g5,O.random=i5,O.reduce=By,O.reduceRight=Dy,O.repeat=m5,O.replace=v5,O.result=W6,O.round=h3,O.runInContext=te,O.sample=$y,O.size=xy,O.snakeCase=w5,O.some=Oy,O.sortedIndex=R4,O.sortedIndexBy=T4,O.sortedIndexOf=x4,O.sortedLastIndex=O4,O.sortedLastIndexBy=k4,O.sortedLastIndexOf=N4,O.startCase=E5,O.startsWith=y5,O.subtract=p3,O.sum=d3,O.sumBy=g3,O.template=S5,O.times=Z5,O.toFinite=Ji,O.toInteger=Xe,O.toLength=L1,O.toLower=b5,O.toNumber=Hn,O.toSafeInteger=b6,O.toString=mt,O.toUpper=C5,O.trim=F5,O.trimEnd=_5,O.trimStart=I5,O.truncate=B5,O.unescape=D5,O.uniqueId=e3,O.upperCase=P5,O.upperFirst=ap,O.each=C1,O.eachRight=F1,O.first=E1,cp(O,function(){var u={};return fi(O,function(o,g){ot.call(O.prototype,g)||(u[g]=o)}),u}(),{chain:!1}),O.VERSION=t,Xr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),Xr(["drop","take"],function(u,o){it.prototype[u]=function(g){g=g===e?1:Qt(Xe(g),0);var C=this.__filtered__&&!o?new it(this):this.clone();return C.__filtered__?C.__takeCount__=_r(g,C.__takeCount__):C.__views__.push({size:_r(g,we),type:u+(C.__dir__<0?"Right":"")}),C},it.prototype[u+"Right"]=function(g){return this.reverse()[u](g).reverse()}}),Xr(["filter","map","takeWhile"],function(u,o){var g=o+1,C=g==M||g==K;it.prototype[u]=function(R){var N=this.clone();return N.__iteratees__.push({iteratee:Le(R,3),type:g}),N.__filtered__=N.__filtered__||C,N}}),Xr(["head","last"],function(u,o){var g="take"+(o?"Right":"");it.prototype[u]=function(){return this[g](1).value()[0]}}),Xr(["initial","tail"],function(u,o){var g="drop"+(o?"":"Right");it.prototype[u]=function(){return this.__filtered__?new it(this):this[g](1)}}),it.prototype.compact=function(){return this.filter(rn)},it.prototype.find=function(u){return this.filter(u).head()},it.prototype.findLast=function(u){return this.reverse().find(u)},it.prototype.invokeMap=et(function(u,o){return typeof u=="function"?new it(this):this.map(function(g){return Wo(g,u,o)})}),it.prototype.reject=function(u){return this.filter(_l(Le(u)))},it.prototype.slice=function(u,o){u=Xe(u);var g=this;return g.__filtered__&&(u>0||o<0)?new it(g):(u<0?g=g.takeRight(-u):u&&(g=g.drop(u)),o!==e&&(o=Xe(o),g=o<0?g.dropRight(-o):g.take(o-u)),g)},it.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},it.prototype.toArray=function(){return this.take(we)},fi(it.prototype,function(u,o){var g=/^(?:filter|find|map|reject)|While$/.test(o),C=/^(?:head|last)$/.test(o),R=O[C?"take"+(o=="last"?"Right":""):o],N=C||/^find/.test(o);R&&(O.prototype[o]=function(){var G=this.__wrapped__,X=C?[1]:arguments,re=G instanceof it,de=X[0],ge=re||Ge(G),ve=function(nt){var at=R.apply(O,gn([nt],X));return C&&Ie?at[0]:at};ge&&g&&typeof de=="function"&&de.length!=1&&(re=ge=!1);var Ie=this.__chain__,Re=!!this.__actions__.length,je=N&&!Ie,Ze=re&&!Re;if(!N&&ge){G=Ze?G:new it(this);var Me=u.apply(G,X);return Me.__actions__.push({func:Sl,args:[ve],thisArg:e}),new kn(Me,Ie)}return je&&Ze?u.apply(this,X):(Me=this.thru(ve),je?C?Me.value()[0]:Me.value():Me)})}),Xr(["pop","push","shift","sort","splice","unshift"],function(u){var o=hu[u],g=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",C=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var R=arguments;if(C&&!this.__chain__){var N=this.value();return o.apply(Ge(N)?N:[],R)}return this[g](function(G){return o.apply(Ge(G)?G:[],R)})}}),fi(it.prototype,function(u,o){var g=O[o];if(g){var C=g.name+"";ot.call(yu,C)||(yu[C]=[]),yu[C].push({name:o,func:g})}}),yu[gl(e,v).name]=[{name:"wrapper",func:e}],it.prototype.clone=DA,it.prototype.reverse=PA,it.prototype.value=$A,O.prototype.at=ay,O.prototype.chain=uy,O.prototype.commit=oy,O.prototype.next=cy,O.prototype.plant=fy,O.prototype.reverse=hy,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=py,O.prototype.first=O.prototype.head,Mi&&(O.prototype[Mi]=ly),O},On=gh();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Yt._=On,define(function(){return On})):Ni?((Ni.exports=On)._=On,To._=On):Yt._=On}).call(so)});var Hf=be((ZR,ew)=>{"use strict";var hB=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])},U0=class e extends Error{constructor(t,r,n){super(t),hB(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:a,text:i})=>({source:a,text:i.split(/\r\n|\n|\r/g)}));function n(a,i,c=""){let l="",h=r.find(({source:A})=>A===a.source),m=a.start;if(h){let A=a.end,p=h.text[m.line-1],E=(m.line===A.line?A.column:p.length+1)-m.column||1;c&&(l+=`
|
||
note: ${c}`),l+=`
|
||
--> ${a.source}:${m.line}:${m.column}
|
||
${"".padEnd(i)} |
|
||
${m.line.toString().padStart(i)} | ${p}
|
||
${"".padEnd(i)} | ${"".padEnd(m.column-1)}${"".padEnd(E,"^")}`}else l+=`
|
||
at ${a.source}:${m.line}:${m.column}`,c&&(l+=`: ${c}`);return l}function s(a,i,c,l=[]){let h;c?h=l.reduce((A,{location:p})=>Math.max(A,p.start.line),c.start.line):h=Math.max.apply(null,l.map(A=>A.location.start.line)),h=h.toString().length;let m=`${a}: ${i}`;c&&(m+=n(c,h));for(let A of l)m+=n(A.location,h,A.message);return m}return this.problems.filter(a=>a[0]!=="info").map(a=>s(...a)).join(`
|
||
|
||
`)}};ew.exports=U0});var zn=be((QR,tw)=>{"use strict";var pB={build(e){function t(i,...c){return e[i.type](i,...c)}function r(){}function n(i,...c){return t(i.expression,...c)}function s(i){return function(c,...l){c[i].forEach(h=>t(h,...l))}}let a={grammar(i,...c){i.topLevelInitializer&&t(i.topLevelInitializer,...c),i.initializer&&t(i.initializer,...c),i.rules.forEach(l=>t(l,...c))},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(a).forEach(i=>{Object.prototype.hasOwnProperty.call(e,i)||(e[i]=a[i])}),t}};tw.exports=pB});var Gs=be((eT,nw)=>{"use strict";var dB=zn(),rw={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=dB.build({choice(a){return a.alternatives.every(s)},sequence(a){return a.elements.some(s)},simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(a){let i=rw.findRule(e,a.name);return i?s(i):void 0},literal(a){return a.value!==""},class:r,any:r});return s(t)}};nw.exports=rw});var H0=be((tT,iw)=>{"use strict";var gB={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};iw.exports=gB});var j0=be((rT,sw)=>{"use strict";var mB=zn(),vB=Gs(),wB=Hf(),Pc=1,qa=0,$c=-1;function jf(e){function t(i){return i.match=qa}function r(i){return a(i.expression),i.match=Pc}function n(i){return i.match=a(i.expression)}function s(i,c){let l=i.length,h=0,m=0;for(let A=0;A<l;++A){let p=a(i[A]);p===Pc&&++h,p===$c&&++m}return h===l?Pc:c?m===l?$c:qa:m>0?$c:qa}let a=mB.build({rule(i){let c,l=0;if(typeof i.match>"u"){i.match=qa;do if(c=i.match,i.match=a(i.expression),++l>6)throw new wB("Infinity cycle detected when trying to evaluate node match result",i.location);while(c!==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=-a(i.expression)},optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:t,semantic_not:t,rule_ref(i){let c=vB.findRule(e,i.name);return i.match=a(c)},literal(i){let c=i.value.length===0?Pc:qa;return i.match=c},class(i){let c=i.parts.length===0?$c:qa;return i.match=c},any:t});a(e)}jf.ALWAYS_MATCH=Pc;jf.SOMETIMES_MATCH=qa;jf.NEVER_MATCH=$c;sw.exports=jf});var uw=be((nT,aw)=>{"use strict";var AB=Gs(),De=H0(),EB=zn(),{ALWAYS_MATCH:oo,SOMETIMES_MATCH:M0,NEVER_MATCH:q0}=j0();function yB(e){let t=[],r=[],n=[],s=[];function a(S){let F=t.indexOf(S);return F===-1?t.push(S)-1:F}function i(S){let F={value:S.parts,inverted:S.inverted,ignoreCase:S.ignoreCase},D=JSON.stringify(F),I=r.findIndex(j=>JSON.stringify(j)===D);return I===-1?r.push(F)-1:I}function c(S){let F=JSON.stringify(S),D=n.findIndex(I=>JSON.stringify(I)===F);return D===-1?n.push(S)-1:D}function l(S,F,D){let I={predicate:S,params:F,body:D.code,location:D.codeLocation},j=JSON.stringify(I),q=s.findIndex(_=>JSON.stringify(_)===j);return q===-1?s.push(I)-1:q}function h(S){let F={};return Object.keys(S).forEach(D=>{F[D]=S[D]}),F}function m(S,...F){return S.concat(...F)}function A(S,F,D,I){return S===oo?D:S===q0?I:F.concat([D.length,I.length],D,I)}function p(S,F){return S.concat([F.length],F)}function f(S,F,D,I){let j=Object.keys(D).map(q=>I-D[q]);return[De.CALL,S,F,j.length].concat(j)}function E(S,F,D){let I=S.match|0;return m([De.PUSH_CURR_POS],[De.SILENT_FAILS_ON],w(S,{sp:D.sp+1,env:h(D.env),action:null}),[De.SILENT_FAILS_OFF],A(F?-I:I,[F?De.IF_ERROR:De.IF_NOT_ERROR],m([De.POP],[F?De.POP:De.POP_CURR_POS],[De.PUSH_UNDEFINED]),m([De.POP],[F?De.POP_CURR_POS:De.POP],[De.PUSH_FAILED])))}function v(S,F,D){let I=l(!0,Object.keys(D.env),S);return m([De.UPDATE_SAVED_POS],f(I,0,D.env,D.sp),A(S.match|0,[De.IF],m([De.POP],F?[De.PUSH_FAILED]:[De.PUSH_UNDEFINED]),m([De.POP],F?[De.PUSH_UNDEFINED]:[De.PUSH_FAILED])))}function b(S){return p([De.WHILE_NOT_ERROR],m([De.APPEND],S))}let w=EB.build({grammar(S){S.rules.forEach(w),S.literals=t,S.classes=r,S.expectations=n,S.functions=s},rule(S){S.bytecode=w(S.expression,{sp:-1,env:{},pluck:[],action:null})},named(S,F){let D=S.match|0,I=D===q0?null:c({type:"rule",value:S.name});return m([De.SILENT_FAILS_ON],w(S.expression,F),[De.SILENT_FAILS_OFF],A(D,[De.IF_ERROR],[De.FAIL,I],[]))},choice(S,F){function D(I,j){let q=I[0].match|0,_=w(I[0],{sp:j.sp,env:h(j.env),action:null});return q===oo?_:m(_,I.length>1?A(M0,[De.IF_ERROR],m([De.POP],D(I.slice(1),j)),[]):[])}return D(S.alternatives,F)},action(S,F){let D=h(F.env),I=S.expression.type!=="sequence"||S.expression.elements.length===0,j=w(S.expression,{sp:F.sp+(I?1:0),env:D,action:S}),q=S.expression.match|0,_=I&&q!==q0?l(!1,Object.keys(D),S):null;return I?m([De.PUSH_CURR_POS],j,A(q,[De.IF_NOT_ERROR],m([De.LOAD_SAVED_POS,1],f(_,1,D,F.sp+2)),[]),[De.NIP]):j},sequence(S,F){function D(I,j){if(I.length>0){let q=S.elements.length-I.length+1;return m(w(I[0],{sp:j.sp,env:j.env,pluck:j.pluck,action:null}),A(I[0].match|0,[De.IF_NOT_ERROR],D(I.slice(1),{sp:j.sp+1,env:j.env,pluck:j.pluck,action:j.action}),m(q>1?[De.POP_N,q]:[De.POP],[De.POP_CURR_POS],[De.PUSH_FAILED])))}else{if(j.pluck.length>0)return m([De.PLUCK,S.elements.length+1,j.pluck.length],j.pluck.map(q=>j.sp-q));if(j.action){let q=l(!1,Object.keys(j.env),j.action);return m([De.LOAD_SAVED_POS,S.elements.length],f(q,S.elements.length+1,j.env,j.sp))}else return m([De.WRAP,S.elements.length],[De.NIP])}}return m([De.PUSH_CURR_POS],D(S.elements,{sp:F.sp+1,env:F.env,pluck:[],action:F.action}))},labeled(S,F){let D=F.env,I=S.label,j=F.sp+1;return I&&(D=h(F.env),F.env[S.label]=j),S.pick&&F.pluck.push(j),w(S.expression,{sp:F.sp,env:D,action:null})},text(S,F){return m([De.PUSH_CURR_POS],w(S.expression,{sp:F.sp+1,env:h(F.env),action:null}),A(S.match|0,[De.IF_NOT_ERROR],m([De.POP],[De.TEXT]),[De.NIP]))},simple_and(S,F){return E(S.expression,!1,F)},simple_not(S,F){return E(S.expression,!0,F)},optional(S,F){return m(w(S.expression,{sp:F.sp,env:h(F.env),action:null}),A(-(S.expression.match|0),[De.IF_ERROR],m([De.POP],[De.PUSH_NULL]),[]))},zero_or_more(S,F){let D=w(S.expression,{sp:F.sp+1,env:h(F.env),action:null});return m([De.PUSH_EMPTY_ARRAY],D,b(D),[De.POP])},one_or_more(S,F){let D=w(S.expression,{sp:F.sp+1,env:h(F.env),action:null});return m([De.PUSH_EMPTY_ARRAY],D,A(S.expression.match|0,[De.IF_NOT_ERROR],m(b(D),[De.POP]),m([De.POP],[De.POP],[De.PUSH_FAILED])))},group(S,F){return w(S.expression,{sp:F.sp,env:h(F.env),action:null})},semantic_and(S,F){return v(S,!1,F)},semantic_not(S,F){return v(S,!0,F)},rule_ref(S){return[De.RULE,AB.indexOfRule(e,S.name)]},literal(S){if(S.value.length>0){let F=S.match|0,I=F===M0||F===oo&&!S.ignoreCase?a(S.ignoreCase?S.value.toLowerCase():S.value):null,j=F!==oo?c({type:"literal",value:S.value,ignoreCase:S.ignoreCase}):null;return A(F,S.ignoreCase?[De.MATCH_STRING_IC,I]:[De.MATCH_STRING,I],S.ignoreCase?[De.ACCEPT_N,S.value.length]:[De.ACCEPT_STRING,I],[De.FAIL,j])}return[De.PUSH_EMPTY_STRING]},class(S){let F=S.match|0,D=F===M0?i(S):null,I=F!==oo?c({type:"class",value:S.parts,inverted:S.inverted,ignoreCase:S.ignoreCase}):null;return A(F,[De.MATCH_CHAR_CLASS,D],[De.ACCEPT_N,1],[De.FAIL,I])},any(S){let F=S.match|0,D=F!==oo?c({type:"any"}):null;return A(F,[De.MATCH_ANY],[De.ACCEPT_N,1],[De.FAIL,D])}});w(e)}aw.exports=yB});var cw=be((iT,ow)=>{"use strict";var K0=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 a=this.sp;if(this.sp=s,n(),a!==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: "+a+", 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+").")}};ow.exports=K0});var V0=be((sT,lw)=>{"use strict";lw.exports="2.0.1"});var fw=be(Mf=>{"use strict";function ys(e){return e.charCodeAt(0).toString(16).toUpperCase()}Mf.hex=ys;function SB(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"+ys(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+ys(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+ys(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+ys(t))}Mf.stringEscape=SB;function bB(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"+ys(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+ys(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+ys(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+ys(t))}Mf.regexpClassEscape=bB});var dw=be(pw=>{var hw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");pw.encode=function(e){if(0<=e&&e<hw.length)return hw[e];throw new TypeError("Must be between 0 and 63: "+e)}});var ww=be(vw=>{var CB=dw(),gw=5,mw=1<<gw,FB=mw-1,_B=mw;function IB(e){return e<0?(-e<<1)+1:(e<<1)+0}vw.encode=function(t){let r="",n,s=IB(t);do n=s&FB,s>>>=gw,s>0&&(n|=_B),r+=CB.encode(n);while(s>0);return r}});var Kf=be(Ws=>{function BB(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}Ws.getArg=BB;var Ew=function(){return!("__proto__"in Object.create(null))}();function yw(e){return e}function DB(e){return Sw(e)?"$"+e:e}Ws.toSetString=Ew?yw:DB;function PB(e){return Sw(e)?e.slice(1):e}Ws.fromSetString=Ew?yw:PB;function Sw(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 Aw(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function $B(e,t){let r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Aw(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Aw(e.name,t.name)}Ws.compareByGeneratedPositionsInflated=$B;var G0="http:",Rc=`${G0}//host`;function bw(e){return t=>{let r=Tc(t),n=z0(t),s=new URL(t,n);e(s);let a=s.toString();return r==="absolute"?a:r==="scheme-relative"?a.slice(G0.length):r==="path-absolute"?a.slice(Rc.length):W0(n,a)}}function zs(e,t){return new URL(e,t).toString()}function RB(e,t){let r=0;do{let n=e+r++;if(t.indexOf(n)===-1)return n}while(!0)}function z0(e){let t=e.split("..").length-1,r=RB("p",e),n=`${Rc}/`;for(let s=0;s<t;s++)n+=`${r}/`;return n}var TB=/^[A-Za-z0-9\+\-\.]+:/;function Tc(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":TB.test(e)?"absolute":"path-relative"}function W0(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 xB=bw(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),qf=bw(e=>{});Ws.normalize=qf;function OB(e,t){let r=Tc(t),n=Tc(e);if(e=xB(e),r==="absolute")return zs(t,void 0);if(n==="absolute")return zs(t,e);if(r==="scheme-relative")return qf(t);if(n==="scheme-relative")return zs(t,zs(e,Rc)).slice(G0.length);if(r==="path-absolute")return qf(t);if(n==="path-absolute")return zs(t,zs(e,Rc)).slice(Rc.length);let s=z0(t+e),a=zs(t,zs(e,s));return W0(s,a)}Ws.join=OB;function kB(e,t){let r=NB(e,t);return typeof r=="string"?r:qf(t)}Ws.relative=kB;function NB(e,t){if(Tc(e)!==Tc(t))return null;let n=z0(e+t),s=new URL(e,n),a=new URL(t,n);try{new URL("",a.toString())}catch{return null}return a.protocol!==s.protocol||a.user!==s.user||a.password!==s.password||a.hostname!==s.hostname||a.port!==s.port?null:W0(s,a)}});var Fw=be(Cw=>{var Y0=class e{constructor(){this._array=[],this._set=new Map}static fromArray(t,r){let n=new e;for(let s=0,a=t.length;s<a;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()}};Cw.ArraySet=Y0});var Bw=be(Iw=>{var _w=Kf();function LB(e,t){let r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=s||_w.compareByGeneratedPositionsInflated(e,t)<=0}var X0=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(t,r){this._array.forEach(t,r)}add(t){LB(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_w.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};Iw.MappingList=X0});var J0=be(Dw=>{var xc=ww(),Zt=Kf(),Vf=Fw().ArraySet,UB=Bw().MappingList,Gf=class e{constructor(t){t||(t={}),this._file=Zt.getArg(t,"file",null),this._sourceRoot=Zt.getArg(t,"sourceRoot",null),this._skipValidation=Zt.getArg(t,"skipValidation",!1),this._sources=new Vf,this._names=new Vf,this._mappings=new UB,this._sourcesContents=null}static fromSourceMap(t){let r=t.sourceRoot,n=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(s){let a={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(a.source=s.source,r!=null&&(a.source=Zt.relative(r,a.source)),a.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(a.name=s.name)),n.addMapping(a)}),t.sources.forEach(function(s){let a=s;r!=null&&(a=Zt.relative(r,s)),n._sources.has(a)||n._sources.add(a);let i=t.sourceContentFor(s);i!=null&&n.setSourceContent(s,i)}),n}addMapping(t){let r=Zt.getArg(t,"generated"),n=Zt.getArg(t,"original",null),s=Zt.getArg(t,"source",null),a=Zt.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,a),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:s,name:a})}setSourceContent(t,r){let n=t;this._sourceRoot!=null&&(n=Zt.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Zt.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Zt.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 a=this._sourceRoot;a!=null&&(s=Zt.relative(a,s));let i=this._mappings.toArray().length>0?new Vf:this._sources,c=new Vf;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){let A=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});A.source!=null&&(l.source=A.source,n!=null&&(l.source=Zt.join(n,l.source)),a!=null&&(l.source=Zt.relative(a,l.source)),l.originalLine=A.line,l.originalColumn=A.column,A.name!=null&&(l.name=A.name))}let h=l.source;h!=null&&!i.has(h)&&i.add(h);let m=l.name;m!=null&&!c.has(m)&&c.add(m)},this),this._sources=i,this._names=c,t.sources.forEach(function(l){let h=t.sourceContentFor(l);h!=null&&(n!=null&&(l=Zt.join(n,l)),a!=null&&(l=Zt.relative(a,l)),this.setSourceContent(l,h))},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,a=0,i=0,c="",l,h,m,A,p=this._mappings.toArray();for(let f=0,E=p.length;f<E;f++){if(h=p[f],l="",h.generatedLine!==r)for(t=0;h.generatedLine!==r;)l+=";",r++;else if(f>0){if(!Zt.compareByGeneratedPositionsInflated(h,p[f-1]))continue;l+=","}l+=xc.encode(h.generatedColumn-t),t=h.generatedColumn,h.source!=null&&(A=this._sources.indexOf(h.source),l+=xc.encode(A-i),i=A,l+=xc.encode(h.originalLine-1-s),s=h.originalLine-1,l+=xc.encode(h.originalColumn-n),n=h.originalColumn,h.name!=null&&(m=this._names.indexOf(h.name),l+=xc.encode(m-a),a=m)),c+=l}return c}_generateSourcesContent(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Zt.relative(r,n));let s=Zt.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())}};Gf.prototype._version=3;Dw.SourceMapGenerator=Gf});var $w=be(Pw=>{var HB=J0().SourceMapGenerator,zf=Kf(),jB=/(\r?\n)/,MB=10,co="$$$isSourceNode$$$",Z0=class e{constructor(t,r,n,s,a){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=n??null,this.name=a??null,this[co]=!0,s!=null&&this.add(s)}static fromStringWithSourceMap(t,r,n){let s=new e,a=t.split(jB),i=0,c=function(){let f=v(),E=v()||"";return f+E;function v(){return i<a.length?a[i++]:void 0}},l=1,h=0,m=null,A;return r.eachMapping(function(f){if(m!==null)if(l<f.generatedLine)p(m,c()),l++,h=0;else{A=a[i]||"";let E=A.substr(0,f.generatedColumn-h);a[i]=A.substr(f.generatedColumn-h),h=f.generatedColumn,p(m,E),m=f;return}for(;l<f.generatedLine;)s.add(c()),l++;h<f.generatedColumn&&(A=a[i]||"",s.add(A.substr(0,f.generatedColumn)),a[i]=A.substr(f.generatedColumn),h=f.generatedColumn),m=f},this),i<a.length&&(m&&p(m,c()),s.add(a.splice(i).join(""))),r.sources.forEach(function(f){let E=r.sourceContentFor(f);E!=null&&(n!=null&&(f=zf.join(n,f)),s.setSourceContent(f,E))}),s;function p(f,E){if(f===null||f.source===void 0)s.add(E);else{let v=n?zf.join(n,f.source):f.source;s.add(new e(f.originalLine,f.originalColumn,v,E,f.name))}}}add(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[co]||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[co]||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[co]?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[co]?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[zf.toSetString(t)]=r}walkSourceContents(t){for(let n=0,s=this.children.length;n<s;n++)this.children[n][co]&&this.children[n].walkSourceContents(t);let r=Object.keys(this.sourceContents);for(let n=0,s=r.length;n<s;n++)t(zf.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 HB(t),s=!1,a=null,i=null,c=null,l=null;return this.walk(function(h,m){r.code+=h,m.source!==null&&m.line!==null&&m.column!==null?((a!==m.source||i!==m.line||c!==m.column||l!==m.name)&&n.addMapping({source:m.source,original:{line:m.line,column:m.column},generated:{line:r.line,column:r.column},name:m.name}),a=m.source,i=m.line,c=m.column,l=m.name,s=!0):s&&(n.addMapping({generated:{line:r.line,column:r.column}}),a=null,s=!1);for(let A=0,p=h.length;A<p;A++)h.charCodeAt(A)===MB?(r.line++,r.column=0,A+1===p?(a=null,s=!1):s&&n.addMapping({source:m.source,original:{line:m.line,column:m.column},generated:{line:r.line,column:r.column},name:m.name})):r.column++}),this.walkSourceContents(function(h,m){n.setSourceContent(h,m)}),{code:r.code,map:n}}};Pw.SourceNode=Z0});var Rw=be(Q0=>{Q0.SourceMapGenerator=J0().SourceMapGenerator;Q0.SourceNode=$w().SourceNode});var kw=be((gT,Ow)=>{"use strict";var qB=Gs(),gt=H0(),KB=cw(),VB=V0(),{stringEscape:Pn,regexpClassEscape:ed}=fw(),{SourceNode:Wn}=Rw();function xw(e,t,r){let n=t.start.line,s=t.start.column-1,a=e.split(`
|
||
`);return a.length===1?new Wn(n,s,t.source,e,r):new Wn(null,null,t.source,a.map((i,c)=>new Wn(n+c,c===0?s:0,t.source,c===a.length-1?i:[i,`
|
||
`],r)))}function Tw(e,t,r,n,s){return r?new Wn(null,null,r.source,[e,xw(t,r,s),new Wn(r.end.line,r.end.column-1,r.source,n)]):new Wn(null,null,null,[e,t,n])}function GB(e,t){function r(v){return v instanceof Wn?v:v.replace(/^(.+)$/gm," $1")}function n(v){return"peg$c"+v}function s(v){return"peg$r"+v}function a(v){return"peg$e"+v}function i(v){return"peg$f"+v}function c(v){return"peg$parse"+v}function l(){function v(F){return'"'+Pn(F)+'"'}function b(F){return"/^["+(F.inverted?"^":"")+F.value.map(D=>Array.isArray(D)?ed(D[0])+"-"+ed(D[1]):ed(D)).join("")+"]/"+(F.ignoreCase?"i":"")}function w(F){switch(F.type){case"rule":return'peg$otherExpectation("'+Pn(F.value)+'")';case"literal":return'peg$literalExpectation("'+Pn(F.value)+'", '+F.ignoreCase+")";case"class":return"peg$classExpectation(["+F.value.map(I=>Array.isArray(I)?'["'+Pn(I[0])+'", "'+Pn(I[1])+'"]':'"'+Pn(I)+'"').join(", ")+"], "+F.inverted+", "+F.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(F)+")")}}function S(F,D){return Tw(`
|
||
var ${i(D)} = function(${F.params.join(", ")}) {`,F.body,F.location,"};")}return new Wn(null,null,t.grammarSource,[e.literals.map((F,D)=>" var "+n(D)+" = "+v(F)+";").concat("",e.classes.map((F,D)=>" var "+s(D)+" = "+b(F)+";")).concat("",e.expectations.map((F,D)=>" var "+a(D)+" = "+w(F)+";")).concat("").join(`
|
||
`),e.functions.map(S)])}function h(v,b){let w=[];return w.push(""),t.trace&&w.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+v+","," location: peg$computeLocation(startPos, startPos)","});",""),t.cache&&(w.push("var key = peg$currPos * "+e.rules.length+" + "+b+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),t.trace&&w.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)"," });","}",""),w.push(" return cached.result;","}","")),w}function m(v,b){let w=[];return t.cache&&w.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+b+" };"),t.trace&&w.push("","if ("+b+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+v+","," result: "+b+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+v+","," location: peg$computeLocation(startPos, startPos)"," });","}"),w.push("","return "+b+";"),w}function A(v){let b=[],w=new KB(v.name,"s","var");function S(D){let I=0,j=D.length,q=[],_;function P(M,W){let K=W+3,V=D[I+K-2],z=D[I+K-1],ne,Ee;w.checkedIf(I,()=>{I+=K,ne=S(D.slice(I,I+V)),I+=V},z>0?()=>{Ee=S(D.slice(I,I+z)),I+=z}:null),q.push("if ("+M+") {"),q.push(...ne.map(r)),z>0&&(q.push("} else {"),q.push(...Ee.map(r))),q.push("}")}function k(M){let K=D[I+2-1],V;w.checkedLoop(I,()=>{I+=2,V=S(D.slice(I,I+K)),I+=K}),q.push("while ("+M+") {"),q.push(...V.map(r)),q.push("}")}function U(){let W=D[I+4-1],K=i(D[I+1])+"("+D.slice(I+4,I+4+W).map(V=>w.index(V)).join(", ")+")";w.pop(D[I+2]),q.push(w.push(K)),I+=4+W}for(;I<j;)switch(D[I]){case gt.PUSH_EMPTY_STRING:q.push(w.push("''")),I++;break;case gt.PUSH_CURR_POS:q.push(w.push("peg$currPos")),I++;break;case gt.PUSH_UNDEFINED:q.push(w.push("undefined")),I++;break;case gt.PUSH_NULL:q.push(w.push("null")),I++;break;case gt.PUSH_FAILED:q.push(w.push("peg$FAILED")),I++;break;case gt.PUSH_EMPTY_ARRAY:q.push(w.push("[]")),I++;break;case gt.POP:w.pop(),I++;break;case gt.POP_CURR_POS:q.push("peg$currPos = "+w.pop()+";"),I++;break;case gt.POP_N:w.pop(D[I+1]),I+=2;break;case gt.NIP:_=w.pop(),w.pop(),q.push(w.push(_)),I++;break;case gt.APPEND:_=w.pop(),q.push(w.top()+".push("+_+");"),I++;break;case gt.WRAP:q.push(w.push("["+w.pop(D[I+1]).join(", ")+"]")),I+=2;break;case gt.TEXT:q.push(w.push("input.substring("+w.pop()+", peg$currPos)")),I++;break;case gt.PLUCK:{let W=D[I+3-1],K=3+W;_=D.slice(I+3,I+K),_=W===1?w.index(_[0]):`[ ${_.map(V=>w.index(V)).join(", ")} ]`,w.pop(D[I+1]),q.push(w.push(_)),I+=K;break}case gt.IF:P(w.top(),0);break;case gt.IF_ERROR:P(w.top()+" === peg$FAILED",0);break;case gt.IF_NOT_ERROR:P(w.top()+" !== peg$FAILED",0);break;case gt.WHILE_NOT_ERROR:k(w.top()+" !== peg$FAILED");break;case gt.MATCH_ANY:P("input.length > peg$currPos",0);break;case gt.MATCH_STRING:P(e.literals[D[I+1]].length>1?"input.substr(peg$currPos, "+e.literals[D[I+1]].length+") === "+n(D[I+1]):"input.charCodeAt(peg$currPos) === "+e.literals[D[I+1]].charCodeAt(0),1);break;case gt.MATCH_STRING_IC:P("input.substr(peg$currPos, "+e.literals[D[I+1]].length+").toLowerCase() === "+n(D[I+1]),1);break;case gt.MATCH_CHAR_CLASS:P(s(D[I+1])+".test(input.charAt(peg$currPos))",1);break;case gt.ACCEPT_N:q.push(w.push(D[I+1]>1?"input.substr(peg$currPos, "+D[I+1]+")":"input.charAt(peg$currPos)")),q.push(D[I+1]>1?"peg$currPos += "+D[I+1]+";":"peg$currPos++;"),I+=2;break;case gt.ACCEPT_STRING:q.push(w.push(n(D[I+1]))),q.push(e.literals[D[I+1]].length>1?"peg$currPos += "+e.literals[D[I+1]].length+";":"peg$currPos++;"),I+=2;break;case gt.FAIL:q.push(w.push("peg$FAILED")),q.push("if (peg$silentFails === 0) { peg$fail("+a(D[I+1])+"); }"),I+=2;break;case gt.LOAD_SAVED_POS:q.push("peg$savedPos = "+w.index(D[I+1])+";"),I+=2;break;case gt.UPDATE_SAVED_POS:q.push("peg$savedPos = peg$currPos;"),I++;break;case gt.CALL:U();break;case gt.RULE:q.push(w.push(c(e.rules[D[I+1]].name)+"()")),I+=2;break;case gt.SILENT_FAILS_ON:q.push("peg$silentFails++;"),I++;break;case gt.SILENT_FAILS_OFF:q.push("peg$silentFails--;"),I++;break;default:throw new Error("Invalid opcode: "+D[I]+".")}return q}let F=S(v.bytecode);return b.push(Tw(" function ",c(v.name),v.nameLocation,`() {
|
||
`,v.name)),t.trace&&b.push(" var startPos = peg$currPos;"),b.push(r(w.defines())),b.push(...h('"'+Pn(v.name)+'"',qB.indexOfRule(e,v.name)).map(r)),b.push(...F.map(r)),b.push(...m('"'+Pn(v.name)+'"',w.result()).map(r)),b.push("}"),b}function p(v){return v.codeLocation?xw(v.code,v.codeLocation,"$"+v.type):v.code}function f(){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 b="{ "+t.allowedStartRules.map(S=>S+": "+c(S)).join(", ")+" }",w=c(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 = "+b+";"," var peg$startRuleFunction = "+w+";","",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(S=>{v.push(...A(S).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 Wn(null,null,t.grammarSource,v.map(S=>S instanceof Wn?S:S+`
|
||
`))}function E(v){function b(){return[`// Generated by Peggy ${VB}.`,"//","// https://peggyjs.org/"]}function w(){return t.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join(`
|
||
`):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join(`
|
||
`)}let F={bare(){return[...b(),"(function() {",' "use strict";',"",v,"",r("return "+w()+";"),"})()"]},commonjs(){let D=Object.keys(t.dependencies),I=b();return I.push("",'"use strict";',""),D.length>0&&(D.forEach(j=>{I.push("var "+j+' = require("'+Pn(t.dependencies[j])+'");')}),I.push("")),I.push(v,"","module.exports = "+w()+";"),I},es(){let D=Object.keys(t.dependencies),I=b();return I.push(""),D.length>0&&(D.forEach(j=>{I.push("import "+j+' from "'+Pn(t.dependencies[j])+'";')}),I.push("")),I.push(v,"","export {"," peg$SyntaxError as SyntaxError,",t.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),I},amd(){let D=Object.keys(t.dependencies),j="["+D.map(_=>t.dependencies[_]).map(_=>'"'+Pn(_)+'"').join(", ")+"]",q=D.join(", ");return[...b(),"define("+j+", function("+q+") {",' "use strict";',"",v,"",r("return "+w()+";"),"});"]},globals(){return[...b(),"(function(root) {",' "use strict";',"",v,"",r("root."+t.exportVar+" = "+w()+";"),"})(this);"]},umd(){let D=Object.keys(t.dependencies),I=D.map(k=>t.dependencies[k]),j="["+I.map(k=>'"'+Pn(k)+'"').join(", ")+"]",q=I.map(k=>'require("'+Pn(k)+'")').join(", "),_=D.join(", "),P=b();return P.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+j+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+q+");"),t.exportVar!==null&&P.push(" } else {"," root."+t.exportVar+" = factory();"),P.push(" }","})(this, function("+_+") {",' "use strict";',"",v,"",r("return "+w()+";"),"});"),P}}[t.format]();return new Wn(null,null,t.grammarSource,F.map(D=>D instanceof Wn?D:D+`
|
||
`))}e.code=E(f())}Ow.exports=GB});var Lw=be((mT,Nw)=>{"use strict";var zB=Gs(),WB=zn();function YB(e,t,r){function n(i){return i.type==="rule"&&i.expression.type==="rule_ref"}function s(i,c,l){WB.build({rule_ref(m){m.name===c&&(m.name=l,r.info(`Proxy rule "${c}" replaced by the rule "${l}"`,m.location,[{message:"This rule will be used",location:zB.findRule(i,l).nameLocation}]))}})(i)}let a=[];e.rules.forEach((i,c)=>{n(i)&&(s(e,i.name,i.expression.name),t.allowedStartRules.indexOf(i.name)===-1&&a.push(c))}),a.reverse(),a.forEach(i=>{e.rules.splice(i,1)})}Nw.exports=YB});var Hw=be((vT,Uw)=>{"use strict";var XB=zn();function JB(e,t,r){function n(i){let c={};return Object.keys(i).forEach(l=>{c[l]=i[l]}),c}function s(i,c){a(i.expression,n(c))}let a=XB.build({rule(i){a(i.expression,{})},choice(i,c){i.alternatives.forEach(l=>{a(l,n(c))})},action:s,labeled(i,c){let l=i.label;l&&Object.prototype.hasOwnProperty.call(c,l)&&r.error(`Label "${i.label}" is already defined`,i.labelLocation,[{message:"Original label location",location:c[l]}]),a(i.expression,c),c[i.label]=i.labelLocation},text:s,simple_and:s,simple_not:s,optional:s,zero_or_more:s,one_or_more:s,group:s});a(e)}Uw.exports=JB});var Mw=be((wT,jw)=>{"use strict";var ZB=zn();function QB(e,t,r){let n={};ZB.build({rule(a){if(Object.prototype.hasOwnProperty.call(n,a.name)){r.error(`Rule "${a.name}" is already defined`,a.nameLocation,[{message:"Original rule location",location:n[a.name]}]);return}n[a.name]=a.nameLocation}})(e)}jw.exports=QB});var Vw=be((AT,Kw)=>{"use strict";var qw=Gs(),eD=zn();function tD(e,t,r){let n=[],s=[],a=eD.build({rule(i){n.push(i.name),a(i.expression),n.pop()},sequence(i){i.elements.every(c=>(a(c),!qw.alwaysConsumesOnSuccess(e,c)))},rule_ref(i){s.push(i);let c=qw.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(" -> ")+")",c.nameLocation,s.map((l,h,m)=>({message:h+1!==m.length?`Step ${h+1}: call of the rule "${l.name}" without input consumption`:`Step ${h+1}: call itself without input consumption - left recursion`,location:l.location})));return}c&&a(c),s.pop()}});a(e)}Kw.exports=tD});var Ww=be((ET,zw)=>{"use strict";var Gw=Gs(),rD=zn();function nD(e,t,r){rD.build({zero_or_more(s){Gw.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){Gw.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)}zw.exports=nD});var Xw=be((yT,Yw)=>{"use strict";var iD=Gs(),sD=zn();function aD(e,t,r){sD.build({rule_ref(s){iD.findRule(e,s.name)||r.error(`Rule "${s.name}" is not defined`,s.location)}})(e)}Yw.exports=aD});var Zw=be((ST,Jw)=>{"use strict";var uD=zn();function oD(e,t,r){let n=uD.build({action(s){n(s.expression,s)},labeled(s,a){s.pick&&a&&r.error('"@" cannot be used with an action block',s.labelLocation,[{message:"Action block location",location:a.codeLocation}]),n(s.expression)}});n(e)}Jw.exports=oD});var eA=be((bT,Qw)=>{"use strict";var cD=Hf(),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(){}},rd=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 cD(...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}};Qw.exports=rd});var tA=be((exports,module)=>{"use strict";var generateBytecode=uw(),generateJS=kw(),inferenceMatchResult=j0(),removeProxyRules=Lw(),reportDuplicateLabels=Hw(),reportDuplicateRules=Mw(),reportInfiniteRecursion=Vw(),reportInfiniteRepetition=Ww(),reportUndefinedRules=Xw(),reportIncorrectPlucking=Zw(),Session=eA(),visitor=zn();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 nA=be((CT,rA)=>{"use strict";var lD={$:"text","&":"simple_and","!":"simple_not"},fD={"?":"optional","*":"zero_or_more","+":"one_or_more"},hD={"&":"semantic_and","!":"semantic_not"};function pD(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function Ys(e,t,r,n){var s=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(s,Ys.prototype),s.expected=t,s.found=r,s.location=n,s.name="SyntaxError",s}pD(Ys,Error);function nd(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,r+=r.repeat(t),e+r.slice(0,t))}Ys.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,a=this.location.source+":"+s.line+":"+s.column;if(r){var i=this.location.end,c=nd("",s.line.toString().length," "),l=r[s.line-1],h=s.line===i.line?i.column:l.length+1,m=h-s.column||1;t+=`
|
||
--> `+a+`
|
||
`+c+` |
|
||
`+s.line+" | "+l+`
|
||
`+c+" | "+nd("",s.column-1," ")+nd("",m,"^")}else t+=`
|
||
at `+a}return t};Ys.buildMessage=function(e,t){var r={literal:function(h){return'"'+s(h.text)+'"'},class:function(h){var m=h.parts.map(function(A){return Array.isArray(A)?a(A[0])+"-"+a(A[1]):a(A)});return"["+(h.inverted?"^":"")+m.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(h){return h.description}};function n(h){return h.charCodeAt(0).toString(16).toUpperCase()}function s(h){return h.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(m){return"\\x0"+n(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+n(m)})}function a(h){return h.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(m){return"\\x0"+n(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+n(m)})}function i(h){return r[h.type](h)}function c(h){var m=h.map(i),A,p;if(m.sort(),m.length>0){for(A=1,p=1;A<m.length;A++)m[A-1]!==m[A]&&(m[p]=m[A],p++);m.length=p}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}function l(h){return h?'"'+s(h)+'"':"end of input"}return"Expected "+c(e)+" but "+l(t)+" found."};function dD(e,t){t=t!==void 0?t:{};var r={},n=t.grammarSource,s={Grammar:uu},a=uu,i="{",c="}",l="=",h="/",m="@",A=":",p="$",f="&",E="!",v="?",b="*",w="+",S="(",F=")",D=" ",I="\v",j="\f",q=" ",_="\xA0",P="\uFEFF",k=`
|
||
`,U=`\r
|
||
`,M="\r",W="\u2028",K="\u2029",V="/*",z="*/",ne="//",Ee="_",we="\\",_e="\u200C",He="\u200D",ue="i",Ce='"',Oe="'",sr="[",_t="^",lt="]",Mt="-",Pt="0",Qe="b",bt="f",Je="n",ht="r",qt="t",ze="v",Ot="x",Rn="u",ar=".",gr=";",zt=/^[\n\r\u2028\u2029]/,br=/^[0-9]/,Xs=/^[0-9a-f]/i,Or=/^[{}]/,pt=/^[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]/,Wt=/^[\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]/,We=/^[\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]/,Cr=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,Js=/^[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]/,Zs=/^[\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]/,Qs=/^[\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]/,ea=/^[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]/,Oi=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,ta=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,bs=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,si=ke("{",!1),ki=ke("}",!1),Va=ke("=",!1),Ga=ke("/",!1),za=ke("@",!1),Wa=ke(":",!1),Ya=ke("$",!1),Xa=ke("&",!1),Ja=ke("!",!1),lo=ke("?",!1),Za=ke("*",!1),fo=ke("+",!1),ho=ke("(",!1),po=ke(")",!1),Cs=Ds(),go=xn("whitespace"),ra=ke(" ",!1),mo=ke("\v",!1),vo=ke("\f",!1),wo=ke(" ",!1),Ao=ke("\xA0",!1),Eo=ke("\uFEFF",!1),yo=Xt([`
|
||
`,"\r","\u2028","\u2029"],!1,!1),So=xn("end of line"),bo=ke(`
|
||
`,!1),ai=ke(`\r
|
||
`,!1),Qa=ke("\r",!1),Co=ke("\u2028",!1),Fo=ke("\u2029",!1),_o=xn("comment"),eu=ke("/*",!1),ui=ke("*/",!1),Wr=ke("//",!1),Io=xn("identifier"),Fs=ke("_",!1),hn=ke("\\",!1),Bo=ke("\u200C",!1),Do=ke("\u200D",!1),tu=xn("literal"),na=ke("i",!1),ru=xn("string"),_s=ke('"',!1),kt=ke("'",!1),Po=xn("character class"),$o=ke("[",!1),nu=ke("^",!1),oi=ke("]",!1),ur=ke("-",!1),Dt=ke("0",!1),Ro=ke("b",!1),ia=ke("f",!1),or=ke("n",!1),sa=ke("r",!1),iu=ke("t",!1),su=ke("v",!1),aa=ke("x",!1),ci=ke("u",!1),oa=Xt([["0","9"]],!1,!1),au=Xt([["0","9"],["a","f"]],!1,!0),ca=ke(".",!1),la=xn("code block"),kr=Xt(["{","}"],!1,!1),$=Xt([["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),T=Xt([["\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),L=Xt(["\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),Z=Xt(["\u01C5","\u01C8","\u01CB","\u01F2",["\u1F88","\u1F8F"],["\u1F98","\u1F9F"],["\u1FA8","\u1FAF"],"\u1FBC","\u1FCC","\u1FFC"],!1,!1),pe=Xt([["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),me=Xt(["\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),Fe=Xt([["\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),Pe=Xt([["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),wt=Xt([["\u16EE","\u16F0"],["\u2160","\u2182"],["\u2185","\u2188"],"\u3007",["\u3021","\u3029"],["\u3038","\u303A"],["\uA6E6","\uA6EF"]],!1,!1),Nt=Xt(["_",["\u203F","\u2040"],"\u2054",["\uFE33","\uFE34"],["\uFE4D","\uFE4F"],"\uFF3F"],!1,!1),mr=Xt([" ","\xA0","\u1680",["\u2000","\u200A"],"\u202F","\u205F","\u3000"],!1,!1),vr=ke(";",!1),pn=function(y,x,Y){return{type:"grammar",topLevelInitializer:y,initializer:x,rules:Y,location:$t()}},Is=function(y){return{type:"top_level_initializer",code:y[0],codeLocation:y[1],location:$t()}},Nr=function(y){return{type:"initializer",code:y[0],codeLocation:y[1],location:$t()}},wr=function(y,x,Y){return{type:"rule",name:y[0],nameLocation:y[1],expression:x!==null?{type:"named",name:x,expression:Y,location:$t()}:Y,location:$t()}},Bs=function(y,x){return x.length>0?{type:"choice",alternatives:[y].concat(x),location:$t()}:y},Tn=function(y,x){return x!==null?{type:"action",expression:y,code:x[0],codeLocation:x[1],location:$t()}:y},fa=function(y,x){return x.length>0||y.type==="labeled"&&y.pick?{type:"sequence",elements:[y].concat(x),location:$t()}:y},Xf=function(y,x,Y){return Y.type.startsWith("semantic_")&&ko('"@" cannot be used on a semantic predicate',y),{type:"labeled",label:x!==null?x[0]:null,labelLocation:x!==null?x[1]:y,pick:!0,expression:Y,location:$t()}},Jf=function(y,x){return{type:"labeled",label:y[0],labelLocation:y[1],expression:x,location:$t()}},Ct=function(){return $t()},yt=function(y){return Au.indexOf(y[0])>=0&&ko(`Label can't be a reserved word "${y[0]}"`,y[1]),y},Zf=function(y,x){return{type:lD[y],expression:x,location:$t()}},Qf=function(y,x){return{type:fD[x],expression:y,location:$t()}},eh=function(y){return y.type==="labeled"||y.type==="sequence"?{type:"group",expression:y,location:$t()}:y},th=function(y){return{type:"rule_ref",name:y[0],location:$t()}},rh=function(y,x){return{type:hD[y],code:x[0],codeLocation:x[1],location:$t()}},nh=function(y,x){return[y+x.join(""),$t()]},Nc=function(y,x){return{type:"literal",value:y,ignoreCase:x!==null,location:$t()}},ih=function(y){return y.join("")},Yt=function(y){return y.join("")},To=function(y,x,Y){return{type:"class",parts:x.filter(H=>H!==""),inverted:y!==null,ignoreCase:Y!==null,location:$t()}},Ni=function(y,x){return y.charCodeAt(0)>x.charCodeAt(0)&&ko("Invalid character range: "+Oo()+"."),[y,x]},Lc=function(){return""},xo=function(){return"\0"},Yr=function(){return"\b"},Uc=function(){return"\f"},Hc=function(){return`
|
||
`},jc=function(){return"\r"},Mc=function(){return" "},qc=function(){return"\v"},Kc=function(y){return String.fromCharCode(parseInt(y,16))},Lr=function(y){return String.fromCharCode(parseInt(y,16))},sh=function(){return{type:"any",location:$t()}},Xr=function(y){return[y,$t()]},B=0,Ve=0,dn=[{line:1,column:1}],Ur=0,ha=[],ee=0,gn;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function Oo(){return e.substring(Ve,B)}function hd(){return Ve}function Vc(){return{source:n,start:Ve,end:B}}function $t(){return Li(Ve,B)}function pd(y,x){throw x=x!==void 0?x:Li(Ve,B),zc([xn(y)],e.substring(Ve,B),x)}function ko(y,x){throw x=x!==void 0?x:Li(Ve,B),Gc(y,x)}function ke(y,x){return{type:"literal",text:y,ignoreCase:x}}function Xt(y,x,Y){return{type:"class",parts:y,inverted:x,ignoreCase:Y}}function Ds(){return{type:"any"}}function ah(){return{type:"end"}}function xn(y){return{type:"other",description:y}}function No(y){var x=dn[y],Y;if(x)return x;for(Y=y-1;!dn[Y];)Y--;for(x=dn[Y],x={line:x.line,column:x.column};Y<y;)e.charCodeAt(Y)===10?(x.line++,x.column=1):x.column++,Y++;return dn[y]=x,x}function Li(y,x){var Y=No(y),H=No(x);return{source:n,start:{offset:y,line:Y.line,column:Y.column},end:{offset:x,line:H.line,column:H.column}}}function he(y){B<Ur||(B>Ur&&(Ur=B,ha=[]),ha.push(y))}function Gc(y,x){return new Ys(y,null,null,x)}function zc(y,x,Y){return new Ys(Ys.buildMessage(y,x),y,x,Y)}function uu(){var y,x,Y,H,ie,oe,Et,Lt;if(y=B,x=dt(),Y=B,H=Lo(),H!==r?(ie=dt(),Y=H):(B=Y,Y=r),Y===r&&(Y=null),H=B,ie=uh(),ie!==r?(oe=dt(),H=ie):(B=H,H=r),H===r&&(H=null),ie=[],oe=B,Et=Uo(),Et!==r?(Lt=dt(),oe=Et):(B=oe,oe=r),oe!==r)for(;oe!==r;)ie.push(oe),oe=B,Et=Uo(),Et!==r?(Lt=dt(),oe=Et):(B=oe,oe=r);else ie=r;return ie!==r?(Ve=y,y=pn(Y,H,ie)):(B=y,y=r),y}function Lo(){var y,x,Y,H,ie;return y=B,e.charCodeAt(B)===123?(x=i,B++):(x=r,ee===0&&he(si)),x!==r?(Y=ot(),Y!==r?(e.charCodeAt(B)===125?(H=c,B++):(H=r,ee===0&&he(ki)),H!==r?(ie=Mi(),ie!==r?(Ve=y,y=Is(Y)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r),y}function uh(){var y,x,Y;return y=B,x=ot(),x!==r?(Y=Mi(),Y!==r?(Ve=y,y=Nr(x)):(B=y,y=r)):(B=y,y=r),y}function Uo(){var y,x,Y,H,ie,oe,Et,Lt;return y=B,x=lu(),x!==r?(Y=dt(),H=B,ie=On(),ie!==r?(oe=dt(),H=ie):(B=H,H=r),H===r&&(H=null),e.charCodeAt(B)===61?(ie=l,B++):(ie=r,ee===0&&he(Va)),ie!==r?(oe=dt(),Et=Fr(),Et!==r?(Lt=Mi(),Lt!==r?(Ve=y,y=wr(x,H,Et)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r),y}function Fr(){var y,x,Y,H,ie,oe,Et,Lt;if(y=B,x=pa(),x!==r){for(Y=[],H=B,ie=dt(),e.charCodeAt(B)===47?(oe=h,B++):(oe=r,ee===0&&he(Ga)),oe!==r?(Et=dt(),Lt=pa(),Lt!==r?H=Lt:(B=H,H=r)):(B=H,H=r);H!==r;)Y.push(H),H=B,ie=dt(),e.charCodeAt(B)===47?(oe=h,B++):(oe=r,ee===0&&he(Ga)),oe!==r?(Et=dt(),Lt=pa(),Lt!==r?H=Lt:(B=H,H=r)):(B=H,H=r);Ve=y,y=Bs(x,Y)}else B=y,y=r;return y}function pa(){var y,x,Y,H,ie;return y=B,x=da(),x!==r?(Y=B,H=dt(),ie=ot(),ie!==r?Y=ie:(B=Y,Y=r),Y===r&&(Y=null),Ve=y,y=Tn(x,Y)):(B=y,y=r),y}function da(){var y,x,Y,H,ie,oe;if(y=B,x=ou(),x!==r){for(Y=[],H=B,ie=dt(),oe=ou(),oe!==r?H=oe:(B=H,H=r);H!==r;)Y.push(H),H=B,ie=dt(),oe=ou(),oe!==r?H=oe:(B=H,H=r);Ve=y,y=fa(x,Y)}else B=y,y=r;return y}function ou(){var y,x,Y,H;return y=B,x=Wc(),x!==r?(Y=Yc(),Y===r&&(Y=null),H=Ho(),H!==r?(Ve=y,y=Xf(x,Y,H)):(B=y,y=r)):(B=y,y=r),y===r&&(y=B,x=Yc(),x!==r?(Y=dt(),H=Ho(),H!==r?(Ve=y,y=Jf(x,H)):(B=y,y=r)):(B=y,y=r),y===r&&(y=Ho())),y}function Wc(){var y,x;return y=B,e.charCodeAt(B)===64?(x=m,B++):(x=r,ee===0&&he(za)),x!==r&&(Ve=y,x=Ct()),y=x,y}function Yc(){var y,x,Y,H;return y=B,x=lu(),x!==r?(Y=dt(),e.charCodeAt(B)===58?(H=A,B++):(H=r,ee===0&&he(Wa)),H!==r?(Ve=y,y=yt(x)):(B=y,y=r)):(B=y,y=r),y}function Ho(){var y,x,Y,H;return y=B,x=oh(),x!==r?(Y=dt(),H=Xc(),H!==r?(Ve=y,y=Zf(x,H)):(B=y,y=r)):(B=y,y=r),y===r&&(y=Xc()),y}function oh(){var y;return e.charCodeAt(B)===36?(y=p,B++):(y=r,ee===0&&he(Ya)),y===r&&(e.charCodeAt(B)===38?(y=f,B++):(y=r,ee===0&&he(Xa)),y===r&&(e.charCodeAt(B)===33?(y=E,B++):(y=r,ee===0&&he(Ja)))),y}function Xc(){var y,x,Y,H;return y=B,x=Ui(),x!==r?(Y=dt(),H=ch(),H!==r?(Ve=y,y=Qf(x,H)):(B=y,y=r)):(B=y,y=r),y===r&&(y=Ui()),y}function ch(){var y;return e.charCodeAt(B)===63?(y=v,B++):(y=r,ee===0&&he(lo)),y===r&&(e.charCodeAt(B)===42?(y=b,B++):(y=r,ee===0&&he(Za)),y===r&&(e.charCodeAt(B)===43?(y=w,B++):(y=r,ee===0&&he(fo)))),y}function Ui(){var y,x,Y,H,ie,oe;return y=gh(),y===r&&(y=ae(),y===r&&(y=pu(),y===r&&(y=lh(),y===r&&(y=fh(),y===r&&(y=B,e.charCodeAt(B)===40?(x=S,B++):(x=r,ee===0&&he(ho)),x!==r?(Y=dt(),H=Fr(),H!==r?(ie=dt(),e.charCodeAt(B)===41?(oe=F,B++):(oe=r,ee===0&&he(po)),oe!==r?(Ve=y,y=eh(H)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r)))))),y}function lh(){var y,x,Y,H,ie,oe,Et,Lt;return y=B,x=lu(),x!==r?(Y=B,ee++,H=B,ie=dt(),oe=B,Et=On(),Et!==r?(Lt=dt(),Et=[Et,Lt],oe=Et):(B=oe,oe=r),oe===r&&(oe=null),e.charCodeAt(B)===61?(Et=l,B++):(Et=r,ee===0&&he(Va)),Et!==r?(ie=[ie,oe,Et],H=ie):(B=H,H=r),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(Ve=y,y=th(x)):(B=y,y=r)):(B=y,y=r),y}function fh(){var y,x,Y,H;return y=B,x=jo(),x!==r?(Y=dt(),H=ot(),H!==r?(Ve=y,y=rh(x,H)):(B=y,y=r)):(B=y,y=r),y}function jo(){var y;return e.charCodeAt(B)===38?(y=f,B++):(y=r,ee===0&&he(Xa)),y===r&&(e.charCodeAt(B)===33?(y=E,B++):(y=r,ee===0&&he(Ja))),y}function Ar(){var y;return e.length>B?(y=e.charAt(B),B++):(y=r,ee===0&&he(Cs)),y}function mn(){var y,x;return ee++,e.charCodeAt(B)===9?(y=D,B++):(y=r,ee===0&&he(ra)),y===r&&(e.charCodeAt(B)===11?(y=I,B++):(y=r,ee===0&&he(mo)),y===r&&(e.charCodeAt(B)===12?(y=j,B++):(y=r,ee===0&&he(vo)),y===r&&(e.charCodeAt(B)===32?(y=q,B++):(y=r,ee===0&&he(wo)),y===r&&(e.charCodeAt(B)===160?(y=_,B++):(y=r,ee===0&&he(Ao)),y===r&&(e.charCodeAt(B)===65279?(y=P,B++):(y=r,ee===0&&he(Eo)),y===r&&(y=nl())))))),ee--,y===r&&(x=r,ee===0&&he(go)),y}function vn(){var y;return zt.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(yo)),y}function cu(){var y,x;return ee++,e.charCodeAt(B)===10?(y=k,B++):(y=r,ee===0&&he(bo)),y===r&&(e.substr(B,2)===U?(y=U,B+=2):(y=r,ee===0&&he(ai)),y===r&&(e.charCodeAt(B)===13?(y=M,B++):(y=r,ee===0&&he(Qa)),y===r&&(e.charCodeAt(B)===8232?(y=W,B++):(y=r,ee===0&&he(Co)),y===r&&(e.charCodeAt(B)===8233?(y=K,B++):(y=r,ee===0&&he(Fo)))))),ee--,y===r&&(x=r,ee===0&&he(So)),y}function Jc(){var y,x;return ee++,y=hh(),y===r&&(y=Jr()),ee--,y===r&&(x=r,ee===0&&he(_o)),y}function hh(){var y,x,Y,H,ie,oe;if(y=B,e.substr(B,2)===V?(x=V,B+=2):(x=r,ee===0&&he(eu)),x!==r){for(Y=[],H=B,ie=B,ee++,e.substr(B,2)===z?(oe=z,B+=2):(oe=r,ee===0&&he(ui)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);H!==r;)Y.push(H),H=B,ie=B,ee++,e.substr(B,2)===z?(oe=z,B+=2):(oe=r,ee===0&&he(ui)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);e.substr(B,2)===z?(H=z,B+=2):(H=r,ee===0&&he(ui)),H!==r?(x=[x,Y,H],y=x):(B=y,y=r)}else B=y,y=r;return y}function Hi(){var y,x,Y,H,ie,oe;if(y=B,e.substr(B,2)===V?(x=V,B+=2):(x=r,ee===0&&he(eu)),x!==r){for(Y=[],H=B,ie=B,ee++,e.substr(B,2)===z?(oe=z,B+=2):(oe=r,ee===0&&he(ui)),oe===r&&(oe=vn()),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);H!==r;)Y.push(H),H=B,ie=B,ee++,e.substr(B,2)===z?(oe=z,B+=2):(oe=r,ee===0&&he(ui)),oe===r&&(oe=vn()),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);e.substr(B,2)===z?(H=z,B+=2):(H=r,ee===0&&he(ui)),H!==r?(x=[x,Y,H],y=x):(B=y,y=r)}else B=y,y=r;return y}function Jr(){var y,x,Y,H,ie,oe;if(y=B,e.substr(B,2)===ne?(x=ne,B+=2):(x=r,ee===0&&he(Wr)),x!==r){for(Y=[],H=B,ie=B,ee++,oe=vn(),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);H!==r;)Y.push(H),H=B,ie=B,ee++,oe=vn(),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);x=[x,Y],y=x}else B=y,y=r;return y}function lu(){var y,x,Y,H;if(ee++,y=B,x=Zc(),x!==r){for(Y=[],H=Qc();H!==r;)Y.push(H),H=Qc();Ve=y,y=nh(x,Y)}else B=y,y=r;return ee--,y===r&&(x=r,ee===0&&he(Io)),y}function Zc(){var y,x,Y;return y=ph(),y===r&&(e.charCodeAt(B)===36?(y=p,B++):(y=r,ee===0&&he(Ya)),y===r&&(e.charCodeAt(B)===95?(y=Ee,B++):(y=r,ee===0&&he(Fs)),y===r&&(y=B,e.charCodeAt(B)===92?(x=we,B++):(x=r,ee===0&&he(hn)),x!==r?(Y=el(),Y!==r?y=Y:(B=y,y=r)):(B=y,y=r)))),y}function Qc(){var y;return y=Zc(),y===r&&(y=dh(),y===r&&(y=tl(),y===r&&(y=rl(),y===r&&(e.charCodeAt(B)===8204?(y=_e,B++):(y=r,ee===0&&he(Bo)),y===r&&(e.charCodeAt(B)===8205?(y=He,B++):(y=r,ee===0&&he(Do))))))),y}function ph(){var y;return y=mu(),y===r&&(y=gu(),y===r&&(y=Eh(),y===r&&(y=wh(),y===r&&(y=Ah(),y===r&&(y=wu()))))),y}function dh(){var y;return y=vu(),y===r&&(y=li()),y}function gh(){var y,x,Y;return ee++,y=B,x=On(),x!==r?(e.charCodeAt(B)===105?(Y=ue,B++):(Y=r,ee===0&&he(na)),Y===r&&(Y=null),Ve=y,y=Nc(x,Y)):(B=y,y=r),ee--,y===r&&(x=r,ee===0&&he(tu)),y}function On(){var y,x,Y,H;if(ee++,y=B,e.charCodeAt(B)===34?(x=Ce,B++):(x=r,ee===0&&he(_s)),x!==r){for(Y=[],H=te();H!==r;)Y.push(H),H=te();e.charCodeAt(B)===34?(H=Ce,B++):(H=r,ee===0&&he(_s)),H!==r?(Ve=y,y=ih(Y)):(B=y,y=r)}else B=y,y=r;if(y===r)if(y=B,e.charCodeAt(B)===39?(x=Oe,B++):(x=r,ee===0&&he(kt)),x!==r){for(Y=[],H=ce();H!==r;)Y.push(H),H=ce();e.charCodeAt(B)===39?(H=Oe,B++):(H=r,ee===0&&he(kt)),H!==r?(Ve=y,y=Yt(Y)):(B=y,y=r)}else B=y,y=r;return ee--,y===r&&(x=r,ee===0&&he(ru)),y}function te(){var y,x,Y,H;return y=B,x=B,Y=B,ee++,e.charCodeAt(B)===34?(H=Ce,B++):(H=r,ee===0&&he(_s)),H===r&&(e.charCodeAt(B)===92?(H=we,B++):(H=r,ee===0&&he(hn)),H===r&&(H=vn())),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(H=Ar(),H!==r?(Y=[Y,H],x=Y):(B=x,x=r)):(B=x,x=r),x!==r?y=e.substring(y,B):y=x,y===r&&(y=B,e.charCodeAt(B)===92?(x=we,B++):(x=r,ee===0&&he(hn)),x!==r?(Y=Rt(),Y!==r?y=Y:(B=y,y=r)):(B=y,y=r),y===r&&(y=st())),y}function ce(){var y,x,Y,H;return y=B,x=B,Y=B,ee++,e.charCodeAt(B)===39?(H=Oe,B++):(H=r,ee===0&&he(kt)),H===r&&(e.charCodeAt(B)===92?(H=we,B++):(H=r,ee===0&&he(hn)),H===r&&(H=vn())),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(H=Ar(),H!==r?(Y=[Y,H],x=Y):(B=x,x=r)):(B=x,x=r),x!==r?y=e.substring(y,B):y=x,y===r&&(y=B,e.charCodeAt(B)===92?(x=we,B++):(x=r,ee===0&&he(hn)),x!==r?(Y=Rt(),Y!==r?y=Y:(B=y,y=r)):(B=y,y=r),y===r&&(y=st())),y}function ae(){var y,x,Y,H,ie,oe;if(ee++,y=B,e.charCodeAt(B)===91?(x=sr,B++):(x=r,ee===0&&he($o)),x!==r){for(e.charCodeAt(B)===94?(Y=_t,B++):(Y=r,ee===0&&he(nu)),Y===r&&(Y=null),H=[],ie=$e(),ie===r&&(ie=qe());ie!==r;)H.push(ie),ie=$e(),ie===r&&(ie=qe());e.charCodeAt(B)===93?(ie=lt,B++):(ie=r,ee===0&&he(oi)),ie!==r?(e.charCodeAt(B)===105?(oe=ue,B++):(oe=r,ee===0&&he(na)),oe===r&&(oe=null),Ve=y,y=To(Y,H,oe)):(B=y,y=r)}else B=y,y=r;return ee--,y===r&&(x=r,ee===0&&he(Po)),y}function $e(){var y,x,Y,H;return y=B,x=qe(),x!==r?(e.charCodeAt(B)===45?(Y=Mt,B++):(Y=r,ee===0&&he(ur)),Y!==r?(H=qe(),H!==r?(Ve=y,y=Ni(x,H)):(B=y,y=r)):(B=y,y=r)):(B=y,y=r),y}function qe(){var y,x,Y,H;return y=B,x=B,Y=B,ee++,e.charCodeAt(B)===93?(H=lt,B++):(H=r,ee===0&&he(oi)),H===r&&(e.charCodeAt(B)===92?(H=we,B++):(H=r,ee===0&&he(hn)),H===r&&(H=vn())),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(H=Ar(),H!==r?(Y=[Y,H],x=Y):(B=x,x=r)):(B=x,x=r),x!==r?y=e.substring(y,B):y=x,y===r&&(y=B,e.charCodeAt(B)===92?(x=we,B++):(x=r,ee===0&&he(hn)),x!==r?(Y=Rt(),Y!==r?y=Y:(B=y,y=r)):(B=y,y=r),y===r&&(y=st())),y}function st(){var y,x,Y;return y=B,e.charCodeAt(B)===92?(x=we,B++):(x=r,ee===0&&he(hn)),x!==r?(Y=cu(),Y!==r?(Ve=y,y=Lc()):(B=y,y=r)):(B=y,y=r),y}function Rt(){var y,x,Y,H;return y=At(),y===r&&(y=B,e.charCodeAt(B)===48?(x=Pt,B++):(x=r,ee===0&&he(Dt)),x!==r?(Y=B,ee++,H=ji(),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(Ve=y,y=xo()):(B=y,y=r)):(B=y,y=r),y===r&&(y=hu(),y===r&&(y=el()))),y}function At(){var y;return y=fu(),y===r&&(y=mh()),y}function fu(){var y,x;return e.charCodeAt(B)===39?(y=Oe,B++):(y=r,ee===0&&he(kt)),y===r&&(e.charCodeAt(B)===34?(y=Ce,B++):(y=r,ee===0&&he(_s)),y===r&&(e.charCodeAt(B)===92?(y=we,B++):(y=r,ee===0&&he(hn)),y===r&&(y=B,e.charCodeAt(B)===98?(x=Qe,B++):(x=r,ee===0&&he(Ro)),x!==r&&(Ve=y,x=Yr()),y=x,y===r&&(y=B,e.charCodeAt(B)===102?(x=bt,B++):(x=r,ee===0&&he(ia)),x!==r&&(Ve=y,x=Uc()),y=x,y===r&&(y=B,e.charCodeAt(B)===110?(x=Je,B++):(x=r,ee===0&&he(or)),x!==r&&(Ve=y,x=Hc()),y=x,y===r&&(y=B,e.charCodeAt(B)===114?(x=ht,B++):(x=r,ee===0&&he(sa)),x!==r&&(Ve=y,x=jc()),y=x,y===r&&(y=B,e.charCodeAt(B)===116?(x=qt,B++):(x=r,ee===0&&he(iu)),x!==r&&(Ve=y,x=Mc()),y=x,y===r&&(y=B,e.charCodeAt(B)===118?(x=ze,B++):(x=r,ee===0&&he(su)),x!==r&&(Ve=y,x=qc()),y=x)))))))),y}function mh(){var y,x,Y,H;return y=B,x=B,Y=B,ee++,H=Zr(),H===r&&(H=vn()),ee--,H===r?Y=void 0:(B=Y,Y=r),Y!==r?(H=Ar(),H!==r?(Y=[Y,H],x=Y):(B=x,x=r)):(B=x,x=r),x!==r?y=e.substring(y,B):y=x,y}function Zr(){var y;return y=fu(),y===r&&(y=ji(),y===r&&(e.charCodeAt(B)===120?(y=Ot,B++):(y=r,ee===0&&he(aa)),y===r&&(e.charCodeAt(B)===117?(y=Rn,B++):(y=r,ee===0&&he(ci))))),y}function hu(){var y,x,Y,H,ie,oe;return y=B,e.charCodeAt(B)===120?(x=Ot,B++):(x=r,ee===0&&he(aa)),x!==r?(Y=B,H=B,ie=Yn(),ie!==r?(oe=Yn(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r),H!==r?Y=e.substring(Y,B):Y=H,Y!==r?(Ve=y,y=Kc(Y)):(B=y,y=r)):(B=y,y=r),y}function el(){var y,x,Y,H,ie,oe,Et,Lt;return y=B,e.charCodeAt(B)===117?(x=Rn,B++):(x=r,ee===0&&he(ci)),x!==r?(Y=B,H=B,ie=Yn(),ie!==r?(oe=Yn(),oe!==r?(Et=Yn(),Et!==r?(Lt=Yn(),Lt!==r?(ie=[ie,oe,Et,Lt],H=ie):(B=H,H=r)):(B=H,H=r)):(B=H,H=r)):(B=H,H=r),H!==r?Y=e.substring(Y,B):Y=H,Y!==r?(Ve=y,y=Lr(Y)):(B=y,y=r)):(B=y,y=r),y}function ji(){var y;return br.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(oa)),y}function Yn(){var y;return Xs.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(au)),y}function pu(){var y,x;return y=B,e.charCodeAt(B)===46?(x=ar,B++):(x=r,ee===0&&he(ca)),x!==r&&(Ve=y,x=sh()),y=x,y}function ot(){var y,x,Y,H;return ee++,y=B,e.charCodeAt(B)===123?(x=i,B++):(x=r,ee===0&&he(si)),x!==r?(Y=vh(),e.charCodeAt(B)===125?(H=c,B++):(H=r,ee===0&&he(ki)),H!==r?y=Y:(B=y,y=r)):(B=y,y=r),ee--,y===r&&(x=r,ee===0&&he(la)),y}function vh(){var y,x;return y=B,x=du(),Ve=y,x=Xr(x),y=x,y}function du(){var y,x,Y,H,ie,oe;if(y=B,x=[],Y=[],H=B,ie=B,ee++,Or.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,ee===0&&he(kr)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r),H!==r)for(;H!==r;)Y.push(H),H=B,ie=B,ee++,Or.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,ee===0&&he(kr)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);else Y=r;for(Y===r&&(Y=B,e.charCodeAt(B)===123?(H=i,B++):(H=r,ee===0&&he(si)),H!==r?(ie=du(),e.charCodeAt(B)===125?(oe=c,B++):(oe=r,ee===0&&he(ki)),oe!==r?(H=[H,ie,oe],Y=H):(B=Y,Y=r)):(B=Y,Y=r));Y!==r;){if(x.push(Y),Y=[],H=B,ie=B,ee++,Or.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,ee===0&&he(kr)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r),H!==r)for(;H!==r;)Y.push(H),H=B,ie=B,ee++,Or.test(e.charAt(B))?(oe=e.charAt(B),B++):(oe=r,ee===0&&he(kr)),ee--,oe===r?ie=void 0:(B=ie,ie=r),ie!==r?(oe=Ar(),oe!==r?(ie=[ie,oe],H=ie):(B=H,H=r)):(B=H,H=r);else Y=r;Y===r&&(Y=B,e.charCodeAt(B)===123?(H=i,B++):(H=r,ee===0&&he(si)),H!==r?(ie=du(),e.charCodeAt(B)===125?(oe=c,B++):(oe=r,ee===0&&he(ki)),oe!==r?(H=[H,ie,oe],Y=H):(B=Y,Y=r)):(B=Y,Y=r))}return y=e.substring(y,B),y}function gu(){var y;return pt.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he($)),y}function wh(){var y;return Wt.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(T)),y}function Ah(){var y;return We.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(L)),y}function Eh(){var y;return Cr.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(Z)),y}function mu(){var y;return Js.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(pe)),y}function li(){var y;return Zs.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(me)),y}function vu(){var y;return Qs.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(Fe)),y}function tl(){var y;return ea.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(Pe)),y}function wu(){var y;return Oi.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(wt)),y}function rl(){var y;return ta.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(Nt)),y}function nl(){var y;return bs.test(e.charAt(B))?(y=e.charAt(B),B++):(y=r,ee===0&&he(mr)),y}function dt(){var y,x;for(y=[],x=mn(),x===r&&(x=cu(),x===r&&(x=Jc()));x!==r;)y.push(x),x=mn(),x===r&&(x=cu(),x===r&&(x=Jc()));return y}function il(){var y,x;for(y=[],x=mn(),x===r&&(x=Hi());x!==r;)y.push(x),x=mn(),x===r&&(x=Hi());return y}function Mi(){var y,x,Y,H;return y=B,x=dt(),e.charCodeAt(B)===59?(Y=gr,B++):(Y=r,ee===0&&he(vr)),Y!==r?(x=[x,Y],y=x):(B=y,y=r),y===r&&(y=B,x=il(),Y=Jr(),Y===r&&(Y=null),H=cu(),H!==r?(x=[x,Y,H],y=x):(B=y,y=r),y===r&&(y=B,x=dt(),Y=qi(),Y!==r?(x=[x,Y],y=x):(B=y,y=r))),y}function qi(){var y,x;return y=B,ee++,e.length>B?(x=e.charAt(B),B++):(x=r,ee===0&&he(Cs)),ee--,x===r?y=void 0:(B=y,y=r),y}let Au=t.reservedWords||[];if(gn=a(),gn!==r&&B===e.length)return gn;throw gn!==r&&B<e.length&&he(ah()),zc(ha,Ur<e.length?e.charAt(Ur):null,Ur<e.length?Li(Ur,Ur+1):Li(Ur,Ur))}rA.exports={SyntaxError:Ys,parse:dD}});var kc=be((FT,iA)=>{"use strict";var gD=Hf(),mD=tA(),vD=nA(),wD=V0(),AD=["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"],Oc={VERSION:wD,RESERVED_WORDS:AD,GrammarError:gD,parser:vD,compiler:mD,generate(e,t){t=t!==void 0?t:{};function r(a){let i={};return Object.keys(a).forEach(c=>{i[c]=a[c].slice()}),i}let n="plugins"in t?t.plugins:[],s={parser:Oc.parser,passes:r(Oc.compiler.passes),reservedWords:Oc.RESERVED_WORDS.slice()};return n.forEach(a=>{a.use(s,t)}),Oc.compiler.compile(s.parser.parse(e,{grammarSource:t.grammarSource,reservedWords:s.reservedWords}),s.passes,t)}};iA.exports=Oc});var Pl="2.19.60";var nn="settings",tc="subs",$l="collections",Bu="files",Rl="modules",Du="artifacts",Z1="rules";var Q1="Sub-Store Artifacts Repository",ba="#sub-store-cached-resource",Ca="#sub-store-cached-headers-resource",Tl="#sub-store-chr-expiration-time";var Fa="#sub-store-cached-script-resource",xl="#sub-store-csr-expiration-time";var Os=typeof $task<"u",Qi=typeof $loon<"u",ks=typeof $httpClient<"u"&&!Qi,di=eval('typeof process !== "undefined"'),tg=typeof $environment<"u"&&$environment["stash-version"],rg=typeof $rocket<"u",b3=typeof egern=="object",C3=typeof $native<"u",Ns=typeof $Plugins<"u";function eg(e){return e!==null&&typeof e=="object"&&[null,Object.prototype].includes(Object.getPrototypeOf(e))}var Ol=class{constructor(name="untitled",debug=!1){if(this.name=name,this.debug=debug,this.http=es(),this.env=gi(),di){let dotenv=eval('require("dotenv")');dotenv.config()}this.node=(()=>{if(di){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(Os&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(Qi||ks)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),Ns&&(this.cache=JSON.parse($Plugins.SubStoreCache.get(this.name)||"{}")),di){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}`)}eg(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{this.cache=JSON.parse(this.node.fs.readFileSync(`${fpath}`))}catch(e){this.node.fs.copyFileSync(fpath,backupPath),this.error(`Failed to parse ${fpath}: ${e.message}. Backup created at ${backupPath}`)}eg(this.cache)||(this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"w"}),this.cache={})}}persistCache(){let data=JSON.stringify(this.cache,null,2);if(Os&&$prefs.setValueForKey(data,this.name),(Qi||ks)&&$persistentStore.write(data,this.name),Ns&&$Plugins.SubStoreCache.set(this.name,data),di){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),ks||Qi)return $persistentStore.write(e,t);if(Os)return $prefs.setValueForKey(e,t);if(di&&(this.root[t]=e),Ns)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),ks||Qi)return $persistentStore.read(e);if(Os)return $prefs.valueForKey(e);if(di)return this.root[e];if(Ns)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),ks||Qi)return $persistentStore.write(null,e);if(Os)return $prefs.removeValueForKey(e);if(di&&delete this.root[e],Ns)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(Os&&$notify(title,subtitle,content,options),ks&&$notification.post(title,subtitle,content+`${mediaURL?`
|
||
\u591A\u5A92\u4F53:`+mediaURL:""}`,{url:openURL}),Qi){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(di){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(`
|
||
`)));es().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}`)})}}Ns&&$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={}){Os||Qi||ks||Ns?$done(e):di&&typeof $context<"u"&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}};function gi(){return{isQX:Os,isLoon:Qi,isSurge:ks,isNode:di,isStash:tg,isShadowRocket:rg,isEgern:b3,isLanceX:C3,isGUIforCores:Ns}}function es(defaultOptions={baseURL:""}){let{isQX,isLoon,isSurge,isNode,isGUIforCores}=gi(),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||tg||rg)&&(opts.timeout=Math.ceil(opts.timeout/1e3),e="s")}if(isNode){let undici=eval("require('undici')"),{ProxyAgent,EnvHttpProxyAgent,request,interceptors}=undici,agentOpts={connect:{rejectUnauthorized:!(opts.strictSSL===!1||opts.insecure===!0)},bodyTimeout:opts.timeout,headersTimeout:opts.timeout};try{let e=new URL(opts.url);(e.username||e.password)&&(opts.headers={...opts.headers||{},Authorization:`Basic ${Buffer.from(`${e.username||""}:${e.password||""}`).toString("base64")}`});let t=await request(opts.url,{...opts,method:method.toUpperCase(),dispatcher:(opts.proxy?new ProxyAgent({...agentOpts,uri:opts.proxy}):new EnvHttpProxyAgent(agentOpts)).compose(interceptors.redirect({maxRedirections:3,throwOnMaxRedirects:!0}))});resolve({statusCode:t.statusCode,headers:t.headers,body:opts.encoding===null?await t.body.arrayBuffer():await t.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,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 F3=new Ol("sub-store"),J=F3;function qr(e,t,r="name"){return e.find(n=>n[r]===t)}var pp=0;function Qn(e){return I3(_3(B3(e)))}function _3(e){return P3($3(D3(e),e.length*8))}function I3(e){try{}catch{pp=0}for(var t=pp?"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 B3(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 D3(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 P3(e){for(var t="",r=0;r<e.length*32;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}function $3(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var r=1732584193,n=-271733879,s=-1732584194,a=271733878,i=0;i<e.length;i+=16){var c=r,l=n,h=s,m=a;r=Br(r,n,s,a,e[i+0],7,-680876936),a=Br(a,r,n,s,e[i+1],12,-389564586),s=Br(s,a,r,n,e[i+2],17,606105819),n=Br(n,s,a,r,e[i+3],22,-1044525330),r=Br(r,n,s,a,e[i+4],7,-176418897),a=Br(a,r,n,s,e[i+5],12,1200080426),s=Br(s,a,r,n,e[i+6],17,-1473231341),n=Br(n,s,a,r,e[i+7],22,-45705983),r=Br(r,n,s,a,e[i+8],7,1770035416),a=Br(a,r,n,s,e[i+9],12,-1958414417),s=Br(s,a,r,n,e[i+10],17,-42063),n=Br(n,s,a,r,e[i+11],22,-1990404162),r=Br(r,n,s,a,e[i+12],7,1804603682),a=Br(a,r,n,s,e[i+13],12,-40341101),s=Br(s,a,r,n,e[i+14],17,-1502002290),n=Br(n,s,a,r,e[i+15],22,1236535329),r=Dr(r,n,s,a,e[i+1],5,-165796510),a=Dr(a,r,n,s,e[i+6],9,-1069501632),s=Dr(s,a,r,n,e[i+11],14,643717713),n=Dr(n,s,a,r,e[i+0],20,-373897302),r=Dr(r,n,s,a,e[i+5],5,-701558691),a=Dr(a,r,n,s,e[i+10],9,38016083),s=Dr(s,a,r,n,e[i+15],14,-660478335),n=Dr(n,s,a,r,e[i+4],20,-405537848),r=Dr(r,n,s,a,e[i+9],5,568446438),a=Dr(a,r,n,s,e[i+14],9,-1019803690),s=Dr(s,a,r,n,e[i+3],14,-187363961),n=Dr(n,s,a,r,e[i+8],20,1163531501),r=Dr(r,n,s,a,e[i+13],5,-1444681467),a=Dr(a,r,n,s,e[i+2],9,-51403784),s=Dr(s,a,r,n,e[i+7],14,1735328473),n=Dr(n,s,a,r,e[i+12],20,-1926607734),r=Pr(r,n,s,a,e[i+5],4,-378558),a=Pr(a,r,n,s,e[i+8],11,-2022574463),s=Pr(s,a,r,n,e[i+11],16,1839030562),n=Pr(n,s,a,r,e[i+14],23,-35309556),r=Pr(r,n,s,a,e[i+1],4,-1530992060),a=Pr(a,r,n,s,e[i+4],11,1272893353),s=Pr(s,a,r,n,e[i+7],16,-155497632),n=Pr(n,s,a,r,e[i+10],23,-1094730640),r=Pr(r,n,s,a,e[i+13],4,681279174),a=Pr(a,r,n,s,e[i+0],11,-358537222),s=Pr(s,a,r,n,e[i+3],16,-722521979),n=Pr(n,s,a,r,e[i+6],23,76029189),r=Pr(r,n,s,a,e[i+9],4,-640364487),a=Pr(a,r,n,s,e[i+12],11,-421815835),s=Pr(s,a,r,n,e[i+15],16,530742520),n=Pr(n,s,a,r,e[i+2],23,-995338651),r=$r(r,n,s,a,e[i+0],6,-198630844),a=$r(a,r,n,s,e[i+7],10,1126891415),s=$r(s,a,r,n,e[i+14],15,-1416354905),n=$r(n,s,a,r,e[i+5],21,-57434055),r=$r(r,n,s,a,e[i+12],6,1700485571),a=$r(a,r,n,s,e[i+3],10,-1894986606),s=$r(s,a,r,n,e[i+10],15,-1051523),n=$r(n,s,a,r,e[i+1],21,-2054922799),r=$r(r,n,s,a,e[i+8],6,1873313359),a=$r(a,r,n,s,e[i+15],10,-30611744),s=$r(s,a,r,n,e[i+6],15,-1560198380),n=$r(n,s,a,r,e[i+13],21,1309151649),r=$r(r,n,s,a,e[i+4],6,-145523070),a=$r(a,r,n,s,e[i+11],10,-1120210379),s=$r(s,a,r,n,e[i+2],15,718787259),n=$r(n,s,a,r,e[i+9],21,-343485551),r=Ls(r,c),n=Ls(n,l),s=Ls(s,h),a=Ls(a,m)}return Array(r,n,s,a)}function kl(e,t,r,n,s,a){return Ls(R3(Ls(Ls(t,e),Ls(n,a)),s),r)}function Br(e,t,r,n,s,a,i){return kl(t&r|~t&n,e,t,s,a,i)}function Dr(e,t,r,n,s,a,i){return kl(t&n|r&~n,e,t,s,a,i)}function Pr(e,t,r,n,s,a,i){return kl(t^r^n,e,t,s,a,i)}function $r(e,t,r,n,s,a,i){return kl(r^(t|~n),e,t,s,a,i)}function Ls(e,t){var r=(e&65535)+(t&65535),n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535}function R3(e,t){return e<<t|e>>>32-t}var Vl=jn(gg()),iS=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,sS=/^(([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 er(e){return iS.test(e)}function tr(e){return sS.test(e)}function mg(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 Ei(e){return typeof e=="string"&&e.trim().length>0}function Ft(e,t){return Ei(e)?e:t}function Tu(e){return typeof e<"u"&&e!==null}function xu(e,t){return Tu(e)?e:t}function rs(e){return e?/^.+?\s*?=\s*?.+?\s*?,.+?/.test(e)?{"policy-descriptor":e}:{policy:e}:{}}function aS(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function ic(e){let t=e.split(/,|\//),r=t[Math.floor(Math.random()*t.length)];if(r.includes("-")){let[n,s]=r.split("-").map(Number);return aS(n,s)}else return Number(r)}function vg(e){return Number.isSafeInteger(e)?String(e):BigInt(e).toString()}function Gl(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)}var Fp=class{constructor(t){this.expires=t,J.read(ba)||J.write("{}",ba);try{this.resourceCache=JSON.parse(J.read(ba))}catch(r){J.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${ba} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${r?.message??r}`),this.resourceCache={},J.write("{}",ba)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,s]=r;s.time||(delete this.resourceCache[n],J.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(){J.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}set(t,r){this.resourceCache[t]={time:new Date().getTime(),data:r},this._persist()}},fr=new Fp(36e5);var _p=class{constructor(){this.expires=oS(),J.read(Ca)||J.write("{}",Ca);try{this.resourceCache=JSON.parse(J.read(Ca))}catch(t){J.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${Ca} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},J.write("{}",Ca)}this._cleanup()}_cleanup(){let t=!1;Object.entries(this.resourceCache).forEach(r=>{let[n,s]=r;s.time||(delete this.resourceCache[n],J.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(){J.write(JSON.stringify(this.resourceCache),Ca)}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 oS(){J.read(Tl)||J.write("6e4",Tl);let e=6e4;if(J.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=J.read("#\u54CD\u5E94\u5934\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=J.read(Tl),e}var sc=new _p;function Ou(e){let t=Object.keys(e),r="",n="";for(let s of t){let a=s.toLowerCase();a==="subscription-userinfo"?r=e[s]:a==="profile-web-page-url"&&(n=e[s])}return`${r||""}${n?`; app_url=${encodeURIComponent(n)}`:""}`}async function zl(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}=gi(),insecure=$arguments?.insecure?J.env.isNode?{strictSSL:!1}:{insecure:!0}:void 0,{defaultProxy,defaultFlowUserAgent,defaultTimeout}=J.read(nn),proxy=customProxy||defaultProxy;J.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultFlowUserAgent||"clash",requestTimeout=timeout||defaultTimeout||8e3,id=Qn(userAgent+url),cached=sc.get(id),flowInfo;if(!$arguments?.noCache&&cached)J.info(`\u4F7F\u7528\u7F13\u5B58\u7684\u6D41\u91CF\u4FE1\u606F: ${url}, ${userAgent}`),flowInfo=cached;else{let e=es();if(flowUrl){J.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?rs(proxy):{},...insecure||{}});flowInfo=t}else{try{J.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?rs(proxy):{},...insecure||{}});flowInfo=Ou(t)}catch(t){J.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){J.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?rs(proxy):{},...insecure||{}});flowInfo=Ou(t)}}flowInfo&&(flowInfo=flowInfo.trim()),flowInfo&&sc.set(id,flowInfo)}return flowInfo}function Wl(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]),a=e.match(/total=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),i=Number(a[1]+a[2]),c=e.match(/expire=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/),l=c?Number(c[1]+c[2]):void 0,h=e.match(/reset_day=([0-9]+)/),m=h?Number(h[1]):void 0,A=e.match(/app_url=(.*?)\s*?(;|$)/),p=A?decodeURIComponent(A[1]):void 0,f=e.match(/plan_name=(.*?)\s*?(;|$)/),E=f?decodeURIComponent(f[1]):void 0;return{expires:l,total:i,usage:{upload:r,download:s},remainingDays:m,appUrl:p,planName:E}}function ac(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:e.toFixed(1),unit:t}:ac(e/1024,r[++n])}function Yl(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=ac(Math.abs(n));s.value=n<0?"-"+s.value:s.value;let a=ac(e.total);throw new Error(`\u6D41\u91CF\u5DF2\u7528\u5B8C: ${s.value} ${s.unit} / ${a.value} ${a.unit}`)}}}function wg(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),a=new Date;if(s.setHours(0,0,0,0),a.setHours(0,0,0,0),s.getTime()>a.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<a;)i.setDate(i.getDate()+n);i.setHours(0,0,0,0);let c=i.getTime()-a.getTime();return Math.ceil(c/(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,a=s.getDate(),i=s.getMonth(),c=s.getFullYear(),l;return t>a?l=0:l=new Date(c,i+1,0).getDate(),l-a+t}}catch(t){J.error(`getRmainingDays failed: ${t.message??t}`)}}function Ag(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(),a=r.slice(n+1).trim();if(!t.has(s))try{let i=decodeURIComponent(a);t.set(s,i)}catch{t.set(s,a)}}),Array.from(t.entries()).map(([r,n])=>`${r}=${encodeURIComponent(n)}`).join("; ")}catch(t){return J.error(`normalizeFlowHeader failed: ${t.message??t}`),e}}var dc=jn(fv());function pv(e,t,...r){try{return e(t,...r)}catch{return e(dv(e(t.replace(/!<str>\s*/g,"__SubStoreJSYAMLString__"),...r)).replace(/__SubStoreJSYAMLString__/g,""),...r)}}function pc(e,...t){return pv(dc.default.safeLoad,JSON.parse(JSON.stringify(e)),...t)}function UC(e,...t){return pv(dc.default.load,JSON.parse(JSON.stringify(e)),...t)}function hv(e,...t){return dc.default.safeDump(JSON.parse(JSON.stringify(e)),...t)}function dv(e,...t){return dc.default.dump(JSON.parse(JSON.stringify(e)),...t)}var Oa={safeLoad:pc,load:UC,safeDump:hv,dump:dv,parse:pc,stringify:hv};var Ev="3.7.7",HC=Ev,Ku=typeof Buffer=="function",gv=typeof TextDecoder=="function"?new TextDecoder:void 0,mv=typeof TextEncoder=="function"?new TextEncoder:void 0,jC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",gc=Array.prototype.slice.call(jC),of=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(gc),MC=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,yr=String.fromCharCode.bind(String),vv=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),yv=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),Sv=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),bv=e=>{let t,r,n,s,a="",i=e.length%3;for(let c=0;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(s=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|s,a+=gc[t>>18&63]+gc[t>>12&63]+gc[t>>6&63]+gc[t&63]}return i?a.slice(0,i-3)+"===".substring(i):a},jp=typeof btoa=="function"?e=>btoa(e):Ku?e=>Buffer.from(e,"binary").toString("base64"):bv,Up=Ku?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,s=e.length;n<s;n+=4096)r.push(yr.apply(null,e.subarray(n,n+4096)));return jp(r.join(""))},cf=(e,t=!1)=>t?yv(Up(e)):Up(e),qC=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?yr(192|t>>>6)+yr(128|t&63):yr(224|t>>>12&15)+yr(128|t>>>6&63)+yr(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return yr(240|t>>>18&7)+yr(128|t>>>12&63)+yr(128|t>>>6&63)+yr(128|t&63)}},KC=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Cv=e=>e.replace(KC,qC),wv=Ku?e=>Buffer.from(e,"utf8").toString("base64"):mv?e=>Up(mv.encode(e)):e=>jp(Cv(e)),qu=(e,t=!1)=>t?yv(wv(e)):wv(e),Av=e=>qu(e,!0),VC=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,GC=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 yr((r>>>10)+55296)+yr((r&1023)+56320);case 3:return yr((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return yr((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Fv=e=>e.replace(VC,GC),_v=e=>{if(e=e.replace(/\s+/g,""),!MC.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r="",n,s;for(let a=0;a<e.length;)t=of[e.charAt(a++)]<<18|of[e.charAt(a++)]<<12|(n=of[e.charAt(a++)])<<6|(s=of[e.charAt(a++)]),r+=n===64?yr(t>>16&255):s===64?yr(t>>16&255,t>>8&255):yr(t>>16&255,t>>8&255,t&255);return r},Mp=typeof atob=="function"?e=>atob(Sv(e)):Ku?e=>Buffer.from(e,"base64").toString("binary"):_v,Iv=Ku?e=>vv(Buffer.from(e,"base64")):e=>vv(Mp(e).split("").map(t=>t.charCodeAt(0))),Bv=e=>Iv(Dv(e)),zC=Ku?e=>Buffer.from(e,"base64").toString("utf8"):gv?e=>gv.decode(Iv(e)):e=>Fv(Mp(e)),Dv=e=>Sv(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Hp=e=>zC(Dv(e)),WC=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)},Pv=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),$v=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Pv(r));e("fromBase64",function(){return Hp(this)}),e("toBase64",function(t){return qu(this,t)}),e("toBase64URI",function(){return qu(this,!0)}),e("toBase64URL",function(){return qu(this,!0)}),e("toUint8Array",function(){return Bv(this)})},Rv=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Pv(r));e("toBase64",function(t){return cf(this,t)}),e("toBase64URI",function(){return cf(this,!0)}),e("toBase64URL",function(){return cf(this,!0)})},YC=()=>{$v(),Rv()},ct={version:Ev,VERSION:HC,atob:Mp,atobPolyfill:_v,btoa:jp,btoaPolyfill:bv,fromBase64:Hp,toBase64:qu,encode:qu,encodeURI:Av,encodeURL:Av,utob:Cv,btou:Fv,decode:Hp,isValid:WC,fromUint8Array:cf,toUint8Array:Bv,extendString:$v,extendUint8Array:Rv,extendBuiltins:YC};function XC(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function JC(){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(a=>s.indexOf(a)!==-1)},parse:function(s){let a=ct.decode(s);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(a)?a:(J.error("Base64 Pre-processor error: decoded line does not start with protocol"),s)}}}function ZC(){return{name:"Fallback Base64 Pre-processor",test:function(n){return!0},parse:function(n){let s=ct.decode(n);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(s)?s:(J.error("Fallback Base64 Pre-processor error: decoded line does not start with protocol"),n)}}}function QC(){return{name:"Clash Pre-processor",test:function(n){if(!/proxies/.test(n))return!1;let s=pc(n);return s.proxies&&Array.isArray(s.proxies)},parse:function(n,s){let a=n.replace(/short-id:([ \t]*[^#\n,}]*)/g,(l,h)=>{let m=h.trim();return!m||m===""?'short-id: ""':/^(['"]).*\1$/.test(m)?`short-id: ${m}`:["null"].includes(m)?`short-id: ${m}`:`short-id: "${m}"`}),{proxies:i,"global-client-fingerprint":c}=pc(a);return(s?`proxies:
|
||
`:"")+i.map(l=>(c&&!l["client-fingerprint"]&&(l["client-fingerprint"]=c),`${s?" - ":""}${JSON.stringify(l)}
|
||
`)).join("")}}}function eF(){return{name:"SSD Pre-processor",test:function(n){return n.indexOf("ssd://")===0},parse:function(n){let s=[],a=JSON.parse(ct.decode(n.split("ssd://")[1])),i=a.port,c=a.encryption,l=a.password,h=a.servers;for(let m=0;m<h.length;m++){let A=h[m];c=A.encryption?A.encryption:c,l=A.password?A.password:l;let p=ct.encode(c+":"+l),f=A.server;i=A.port?A.port:i;let E=A.remarks?A.remarks:m,v=A.plugin_options?"/?plugin="+encodeURIComponent(A.plugin+";"+A.plugin_options):"";s[m]="ss://"+p+"@"+f+":"+i+v+"#"+E}return s.join(`
|
||
`)}}}function tF(){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 lf=[XC(),QC(),JC(),eF(),tF(),ZC()];var Tv=lf.find(e=>e.name==="Clash Pre-processor"),qp=new Map;async function Sn(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}=gi(),{defaultProxy,defaultUserAgent,defaultTimeout,cacheThreshold:defaultCacheThreshold}=J.read(nn),cacheThreshold=defaultCacheThreshold||1024,proxy=customProxy||defaultProxy;J.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultUserAgent||"clash.meta",requestTimeout=timeout||defaultTimeout||8e3,id=Qn(userAgent+url);$arguments?.cacheKey===!0&&(J.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=J.read(customCacheKey),t=fr.get(id);if(!noCache&&!$arguments?.noCache&&t)return J.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){J.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
|
||
\u672C\u6B21\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u66F4\u65B0\u7F13\u5B58`);try{await Sn(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess)}catch(r){J.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`),J.info("\u4F7F\u7528\u4E50\u89C2\u7F13\u5B58\u7684\u6570\u636E\u5237\u65B0\u7F13\u5B58, \u9632\u6B62\u540E\u7EED\u8BF7\u6C42"),fr.set(id,e)}}else J.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`),Sn(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess).catch(r=>{J.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"?Rl:Bu,n=qr(J.read(r),t);if(!n)throw new Error(`\u627E\u4E0D\u5230 ${e}: ${t}`);return e==="module"?n.content:await Mn({type:"file",name:t})}catch(t){throw J.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 J.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&&qp.has(id))return qp.get(id);let http=es({headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout}),result,cached=fr.get(id);if(!noCache&&!$arguments?.noCache&&cached)J.info(`\u4F7F\u7528\u7F13\u5B58: ${url}, ${userAgent}`),result=cached,customCacheKey&&(J.info(`URL ${url}
|
||
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),J.write(cached,customCacheKey));else{let e=$arguments?.insecure?isNode?{strictSSL:!1}:{insecure:!0}:void 0;J.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?rs(proxy):{},...e||{}});if(J.info(`statusCode: ${n}`),n<200||n>=400)throw new Error(`statusCode: ${n}`);if(r){let a=Ou(r);a&&sc.set(id,a)}if(t.replace(/\s/g,"").length===0)throw new Error(new Error("\u8FDC\u7A0B\u8D44\u6E90\u5185\u5BB9\u4E3A\u7A7A"));if(preprocess)try{Tv.test(t)&&(t=Tv.parse(t,!0))}catch(a){J.error(`Clash Pre-processor error: ${a}`)}let s=!0;if(cacheThreshold){let a=t.length/1024;a>cacheThreshold&&(J.info(`\u8D44\u6E90\u5927\u5C0F ${a.toFixed(2)} KB \u8D85\u8FC7\u4E86 ${cacheThreshold} KB, \u4E0D\u7F13\u5B58`),s=!1)}s&&(fr.set(id,t),customCacheKey&&(J.info(`URL ${url}
|
||
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),J.write(t,customCacheKey))),result=t}catch(t){if(customCacheKey){let r=J.read(customCacheKey);if(r)return J.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 Yl(Wl(await zl(url,$arguments.flowUserAgent,void 0,proxy,$arguments.flowUrl))),isNode||qp.set(id,result),result}async function xv(url,file){let undici=eval("require('undici')"),fs=eval("require('fs')"),{pipeline}=eval("require('stream/promises')"),{Agent,interceptors,request}=undici;J.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),J.info(`File downloaded from ${url} to ${file}`),file}var Wf=jn(df());var v0=jn(C2());function _I(e){let t=v0.default.pemtohex(e);return v0.default.KJUR.crypto.Util.hashHex(t,"sha256").match(/.{2}/g).join(":").toUpperCase()}var F2={generateFingerprint:_I};var w0=class{constructor(){this.expires=II(),J.read(Fa)||J.write("{}",Fa);try{this.resourceCache=JSON.parse(J.read(Fa))}catch(t){J.error(`\u89E3\u6790\u6301\u4E45\u5316\u7F13\u5B58\u4E2D\u7684 ${Fa} \u5931\u8D25, \u91CD\u7F6E\u4E3A {}, \u9519\u8BEF: ${t?.message??t}`),this.resourceCache={},J.write("{}",Fa)}this._cleanup()}_cleanup(t,r){let n=!1;Object.entries(this.resourceCache).forEach(s=>{let[a,i]=s;i.time||(delete this.resourceCache[a],J.delete(`#${a}`),n=!0),(new Date().getTime()-i.time>(r??this.expires)||t&&a.startsWith(t))&&(delete this.resourceCache[a],n=!0)}),n&&this._persist()}revokeAll(){this.resourceCache={},this._persist()}_persist(){J.write(JSON.stringify(this.resourceCache),Fa)}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 II(){J.read(xl)||J.write("1728e5",xl);let e=1728e5;if(J.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=J.read("#\u8282\u70B9\u7F13\u5B58\u6709\u6548\u671F");return r in t&&(e=t[r],e==="readcachets"&&(e=r)),e}else return e=J.read(xl),e}var A0=new w0;function Bf(e,t){return[...Array(e).keys()].map(()=>t)}var E0={"\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{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{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 ro(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{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{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(a=>RegExp(`${a}`,"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(E0))if(E0[n].some(a=>RegExp(`(^|[^a-zA-Z])${a}([^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 _2(e){return E0[ro(e)]?.[0]}function Sc(e){return e.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]|🏴☠️|🏳️🌈/g,"").trim()}var Df=class{constructor({country,asn}={}){if(J.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 Rf=jn(N2()),L2=jn(df());async function io({url:e,domain:t,type:r="A",timeout:n,edns:s}){let a=Rf.default.encode({type:"query",id:0,flags:Rf.default.RECURSION_DESIRED,questions:[{type:r,name:t}],additionals:[{type:"OPT",name:".",udpPayloadSize:4096,flags:0,options:[{code:"CLIENT_SUBNET",ip:s,sourcePrefixLength:er(s)?24:56,scopePrefixLength:0}]}]}),i=await J.http.get({url:`${e}?dns=${a.toString("base64").toString("utf-8").replace(/=/g,"")}`,headers:{Accept:"application/dns-message"},"binary-mode":!0,encoding:null,timeout:n});return Rf.default.decode(L2.Buffer.from(J.env.isQX?i.bodyBytes:i.body))}var R0=jn(P0());var{isNode:U2,isQX:OI,isLoon:kI,isSurge:NI,isStash:LI,isShadowRocket:UI,isLanceX:HI,isEgern:jI,isGUIforCores:MI}=gi(),Ri="Node";U2&&(Ri="Node");OI&&(Ri="QX");kI&&(Ri="Loon");NI&&(Ri="Surge");LI&&(Ri="Stash");UI&&(Ri="ShadowRocket");jI&&(Ri="Egern");HI&&(Ri="LanceX");MI&&(Ri="GUI.for.Cores");var ja={},qI={};try{if(typeof $environment<"u"&&(ja.env=$environment),typeof $loon<"u"&&(ja.loon=$loon),typeof $script<"u"&&(ja.script=$script),typeof $Plugin<"u"&&(ja.plugin=$Plugin),U2){ja.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)&&(ja.node.env[e]=env[e])}}catch(e){}var Fc={backend:Ri,version:Pl,feature:qI,meta:ja};function KI(e){return e&&typeof e=="object"&&!Array.isArray(e)}function _c(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function j2(e,t){let r=typeof t=="string"?JSON.parse(t):t;for(let n in r)if(KI(r[n]))if(n.endsWith("!")){let s=_c(n.slice(0,-1));e[s]=r[n]}else{let s=_c(n);e[s]||Object.assign(e,{[s]:{}}),j2(e[s],r[s])}else if(Array.isArray(r[n]))if(n.startsWith("+")){let s=_c(n.slice(1));e[s]||Object.assign(e,{[s]:[]}),e[s]=[...r[n],...e[s]]}else if(n.endsWith("+")){let s=_c(n.slice(0,-1));e[s]||Object.assign(e,{[s]:[]}),e[s]=[...e[s],...r[n]]}else{let s=_c(n);Object.assign(e,{[s]:r[n]})}else Object.assign(e,{[n]:r[n]});return e}function VI({rule:e}){return{name:"Conditional Filter",func:t=>t.map(r=>Tf(e,r))}}function Tf(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=>Tf(r,t));case"OR":return e.child.some(r=>Tf(r,t));case"NOT":return!Tf(e.child,t);default:throw new Error(`Unknown operator: ${e.operator}`)}}function GI(e){return{name:"Quick Setting Operator",func:r=>{if(t(e.useless)){let s=V2().func(r);r=r.filter((a,i)=>s[i]&&a.port>0&&a.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 zI({mode:e,tw:t}){return{name:"Flag Operator",func:r=>r.map(n=>{if(e==="remove")n.name=Sc(n.name);else{let s=ro(n.name);n.name=Sc(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 WI(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:a=>{if(t==="delete"){let i={};return a.filter(c=>i[c.name]?!1:(i[c.name]=!0,!0))}else if(t==="rename"){let i=r.split(" "),c={},l=0;a.forEach(m=>{typeof c[m.name]>"u"?c[m.name]=1:c[m.name]++,l=Math.max(c[m.name].toString().length,l)});let h={};return a.map(m=>{if(c[m.name]>1){typeof h[m.name]>"u"&&(h[m.name]=1);let A="",p=h[m.name]++,f=0;for(;p>0;)A=i[p%10]+A,p=parseInt(p/10),f++;for(;f++<l;)A=i[0]+A;s==="front"?m.name=A+n+m.name:s==="back"&&(m.name=m.name+n+A)}return m})}}}}function YI(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 a9(t);default:throw new Error("Unknown sort option: "+e)}}}}function XI(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=>T0(s)),n.sort((s,a)=>{let i=H2(r,s.name),c=H2(r,a.name);return i&&!c?-1:c&&!i?1:i&&c?i<c?-1:1:t==="original"?0:t==="desc"?s.name<a.name?1:-1:s.name<a.name?-1:1}))}}function H2(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 M2(e){return{name:"Regex Rename Operator",func:t=>t.map(r=>{for(let{expr:n,now:s}of e)r.name=r.name.replace(T0(n,"g"),s).trim();return r})}}function JI(e){let t=e.map(r=>({expr:r,now:""}));return{name:"Regex Delete Operator",func:M2(t).func}}function ZI(e,t,r,n,s){return{name:"Script Operator",func:async a=>{let i=a;if(i?.$file?.type==="mihomoProfile")try{let c=Oa.safeLoad(e),l;if(i?.$content)try{l=Oa.safeLoad(i?.$content)}catch(h){J.error(h.message??h)}if(typeof c!="object")throw new Error("patch is not an object");return i.$content=Gt.yaml.safeDump(j2(l||(i?.$file?.sourceType==="none"?{}:{proxies:await Mn({type:i?.$file?.sourceType||"collection",name:i?.$file?.sourceName,platform:"mihomo",produceType:"internal",produceOpts:{"delete-underscore-fields":!0}})}),c)),i}catch{}return await async function(){i=xf("operator",e,r,s)(a,t,{source:n,...Fc})}(),i},nodeFunc:async a=>{let i=a;return await async function(){i=xf("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)(a,t,{source:n,...Fc})}(),i}}}function QI(e){let t,r;try{let n=e.split(":");r=parseInt(n[2],16);let s=parseInt(n[3],16),a=parseInt(n[4],16),i=s>>8,c=s&255,l=a>>8,h=a&255;if(t=`${i}.${c}.${l}.${h}`,r<=0||r>65535)throw new Error(`Invalid port number: ${r}`);if(!er(t))throw new Error(`Invalid IP address: ${t}`)}catch(n){J.error(`IP4P \u89E3\u6790\u5931\u8D25: ${n}`)}return{server:t,port:r}}var q2={Custom:async function(e,t,r,n,s,a){let i=Qn(`CUSTOM:${a}:${e}:${t}`),c=fr.get(i);if(!r&&c)return c;let l=t==="IPv6"?"AAAA":"A",h=await io({url:a,domain:e,type:l,timeout:n,edns:s}),{answers:m}=h;if(!Array.isArray(m)||m.length===0)throw new Error("No answers");let A=m.filter(p=>p?.type===l).map(p=>p?.data).filter(p=>p);if(A.length===0)throw new Error("No answers");return fr.set(i,A),A},Google:async function(e,t,r,n,s){let a=Qn(`GOOGLE:${e}:${t}`),i=fr.get(a);if(!r&&i)return i;let c=t==="IPv6"?"AAAA":"A",l=await io({url:"https://8.8.4.4/dns-query",domain:e,type:c,timeout:n,edns:s}),{answers:h}=l;if(!Array.isArray(h)||h.length===0)throw new Error("No answers");let m=h.filter(A=>A?.type===c).map(A=>A?.data).filter(A=>A);if(m.length===0)throw new Error("No answers");return fr.set(a,m),m},"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=Qn(`IP-API:${e}`),a=fr.get(s);if(!r&&a)return a;let i=await J.http.get({url:`http://ip-api.com/json/${encodeURIComponent(e)}?lang=zh-CN`,timeout:n}),c=JSON.parse(i.body);if(c.status!=="success")throw new Error(`Status is ${c.status}`);if(!c.query||c.query===0)throw new Error("No answers");let l=[c.query];if(l.length===0)throw new Error("No answers");return fr.set(s,l),l},Cloudflare:async function(e,t,r,n,s){let a=Qn(`CLOUDFLARE:${e}:${t}`),i=fr.get(a);if(!r&&i)return i;let c=t==="IPv6"?"AAAA":"A",l=await io({url:"https://1.0.0.1/dns-query",domain:e,type:c,timeout:n,edns:s}),{answers:h}=l;if(!Array.isArray(h)||h.length===0)throw new Error("No answers");let m=h.filter(A=>A?.type===c).map(A=>A?.data).filter(A=>A);if(m.length===0)throw new Error("No answers");return fr.set(a,m),m},Ali:async function(e,t,r,n,s){let a=Qn(`ALI:${e}:${t}`),i=fr.get(a);if(!r&&i)return i;let c=await J.http.get({url:`http://223.6.6.6/resolve?edns_client_subnet=${s}/24&name=${encodeURIComponent(e)}&type=${t==="IPv6"?"AAAA":"A"}&short=1`,headers:{accept:"application/dns-json"},timeout:n}),l=JSON.parse(c.body);if(!Array.isArray(l)||l.length===0)throw new Error("No answers");let h=l;if(h.length===0)throw new Error("No answers");return fr.set(a,h),h},Tencent:async function(e,t,r,n,s){let a=Qn(`TENCENT:${e}:${t}`),i=fr.get(a);if(!r&&i)return i;let l=(await J.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(m=>m.split(",")[0]);if(l.length===0||String(l)==="0")throw new Error("No answers");let h=l;if(h.length===0)throw new Error("No answers");return fr.set(a,h),h}};function K2({provider:e,type:t,filter:r,cache:n,url:s,timeout:a,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:c}=J.read(nn),l=a||c||8e3,h=["IPv6","IP4P"].includes(t)?"IPv6":"IPv4",m=q2[e];if(!m)throw new Error(`\u627E\u4E0D\u5230\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9: ${e}`);let A=i||"223.6.6.6";if(!Ma(A))throw new Error("\u57DF\u540D\u89E3\u6790 EDNS \u5E94\u4E3A IP");return J.info(`Domain Resolver: [${t}] ${e} ${A||""} ${s||""}`),{name:"Resolve Domain Operator",func:async p=>{p.forEach((w,S)=>{!w["_no-resolve"]&&w["no-resolve"]&&(p[S]["_no-resolve"]=w["no-resolve"])});let f={},E=15,v=[...new Set(p.filter(w=>!Ma(w.server)&&!w["_no-resolve"]).map(w=>w.server))],b=Math.ceil(v.length/E);for(let w=0;w<b;w++){let S=[];for(let F of v.splice(0,E))S.push(m(F,h,n==="disabled",l,A,s).then(D=>{f[F]=D,J.info(`Successfully resolved domain: ${F} \u279F ${D}`)}).catch(D=>{J.error(`Failed to resolve domain: ${F} with resolver [${e}]: ${D}`)}));await Promise.all(S)}return p.forEach(w=>{if(!w["_no-resolve"])if(f[w.server]){w._resolved_ips=f[w.server];let S=Array.isArray(f[w.server])?f[w.server][Math.floor(Math.random()*f[w.server].length)]:f[w.server];if(h==="IPv6"&&tr(S)){try{S=new Vl.Address6(S).correctForm()}catch(F){J.error(`Failed to parse IPv6 address: ${S}: ${F}`)}if(/^2001::[^:]+:[^:]+:[^:]+$/.test(S)){w._IP4P=S;let{server:F,port:D}=QI(S);F&&D?(w._domain=w.server,w.server=F,w.port=D,w.resolved=!0,w._IPv4=w.server,Ma(w._IP)||(w._IP=w.server)):w.resolved||(w.resolved=!1)}else w._domain=w.server,w.server=S,w.resolved=!0,w[`_${h}`]=w.server,Ma(w._IP)||(w._IP=w.server)}else w._domain=w.server,w.server=S,w.resolved=!0,w[`_${h}`]=w.server,Ma(w._IP)||(w._IP=w.server)}else w.resolved||(w.resolved=!1)}),p.filter(w=>r==="removeFailed"?Ma(w.server)||w["_no-resolve"]||w.resolved:r==="IPOnly"?Ma(w.server):r==="IPv4Only"?er(w.server):r==="IPv6Only"?tr(w.server):!0)}}}function Ma(e){return er(e)||tr(e)}K2.resolver=q2;function $0(e){var t=/^[\x00-\x7F]+$/;return t.test(e)}function V2(){return{name:"Useless Filter",func:e=>e.map(t=>{if(t.cipher&&!$0(t.cipher))return!1;if(t.password&&!$0(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&&!$0(n)))return!1}return!/网址|流量|时间|应急|过期|Bandwidth|expire/.test(t.name)})}}function e9(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(a=>{let i=ro(a.name),c=t.some(l=>n[l]===i);return r?c:!c})}}function t9({regex:e=[],keep:t=!0}){return{name:"Regex Filter",func:r=>r.map(n=>{let s=e.some(a=>T0(a).test(n.name));return t?s:!s})}}function T0(e,...t){return t=t.join(""),e.startsWith("(?i)")?(e=e.substring(4),new RegExp(e,"i"+t)):new RegExp(e,t)}function r9(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 a=t.some(i=>s.type===i);return r?a:!a})}}function n9(e,t,r,n,s){return{name:"Script Filter",func:async a=>{let i=Bf(a.length,!0);return await async function(){i=xf("filter",e,r,s)(a,t,{source:n,...Fc})}(),i},nodeFunc:async a=>{let i=Bf(a.length,!0);return await async function(){i=xf("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)(a,t,{source:n,...Fc})}(),i}}}var Of={"Useless Filter":V2,"Region Filter":e9,"Regex Filter":t9,"Type Filter":r9,"Script Filter":n9,"Conditional Filter":VI,"Quick Setting Operator":GI,"Flag Operator":zI,"Sort Operator":YI,"Regex Sort Operator":XI,"Regex Rename Operator":M2,"Regex Delete Operator":JI,"Script Operator":ZI,"Handle Duplicate Operator":WI,"Resolve Domain Operator":K2};async function i9(e,t){let r=Bf(t.length,!0);try{r=await e.func(t)}catch(n){let s="",a=`${n.message??n}`;a.includes("$server is not defined")?s="":(J.error(`Cannot apply filter ${e.name}(function filter)! Reason: ${n}`),s=`\u6267\u884C function filter \u5931\u8D25 ${a}; `);try{r=await e.nodeFunc(t)}catch(i){J.error(`Cannot apply filter ${e.name}(shortcut script)! Reason: ${i}`);let c="",l=`${i.message??i}`;throw s&&l===a?(c="",s=`\u6267\u884C\u5931\u8D25 ${a}`):c=`\u6267\u884C\u5FEB\u6377\u8FC7\u6EE4\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u8FC7\u6EE4 ${s}${c}`)}}return t.filter((n,s)=>r[s])}async function s9(e,t){let r=u9(t);try{let n=await e.func(r);n&&(r=n)}catch(n){let s="",a=`${n.message??n}`;a.includes("$server is not defined")||a.includes("$content is not defined")||a.includes("$files is not defined")||r?.$files||r?.$content?s="":(J.error(`Cannot apply operator ${e.name}(function operator)! Reason: ${n}`),s=`\u6267\u884C function operator \u5931\u8D25 ${a}; `);try{let i=await e.nodeFunc(r);i&&(r=i)}catch(i){J.error(`Cannot apply operator ${e.name}(shortcut script)! Reason: ${i}`);let c="",l=`${i.message??i}`;throw s&&l===a?(c="",s=`\u6267\u884C\u5931\u8D25 ${a}`):c=`\u6267\u884C\u5FEB\u6377\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u64CD\u4F5C ${s}${c}`)}}return r}async function G2(e,t){if(e.name.indexOf("Filter")!==-1)return i9(e,t);if(e.name.indexOf("Operator")!==-1)return s9(e,t)}function a9(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 u9(e){return JSON.parse(JSON.stringify(e))}function xf(name,script,$arguments,$options){let flowUtils={getFlowField:Ou,getFlowHeaders:zl,parseFlowHeaders:Wl,flowTransfer:ac,validCheck:Yl,getRmainingDays:wg,normalizeFlowHeader:Ag};return J.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,J,R0.default,$persistentStore,$httpClient,$notification,Gt,Gt.yaml,Gt.Buffer,Gt.Base64.decode,Gt.Base64.encode,A0,flowUtils,Mn,eval('typeof require !== "undefined"')?Sa:void 0):new Function("$arguments","$options","$substore","lodash","ProxyUtils","yaml","Buffer","b64d","b64e","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
|
||
return ${name}`)($arguments,$options,J,R0.default,Gt,Gt.yaml,Gt.Buffer,Gt.Base64.decode,Gt.Base64.encode,A0,flowUtils,Mn,eval('typeof require !== "undefined"')?Sa:void 0)}var z2=jn(P0()),Ye=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){se(this.proxy,r)&&this.append(t)}toString(){return this.output.join("")}};function se(e,t){let r=z2.default.get(e,t);return typeof r<"u"&&r!==null}var o9="Surge",Gn={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function ao(){return{produce:(t,r,n={})=>{switch(t.name=t.name.replace(/=|,/g,""),t.ports&&(t.ports=String(t.ports)),t.type){case"ss":return c9(t,n["include-unsupported-proxy"]);case"trojan":return l9(t);case"vmess":return f9(t,n["include-unsupported-proxy"]);case"http":return p9(t);case"direct":return d9(t);case"socks5":return g9(t);case"snell":return m9(t);case"tuic":return v9(t);case"wireguard-surge":return A9(t);case"hysteria2":return E9(t);case"ssh":return h9(t)}if(n["include-unsupported-proxy"]&&t.type==="wireguard")return w9(t);throw new Error(`Platform ${o9} does not support proxy type: ${t.type}`)}}}function c9(e){let t=new Ye(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=Gn[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"),se(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"),se(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,a=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),a){if(a<2)throw new Error(`shadow-tls version ${a} is not supported`);t.append(`,shadow-tls-version=${a}`)}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 l9(e){let t=new Ye(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=Gn[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"),W2(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"),se(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 f9(e,t){let r=new Ye(e);r.append(`${e.name}=${e.type},${e.server},${e.port}`),r.appendIfPresent(`,username=${e.uuid}`,"uuid");let n=Gn[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"),W2(r,e,t),se(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"),se(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 h9(e){let t=new Ye(e);t.append(`${e.name}=ssh,${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${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=Gn[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 p9(e){if(e.headers&&Object.keys(e.headers).length>0)throw new Error("headers is unsupported");let t=new Ye(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");let n=Gn[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"),se(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 d9(e){let t=new Ye(e);t.append(`${e.name}=direct`);let n=Gn[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 g9(e){let t=new Ye(e),r=e.tls?"socks5-tls":"socks5";t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,"${e.password}"`,"password");let n=Gn[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&&J.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"),se(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 m9(e){let t=new Ye(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=Gn[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"),se(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 v9(e){let t=new Ye(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"),se(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let n=Gn[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"),se(e,"tfo")?t.append(`,tfo=${e.tfo}`):se(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"),se(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 w9(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 Ye(e);t.append(`# > WireGuard Proxy ${e.name}
|
||
# ${e.name}=wireguard`),e["section-name"]=Ft(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=Gn[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"),se(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,a=e["preshared-key"]??e["pre-shared-key"];a&&(a=`,preshared-key="${a}"`);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":a};return t.append(`
|
||
peer = (${Object.keys(i).filter(c=>i[c]!=null).map(c=>`${c} = ${i[c]}`).join(", ")})`),t.toString()}function A9(e){let t=new Ye(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=Gn[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"),se(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 E9(e){if(e.obfs||e["obfs-password"])throw new Error("obfs is unsupported");let t=new Ye(e);t.append(`${e.name}=hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password"),se(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let r=Gn[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"),se(e,"tfo")?t.append(`,tfo=${e.tfo}`):se(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"),se(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 W2(e,t,r){if(se(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),se(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),se(t,"ws-opts.headers"))){let n=t["ws-opts"].headers,s=Object.keys(n).map(a=>{let i=n[a];return["Host"].includes(a)&&(i=`"${i}"`),`${a}:${i}`}).join("|");Ei(s)&&e.append(`,ws-headers=${s}`)}}else if(r&&["http"].includes(t.network))J.info(`Include Unsupported Proxy: nework ${t.network} -> tcp`);else throw new Error(`network ${t.network} is unsupported`)}function In(){return{type:"ALL",produce:(r,n,s={})=>{let a=r.filter(i=>s["include-unsupported-proxy"]?!0:i.type==="snell"&&String(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"?(se(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),se(i,"sni")&&(i.servername=i.sni,delete i.sni),se(i,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(se(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],se(i,"tfo")&&!se(i,"fast-open")&&(i["fast-open"]=i.tfo),(!i.token||i.token.length===0)&&!se(i,"version")&&(i.version=5)):i.type==="hysteria"?(se(i,"auth_str")&&!se(i,"auth-str")&&(i["auth-str"]=i.auth_str),se(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),se(i,"tfo")&&!se(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"?se(i,"sni")&&(i.servername=i.sni,delete i.sni):i.type==="ss"&&se(i,"shadow-tls-password")&&!se(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 c=i["http-opts"]?.path;se(i,"http-opts.path")&&!Array.isArray(c)&&(i["http-opts"].path=[c]);let l=i["http-opts"]?.headers?.Host;se(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let c=i["h2-opts"]?.path;se(i,"h2-opts.path")&&Array.isArray(c)&&(i["h2-opts"].path=c[0]);let l=i["h2-opts"]?.headers?.host;se(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i["plugin-opts"]?.tls&&se(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"],se(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 c in i)(i[c]==null||/^_/i.test(c))&&delete i[c];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"?a:`proxies:
|
||
`+a.map(i=>" - "+JSON.stringify(i)+`
|
||
`).join("")}}}var Y2="SurgeMac",y9=ao();function x0(){return{produce:(t,r,n={})=>{switch(t.type){case"external":return X2(t);default:try{return y9.produce(t,r,n)}catch{if(n.useMihomoExternal)return J.log(`${t.name} is not supported on ${Y2}, try to use Mihomo(SurgeMac - External Proxy Program) instead`),S9(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 X2(e){let t=new Ye(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"),se(e,"tfo")?t.append(`,tfo=${e.tfo}`):se(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 S9(e,t,r){let n=In().produce([e],"internal")?.[0];if(n){let s=r?.localPort||e._localPort||65535,a=!["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",ct.encode(JSON.stringify({"mixed-port":s,ipv6:a,mode:"global",dns:{enable:!0,ipv6:a,"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 b9(e.server)?i.addresses.push(e.server):J.log(`Platform ${Y2}, proxy type ${e.type}: addresses should be an IP address, but got ${e.server}`),r.localPort=s-1,X2(i)}}function b9(e){return er(e)||tr(e)}function O0(){return{type:"ALL",produce:(r,n,s={})=>{let a=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"&&String(i.version)==="4"||i.type==="vless"&&(typeof i.flow<"u"||i["reality-opts"])?!1:i["underlying-proxy"]||i["dialer-proxy"]?(J.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"?(se(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),se(i,"sni")&&(i.servername=i.sni,delete i.sni),se(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"&&se(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let c=i["http-opts"]?.path;se(i,"http-opts.path")&&!Array.isArray(c)&&(i["http-opts"].path=[c]);let l=i["http-opts"]?.headers?.Host;se(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let c=i["h2-opts"]?.path;se(i,"h2-opts.path")&&Array.isArray(c)&&(i["h2-opts"].path=c[0]);let l=i["h2-opts"]?.headers?.host;se(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i["plugin-opts"]?.tls&&se(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"],se(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 c in i)(i[c]==null||/^_/i.test(c))&&delete i[c];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"?a:`proxies:
|
||
`+a.map(i=>" - "+JSON.stringify(i)+`
|
||
`).join("")}}}function kf(){return{type:"ALL",produce:(r,n,s={})=>{let a=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"&&String(i.version)==="4"||i.type==="vless"&&i["reality-opts"]&&!["xtls-rprx-vision"].includes(i.flow)?!1:i["underlying-proxy"]||i["dialer-proxy"]?(J.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"?(se(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),se(i,"sni")&&(i.servername=i.sni,delete i.sni),se(i,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(se(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],se(i,"tfo")&&!se(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),(!i.token||i.token.length===0)&&!se(i,"version")&&(i.version=5)):i.type==="hysteria"?(se(i,"auth_str")&&!se(i,"auth-str")&&(i["auth-str"]=i.auth_str),se(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),se(i,"tfo")&&!se(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),se(i,"down")&&!se(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),se(i,"up")&&!se(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),se(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),se(i,"up-speed")&&(i["up-speed"]=`${i["up-speed"]}`.match(/\d+/)?.[0]||0)):i.type==="hysteria2"?(se(i,"password")&&!se(i,"auth")&&(i.auth=i.password,delete i.password),se(i,"tfo")&&!se(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),se(i,"down")&&!se(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),se(i,"up")&&!se(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),se(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),se(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"&&se(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let c=i["http-opts"]?.path;se(i,"http-opts.path")&&!Array.isArray(c)&&(i["http-opts"].path=[c]);let l=i["http-opts"]?.headers?.Host;se(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let c=i["h2-opts"]?.path;se(i,"h2-opts.path")&&Array.isArray(c)&&(i["h2-opts"].path=c[0]);let l=i["h2-opts"]?.headers?.host;se(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i["plugin-opts"]?.tls&&se(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"],se(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 c in i)(i[c]==null||/^_/i.test(c))&&delete i[c];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"?a:`proxies:
|
||
`+a.map(i=>" - "+JSON.stringify(i)+`
|
||
`).join("")}}}var C9="Loon",As={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function k0(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return F9(t);case"ssr":return _9(t);case"trojan":return I9(t);case"vmess":return B9(t,n["include-unsupported-proxy"]);case"vless":return D9(t,n["include-unsupported-proxy"]);case"http":return P9(t);case"socks5":return $9(t);case"wireguard":return R9(t);case"hysteria2":return T9(t)}throw new Error(`Platform ${C9} does not support proxy type: ${t.type}`)}}}function F9(e){let t=new Ye(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}"`),se(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(se(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,a=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),a){if(a<2)throw new Error(`shadow-tls version ${a} is not supported`);t.append(`,shadow-tls-version=${a}`)}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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function _9(e){let t=new Ye(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"),se(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,a=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),s&&t.append(`,shadow-tls-sni=${s}`),a){if(a<2)throw new Error(`shadow-tls version ${a} is not supported`);t.append(`,shadow-tls-version=${a}`)}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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function I9(e){let t=new Ye(e);if(t.append(`${e.name}=trojan,${e.server},${e.port},"${e.password}"`),e.network==="tcp"&&delete e.network,se(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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function B9(e){let t=!!e["reality-opts"],r=new Ye(e);if(r.append(`${e.name}=vmess,${e.server},${e.port},${e.cipher},"${e.uuid}"`),e.network==="tcp"&&delete e.network,se(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,a=e["http-opts"]?.headers?.Host;r.appendIfPresent(`,path=${Array.isArray(s)?s[0]:s}`,"http-opts.path"),r.appendIfPresent(`,host=${Array.isArray(a)?a[0]:a}`,"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")),se(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=As[e["ip-version"]]||e["ip-version"];return r.appendIfPresent(`,ip-mode=${n}`,"ip-version"),r.toString()}function D9(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 Ye(e);if(n.append(`${e.name}=vless,${e.server},${e.port},"${e.uuid}"`),e.network==="tcp"&&delete e.network,se(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 a=e["http-opts"]?.path,i=e["http-opts"]?.headers?.Host;n.appendIfPresent(`,path=${Array.isArray(a)?a[0]:a}`,"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=As[e["ip-version"]]||e["ip-version"];return n.appendIfPresent(`,ip-mode=${s}`,"ip-version"),n.toString()}function P9(e){let t=new Ye(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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${n}`,"ip-version"),t.toString()}function $9(e){let t=new Ye(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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function R9(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 Ye(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(c=>tr(c));let i=e.dns.find(c=>er(c));i||(i=e.dns.find(c=>!er(c)&&!tr(c))),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 a=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${a}`,"ip-version"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),t.toString()}function T9(e){if(e["obfs-password"]&&e.obfs!="salamander")throw new Error("only salamander obfs is supported");let t=new Ye(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=As[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function uo(){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&&tr(r.server)&&(r.server=`[${r.server}]`),r.type){case"socks5":n=`socks://${encodeURIComponent(ct.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)}`:ct.encode(s)}@${r.server}:${r.port}${r.plugin?"/":""}`,r.plugin){n+="?plugin=";let ue=r["plugin-opts"];switch(r.plugin){case"obfs":n+=encodeURIComponent(`simple-obfs;obfs=${ue.mode}${ue.host?";obfs-host="+ue.host:""}`);break;case"v2ray-plugin":n+=encodeURIComponent(`v2ray-plugin;obfs=${ue.mode}${ue.host?";obfs-host"+ue.host:""}${ue.tls?";tls":""}`);break;case"shadow-tls":n+=encodeURIComponent(`shadow-tls;host=${ue.host};password=${ue.password};version=${ue.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}:${ct.encode(r.password)}/`,n+=`?remarks=${ct.encode(r.name)}${r["obfs-param"]?"&obfsparam="+ct.encode(r["obfs-param"]):""}${r["protocol-param"]?"&protocolparam="+ct.encode(r["protocol-param"]):""}`,n="ssr://"+ct.encode(n);break;case"vmess":let a="",i=r.network||"tcp";if(r.network==="http"?(i="tcp",a="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:a,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 ue=r[`${r.network}-opts`]?.path,Ce=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`]):(ue&&(n.path=Array.isArray(ue)?ue[0]:ue),Ce&&(n.host=Array.isArray(Ce)?Ce[0]:Ce))}n="vmess://"+ct.encode(JSON.stringify(n));break;case"vless":let c="none",l=r["reality-opts"],h="",m="",A="";if(l){c="reality";let ue=r["reality-opts"]?.["public-key"];ue&&(m=`&pbk=${encodeURIComponent(ue)}`);let Ce=r["reality-opts"]?.["short-id"];Ce&&(h=`&sid=${encodeURIComponent(Ce)}`);let Oe=r["reality-opts"]?.["_spider-x"];Oe&&(A=`&spx=${encodeURIComponent(Oe)}`)}else r.tls&&(c="tls");let p="";r.alpn&&(p=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let f="";r["skip-cert-verify"]&&(f="&allowInsecure=1");let E="";r.sni&&(E=`&sni=${encodeURIComponent(r.sni)}`);let v="";r["client-fingerprint"]&&(v=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let b="";r.flow&&(b=`&flow=${encodeURIComponent(r.flow)}`);let w="";r._extra&&(w=`&extra=${encodeURIComponent(r._extra)}`);let S="";r._mode&&(S=`&mode=${encodeURIComponent(r._mode)}`);let F=r.network;r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(F="httpupgrade");let D=`&type=${encodeURIComponent(F)}`;if(["grpc"].includes(r.network)){D+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`;let ue=r[`${r.network}-opts`]?.["_grpc-authority"];ue&&(D+=`&authority=${encodeURIComponent(ue)}`)}let I=r[`${r.network}-opts`]?.[`${r.network}-service-name`],j=r[`${r.network}-opts`]?.path,q=r[`${r.network}-opts`]?.headers?.Host;j&&(D+=`&path=${encodeURIComponent(Array.isArray(j)?j[0]:j)}`),q&&(D+=`&host=${encodeURIComponent(Array.isArray(q)?q[0]:q)}`),I&&(D+=`&serviceName=${encodeURIComponent(I)}`),r.network==="kcp"&&(r.seed&&(D+=`&seed=${encodeURIComponent(r.seed)}`),r.headerType&&(D+=`&headerType=${encodeURIComponent(r.headerType)}`)),n=`vless://${r.uuid}@${r.server}:${r.port}?security=${encodeURIComponent(c)}${D}${p}${f}${E}${v}${b}${h}${A}${m}${S}${w}#${encodeURIComponent(r.name)}`;break;case"trojan":let _="";if(r.network){let ue=r.network;if(r.network==="ws"&&r["ws-opts"]?.["v2ray-http-upgrade"]&&(ue="httpupgrade"),_=`&type=${encodeURIComponent(ue)}`,["grpc"].includes(r.network)){let sr=r[`${r.network}-opts`]?.[`${r.network}-service-name`],_t=r[`${r.network}-opts`]?.["_grpc-authority"];sr&&(_+=`&serviceName=${encodeURIComponent(sr)}`),_t&&(_+=`&authority=${encodeURIComponent(_t)}`),_+=`&mode=${encodeURIComponent(r[`${r.network}-opts`]?.["_grpc-type"]||"gun")}`}let Ce=r[`${r.network}-opts`]?.path,Oe=r[`${r.network}-opts`]?.headers?.Host;Ce&&(_+=`&path=${encodeURIComponent(Array.isArray(Ce)?Ce[0]:Ce)}`),Oe&&(_+=`&host=${encodeURIComponent(Array.isArray(Oe)?Oe[0]:Oe)}`)}let P="";r["client-fingerprint"]&&(P=`&fp=${encodeURIComponent(r["client-fingerprint"])}`);let k="";r.alpn&&(k=`&alpn=${encodeURIComponent(Array.isArray(r.alpn)?r.alpn:r.alpn.join(","))}`);let U=r["reality-opts"],M="",W="",K="",V="",z="",ne="";if(U){V="&security=reality";let ue=r["reality-opts"]?.["public-key"];ue&&(W=`&pbk=${encodeURIComponent(ue)}`);let Ce=r["reality-opts"]?.["short-id"];Ce&&(M=`&sid=${encodeURIComponent(Ce)}`);let Oe=r["reality-opts"]?.["_spider-x"];Oe&&(K=`&spx=${encodeURIComponent(Oe)}`),r._extra&&(ne=`&extra=${encodeURIComponent(r._extra)}`),r._mode&&(z=`&mode=${encodeURIComponent(r._mode)}`)}n=`trojan://${r.password}@${r.server}:${r.port}?sni=${encodeURIComponent(r.sni||r.server)}${r["skip-cert-verify"]?"&allowInsecure=1":""}${_}${k}${P}${V}${M}${W}${K}${z}${ne}#${encodeURIComponent(r.name)}`;break;case"hysteria2":let Ee=[];r["hop-interval"]&&Ee.push(`hop-interval=${r["hop-interval"]}`),r.keepalive&&Ee.push(`keepalive=${r.keepalive}`),r["skip-cert-verify"]&&Ee.push("insecure=1"),r.obfs&&(Ee.push(`obfs=${encodeURIComponent(r.obfs)}`),r["obfs-password"]&&Ee.push(`obfs-password=${encodeURIComponent(r["obfs-password"])}`)),r.sni&&Ee.push(`sni=${encodeURIComponent(r.sni)}`),r.ports&&Ee.push(`mport=${r.ports}`),r["tls-fingerprint"]&&Ee.push(`pinSHA256=${encodeURIComponent(r["tls-fingerprint"])}`),r.tfo&&Ee.push("fastopen=1"),n=`hysteria2://${encodeURIComponent(r.password)}@${r.server}:${r.port}?${Ee.join("&")}#${encodeURIComponent(r.name)}`;break;case"hysteria":let we=[];Object.keys(r).forEach(ue=>{if(!["name","type","server","port"].includes(ue)){let Ce=ue.replace(/-/,"_");["alpn"].includes(ue)?r[ue]&&we.push(`${Ce}=${encodeURIComponent(Array.isArray(r[ue])?r[ue][0]:r[ue])}`):["skip-cert-verify"].includes(ue)?r[ue]&&we.push("insecure=1"):["tfo","fast-open"].includes(ue)?r[ue]&&!we.includes("fastopen=1")&&we.push("fastopen=1"):["ports"].includes(ue)?we.push(`mport=${r[ue]}`):["auth-str"].includes(ue)?we.push(`auth=${r[ue]}`):["up"].includes(ue)?we.push(`upmbps=${r[ue]}`):["down"].includes(ue)?we.push(`downmbps=${r[ue]}`):["_obfs"].includes(ue)?we.push(`obfs=${r[ue]}`):["obfs"].includes(ue)?we.push(`obfsParam=${r[ue]}`):["sni"].includes(ue)?we.push(`peer=${r[ue]}`):r[ue]&&!/^_/i.test(ue)&&we.push(`${Ce}=${encodeURIComponent(r[ue])}`)}}),n=`hysteria://${r.server}:${r.port}?${we.join("&")}#${encodeURIComponent(r.name)}`;break;case"tuic":if(!r.token||r.token.length===0){let ue=[];Object.keys(r).forEach(Ce=>{if(!["name","type","uuid","password","server","port","tls"].includes(Ce)){let Oe=Ce.replace(/-/,"_");["alpn"].includes(Ce)?r[Ce]&&ue.push(`${Oe}=${encodeURIComponent(Array.isArray(r[Ce])?r[Ce][0]:r[Ce])}`):["skip-cert-verify"].includes(Ce)?r[Ce]&&ue.push("allow_insecure=1"):["tfo","fast-open"].includes(Ce)?r[Ce]&&!ue.includes("fast_open=1")&&ue.push("fast_open=1"):["disable-sni","reduce-rtt"].includes(Ce)&&r[Ce]?ue.push(`${Oe.replace(/-/g,"_")}=1`):["congestion-controller"].includes(Ce)?ue.push(`congestion_control=${r[Ce]}`):r[Ce]&&!/^_/i.test(Ce)&&ue.push(`${Oe.replace(/-/g,"_")}=${encodeURIComponent(r[Ce])}`)}}),n=`tuic://${encodeURIComponent(r.uuid)}:${encodeURIComponent(r.password)}@${r.server}:${r.port}?${ue.join("&")}#${encodeURIComponent(r.name)}`}break;case"anytls":let _e=[];Object.keys(r).forEach(ue=>{if(!["name","type","password","server","port","tls"].includes(ue)){let Ce=ue.replace(/-/,"_");["alpn"].includes(ue)?r[ue]&&_e.push(`${Ce}=${encodeURIComponent(Array.isArray(r[ue])?r[ue][0]:r[ue])}`):["skip-cert-verify"].includes(ue)?r[ue]&&_e.push("insecure=1"):["udp"].includes(ue)?r[ue]&&_e.push("udp=1"):r[ue]&&!/^_/i.test(ue)&&_e.push(`${Ce.replace(/-/g,"_")}=${encodeURIComponent(r[ue])}`)}}),n=`anytls://${encodeURIComponent(r.password)}@${r.server}:${r.port}/?${_e.join("&")}#${encodeURIComponent(r.name)}`;break;case"wireguard":let He=[];Object.keys(r).forEach(ue=>{["name","type","server","port","ip","ipv6","private-key"].includes(ue)||(["public-key"].includes(ue)?He.push(`publickey=${r[ue]}`):["udp"].includes(ue)?r[ue]&&He.push(`${ue}=1`):r[ue]&&!/^_/i.test(ue)&&He.push(`${ue}=${encodeURIComponent(r[ue])}`))}),r.ip&&r.ipv6?He.push(`address=${r.ip}/32,${r.ipv6}/128`):r.ip?He.push(`address=${r.ip}/32`):r.ipv6&&He.push(`address=${r.ipv6}/128`),n=`wireguard://${encodeURIComponent(r["private-key"])}@${r.server}:${r.port}/?${He.join("&")}#${encodeURIComponent(r.name)}`;break}return n}}}var x9=uo();function Ic(){return{type:"ALL",produce:r=>{let n=[];return r.map(s=>{try{n.push(x9.produce(s))}catch(a){J.error(`Cannot produce proxy: ${JSON.stringify(s,null,2)}
|
||
Reason: ${a}`)}}),ct.encode(n.join(`
|
||
`))}}}var O9="QX";function Bc(){return{produce:(t,r,n={})=>{switch(t.type){case"ss":return k9(t);case"ssr":return N9(t);case"trojan":return L9(t);case"vmess":return U9(t);case"http":return j9(t);case"socks5":return M9(t);case"vless":return H9(t)}throw new Error(`Platform ${O9} does not support proxy type: ${t.type}`)}}}function k9(e){let t=new Ye(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}`),Bn(e)&&(e.tls=!0),se(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 Bn(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 N9(e){let t=new Ye(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 L9(e){let t=new Ye(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`trojan=${e.server}:${e.port}`),r(`,password=${e.password}`),se(e,"network"))if(e.network==="ws")Bn(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"&&Bn(e)&&r(",over-tls=true"),Bn(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 U9(e){let t=new Ye(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}`),Bn(e)&&(e.tls=!0),se(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 a=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(a)?a[0]:a}`,`${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 Bn(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")),se(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 H9(e){if(typeof e.flow<"u"||e["reality-opts"])throw new Error("VLESS XTLS/REALITY is not supported");let t=new Ye(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}`),Bn(e)&&(e.tls=!0),se(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 a=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;n(`,obfs-uri=${Array.isArray(a)?a[0]:a}`,`${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 Bn(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 j9(e){let t=new Ye(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"),Bn(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),Bn(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 M9(e){let t=new Ye(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"),Bn(e)&&(e.tls=!0),n(`,over-tls=${e.tls}`,"tls"),Bn(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 Bn(e){return e.tls}function Dc(){return{type:"ALL",produce:(r,n,s={})=>{let a=r.filter(i=>s["include-unsupported-proxy"]?!0:i.type==="snell"&&String(i.version)==="4"?!1:!["mieru"].includes(i.type)).map(i=>{if(i.type==="vmess"?(se(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),se(i,"sni")&&(i.servername=i.sni,delete i.sni),se(i,"cipher")&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(se(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],se(i,"tfo")&&!se(i,"fast-open")&&(i["fast-open"]=i.tfo),(!i.token||i.token.length===0)&&!se(i,"version")&&(i.version=5)):i.type==="hysteria"?(se(i,"auth_str")&&!se(i,"auth-str")&&(i["auth-str"]=i.auth_str),se(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),se(i,"tfo")&&!se(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"]),se(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),se(i,"tfo")&&!se(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"?se(i,"sni")&&(i.servername=i.sni,delete i.sni):i.type==="ss"&&se(i,"shadow-tls-password")&&!se(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 c=i["http-opts"]?.path;se(i,"http-opts.path")&&!Array.isArray(c)&&(i["http-opts"].path=[c]);let l=i["http-opts"]?.headers?.Host;se(i,"http-opts.headers.Host")&&!Array.isArray(l)&&(i["http-opts"].headers.Host=[l])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let c=i["h2-opts"]?.path;se(i,"h2-opts.path")&&Array.isArray(c)&&(i["h2-opts"].path=c[0]);let l=i["h2-opts"]?.headers?.host;se(i,"h2-opts.headers.Host")&&!Array.isArray(l)&&(i["h2-opts"].headers.host=[l])}if(i["plugin-opts"]?.tls&&se(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"],se(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 c in i)(i[c]==null||/^_/i.test(c))&&delete i[c];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"?a:`proxies:
|
||
`+a.map(i=>" - "+JSON.stringify(i)+`
|
||
`).join("")}}}var q9="Surfboard";function Nf(){return{produce:t=>{switch(t.name=t.name.replace(/=|,/g,""),t.type){case"ss":return K9(t);case"trojan":return V9(t);case"vmess":return G9(t);case"http":return z9(t);case"socks5":return W9(t);case"wireguard-surge":return Y9(t)}throw new Error(`Platform ${q9} does not support proxy type: ${t.type}`)}}}function K9(e){let t=new Ye(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"),se(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 V9(e){let t=new Ye(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password=${e.password}`,"password"),J2(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 G9(e){let t=new Ye(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,username=${e.uuid}`,"uuid"),J2(t,e),se(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 z9(e){let t=new Ye(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 W9(e){let t=new Ye(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 Y9(e){let t=new Ye(e);return t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.toString()}function J2(e,t){if(se(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),se(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),se(t,"ws-opts.headers"))){let r=t["ws-opts"].headers,n=Object.keys(r).map(s=>{let a=r[s];return["Host"].includes(s)&&(a=`"${a}"`),`${s}:${a}`}).join("|");Ei(n)&&e.append(`,ws-headers=${n}`)}}else throw new Error(`network ${t.network} is unsupported`)}var fn=(e,t)=>{t.detour=e["dialer-proxy"]||e.detour},Es=(e,t)=>{["tcp","udp"].includes(e._network)&&(t.network=e._network)},Dn=(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},Ti=(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))))},N0=(e,t)=>{let r={type:"ws",headers:{}};if(e["ws-opts"]){let{path:n="",headers:s={}}=e["ws-opts"];if(n!==""&&(r.path=`${n}`),Object.keys(s).length>0){let a={};for(let c of Object.keys(s)){let l=s[c];l!==""&&(Array.isArray(l)||(l=[`${l}`]),l.length>0&&(a[c]=l))}let{Host:i}=a;if(i.length===1)for(let c of`Host:${i[0]}`.split(`
|
||
`)){let[l,h]=c.split(":");h.trim()!==""&&(a[l.trim()]=h.trim().split(","))}r.headers=a}}if(e["ws-headers"]){let n={};for(let a of Object.keys(e["ws-headers"])){let i=e["ws-headers"][a];i!==""&&(Array.isArray(i)||(i=[`${i}`]),i.length>0&&(n[a]=i))}let{Host:s}=n;if(s.length===1)for(let a of`Host:${s[0]}`.split(`
|
||
`)){let[i,c]=a.split(":");c.trim()!==""&&(n[i.trim()]=c.trim().split(","))}for(let a of Object.keys(n))r.headers[a]=n[a]}if(e["ws-path"]&&e["ws-path"]!==""&&(r.path=`${e["ws-path"]}`),r.path){let n=/^(.*?)(?:\?ed=(\d+))?$/,[s,a="",i=""]=n.exec(r.path);r.path=a,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},X9=(e,t)=>{let r={type:"http",headers:{}};if(e["http-opts"]){let{method:n="",path:s="",headers:a={}}=e["http-opts"];n!==""&&(r.method=n),Array.isArray(s)?r.path=`${s[0]}`:s!==""&&(r.path=`${s}`);for(let i of Object.keys(a)){let c=a[i];if(c!==""){if(i.toLowerCase()==="host"){let l=c;Array.isArray(l)||(l=`${l}`.split(",").map(h=>h.trim())),l.length>0&&(r.host=l);continue}Array.isArray(c)||(c=`${c}`.split(",").map(l=>l.trim())),c.length>0&&(r.headers[i]=c)}}}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(r.host){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}},J9=(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(a=>a.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},L0=(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},Vs=(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},Z9=(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),Dn(e,t),fn(e,t),t},Q9=(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),Dn(e,t),fn(e,t),Vs(e,t),t},eB=(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),Es(e,t),Dn(e,t),fn(e,t),t},tB=(e={})=>{let t={tag:e.name,type:"shadowsocks",method:e.cipher,password:e.password,detour:`${e.name}_shadowtls`},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),Dn(e,r),fn(e,r),Ti(e.smux,t),{type:"ss-with-st",ssPart:t,stPart:r}},rB=(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),Es(e,t),Dn(e,t),fn(e,t),Ti(e.smux,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},nB=(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),Dn(e,t),fn(e,t),Ti(e.smux,t),t},iB=(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"&&N0(e,t),e.network==="h2"&&J9(e,t),e.network==="http"&&X9(e,t),e.network==="grpc"&&L0(e,t),Es(e,t),Dn(e,t),fn(e,t),Vs(e,t),Ti(e.smux,t),t},sB=(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==="xtls-rprx-vision"&&(t.flow=e.flow),e.network==="ws"&&N0(e,t),e.network==="grpc"&&L0(e,t),Es(e,t),Dn(e,t),fn(e,t),Ti(e.smux,t),Vs(e,t),t},aB=(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"&&L0(e,t),e.network==="ws"&&N0(e,t),Es(e,t),Dn(e,t),fn(e,t),Vs(e,t),Ti(e.smux,t),t},uB=(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)),Es(e,t),Vs(e,t),fn(e,t),Dn(e,t),Ti(e.smux,t),t},oB=(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,Es(e,t),Vs(e,t),Dn(e,t),fn(e,t),Ti(e.smux,t),t},cB=(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`),Es(e,t),Dn(e,t),fn(e,t),Vs(e,t),Ti(e.smux,t),t},lB=(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`),fn(e,t),Vs(e,t),t},fB=(e={})=>{let t=["ip","ipv6"].map(n=>e[n]).map(n=>{if(er(n))return`${n}/32`;if(tr(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 a of n.reserved)s.reserved.push(a);else delete s.reserved;n["pre-shared-key"]&&(s.pre_shared_key=n["pre-shared-key"]),r.peers.push(s)}}return Es(e,r),Dn(e,r),fn(e,r),Ti(e.smux,r),r};function Lf(){return{type:"ALL",produce:(r,n,s={})=>{let a=[];return In().produce(r,"internal",{"include-unsupported-proxy":!0}).map(i=>{try{switch(i.type){case"ssh":a.push(Z9(i));break;case"http":a.push(Q9(i));break;case"socks5":if(i.tls)throw new Error(`Platform sing-box does not support proxy type: ${i.type} with tls`);a.push(eB(i));break;case"ss":if(i.plugin==="shadow-tls"){let{ssPart:c,stPart:l}=tB(i);a.push(c),a.push(l)}else a.push(rB(i));break;case"ssr":if(s["include-unsupported-proxy"])a.push(nB(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))a.push(iB(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))a.push(sB(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)a.push(aB(i));else throw new Error(`Platform sing-box does not support proxy type: ${i.type} with flow ${i.flow}`);break;case"hysteria":a.push(uB(i));break;case"hysteria2":a.push(oB(i,s["include-unsupported-proxy"]));break;case"tuic":if(!i.token||i.token.length===0)a.push(cB(i));else throw new Error("Platform sing-box does not support proxy type: TUIC v4");break;case"wireguard":a.push(fB(i));break;case"anytls":a.push(lB(i));break;default:throw new Error(`Platform sing-box does not support proxy type: ${i.type}`)}}catch(c){J.error(c.message??c)}}),n==="internal"?a:JSON.stringify({outbounds:a},null,2)}}}function Uf(){return{type:"ALL",produce:(r,n)=>{let s=r.filter(a=>!(!["http","socks5","ss","trojan","hysteria2","vless","vmess","tuic"].includes(a.type)||a.type==="ss"&&(a.plugin==="obfs"&&!["http","tls"].includes(a["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(a.cipher))||a.type==="vmess"&&!["http","ws","tcp"].includes(a.network)&&a.network||a.type==="trojan"&&!["http","ws","tcp"].includes(a.network)&&a.network||a.type==="vless"&&(typeof a.flow<"u"||a["reality-opts"]||!["http","ws","tcp"].includes(a.network)&&a.network)||a.type==="tuic"&&a.token&&a.token.length!==0)).map(a=>{let i={...a};a.tls&&!a.sni&&(a.sni=a.server);let c=a.prev_hop||a["underlying-proxy"]||a["dialer-proxy"]||a.detour;if(a.type==="http")a={type:"http",name:a.name,server:a.server,port:a.port,username:a.username,password:a.password,tfo:a.tfo||a["fast-open"],next_hop:a.next_hop};else if(a.type==="socks5")a={type:"socks5",name:a.name,server:a.server,port:a.port,username:a.username,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop};else if(a.type==="ss")a={type:"shadowsocks",name:a.name,method:a.cipher==="chacha20-ietf-poly1305"?"chacha20-poly1305":a.cipher,server:a.server,port:a.port,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop},i.plugin==="obfs"&&(a.obfs=i["plugin-opts"].mode,a.obfs_host=i["plugin-opts"].host,a.obfs_uri=i["plugin-opts"].path);else if(a.type==="hysteria2")a={type:"hysteria2",name:a.name,server:a.server,port:a.port,auth:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,sni:a.sni,skip_tls_verify:a["skip-cert-verify"],port_hopping:a.ports,port_hopping_interval:a["hop-interval"]},i["obfs-password"]&&i.obfs=="salamander"&&(a.obfs="salamander",a.obfs_password=i["obfs-password"]);else if(a.type==="tuic")a={type:"tuic",name:a.name,server:a.server,port:a.port,uuid:a.uuid,password:a.password,next_hop:a.next_hop,sni:a.sni,alpn:Array.isArray(a.alpn)?a.alpn:[a.alpn||"h3"],skip_tls_verify:a["skip-cert-verify"],port_hopping:a.ports,port_hopping_interval:a["hop-interval"]};else if(a.type==="trojan")a.network==="ws"&&(a.websocket={path:a["ws-opts"]?.path,host:a["ws-opts"]?.headers?.Host}),a={type:"trojan",name:a.name,server:a.server,port:a.port,password:a.password,tfo:a.tfo||a["fast-open"],udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,sni:a.sni,skip_tls_verify:a["skip-cert-verify"],websocket:a.websocket};else if(a.type==="vmess"){let l=a.cipher;l&&!["auto","none","zero","aes-128-gcm","chacha20-poly1305"].includes(l)&&(l="auto"),a.network==="ws"?a.transport={[a.tls?"wss":"ws"]:{path:a["ws-opts"]?.path,headers:{Host:a["ws-opts"]?.headers?.Host},sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}:a.network==="http"?a.transport={http1:{method:a["http-opts"]?.method,path:Array.isArray(a["http-opts"]?.path)?a["http-opts"]?.path[0]:a["http-opts"]?.path,headers:{Host:Array.isArray(a["http-opts"]?.headers?.Host)?a["http-opts"]?.headers?.Host[0]:a["http-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:a.network==="h2"?a.transport={http2:{method:a["h2-opts"]?.method,path:Array.isArray(a["h2-opts"]?.path)?a["h2-opts"]?.path[0]:a["h2-opts"]?.path,headers:{Host:Array.isArray(a["h2-opts"]?.headers?.Host)?a["h2-opts"]?.headers?.Host[0]:a["h2-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:(a.network==="tcp"||!a.network)&&a.tls&&(a.transport={tls:{sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}),a={type:"vmess",name:a.name,server:a.server,port:a.port,user_id:a.uuid,security:l,tfo:a.tfo||a["fast-open"],legacy:a.legacy,udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,transport:a.transport}}else a.type==="vless"&&(a.network==="ws"?a.transport={[a.tls?"wss":"ws"]:{path:a["ws-opts"]?.path,headers:{Host:a["ws-opts"]?.headers?.Host},sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}:a.network==="http"?a.transport={http:{method:a["http-opts"]?.method,path:Array.isArray(a["http-opts"]?.path)?a["http-opts"]?.path[0]:a["http-opts"]?.path,headers:{Host:Array.isArray(a["http-opts"]?.headers?.Host)?a["http-opts"]?.headers?.Host[0]:a["http-opts"]?.headers?.Host},skip_tls_verify:a["skip-cert-verify"]}}:(a.network==="tcp"||!a.network)&&(a.transport={[a.tls?"tls":"tcp"]:{sni:a.tls?a.sni:void 0,skip_tls_verify:a.tls?a["skip-cert-verify"]:void 0}}),a={type:"vless",name:a.name,server:a.server,port:a.port,user_id:a.uuid,security:a.cipher,tfo:a.tfo||a["fast-open"],legacy:a.legacy,udp_relay:a.udp||a.udp_relay||a.udp_relay,next_hop:a.next_hop,transport:a.transport});if(["http","socks5","ss","trojan","vless","vmess"].includes(i.type)){if(se(i,"shadow-tls-password")){if(i["shadow-tls-version"]!=3)throw new Error(`shadow-tls version ${i["shadow-tls-version"]} is not supported`);a.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`);a.shadow_tls={password:i["plugin-opts"].password,sni:i["plugin-opts"].host}}}if(delete a.subName,delete a.collectionName,delete a.id,delete a.resolved,delete a["no-resolve"],n!=="internal")for(let l in a)(a[l]==null||/^_/i.test(l))&&delete a[l];return{[a.type]:{...a,type:void 0,prev_hop:c}}});return n==="internal"?s:`proxies:
|
||
`+s.map(a=>" - "+JSON.stringify(a)+`
|
||
`).join("")}}}function Z2(){return{type:"ALL",produce:(r,n)=>n==="internal"?r:JSON.stringify(r,null,2)}}var Q2={qx:Bc(),QX:Bc(),QuantumultX:Bc(),surge:ao(),Surge:ao(),SurgeMac:x0(),Loon:k0(),Clash:O0(),meta:In(),clashmeta:In(),"clash.meta":In(),"Clash.Meta":In(),ClashMeta:In(),mihomo:In(),Mihomo:In(),uri:uo(),URI:uo(),v2:Ic(),v2ray:Ic(),V2Ray:Ic(),json:Z2(),JSON:Z2(),stash:kf(),Stash:kf(),shadowrocket:Dc(),Shadowrocket:Dc(),ShadowRocket:Dc(),surfboard:Nf(),Surfboard:Nf(),singbox:Lf(),"sing-box":Lf(),egern:Uf(),Egern:Uf()};var sA=jn(kc()),ED=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/fast_open/tfo/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/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; }
|
||
password = comma match:[^,]+ { proxy.password = match.join(""); }
|
||
|
||
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(""); }
|
||
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();
|
||
})
|
||
obfs["ws-headers"] = result;
|
||
}
|
||
ws_path = comma "ws-path" equals path:uri { obfs.path = path; }
|
||
|
||
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 [^=,]+
|
||
`,sd;function $n(){return sd||(sd=sA.generate(ED)),sd}var aA=jn(kc()),yD=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_host/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_host/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_host/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_host/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_host/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_host/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_host = comma sni:("tls-name"/"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 [^=,]+
|
||
`,ad;function xi(){return ad||(ad=aA.generate(yD)),ad}var uA=jn(kc()),SD=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" }
|
||
`,ud;function Ss(){return ud||(ud=uA.generate(SD)),ud}var oA=jn(kc()),bD=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);
|
||
}
|
||
`,od;function cd(){return od||(od=oA.generate(bD)),od}function cA(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 CD(){return{name:"URI PROXY Parser",test:n=>/^(socks5\+tls|socks5|http|https):\/\//.test(n),parse:n=>{let[s,a,i,c,l,h,m,A,p]=n.match(/^(socks5|http|http)(\+tls|s)?:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(m)m=parseInt(m,10);else{if(i)m=443;else if(a==="http")m=80;else throw J.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);J.info(`port is not present in line: ${n}, set to ${m}`)}return{name:p!=null?decodeURIComponent(p):`${a} ${h}:${m}`,type:a,tls:!!i,server:h,port:m,username:c!=null?decodeURIComponent(c):void 0,password:l!=null?decodeURIComponent(l):void 0}}}}function FD(){return{name:"URI SOCKS Parser",test:n=>/^socks:\/\//.test(n),parse:n=>{let[s,a,i,c,l,h,m]=n.match(/^(socks)?:\/\/(?:(.*)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(l)l=parseInt(l,10);else throw J.error(`port is not present in line: ${n}`),new Error(`port is not present in line: ${n}`);let A,p;if(i){let E=ct.decode(decodeURIComponent(i)).split(":");A=E[0],p=E[1]}return{name:m!=null?decodeURIComponent(m):`${a} ${c}:${l}`,type:"socks5",server:c,port:l,username:A,password:p}}}}function _D(){return{name:"URI SS Parser",test:n=>/^ss:\/\//.test(n),parse:n=>{let s=n.split("ss://")[1],a=n.split("#")[1],i={type:"ss"};s=s.split("#")[0];let c=s.match(/@([^/?]*)(\/|\?|$)/),l=decodeURIComponent(s.split("@")[0]),h;l?.startsWith("2022-blake3-")?h=l:h=ct.decode(l);let m="";if(c)s.includes("?")&&(m=s.match(/(\?.*)$/)[1]);else{if(s.includes("?")){let b=s.match(/^(.*)(\?.*)$/);s=b[1],m=b[2]}if(s=ct.decode(s),m){if(/(&|\?)v2ray-plugin=/.test(m)){let w=m.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/)[2];w&&(i.plugin="v2ray-plugin",i["plugin-opts"]=JSON.parse(ct.decode(w)))}s=`${s}${m}`}h=s.match(/(^.*)@/)?.[1],c=s.match(/@([^/@]*)(\/|$)/)}let A=c[1],p=A.lastIndexOf(":");i.server=A.substring(0,p),i.port=`${A.substring(p+1)}`.match(/\d+/)?.[0];let f=h.match(/(^.*?):(.*$)/);i.cipher=f?.[1],i.password=f?.[2];let E=s.match(/[?&]plugin=([^&]+)/),v=s.match(/[?&]shadow-tls=([^&]+)/);if(E){let b=("plugin="+decodeURIComponent(E[1])).split(";"),w={};for(let S of b){let[F,D]=S.split("=");F&&(w[F]=D||!0)}switch(w.plugin){case"obfs-local":case"simple-obfs":i.plugin="obfs",i["plugin-opts"]={mode:w.obfs,host:Ft(w["obfs-host"])};break;case"v2ray-plugin":i.plugin="v2ray-plugin",i["plugin-opts"]={mode:"websocket",host:Ft(w["obfs-host"]),path:Ft(w.path),tls:xu(w.tls)};break;case"shadow-tls":{i.plugin="shadow-tls";let S=Ft(w.version);i["plugin-opts"]={host:Ft(w.host),password:Ft(w.password),version:S?parseInt(S,10):void 0};break}default:throw new Error(`Unsupported plugin option: ${w.plugin}`)}}if(v){let b=JSON.parse(ct.decode(v[1])),w=Ft(b.version),S=Ft(b.address),F=Ft(b.port);i.plugin="shadow-tls",i["plugin-opts"]={host:Ft(b.host),password:Ft(b.password),version:w?parseInt(w,10):void 0},S&&(i.server=S),F&&(i.port=parseInt(F,10))}return/(&|\?)uot=(1|true)/i.test(m)&&(i["udp-over-tcp"]=!0),/(&|\?)tfo=(1|true)/i.test(m)&&(i.tfo=!0),a!=null&&(a=decodeURIComponent(a)),i.name=a??`SS ${i.server}:${i.port}`,i}}}function ID(){return{name:"URI SSR Parser",test:n=>/^ssr:\/\//.test(n),parse:n=>{n=ct.decode(n.split("ssr://")[1]);let s=n.indexOf(":origin");s===-1&&(s=n.indexOf(":auth_"));let a=n.substring(0,s),i=a.substring(0,a.lastIndexOf(":")),c=a.substring(a.lastIndexOf(":")+1),l=n.substring(s+1).split("/?")[0].split(":"),h={type:"ssr",server:i,port:c,protocol:l[0],cipher:l[1],obfs:l[2],password:ct.decode(l[3])},m={};if(n=n.split("/?")[1].split("&"),n.length>1)for(let A of n){let[p,f]=A.split("=");f=f.trim(),f.length>0&&f!=="(null)"&&(m[p]=f)}return h={...h,name:m.remarks?ct.decode(m.remarks):h.server,"protocol-param":Ft(ct.decode(m.protoparam||"").replace(/\s/g,"")),"obfs-param":Ft(ct.decode(m.obfsparam||"").replace(/\s/g,""))},h}}}function BD(){return{name:"URI VMess Parser",test:n=>/^vmess:\/\//.test(n),parse:n=>{n=n.split("vmess://")[1];let s=ct.decode(n.replace(/\?.*?$/,""));if(/=\s*vmess/.test(s)){let a=s.split(",").map(l=>l.trim()),i={};for(let l of a)if(l.indexOf("=")!==-1){let[h,m]=l.split("=");i[h.trim()]=m.trim()}let c={name:a[0].split("=")[0].trim(),type:"vmess",server:a[1],port:a[2],cipher:Ft(a[3],"auto"),uuid:a[4].match(/^"(.*)"$/)[1],tls:i.obfs==="wss",udp:xu(i["udp-relay"]),tfo:xu(i["fast-open"]),"skip-cert-verify":Tu(i["tls-verification"])?!i["tls-verification"]:void 0};if(Tu(i.obfs))if(i.obfs==="ws"||i.obfs==="wss"){c.network="ws",c["ws-opts"].path=(Ft(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]),Ei(l)&&(c["ws-opts"].headers={Host:l})}else throw new Error(`Unsupported obfs: ${i.obfs}`);return c}else{let a={};try{a=JSON.parse(s)}catch{let[A,p,f]=/(^[^?]+?)\/?\?(.*)$/.exec(n);s=ct.decode(p);for(let F of f.split("&")){let[D,I]=F.split("="),j=I;j=decodeURIComponent(I),j.indexOf(",")===-1?a[D]=j:a[D]=j.split(",")}let[E,v,b,w,S]=/(^[^:]+?):([^:]+?)@(.*):(\d+)$/.exec(s);a.scy=v,a.id=b,a.port=S,a.add=w}let i=a.add,c=parseInt(xu(a.port),10),l={name:a.ps??a.remarks??a.remark??`VMess ${i}:${c}`,type:"vmess",server:i,port:c,cipher:["auto","aes-128-gcm","chacha20-poly1305","none"].includes(a.scy)?a.scy:"auto",uuid:a.id,alterId:parseInt(xu(a.aid??a.alterId,0),10),tls:["tls",!0,1,"1"].includes(a.tls),"skip-cert-verify":Tu(a.verify_cert)?!a.verify_cert:void 0};!l["skip-cert-verify"]&&Tu(a.allowInsecure)&&(l["skip-cert-verify"]=/(TRUE)|1/i.test(a.allowInsecure)),l.tls&&(a.sni&&a.sni!==""?l.sni=a.sni:a.peer&&a.peer!==""&&(l.sni=a.peer));let h=!1;if(a.net==="ws"||a.obfs==="websocket"?l.network="ws":["http"].includes(a.net)||["http"].includes(a.obfs)||["http"].includes(a.type)?l.network="http":["grpc","kcp","quic"].includes(a.net)?l.network=a.net:a.net==="httpupgrade"||l.network==="httpupgrade"?(l.network="ws",h=!0):(a.net==="h2"||l.network==="h2")&&(l.network="h2"),l.network){let m=a.host??a.obfsParam;try{let f=JSON.parse(m)?.Host;f&&(m=f)}catch{}let A=a.path;if(["ws"].includes(l.network)&&(A=A||"/"),l.network==="http"&&(m&&(m=m.split(",").map(p=>p.trim()),m=Array.isArray(m)?m[0]:m),A?A=Array.isArray(A)?A[0]:A:A="/"),A||m||["kcp","quic"].includes(l.network))if(["grpc"].includes(l.network))l[`${l.network}-opts`]={"grpc-service-name":Ft(A),"_grpc-type":Ft(a.type),"_grpc-authority":Ft(a.authority)};else if(["kcp","quic"].includes(l.network))l[`${l.network}-opts`]={[`_${l.network}-type`]:Ft(a.type),[`_${l.network}-host`]:Ft(Ft(m)),[`_${l.network}-path`]:Ft(A)};else{let p={path:Ft(A),headers:{Host:Ft(m)}};h&&(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"]=a.fp,l.alpn=a.alpn?a.alpn.split(","):void 0,l}}}}function DD(){return{name:"URI VLESS Parser",test:n=>/^vless:\/\//.test(n),parse:n=>{n=n.split("vless://")[1];let s,a=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);if(!a){let[b,w,S]=/^(.*?)(\?.*?$)/.exec(n);n=`${ct.decode(w)}${S}`,a=/^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(n),s=!0}let[i,c,l,h,m,A="",p]=a;s&&(c=c.replace(/^.*?:/g,"")),h=parseInt(`${h}`,10),c=decodeURIComponent(c),p!=null&&(p=decodeURIComponent(p));let f={type:"vless",name:p,server:l,port:h,uuid:c},E={};for(let b of A.split("&")){let[w,S]=b.split("="),F=S;F=decodeURIComponent(S),E[w]=F}if(f.name=p??E.remarks??E.remark??`VLESS ${l}:${h}`,f.tls=E.security&&E.security!=="none",s&&/TRUE|1/i.test(E.tls)&&(f.tls=!0,E.security=E.security??"reality"),f.sni=E.sni||E.peer,f.flow=E.flow,!f.flow&&s&&E.xtls){let b=[void 0,"xtls-rprx-direct","xtls-rprx-vision"][E.xtls];b&&(f.flow=b)}if(f["client-fingerprint"]=E.fp,f.alpn=E.alpn?E.alpn.split(","):void 0,f["skip-cert-verify"]=/(TRUE)|1/i.test(E.allowInsecure),["reality"].includes(E.security)){let b={};E.pbk&&(b["public-key"]=E.pbk),E.sid&&(b["short-id"]=E.sid),E.spx&&(b["_spider-x"]=E.spx),Object.keys(b).length>0&&(f[`${E.security}-opts`]=b)}let v=!1;if(f.network=E.type,f.network==="tcp"&&E.headerType==="http"?f.network="http":f.network==="httpupgrade"&&(f.network="ws",v=!0),!f.network&&s&&E.obfs&&(f.network=E.obfs,["none"].includes(f.network)&&(f.network="tcp")),["websocket"].includes(f.network)&&(f.network="ws"),f.network&&!["tcp","none"].includes(f.network)){let b={},w=E.host??E.obfsParam;if(w)if(E.obfsParam)try{let S=JSON.parse(w);b.headers=S}catch{b.headers={Host:w}}else b.headers={Host:w};E.serviceName?(b[`${f.network}-service-name`]=E.serviceName,["grpc"].includes(f.network)&&E.authority&&(b["_grpc-authority"]=E.authority)):s&&E.path&&(["ws","http","h2"].includes(f.network)||(b[`${f.network}-service-name`]=E.path,delete E.path)),E.path&&(b.path=E.path),["grpc"].includes(f.network)&&(b["_grpc-type"]=E.mode||"gun"),v&&(b["v2ray-http-upgrade"]=!0,b["v2ray-http-upgrade-fast-open"]=!0),Object.keys(b).length>0&&(f[`${f.network}-opts`]=b),f.network==="kcp"&&(E.seed&&(f.seed=E.seed),f.headerType=E.headerType||"none"),E.mode&&(f._mode=E.mode),E.extra&&(f._extra=E.extra)}return f}}}function PD(){return{name:"URI AnyTLS Parser",test:n=>/^anytls:\/\//.test(n),parse:n=>{n=n.split(/anytls:\/\//)[1];let[s,a,i,c,l="",h]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);a=decodeURIComponent(a),c=parseInt(`${c}`,10),isNaN(c)&&(c=443),a=decodeURIComponent(a),h!=null&&(h=decodeURIComponent(h)),h=h??`AnyTLS ${i}:${c}`;let m={type:"anytls",name:h,server:i,port:c,password:a};for(let A of l.split("&")){let[p,f]=A.split("=");p=p.replace(/_/g,"-"),f=decodeURIComponent(f),["alpn"].includes(p)?m[p]=f?f.split(","):void 0:["insecure"].includes(p)?m["skip-cert-verify"]=/(TRUE)|1/i.test(f):["udp"].includes(p)?m[p]=/(TRUE)|1/i.test(f):m[p]=f}return m}}}function $D(){return{name:"URI Hysteria2 Parser",test:n=>/^(hysteria2|hy2):\/\//.test(n),parse:n=>{n=n.split(/(hysteria2|hy2):\/\//)[2];let s,[a,i,c,l,h,m,A,p,f,E,v="",b]=/^(.*?)@(.*?)(:((\d+(-\d+)?)([,;]\d+(-\d+)?)*))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);/^\d+$/.test(h)?(h=parseInt(`${h}`,10),isNaN(h)&&(h=443)):h?(s=h,h=ic(s)):h=443,i=decodeURIComponent(i),b!=null&&(b=decodeURIComponent(b)),b=b??`Hysteria2 ${c}:${h}`;let w={type:"hysteria2",name:b,server:c,port:h,ports:s,password:i},S={};for(let I of v.split("&")){let[j,q]=I.split("="),_=q;_=decodeURIComponent(q),S[j]=_}w.sni=S.sni,!w.sni&&S.peer&&(w.sni=S.peer),S.obfs&&S.obfs!=="none"&&(w.obfs=S.obfs),S.mport&&(w.ports=S.mport),w["obfs-password"]=S["obfs-password"],w["skip-cert-verify"]=/(TRUE)|1/i.test(S.insecure),w.tfo=/(TRUE)|1/i.test(S.fastopen),w["tls-fingerprint"]=S.pinSHA256;let F=S["hop-interval"]||S.hop_interval;/^\d+$/.test(F)&&(w["hop-interval"]=parseInt(`${F}`,10));let D=S.keepalive;return/^\d+$/.test(D)&&(w.keepalive=parseInt(`${D}`,10)),w}}}function RD(){return{name:"URI Hysteria Parser",test:n=>/^(hysteria|hy):\/\//.test(n),parse:n=>{n=n.split(/(hysteria|hy):\/\//)[2];let[s,a,i,c,l,h="",m]=/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);c=parseInt(`${c}`,10),isNaN(c)&&(c=443),m!=null&&(m=decodeURIComponent(m)),m=m??`Hysteria ${a}:${c}`;let A={type:"hysteria",name:m,server:a,port:c},p={};for(let f of h.split("&")){let[E,v]=f.split("=");E=E.replace(/_/,"-"),v=decodeURIComponent(v),["alpn"].includes(E)?A[E]=v?v.split(","):void 0:["insecure"].includes(E)?A["skip-cert-verify"]=/(TRUE)|1/i.test(v):["auth"].includes(E)?A["auth-str"]=v:["mport"].includes(E)?A.ports=v:["obfsParam"].includes(E)?A.obfs=v:["upmbps"].includes(E)?A.up=v:["downmbps"].includes(E)?A.down=v:["obfs"].includes(E)?A._obfs=v||"":["fast-open","peer"].includes(E)?p[E]=v:A[E]=v}return!A.sni&&p.peer&&(A.sni=p.peer),!A["fast-open"]&&p.fastopen&&(A["fast-open"]=!0),A.protocol||(A.protocol="udp"),A}}}function TD(){return{name:"URI TUIC Parser",test:n=>/^tuic:\/\//.test(n),parse:n=>{n=n.split(/tuic:\/\//)[1];let[s,a,i,c,l="",h]=/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(n);a=decodeURIComponent(a);let[m,...A]=a.split(":"),p=A.join(":");c=parseInt(`${c}`,10),isNaN(c)&&(c=443),p=decodeURIComponent(p),h!=null&&(h=decodeURIComponent(h)),h=h??`TUIC ${i}:${c}`;let f={type:"tuic",name:h,server:i,port:c,password:p,uuid:m};for(let E of l.split("&")){let[v,b]=E.split("=");v=v.replace(/_/g,"-"),b=decodeURIComponent(b),["alpn"].includes(v)?f[v]=b?b.split(","):void 0:["allow-insecure"].includes(v)?f["skip-cert-verify"]=/(TRUE)|1/i.test(b):["fast-open"].includes(v)?f.tfo=!0:["disable-sni","reduce-rtt"].includes(v)?f[v]=/(TRUE)|1/i.test(b):v==="congestion-control"?(f["congestion-controller"]=b,delete f[v]):f[v]=b}return f}}}function xD(){return{name:"URI WireGuard Parser",test:n=>/^(wireguard|wg):\/\//.test(n),parse:n=>{n=n.split(/(wireguard|wg):\/\//)[2];let[s,a,i,c,l,h,m,A="",p]=/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(n);h=parseInt(`${h}`,10),isNaN(h)&&(h=51820),i=decodeURIComponent(i),p!=null&&(p=decodeURIComponent(p)),p=p??`WireGuard ${c}:${h}`;let f={type:"wireguard",name:p,server:c,port:h,"private-key":i,udp:!0};for(let E of A.split("&")){let[v,b]=E.split("=");if(v=v.replace(/_/,"-"),b=decodeURIComponent(b),["reserved"].includes(v)){let w=b.split(",").map(S=>parseInt(S.trim(),10)).filter(S=>Number.isInteger(S));w.length===3&&(f[v]=w)}else if(["address","ip"].includes(v))b.split(",").map(w=>{let S=w.trim().replace(/\/\d+$/,"").replace(/^\[/,"").replace(/\]$/,"");er(S)?f.ip=S:tr(S)&&(f.ipv6=S)});else if(["mtu"].includes(v)){let w=parseInt(b.trim(),10);Number.isInteger(w)&&(f[v]=w)}else/publickey/i.test(v)?f["public-key"]=b:/privatekey/i.test(v)?f["private-key"]=b:["udp"].includes(v)?f[v]=/(TRUE)|1/i.test(b):["flag"].includes(v)||(f[v]=b)}return f}}}function OD(){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,c]=n.split(/#(.+)/,2),h=cd().parse(i);if(Ei(c))try{h.name=decodeURIComponent(c)}catch(m){console.log(m)}return h}}}function kD(){return{name:"Clash Parser",test:n=>{try{JSON.parse(n)}catch{return!1}return!0},parse:n=>{let s=JSON.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 ND(){return{name:"QX SS Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")===-1,parse:n=>Ss().parse(n)}}function LD(){return{name:"QX SSR Parser",test:n=>/^shadowsocks\s*=/.test(n.split(",")[0].trim())&&n.indexOf("ssr-protocol")!==-1,parse:n=>Ss().parse(n)}}function UD(){return{name:"QX VMess Parser",test:n=>/^vmess\s*=/.test(n.split(",")[0].trim()),parse:n=>Ss().parse(n)}}function HD(){return{name:"QX VLESS Parser",test:n=>/^vless\s*=/.test(n.split(",")[0].trim()),parse:n=>Ss().parse(n)}}function jD(){return{name:"QX Trojan Parser",test:n=>/^trojan\s*=/.test(n.split(",")[0].trim()),parse:n=>Ss().parse(n)}}function MD(){return{name:"QX HTTP Parser",test:n=>/^http\s*=/.test(n.split(",")[0].trim()),parse:n=>Ss().parse(n)}}function qD(){return{name:"QX Socks5 Parser",test:n=>/^socks5\s*=/.test(n.split(",")[0].trim()),parse:n=>Ss().parse(n)}}function KD(){return{name:"Loon SS Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocks",parse:n=>xi().parse(n)}}function VD(){return{name:"Loon SSR Parser",test:n=>n.split(",")[0].split("=")[1].trim().toLowerCase()==="shadowsocksr",parse:n=>xi().parse(n)}}function GD(){return{name:"Loon VMess Parser",test:n=>/^.*=\s*vmess/i.test(n.split(",")[0])&&n.indexOf("username")===-1,parse:n=>xi().parse(n)}}function zD(){return{name:"Loon Vless Parser",test:n=>/^.*=\s*vless/i.test(n.split(",")[0]),parse:n=>xi().parse(n)}}function WD(){return{name:"Loon Trojan Parser",test:n=>/^.*=\s*trojan/i.test(n.split(",")[0]),parse:n=>xi().parse(n)}}function YD(){return{name:"Loon Hysteria2 Parser",test:n=>/^.*=\s*Hysteria2/i.test(n.split(",")[0]),parse:n=>xi().parse(n)}}function XD(){return{name:"Loon HTTP Parser",test:n=>/^.*=\s*http/i.test(n.split(",")[0]),parse:n=>xi().parse(n)}}function JD(){return{name:"Loon SOCKS5 Parser",test:n=>/^.*=\s*socks5/i.test(n.split(",")[0]),parse:n=>xi().parse(n)}}function ZD(){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 a=n.match(/,\s*?peers\s*?=\s*?\[\s*?\{\s*?(.+?)\s*?\}\s*?\]/i)?.[1],i=a.match(/(,|^)\s*?endpoint\s*?=\s*?"?(.+?):(\d+)"?\s*?(,|$)/i),c=i?.[2],l=parseInt(i?.[3],10),h=n.match(/(,|^)\s*?mtu\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];h&&(h=parseInt(h,10));let m=n.match(/(,|^)\s*?keepalive\s*?=\s*?"?(\d+?)"?\s*?(,|$)/i)?.[2];m&&(m=parseInt(m,10));let A=a.match(/(,|^)\s*?reserved\s*?=\s*?"?(\[\s*?.+?\s*?\])"?\s*?(,|$)/i)?.[2];A&&(A=JSON.parse(A));let p,f=n.match(/(,|^)\s*?dns\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],E=n.match(/(,|^)\s*?dnsv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2];(f||E)&&(p=[],f&&p.push(f),E&&p.push(E));let v=a.match(/(,|^)\s*?allowed-ips\s*?=\s*?"(.+?)"\s*?(,|$)/i)?.[2]?.split(",").map(I=>I.trim()),b=a.match(/(,|^)\s*?preshared-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],w=n.match(/(,|^)\s*?interface-ip\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],S=n.match(/(,|^)\s*?interface-ipv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],F=a.match(/(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],D={type:"wireguard",name:s,server:c,port:l,ip:w,ipv6:S,"private-key":n.match(/(,|^)\s*?private-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2],"public-key":F,mtu:h,keepalive:m,reserved:A,"allowed-ips":v,"preshared-key":b,dns:p,udp:!0,peers:[{server:c,port:l,ip:w,ipv6:S,"public-key":F,"pre-shared-key":b,"allowed-ips":v,reserved:A}]};return Array.isArray(D.dns)&&D.dns.length>0&&(D["remote-dns-resolve"]=!0),D}}}function QD(){return{name:"Surge Direct Parser",test:n=>/^.*=\s*direct/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function e7(){return{name:"Surge SSH Parser",test:n=>/^.*=\s*ssh/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function t7(){return{name:"Surge SS Parser",test:n=>/^.*=\s*ss/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function r7(){return{name:"Surge VMess Parser",test:n=>/^.*=\s*vmess/.test(n.split(",")[0])&&n.indexOf("username")!==-1,parse:n=>$n().parse(n)}}function n7(){return{name:"Surge Trojan Parser",test:n=>/^.*=\s*trojan/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function i7(){return{name:"Surge HTTP Parser",test:n=>/^.*=\s*https?/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function s7(){return{name:"Surge Socks5 Parser",test:n=>/^.*=\s*socks5(-tls)?/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function a7(){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),[a,i,c]=s;n=c;let l=/(,|^)\s*?exec\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];l||(l=/(,|^)\s*?exec\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let h=/(,|^)\s*?local-port\s*?=\s*"(.*?)"\s*?(,|$)/.exec(n)?.[2];h||(h=/(,|^)\s*?local-port\s*?=\s*(.*?)\s*?(,|$)/.exec(n)?.[2]);let m=/(,|^)\s*?args\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,A,p=[];for(;(A=m.exec(n))!==null;)A[3]!=null?p.push(A[3]):A[4]!=null&&p.push(A[4]);let f=/(,|^)\s*?addresses\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g,E,v=[];for(;(E=f.exec(n))!==null;){let w;E[3]!=null?w=E[3]:E[4]!=null&&(w=E[4]),w!=null&&(w=`${w}`.trim().replace(/^\[/,"").replace(/\]$/,"")),f7(w)&&v.push(w)}return{type:"external",name:i,exec:l,"local-port":h,args:p,addresses:v}}}}function u7(){return{name:"Surge Snell Parser",test:n=>/^.*=\s*snell/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function o7(){return{name:"Surge Tuic Parser",test:n=>/^.*=\s*tuic(-v5)?/.test(n.split(",")[0]),parse:n=>{let{port_hopping:s,line:a}=cA(n),i=$n().parse(a);return i.ports=s,i}}}function c7(){return{name:"Surge WireGuard Parser",test:n=>/^.*=\s*wireguard/.test(n.split(",")[0]),parse:n=>$n().parse(n)}}function l7(){return{name:"Surge Hysteria2 Parser",test:n=>/^.*=\s*hysteria2/.test(n.split(",")[0]),parse:n=>{let{port_hopping:s,line:a}=cA(n),i=$n().parse(a);return i.ports=s,i}}}function f7(e){return er(e)||tr(e)}var lA=[CD(),FD(),_D(),ID(),BD(),DD(),TD(),xD(),RD(),$D(),OD(),PD(),kD(),QD(),e7(),t7(),r7(),n7(),i7(),u7(),o7(),c7(),l7(),s7(),a7(),KD(),VD(),GD(),zD(),YD(),WD(),XD(),JD(),ZD(),ND(),LD(),UD(),HD(),jD(),MD(),qD()];var Ka=class{constructor({token,key,syncPlatform}){let{isStash,isLoon,isShadowRocket,isQX}=gi(),{defaultProxy,defaultTimeout:timeout}=J.read(nn),proxy=defaultProxy;J.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=es({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?rs(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=es({baseURL:"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?rs(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);J.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((a,i)=>(a[i.path]=i,a),{}));let n=[],s={...t.files};return Object.keys(r).map(a=>{s[a]?r[a].content==null||r[a].content===""?(delete s[a],n.push({action:"delete",file_path:a})):(s[a]=r[a],n.push({action:"update",file_path:a,content:r[a].content})):r[a].content==null||r[a].content===""?(delete s[a],delete r[a]):(s[a]=r[a],n.push({action:"create",file_path:a,content:r[a].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,a])=>(a.content!==null&&a.content!==""&&(n[s]=a),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 h7(e){for(let t of lf)try{if(t.test(e))return J.info(`Pre-processor [${t.name}] activated`),t.parse(e)}catch(r){J.error(`Parser [${t.name}] failed
|
||
Reason: ${r}`)}return e}function p7(e){e=h7(e);let t=e.split(`
|
||
`),r=[],n;for(let s of t){if(s=s.trim(),s.length===0)continue;let a=!1;if(n){let[i,c]=fA(n,s);c||(r.push(pA(i)),a=!0)}if(!a)for(let i of lA){let[c,l]=fA(i,s);if(!l){r.push(pA(c)),n=i,a=!0,J.info(`${i.name} is activated`);break}}a||J.error(`Failed to parse line: ${s}`)}return r.filter(s=>(["vless","vmess"].includes(s.type)&&(Gl(s.uuid)||J.error(`UUID may be invalid: ${s.name} ${s.uuid}`)),!0))}async function d7(proxies,operators=[],targetPlatform,source,$options){for(let item of operators){if(item.disabled){J.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"?Rl:Bu,n=qr(J.read(r),t);if(!n)throw new Error(`\u627E\u4E0D\u5230 ${e}: ${t}`);e==="module"?script=n.content:script=await Mn({type:"file",name:t})}catch(t){throw J.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 J.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 Sn(url)}catch(e){throw J.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(!Of[item.type]){J.error(`Unknown operator: "${item.type}"`);continue}J.log(`Applying "${item.type}" with arguments:
|
||
>>> ${JSON.stringify(item.args,null,2)||"None"}`);let processor;item.type.indexOf("Script")!==-1?processor=Of[item.type](script,targetPlatform,$arguments,source,$options):processor=Of[item.type](item.args||{}),proxies=await G2(processor,proxies)}return proxies}function g7(e,t,r,n={}){let s=Q2[t];if(!s)throw new Error(`Target platform: ${t} is not supported!`);let a=/Surge|SurgeMac|Shadowrocket/i.test(t);if(e=e.filter(i=>i.supported&&i.supported[t]===!1?!1:(["vless","vmess"].includes(i.type)&&(Gl(i.uuid)||J.error(`UUID may be invalid: ${i.name} ${i.uuid}`)),!0)),e=e.map(i=>(i._resolved=i.resolved,Ei(i.name)||(i.name=`${i.type} ${i.server}:${i.port}`),i["disable-sni"]&&(a?i.sni="off":["tuic"].includes(i.type)||(J.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=ic(i.ports))),i)),J.log(`Producing proxies for target: ${t}`),typeof s.type>"u"||s.type==="SINGLE"){let i=e.map(c=>{try{return s.produce(c,r,n)}catch(l){return J.error(`Cannot produce proxy: ${JSON.stringify(c,null,2)}
|
||
Reason: ${l}`),""}}).filter(c=>c.length>0);return i=r==="internal"?i:i.join(`
|
||
`),t.startsWith("Surge")&&e.length>0&&e.every(c=>c.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 Gt={parse:p7,process:d7,produce:g7,ipAddress:Vl,getRandomPort:ic,isIPv4:er,isIPv6:tr,isIP:ld,yaml:Oa,getFlag:ro,removeFlag:Sc,getISO:_2,MMDB:Df,Gist:Ka,download:Sn,downloadFile:xv,isValidUUID:Gl,doh:io,Buffer:Wf.Buffer,Base64:ct};function fA(e,t){if(!m7(e,t))return[null,new Error("Parser mismatch")];try{return[e.parse(t),null]}catch(r){return[null,r]}}function m7(e,t){try{return e.test(t)}catch{return!1}}function hA(e){if(typeof e=="string"||typeof e=="number"){if(e=String(e).trim(),e==="")return"/";if(!e.startsWith("/"))return"/"+e}return e}function pA(e){typeof e.cipher=="string"&&(e.cipher=e.cipher.toLowerCase()),typeof e.password=="number"&&(e.password=vg(e.password)),["ss"].includes(e.type)&&e.cipher==="none"&&!e.password&&(e.password=""),e.interface&&(e["interface-name"]=e.interface,delete e.interface),mg(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=>hA(n)):t!=null&&(e[`${e.network}-opts`].path=hA(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&&!ld(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&&(ld(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=Wf.Buffer.from(e.name.data).toString("utf8"):e.name=Wf.Buffer.from(e.name).toString("utf8")}catch(n){J.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{J.env.isNode&&!r&&e._ca&&(r=J.node.fs.readFileSync(e._ca,{encoding:"utf8"}))}catch(n){J.error(`Read ca file failed
|
||
Reason: ${n}`)}return!e["tls-fingerprint"]&&r&&(e["tls-fingerprint"]=F2.generateFingerprint(r)),["ss"].includes(e.type)&&se(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 ld(e){return er(e)||tr(e)}function v7(){return{name:"HTML",test:n=>/^<!DOCTYPE html>/.test(n),parse:()=>""}}function w7(){return{name:"Clash Provider",test:n=>/^payload:/gm.exec(n).index>=0,parse:n=>n.replace("payload:","").replace(/^\s*-\s*/gm,"")}}var dA=[v7(),w7()];function A7(){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 gA(){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 E7(){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))),gA().func(r))}}function y7(){return{type:"ALL",func:r=>{let n={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},s={payload:r.map(a=>{let i=`${n[a.type]||a.type},${a.content}`;return["IP-CIDR","IP-CIDR6","GEOIP"].includes(a.type)&&(a.options&&(a.options=a.options.filter(c=>["no-resolve"].includes(c))),i+=a.options?.length>0?`,${a.options.join(",")}`:""),i})};return Oa.dump(s)}}}var mA={QX:A7(),Surge:gA(),Loon:E7(),Clash:y7()};var S7=[[/^(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 b7(){return{name:"Universal Rule Parser",test:()=>!0,parse:n=>{let s=n.split(`
|
||
`),a=[];for(let i of s)if(i=i.trim(),i.length!==0&&!/\s*#/.test(i))try{let c=i.split(",").map(m=>m.trim()),l=c[0],h=!1;for(let m of S7)if(m[0].test(l)){h=!0;let p={type:m[1],content:c[1]};["IP-CIDR","IP-CIDR6","GEOIP"].includes(p.type)&&(p.options=c.slice(2)),a.push(p)}if(!h)throw new Error("Invalid rule type: "+l)}catch(c){console.log(`Failed to parse line: ${i}
|
||
Reason: ${c}`)}return a}}}var vA=[b7()];var Yf=function(){function e(n){for(let s of dA)try{if(s.test(n))return J.info(`Pre-processor [${s.name}] activated`),s.parse(n)}catch(a){J.error(`Parser [${s.name}] failed
|
||
Reason: ${a}`)}return n}function t(n){n=e(n);for(let s of vA){let a;try{a=s.test(n)}catch{a=!1}if(a)return J.info(`Rule parser [${s.name}] is activated!`),s.parse(n)}}function r(n,s){let a=mA[s];if(!a)throw new Error(`Target platform: ${s} is not supported!`);if(typeof a.type>"u"||a.type==="SINGLE")return n.map(i=>{try{return a.func(i)}catch(c){return console.log(`ERROR: cannot produce rule: ${JSON.stringify(i)}
|
||
Reason: ${c}`),""}}).filter(i=>i.length>0).join(`
|
||
`);if(a.type==="ALL")return a.func(n)}return{parse:t,produce:r}}();async function fd(e){let{gistToken:t,syncPlatform:r}=J.read(nn);if(!t)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let s=await new Ka({token:t,key:Q1,syncPlatform:r}).upload(e),a={};try{a=JSON.parse(s.body)}catch{}let i=a?.html_url??a?.web_url,c=J.read(nn);return i?(J.log(`\u540C\u6B65 Gist \u540E, \u627E\u5230 Sub-Store Gist: ${i}`),c.artifactStore=i,c.artifactStoreStatus="VALID"):(J.error("\u540C\u6B65 Gist \u540E, \u627E\u4E0D\u5230 Sub-Store Gist"),c.artifactStoreStatus="NOT FOUND"),J.write(c,nn),s}async function Mn({type:e,name:t,platform:r,url:n,ua:s,content:a,mergeSources:i,ignoreFailedRemoteSub:c,ignoreFailedRemoteFile:l,produceType:h,produceOpts:m={},subscription:A,awaitCustomCache:p,$options:f,proxy:E,noCache:v,all:b}){if(r=r||"JSON",["subscription","sub"].includes(e)){let w;if(t){let I=J.read(tc);if(w=qr(I,t),!w)throw new Error(`\u627E\u4E0D\u5230\u8BA2\u9605 ${t}`)}else if(A)w=A;else throw new Error("\u672A\u63D0\u4F9B\u8BA2\u9605\u540D\u79F0\u6216\u8BA2\u9605\u6570\u636E");let S;if(a&&!["localFirst","remoteFirst"].includes(i))S=a;else if(n){let I={};S=await Promise.all(n.split(/[\r\n]+/).map(q=>q.trim()).filter(q=>q.length).map(async q=>{try{return await Sn(q,s||w.ua,void 0,E||w.proxy,void 0,p,v||w.noCache,!0)}catch(_){return I[q]=_,J.error(`\u8BA2\u9605 ${w.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${q} \u53D1\u751F\u9519\u8BEF: ${_}`),""}}));let j=w.ignoreFailedRemoteSub;if(c!=null&&c!==""&&(j=c),Object.keys(I).length>0)if(j)j==="enabled"&&J.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${w.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(I).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(I).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);i==="localFirst"?S.unshift(a):i==="remoteFirst"&&S.push(a)}else if(w.source==="local"&&!["localFirst","remoteFirst"].includes(w.mergeSources))S=w.content;else{let I={};S=await Promise.all(w.url.split(/[\r\n]+/).map(q=>q.trim()).filter(q=>q.length).map(async q=>{try{return await Sn(q,s||w.ua,void 0,E||w.proxy,void 0,p,v||w.noCache,!0)}catch(_){return I[q]=_,J.error(`\u8BA2\u9605 ${w.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${q} \u53D1\u751F\u9519\u8BEF: ${_}`),""}}));let j=w.ignoreFailedRemoteSub;if(c!=null&&c!==""&&(j=c),Object.keys(I).length>0)if(j)j==="enabled"&&J.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${w.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(I).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(I).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);w.mergeSources==="localFirst"?S.unshift(w.content):w.mergeSources==="remoteFirst"&&S.push(w.content)}if(h==="raw")return JSON.stringify((Array.isArray(S)?S:[S]).flat());let F=(Array.isArray(S)?S:[S]).map(I=>Gt.parse(I)).flat();if(F.forEach(I=>{I._subName=w.name,I._subDisplayName=w.displayName}),F=await Gt.process(F,w.process||[],r,{[w.name]:w},f),F.length===0)throw new Error(`\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let D={};for(let I of F){if(D[I.name]){J.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${I.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}D[I.name]=!0}return Gt.produce(F,r,h,m)}else if(["collection","col"].includes(e)){let w=J.read(tc),S=J.read($l),F=qr(S,t);if(!F)throw new Error(`\u627E\u4E0D\u5230\u7EC4\u5408\u8BA2\u9605 ${t}`);let D=[...F.subscriptions],I=F.subscriptionTags;Array.isArray(I)&&I.length>0&&w.forEach(M=>{Array.isArray(M.tag)&&M.tag.length>0&&!D.includes(M.name)&&M.tag.some(W=>I.includes(W))&&D.push(M.name)});let j={},q={},_=0;await Promise.all(D.map(async M=>{let W=qr(w,M),K=W.passThroughUA,V=W.ua;K&&(J.info(`\u8BA2\u9605\u5F00\u542F\u4E86\u900F\u4F20 User-Agent, \u4F7F\u7528\u8BF7\u6C42\u7684 User-Agent: ${s}`),V=s);try{J.info(`\u6B63\u5728\u5904\u7406\u5B50\u8BA2\u9605\uFF1A${W.name}...`);let z;if(W.source==="local"&&!["localFirst","remoteFirst"].includes(W.mergeSources))z=W.content;else{let Ee={};if(z=await await Promise.all(W.url.split(/[\r\n]+/).map(we=>we.trim()).filter(we=>we.length).map(async we=>{try{return await Sn(we,V,void 0,E||W.proxy||F.proxy,void 0,void 0,v||W.noCache,!0)}catch(_e){return Ee[we]=_e,J.error(`\u8BA2\u9605 ${W.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${we} \u53D1\u751F\u9519\u8BEF: ${_e}`),""}})),Object.keys(Ee).length>0)if(W.ignoreFailedRemoteSub)W.ignoreFailedRemoteSub==="enabled"&&J.notify("\u{1F30D} Sub-Store \u5904\u7406\u8BA2\u9605\u5931\u8D25",`\u274C ${W.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(Ee).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(Ee).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);W.mergeSources==="localFirst"?z.unshift(W.content):W.mergeSources==="remoteFirst"&&z.push(W.content)}let ne=(Array.isArray(z)?z:[z]).map(Ee=>Gt.parse(Ee)).flat();ne.forEach(Ee=>{Ee._subName=W.name,Ee._subDisplayName=W.displayName,Ee._collectionName=F.name,Ee._collectionDisplayName=F.displayName}),ne=await Gt.process(ne,W.process||[],r,{[W.name]:W,_collection:F,$options:f}),j[M]=ne,_++,J.info(`\u2705 \u5B50\u8BA2\u9605\uFF1A${W.name}\u52A0\u8F7D\u6210\u529F\uFF0C\u8FDB\u5EA6--${100*(_/D.length).toFixed(1)}% `)}catch(z){_++,q[M]=z,J.error(`\u274C \u5904\u7406\u7EC4\u5408\u8BA2\u9605\u4E2D\u7684\u5B50\u8BA2\u9605: ${W.name}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${z}\uFF01\u8FDB\u5EA6--${100*(_/D.length).toFixed(1)}%`)}}));let P=F.ignoreFailedRemoteSub;if(c!=null&&c!==""&&(P=c),Object.keys(q).length>0)if(P)P==="enabled"&&J.notify("\u{1F30D} Sub-Store \u5904\u7406\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C ${F.name}`,`\u5B50\u8BA2\u9605 ${Object.keys(q).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${F.name} \u7684\u5B50\u8BA2\u9605 ${Object.keys(q).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);let k=Array.prototype.concat.apply([],D.map(M=>j[M]||[]));if(k.forEach(M=>{M._collectionName=F.name,M._collectionDisplayName=F.displayName}),k=await Gt.process(k,F.process||[],r,{_collection:F},f),k.length===0)throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${t} \u4E2D\u4E0D\u542B\u6709\u6548\u8282\u70B9`);let U={};for(let M of k){if(U[M.name]){J.notify("\u{1F30D} Sub-Store",`\u26A0\uFE0F \u7EC4\u5408\u8BA2\u9605 ${t} \u5305\u542B\u91CD\u590D\u8282\u70B9 ${M.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}U[M.name]=!0}return Gt.produce(k,r,h,m)}else if(e==="rule"){let w=J.read(Z1),S=qr(w,t);if(!S)throw new Error(`\u627E\u4E0D\u5230\u89C4\u5219 ${t}`);let F=[];for(let D=0;D<S.urls.length;D++){let I=S.urls[D];J.info(`\u6B63\u5728\u5904\u7406URL\uFF1A${I}\uFF0C\u8FDB\u5EA6--${100*((D+1)/S.urls.length).toFixed(1)}% `);try{let{body:j}=await Sn(I),q=Yf.parse(j);F=F.concat(q)}catch(j){J.error(`\u5904\u7406\u5206\u6D41\u8BA2\u9605\u4E2D\u7684URL: ${I}\u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${j}! \u8BE5\u8BA2\u9605\u5DF2\u88AB\u8DF3\u8FC7\u3002`)}}return F=await Yf.process(F,[{type:"Remove Duplicate Filter"}]),Yf.produce(F,r)}else if(e==="file"){let w=J.read(Bu),S=qr(w,t);if(!S)throw new Error(`\u627E\u4E0D\u5230\u6587\u4EF6 ${t}`);let F="";if(S.type!=="mihomoProfile")if(a&&!["localFirst","remoteFirst"].includes(i))F=a;else if(n){let q={};F=await Promise.all(n.split(/[\r\n]+/).map(P=>P.trim()).filter(P=>P.length).map(async P=>{try{return await Sn(P,s||S.ua,void 0,S.proxy||E,void 0,void 0,v)}catch(k){return q[P]=k,J.error(`\u6587\u4EF6 ${S.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${P} \u53D1\u751F\u9519\u8BEF: ${k}`),""}}));let _=S.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(_=l),!_&&Object.keys(q).length>0)throw new Error(`\u6587\u4EF6 ${S.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(q).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);i==="localFirst"?F.unshift(a):i==="remoteFirst"&&F.push(a)}else if(S.source==="local"&&!["localFirst","remoteFirst"].includes(S.mergeSources))F=S.content;else{let q={};F=await Promise.all(S.url.split(/[\r\n]+/).map(P=>P.trim()).filter(P=>P.length).map(async P=>{try{return await Sn(P,s||S.ua,void 0,S.proxy||E,void 0,void 0,v)}catch(k){return q[P]=k,J.error(`\u6587\u4EF6 ${S.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${P} \u53D1\u751F\u9519\u8BEF: ${k}`),""}}));let _=S.ignoreFailedRemoteFile;if(l!=null&&l!==""&&(_=l),Object.keys(q).length>0)if(_)_==="enabled"&&J.notify("\u{1F30D} Sub-Store \u5904\u7406\u6587\u4EF6\u5931\u8D25",`\u274C ${S.name}`,`\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(q).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u6587\u4EF6 ${S.name} \u7684\u8FDC\u7A0B\u6587\u4EF6 ${Object.keys(q).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);S.mergeSources==="localFirst"?F.unshift(S.content):S.mergeSources==="remoteFirst"&&F.push(S.content)}if(h==="raw")return JSON.stringify((Array.isArray(F)?F:[F]).flat());let D=(Array.isArray(F)?F:[F]).flat(),I=D.filter(q=>q!=null&&q!=="").join(`
|
||
`),j=Array.isArray(S.process)&&S.process.length>0?await Gt.process({$files:D,$content:I,$options:f,$file:S},S.process):{$content:I,$files:D,$options:f};return(b?j:j?.$content)??""}}(async function(){let e;typeof $argument<"u"?e=Object.fromEntries($argument.split("&").map(n=>n.split("="))):e={};let t=(e?.subscription??e?.sub??"").split(/,|,/g).map(n=>n.trim()).filter(n=>n.length>0).map(n=>decodeURIComponent(n)),r=(e?.collection??e?.col??"").split(/,|,/g).map(n=>n.trim()).filter(n=>n.length>0).map(n=>decodeURIComponent(n));if(t.length>0||r.length>0)t.length>0&&await wA(t,"subscription"),r.length>0&&await wA(r,"collection");else{let n=J.read(nn);if(!n.githubUser||!n.gistToken)return;let s=J.read(Du);if(!s||s.length===0)return;s.some(i=>i.sync)&&await B7()}})().finally(()=>J.done());async function wA(e,t){try{e.length>0&&(J.info(`produceArtifacts ${t} \u5F00\u59CB: ${e.join(", ")}`),await Promise.all(e.map(async r=>{try{await Mn({type:t,name:r})}catch(n){J.error(`${t} ${r} error: ${n.message??n}`)}})),J.info(`produceArtifacts ${t} \u5B8C\u6210: ${e.join(", ")}`))}catch(r){J.error(`produceArtifacts error: ${r.message??r}`)}}async function B7(){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 Sync -- v${Pl}
|
||
\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
|
||
`),J.info("\u5F00\u59CB\u540C\u6B65\u6240\u6709\u8FDC\u7A0B\u914D\u7F6E...");let e=J.read(Du),t={};try{let r=[],n=[],s=J.read(tc),a=J.read($l),i=[],c=0;if(e.map(m=>{if(m.sync&&m.source){if(c++,m.type==="subscription"){let A=m.source,p=qr(s,A);p&&p.url&&!i.includes(A)&&i.push(A)}else if(m.type==="collection"){let A=qr(a,m.source);A&&Array.isArray(A.subscriptions)&&A.subscriptions.map(p=>{let f=qr(s,p);f&&f.url&&!i.includes(p)&&i.push(p)})}}}),c===0){J.info(`\u9700\u540C\u6B65\u7684\u914D\u7F6E: ${c}, \u603B\u6570: ${e.length}`);return}if(i.length>0&&await Promise.all(i.map(async m=>{try{await Mn({type:"subscription",name:m,awaitCustomCache:!0})}catch{}})),await Promise.all(e.map(async m=>{try{if(m.sync&&m.source){J.info(`\u6B63\u5728\u540C\u6B65\u4E91\u914D\u7F6E\uFF1A${m.name}...`);let A=m.platform==="SurgeMac";A&&J.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External");let p=await Mn({type:m.type,name:m.source,platform:m.platform,produceOpts:{"include-unsupported-proxy":m.includeUnsupportedProxy,useMihomoExternal:A}});t[encodeURIComponent(m.name)]={content:p},r.push(m.name)}}catch(A){J.error(`\u751F\u6210\u540C\u6B65\u914D\u7F6E ${m.name} \u53D1\u751F\u9519\u8BEF: ${A.message??A}`),n.push(m.name)}})),J.info(`${r.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u6210\u529F: ${r.join(", ")}`),J.info(`${n.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u5931\u8D25: ${n.join(", ")}`),r.length===0)throw new Error(`\u540C\u6B65\u914D\u7F6E ${n.join(", ")} \u751F\u6210\u5931\u8D25 \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`);let l=await fd(t),h=JSON.parse(l.body);delete h.history,delete h.forks,delete h.owner,Object.values(h.files).forEach(m=>{delete m.content}),J.info("\u4E0A\u4F20\u914D\u7F6E\u54CD\u5E94:"),J.info(JSON.stringify(h,null,2));for(let m of e)if(m.sync&&m.source&&r.includes(m.name)){m.updated=new Date().getTime();let A=h.files,p;Array.isArray(A)&&(p=!0,A=Object.fromEntries(A.map(v=>[v.path,v])));let f=A[encodeURIComponent(m.name)]?.raw_url,E=p?f:f?.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1");J.info(`\u4E0A\u4F20\u914D\u7F6E\u5B8C\u6210
|
||
\u6587\u4EF6\u5217\u8868: ${Object.keys(A).join(", ")}
|
||
\u5F53\u524D\u6587\u4EF6: ${encodeURIComponent(m.name)}
|
||
\u54CD\u5E94\u8FD4\u56DE\u7684\u539F\u59CB\u94FE\u63A5: ${f}
|
||
\u5904\u7406\u5B8C\u7684\u65B0\u94FE\u63A5: ${E}`),m.url=E}J.write(e,Du),J.info("\u4E0A\u4F20\u914D\u7F6E\u6210\u529F"),n.length>0?J.notify("\u{1F30D} Sub-Store",`\u540C\u6B65\u914D\u7F6E\u6210\u529F ${r.length} \u4E2A, \u5931\u8D25 ${n.length} \u4E2A, \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`):J.notify("\u{1F30D} Sub-Store","\u540C\u6B65\u914D\u7F6E\u5B8C\u6210")}catch(r){J.notify("\u{1F30D} Sub-Store","\u540C\u6B65\u914D\u7F6E\u5931\u8D25",`\u539F\u56E0\uFF1A${r.message??r}`),J.error(`\u65E0\u6CD5\u540C\u6B65\u914D\u7F6E\u5230 Gist\uFF0C\u539F\u56E0\uFF1A${r}`)}}})();
|
||
/*! Bundled license information:
|
||
|
||
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
|
||
*)
|
||
|
||
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
|
||
*)
|
||
*/
|