(function(){'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(m,q,a){m!=Array.prototype&&m!=Object.prototype&&(m[q]=a.value)};$jscomp.getGlobal=function(m){return"undefined"!=typeof window&&window===m?m:"undefined"!=typeof global&&null!=global?global:m};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(m,q,a,c){if(q){a=$jscomp.global;m=m.split(".");for(c=0;ca&&(a=Math.max(a+b,0));a{Sk.abstr.setUpSlots(a);Sk.abstr.setUpMethods(a);Sk.abstr.setUpGetSets(a)});a(19);a(20);a(21);[Sk.builtin.str,Sk.builtin.none,Sk.builtin.NotImplemented,Sk.builtin.object].forEach(a=>{a=a.prototype;a.__doc__=a.hasOwnProperty("tp$doc")?new Sk.builtin.str(a.tp$doc):Sk.builtin.none.none$}); a(22);a(23);a(24);a(25);a(26);a(27);a(28);a(29);a(31);a(32);a(33);a(34);a(35);a(36);a(37);a(38);a(39);a(40);a(41);a(42);a(43);a(44);a(45);a(46);a(47);a(48);a(49);a(50);a(51);a(52);a(53);a(54);a(55);a(56);a(57);a(58);a(59);a(60);a(61);a(62);a(63);a(64);a(65)},function(m,q,a){(function(a){var b={build:{githash:"6c99c2196851bb29f0e503afccb01804f089cb60",date:"2021-02-23T18:59:26.986Z"}};b.global="undefined"!==typeof a?a:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{};b.exportSymbol= function(a,c){a=a.split(".");var e=b.global,f;for(f=0;fd.getHours()?k.am:k.pm;break;case 82:u+=p(k.formats.R,d,k,g);break;case 83:u+=c(d.getSeconds(),C);break;case 84:u+=p(k.formats.T,d,k,g);break;case 85:u+=c(f(d,"sunday"),C);break;case 87:u+=c(f(d,"monday"),C);break;case 88:u+=p(k.formats.X,d,k,g);break;case 89:u+= d.getFullYear();break;case 90:E&&0===B?u+="GMT":(C=d.toString().match(/\(([\w\s]+)\)/),u+=C&&C[1]||"");break;case 97:u+=k.shortDays[d.getDay()];break;case 98:u+=k.shortMonths[d.getMonth()];break;case 99:u+=p(k.formats.c,d,k,g);break;case 100:u+=c(d.getDate(),C);break;case 101:u+=c(d.getDate(),null==C?" ":C);break;case 104:u+=k.shortMonths[d.getMonth()];break;case 106:C=new Date(d.getFullYear(),0,1);C=Math.ceil((d.getTime()-C.getTime())/864E5);u+=b(C);break;case 107:u+=c(d.getHours(),null==C?" ":C); break;case 108:u+=c(e(d.getHours()),null==C?" ":C);break;case 109:u+=c(d.getMonth()+1,C);break;case 110:u+="\n";break;case 111:C=d.getDate();u=k.ordinalSuffixes?u+(String(C)+(k.ordinalSuffixes[C-1]||l(C))):u+(String(C)+l(C));break;case 112:u+=12>d.getHours()?k.AM:k.PM;break;case 114:u+=p(k.formats.r,d,k,g);break;case 115:u+=Math.floor(g/1E3);break;case 116:u+="\t";break;case 117:C=d.getDay();u+=0===C?7:C;break;case 118:u+=p(k.formats.v,d,k,g);break;case 119:u+=d.getDay();break;case 120:u+=p(k.formats.x, d,k,g);break;case 121:u+=(""+d.getFullYear()).slice(2);break;case 122:E&&0===B?u+=N?"+00:00":"+0000":(C=0!==B?B/6E4:-d.getTimezoneOffset(),n=N?":":"",A=Math.abs(C%60),u+=(0>C?"-":"+")+c(Math.floor(Math.abs(C/60)))+n+c(A));break;default:n&&(u+="%"),u+=a[F]}C=null;n=!1}else 37===A?n=!0:u+=a[F]}return u}var y=k||g,B=n||0,E=A||!1,F=0,w,m=function(a,b){if(b){var d=b.getTime();if(E){var c=6E4*(b.getTimezoneOffset()||0);b=new Date(d+c+B);6E4*(b.getTimezoneOffset()||0)!==c&&(b=6E4*(b.getTimezoneOffset()|| 0),b=new Date(d+b+B))}}else d=Date.now(),d>F?(F=d,w=new Date(F),d=F,E&&(w=new Date(F+6E4*(w.getTimezoneOffset()||0)+B))):d=F,b=w;return p(a,b,y,d)};m.localize=function(b){return new a(b||y,B,E)};m.localizeByIdentifier=function(a){var b=d[a];return b?m.localize(b):(h('[WARNING] No locale found with identifier "'+a+'".'),m)};m.timezone=function(b){var d=B,c=E,e=typeof b;if("number"===e||"string"===e)c=!0,"string"===e?(d="-"===b[0]?-1:1,e=parseInt(b.slice(1,3),10),b=parseInt(b.slice(3,5),10),d=d*(60* e+b)*6E4):"number"===e&&(d=6E4*b);return new a(y,d,c)};m.utc=function(){return new a(y,B,!0)};return m}function c(a,b){if(""===b||9=a||0===b||4<=b)return"th";switch(b){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function h(a){"undefined"!==typeof console&&"function"==typeof console.warn&&console.warn(a)}var d={de_DE:{days:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),shortDays:"So Mo Di Mi Do Fr Sa".split(" "),months:"Januar Februar M\u00e4rz April Mai Juni Juli August September Oktober November Dezember".split(" "),shortMonths:"Jan Feb M\u00e4r Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "), AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "), AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "), AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{days:"domingo lunes martes mi\u00e9rcoles jueves viernes s\u00e1bado".split(" "),shortDays:"dom lun mar mi\u00e9 jue vie s\u00e1b".split(" "),months:"enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiembre;octubre;noviembre; diciembre".split(";"),shortMonths:"ene feb mar abr may jun jul ago sep oct nov dic".split(" "),AM:"AM",PM:"PM", am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{days:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),shortDays:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),months:"janvier f\u00e9vrier mars avril mai juin juillet ao\u00fbt septembre octobre novembre d\u00e9cembre".split(" "),shortMonths:"janv. f\u00e9vr. mars avril mai juin juil. ao\u00fbt sept. oct. nov. d\u00e9c.".split(" "),AM:"AM", PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{days:"domenica luned\u00ec marted\u00ec mercoled\u00ec gioved\u00ec venerd\u00ec sabato".split(" "),shortDays:"dom lun mar mer gio ven sab".split(" "),months:"gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre".split(" "),shortMonths:"pr mag giu lug ago set ott nov dic".split(" "),AM:"AM",PM:"PM",am:"am", pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{days:"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),shortDays:"zo ma di wo do vr za".split(" "),months:"januari februari maart april mei juni juli augustus september oktober november december".split(" "),shortMonths:"jan feb mrt apr mei jun jul aug sep okt nov dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z", D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{days:"domingo segunda ter\u00e7a quarta quinta sexta s\u00e1bado".split(" "),shortDays:"Dom Seg Ter Qua Qui Sex S\u00e1b".split(" "),months:"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),shortMonths:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d", R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{days:"\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435 \u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a \u0412\u0442\u043e\u0440\u043d\u0438\u043a \u0421\u0440\u0435\u0434\u0430 \u0427\u0435\u0442\u0432\u0435\u0440\u0433 \u041f\u044f\u0442\u043d\u0438\u0446\u0430 \u0421\u0443\u0431\u0431\u043e\u0442\u0430".split(" "),shortDays:"\u0412\u0441 \u041f\u043d \u0412\u0442 \u0421\u0440 \u0427\u0442 \u041f\u0442 \u0421\u0431".split(" "), months:"\u042f\u043d\u0432\u0430\u0440\u044c \u0424\u0435\u0432\u0440\u0430\u043b\u044c \u041c\u0430\u0440\u0442 \u0410\u043f\u0440\u0435\u043b\u044c \u041c\u0430\u0439 \u0418\u044e\u043d\u044c \u0418\u044e\u043b\u044c \u0410\u0432\u0433\u0443\u0441\u0442 \u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c \u041e\u043a\u0442\u044f\u0431\u0440\u044c \u041d\u043e\u044f\u0431\u0440\u044c \u0414\u0435\u043a\u0430\u0431\u0440\u044c".split(" "),shortMonths:"\u044f\u043d\u0432 \u0444\u0435\u0432 \u043c\u0430\u0440 \u0430\u043f\u0440 \u043c\u0430\u0439 \u0438\u044e\u043d \u0438\u044e\u043b \u0430\u0432\u0433 \u0441\u0435\u043d \u043e\u043a\u0442 \u043d\u043e\u044f \u0434\u0435\u043a".split(" "), AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{days:"Pazar Pazartesi Sal\u0131 \u00c7ar\u015famba Per\u015fembe Cuma Cumartesi".split(" "),shortDays:"Paz Pzt Sal \u00c7r\u015f Pr\u015f Cum Cts".split(" "),months:"Ocak \u015eubat Mart Nisan May\u0131s Haziran Temmuz A\u011fustos Eyl\u00fcl Ekim Kas\u0131m Aral\u0131k".split(" "),shortMonths:"Oca \u015eub Mar Nis May Haz Tem A\u011fu Eyl Eki Kas Ara".split(" "), AM:"\u00d6\u00d6",PM:"\u00d6S",am:"\u00d6\u00d6",pm:"\u00d6S",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{days:"\u661f\u671f\u65e5 \u661f\u671f\u4e00 \u661f\u671f\u4e8c \u661f\u671f\u4e09 \u661f\u671f\u56db \u661f\u671f\u4e94 \u661f\u671f\u516d".split(" "),shortDays:"\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d".split(""),months:"\u4e00\u6708\u4efd \u4e8c\u6708\u4efd \u4e09\u6708\u4efd \u56db\u6708\u4efd \u4e94\u6708\u4efd \u516d\u6708\u4efd \u4e03\u6708\u4efd \u516b\u6708\u4efd \u4e5d\u6708\u4efd \u5341\u6708\u4efd \u5341\u4e00\u6708\u4efd \u5341\u4e8c\u6708\u4efd".split(" "), shortMonths:"\u4e00\u6708 \u4e8c\u6708 \u4e09\u6708 \u56db\u6708 \u4e94\u6708 \u516d\u6708 \u4e03\u6708 \u516b\u6708 \u4e5d\u6708 \u5341\u6708 \u5341\u4e00\u6708 \u5341\u4e8c\u6708".split(" "),AM:"\u4e0a\u5348",PM:"\u4e0b\u5348",am:"\u4e0a\u5348",pm:"\u4e0b\u5348",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},g=d.en_US,n=new a(g,0,!1);if("undefined"!==typeof m)var k=m.exports=n;else k=function(){return this||(0,eval)("this")}(), k.strftime=n;"function"!==typeof Date.now&&(Date.now=function(){return+new Date})})()},function(m,q,a){(function(){var a=function(b,c,f){return a.parse(b,c,f)};a.version="0.0.1";(m.exports=a).strptime=a;a.locale={a:"Sun Mon Tue Wed Thu Fri Sat".split(" "),A:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),b:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),B:"January February March April May June July August September October November December".split(" "),f:"Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec.".split(" "), c:"%Y-%m-%d %H:%M:%S",P:["am","pm"],r:"%I:%M:%S %p",x:"%m/%d/%y",X:"%H:%M:%S",day:["Yesterday","Today","Tomorrow"],bg:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Bg:"January February March April May June July August September October November December".split(" "),fg:"Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec.".split(" "),Date_dBY_year_in_HM:"%#B %-d, %Y at %-H:%M",Date_dBY_year:"%#B %-d, %Y",Date_dBY:"%#B %-d, %Y",Date_AdBY:"%A, %#B %-d, %Y",Date_dBA:"%#B %-d, %A", Date_df_in_HM:"%#f, %-d at %-H:%M",Date_dfY:"%-d %#f %Y",Date_dB_in_HM:"%#B %-d at %-H:%M",Date_df:"%-d %#f"};(function(a){function b(a,c,e,f,h,l){c=String(c);e=String(e);c=c.replace(/^[#_0\^\-!~]+/,"");f=d[c];if(!f)return a;var k=!1;-1===e.indexOf("!")&&1===c.length&&(-1b||99b||31b||31b||23b||12b||12b||59b||60b||99b||12null!==b&&a(b):a=>a instanceof c;c.powermod=(a,b,l)=>{const e=c.BigInt(1);let d=e;for(b=c.greaterThan(b,c.__ZERO)?b:c.unaryMinus(b);c.greaterThan(b,c.__ZERO);)c.bitwiseAnd(b,e)&&(d=c.remainder(c.multiply(d, a),l)),b=c.signedRightShift(b,e),a=c.remainder(c.multiply(a,a),l);return d}}else Object.assign(c,{BigInt:Sk.global.BigInt,toNumber:a=>Number(a),toString:a=>a.toString(),__isBigInt:a=>"bigint"===typeof a,unaryMinus:a=>-a,bitwiseNot:a=>~a,bitwiseAnd:(a,c)=>a&c,bitwiseOr:(a,c)=>a|c,bitwiseXor:(a,c)=>a^c,exponentiate:(a,e)=>{const b=c.BigInt(1);let l=b;for(e=e>c.__ZERO?e:-e;e>c.__ZERO;)e&b&&(l*=a),e>>=b,a*=a;return l},powermod:(a,e,f)=>{const b=c.BigInt(1);let h=b;for(e=e>c.__ZERO?e:-e;e>c.__ZERO;)e& b&&(h=h*a%f),e>>=b,a=a*a%f;return h},multiply:(a,c)=>a*c,divide:(a,c)=>a/c,remainder:(a,c)=>a%c,add:(a,c)=>a+c,subtract:(a,c)=>a-c,leftShift:(a,c)=>a<a>>c,unsignedRightShift:(a,c)=>a>>>c,lessThan:(a,c)=>aa<=c,greaterThan:(a,c)=>a>c,greaterThanOrEqual:(a,c)=>a>=c,equal:(a,c)=>a===c,notEqual:(a,c)=>a!==c});c.__ZERO=c.BigInt(0);c.__MAX_SAFE=c.BigInt(Number.MAX_SAFE_INTEGER);c.__MIN_SAFE=c.BigInt(-Number.MAX_SAFE_INTEGER);c.numberIfSafe=a=>c.lessThan(a, c.__MAX_SAFE)&&c.greaterThan(a,c.__MIN_SAFE)?c.toNumber(a):a},function(m,q,a){(function(a,b){m.exports=b()})(this,function(){function a(b){"@babel/helpers - typeof";return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},a(b)}function b(a,b){for(var d,c=0;ca.length)&&(b=a.length);for(var d=0,c=Array(b);d=a.length?{done:!0}:{done:!1,value:a[c++]}},e:function(a){throw a;},f:b}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }var e,k=!0,f=!1;return{s:function(){d=a[Symbol.iterator]()},n:function(){var a=d.next();return k=a.done,a},e:function(a){f=!0;e=a},f:function(){try{k||null==d.return||d.return()}finally{if(f)throw e;}}}}var t=Math.imul,y=Math.clz32,B=function(b){function d(a,b){var c;if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");if(a>d.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return c=h.call(this,a),c.sign=b,c}var c=Math.abs,g=Math.max;f(d,b);var h=k(d); return e(d,[{key:"toDebugString",value:function(){var a,b=["BigInt["],d=A(this);try{for(d.s();!(a=d.n()).done;){var c=a.value;b.push((c?(c>>>0).toString(16):c)+", ")}}catch(O){d.e(O)}finally{d.f()}return b.push("]"),b.join("")}},{key:"toString",value:function(){var a=0a||36this.length&&(c=this.length);var e= 65535&a;a>>>=16;var k=0,f=65535&b;b>>>=16;for(var g=0;g>>16;h=d.__imul(p,e);p=d.__imul(p,a);var u=d.__imul(l,e);l=d.__imul(l,a);var y=f+(65535&h);h=b+k+(y>>>16)+(h>>>16)+(65535&p)+(65535&u);f=(p>>>16)+(u>>>16)+(65535&l)+(h>>>16);k=f>>>16;f&=65535;b=l>>>16;this.__setDigit(g,65535&y|h<<16)}if(0!==k||0!==f||0!==b)throw Error("implementation bug");}},{key:"__inplaceAdd",value:function(a,b,d){for(var c,e=0,k=0;k>>16,this.__setHalfDigit(b+k,c);return e}},{key:"__inplaceSub",value:function(a,b,d){var c=0;if(1&b){b>>=1;for(var e=this.__digit(b),k=65535&e,f=0;f>>1;f++){var g=a.__digit(f);e=(e>>>16)-(65535&g)-c;c=1&e>>>16;this.__setDigit(b+f,e<<16|65535&k);e=this.__digit(b+f+1);k=(65535&e)-(g>>>16)-c;c=1&k>>>16}g=a.__digit(f);var h=(e>>>16)-(65535&g)-c;c=1&h>>>16;this.__setDigit(b+f,h<<16|65535&k);if(b+f+1>=this.length)throw new RangeError("out of bounds");0==(1&d)&&(e=this.__digit(b+f+1),k=(65535& e)-(g>>>16)-c,c=1&k>>>16,this.__setDigit(b+a.length,4294901760&e|65535&k))}else{b>>=1;for(k=0;k>>16,e=(e>>>16)-(g>>>16)-c,c=1&e>>>16,this.__setDigit(b+k,e<<16|65535&f);f=this.__digit(b+k);a=a.__digit(k);e=(65535&f)-(65535&a)-c;c=1&e>>>16;g=0;0==(1&d)&&(g=(f>>>16)-(a>>>16)-c,c=1&g>>>16);this.__setDigit(b+k,g<<16|65535&e)}return c}},{key:"__inplaceRightShift",value:function(a){if(0!==a){for(var b,d=this.__digit(0)>>>a, c=this.length-1,e=0;e>>a;this.__setDigit(c,d)}}},{key:"__digit",value:function(a){return this[a]}},{key:"__unsignedDigit",value:function(a){return this[a]>>>0}},{key:"__setDigit",value:function(a,b){this[a]=0|b}},{key:"__setDigitGrow",value:function(a,b){this[a]=0|b}},{key:"__halfDigitLength",value:function(){var a=this.length;return 65535>=this.__unsignedDigit(a-1)?2*a-1:2*a}},{key:"__halfDigit",value:function(a){return 65535&this[a>>>1]>>> ((1&a)<<4)}},{key:"__setHalfDigit",value:function(a,b){var d=a>>>1,c=this.__digit(d);this.__setDigit(d,1&a?65535&c|b<<16:4294901760&c|65535&b)}}],[{key:"BigInt",value:function(b){var c=Math.floor,e=Number.isFinite;if("number"==typeof b){if(0===b)return d.__zero();if((0|b)===b)return 0>b?d.__oneDigit(-b,!0):d.__oneDigit(b,!1);if(!e(b)||c(b)!==b)throw new RangeError("The number "+b+" cannot be converted to BigInt because it is not an integer");return d.__fromDouble(b)}if("string"==typeof b){c=d.__fromString(b); if(null===c)throw new SyntaxError("Cannot convert "+b+" to a BigInt");return c}if("boolean"==typeof b)return!0===b?d.__oneDigit(1,!1):d.__zero();if("object"===a(b)){if(b.constructor===d)return b;b=d.__toPrimitive(b);return d.BigInt(b)}throw new TypeError("Cannot convert "+b+" to a BigInt");}},{key:"toNumber",value:function(a){var b=a.length;if(0===b)return 0;if(1===b){var c=a.__unsignedDigit(0);return a.sign?-c:c}var e=a.__digit(b-1),k=d.__clz32(e);c=32*b-k;if(1024>>12;var h=g-12;b=12<=g?0:e<<20+g;g=20+g;0>>32-h,b=e<>>32-g,g-=32);e=d.__decideRounding(a,g,f,e);if((1===e||0===e&&1==(1&b))&&(b=b+1>>>0,0===b&&(k++,0!=k>>>20&&(k=0,c++,1023= d.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===a.length&&2===a.__digit(0)){var c=1+(b>>>5);a=new d(c,a.sign&&0!=(1&b));a.__initializeDigits();return a.__setDigit(c-1,1<<(31&b)),a}c=null;var e=a;0!=(1&b)&&(c=a);for(b>>=1;0!==b;b>>=1)e=d.multiply(e,e),0!=(1&b)&&(null===c?c=e:c=d.multiply(c,e));return c}},{key:"multiply",value:function(a,b){if(0===a.length)return a;if(0===b.length)return b;var c=a.length+b.length;32<=a.__clzmsd()+b.__clzmsd()&&c--;c=new d(c,a.sign!==b.sign);c.__initializeDigits(); for(var e=0;ed.__absoluteCompare(a,b))return d.__zero();var c=a.sign!==b.sign,e=b.__unsignedDigit(0);if(1===b.length&&65535>=e){if(1===e)return c===a.sign?a:d.unaryMinus(a);a=d.__absoluteDivSmall(a,e,null)}else a=d.__absoluteDivLarge(a,b,!0,!1);return a.sign=c,a.__trim()}},{key:"remainder",value:function(a,b){if(0===b.length)throw new RangeError("Division by zero"); if(0>d.__absoluteCompare(a,b))return a;var c=b.__unsignedDigit(0);if(1===b.length&&65535>=c){if(1===c)return d.__zero();b=d.__absoluteModSmall(a,c);return 0===b?d.__zero():d.__oneDigit(b,a.sign)}b=d.__absoluteDivLarge(a,b,!1,!0);return b.sign=a.sign,b.__trim()}},{key:"add",value:function(a,b){var c=a.sign;return c===b.sign?d.__absoluteAdd(a,b,c):0<=d.__absoluteCompare(a,b)?d.__absoluteSub(a,b,c):d.__absoluteSub(b,a,!c)}},{key:"subtract",value:function(a,b){var c=a.sign;return c===b.sign?0<=d.__absoluteCompare(a, b)?d.__absoluteSub(a,b,c):d.__absoluteSub(b,a,!c):d.__absoluteAdd(a,b,c)}},{key:"leftShift",value:function(a,b){return 0===b.length||0===a.length?a:b.sign?d.__rightShiftByAbsolute(a,b):d.__leftShiftByAbsolute(a,b)}},{key:"signedRightShift",value:function(a,b){return 0===b.length||0===a.length?a:b.sign?d.__leftShiftByAbsolute(a,b):d.__rightShiftByAbsolute(a,b)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead");}},{key:"lessThan", value:function(a,b){return 0>d.__compareToBigInt(a,b)}},{key:"lessThanOrEqual",value:function(a,b){return 0>=d.__compareToBigInt(a,b)}},{key:"greaterThan",value:function(a,b){return 0=d.__kMaxLengthBits)return b;var c=a+31>>>5;if(b.lengthd.__kMaxLengthBits)throw new RangeError("BigInt too big");return d.__truncateAndSubFromPowerOfTwo(a,b,!1)}if(a>=d.__kMaxLengthBits)return b;var c=a+31>>>5;if(b.length>> e?d.__truncateToNBits(a,b):b}},{key:"ADD",value:function(a,b){if(a=d.__toPrimitive(a),b=d.__toPrimitive(b),"string"==typeof a)return"string"!=typeof b&&(b=b.toString()),a+b;if("string"==typeof b)return a.toString()+b;if(a=d.__toNumeric(a),b=d.__toNumeric(b),d.__isBigInt(a)&&d.__isBigInt(b))return d.add(a,b);if("number"==typeof a&&"number"==typeof b)return a+b;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions");}},{key:"LT",value:function(a,b){return d.__compare(a,b, 0)}},{key:"LE",value:function(a,b){return d.__compare(a,b,1)}},{key:"GT",value:function(a,b){return d.__compare(a,b,2)}},{key:"GE",value:function(a,b){return d.__compare(a,b,3)}},{key:"EQ",value:function(b,c){for(;;){if(d.__isBigInt(b))return d.__isBigInt(c)?d.equal(b,c):d.EQ(c,b);if("number"==typeof b){if(d.__isBigInt(c))return d.__equalToNumber(c,b);if("object"!==a(c))return b==c;c=d.__toPrimitive(c)}else if("string"==typeof b){if(d.__isBigInt(c))return b=d.__fromString(b),null!==b&&d.equal(b,c); if("object"!==a(c))return b==c;c=d.__toPrimitive(c)}else if("boolean"==typeof b){if(d.__isBigInt(c))return d.__equalToNumber(c,+b);if("object"!==a(c))return b==c;c=d.__toPrimitive(c)}else if("symbol"===a(b)){if(d.__isBigInt(c))return!1;if("object"!==a(c))return b==c;c=d.__toPrimitive(c)}else if("object"===a(b)){if("object"===a(c)&&c.constructor!==d)return b==c;b=d.__toPrimitive(b)}else return b==c}}},{key:"NE",value:function(a,b){return!d.EQ(a,b)}},{key:"__zero",value:function(){return new d(0,!1)}}, {key:"__oneDigit",value:function(a,b){b=new d(1,b);return b.__setDigit(0,a),b}},{key:"__decideRounding",value:function(a,b,d,c){if(0b)b=-b-1;else{if(0===d)return-1;d--;c=a.__digit(d);b=31}b=1<>>20)-1023;var c=(b>>>5)+1;a=new d(c,0>a);var e=1048575&d.__kBitConversionInts[1]|1048576, k=d.__kBitConversionInts[0];b&=31;if(20>b){var f=20-b;var g=f+32;b=e>>>f;e=e<<32-f|k>>>f;k<<=32-f}else 20===b?(g=32,b=e,e=k):(f=b-20,g=32-f,b=e<>>32-f,e=k<=a&&9<=a)||(159>=a?32==a:131071>=a?160==a||5760==a:196607>=a?(a&=131071,10>=a||40==a||41==a||47==a||95==a||4096==a):65279==a)}},{key:"__fromString",value:function(a){var b=11073741824/h)return null;g=new d((h*g+p>>>d.__kBitsPerCharTableShift)+31>>>5,!1);var l=10>b?b:10,y=10>=d.__kBitsPerCharTableShift;var B=[],n=[],A= !1;do{for(var w,E=p=0;;){if(f-48>>>0>>0>>0>>0>>d.__kBitsPerCharTableShift+5)}while(!B)}if(k!==e){if(!d.__isWhitespace(f))return null;for(k++;k>>h-k)}if(0!==e){if(c>=a.length)throw Error("implementation bug");a.__setDigit(c++,e)}for(;c< a.length;c++)a.__setDigit(c,0)}},{key:"__toStringBasePowerOfTwo",value:function(a,b){var c=a.length,e=b-1;e=(85&e>>>1)+(85&e);e=(51&e>>>2)+(51&e);e=(15&e>>>4)+(15&e);--b;var k=a.__digit(c-1),f=d.__clz32(k),g=0|(32*c-f+e-1)/e;if(a.sign&&g++,268435456>>p;for(p=32-p;p>=e;)f[g--]=d.__kConversionChars[h&b],h>>>=e,p-=e}f[g--]=d.__kConversionChars[(h|k<< p)&b];for(h=k>>>e-p;0!==h;)f[g--]=d.__kConversionChars[h&b],h>>>=e;if(a.sign&&(f[g--]="-"),-1!==g)throw Error("implementation bug");return f.join("")}},{key:"__toStringGeneric",value:function(a,b,c){var e=a.length;if(0===e)return"";if(1===e)return b=a.__unsignedDigit(0).toString(b),!1===c&&a.sign&&(b="-"+b),b;var k=32*e-d.__clz32(a.__digit(e-1));e=d.__kMaxBitsPerChar[b]-1;k*=d.__kBitsPerCharTableMultiplier;e=(0|(k+(e-1))/e)+1>>1;k=d.exponentiate(d.__oneDigit(b,!1),d.__oneDigit(e,!1));var f=k.__unsignedDigit(0); if(1===k.length&&65535>=f){k=new d(a.length,!1);k.__initializeDigits();var g=0;for(var h=2*a.length-1;0<=h;h--)g=g<<16|a.__halfDigit(h),k.__setHalfDigit(h,0|g/f),g=0|g%f;f=g.toString(b)}else f=d.__absoluteDivLarge(a,k,!0,!0),k=f.quotient,f=f.remainder.__trim(),f=d.__toStringGeneric(f,b,!0);k.__trim();for(b=d.__toStringGeneric(k,b,!0);f.lengtha?d.__absoluteLess(c):0}},{key:"__compareToNumber",value:function(a,b){if(1|b){var e=a.sign,k=0>b;if(e!==k)return d.__unequalSign(e);if(0===a.length){if(k)throw Error("implementation bug");return 0===b?0:-1}if(1b?d.__absoluteGreater(e):ab)return d.__unequalSign(c);if(0===b)throw Error("implementation bug: should be handled elsewhere");if(0===a.length)return-1;d.__kBitConversionDouble[0]=b;b=2047&d.__kBitConversionInts[1]>>>20;if(2047==b)throw Error("implementation bug: handled elsewhere");var e=b-1023;if(0>e)return d.__absoluteGreater(c); b=a.length;var k=a.__digit(b-1),f=d.__clz32(k),g=32*b-f;e+=1;if(ge)return d.__absoluteGreater(c);e=1048576|1048575&d.__kBitConversionInts[1];var h=d.__kBitConversionInts[0];f=31-f;if(f!==(g-1)%31)throw Error("implementation bug");if(20>f){var p=20-f;f=p+32;g=e>>>p;e=e<<32-p|h>>>p;h<<=32-p}else 20===f?(f=32,g=e,e=h):(p=f-20,f=32-p,g=e<>>32-p,e=h<>>=0,g>>>=0,k>g)return d.__absoluteGreater(c);if(k>>0,e=h,h=0):g=0;k=a.__unsignedDigit(b);if(k>g)return d.__absoluteGreater(c);if(kb&&a.__unsignedDigit(0)===c(b):0===d.__compareToDouble(a,b)}},{key:"__comparisonResultToBool",value:function(a,b){switch(b){case 0:return 0>a;case 1:return 0>=a;case 2:return 0b;case 3:return a>=b}if(d.__isBigInt(a)&&"string"==typeof b)return b=d.__fromString(b),null!==b&&d.__comparisonResultToBool(d.__compareToBigInt(a,b),c);if("string"==typeof a&&d.__isBigInt(b))return a=d.__fromString(a),null!==a&&d.__comparisonResultToBool(d.__compareToBigInt(a,b),c); if(a=d.__toNumeric(a),b=d.__toNumeric(b),d.__isBigInt(a)){if(d.__isBigInt(b))return d.__comparisonResultToBool(d.__compareToBigInt(a,b),c);if("number"!=typeof b)throw Error("implementation bug");return d.__comparisonResultToBool(d.__compareToNumber(a,b),c)}if("number"!=typeof a)throw Error("implementation bug");if(d.__isBigInt(b))return d.__comparisonResultToBool(d.__compareToNumber(b,a),2^c);if("number"!=typeof b)throw Error("implementation bug");return 0===c?ab:3===c?a>=b: void 0}},{key:"__absoluteAdd",value:function(a,b,c){if(a.length>>16)+(f>>>16)+(h>>>16);e=f>>>16;c.__setDigit(k,65535&h|f<<16)}for(;k>>16)+(b>>>16),e=h>>> 16,c.__setDigit(k,65535&b|h<<16);return k>>16;f=(f>>>16)-(g>>>16)-e;e=1&f>>>16;c.__setDigit(k,65535&h|f<<16)}for(;k>>16,h=(h>>>16)-e,e=1&h>>>16,c.__setDigit(k,65535&b|h<<16); return c.__trim()}},{key:"__absoluteAddOne",value:function(a,b){var c=2d?0:a.__unsignedDigit(d)> b.__unsignedDigit(d)?1:-1}},{key:"__multiplyAccumulate",value:function(a,b,c,e){if(0!==b){for(var k=65535&b,f=b>>>16,g=b=0,h=0,p=0;p>>=16;var B=a.__digit(p),n=65535&B,A=B>>>16;B=d.__imul(n,k);n=d.__imul(n,f);var u=d.__imul(A,k);A=d.__imul(A,f);y+=g+(65535&B);l+=h+b+(y>>>16)+(B>>>16)+(65535&n)+(65535&u);b=l>>>16;g=(n>>>16)+(u>>>16)+(65535&A)+b;b=g>>>16;g&=65535;h=A>>>16;l=65535&y|l<<16;c.__setDigit(e,l)}for(;0!==b||0!==g||0!==h;e++)k=c.__digit(e),a= (65535&k)+g,k=(k>>>16)+(a>>>16)+h+b,h=g=0,b=k>>>16,k=65535&a|k<<16,c.__setDigit(e,k)}}},{key:"__internalMultiplyAdd",value:function(a,b,c,e,k){for(var f=0,g=0;g>>16;f=d.__imul(h>>>16,b);p=(65535&f)+(p>>>16)+c;c=p>>>16;f>>>=16;k.__setDigit(g,p<<16|65535&l)}if(k.length>e)for(k.__setDigit(e++,c+f);e>>0;var f=0|e/b;e=0|e%b;e=(e<<16|a.__halfDigit(k-1))>>>0;var g=0|e/b;e=0|e%b;c.__setDigit(k>>>1,f<<16|g)}return c}},{key:"__absoluteModSmall",value:function(a,b){var d=0;for(var c=2*a.length-1;0<=c;c--)d=(d<<16|a.__halfDigit(c))>>>0,d=0|d%b;return d}},{key:"__absoluteDivLarge",value:function(a,b,c,e){var k=b.__halfDigitLength(),f=b.length,g=a.__halfDigitLength()-k,h=null;c&&(h=new d(g+2>>>1,!1),h.__initializeDigits()); var p=new d(k+2>>>1,!1);p.__initializeDigits();var l=d.__clz16(b.__halfDigit(k-1));0>>0;n=0|A/y;A=0|A%y;for(var u=b.__halfDigit(k-2),w=a.__halfDigit(g+k-2);d.__imul(n,u)>>>0>(A<<16|w)>>>0&&(n--,A+=y,!(65535>>1,B|n))}return e?(a.__inplaceRightShift(l),c?{quotient:h,remainder:a}:a):c?h:void 0}},{key:"__clz16",value:function(a){return d.__clz32(a)-16}},{key:"__specialLeftShift",value:function(a,b,c){var e=a.length,k=new d(e+c,!1);if(0===b){for(b=0;b>>32-b;return 0c)throw new RangeError("BigInt too big");b=c>>>5;var e=31&c,k=a.length,f=0!==e&&0!=a.__digit(k-1)>>>32-e,g=k+b+(f?1:0);c=new d(g,a.sign);if(0===e){for(e=0;e>>32-e;if(f)c.__setDigit(k+b,g);else if(0!==g)throw Error("implementation bug");}return c.__trim()}},{key:"__rightShiftByAbsolute", value:function(a,b){var c=a.length,e=a.sign,k=d.__toShiftAmount(b);if(0>k)return d.__rightShiftByMaximum(e);b=k>>>5;var f=31&k,g=c-b;if(0>=g)return d.__rightShiftByMaximum(e);k=!1;if(e)if(0!=(a.__digit(b)&(1<>>f;h=c-b-1;for(var p=0;p>>f;e.__setDigit(h,g)}return k&& (e=d.__absoluteAddOne(e,!0,e)),e.__trim()}},{key:"__rightShiftByMaximum",value:function(a){return a?d.__oneDigit(1,!0):d.__zero()}},{key:"__toShiftAmount",value:function(a){if(1d.__kMaxLengthBits?-1:a}},{key:"__toPrimitive",value:function(b){var c=1>>5,e=new d(c,b.sign);--c;for(var k=0;k>> a);return e.__setDigit(c,b),e.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(a,b,c){var e=Math.min,k=a+31>>>5;c=new d(k,c);var f=0;--k;var g=0;for(e=e(k,b.length);f>>16;h=-(h>>>16)-g;g=1&h>>>16;c.__setDigit(f,65535&p|h<<16)}for(;f>>16)-(1&g>>>16)<<16):(a=32-a,b=b<>>a,a=1<<32-a,g=(65535&a)-(65535&b)-g,g=(65535&g|(a>>>16)-(b>>>16)-(1&g>>> 16)<<16)&a-1);return c.__setDigit(k,g),c.__trim()}},{key:"__digitPow",value:function(a,b){for(var d=1;0>>=1,a*=a;return d}}]),d}(n(Array));return B.__kMaxLength=33554432,B.__kMaxLengthBits=B.__kMaxLength<<5,B.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],B.__kBitsPerCharTableShift=5,B.__kBitsPerCharTableMultiplier=1<>>0)/b)},B.__imul=t||function(a,b){return 0|a*b},B})},function(m,q,a){(function(a,b){(function(a,c){function e(a){delete t[a]}function f(a){if(y)setTimeout(f,0,a);else{var b=t[a];if(b){y=!0;try{var d=b.callback,k=b.args;switch(k.length){case 0:d(); break;case 1:d(k[0]);break;case 2:d(k[0],k[1]);break;case 3:d(k[0],k[1],k[2]);break;default:d.apply(c,k)}}finally{e(a),y=!1}}}}function d(){E=function(a){b.nextTick(function(){f(a)})}}function g(){if(a.postMessage&&!a.importScripts){var b=!0,d=a.onmessage;a.onmessage=function(){b=!1};a.postMessage("","*");a.onmessage=d;return b}}function n(){var b="setImmediate$"+Math.random()+"$",d=function(d){d.source===a&&"string"===typeof d.data&&0===d.data.indexOf(b)&&f(+d.data.slice(b.length))};a.addEventListener? a.addEventListener("message",d,!1):a.attachEvent("onmessage",d);E=function(d){a.postMessage(b+d,"*")}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){f(a.data)};E=function(b){a.port2.postMessage(b)}}function p(){var a=B.documentElement;E=function(b){var d=B.createElement("script");d.onreadystatechange=function(){f(b);d.onreadystatechange=null;a.removeChild(d);d=null};a.appendChild(d)}}function w(){E=function(a){setTimeout(f,0,a)}}if(!a.setImmediate){var A=1,t={},y=!1,B=a.document, E,F=Object.getPrototypeOf&&Object.getPrototypeOf(a);F=F&&F.setTimeout?F:a;"[object process]"==={}.toString.call(a.process)?d():g()?n():a.MessageChannel?k():B&&"onreadystatechange"in B.createElement("script")?p():w();F.setImmediate=function(a){"function"!==typeof a&&(a=new Function(""+a));for(var b=Array(arguments.length-1),d=0;d the object's type\ntype(name, bases, dict) -> a new type",tp$call:function(a,b){if(this===Sk.builtin.type){if(1===a.length&&(void 0===b||!b.length))return a[0].ob$type;if(3!==a.length)throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments"); }let d=this.prototype.tp$new(a,b);if(d.$isSuspension)return Sk.misceval.chain(d,c=>{d=c;if(d.ob$type.$isSubType(this))return d.tp$init(a,b)},()=>d);if(d.ob$type.$isSubType(this)){const c=d.tp$init(a,b);return void 0!==c&&c.$isSuspension?Sk.misceval.chain(c,()=>d):d}return d},tp$new:function(a,c){if(3!==a.length){if(1===a.length&&(void 0===c||!c.length))return a[0].ob$type;throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments");}let d;c=a[0];d=a[1];a=a[2];if("dict"!==a.tp$name)throw new Sk.builtin.TypeError("type() argument 3 must be dict, not "+ Sk.abstr.typeName(a));if(!Sk.builtin.checkString(c))throw new Sk.builtin.TypeError("type() argument 1 must be str, not "+Sk.abstr.typeName(c));c=c.$jsstr();if("tuple"!==d.tp$name)throw new Sk.builtin.TypeError("type() argument 2 must be tuple, not "+Sk.abstr.typeName(d));d=d.sk$asarray();const e=function(){this.$d=new Sk.builtin.dict};b(c,e,d,this.constructor);Sk.globals&&(e.prototype.__module__=Sk.globals.__name__);e.prototype.__doc__=Sk.builtin.none.none$;void 0===e.$typeLookup(Sk.builtin.str.$dict)&& (e.prototype.__dict__=new Sk.builtin.getset_descriptor(e,h));a.$items().forEach(([a,b])=>{e.prototype[a.$mangled]=b});e.prototype.hasOwnProperty("__new__")&&(a=e.prototype.__new__,a instanceof Sk.builtin.func&&(e.prototype.__new__=new Sk.builtin.staticmethod(a)));e.$allocateSlots();return e},tp$getattr:function(a,b){var d=this.ob$type;const c=d.$typeLookup(a);let e;if(void 0!==c&&(e=c.tp$descr_get,void 0!==e&&void 0!==c.tp$descr_set))return b=e.call(c,this,d,b);a=this.$typeLookup(a);if(void 0!==a)return d= a.tp$descr_get,void 0!==d?b=d.call(a,null,this,b):a;if(void 0!==e)return b=e.call(c,this,d,b);if(void 0!==c)return c},tp$setattr:function(a,b,c){if(!this.sk$klass){if(void 0!==b)throw new Sk.builtin.TypeError("can't set attributes of built-in/extension type '"+this.prototype.tp$name+"'");throw new Sk.builtin.TypeError("can't delete attributes on type object '"+this.prototype.tp$name+"'");}const d=this.ob$type.$typeLookup(a);if(void 0!==d){const a=d.tp$descr_set;if(a)return a.call(d,this,b,c)}c=a.$mangled; if(void 0===b)if(b=this.prototype,b.hasOwnProperty(c))delete b[c],a=Sk.dunderToSkulpt[c],void 0!==a&&(delete this.prototype[a],b.sk$prototypical||this.$allocateGetterSlot(c));else throw new Sk.builtin.AttributeError("type object '"+this.prototype.tp$name+"' has no attribute '"+a.$jsstr()+"'");else this.prototype[c]=b,c in Sk.dunderToSkulpt&&this.$allocateSlot(c,b)},$r:function(){let a=this.prototype.__module__,b="",c="class";a&&Sk.builtin.checkString(a)?b=a.v+".":a=null;a||this.sk$klass||Sk.__future__.class_repr|| (c="type");return new Sk.builtin.str("<"+c+" '"+b+this.prototype.tp$name+"'>")}},writable:!0},tp$methods:{value:null,writable:!0},tp$getsets:{value:null,writable:!0},sk$type:{value:!0},$isSubType:{value:function(a){return this===a||this.prototype instanceof a||!this.prototype.sk$prototypical&&this.prototype.tp$mro.includes(a)}},$allocateSlot:{value:function(a,b){a=Sk.slots[a];const c=a.$slot_name,d=this.prototype;d.hasOwnProperty(c)&&delete d[c];d[c]=a.$slot_func(b)}},$allocateSlots:{value:function(){const a= this.prototype;this.prototype.sk$prototypical?Object.keys(a).forEach(b=>{b in Sk.slots&&this.$allocateSlot(b,a[b])}):Object.keys(Sk.slots).forEach(b=>{a.hasOwnProperty(b)?this.$allocateSlot(b,a[b]):this.$allocateGetterSlot(b)})}},$allocateGetterSlot:{value:function(a){const b=Sk.slots[a].$slot_name,c=this.prototype;c.hasOwnProperty(b)||Object.defineProperty(c,b,{configurable:!0,get(){const a=c.tp$mro;for(let c=1;ca.length)throw a= b.tp$name,new Sk.builtin.TypeError(a+".__new__(): not enough arguments");var e=a.shift();if(void 0===e.sk$type)throw a=b.tp$name,new Sk.builtin.TypeError(a+"__new__(X): X is not a type object ("+Sk.abstr.typeName(e)+")");if(!e.$isSubType(this))throw a=b.tp$name,e=e.prototype.tp$name,new Sk.builtin.TypeError(a+".__new__("+e+"): "+e+" is not a subtype of "+a);const f=e.prototype.sk$staticNew.prototype;if(f.tp$new!==b.tp$new)throw a=b.tp$name,e=e.prototype.tp$name,new Sk.builtin.TypeError(a+".__new__("+ e+") is not safe, use "+f.tp$name+".__new__()");return b.tp$new.call(e.prototype,a,c)},$flags:{FastCall:!0},$textsig:"($type, *args, **kwargs)",$name:"__new__"};Sk.generic.selfIter=function(){return this};Sk.generic.iterNextWithArrayCheckSize=function(){if(this.$seq.length!==this.$orig.get$size()){const a=this.tp$name.split("_")[0];throw new Sk.builtin.RuntimeError(a+" changed size during iteration");}if(!(this.$index>=this.$seq.length))return this.$seq[this.$index++]};Sk.generic.iterNextWithArray= function(){const a=this.$seq[this.$index++];void 0===a&&(this.tp$iternext=()=>{});return a};Sk.generic.iterLengthHintWithArrayMethodDef={$meth:function(){return new Sk.builtin.int_(this.$seq.length-this.$index)},$flags:{NoArgs:!0}};Sk.generic.iterReverseLengthHintMethodDef={$meth:function(){return new Sk.builtin.int_(this.$index)},$flags:{NoArgs:!0}};Sk.generic.getSetDict={$get(){return this.$d},$set(a){if(void 0===a)this.$d=new Sk.builtin.dict;else if(a instanceof Sk.builtin.dict)this.$d=a;else throw new Sk.builtin.TypeError("__dict__ must be set to a dictionary, not a '"+ Sk.abstr.typeName(a)+"'");},$doc:"dictionary for instance variables (if defined)",$name:"__dict__"};Sk.generic.seqCompare=function(a,c){if(this===a&&Sk.misceval.opAllowsEquality(c))return!0;if(!(a instanceof this.sk$builtinBase))return Sk.builtin.NotImplemented.NotImplemented$;const b=this.v;a=a.v;let e;if(b.length!==a.length&&("Eq"===c||"NotEq"===c))return"Eq"===c?!1:!0;for(e=0;e= f||e>=l)switch(c){case "Lt":return fl;case "GtE":return f>=l;default:Sk.asserts.fail()}return"Eq"===c?!1:"NotEq"===c?!0:Sk.misceval.richCompareBool(b[e],a[e],c)}},function(m,q){Sk.builtin.pyCheckArgs=function(a,c,b,e,f,l){c=c.length;void 0===e&&(e=Infinity);f&&--c;l&&--c;if(ce)throw new Sk.builtin.TypeError((b===e?a+"() takes exactly "+b+" arguments":ce)throw new Sk.builtin.TypeError((b===e?a+"() takes exactly "+b+" arguments":c{a[c]=function(a){return this.tp$richcompare(a,b)}})}function l(a){const b=Sk.reflectedNumberSlots; Object.keys(b).forEach(c=>{if(void 0!==a[c]){const d=b[c],e=d.reflected,f=a[e];void 0!==f?null===f&&delete a[e]:a[e]=d.slot||a[c]}})}function h(a){const b=Sk.sequenceAndMappingSlots;Object.keys(b).forEach(c=>{void 0!==a[c]&&b[c].forEach(b=>{a[b]=a[c]})})}Sk.abstr={};Sk.abstr.typeName=function(a){return null!=a&&void 0!==a.tp$name?a.tp$name:""};const d={Add:"+",Sub:"-",Mult:"*",MatMult:"@",Div:"/",FloorDiv:"//",Mod:"%",DivMod:"divmod()",Pow:"** or pow()",LShift:"<<",RShift:">>",BitAnd:"&", BitXor:"^",BitOr:"|"},g={UAdd:"+",USub:"-",Invert:"~"};Sk.abstr.numberBinOp=function(a,b,c){var f;if(!(f=e(a,b,c)))throw a=Sk.abstr.typeName(a),b=Sk.abstr.typeName(b),new Sk.builtin.TypeError("unsupported operand type(s) for "+d[c]+": '"+a+"' and '"+b+"'");return f};Sk.exportSymbol("Sk.abstr.numberBinOp",Sk.abstr.numberBinOp);Sk.abstr.numberInplaceBinOp=function(a,c,f){a:{var k=b(a,f);if(void 0!==k&&(k=k.call(a,c),k!==Sk.builtin.NotImplemented.NotImplemented$))break a;k=e(a,c,f)}if(!k)throw a=Sk.abstr.typeName(a), c=Sk.abstr.typeName(c),new Sk.builtin.TypeError("unsupported operand type(s) for "+d[f]+"=: '"+a+"' and '"+c+"'");return k};Sk.exportSymbol("Sk.abstr.numberInplaceBinOp",Sk.abstr.numberInplaceBinOp);Sk.abstr.numberUnaryOp=function(a,b){if("Not"===b)return Sk.misceval.isTrue(a)?Sk.builtin.bool.false$:Sk.builtin.bool.true$;b:{switch(b){case "USub":var c=a.nb$negative;break b;case "UAdd":c=a.nb$positive;break b;case "Invert":c=a.nb$invert;break b}c=void 0}c=void 0!==c?c.call(a):void 0;if(!c)throw a= Sk.abstr.typeName(a),new Sk.builtin.TypeError("bad operand type for unary "+g[b]+": '"+a+"'");return c};Sk.exportSymbol("Sk.abstr.numberUnaryOp",Sk.abstr.numberUnaryOp);Sk.abstr.fixSeqIndex_=function(a,b){b=Sk.builtin.asnum$(b);0>b&&a.sq$length&&(b+=a.sq$length());return b};Sk.abstr.sequenceContains=function(a,b,c){if(a.sq$contains)return a.sq$contains(b,c);a=Sk.misceval.iterFor(Sk.abstr.iter(a),function(a){return a===b||Sk.misceval.richCompareBool(a,b,"Eq")?new Sk.misceval.Break(!0):!1},!1);return c? a:Sk.misceval.retryOptionalSuspensionOrThrow(a)};Sk.abstr.sequenceConcat=function(a,b){if(a.sq$concat)return a.sq$concat(b);throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(a)+"' object can't be concatenated");};Sk.abstr.sequenceGetIndexOf=function(a,b){if(a.index)return Sk.misceval.callsimArray(a.index,[a,b]);let c=0;for(let d=Sk.abstr.iter(a),e=d.tp$iternext();void 0!==e;e=d.tp$iternext()){if(Sk.misceval.richCompareBool(b,e,"Eq"))return new Sk.builtin.int_(c);c+=1}throw new Sk.builtin.ValueError("sequence.index(x): x not in sequence"); };Sk.abstr.sequenceGetCountOf=function(a,b){if(a.count)return Sk.misceval.callsimArray(a.count,[a,b]);let c=0;for(let d=Sk.abstr.iter(a),e=d.tp$iternext();void 0!==e;e=d.tp$iternext())Sk.misceval.richCompareBool(b,e,"Eq")&&(c+=1);return new Sk.builtin.int_(c)};Sk.abstr.sequenceGetItem=function(a,b,c){"number"===typeof b&&(b=new Sk.builtin.int_(b));return Sk.abstr.objectGetItem(a,b,c)};Sk.abstr.sequenceSetItem=function(a,b,c,d){"number"===typeof b&&(b=new Sk.builtin.int_(b));return Sk.abstr.objectSetItem(a, b,c,d)};Sk.abstr.sequenceDelItem=function(a,b,c){return Sk.abstr.objectDelItem(a,b,c)};Sk.abstr.sequenceGetSlice=function(a,b,c){return Sk.abstr.objectGetItem(a,new Sk.builtin.slice(b,c))};Sk.abstr.sequenceDelSlice=function(a,b,c){return Sk.abstr.objectDelItem(a,new Sk.builtin.slice(b,c))};Sk.abstr.sequenceSetSlice=function(a,b,c,d){return Sk.abstr.objectSetItem(a,new Sk.builtin.slice(b,c))};Sk.abstr.sequenceUnpack=function(a,b,c,d){if(!Sk.builtin.checkIterable(a))throw new Sk.builtin.TypeError("cannot unpack non-iterable "+ Sk.abstr.typeName(a)+" object");const e=Sk.abstr.iter(a),f=[];let k=0,g;0{f.push(a);if(++k===b)return new Sk.misceval.Break}));return Sk.misceval.chain(g,()=>{if(f.length{if(void 0!==a)throw new Sk.builtin.ValueError("too many values to unpack (expected "+b+")");return f});const a=[];return Sk.misceval.chain(Sk.misceval.iterFor(e, b=>{a.push(b)}),()=>{const d=a.length+b-c;if(0>d)throw new Sk.builtin.ValueError("not enough values to unpack (expected at least "+c+", got "+(c+d)+")");f.push(new Sk.builtin.list(a.slice(0,d)));f.push(...a.slice(d));return f})})};Sk.abstr.mappingUnpackIntoKeywordArray=function(a,b,c){if(b instanceof Sk.builtin.dict)b.$items().forEach(([b,d])=>{if(!Sk.builtin.checkString(b))throw new Sk.builtin.TypeError((c.$qualname?c.$qualname+"() ":"")+"keywords must be strings");a.push(b.v);a.push(d)});else{var d= Sk.abstr.lookupSpecial(b,Sk.builtin.str.$keys);if(void 0===d)throw new Sk.builtin.TypeError("Object is not a mapping");return Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(d),d=>Sk.misceval.iterFor(Sk.abstr.iter(d),d=>{if(!Sk.builtin.checkString(d))throw new Sk.builtin.TypeError((c.$qualname?c.$qualname+"() ":"")+"keywords must be strings");return Sk.misceval.chain(b.mp$subscript(d,!0),b=>{a.push(d.v);a.push(b)})}))}};Sk.abstr.copyKeywordsToNamedArgs=function(a,b,c,d,e){d=d||[];var f=c.length+ d.length/2;if(f>b.length)throw new Sk.builtin.TypeError(a+"() expected at most "+b.length+" arguments ("+f+" given)");if(d.length||void 0!==e){if(f===b.length&&!d.length)return c;if(0===f&&b.length===(e&&e.length))return e}else return c;c=c.slice(0);for(f=0;fvoid 0===c[b]);if(b.length)throw new Sk.builtin.TypeError(a+"() missing "+b.length+" required positional arguments: "+b.join(", "));}return c};Sk.exportSymbol("Sk.abstr.copyKeywordsToNamedArgs",Sk.abstr.copyKeywordsToNamedArgs);Sk.abstr.checkNoKwargs=function(a,b){if(b&&b.length)throw new Sk.builtin.TypeError(a+"() takes no keyword arguments");};Sk.exportSymbol("Sk.abstr.checkNoKwargs",Sk.abstr.checkNoKwargs); Sk.abstr.checkNoArgs=function(a,b,c){if(b=b.length+(c?c.length:0))throw new Sk.builtin.TypeError(a+"() takes no arguments ("+b+" given)");};Sk.exportSymbol("Sk.abstr.checkNoArgs",Sk.abstr.checkNoArgs);Sk.abstr.checkOneArg=function(a,b,c){Sk.abstr.checkNoKwargs(a,c);if(1!==b.length)throw new Sk.builtin.TypeError(a+"() takes exactly one argument ("+b.length+" given)");};Sk.exportSymbol("Sk.abstr.checkOneArg",Sk.abstr.checkOneArg);Sk.abstr.checkArgsLen=function(a,b,c,d){b=b.length;void 0===d&&(d=Infinity); if(bd)throw new Sk.builtin.TypeError((c===d?a+"() takes exactly "+c+" arguments":b{d.$name=b;c[b]=new Sk.builtin.getset_descriptor(a,d)});Object.defineProperty(c,"tp$getsets",{value:null,writable:!0})}};Sk.abstr.setUpMethods=function(a,b){if(void 0!==Sk.builtin.method_descriptor){var c=a.prototype;b=b||c.tp$methods||{};Object.entries(b).forEach(([b,d])=>{d.$name=b;c[b]=new Sk.builtin.method_descriptor(a,d)});Object.defineProperty(c,"tp$methods",{value:null,writable:!0})}};Sk.abstr.setUpClassMethods=function(a,b){if(void 0!==Sk.builtin.classmethod_descriptor){var c= a.prototype;b=b||c.tp$classmethods||{};Object.entries(b).forEach(([b,d])=>{d.$name=b;c[b]=new Sk.builtin.classmethod_descriptor(a,d)});Object.defineProperty(c,"tp$classmethods",{value:null,writable:!0})}};const n=Object.entries({Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"});Sk.abstr.setUpSlots=function(a,b){function c(b,c){e[b]=new Sk.builtin.wrapper_descriptor(a,Sk.slots[b],c)}function d(a,b){"string"===typeof a?c(a,b):a.forEach(a=>{c(a,b)})}if(void 0!==Sk.builtin.wrapper_descriptor){var e= a.prototype;b=b||e.tp$slots||{};b.tp$new===Sk.generic.new&&(b.tp$new=Sk.generic.new(a));b.tp$richcompare&&f(b);b.tp$as_number&&l(b);b.tp$as_sequence_or_mapping&&h(b);Object.entries(b).forEach(([a,b])=>{Object.defineProperty(e,a,{value:b,writable:!0})});b.tp$new&&(e.__new__=new Sk.builtin.sk_method(Sk.generic.newMethodDef,a),Object.defineProperty(e,"sk$staticNew",{value:a,writable:!0}));Sk.subSlots.main_slots.forEach(([a,c])=>{a=b[a];void 0!==a&&d(c,a)});var g=b.tp$hash;void 0!==g&&("function"===typeof g? c("__hash__",g):g===Sk.builtin.none.none$?e.__hash__=g:Sk.asserts.fail("invalid tp$hash"));b.tp$as_number&&Sk.subSlots.number_slots.forEach(([a,c])=>{a=b[a];void 0!==a&&d(c,a)});b.tp$as_sequence_or_mapping&&Sk.subSlots.sequence_and_mapping_slots.forEach(([a,c])=>{a=b[a];void 0!==a&&d(c,a)});Object.defineProperty(e,"tp$slots",{value:null,writable:!0})}};Sk.abstr.buildNativeClass=function(a,b){b=b||{};Sk.asserts.assert(b.hasOwnProperty("constructor"),"A constructor is required to build a native class"); let c=b.constructor;if(a.includes(".")){var d=a.split(".");a=d.pop();d=d.join(".")}Sk.abstr.setUpInheritance(a,c,b.base,b.meta);Sk.abstr.setUpBuiltinMro(c);const e=c.prototype;Object.defineProperties(e,{tp$slots:{value:b.slots,writable:!0},tp$getsets:{value:b.getsets,writable:!0},tp$methods:{value:b.methods,writable:!0},tp$classmethods:{value:b.classmethods,writable:!0}});Sk.abstr.setUpSlots(c,b.slots||{});Sk.abstr.setUpMethods(c,b.methods);Sk.abstr.setUpGetSets(c,b.getsets);Sk.abstr.setUpClassMethods(c, b.classmethods);void 0!==d&&(e.__module__=new Sk.builtin.str(d));Object.entries(b.proto||{}).forEach(([a,b])=>{Object.defineProperty(e,a,{value:b,writable:!0,enumerable:!(a.includes("$")||a in Object.prototype)})});Object.entries(b.flags||{}).forEach(([a,b])=>{Object.defineProperty(c,a,{value:b,writable:!0})});void 0!==Sk.builtin.str&&e.hasOwnProperty("tp$doc")&&!e.hasOwnProperty("__doc__")&&(a=e.tp$doc||null,e.__doc__="string"===typeof a?new Sk.builtin.str(a):Sk.builtin.none.none$);return c};Sk.abstr.buildIteratorClass= function(a,b){Sk.asserts.assert(b.hasOwnProperty("constructor"),"must provide a constructor");b.slots=b.slots||{};b.slots.tp$iter=Sk.generic.selfIter;b.slots.tp$iternext=b.slots.tp$iternext||b.iternext;b.slots.tp$getattr=b.slots.tp$getattr||Sk.generic.getAttr;a=Sk.abstr.buildNativeClass(a,b);Sk.abstr.built$iterators.push(a);return a};Sk.abstr.built$iterators=[];Sk.abstr.setUpModuleMethods=function(a,b,c){Object.entries(c).forEach(([c,d])=>{d.$name=d.$name||c;b[c]=new Sk.builtin.sk_method(d,null,a)})}; Sk.abstr.superConstructor=function(a,b,c){var d=Array.prototype.slice.call(arguments,2);a.prototype.tp$base.apply(b,d)}},function(m,q){const a=new Map;Sk.builtin.object=Sk.abstr.buildNativeClass("object",{constructor:function(){Sk.asserts.assert(this instanceof Sk.builtin.object,"bad call to object, use 'new'")},base:null,slots:{tp$new(a,b){if(a.length||b&&b.length){if(this.tp$new!==Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError("object.__new__() takes exactly one argument (the type to instantiate)"); if(this.tp$init===Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+"() takes no arguments");}return new this.constructor},tp$init(a,b){if(a.length||b&&b.length){if(this.tp$init!==Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError("object.__init__() takes exactly one argument (the instance to initialize)");if(this.tp$new===Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+".__init__() takes exactly one argument (the instance to initialize)"); }},tp$getattr:Sk.generic.getAttr,tp$setattr:Sk.generic.setAttr,$r(){const a=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$module);let b="";a&&Sk.builtin.checkString(a)&&(b=a.v+".");return new Sk.builtin.str("<"+b+Sk.abstr.typeName(this)+" object>")},tp$str(){return this.$r()},tp$hash(){let c=a.get(this);if(void 0!==c)return c;c=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER-Number.MAX_SAFE_INTEGER/2);a.set(this,c);return c},tp$richcompare(a,b){switch(b){case "Eq":a=this===a||Sk.builtin.NotImplemented.NotImplemented$; break;case "NotEq":a=this.tp$richcompare(a,"Eq");a!==Sk.builtin.NotImplemented.NotImplemented$&&(a=!Sk.misceval.isTrue(a));break;default:a=Sk.builtin.NotImplemented.NotImplemented$}return a},tp$doc:"The most base type"},getsets:{__class__:{$get(){return this.ob$type},$set(a){if(void 0===a)throw new Sk.builtin.TypeError("can't delete __class__ attribute");if(!Sk.builtin.checkClass(a))throw new Sk.builtin.TypeError("__class__ must be set to a class, not '"+Sk.abstr.typeName(a)+"' object");const b=this.ob$type; if(!(b.$isSubType(Sk.builtin.module)&&a.$isSubType(Sk.builtin.module)||void 0!==b.sk$klass&&void 0!==a.sk$klass))throw new Sk.builtin.TypeError(" __class__ assignment only supported for heap types or ModuleType subclasses");if(a.prototype.sk$builtinBase!==this.sk$builtinBase)throw new Sk.builtin.TypeError("__class__ assignment: '"+Sk.abstr.typeName(this)+"' object layout differs from '"+a.prototype.tp$name+"'");Object.setPrototypeOf(this,a.prototype)},$doc:"the object's class"}},methods:{__dir__:{$meth:function(){let a= [];if(this.$d)if(this.$d instanceof Sk.builtin.dict)a=this.$d.sk$asarray();else for(var b in this.$d)a.push(new Sk.builtin.str(b));b=Sk.misceval.callsimArray(Sk.builtin.type.prototype.__dir__,[this.ob$type]);a.push(...b.v);b.v=a;return b},$flags:{NoArgs:!0},$doc:"Default dir() implementation."},__format__:{$meth(a){if(Sk.builtin.checkString(a)){if(a=Sk.ffi.remapToJs(a),""!==a)throw new Sk.builtin.NotImplementedError("format spec is not yet implemented");}else{if(Sk.__future__.exceptions)throw new Sk.builtin.TypeError("format() argument 2 must be str, not "+ Sk.abstr.typeName(a));throw new Sk.builtin.TypeError("format expects arg 2 to be string or unicode, not "+Sk.abstr.typeName(a));}return this.tp$str()},$flags:{OneArg:!0},$doc:"Default object formatter."}},proto:{valueOf:Object.prototype.valueOf,toString:function(){return this.tp$str().v},hasOwnProperty:Object.prototype.hasOwnProperty,hp$type:void 0,sk$attrError(){return"'"+this.tp$name+"' object"}}});Sk.abstr.setUpInheritance("type",Sk.builtin.type,Sk.builtin.object);Sk.abstr.setUpBuiltinMro(Sk.builtin.type)}, function(m,q){function a(a,b,c){Sk.abstr.checkNoArgs(this.$name,b,c);a=this.call(a);return void 0===a?Sk.builtin.none.none$:a}function c(a,b,c){Sk.abstr.checkOneArg(this.$name,b,c);a=this.call(a,b[0]);return void 0===a?Sk.builtin.none.none$:a}function b(a,b,c){Sk.abstr.checkNoKwargs(this.$name,c);Sk.abstr.checkArgsLen(this.$name,b,1,2);a=this.call(a,...b);return void 0===a?Sk.builtin.none.none$:a}function e(a,b,c){Sk.abstr.checkNoKwargs(this.$name,c);Sk.abstr.checkArgsLen(this.$name,b,2,2);this.call(a, b[0],b[1]);return Sk.builtin.none.none$}function f(a,b,d){a=c.call(this,a,b,d);return a===Sk.builtin.NotImplemented.NotImplemented$?a:new Sk.builtin.bool(a)}function l(a,b){return function(c,d,e){c=a.call(this,c,d,e);return b(c)}}function h(a){return function(){const b=a.tp$descr_get?a.tp$descr_get(this):a;return Sk.misceval.callsimArray(b,[])}}function d(a,b,c,d){return function(e){return function(){var f=e.tp$descr_get?e.tp$descr_get(this):e;f=Sk.misceval.callsimArray(f,[]);if(!b(f))throw new Sk.builtin.TypeError(a+ " should return "+c+" (returned "+Sk.abstr.typeName(f)+")");return void 0!==d?d(f):f}}}function g(a){return function(b){const c=a.tp$descr_get?a.tp$descr_get(this):a;return Sk.misceval.callsimArray(c,[b])}}function n(a,b){let c=this.ob$type.$typeLookup(Sk.builtin.str.$getattribute);if(c instanceof Sk.builtin.wrapper_descriptor)return c.d$wrapped.call(this,a,b);c.tp$descr_get&&(c=c.tp$descr_get(this));const d=Sk.misceval.tryCatch(()=>Sk.misceval.callsimOrSuspendArray(c,[a]),a=>{if(!(a instanceof Sk.builtin.AttributeError))throw a; });return b?d:Sk.misceval.retryOptionalSuspensionOrThrow(d)}function k(a,b,c){return function(d){return function(d,e,f){let g;void 0===e?(g=b,c=null):g=a;let h=this.ob$type.$typeLookup(new Sk.builtin.str(g));if(h instanceof Sk.builtin.wrapper_descriptor)return h.d$wrapped.call(this,d,e);h.tp$descr_get&&(h=h.tp$descr_get(this));if(void 0!==h)d=Sk.misceval.callsimOrSuspendArray(h,void 0===e?[d]:[d,e]);else{if(c)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this)+"' object "+c);throw new Sk.builtin.AttributeError(g); }return f?d:Sk.misceval.retryOptionalSuspensionOrThrow(d)}}}function p(a,b){let c=a.ob$type;for(;c&&void 0!==c.sk$klass;)c=c.prototype.tp$base;if(c&&c.prototype.tp$setattr!==b)throw new Sk.builtin.TypeError("can't apply this "+b.$name+" to "+Sk.abstr.typeName(a)+" object");}Sk.slots=Object.create(null);m=Sk.slots;Sk.slots.__init__={$name:"__init__",$slot_name:"tp$init",$slot_func:function(a){return function(b,c){const d=a.tp$descr_get?a.tp$descr_get(this):a;b=Sk.misceval.callsimOrSuspendArray(d,b, c);return Sk.misceval.chain(b,a=>{if(!Sk.builtin.checkNone(a)&&void 0!==a)throw new Sk.builtin.TypeError("__init__() should return None, not "+Sk.abstr.typeName(a));})}},$wrapper:function(a,b,c){this.call(a,b,c);return Sk.builtin.none.none$},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Initialize self. See help(type(self)) for accurate signature."};m.__new__={$name:"__new__",$slot_name:"tp$new",$slot_func:function(a){const b=function(b,c){let d=a;a.tp$descr_get&&(d=a.tp$descr_get(null, this.constructor));return Sk.misceval.callsimOrSuspendArray(d,[this.constructor,...b],c)};b.sk$static_new=!1;return b},$wrapper:null,$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Create and return a new object."};m.__call__={$name:"__call__",$slot_name:"tp$call",$slot_func:function(a){return function(b,c){const d=a.tp$descr_get?a.tp$descr_get(this):a;return Sk.misceval.callsimOrSuspendArray(d,b,c)}},$wrapper:function(a,b,c){a=a.tp$call(b,c);return void 0===a?Sk.builtin.none.none$: a},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Call self as a function."};m.__repr__={$name:"__repr__",$slot_name:"$r",$slot_func:d("__repr__",Sk.builtin.checkString,"str"),$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return repr(self)."};m.__str__={$name:"__str__",$slot_name:"tp$str",$slot_func:d("__str__",Sk.builtin.checkString,"str"),$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return str(self)."};var w=d("__hash__",Sk.builtin.checkInt,"int",a=>"number"=== typeof a.v?a.v:a.tp$hash());m.__hash__={$name:"__hash__",$slot_name:"tp$hash",$slot_func:function(a){return a===Sk.builtin.none.none$?Sk.builtin.none.none$:w(a)},$wrapper:l(a,a=>new Sk.builtin.int_(a)),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return hash(self)."};m.__getattribute__={$name:"__getattribute__",$slot_name:"tp$getattr",$slot_func:function(a){return function(a,b){let c=this.ob$type.$typeLookup(Sk.builtin.str.$getattr);if(void 0===c)return n.call(this,a,b);const d=Sk.misceval.chain(n.call(this, a,b),b=>Sk.misceval.tryCatch(()=>{if(void 0!==b)return b;c.tp$descr_get&&(c=c.tp$descr_get(this));return Sk.misceval.callsimOrSuspendArray(c,[a])},function(a){if(!(a instanceof Sk.builtin.AttributeError))throw a;}));return b?d:Sk.misceval.retryOptionalSuspensionOrThrow(d)}},$wrapper:function(a,b,c){Sk.abstr.checkOneArg(this.$name,b,c);b=b[0];if(!Sk.builtin.checkString(b))throw new Sk.builtin.TypeError("attribute name must be string, not '"+Sk.abstr.typeName(b)+"'");c=this.call(a,b);if(void 0===c)throw new Sk.builtin.AttributeError(Sk.abstr.typeName(a)+ " has no attribute "+b.$jsstr());return c},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."};m.__getattr__={$name:"__getattr__",$slot_name:"tp$getattr",$slot_func:m.__getattribute__.$slot_func,$wrapper:null,$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."};m.__setattr__={$name:"__setattr__",$slot_name:"tp$setattr",$slot_func:k("__setattr__","__delattr__"),$wrapper:function(a,b,c){Sk.abstr.checkNoKwargs(this.$name,c);Sk.abstr.checkArgsLen(this.$name, b,2,2);p(a,this);this.call(a,b[0],b[1]);return Sk.builtin.none.none$},$textsig:"($self, name, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Implement setattr(self, name, value)."};m.__delattr__={$name:"__delattr__",$slot_name:"tp$setattr",$slot_func:m.__setattr__.$slot_func,$wrapper:function(a,b,c){Sk.abstr.checkOneArg(this.$name,b,c);p(a,this);this.call(a,b[0]);return Sk.builtin.none.none$},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Implement delattr(self, name)."};m.__get__={$name:"__get__", $slot_name:"tp$descr_get",$slot_func:function(a){return function(b,c,d){null===b&&(b=Sk.builtin.none.none$);null==c&&(c=Sk.builtin.none.none$);const e=a.tp$descr_get?a.tp$descr_get(this):a;b=Sk.misceval.callsimOrSuspendArray(e,[b,c]);return d?b:Sk.misceval.retryOptionalSuspensionOrThrow(b)}},$wrapper:function(a,b,c){Sk.abstr.checkNoKwargs(this.$name,c);Sk.abstr.checkArgsLen(this.$name,b,1,2);c=b[0];b=b[1];c===Sk.builtin.none.none$&&(c=null);b===Sk.builtin.none.none$&&(b=null);if(null===b&&null=== c)throw new Sk.builtin.TypeError("__get__(None, None) is invalid");return this.call(a,c,b)},$textsig:"($self, instance, owner, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Return an attribute of instance, which is of type owner."};m.__set__={$name:"__set__",$slot_name:"tp$descr_set",$slot_func:k("__set__","__delete__"),$wrapper:e,$textsig:"($self, instance, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Set an attribute of instance to value."};m.__delete__={$name:"__delete__",$slot_name:"tp$descr_set",$slot_func:m.__set__.$slot_func, $wrapper:c,$textsig:"($self, instance, /)",$flags:{OneArg:!0},$doc:"Delete an attribute of instance."};m.__eq__={$name:"__eq__",$slot_name:"ob$eq",$slot_func:g,$wrapper:f,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self==value."};m.__ge__={$name:"__ge__",$slot_name:"ob$ge",$slot_func:g,$wrapper:f,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self>=value."};m.__gt__={$name:"__gt__",$slot_name:"ob$gt",$slot_func:g,$wrapper:f,$textsig:"($self, value, /)",$flags:{OneArg:!0}, $doc:"Return self>value."};m.__le__={$name:"__le__",$slot_name:"ob$le",$slot_func:g,$wrapper:f,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<=value."};m.__lt__={$name:"__lt__",$slot_name:"ob$lt",$slot_func:g,$wrapper:f,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return selfSk.misceval.callsimOrSuspendArray(c,[]),a=>{if(!(a instanceof Sk.builtin.StopIteration))throw a;});return b?d:Sk.misceval.retryOptionalSuspensionOrThrow(d)}},$wrapper:function(a,b,c){Sk.abstr.checkNoArgs(this.$name,b,c);return Sk.misceval.chain(a.tp$iternext(!0), a=>{if(void 0===a)throw new Sk.builtin.StopIteration;return a})},$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Implement next(self)."};m.__len__={$name:"__len__",$slot_name:"sq$length",$slot_func:function(a){return function(b){const c=a.tp$descr_get?a.tp$descr_get(this):a;if(b)return b=Sk.misceval.callsimOrSuspendArray(c,[]),Sk.misceval.chain(b,a=>Sk.misceval.asIndexOrThrow(a));b=Sk.misceval.callsimArray(c,[]);return Sk.misceval.asIndexOrThrow(b)}},$wrapper:l(a,a=>new Sk.builtin.int_(a)),$flags:{NoArgs:!0}, $textsig:"($self, /)",$doc:"Return len(self)."};m.__contains__={$name:"__contains__",$slot_name:"sq$contains",$slot_func:function(a){return function(b,c){const d=a.tp$descr_get?a.tp$descr_get(this):a;b=Sk.misceval.callsimOrSuspendArray(d,[b]);b=Sk.misceval.chain(b,a=>Sk.misceval.isTrue(a));return b.$isSuspension?c?b:Sk.misceval.retryOptionalSuspensionOrThrow(b):b}},$wrapper:l(c,a=>new Sk.builtin.bool(a)),$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return key in self."};m.__getitem__={$name:"__getitem__", $slot_name:"mp$subscript",$slot_func:function(a){return function(b,c){const d=a.tp$descr_get?a.tp$descr_get(this):a;b=Sk.misceval.callsimOrSuspendArray(d,[b]);return c?b:Sk.misceval.retryOptionalSuspensionOrThrow(b)}},$wrapper:c,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return self[key]."};m.__setitem__={$name:"__setitem__",$slot_name:"mp$ass_subscript",$slot_func:k("__setitem__","__delitem__","does not support item assignment"),$wrapper:e,$textsig:"($self, key, value, /)",$flags:{MinArgs:2, MaxArgs:2},$doc:"Set self[key] to value."};m.__delitem__={$name:"__delitem__",$slot_name:"mp$ass_subscript",$slot_func:m.__setitem__.$slot_func,$wrapper:c,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Delete self[key]."};m.__add__={$name:"__add__",$slot_name:"nb$add",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self+value."};m.__radd__={$name:"__radd__",$slot_name:"nb$reflected_add",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0}, $doc:"Return value+self."};m.__iadd__={$name:"__iadd__",$slot_name:"nb$inplace_add",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self+=value."};m.__sub__={$name:"__sub__",$slot_name:"nb$subtract",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self-value."};m.__rsub__={$name:"__rsub__",$slot_name:"nb$reflected_subtract",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value-self."}; m.__imul__={$name:"__imul__",$slot_name:"nb$inplace_multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self*=value."};m.__mul__={$name:"__mul__",$slot_name:"nb$multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self*value."};m.__rmul__={$name:"__rmul__",$slot_name:"nb$reflected_multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value*self."};m.__isub__={$name:"__isub__", $slot_name:"nb$inplace_subtract",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self-=value."};m.__mod__={$name:"__mod__",$slot_name:"nb$remainder",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self%value."};m.__rmod__={$name:"__rmod__",$slot_name:"nb$reflected_remainder",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value%self."};m.__imod__={$name:"__imod__",$slot_name:"nb$inplace_remainder", $slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement value%=self."};m.__divmod__={$name:"__divmod__",$slot_name:"nb$divmod",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(self, value)."};m.__rdivmod__={$name:"__rdivmod__",$slot_name:"nb$reflected_divmod",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(value, self)"};m.__pos__={$name:"__pos__",$slot_name:"nb$positive",$slot_func:h, $wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"+self"};m.__neg__={$name:"__neg__",$slot_name:"nb$negative",$slot_func:h,$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"-self"};m.__abs__={$name:"__abs__",$slot_name:"nb$abs",$slot_func:h,$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"abs(self)"};m.__bool__={$name:"__bool__",$slot_name:"nb$bool",$slot_func:d("__bool__",Sk.builtin.checkBool,"bool",a=>0!==a.v),$wrapper:l(a,a=>new Sk.builtin.bool(a)),$textsig:"($self, /)", $flags:{NoArgs:!0},$doc:"self != 0"};m.__invert__={$name:"__invert__",$slot_name:"nb$invert",$slot_func:h,$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"~self"};m.__lshift__={$name:"__lshift__",$slot_name:"nb$lshift",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<>value."};m.__rrshift__={$name:"__rrshift__",$slot_name:"nb$reflected_rshift",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value>>self."};m.__ilshift__={$name:"__ilshift__",$slot_name:"nb$inplace_lshift",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self<<=value."};m.__irshift__={$name:"__irshift__", $slot_name:"nb$inplace_rshift",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self=>>value."};m.__and__={$name:"__and__",$slot_name:"nb$and",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self&value."};m.__rand__={$name:"__rand__",$slot_name:"nb$refelcted_and",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value&self."};m.__iand__={$name:"__iand__",$slot_name:"nb$and",$slot_func:g, $wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self&=value."};m.__xor__={$name:"__xor__",$slot_name:"nb$xor",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self^value."};m.__rxor__={$name:"__rxor__",$slot_name:"nb$reflected_xor",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value^self."};m.__ixor__={$name:"__ixor__",$slot_name:"nb$inplace_xor",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)", $flags:{OneArg:!0},$doc:"Implement self^=value."};m.__or__={$name:"__or__",$slot_name:"nb$or",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self|value."};m.__ror__={$name:"__ror__",$slot_name:"nb$reflected_or",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value|self."};m.__ior__={$name:"__ior__",$slot_name:"nb$inplace_or",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self|=value."}; m.__int__={$name:"__int__",$slot_name:"nb$int",$slot_func:d("__int__",Sk.builtin.checkInt,"int"),$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"int(self)"};m.__float__={$name:"__float__",$slot_name:"nb$float",$slot_func:d("__float__",Sk.builtin.checkFloat,"float"),$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"float(self)"};m.__floordiv__={$name:"__floordiv__",$slot_name:"nb$floor_divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self//value."}; m.__rfloordiv__={$name:"__rfloordiv__",$slot_name:"nb$reflected_floor_divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value//self."};m.__ifloordiv__={$name:"__ifloordiv__",$slot_name:"nb$inplace_floor_divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self//=value."};m.__truediv__={$name:"__truediv__",$slot_name:"nb$divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self/value."}; m.__rtruediv__={$name:"__rtruediv__",$slot_name:"nb$reflected_divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value/self."};m.__itruediv__={$name:"__itruediv__",$slot_name:"nb$inplace_divide",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self/=value."};m.__index__={$name:"__index__",$slot_name:"nb$index",$slot_func:d("__index__",Sk.builtin.checkInt,"int",a=>a.v),$wrapper:l(a,a=>new Sk.builtin.int_(a)),$textsig:"($self, /)", $flags:{NoArgs:!0},$doc:"Return self converted to an integer, if self is suitable for use as an index into a list."};m.__pow__={$name:"__pow__",$slot_name:"nb$power",$slot_func:function(a){return function(b,c){const d=a.tp$descr_get?a.tp$descr_get(this):a;return void 0==c?Sk.misceval.callsimArray(d,[b]):Sk.misceval.callsimArray(d,[b,c])}},$wrapper:b,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(self, value, mod)."};m.__rpow__={$name:"__rpow__",$slot_name:"nb$reflected_power", $slot_func:m.__pow__.$slot_func,$wrapper:b,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(value, self, mod)."};m.__ipow__={$name:"__ipow__",$slot_name:"nb$inplace_power",$slot_func:m.__pow__.$slot_func,$wrapper:b,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Implement **="};m.__matmul__={$name:"__matmul__",$slot_name:"nb$matrix_multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self@value."}; m.__rmatmul__={$name:"__rmatmul__",$slot_name:"nb$reflected_matrix_multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value@self."};m.__imatmul__={$name:"__imatmul__",$slot_name:"nb$inplace_matrix_multiply",$slot_func:g,$wrapper:c,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self@=value."};m.__long__={$name:"__long__",$slot_name:"nb$long",$slot_func:d("__long__",Sk.builtin.checkInt,"int"),$wrapper:a,$textsig:"($self, /)",$flags:{NoArgs:!0}, $doc:"int(self)"};var A,t={next:{$name:"next",$slot_name:"tp$iternext",$slot_func:m.__next__.$slot_func,$wrapper:m.__next__.$wrapper,$textsig:m.__next__.$textsig,$flags:m.__next__.$flags},__nonzero__:{$name:"__nonzero__",$slot_name:"nb$bool",$slot_func:d("__nonzero__",Sk.builtin.checkInt,"int",a=>0!==a.v),$wrapper:l(a,a=>new Sk.builtin.bool(a)),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"x.__nonzero__() <==> x != 0"},__div__:{$name:"__div__",$slot_name:"nb$divide",$slot_func:g,$wrapper:c,$textsig:"($self, other/)", $flags:{OneArg:!0},$doc:"x.__div__(y) <==> x/y"},__rdiv__:{$name:"__rdiv__",$slot_name:"nb$reflected_divide",$slot_func:g,$wrapper:c,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"x.__rdiv__(y) <==> x/y"},__idiv__:{$name:"__idiv__",$slot_name:"nb$inplace_divide",$slot_func:g,$wrapper:c,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"implement self /= other"}};Sk.subSlots={main_slots:Object.entries({tp$init:"__init__",tp$call:"__call__",$r:"__repr__",tp$str:"__str__",tp$getattr:"__getattribute__", tp$setattr:["__setattr__","__delattr__"],ob$eq:"__eq__",ob$ne:"__ne__",ob$lt:"__lt__",ob$le:"__le__",ob$gt:"__gt__",ob$ge:"__ge__",tp$descr_get:"__get__",tp$descr_set:["__set__","__delete__"],tp$iter:"__iter__",tp$iternext:"__next__"}),number_slots:Object.entries({nb$abs:"__abs__",nb$negative:"__neg__",nb$positive:"__pos__",nb$int:"__int__",nb$long:"__long__",nb$float:"__float__",nb$add:"__add__",nb$reflected_add:"__radd__",nb$inplace_add:"__iadd__",nb$subtract:"__sub__",nb$reflected_subtract:"__rsub__", nb$inplace_subtract:"__isub__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_multiply:"__imul__",nb$floor_divide:"__floordiv__",nb$reflected_floor_divide:"__rfloordiv__",nb$inplace_floor_divide:"__ifloordiv__",nb$invert:"__invert__",nb$remainder:"__mod__",nb$reflected_remainder:"__rmod__",nb$inplace_remainder:"__imod__",nb$divmod:"__divmod__",nb$reflected_divmod:"__rdivmod__",nb$power:"__pow__",nb$reflected_power:"__rpow__",nb$inplace_power:"__ipow__",nb$divide:"__truediv__",nb$reflected_divide:"__rtruediv__", nb$inplace_divide:"__itruediv__",nb$bool:"__bool__",nb$and:"__and__",nb$reflected_and:"__rand__",nb$inplace_and:"__iand__",nb$or:"__or__",nb$reflected_or:"__ror__",nb$inplace_or:"__ior__",nb$xor:"__xor__",nb$reflected_xor:"__rxor__",nb$inplace_xor:"__ixor__",nb$lshift:"__lshift__",nb$reflected_lshift:"__rlshift__",nb$rshift:"__rshift__",nb$reflected_rshift:"__rrshift__",nb$inplace_lshift:"__ilshift__",nb$inplace_rshift:"__irshift__",nb$matrix_multiply:"__matmul__",nb$reflected_matrix_multiply:"__rmatmul__", nb$inplace_matrix_multiply:"__imatmul__"}),sequence_and_mapping_slots:Object.entries({sq$length:"__len__",sq$contains:"__contains__",mp$subscript:"__getitem__",mp$ass_subscript:["__setitem__","__delitem__"],nb$add:"__add__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_add:"__iadd__",nb$inplace_multiply:"__imul__"})};Sk.reflectedNumberSlots={nb$add:{reflected:"nb$reflected_add"},nb$subtract:{reflected:"nb$reflected_subtract",slot:function(a){return a instanceof this.constructor? a.nb$subtract(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$multiply:{reflected:"nb$reflected_multiply"},nb$divide:{reflected:"nb$reflected_divide",slot:function(a){return a instanceof this.constructor?a.nb$divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$floor_divide:{reflected:"nb$reflected_floor_divide",slot:function(a){return a instanceof this.constructor?a.nb$floor_divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$remainder:{reflected:"nb$reflected_remainder",slot:function(a){return a instanceof this.constructor?a.nb$remainder(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$divmod:{reflected:"nb$reflected_divmod",slot:function(a){return a instanceof this.constructor?a.nb$divmod(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$power:{reflected:"nb$reflected_power",slot:function(a,b){return a instanceof this.constructor?a.nb$power(this,b):Sk.builtin.NotImplemented.NotImplemented$}},nb$and:{reflected:"nb$reflected_and"},nb$or:{reflected:"nb$reflected_or"},nb$xor:{reflected:"nb$reflected_xor"}, nb$lshift:{reflected:"nb$reflected_lshift",slot:function(a){return a instanceof this.constructor?a.nb$lshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$rshift:{reflected:"nb$reflected_rshift",slot:function(a){return a instanceof this.constructor?a.nb$rshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$matrix_multiply:{reflected:"nb$reflexted_matrix_multiply",slot:function(a){return a instanceof this.constructor?a.nb$matrix_multiply(this):Sk.builtin.NotImplemented.NotImplemented$}}}; Sk.sequenceAndMappingSlots={sq$concat:["nb$add"],sq$repeat:["nb$multiply","nb$reflected_multiply"],mp$length:["sq$length"],sq$inplace_repeat:["nb$inplace_multiply"],sq$inplace_concat:["nb$inplace_add"]};Sk.dunderToSkulpt={__repr__:"$r",__str__:"tp$str",__init__:"tp$init",__new__:"tp$new",__hash__:"tp$hash",__call__:"tp$call",__iter__:"tp$iter",__next__:"tp$iternext",__eq__:"ob$eq",__ne__:"ob$ne",__lt__:"ob$lt",__le__:"ob$le",__gt__:"ob$gt",__ge__:"ob$ge",__abs__:"nb$abs",__neg__:"nb$negative",__pos__:"nb$positive", __int__:"nb$int",__float__:"nb$float",__add__:"nb$add",__radd__:"nb$reflected_add",__iadd__:"nb$inplace_add",__sub__:"nb$subtract",__rsub__:"nb$reflected_subtract",__isub__:"nb$inplace_subtract",__mul__:"nb$multiply",__rmul__:"nb$reflected_multiply",__imul__:"nb$inplace_multiply",__truediv__:"nb$divide",__rtruediv__:"nb$reflected_divide",__itruediv__:"nb$inplace_divide",__floordiv__:"nb$floor_divide",__rfloordiv__:"nb$reflected_floor_divide",__ifloordiv__:"nb$inplace_floor_divide",__invert__:"nb$invert", __mod__:"nb$remainder",__rmod__:"nb$reflected_remainder",__imod__:"nb$inplace_remainder",__divmod__:"nb$divmod",__rdivmod__:"nb$reflected_divmod",__pow__:"nb$power",__rpow__:"nb$reflected_power",__ipow__:"nb$inplace_power",__bool__:"nb$bool",__long__:"nb$long",__lshift__:"nb$lshift",__rlshift__:"nb$reflected_lshift",__ilshift__:"nb$inplace_lshift",__rshift__:"nb$rshift",__rrshift__:"nb$reflected_rshift",__irshift__:"nb$inplace_rshift",__and__:"nb$and",__rand__:"nb$reflected_and",__iand__:"nb$inplace_and", __or__:"nb$or",__ror__:"nb$reflected_or",__ior__:"nb$inplace_or",__xor__:"nb$xor",__rxor__:"nb$reflected_xor",__ixor__:"nb$inplace_xor",__matmul__:"nb$matrix_multiply",__rmatmul__:"nb$reflected_matrix_multiply",__imatmul__:"nb$inplace_matrix_multiply",__get__:"tp$descr_get",__set__:"tp$descr_set",__delete__:"tp$descr_set",__getattribute__:"tp$getattr",__getattr__:"tp$getattr",__setattr__:"tp$setattr",__delattr__:"tp$setattr",__len__:"sq$length",__contains__:"sq$contains",__getitem__:"mp$subscript", __setitem__:"mp$ass_subscript",__delitem__:"mp$ass_subscript"};Sk.exportSymbol("Sk.setupDunderMethods",Sk.setupDunderMethods);Sk.setupDunderMethods=function(a){function b(a,b,c){for(let d=0;d"tp$iternext"===a[0]), k=f.findIndex(a=>"nb$bool"===a[0]),l=Sk.dunderToSkulpt;if(a){l.__bool__="nb$bool";l.__next__="tp$iternext";delete l.__nonzero__;delete l.__div__;delete l.__rdiv__;delete l.__idiv__;delete l.next;for(let a in A)c[a]=A[a];for(let a in t)delete c[a];for(a=0;a")}const f={__doc__:{$get(){return this.d$def.$doc?new Sk.builtin.str(this.d$def.$doc):Sk.builtin.none.none$}},__objclass__:{$get(){return this.d$type}}, __name__:{$get(){return new Sk.builtin.str(this.d$name)}}};m={__text_signature__:{$get(){return this.d$def.$textsig?new Sk.builtin.str(this.d$def.$textsig):Sk.builtin.none.none$}}};Sk.builtin.getset_descriptor=a("getset_descriptor",void 0,{constructor:function(a,b){this.d$def=b;this.$get=b.$get;this.$set=b.$set;this.d$type=a;this.d$name=b.$name},slots:{tp$descr_get(a,b){if(b=this.d$check(a))return b;if(void 0!==this.$get)return this.$get.call(a);throw new Sk.builtin.AttributeError("getset_descriptor '"+ this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is not readable");},tp$descr_set(a,b){this.d$set_check(a);if(void 0!==this.$set)return this.$set.call(a,b);throw new Sk.builtin.AttributeError("attribute '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is readonly");}}});Sk.builtin.method_descriptor=a("method_descriptor","method",{constructor:function(a,b){this.d$def=b;this.$meth=b.$meth;this.d$type=a;this.d$name=b.$name||"";this.$flags=a=b.$flags||{};a.FastCall&& a.NoKwargs?this.tp$call=this.$methodFastCallNoKwargs:a.FastCall?this.tp$call=this.$methodFastCall:a.NoArgs?this.tp$call=this.$methodCallNoArgs:a.OneArg?this.tp$call=this.$methodCallOneArg:a.NamedArgs?this.tp$call=this.$methodCallNamedArgs:void 0!==a.MinArgs?this.tp$call=this.$methodCallMinArgs:(this.func_code=b.$meth,this.tp$call=this.$defaultCall,this.$memoiseFlags=Sk.builtin.func.prototype.$memoiseFlags,this.$resolveArgs=Sk.builtin.func.prototype.$resolveArgs)},slots:{tp$call(a,b){return this.tp$call(a, b)},tp$descr_get(a,b){let c;return(c=this.d$check(a))?c:new Sk.builtin.sk_method(this.d$def,a)}},getsets:m,proto:{$methodFastCall(a,b){const c=a.shift();this.m$checkself(c);return this.$meth.call(c,a,b)},$methodFastCallNoKwargs(a,b){const c=a.shift();this.m$checkself(c);Sk.abstr.checkNoKwargs(this.d$name,b);return this.$meth.call(c,a)},$methodCallNoArgs(a,b){const c=a.shift();this.m$checkself(c);Sk.abstr.checkNoArgs(this.d$name,a,b);return this.$meth.call(c)},$methodCallOneArg(a,b){const c=a.shift(); this.m$checkself(c);Sk.abstr.checkOneArg(this.d$name,a,b);return this.$meth.call(c,a[0])},$methodCallNamedArgs(a,b){const c=a.shift();this.m$checkself(c);a=Sk.abstr.copyKeywordsToNamedArgs(this.d$name,this.$flags.NamedArgs,a,b,this.$flags.Defaults);return this.$meth.call(c,...a)},$methodCallMinArgs(a,b){const c=a.shift();this.m$checkself(c);Sk.abstr.checkNoKwargs(this.d$name,b);Sk.abstr.checkArgsLen(this.d$name,a,this.$flags.MinArgs,this.$flags.MaxArgs);return this.$meth.call(c,...a)},$defaultCall(a, b){this.m$checkself(a[0]);return Sk.builtin.func.prototype.tp$call.call(this,a,b)},m$checkself(a){if(void 0===a)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");this.d$check(a)}}});Sk.builtin.wrapper_descriptor=a("wrapper_descriptor","slot wrapper",{constructor:function(a,b,c){this.d$def=b;this.d$type=a;this.d$name=c.$name=b.$name;this.d$wrapped=c},slots:{tp$descr_get(a,b){let c;return(c=this.d$check(a))?c:new Sk.builtin.method_wrapper(this, a)},tp$call(a,b){if(1>a.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const c=a.shift();if(!c.ob$type.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(c)+"'");return this.raw$call(c,a,b)}},proto:{raw$call(a,b,c){this.d$wrapped.$name=this.d$name;return this.d$def.$wrapper.call(this.d$wrapped, a,b,c)}}});Sk.builtin.method_wrapper=a("method_wrapper",void 0,{constructor:function(a,b){this.m$descr=a;this.m$self=b;this.d$def=a.d$def;this.d$name=a.d$name;this.d$type=a.d$type},slots:{tp$call(a,b){return this.m$descr.raw$call(this.m$self,a,b)},tp$richcompare(a,b){if("Eq"!==b&&"NotEq"!==b||!(a instanceof Sk.builtin.method_wrapper))return Sk.builtin.NotImplemented.NotImplemented$;a=this.m$self===a.m$self&&this.m$descr===a.m$descr;return"Eq"===b?a:!a},$r(){return new Sk.builtin.str("")}},getsets:{__self__:{$get(){return this.m$self}}}});Sk.builtin.classmethod_descriptor=a("classmethod_descriptor","method",{constructor:function(a,b){this.d$def=b;this.$meth=b.$meth;this.d$type=a;this.d$name=b.$name||""},slots:{tp$call(a,b){if(1>a.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const c=a.shift();return this.tp$descr_get(null, c).tp$call(a,b)},tp$descr_get(a,b,c){if(void 0===b)if(null!==a)b=b||a.ob$type;else throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs an object or a type");if(b.ob$type!==Sk.builtin.type)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs a type not a '"+Sk.abstr.typeName(b)+"' as arg 2");if(!b.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+ this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(b)+"' object");return new Sk.builtin.sk_method(this.d$def,b)}},getsets:m});[Sk.builtin.method_descriptor,Sk.builtin.getset_descriptor,Sk.builtin.wrapper_descriptor,Sk.builtin.method_wrapper,Sk.builtin.classmethod_descriptor].forEach(a=>{Sk.abstr.setUpSlots(a);Sk.abstr.setUpMethods(a);Sk.abstr.setUpGetSets(a)})},function(m,q){Sk.builtin.sk_method=Sk.abstr.buildNativeClass("builtin_function_or_method",{constructor:function(a, c,b){this.$meth=a.$meth.bind(c);this.$doc=a.$doc;this.$self=c||null;this.$module=b?new Sk.builtin.str(b):null;this.$name=a.$name||a.$meth.name||"";this.m$def=a;this.$textsig=a.$textsig;this.$flags=a=a.$flags||{};a.FastCall&&a.NoKwargs?this.tp$call=this.$fastCallNoKwargs:a.FastCall?this.tp$call=this.$meth:a.NoArgs?this.tp$call=this.$callNoArgs:a.OneArg?this.tp$call=this.$callOneArg:a.NamedArgs?this.tp$call=this.$callNamedArgs:void 0!==a.MinArgs?this.tp$call=this.$callMinArgs:(this.func_code= this.$meth,this.tp$call=this.$defaultCallMethod)},proto:{$fastCallNoKwargs(a,c){Sk.abstr.checkNoKwargs(this.$name,c);return this.$meth(a)},$callNoArgs(a,c){Sk.abstr.checkNoArgs(this.$name,a,c);return this.$meth()},$callOneArg(a,c){Sk.abstr.checkOneArg(this.$name,a,c);return this.$meth(a[0])},$callNamedArgs(a,c){a=Sk.abstr.copyKeywordsToNamedArgs(this.$name,this.$flags.NamedArgs,a,c,this.$flags.Defaults);return this.$meth(...a)},$callMinArgs(a,c){Sk.abstr.checkNoKwargs(this.$name,c);Sk.abstr.checkArgsLen(this.$name, a,this.$flags.MinArgs,this.$flags.MaxArgs);return this.$meth(...a)},$defaultCallMethod(a,c){return null!==this.$self?Sk.builtin.func.prototype.tp$call.call(this,[this.$self,...a],c):Sk.builtin.func.prototype.tp$call.call(this,a,c)},$memoiseFlags(){return Sk.builtin.func.prototype.$memoiseFlags.call(this)},$resolveArgs(){return Sk.builtin.func.prototype.$resolveArgs.call(this)}},flags:{sk$acceptable_as_base_class:!1},slots:{tp$getattr:Sk.generic.getAttr,$r(){return null===this.$self?new Sk.builtin.str(""):new Sk.builtin.str("")},tp$call(a,c){return this.tp$call(a,c)},tp$richcompare(a,c){if("Eq"!==c&&"NotEq"!==c||!(a instanceof Sk.builtin.sk_method))return Sk.builtin.NotImplemented.NotImplemented$;a=this.$self===a.$self&&this.m$def.$meth===a.m$def.$meth;return"Eq"===c?a:!a}},getsets:{__module__:{$get(){return this.$module||Sk.builtin.none.none$},$set(a){this.$module=a=a||Sk.builtin.none.none$}},__doc__:{$get(){return this.$doc? new Sk.builtin.str(this.$doc):Sk.builtin.none.none$}},__name__:{$get(){return new Sk.builtin.str(this.$name)}},__text_signature__:{$get(){return new Sk.builtin.str(this.$textsig)}},__self__:{$get(){return this.$self||Sk.sysModules.mp$lookup(this.$module)||Sk.builtin.none.none$}}}})},function(m,q){Sk.builtin.none=Sk.abstr.buildNativeClass("NoneType",{constructor:function(){return Sk.builtin.none.none$},slots:{tp$new(a,c){Sk.abstr.checkNoArgs("NoneType",a,c);return Sk.builtin.none.none$},$r(){return new Sk.builtin.str("None")}, tp$as_number:!0,nb$bool(){return!1}},flags:{sk$acceptable_as_base_class:!1}});Sk.builtin.none.none$=Object.create(Sk.builtin.none.prototype,{v:{value:null,enumerable:!0}});Sk.builtin.NotImplemented=Sk.abstr.buildNativeClass("NotImplementedType",{constructor:function(){return Sk.builtin.NotImplemented.NotImplemented$},slots:{$r(){return new Sk.builtin.str("NotImplemented")},tp$new(a,c){Sk.abstr.checkNoArgs("NotImplementedType",a,c);return Sk.builtin.NotImplemented.NotImplemented$}},flags:{sk$acceptable_as_base_class:!1}}); Sk.builtin.NotImplemented.NotImplemented$=Object.create(Sk.builtin.NotImplemented.prototype,{v:{value:null,enumerable:!0}})},function(m,q){const a=/^(?:(.)?([<>=\^]))?([\+\-\s])?(#)?(0)?(\d+)?(,)?(?:\.(\d+))?([bcdeEfFgGnosxX%])?$/;Sk.formatting={};let c=function(a,b,c,e){Sk.asserts.assert("string"===typeof b);if(a[6]){var d=parseInt(a[6],10);e=a[2]||(a[5]?"=":e?">":"<");let f=d-(b.length+(c?c.length:0));if(0>=f)return b;d=(a[1]||(a[5]?"0":" ")).repeat(f);switch(e){case "=":if("s"===a[9])throw new Sk.builtin.ValueError("'=' alignment not allowed in string format specifier"); return c+d+b;case ">":return d+c+b;case "<":return c+b+d;case "^":return a=Math.floor(f/2),d.substring(0,a)+c+b+d.substring(a)}}return c+b},b=function(a,b){return b?"-":"+"===a[3]?"+":" "===a[3]?" ":""},e=function(a,e,d){Sk.asserts.assert(e instanceof Sk.builtin.int_||e instanceof Sk.builtin.lng);if(a[8])throw new Sk.builtin.ValueError("Precision not allowed in integer format");let f=e.str$(d,!1);e=e.nb$isnegative();e=b(a,e);a[4]&&(16===d?e+="0x":8===d?e+="0o":2===d&&(e+="0b"));"X"===a[9]&&(f=f.toUpperCase()); "n"===a[9]?f=(+f).toLocaleString():a[7]&&(d=f.toString().split("."),d[0]=d[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),f=d.join("."));return c(a,f,e,!0)},f=function(f,h,d){if(!h)return f.str$(10,!0);h=h.match(a);if(!h)throw new Sk.builtin.ValueError("Invalid format specifier");var g=h[9];g||(g=d?"g":"d");if(-1==(d?"fFeEgG%":"bcdoxXnfFeEgG%").indexOf(g))throw new Sk.builtin.ValueError("Unknown format code '"+h[9]+"' for object of type '"+Sk.abstr.typeName(f)+"'");switch(g){case "d":case "n":return e(h, f,10);case "x":case "X":return e(h,f,16);case "o":return e(h,f,8);case "b":return e(h,f,2);case "c":if(h[3])throw new Sk.builtin.ValueError("Sign not allowed with integer format specifier 'c'");if(h[4])throw new Sk.builtin.ValueError("Alternate form not allowed with integer format specifier 'c'");if(h[7])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");if(h[8])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");return c(h,String.fromCodePoint(Sk.builtin.asnum$(f)),"",!0); case "f":case "F":case "e":case "E":case "g":case "G":{if(h[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed in float format specifier");d=Sk.builtin.asnum$(f);"string"===typeof d&&(d=Number(d));if(Infinity===d)return c(h,"inf","",!0);if(-Infinity===d)return c(h,"inf","-",!0);if(isNaN(d))return c(h,"nan","",!0);f=!1;0>d&&(d=-d,f=!0);var l=["toExponential","toFixed","toPrecision"]["efg".indexOf(g.toLowerCase())];let a=h[8]?parseInt(h[8],10):6;d=d[l](a);-1!=="EFG".indexOf(g)&&(d=d.toUpperCase()); if("g"===g.toLowerCase()||!h[9]){if(l=d.match(/\.(\d*[1-9])?(0+)$/)){let [,a,b]=l;d=d.slice(0,a?-b.length:-(b.length+1))}-1!=d.indexOf(".")||h[9]||(d+=".0")}"e"===g.toLowerCase()&&(d=d.replace(/^([-+]?[0-9]*\.?[0-9]+[eE][-+]?)([0-9])?$/,"$10$2"));h[7]&&(g=d.toString().split("."),g[0]=g[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),d=g.join("."));return c(h,d,b(h,f),!0)}case "%":if(h[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed with format specifier '%'");f=Sk.builtin.asnum$(f);"string"=== typeof f&&(f=Number(f));if(Infinity===f)return c(h,"inf%","",!0);if(-Infinity===f)return c(h,"inf%","-",!0);if(isNaN(f))return c(h,"nan%","",!0);g=!1;0>f&&(f=-f,g=!0);d=h[8]?parseInt(h[8],10):6;f=(100*f).toFixed(d)+"%";return c(h,f,b(h,g),!0);default:throw new Sk.builtin.ValueError("Unknown format code '"+h[9]+"'");}};Sk.formatting.mkNumber__format__=a=>function(b){if(!Sk.builtin.checkString(b))throw new Sk.builtin.TypeError("format() argument 2 must be str, not "+Sk.abstr.typeName(b));return new Sk.builtin.str(f(this, b.$jsstr(),a))};Sk.formatting.format=function(a,b){b=b||[];const c={};for(let a=0;ac?Infinity:c;null!=(h=e.exec(a))&&kd)return new Sk.builtin.tuple([new Sk.builtin.str(""),new Sk.builtin.str(""),new Sk.builtin.str(c)])}else if(d=c.indexOf(b),0>d)return new Sk.builtin.tuple([new Sk.builtin.str(c),new Sk.builtin.str(""),new Sk.builtin.str("")]);return new Sk.builtin.tuple([new Sk.builtin.str(c.substring(0,d)),new Sk.builtin.str(b),new Sk.builtin.str(c.substring(d+b.length))])}}function f(a,b){return function(c,d){c=Sk.misceval.asIndexSized(c,Sk.builtin.OverflowError); if(void 0===d)d=" ";else if(d instanceof Sk.builtin.str&&1===d.sq$length())d=d.v;else throw new Sk.builtin.TypeError("the fill character must be a str of length 1");const e=this.sq$length();let f;if(e>=c)return new Sk.builtin.str(this.v);if(b)return f=d.repeat(Math.floor((c-e)/2)),f=f+this.v+f,(c-e)%2&&(f+=d),new Sk.builtin.str(f);f=d.repeat(c-e);return new Sk.builtin.str(a?f+this.v:this.v+f)}}function l(a,b,c){({start:b,end:c}=Sk.builtin.slice.startEnd$wrt(a,b,c));if(a.$hasAstralCodePoints()){const d= a.codepoints[b];b=void 0===d?b+a.v.length-a.codepoints.length:d;c=a.codepoints[c];c=void 0===c?a.v.length:c}return{start:b,end:c}}function h(a){return function(b,c,d){b=this.get$tgt(b);({start:c,end:d}=l(this,c,d));if(d=c&&b<=d?b:-1;if(this.codepoints){d=this.sq$length();c=-1;for(let a=0;ae)return Sk.builtin.bool.false$;d=this.v.slice(d,e);if(c instanceof Sk.builtin.tuple){for(let e=Sk.abstr.iter(c),f=e.tp$iternext();void 0!==f;f=e.tp$iternext()){if(!(f instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("tuple for "+a+" must only contain str, not "+Sk.abstr.typeName(f));if(b(d,f.v))return Sk.builtin.bool.true$}return Sk.builtin.bool.false$}return new Sk.builtin.bool(b(d, c.v))}}var g=/^[0-9!#_]/,n=Object.create(null);Sk.builtin.str=Sk.abstr.buildNativeClass("str",{constructor:function(a){Sk.asserts.assert(this instanceof Sk.builtin.str,"bad call to str - use 'new'");if("string"!==typeof a)if(void 0===a)a="";else if(null===a)a="None";else{if(void 0!==a.tp$str)return a.tp$str();if("number"===typeof a)a=Number.isFinite(a)?String(a):String(a).replace("Infinity","inf").replace("NaN","nan");else throw new Sk.builtin.TypeError("could not convert object of type '"+Sk.abstr.typeName(a)+ "' to str");}var b=n[a];if(void 0!==b)return b;n[a]=this;b=void 0===t[a]?a:a+"_$rw$";this.$mangled=b;this.$savedKeyHash=a.replace(g,"!$&");this.v=a},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", tp$new(a,b){b=b||[];if(this!==Sk.builtin.str.prototype)return this.$subtype_new(a,b);if(1>=a.length&&!b.length)return new Sk.builtin.str(a[0]);if(Sk.__future__.python3){const [c,d,e]=Sk.abstr.copyKeywordsToNamedArgs("str",["object","encoding","errors"],a,b);if(void 0===c||void 0===d&&void 0===e)return new Sk.builtin.str(c);Sk.builtin.bytes.check$encodeArgs("str",d,e);if(!Sk.builtin.checkBytes(c))throw new Sk.builtin.TypeError("decoding to str: need a bytes-like object, "+Sk.abstr.typeName(c)+" found"); return Sk.builtin.bytes.$decode.call(c,d,e)}throw new Sk.builtin.TypeError("str takes at most one argument ("+(a.length+b.length)+" given)");},$r(){let a="'";-1!==this.v.indexOf("'")&&-1===this.v.indexOf('"')&&(a='"');const b=this.v.length;let c=a;for(let f=0;fe||57344<=e)&&!Sk.__future__.python3?c+="\\u"+("000"+e.toString(16)).slice(-4):55296<=e&& !Sk.__future__.python3?(d=this.v.codePointAt(f),f++,d=d.toString(16),e="0000000"+d.toString(16),c=4d||127<=e&&!Sk.__future__.python3?(d=d.charCodeAt(0).toString(16),2>d.length&&(d="0"+d),c+="\\x"+d):c+=d}return new Sk.builtin.str(c+a)},tp$str(){return this.constructor===Sk.builtin.str?this:new Sk.builtin.str(this.v)},tp$iter(){return new A(this)},tp$richcompare(a,b){if(!(a instanceof Sk.builtin.str))return Sk.builtin.NotImplemented.NotImplemented$; switch(b){case "Lt":return this.va.v;case "GtE":return this.v>=a.v}},mp$subscript(a){let b;if(Sk.misceval.isIndex(a)){a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);b=this.sq$length();0>a&&(a+=b);if(0>a||a>=b)throw new Sk.builtin.IndexError("string index out of range");return this.codepoints?new Sk.builtin.str(this.v.substring(this.codepoints[a],this.codepoints[a+1])): new Sk.builtin.str(this.v.charAt(a))}if(a instanceof Sk.builtin.slice){let c="";b=this.sq$length();this.codepoints?a.sssiter$(b,a=>{c+=this.v.substring(this.codepoints[a],this.codepoints[a+1])}):a.sssiter$(b,a=>{c+=this.v.charAt(a)});return new Sk.builtin.str(c)}throw new Sk.builtin.TypeError("string indices must be integers, not "+Sk.abstr.typeName(a));},sq$length(){return this.$hasAstralCodePoints()?this.codepoints.length:this.v.length},sq$concat(a){if(!(a instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("cannot concatenate 'str' and '"+ Sk.abstr.typeName(a)+"' objects");return new Sk.builtin.str(this.v+a.v)},sq$repeat(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(a)+"'");a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);if(a*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;let b="";for(let c=0;c' requires string as left operand not "+ Sk.abstr.typeName(a));return-1!==this.v.indexOf(a.v)},tp$as_number:!0,nb$remainder:function(a){var b;const c=this.sk$builtinBase;a.constructor===Sk.builtin.tuple||a instanceof Sk.builtin.dict||a instanceof Sk.builtin.mappingproxy||(a=new Sk.builtin.tuple([a]));var d=0;var e=this.$jsstr().replace(/%(\([a-zA-Z0-9]+\))?([#0 +\-]+)?(\*|[0-9]+)?(\.(\*|[0-9]+))?[hlL]?([diouxXeEfFgGcrsb%])/g,function(e,f,g,k,h,l,p){var n,B,A,u,y;k=Sk.builtin.asnum$(k);h=Sk.builtin.asnum$(h);void 0!==f&&""!==f||"%"==p||(n= d++);""===h&&(h=void 0);var t=B=A=u=y=!1;g&&(-1!==g.indexOf("-")?u=!0:-1!==g.indexOf("0")&&(y=!0),-1!==g.indexOf("+")?B=!0:-1!==g.indexOf(" ")&&(A=!0),t=-1!==g.indexOf("#"));h&&(h=parseInt(h.substr(1),10));g=function(a,b){var c;b=Sk.builtin.asnum$(b);var d=!1;if("number"===typeof a){0>a&&(a=-a,d=!0);var e=a.toString(b)}else a instanceof Sk.builtin.float_?(e=a.str$(b,!1),2b){this.codepoints=[];for(a=0;ab&&a++;return!0}}this.codepoints=null;return!1},sk$asarray(){const a=[];if(this.$hasAstralCodePoints()){var b=this.codepoints;for(let c=0;cd)return new Sk.builtin.str(this.v.replace(b,c));let e=0;b=this.v.replace(b,a=>e++b?0:2*(a.length/2-b);b=[];for(0>=d?d=0:b.push(new Sk.builtin.str(this.v.slice(0,a[d-1])));d{if(!(a instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("sequence item "+b.length+": expected str, "+Sk.abstr.typeName(a)+" found");b.push(a.v)}),()=>new Sk.builtin.str(b.join(this.v)))},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'"}, capitalize:{$meth:function(){return new Sk.builtin.str(this.v.charAt(0).toUpperCase()+this.v.slice(1).toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a capitalized version of the string.\n\nMore specifically, make the first character have upper case and the rest lower\ncase."},title:{$meth:function(){const a=this.v.replace(/[a-z][a-z]*/gi,a=>a[0].toUpperCase()+a.substr(1).toLowerCase());return new Sk.builtin.str(a)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case."}, center:{$meth:f(!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a centered string of length width.\n\nPadding is done using the specified fill character (default is a space)."},count:{$meth:function(a,b,c){a=this.get$tgt(a);({start:b,end:c}=l(this,b,c));if(c int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation."},expandtabs:{$meth:function(a){if(Sk.builtin.checkInt(a))a=Sk.builtin.asnum$(a);else throw new Sk.builtin.TypeError("an integer is required, got type"+Sk.abstr.typeName(a));const b=Array(a+1).join(" "),c=this.v.replace(/([^\r\n\t]*)\t/g,(c,d)=>d+b.slice(d.length%a)); return new Sk.builtin.str(c)},$flags:{NamedArgs:["tabsize"],Defaults:[8]},$textsig:"($self, /, tabsize=8)",$doc:"Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(a,b,c){return new Sk.builtin.int_(this.find$left(a,b,c))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."}, partition:{$meth:e(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings."},index:{$meth:function(a,b,c){a=this.find$left(a,b,c);if(-1===a)throw new Sk.builtin.ValueError("substring not found"); return new Sk.builtin.int_(a)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."},ljust:{$meth:f(!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."}, lower:{$meth(){return new Sk.builtin.str(this.v.toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to lowercase."},lstrip:{$meth:b(/^\s+/g,a=>"^["+a+"]+"),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rfind:{$meth(a,b,c){return new Sk.builtin.int_(this.find$right(a,b,c))},$flags:{MinArgs:1,MaxArgs:3}, $textsig:null,$doc:"S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(a,b,c){a=this.find$right(a,b,c);if(-1===a)throw new Sk.builtin.ValueError("substring not found");return new Sk.builtin.int_(a)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."}, rjust:{$meth:f(!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."},rstrip:{$meth:b(/\s+$/g,a=>"["+a+"]+$"),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rpartition:{$meth:e(!0),$flags:{OneArg:!0}, $textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string."},splitlines:{$meth:function(a){a=Sk.misceval.isTrue(a);const b=this.v,c=[],d=b.length;var e= 0;for(let g=0;g"^["+a+"]+|["+a+"]+$"),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead."},swapcase:{$meth(){const a=this.v.replace(/[a-z]/gi,a=>{const b=a.toLowerCase();return b===a?a.toUpperCase():b});return new Sk.builtin.str(a)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Convert uppercase characters to lowercase and lowercase characters to uppercase."}, upper:{$meth(){return new Sk.builtin.str(this.v.toUpperCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to uppercase."},startswith:{$meth:d("startswith",(a,b)=>0===a.indexOf(b)),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try."}, endswith:{$meth:d("endswith",(a,b)=>-1!==a.indexOf(b,a.length-b.length)),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try."},isascii:{$meth(){return new Sk.builtin.bool(/^[\x00-\x7F]*$/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)", $doc:"Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too."},islower:{$meth:function(){return new Sk.builtin.bool(this.v.length&&/[a-z]/.test(this.v)&&!/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string."}, isupper:{$meth:function(){return new Sk.builtin.bool(this.v.length&&!/[a-z]/.test(this.v)&&/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string."},istitle:{$meth:function(){const a=this.v;let b=!1,c=!1,d;for(let e=0;e str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}')."}, __format__:{$meth:Sk.formatting.formatString,$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:"Return a formatted version of the string as described by format_spec."},__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.str(this.v))},$flags:{NoArgs:!0},$textsig:null,$doc:null}}});Sk.exportSymbol("Sk.builtin.str",Sk.builtin.str);var k=/^[A-Za-z0-9]+$/,p=/([.*+?=|\\\/()\[\]\{\}^$])/g,w=/^[\s\xa0]+/;Sk.builtin.str.$py2decode=new Sk.builtin.method_descriptor(Sk.builtin.str,{$name:"decode", $meth(a,b){const c=new Sk.builtin.bytes(this.v);return Sk.builtin.bytes.$decode.call(c,a,b)},$flags:{NamedArgs:["encoding","errors"]}});var A=Sk.abstr.buildIteratorClass("str_iterator",{constructor:function(a){this.$index=0;a.$hasAstralCodePoints()?(this.$seq=a.codepoints,this.tp$iternext=()=>{const b=this.$seq[this.$index];if(void 0!==b)return new Sk.builtin.str(a.v.substring(b,this.$seq[++this.$index]))}):(this.$seq=a.v,this.tp$iternext=()=>{const a=this.$seq[this.$index++];if(void 0!==a)return new Sk.builtin.str(a)})}, iternext(){return this.tp$iternext()},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$acceptable_as_base_class:!1}}),t={abstract:!0,as:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,continue:!0,const:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,is:!0,long:!0,namespace:!0, native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,throws:!0,transient:!0,true:!0,try:!0,typeof:!0,use:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0,constructor:!0,__defineGetter__:!0,__defineSetter__:!0,apply:!0,arguments:!0,call:!0,caller:!0,eval:!0,hasOwnProperty:!0,isPrototypeOf:!0,__lookupGetter__:!0,__lookupSetter__:!0,__noSuchMethod__:!0,propertyIsEnumerable:!0,prototype:!0,toSource:!0,toLocaleString:!0, toString:!0,unwatch:!0,valueOf:!0,watch:!0,length:!0,name:!0};Sk.builtin.str.reservedWords_=t},function(m,q){Sk.builtin.func=Sk.abstr.buildNativeClass("function",{constructor:function(a,c,b,e){Sk.asserts.assert(this instanceof Sk.builtin.func,"builtin func should be called as a class with `new`");this.func_code=a;this.func_globals=c||null;this.$name=a.co_name&&a.co_name.v||a.name||"";this.$d=Sk.builtin.dict?new Sk.builtin.dict:void 0;this.$doc=a.co_docstring||Sk.builtin.none.none$;this.$module= Sk.globals&&Sk.globals.__name__||Sk.builtin.none.none$;this.$qualname=a.co_qualname&&a.co_qualname.v||this.$name;if(void 0!==e)for(let a in e)b[a]=e[a];this.func_closure=b;this.$memoiseFlags();this.memoised=a.co_fastcall||null;this.tp$call=a.co_fastcall?a.bind(this):Sk.builtin.func.prototype.tp$call.bind(this)},slots:{tp$getattr:Sk.generic.getAttr,tp$descr_get(a,c){return null===a?this:new Sk.builtin.method(this,a)},$r(){return new Sk.builtin.str("")},tp$call(a,c){this.memoised|| (this.$memoiseFlags(),this.memoised=!0);if(void 0===this.co_argcount&&void 0===this.co_varnames&&!this.co_kwargs&&!this.func_closure){if(c&&0!==c.length)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");return this.func_code.apply(this.func_globals,a)}a=this.$resolveArgs(a,c);this.func_closure&&a.push(this.func_closure);return this.func_code.apply(this.func_globals,a)}},getsets:{__name__:{$get(){return new Sk.builtin.str(this.$name)},$set(a){if(!Sk.builtin.checkString(a))throw new Sk.builtin.TypeError("__name__ must be set to a string object"); this.$name=a.$jsstr()}},__qualname__:{$get(){return new Sk.builtin.str(this.$qualname)},$set(a){if(!Sk.builtin.checkString(a))throw new Sk.builtin.TypeError("__qualname__ must be set to a string object");this.$qualname=a.$jsstr()}},__dict__:Sk.generic.getSetDict,__defaults__:{$get(){return new Sk.builtin.tuple(this.$defaults)}},__doc__:{$get(){return this.$doc},$set(a){this.$doc=a||Sk.builtin.none.none$}}},proto:{$memoiseFlags(){this.co_varnames=this.func_code.co_varnames;this.co_argcount=this.func_code.co_argcount; void 0===this.co_argcount&&this.co_varnames&&(this.co_argcount=this.co_argcount=this.co_varnames.length);this.co_kwonlyargcount=this.func_code.co_kwonlyargcount||0;this.co_varargs=this.func_code.co_varargs;this.co_kwargs=this.func_code.co_kwargs;this.$defaults=this.func_code.$defaults||[];this.$kwdefs=this.func_code.$kwdefs||[]},$resolveArgs:function(a,c){var b=this.co_argcount;void 0===b&&(b=this.co_varnames?this.co_varnames.length:a.length);var e=this.co_varnames||[],f=this.co_kwonlyargcount||0; let l=b+f;if(!(0!==f||this.co_kwargs||c&&0!==c.length||this.co_varargs)){if(a.length==b)return a;if(0===a.length&&this.$defaults&&this.$defaults.length===b){for(e=0;e!=this.$defaults.length;e++)a[e]=this.$defaults[e];return a}}let h;this.co_kwargs&&(h=[]);var d=a.length;let g=a.length<=b?a:a.slice(0,b);if(this.co_varargs)a=a.length>g.length?a.slice(g.length):[],g[l]=new Sk.builtin.tuple(a);else if(d>b)throw new Sk.builtin.TypeError(this.$name+"() takes "+b+" positional argument"+(1==b?"":"s")+" but "+ d+(1==d?" was ":" were ")+" given");if(c){if(this.func_code.no_kw)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");for(a=0;aa.indexOf(".")&&0>a.indexOf("e")&&0>a.indexOf("E"))return a;var b=0;if(0<=a.indexOf("e")){var c=a.substr(0,a.indexOf("e"));b=a.substr(a.indexOf("e")+1)}else 0<=a.indexOf("E")? (c=a.substr(0,a.indexOf("e")),b=a.substr(a.indexOf("E")+1)):c=a;b=parseInt(b,10);a=c.indexOf(".");if(0>a){if(0<=b){for(;0-b?c.substr(0,c.length+b):0}c=0===a?c.substr(1):ac.length;)c+="0";return c=0>=a?0:c.substr(0,a)};Sk.exportSymbol("Sk.builtin.asnum$nofloat",Sk.builtin.asnum$nofloat);Sk.builtin.round=function(a,c){if(void 0===a)throw new Sk.builtin.TypeError("a float is required");if(!Sk.__future__.dunder_round){if(!Sk.builtin.checkNumber(a))throw new Sk.builtin.TypeError("a float is required"); if(a.round$)return a.round$(c);throw new Sk.builtin.AttributeError(Sk.abstr.typeName(a)+" instance has no attribute '__float__'");}if(void 0!==c&&!Sk.builtin.checkNone(c)&&!Sk.misceval.isIndex(c))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(c)+"' object cannot be interpreted as an index");a=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$round);if(void 0!==a)return void 0!==c?Sk.misceval.callsimArray(a,[c]):Sk.misceval.callsimArray(a,[]);throw new Sk.builtin.TypeError("a float is required");};Sk.builtin.len= function(a){if(a.sq$length)a=a.sq$length(!0);else throw new Sk.builtin.TypeError("object of type '"+Sk.abstr.typeName(a)+"' has no len()");return Sk.misceval.chain(a,a=>new Sk.builtin.int_(a))};Sk.builtin.min=function(a,c){let b;const e=a.length;if(!e)throw new Sk.builtin.TypeError("min expected 1 argument, got 0");const [h,d]=Sk.abstr.copyKeywordsToNamedArgs("min",["default","key"],[],c,[null,Sk.builtin.none.none$]);if(1{g=a;if(void 0!==g)return Sk.builtin.checkNone(d)?Sk.misceval.iterFor(b,a=>{Sk.misceval.richCompareBool(a,g,"Lt")&&(g=a)}):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(d,[g]),a=>Sk.misceval.iterFor(b,b=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(d, [b]),c=>{Sk.misceval.richCompareBool(c,a,"Lt")&&(g=b,a=c)})))},()=>{if(void 0===g){if(null===h)throw new Sk.builtin.ValueError("min() arg is an empty sequence");g=h}return g})};Sk.builtin.max=function(a,c){let b;const e=a.length;if(!e)throw new Sk.builtin.TypeError("max expected 1 argument, got 0");const [h,d]=Sk.abstr.copyKeywordsToNamedArgs("min",["default","key"],[],c,[null,Sk.builtin.none.none$]);if(1{g=a;if(void 0!==g)return Sk.builtin.checkNone(d)?Sk.misceval.iterFor(b,a=>{Sk.misceval.richCompareBool(a,g,"Gt")&&(g=a)}):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(d,[g]),a=>Sk.misceval.iterFor(b,b=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(d, [b]),c=>{Sk.misceval.richCompareBool(c,a,"Gt")&&(g=b,a=c)})))},()=>{if(void 0===g){if(null===h)throw new Sk.builtin.ValueError("min() arg is an empty sequence");g=h}return g})};Sk.builtin.min.co_fastcall=Sk.builtin.max.co_fastcall=1;Sk.builtin.any=function(a){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),function(a){if(Sk.misceval.isTrue(a))return new Sk.misceval.Break(Sk.builtin.bool.true$)}),a=>a||Sk.builtin.bool.false$)};Sk.builtin.all=function(a){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a), function(a){if(!Sk.misceval.isTrue(a))return new Sk.misceval.Break(Sk.builtin.bool.false$)}),a=>a||Sk.builtin.bool.true$)};Sk.builtin.sum=function(a,c){function b(){return Sk.misceval.iterFor(d,a=>{if(a.constructor===Sk.builtin.int_)g=g.nb$add(a);else{if(a.constructor===Sk.builtin.float_)return g=g.nb$float().nb$add(a),new Sk.misceval.Break("float");g=Sk.abstr.numberBinOp(g,a,"Add");return new Sk.misceval.Break("slow")}})}function e(){return Sk.misceval.iterFor(d,a=>{if(a.constructor===Sk.builtin.float_|| a.constructor===Sk.builtin.int_)g=g.nb$add(a);else return g=Sk.abstr.numberBinOp(g,a,"Add"),new Sk.misceval.Break("slow")})}function h(){return Sk.misceval.iterFor(d,a=>{g=Sk.abstr.numberBinOp(g,a,"Add")})}const d=Sk.abstr.iter(a);if(void 0===c)var g=new Sk.builtin.int_(0);else{if(Sk.builtin.checkString(c))throw new Sk.builtin.TypeError("sum() can't sum strings [use ''.join(seq) instead]");g=c}a=void 0===c||c.constructor===Sk.builtin.int_?b():c.constructor===Sk.builtin.float_?"float":"slow";return Sk.misceval.chain(a, a=>"float"===a?e():a,a=>{if("slow"===a)return h()},()=>g)};Sk.builtin.zip=function(){var a,c;if(0===arguments.length)return new Sk.builtin.list([]);var f=[];for(c=0;ca||1114112<=a)throw new Sk.builtin.ValueError("chr() arg not in range(0x110000)");}else if(0>a||256<=a)throw new Sk.builtin.ValueError("chr() arg not in range(256)");return new Sk.builtin.str(String.fromCodePoint(a))}; Sk.builtin.unichr=function(a){if(!Sk.builtin.checkInt(a))throw new Sk.builtin.TypeError("an integer is required");a=Sk.builtin.asnum$(a);try{return new Sk.builtin.str(String.fromCodePoint(a))}catch(e){if(e instanceof RangeError)throw new Sk.builtin.ValueError(e.message);throw e;}};Sk.builtin.int2str_=function(a,c,f){let b;a.constructor===Sk.builtin.int_||a instanceof Sk.builtin.int_||(a=a.nb$index());b=a.v;let e=b.toString(c);e=a.nb$isnegative()?"-"+f+e.slice(1):f+e;2!==c&&!Sk.__future__.python3&& (a instanceof Sk.builtin.lng||JSBI.__isBigInt(b))&&(e+="L");return new Sk.builtin.str(e)};Sk.builtin.hex=function(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("hex() argument can't be converted to hex");return Sk.builtin.int2str_(a,16,"0x")};Sk.builtin.oct=function(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("oct() argument can't be converted to hex");return Sk.__future__.octal_number_literal?Sk.builtin.int2str_(a,8,"0o"):Sk.builtin.int2str_(a,8,"0")};Sk.builtin.bin= function(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(a)+"' object can't be interpreted as an index");return Sk.builtin.int2str_(a,2,"0b")};Sk.builtin.dir=function(a){if(void 0!==a)return a=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$dir),Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(a,[]),a=>Sk.builtin.sorted(a));throw new Sk.builtin.NotImplementedError("skulpt does not yet support dir with no args");};Sk.builtin.repr=function(a){return a.$r()};Sk.builtin.ascii= function(a){return Sk.misceval.chain(a.$r(),a=>{let b,c;for(c=0;c=d?(e=d.toString(16),2>e.length&&(e="0"+e),b+="\\x"+e):127d||57344<=d?b+="\\u"+("000"+d.toString(16)).slice(-4):55296<=d?(e=a.v.codePointAt(c),c++,e=e.toString(16),d="0000000"+e.toString(16),b=4a.tp$getattr(c,!0),a=>{if(!(a instanceof Sk.builtin.AttributeError))throw a;});return Sk.misceval.chain(b,b=>{if(void 0===b){if(void 0!==f)return f;throw new Sk.builtin.AttributeError(a.sk$attrError()+" has no attribute "+Sk.misceval.objectRepr(c));}return b})};Sk.builtin.setattr=function(a,c,f){if(!Sk.builtin.checkString(c))throw new Sk.builtin.TypeError("attribute name must be string"); return Sk.misceval.chain(a.tp$setattr(c,f,!0),()=>Sk.builtin.none.none$)};Sk.builtin.raw_input=function(a){var b=a?a:"";return Sk.misceval.chain(Sk.importModule("sys",!1,!0),function(a){return Sk.inputfunTakesPrompt?Sk.builtin.file.$readline(a.$d.stdin,null,b):Sk.misceval.chain(void 0,function(){return Sk.misceval.callsimOrSuspendArray(a.$d.stdout.write,[a.$d.stdout,new Sk.builtin.str(b)])},function(){return Sk.misceval.callsimOrSuspendArray(a.$d.stdin.readline,[a.$d.stdin])})})};Sk.builtin.input= Sk.builtin.raw_input;Sk.builtin.jseval=function(a){a=Sk.global.eval(Sk.ffi.remapToJs(a));return Sk.ffi.remapToPy(a)};Sk.builtin.jsmillis=function(){console.warn("jsmillis is deprecated");return(new Date).valueOf()};Sk.builtin.eval_=function(){throw new Sk.builtin.NotImplementedError("eval is not yet implemented");};Sk.builtin.map=function(a,c){var b=[],e,h;Sk.builtin.pyCheckArgsLen("map",arguments.length,2);if(2{a=new Sk.builtin.list(a);a.list$sort(c,f,l);return a})};Sk.builtin.filter=function(a,c){var b;Sk.builtin.pyCheckArgsLen("filter",arguments.length,2,2);if(!Sk.builtin.checkIterable(c))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(c)+"' object is not iterable");var e=function(){return[]}; var h=function(a,b){a.push(b);return a};var d=function(a){return new Sk.builtin.list(a)};c.ob$type===Sk.builtin.str?(e=function(){return new Sk.builtin.str("")},h=function(a,b){return a.sq$concat(b)},d=function(a){return a}):c.ob$type===Sk.builtin.tuple&&(d=function(a){return new Sk.builtin.tuple(a)});var g=e();var n=Sk.abstr.iter(c);for(b=n.tp$iternext();void 0!==b;b=n.tp$iternext())e=a===Sk.builtin.none.none$?new Sk.builtin.bool(b):Sk.misceval.callsimArray(a,[b]),Sk.misceval.isTrue(e)&&(g=h(g,b)); return d(g)};Sk.builtin.hasattr=function(a,c){if(!Sk.builtin.checkString(c))throw new Sk.builtin.TypeError("hasattr(): attribute name must be string");const b=Sk.misceval.tryCatch(()=>a.tp$getattr(c,!0),a=>{if(!(a instanceof Sk.builtin.AttributeError))throw a;});return Sk.misceval.chain(b,a=>void 0===a?Sk.builtin.bool.false$:Sk.builtin.bool.true$)};Sk.builtin.pow=function(a,c,f){if(void 0===f||Sk.builtin.checkNone(f))return Sk.abstr.numberBinOp(a,c,"Pow");if(!(Sk.builtin.checkInt(a)&&Sk.builtin.checkInt(c)&& Sk.builtin.checkInt(f))){if(Sk.builtin.checkFloat(a)||Sk.builtin.checkComplex(a))return a.nb$power(c,f);throw new Sk.builtin.TypeError("unsupported operand type(s) for ** or pow(): '"+Sk.abstr.typeName(a)+"', '"+Sk.abstr.typeName(c)+"', '"+Sk.abstr.typeName(f)+"'");}return a.nb$power(c,f)};Sk.builtin.quit=function(a){a=(new Sk.builtin.str(a)).v;throw new Sk.builtin.SystemExit(a);};Sk.builtin.issubclass=function(a,c){if(!Sk.builtin.checkClass(a))throw new Sk.builtin.TypeError("issubclass() arg 1 must be a class"); var b=Sk.builtin.checkClass(c);if(!(b||c instanceof Sk.builtin.tuple))throw new Sk.builtin.TypeError("issubclass() arg 2 must be a class or tuple of classes");if(b)return a.$isSubType(c)?Sk.builtin.bool.true$:Sk.builtin.bool.false$;for(b=0;b"})},slots:{tp$getattr:Sk.generic.getAttr,tp$doc:"Common base class for all exceptions",tp$new(a,c){this.hp$type?(c=new this.constructor,Sk.builtin.BaseException.call(c)): c=new this.constructor;c.args=new Sk.builtin.tuple(a.slice());return c},tp$init(a,c){Sk.abstr.checkNoKwargs(Sk.abstr.typeName(this),c)},$r(){let a=this.tp$name;a+="("+this.args.v.map(a=>Sk.misceval.objectRepr(a)).join(", ")+")";return new Sk.builtin.str(a)},tp$str(){return 1>=this.args.v.length?new Sk.builtin.str(this.args.v[0]):this.args.$r()}},getsets:{args:{$get(){return this.args}},__dict__:Sk.generic.getSetDict},proto:{toString(){let a=this.tp$name;a+=": "+this.tp$str().v;return a=0!==this.traceback.length? a+(" on line "+this.traceback[0].lineno):a+" at "}}});Sk.exportSymbol("Sk.builtin.BaseException",Sk.builtin.BaseException);Sk.builtin.Exception=Sk.abstr.buildNativeClass("Exception",{constructor:function(...a){Sk.builtin.BaseException.apply(this,a)},base:Sk.builtin.BaseException});Sk.exportSymbol("Sk.builtin.Exception",Sk.builtin.Exception);Sk.builtin.AssertionError=Sk.abstr.buildNativeClass("AssertionError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception}); Sk.exportSymbol("Sk.builtin.AssertionError",Sk.builtin.AssertionError);Sk.builtin.AttributeError=Sk.abstr.buildNativeClass("AttributeError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.ImportError=Sk.abstr.buildNativeClass("ImportError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.IndentationError=Sk.abstr.buildNativeClass("IndentationError",{constructor:function(...a){Sk.builtin.Exception.apply(this, a)},base:Sk.builtin.Exception});Sk.builtin.IndexError=Sk.abstr.buildNativeClass("IndexError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.LookupError=Sk.abstr.buildNativeClass("LookupError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.KeyError=Sk.abstr.buildNativeClass("KeyError",{constructor:function(...a){Sk.builtin.LookupError.apply(this,a)},base:Sk.builtin.LookupError});Sk.builtin.NameError= Sk.abstr.buildNativeClass("NameError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.UnboundLocalError=Sk.abstr.buildNativeClass("UnboundLocalError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.OverflowError=Sk.abstr.buildNativeClass("OverflowError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.SyntaxError=Sk.abstr.buildNativeClass("SyntaxError", {constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.RuntimeError=Sk.abstr.buildNativeClass("RuntimeError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.RuntimeError",Sk.builtin.RuntimeError);Sk.builtin.SuspensionError=Sk.abstr.buildNativeClass("SuspensionError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.SuspensionError", Sk.builtin.SuspensionError);Sk.builtin.SystemExit=Sk.abstr.buildNativeClass("SystemExit",{constructor:function(...a){Sk.builtin.BaseException.apply(this,a)},base:Sk.builtin.BaseException});Sk.exportSymbol("Sk.builtin.SystemExit",Sk.builtin.SystemExit);Sk.builtin.TypeError=Sk.abstr.buildNativeClass("TypeError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.TypeError",Sk.builtin.TypeError);Sk.builtin.ValueError=Sk.abstr.buildNativeClass("ValueError", {constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.ValueError",Sk.builtin.ValueError);Sk.builtin.ZeroDivisionError=Sk.abstr.buildNativeClass("ZeroDivisionError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.builtin.TimeLimitError=Sk.abstr.buildNativeClass("TimeLimitError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.TimeLimitError", Sk.builtin.TimeLimitError);Sk.builtin.IOError=Sk.abstr.buildNativeClass("IOError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.IOError",Sk.builtin.IOError);Sk.builtin.NotImplementedError=Sk.abstr.buildNativeClass("NotImplementedError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.NotImplementedError",Sk.builtin.NotImplementedError);Sk.builtin.NegativePowerError= Sk.abstr.buildNativeClass("NegativePowerError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.NegativePowerError",Sk.builtin.NegativePowerError);Sk.builtin.ExternalError=Sk.abstr.buildNativeClass("ExternalError",{constructor:function(...a){this.nativeError=a[0];if(!Sk.builtin.checkString(this.nativeError)&&(a[0]=this.nativeError.toString(),a[0].startsWith("RangeError: Maximum call")))return a[0]="Maximum call stack size exceeded", new Sk.builtin.RecursionError(...a);Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.ExternalError",Sk.builtin.ExternalError);Sk.builtin.RecursionError=Sk.abstr.buildNativeClass("RecursionError",{constructor:function(...a){Sk.builtin.RuntimeError.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.RecursionError",Sk.builtin.RecursionError);Sk.builtin.OperationError=Sk.abstr.buildNativeClass("OperationError",{constructor:function(...a){Sk.builtin.Exception.apply(this, a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.OperationError",Sk.builtin.OperationError);Sk.builtin.SystemError=Sk.abstr.buildNativeClass("SystemError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.SystemError",Sk.builtin.SystemError);Sk.builtin.UnicodeDecodeError=Sk.abstr.buildNativeClass("UnicodeDecodeError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.UnicodeDecodeError", Sk.builtin.UnicodeDecodeError);Sk.builtin.UnicodeEncodeError=Sk.abstr.buildNativeClass("UnicodeEncodeError",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.UnicodeEncodeError",Sk.builtin.UnicodeEncodeError);Sk.builtin.StopIteration=Sk.abstr.buildNativeClass("StopIteration",{constructor:function(...a){Sk.builtin.Exception.apply(this,a)},base:Sk.builtin.Exception});Sk.exportSymbol("Sk.builtin.StopIteration",Sk.builtin.StopIteration); Sk.builtin.getExcInfo=function(a){return new Sk.builtin.tuple([a.ob$type||Sk.builtin.none.none$,a,Sk.builtin.none.none$])}},function(m,q){Sk.builtin.method=Sk.abstr.buildNativeClass("method",{constructor:function(a,c){Sk.asserts.assert(this instanceof Sk.builtin.method,"bad call to method constructor, use 'new'");this.im_func=a;this.im_self=c;this.im_call=a.tp$call},slots:{$r(){let a=this.im_func.tp$getattr(Sk.builtin.str.$qualname)||this.im_func.tp$getattr(Sk.builtin.str.$name);a=a&&a.v||"?";return new Sk.builtin.str("")},tp$hash(){const a=Sk.abstr.objectHash(this.im_self),c=Sk.abstr.objectHash(this.im_func);return a+c},tp$call(a,c){var b=this.im_call;if(void 0===b)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this.im_func)+"' object is not callable");a=[this.im_self,...a];return b.call(this.im_func,a,c)},tp$new(a,c){Sk.abstr.checkNoKwargs("method",c);Sk.abstr.checkArgsLen("method",a,2,2);c=a[0];a=a[1];if(!Sk.builtin.checkCallable(c))throw new Sk.builtin.TypeError("first argument must be callable"); if(Sk.builtin.checkNone(a))throw new Sk.builtin.TypeError("self must not be None");return new Sk.builtin.method(c,a)},tp$richcompare(a,c){if("Eq"!=c&&"NotEq"!=c||!(a instanceof Sk.builtin.method))return Sk.builtin.NotImplemented.NotImplemented$;let b;try{b=Sk.misceval.richCompareBool(this.im_self,a.im_self,"Eq",!1)&&this.im_func==a.im_func}catch(e){b=!1}return"Eq"==c?b:!b},tp$descr_get(a,c){return this},tp$getattr(a,c){const b=Sk.abstr.lookupSpecial(this,a);return void 0!==b?b:this.im_func.tp$getattr(a, c)}},getsets:{__func__:{$get(){return this.im_func}},__self__:{$get(){return this.im_self}},__doc__:{$get(){return this.im_func.tp$getattr(Sk.builtin.str.$doc)}}},flags:{sk$suitable_as_base_class:!1}})},function(m,q){function a(a){if(null!==a&&void 0!==a){if(a.nb$index)return a.nb$index();if("number"===typeof a&&Number.isInteger(a))return a}}function c(b,c){const e=a(b);if(void 0!==e)return e;c=(c||"'{tp$name}' object cannot be interpreted as an integer").replace("{tp$name}",Sk.abstr.typeName(b)); throw new Sk.builtin.TypeError(c);}Sk.misceval={};Sk.misceval.Suspension=function(a,c,f){this.$isSuspension=!0;void 0!==a&&void 0!==c&&(this.resume=function(){return a(c.resume())});this.child=c;this.optional=void 0!==c&&c.optional;this.data=void 0===f&&void 0!==c?c.data:f};Sk.exportSymbol("Sk.misceval.Suspension",Sk.misceval.Suspension);Sk.misceval.retryOptionalSuspensionOrThrow=function(a,c){for(;a instanceof Sk.misceval.Suspension;){if(!a.optional)throw new Sk.builtin.SuspensionError(c||"Cannot call a function that blocks or suspends here"); a=a.resume()}return a};Sk.exportSymbol("Sk.misceval.retryOptionalSuspensionOrThrow",Sk.misceval.retryOptionalSuspensionOrThrow);Sk.misceval.isIndex=function(a){return null!==a&&void 0!==a&&(void 0!==a.nb$index||"number"===typeof a&&Number.isInteger(a))};Sk.exportSymbol("Sk.misceval.isIndex",Sk.misceval.isIndex);Sk.misceval.asIndex=a;Sk.misceval.asIndexSized=function(a,e,f){f=c(a,f);if("number"===typeof f)return f;if(null==e)return JSBI.lessThan(f,JSBI.__ZERO)?-Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER; throw new e("cannot fit '"+Sk.abstr.typeName(a)+"' into an index-sized integer");};Sk.misceval.asIndexOrThrow=c;Sk.misceval.applySlice=function(a,c,f,l){return Sk.abstr.objectGetItem(a,new Sk.builtin.slice(c,f,null),l)};Sk.exportSymbol("Sk.misceval.applySlice",Sk.misceval.applySlice);Sk.misceval.assignSlice=function(a,c,f,l,h){c=new Sk.builtin.slice(c,f);return null===l?Sk.abstr.objectDelItem(a,c):Sk.abstr.objectSetItem(a,c,l,h)};Sk.exportSymbol("Sk.misceval.assignSlice",Sk.misceval.assignSlice); Sk.misceval.arrayFromArguments=function(a){var b;if(1!=a.length)return a;var c=a[0];c instanceof Sk.builtin.set?c=c.tp$iter().$obj:c instanceof Sk.builtin.dict&&(c=Sk.builtin.dict.prototype.keys.func_code(c));if(c instanceof Sk.builtin.list||c instanceof Sk.builtin.tuple)return c.v;if(Sk.builtin.checkIterable(c)){a=[];c=Sk.abstr.iter(c);for(b=c.tp$iternext();void 0!==b;b=c.tp$iternext())a.push(b);return a}throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(c)+"' object is not iterable");};Sk.exportSymbol("Sk.misceval.arrayFromArguments", Sk.misceval.arrayFromArguments);Sk.misceval.iterator=Sk.abstr.buildIteratorClass("iterator",{constructor:function(a,c){this.tp$iternext=c?a:function(b){let c=a();return b||!c.$isSuspension?c:Sk.misceval.retryOptionalSuspensionOrThrow(c)}},iternext:function(a){return this.tp$iternext(a)},flags:{sk$acceptable_as_base_class:!1}});Sk.misceval.swappedOp_={Eq:"Eq",NotEq:"NotEq",Lt:"Gt",LtE:"GtE",Gt:"Lt",GtE:"LtE"};Sk.misceval.opSymbols={Eq:"==",NotEq:"!=",Lt:"<",LtE:"<=",Gt:">",GtE:">=",Is:"is",IsNot:"is not", In_:"in",NotIn:"not in"};Sk.misceval.richCompareBool=function(a,c,f,l){Sk.asserts.assert(a.sk$object&&c.sk$object,"JS object passed to richCompareBool");var b;var d=a.ob$type;var e=c.ob$type,n=e!==d&&void 0===e.sk$baseClass&&e.$isSubType(d);if(!Sk.__future__.python3&&d!==e&&("GtE"===f||"Gt"===f||"LtE"===f||"Lt"===f)){var k=[Sk.builtin.float_,Sk.builtin.int_,Sk.builtin.lng,Sk.builtin.bool],p=[Sk.builtin.dict,Sk.builtin.enumerate,Sk.builtin.filter_,Sk.builtin.list,Sk.builtin.map_,Sk.builtin.str,Sk.builtin.tuple, Sk.builtin.zip_];const b=k.indexOf(d),g=p.indexOf(d);k=k.indexOf(e);p=p.indexOf(e);if(a===Sk.builtin.none.none$)switch(f){case "Lt":return!0;case "LtE":return!0;case "Gt":return!1;case "GtE":return!1}if(c===Sk.builtin.none.none$)switch(f){case "Lt":return!1;case "LtE":return!1;case "Gt":return!0;case "GtE":return!0}if(-1!==b&&-1!==p)switch(f){case "Lt":return!0;case "LtE":return!0;case "Gt":return!1;case "GtE":return!1}if(-1!==g&&-1!==k)switch(f){case "Lt":return!1;case "LtE":return!1;case "Gt":return!0; case "GtE":return!0}if(-1!==g&&-1!==p)switch(f){case "Lt":return gp;case "GtE":return g>=p}}if("Is"===f){if(d===e){if(a===c)return!0;if(d===Sk.builtin.float_)return a.v===c.v;if(d===Sk.builtin.int_)return"number"===typeof a.v&&"number"===typeof a.v?a.v===c.v:JSBI.equal(JSBI.BigInt(a.v),JSBI.BigInt(c.v))}return!1}if("IsNot"===f)return d!==e?!0:d===Sk.builtin.float_?a.v!==c.v:d===Sk.builtin.int_?"number"===typeof a.v&&"number"===typeof a.v?a.v!==c.v:JSBI.notEqual(JSBI.BigInt(a.v), JSBI.BigInt(c.v)):a!==c;if("In"===f)return Sk.misceval.chain(Sk.abstr.sequenceContains(c,a,l),Sk.misceval.isTrue);if("NotIn"===f)return Sk.misceval.chain(Sk.abstr.sequenceContains(c,a,l),function(a){return!Sk.misceval.isTrue(a)});e={Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"};d=e[f];if(n&&(l=e[Sk.misceval.swappedOp_[f]],c[l]!==a[l]&&(b=c[l](a))!==Sk.builtin.NotImplemented.NotImplemented$)||(b=a[d](c))!==Sk.builtin.NotImplemented.NotImplemented$||!n&&(l=e[Sk.misceval.swappedOp_[f]], (b=c[l](a))!==Sk.builtin.NotImplemented.NotImplemented$))return Sk.misceval.isTrue(b);if(!Sk.__future__.python3){if(n=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$cmp))try{b=Sk.misceval.callsimArray(n,[c]);if(Sk.builtin.checkNumber(b)){b=Sk.builtin.asnum$(b);if("Eq"===f)return 0===b;if("NotEq"===f)return 0!==b;if("Lt"===f)return 0>b;if("Gt"===f)return 0=b;if("GtE"===f)return 0<=b}if(b!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int"); }catch(w){throw new Sk.builtin.TypeError("comparison did not return an int");}if(n=Sk.abstr.lookupSpecial(c,Sk.builtin.str.$cmp))try{b=Sk.misceval.callsimArray(n,[a]);if(Sk.builtin.checkNumber(b)){b=Sk.builtin.asnum$(b);if("Eq"===f)return 0===b;if("NotEq"===f)return 0!==b;if("Lt"===f)return 0b;if("LtE"===f)return 0<=b;if("GtE"===f)return 0>=b}if(b!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int");}catch(w){throw new Sk.builtin.TypeError("comparison did not return an int"); }if(a===Sk.builtin.none.none$&&c===Sk.builtin.none.none$){if("Eq"===f)return a.v===c.v;if("NotEq"===f)return a.v!==c.v;if("Gt"===f)return a.v>c.v;if("GtE"===f)return a.v>=c.v;if("Lt"===f)return a.v";throw e;}};Sk.exportSymbol("Sk.misceval.objectRepr",Sk.misceval.objectRepr);Sk.misceval.opAllowsEquality=function(a){switch(a){case "LtE":case "Eq":case "GtE":return!0}return!1};Sk.exportSymbol("Sk.misceval.opAllowsEquality",Sk.misceval.opAllowsEquality);Sk.misceval.isTrue=function(a){return!0=== a||a===Sk.builtin.bool.true$?!0:!1===a||a===Sk.builtin.bool.false$||null===a||void 0===a?!1:a.nb$bool?a.nb$bool():a.sq$length?0!==a.sq$length():!!a};Sk.exportSymbol("Sk.misceval.isTrue",Sk.misceval.isTrue);Sk.misceval.softspace_=!1;Sk.misceval.print_=function(a){Sk.misceval.softspace_&&("\n"!==a&&Sk.output(" "),Sk.misceval.softspace_=!1);var b=new Sk.builtin.str(a);return Sk.misceval.chain(Sk.importModule("sys",!1,!0),function(a){return Sk.misceval.apply(a.$d.stdout.write,void 0,void 0,void 0,[a.$d.stdout, b])},function(){var a;(a=0===b.v.length)||(a=b.v[b.v.length-1],a=!("\n"===a||"\t"===a||"\r"===a));if(a||" "===b.v[b.v.length-1])Sk.misceval.softspace_=!0})};Sk.exportSymbol("Sk.misceval.print_",Sk.misceval.print_);Sk.misceval.loadname=function(a,c){c=c[a];if(void 0!==c)return c;c=Sk.builtins[a];if(void 0!==c)return c;throw new Sk.builtin.NameError("name '"+Sk.unfixReserved(a)+"' is not defined");};Sk.exportSymbol("Sk.misceval.loadname",Sk.misceval.loadname);Sk.misceval.call=function(a,c,f,l,h){h= Array.prototype.slice.call(arguments,4);return Sk.misceval.apply(a,c,f,l,h)};Sk.exportSymbol("Sk.misceval.call",Sk.misceval.call);Sk.misceval.callAsync=function(a,c,f,l,h,d){d=Array.prototype.slice.call(arguments,5);return Sk.misceval.applyAsync(a,c,f,l,h,d)};Sk.exportSymbol("Sk.misceval.callAsync",Sk.misceval.callAsync);Sk.misceval.callOrSuspend=function(a,c,f,l,h){h=Array.prototype.slice.call(arguments,4);return Sk.misceval.applyOrSuspend(a,c,f,l,h)};Sk.exportSymbol("Sk.misceval.callOrSuspend", Sk.misceval.callOrSuspend);Sk.misceval.callsim=function(a,c){c=Array.prototype.slice.call(arguments,1);return Sk.misceval.apply(a,void 0,void 0,void 0,c)};Sk.exportSymbol("Sk.misceval.callsim",Sk.misceval.callsim);Sk.misceval.callsimArray=function(a,c,f){c=c||[];return Sk.misceval.retryOptionalSuspensionOrThrow(Sk.misceval.callsimOrSuspendArray(a,c,f))};Sk.exportSymbol("Sk.misceval.callsimArray",Sk.misceval.callsimArray);Sk.misceval.callsimAsync=function(a,c,f){f=Array.prototype.slice.call(arguments, 2);return Sk.misceval.applyAsync(a,c,void 0,void 0,void 0,f)};Sk.exportSymbol("Sk.misceval.callsimAsync",Sk.misceval.callsimAsync);Sk.misceval.callsimOrSuspend=function(a,c){c=Array.prototype.slice.call(arguments,1);return Sk.misceval.applyOrSuspend(a,void 0,void 0,void 0,c)};Sk.exportSymbol("Sk.misceval.callsimOrSuspend",Sk.misceval.callsimOrSuspend);Sk.misceval.callsimOrSuspendArray=function(a,c,f){c=c||[];return void 0!==a&&a.tp$call?a.tp$call(c,f):Sk.misceval.applyOrSuspend(a,void 0,void 0,f, c)};Sk.exportSymbol("Sk.misceval.callsimOrSuspendArray",Sk.misceval.callsimOrSuspendArray);Sk.misceval.apply=function(a,c,f,l,h){a=Sk.misceval.applyOrSuspend(a,c,f,l,h);return a instanceof Sk.misceval.Suspension?Sk.misceval.retryOptionalSuspensionOrThrow(a):a};Sk.exportSymbol("Sk.misceval.apply",Sk.misceval.apply);Sk.misceval.asyncToPromise=function(a,c){return new Promise(function(b,e){try{(function g(a){try{for(var d=function(){try{g(a.resume())}catch(t){e(t)}},f=function(b){try{a.data.result=b, d()}catch(y){e(y)}},p=function(b){try{a.data.error=b,d()}catch(y){e(y)}};a instanceof Sk.misceval.Suspension;){var l=c&&(c[a.data.type]||c["*"]);if(l){var A=l(a);if(A){A.then(g,e);return}}if("Sk.promise"==a.data.type){a.data.promise.then(f,p);return}if("Sk.yield"==a.data.type){Sk.global.setImmediate(d);return}if("Sk.delay"==a.data.type){Sk.global.setImmediate(d);return}if(a.optional)a=a.resume();else throw new Sk.builtin.SuspensionError("Unhandled non-optional suspension of type '"+a.data.type+"'"); }b(a)}catch(t){e(t)}})(a())}catch(h){e(h)}})};Sk.exportSymbol("Sk.misceval.asyncToPromise",Sk.misceval.asyncToPromise);Sk.misceval.applyAsync=function(a,c,f,l,h,d){return Sk.misceval.asyncToPromise(function(){return Sk.misceval.applyOrSuspend(c,f,l,h,d)},a)};Sk.exportSymbol("Sk.misceval.applyAsync",Sk.misceval.applyAsync);Sk.misceval.chain=function(a,c){for(var b=1,e=a,h,d;;){if(b==arguments.length)return e;if(e&&e.$isSuspension)break;e=arguments[b](e);b++}d=Array(arguments.length-b);for(h=0;ha[b++]},c,f)};Sk.misceval.arrayFromIterable=function(a,c){if(void 0===a)return[];if(void 0===a.hp$type&&void 0!==a.sk$asarray)return a.sk$asarray();const b=[];a=Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{b.push(a)}),()=>b);return c?a:Sk.misceval.retryOptionalSuspensionOrThrow(a)};Sk.misceval.Break=function(a){if(!(this instanceof Sk.misceval.Break))return new Sk.misceval.Break(a);this.brValue=a};Sk.exportSymbol("Sk.misceval.Break", Sk.misceval.Break);Sk.misceval.applyOrSuspend=function(a,c,f,l,h){var b;if(null==a||a===Sk.builtin.none.none$)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(a)+"' object is not callable");"function"===typeof a&&void 0===a.tp$call&&(a=new Sk.builtin.func(a));var e=a.tp$call;if(void 0!==e){if(f)for(f=f.tp$iter(),b=f.tp$iternext();void 0!==b;b=f.tp$iternext())h.push(b);if(c)for(f=Sk.abstr.iter(c),b=f.tp$iternext();void 0!==b;b=f.tp$iternext()){if(!Sk.builtin.checkString(b))throw new Sk.builtin.TypeError("Function keywords must be strings"); l.push(b.v);l.push(Sk.abstr.objectGetItem(c,b,!1))}return e.call(a,h,l,c)}e=a.__call__;if(void 0!==e)return h.unshift(a),Sk.misceval.apply(e,c,f,l,h);throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(a)+"' object is not callable");};Sk.exportSymbol("Sk.misceval.applyOrSuspend",Sk.misceval.applyOrSuspend);Sk.misceval.promiseToSuspension=function(a){var b=new Sk.misceval.Suspension;b.resume=function(){if(b.data.error)throw b.data.error;return b.data.result};b.data={type:"Sk.promise",promise:a};return b}; Sk.exportSymbol("Sk.misceval.promiseToSuspension",Sk.misceval.promiseToSuspension);Sk.misceval.buildClass=function(a,c,f,l,h){var b=Sk.builtin.type,e={};c(a,e,void 0===h?{}:h);a.__name__&&(e.__module__=a.__name__);a=new Sk.builtin.str(f);l=new Sk.builtin.tuple(l);c=[];for(var n in e)e.hasOwnProperty(n)&&(c.push(new Sk.builtin.str(n)),c.push(e[n]));c=new Sk.builtin.dict(c);return Sk.misceval.callsimArray(b,[a,l,c])};Sk.exportSymbol("Sk.misceval.buildClass",Sk.misceval.buildClass)},function(m,q){Sk.builtin.callable_iter_= Sk.abstr.buildIteratorClass("callable_iterator",{constructor:function(a,c){if(!Sk.builtin.checkCallable(a))throw new Sk.builtin.TypeError("iter(v, w): v must be callable");this.$callable=a;this.$sentinel=c;this.$flag=!1},iternext(a){if(!0!==this.$flag){if(a)return a=Sk.misceval.callsimOrSuspendArray(this.$callable,[]),Sk.misceval.chain(a,a=>{if(Sk.misceval.richCompareBool(a,this.$sentinel,"Eq",!0))this.$flag=!0;else return a});a=Sk.misceval.callsimArray(this.$callable,[]);if(Sk.misceval.richCompareBool(a, this.$sentinel,"Eq",!1))this.$flag=!0;else return a}},flags:{sk$acceptable_as_base_class:!1}});Sk.builtin.seq_iter_=Sk.abstr.buildIteratorClass("iterator",{constructor:function(a){this.$index=0;this.$seq=a},iternext(a){let c;c=Sk.misceval.tryCatch(()=>this.$seq.mp$subscript(new Sk.builtin.int_(this.$index++),a),a=>{if(!(a instanceof Sk.builtin.IndexError||a instanceof Sk.builtin.StopIteration))throw a;});return a?c:Sk.misceval.retryOptionalSuspensionOrThrow(c)},methods:{__length_hint__:{$flags:{NoArgs:!0}, $meth(){if(this.$seq.sq$length)return this.$seq.sq$length()-this.$index;throw new Sk.builtin.NotImplementedError("len is not implemented for "+Sk.abstr.typeName(this.$seq));}}},flags:{sk$acceptable_as_base_class:!1}});Sk.exportSymbol("Sk.builtin.callable_iter_",Sk.builtin.callable_iter_)},function(m,q){Sk.builtin.list=Sk.abstr.buildNativeClass("list",{constructor:function(a){void 0===a?a=[]:Array.isArray(a)||(a=Sk.misceval.arrayFromIterable(a));Sk.asserts.assert(this instanceof Sk.builtin.list,"bad call to list, use 'new' with an Array of python objects"); this.v=a;this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$doc:"Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.",tp$new:Sk.generic.new,tp$init(a,c){Sk.abstr.checkNoKwargs("list",c);Sk.abstr.checkArgsLen("list",a,0,1);return Sk.misceval.chain(Sk.misceval.arrayFromIterable(a[0],!0),a=>{this.v=a})},$r(){if(this.in$repr)return new Sk.builtin.str("[...]"); this.in$repr=!0;const a=this.v.map(a=>Sk.misceval.objectRepr(a));this.in$repr=!1;return new Sk.builtin.str("["+a.join(", ")+"]")},tp$richcompare:Sk.generic.seqCompare,tp$iter(){return new a(this)},sq$length(){return this.v.length},sq$concat(a){if(!(a instanceof Sk.builtin.list))throw new Sk.builtin.TypeError("can only concatenate list to list");return new Sk.builtin.list(this.v.concat(a.v))},sq$contains(a){for(let b=this.tp$iter(),c=b.tp$iternext();void 0!==c;c=b.tp$iternext())if(c===a||Sk.misceval.richCompareBool(c, a,"Eq"))return!0;return!1},sq$repeat(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(a)+"'");a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);if(a*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;const b=[];for(let c=0;c{b.push(this.v[a])});return new Sk.builtin.list(b)}throw new Sk.builtin.TypeError("list indices must be integers or slices, not "+Sk.abstr.typeName(a));},mp$ass_subscript(a,c){void 0===c?this.del$subscript(a):this.ass$subscript(a,c)},sq$inplace_concat(a){return a===this?(this.v.push(...this.v),this):Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{this.v.push(a)}), ()=>this)},sq$inplace_repeat(a){if(!Sk.misceval.isIndex(a))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(a)+"'");a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);const b=this.v.length;if(0>=a)this.v.length=0;else if(a*b>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;for(let c=1;c{this.v.push(a)}),()=>Sk.builtin.none.none$)},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Extend list by appending elements from the iterable."}, pop:{$meth(a){a=void 0===a?this.v.length-1:Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);a=this.list$inRange(a,"pop index out of range");const b=this.v[a];this.v.splice(a,1);return b},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, index=-1, /)",$doc:"Remove and return item at index (default last).\n\nRaises IndexError if list is empty or index is out of range."},remove:{$meth(a){a=this.list$indexOf(a);if(-1===a)throw new Sk.builtin.ValueError("list.remove(x): x not in list");this.v.splice(a, 1);return Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:"($self, value, /)",$doc:"Remove first occurrence of value.\n\nRaises ValueError if the value is not present."},sort:{$meth(a,c){if(a.length)throw new Sk.builtin.TypeError("sort() takes no positional arguments");const [b,e]=Sk.abstr.copyKeywordsToNamedArgs("sort",["key","reverse"],a,c,[Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(void 0,b,e)},$flags:{FastCall:!0},$textsig:"($self, /, *, key=None, reverse=False)", $doc:"Stable sort *IN PLACE*."},index:{$meth(a,c,f){if(void 0!==c&&!Sk.misceval.isIndex(c)||void 0!==f&&!Sk.misceval.isIndex(f))throw new Sk.builtin.TypeError("slice indices must be integers or have an __index__ method");c=this.list$indexOf(a,c,f);if(-1===c)throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(a)+" is not in list");return new Sk.builtin.int_(c)},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($self, value, start=0, stop=sys.maxsize, /)",$doc:"Return first index of value.\n\nRaises ValueError if the value is not present."}, count:{$meth(a){let b=0;const c=this.v.length;for(let e=0;ea&&(a+=this.v.length);if(0<=a&&a{b.push(a)});if(!Sk.builtin.checkIterable(c))throw new Sk.builtin.TypeError("must assign iterable to extended slice"); a=Sk.misceval.arrayFromIterable(c);if(b.length!==a.length)throw new Sk.builtin.ValueError("attempt to assign sequence of size "+a.length+" to extended slice of size "+b.length);for(c=0;c{this.v.splice(a-b,1);b+=c})}}});Sk.exportSymbol("Sk.builtin.list",Sk.builtin.list);Sk.builtin.list.py2$methods={sort:{$name:"sort",$meth(a,c){const [b,e,h]=Sk.abstr.copyKeywordsToNamedArgs("sort",["cmp","key","reverse"],a,c,[Sk.builtin.none.none$, Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(b,e,h)},$flags:{FastCall:!0},$textsig:"($self, cmp=None, key=None, reverse=False)",$doc:"Stable sort *IN PLACE*."}};var a=Sk.abstr.buildIteratorClass("list_iterator",{constructor:function(a){this.$index=0;this.$seq=a.v},iternext:Sk.generic.iterNextWithArray,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$acceptable_as_base_class:!1}}),c=Sk.abstr.buildIteratorClass("list_reverseiterator",{constructor:function(a){this.$index= a.v.length-1;this.$seq=a.v},iternext(){const a=this.$seq[this.$index--];if(void 0===a)this.tp$iternext=()=>{};else return a},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$acceptable_as_base_class:!1}})},function(m,q,a){function c(a){var b=a.replace(K,"").replace(G,"_").toLowerCase();b=F[b];return void 0===b?a:b}function b(a,b,c){if(void 0===b)b="utf-8";else if(Sk.builtin.checkString(b))b=b.$jsstr();else throw new Sk.builtin.TypeError(a+"() argument "+("bytesstr".includes(a)? 2:1)+" must be str not "+Sk.abstr.typeName(b));if(void 0===c)c="strict";else if(Sk.builtin.checkString(c))c=c.$jsstr();else throw new Sk.builtin.TypeError(a+"() argument "+("bytesstr".includes(a)?3:2)+" must be str not "+Sk.abstr.typeName(c));return{encoding:b,errors:c}}function e(a,b,d){a=a.$jsstr();b=c(b);if("strict"!==d&&"ignore"!==d&&"replace"!==d)throw new Sk.builtin.NotImplementedError("'"+d+"' error handling not implemented in Skulpt");if("ascii"===b){b=[];for(e in a){const c=a.charCodeAt(e); if(127=a?"\\x":"\\u";a=a.toString(16);3===a.length&&(a=a.slice(1,3));return a=1===a.length?b+"0"+a:b+a}function l(a,d){({encoding:a, errors:d}=b("decode",a,d));a=c(a);if("strict"!==d&&"ignore"!==d&&"replace"!==d)throw new Sk.builtin.NotImplementedError("'"+d+"' error handling not implemented in Skulpt");if("ascii"===a){a=this.v;var e="";for(let b=0;b=c&&bc)return new Sk.builtin.tuple([new Sk.builtin.bytes,new Sk.builtin.bytes,this])}else if(c=this.find$subleft(b,0,this.v.length),0>c)return new Sk.builtin.tuple([this,new Sk.builtin.bytes, new Sk.builtin.bytes]);return new Sk.builtin.tuple([new Sk.builtin.bytes(this.v.subarray(0,c)),new Sk.builtin.bytes(b),new Sk.builtin.bytes(this.v.subarray(c+b.length))])}}function n(a,b){return function(c){var d=void 0===c||c===Sk.builtin.none.none$?new Uint8Array([9,10,11,12,13,32,133]):this.get$raw(c);c=0;var e=this.v.length;if(a)for(;cc&&d.includes(this.v[e-1]);)e--;d=new Uint8Array(e-c);for(e=0;e=a||32===a}function w(a){return 97<=a&&122>=a}function A(a){return 65<=a&&90>=a}function t(a){return 48<=a&&57>=a}function y(a,b){return function(){return 0===this.v.length?b?Sk.builtin.bool.true$:Sk.builtin.bool.false$:this.v.every(b=>a(b))?Sk.builtin.bool.true$:Sk.builtin.bool.false$}}function B(a,b){return function(){let c=!1;for(let d=0;d0<=a&&255>=a),"bad internal call to bytes with array"),this.v=new Uint8Array(a);else if("string"===typeof a){let b;const c=new Uint8Array(a.length),d=a.length;for(let e=0;e bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", tp$new(a,c){if(this!==Sk.builtin.bytes.prototype)return this.$subtype_new(a,c);c=c||[];if(1>=a.length&&0===+c.length)a=a[0];else{[a,d,c]=Sk.abstr.copyKeywordsToNamedArgs("bytes",[null,"pySource","errors"],a,c);({encoding:d,errors:c}=b("bytes",d,c));if(!Sk.builtin.checkString(a))throw new Sk.builtin.TypeError("encoding or errors without a string argument");return e(a,d,c)}if(void 0===a)return new Sk.builtin.bytes;if(void 0!==(c=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$bytes))){var d=Sk.misceval.callsimOrSuspendArray(c, []);return Sk.misceval.chain(d,a=>{if(!Sk.builtin.checkBytes(a))throw new Sk.builtin.TypeError("__bytes__ returned non-bytes (type "+Sk.abstr.typeName(a)+")");return a})}if(Sk.misceval.isIndex(a)){d=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);if(0>d)throw new Sk.builtin.ValueError("negative count");return new Sk.builtin.bytes(d)}if(Sk.builtin.checkBytes(a))return new Sk.builtin.bytes(a.v);if(Sk.builtin.checkString(a))throw new Sk.builtin.TypeError("string argument without an encoding");if(Sk.builtin.checkIterable(a)){let b= [];d=Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{a=Sk.misceval.asIndexSized(a);if(0>a||255new Sk.builtin.bytes(b))}throw new Sk.builtin.TypeError("cannot convert '"+Sk.abstr.typeName(d)+"' object into bytes");},$r(){let a,b="'";const c=-1!==this.v.indexOf(34);let d="";for(let e=0;ea||10a||13a||126a.length||c[d]>a[d];case "GtE":return d===e&&c.length>=a.length||c[d]>=a[d]}},tp$hash(){return(new Sk.builtin.str(this.$jsstr())).tp$hash()},tp$as_sequence_or_mapping:!0,mp$subscript(a){if(Sk.misceval.isIndex(a)){let b=Sk.misceval.asIndexSized(a, Sk.builtin.IndexError);if(void 0!==b){0>b&&(b=this.v.length+b);if(0>b||b>=this.v.length)throw new Sk.builtin.IndexError("index out of range");return new Sk.builtin.int_(this.v[b])}}else if(a instanceof Sk.builtin.slice){const b=[];a.sssiter$(this.v.length,a=>{b.push(this.v[a])});return new Sk.builtin.bytes(new Uint8Array(b))}throw new Sk.builtin.TypeError("byte indices must be integers or slices, not "+Sk.abstr.typeName(a));},sq$length(){return this.v.length},sq$concat(a){if(!(a instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("can't concat "+ Sk.abstr.typeName(a)+" to bytes");const b=new Uint8Array(this.v.length+a.v.length);let c;for(c=0;cNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;if(0>= a)return new Sk.builtin.bytes;a=new Uint8Array(b);let c=0;for(;ca||255b?Infinity:b;a=Sk.builtin.checkNone(a)?null:this.get$raw(a);if(null!==a&&!a.length)throw new Sk.builtin.ValueError("empty separator");return{sep:a,maxsplit:b}},find$left:d(!1), find$right:d(!0),find$subleft:function(a,b,c){c=c-a.length+1;let d=b;for(;da===this.v[d+b]))return d;d++}return-1},find$subright(a,b,c){let d=c-a.length;for(;d>=b;){if(a.every((a,b)=>a===this.v[d+b]))return d;d--}return-1},$subtype_new(a,b){const c=new this.constructor;a=Sk.builtin.bytes.prototype.tp$new(a,b);c.v=a.v;return c},sk$asarray(){const a=[];this.v.forEach(b=>{a.push(new Sk.builtin.int_(b))});return a}},flags:{str$encode:e,$decode:l,check$encodeArgs:b},methods:{__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.bytes(this.v))}, $flags:{NoArgs:!0},$textsig:null,$doc:null},capitalize:{$meth(){const a=this.v.length;if(0===a)return new Sk.builtin.bytes(this.v);const b=new Uint8Array(a);let c=this.v[0];b[0]=w(c)?c-32:c;for(let d=1;d copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased."},center:{$meth:k("center",!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:null, $doc:"B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space)."},count:{$meth(a,b,c){a=this.get$tgt(a);({start:b,end:c}=Sk.builtin.slice.startEnd$wrt(this,b,c));let d=0;if("number"===typeof a)for(;ba===this.v[e+b])&&(d++,e+=a.length-1)}return new Sk.builtin.int_(d)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation."}, decode:{$meth:l,$flags:{NamedArgs:["encoding","errors"]},$textsig:"($self, /, encoding='utf-8', errors='strict')",$doc:"Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors."}, endswith:{$meth:h("endswith",(a,b)=>{const c=a.length-b.length;return 0<=c&&b.every((b,d)=>b===a[c+d])}),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try."},expandtabs:{$meth(a){a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError,"an integer is required (got type {tp$nam})"); const b=[];let c=0;for(let e=0;e copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(a,b,c){return new Sk.builtin.int_(this.find$left(a, b,c))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},hex:{$meth(){let a="";for(let b=0;b string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'."}, index:{$meth:function(a,b,c){a=this.find$left(a,b,c);if(-1===a)throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(a)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found."},isalnum:{$meth:y(a=>t(a)|| w(a)||A(a)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise."},isalpha:{$meth:y(a=>65<=a&&90>=a||97<=a&&122>=a),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise."},isascii:{$meth:y(a=>0<=a&&127>=a,!0),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise."}, isdigit:{$meth:y(t),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise."},islower:{$meth:B(w,A),$flags:{NoArgs:!0},$textsig:null,$doc:"B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise."},isspace:{$meth:y(p),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise."}, istitle:{$meth:function(){let a=!1,b=!1;for(let c=0;c bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise."}, isupper:{$meth:B(A,w),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise."},join:{$meth(a){const b=[];let c=0;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{if(!(a instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("sequence item "+c+": expected a bytes-like object, "+Sk.abstr.typeName(a)+" found");c++;b.length&&b.push(...this.v);b.push(...a.v)}), ()=>new Sk.builtin.bytes(new Uint8Array(b)))},$flags:{OneArg:!0},$textsig:"($self, iterable_of_bytes, /)",$doc:"Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'."},ljust:{$meth:k("ljust",!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)."}, lower:{$meth:E(a=>A(a)?a+32:a),$flags:{NoArgs:!0},$textsig:null,$doc:"B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase."},lstrip:{$meth:n(!0,!1),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace."},partition:{$meth:g(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects."}, replace:{$meth(a,b,c){a=this.get$raw(a);b=this.get$raw(b);c=void 0===c?-1:Sk.misceval.asIndexSized(c,Sk.builtin.OverflowError);c=0>c?Infinity:c;const d=[];let e=0;for(var f=0;f int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(a,b,c){a=this.find$right(a,b,c);if(-1===a)throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(a)}, $flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found."},rjust:{$meth:k("rjust",!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)"}, rpartition:{$meth:g(!0),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object."},rsplit:{$meth:function(a,b){({sep:a, maxsplit:b}=this.get$splitArgs(a,b));const c=[];let d=0,e=this.v.length;if(null!==a){for(;0<=e&&de)break;a=e+1;for(e--;0<=e&&!p(this.v[e]);)e--;c.push(new Sk.builtin.bytes(this.v.subarray(e+1,a)));d++}if(0<=e){for(;p(this.v[e]);)e--;0<=e&&c.push(new Sk.builtin.bytes(this.v.subarray(0, e+1)))}}return new Sk.builtin.list(c.reverse())},$flags:{NamedArgs:["sep","maxsplit"],Defaults:[Sk.builtin.none.none$,-1]},$textsig:"($self, /, sep=None, maxsplit=-1)",$doc:"Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front."}, rstrip:{$meth:n(!1,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace."},split:{$meth:function(a,b){({sep:a,maxsplit:b}=this.get$splitArgs(a,b));const c=[],d=this.v.length;let e=0,f=0;if(null!==a){for(;fb.length<=a.length&&b.every((b,c)=>b===a[c])),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try."},strip:{$meth:n(!0,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace."}, swapcase:{$meth:E(a=>A(a)?a+32:w(a)?a-32:a),$flags:{NoArgs:!0},$textsig:null,$doc:"B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa."},title:{$meth(){const a=this.v.length,b=new Uint8Array(a);let c=!1;for(let d=0;d copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase."}, upper:{$meth:E(a=>w(a)?a-32:a),$flags:{NoArgs:!0},$textsig:null,$doc:"B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase."},zfill:{$meth(a){a=Sk.misceval.asIndexSized(a,Sk.builtin.IndexError);const b=a-this.v.length;if(0>=b)return new Sk.builtin.bytes(this.v);const c=new Uint8Array(a);let d=0,e;if(43===this.v[0]||45===this.v[0])c[0]=this.v[0],d++;c.fill(48,d,d+b);e=d;for(d+=b;d copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated."}},classmethods:{fromhex:{$meth:function(a){function b(b){for(let c=f;c b'\\\\xb9\\\\x01\\\\xef'."}}});var N=Sk.abstr.buildIteratorClass("bytes_iterator",{constructor:function(a){this.$index=0;this.$seq=a.v},iternext(){const a= this.$seq[this.$index++];if(void 0!==a)return new Sk.builtin.int_(a)},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$acceptable_as_base_class:!1}});Sk.exportSymbol("Sk.builtin.bytes",Sk.builtin.bytes)},function(m,q,a){(function(a){(function(a){function b(){}function c(){}var l=String.fromCharCode,h={}.toString,d=h.call(a.SharedArrayBuffer),g=h(),n=a.Uint8Array,k=n||Array,p=n?ArrayBuffer:k,w=p.isView||function(a){return a&&"length"in a},A=h.call(p.prototype);p=c.prototype; var t=a.TextEncoder,m=new (n?Uint16Array:k)(32);b.prototype.decode=function(a){if(!w(a)){var b=h.call(a);if(b!==A&&b!==d&&b!==g)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");a=n?new k(a):a||[]}for(var c=b="",e=0,f=a.length|0,p=f-32|0,B,t,y=0,q=0,O,S=0,V=-1;e>4){case 15:O=a[e=e+1|0]&255;if(2!==O>>6||247>6?q+4|0:24,t=t+256&768;case 13:case 12:O=a[e=e+1|0]&255,y<<=6,y|=(t&31)<<6|O&63,q=q+7|0,e>6&&y>>q&&1114112>y?(t=y,y=y-65536|0,0<=y&&(V=(y>>10)+55296|0,t=(y&1023)+56320|0,31>S?(m[S]=V,S=S+1|0,V=-1):(O=V,V=t,t=O))):(t>>=8,e=e-t-1|0,t=65533),y=q=0,B=e<=p?32:f-e|0;default:m[S]=t;continue;case 11:case 10:case 9:case 8:}m[S]=65533}c+=l(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15],m[16],m[17],m[18],m[19],m[20], m[21],m[22],m[23],m[24],m[25],m[26],m[27],m[28],m[29],m[30],m[31]);32>S&&(c=c.slice(0,S-32|0));if(e>>31,V=-1,c.length=g)c[e]=g;else{if(2047>=g)c[e]=192|g>>6;else{a:{if(55296<=g)if(56319>=g){var h=a.charCodeAt(d=d+1|0)|0;if(56320<=h&&57343>=h){g=(g<<10)+h-56613888|0;if(65535< g){c[e]=240|g>>18;c[e=e+1|0]=128|g>>12&63;c[e=e+1|0]=128|g>>6&63;c[e=e+1|0]=128|g&63;continue}break a}g=65533}else 57343>=g&&(g=65533);!f&&d<<1>12;c[e=e+1|0]=128|g>>6&63}c[e=e+1|0]=128|g&63}}return n?c.subarray(0,e):c.slice(0,e)};t||(a.TextDecoder=b,a.TextEncoder=c)})("undefined"==typeof a?"undefined"==typeof self?this:self:a)}).call(this,a(0))},function(m,q){Sk.builtin.tuple=Sk.abstr.buildNativeClass("tuple",{constructor:function(a){void 0=== a?a=[]:Array.isArray(a)||(a=Sk.misceval.arrayFromIterable(a));Sk.asserts.assert(this instanceof Sk.builtin.tuple,"bad call to tuple, use 'new' with an Array of python objects");this.v=a;this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", $r(){if(this.in$repr)return new Sk.builtin.str("(...)");this.in$repr=!0;let a=this.v.map(a=>Sk.misceval.objectRepr(a));this.in$repr=!1;a=a.join(", ");1===this.v.length&&(a+=",");return new Sk.builtin.str("("+a+")")},tp$new(a,b){if(this!==Sk.builtin.tuple.prototype)return this.$subtype_new(a,b);Sk.abstr.checkNoKwargs("tuple",b);Sk.abstr.checkArgsLen("tuple",a,0,1);a=a[0];return void 0===a?new Sk.builtin.tuple([]):a.constructor===Sk.builtin.tuple?a:Sk.misceval.chain(Sk.misceval.arrayFromIterable(a, !0),a=>new Sk.builtin.tuple(a))},tp$hash(){let a,b=3430008,e=1000003;const f=this.v.length;for(let c=0;ca&&(a=this.v.length+a);if(0>a||a>=this.v.length)throw new Sk.builtin.IndexError("tuple index out of range");return this.v[a]}if(a instanceof Sk.builtin.slice){const b=[];a.sssiter$(this.v.length,a=>{b.push(this.v[a])});return new Sk.builtin.tuple(b)}throw new Sk.builtin.TypeError("tuple indices must be integers or slices, not "+Sk.abstr.typeName(a));},sq$length(){return this.v.length},sq$repeat(a){a=Sk.misceval.asIndexSized(a,Sk.builtin.OverflowError);if(1===a&&this.constructor===Sk.builtin.tuple)return this;const b=[];for(let c=0;c{this.$seq=a.$items();this.$version=a.$version;c&&(this.$seq=this.$seq.reverse());this.tp$iternext=this.constructor.prototype.tp$iternext;return this.tp$iternext()}},iternext:b,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef}, flags:{sk$acceptable_as_base_class:!1},proto:{next$item:l}})}function l(){if(this.$version!==this.$orig.$version){if(this.$len!==this.$orig.get$size())throw new Sk.builtin.RuntimeError("dict changed size during iteration");throw new Sk.builtin.RuntimeError("dictionary keys changed during iteration");}return this.$seq[this.$index++]}Sk.builtin.dict=Sk.abstr.buildNativeClass("dict",{constructor:function(a){void 0===a&&(a=[]);Sk.asserts.assert(Array.isArray(a)&&0===a.length%2&&this instanceof Sk.builtin.dict, "bad call to dict constructor");this.size=0;this.entries=Object.create(null);this.buckets={};for(let b=0;b new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", $r(){if(this.in$repr)return new Sk.builtin.str("{...}");this.in$repr=!0;const a=this.$items().map(([a,b])=>Sk.misceval.objectRepr(a)+": "+Sk.misceval.objectRepr(b));this.in$repr=!1;return new Sk.builtin.str("{"+a.join(", ")+"}")},tp$new:Sk.generic.new,tp$init(a,b){return this.update$common(a,b,"dict")},tp$iter(){return new k(this)},tp$richcompare(a,b){let c;if(!(a instanceof Sk.builtin.dict)||"Eq"!==b&&"NotEq"!==b)return Sk.builtin.NotImplemented.NotImplemented$;if(a===this)c=!0;else if(this.size!== a.size)c=!1;else{let b;c=this.$items().every(([c,d])=>{b=a.mp$lookup(c);return void 0!==b&&(b===d||Sk.misceval.richCompareBool(d,b,"Eq"))})}return"Eq"===b?c:!c},nb$or(a){if(!(a instanceof Sk.builtin.dict))return Sk.builtin.NotImplemented.NotImplemented$;const b=this.dict$copy();b.dict$merge(a);return b},nb$reflected_or(a){if(!(a instanceof Sk.builtin.dict))return Sk.builtin.NotImplemented.NotImplemented$;a=a.dict$copy();a.dict$merge(this);return a},nb$inplace_or(a){return Sk.misceval.chain(this.update$onearg(a), ()=>this)},sq$length(){return this.get$size()},sq$contains(a){return void 0!==this.mp$lookup(a)},mp$subscript(a,b){var c=this.mp$lookup(a);if(void 0!==c)return c;c=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$missing);if(void 0!==c)return a=Sk.misceval.callsimOrSuspendArray(c,[a]),b?a:Sk.misceval.retryOptionalSuspensionOrThrow(a);throw new Sk.builtin.KeyError(a);},mp$ass_subscript(a,b){if(void 0===b){if(void 0===this.pop$item(a))throw new Sk.builtin.KeyError(a);}else this.set$item(a,b)}},methods:{__reversed__:{$meth(){return new A(this)}, $flags:{NoArgs:!0},$textsig:null,$doc:"Return a reverse iterator over the dict keys."},get:{$meth(a,b){return this.mp$lookup(a)||b||Sk.builtin.none.none$},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Return the value for key if key is in the dictionary, else default."},setdefault:{$meth(b,c){let d;const e=a(b);d="string"===typeof e?this.entries[e]:this.get$bucket_item(b,e);if(void 0!==d)return d[1];c=c||Sk.builtin.none.none$;"string"===typeof e?this.entries[e]=[b,c]: this.set$bucket_item(b,c,e);this.size++;this.$version++;return c},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default."},pop:{$meth(a,b){const c=this.pop$item(a);if(void 0!==c)return c[1];if(void 0!==b)return b;throw new Sk.builtin.KeyError(a);},$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised"}, popitem:{$meth(){const a=this.get$size();if(0===a)throw new Sk.builtin.KeyError("popitem(): dictionary is empty");const [b,c]=this.$items()[a-1];this.pop$item(b);return new Sk.builtin.tuple([b,c])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty."},keys:{$meth(){return new d(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return new n(this)}, $flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return new g(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"},update:{$meth(a,b){return Sk.misceval.chain(this.update$common(a,b,"update"),()=>Sk.builtin.none.none$)},$flags:{FastCall:!0},$textsig:null,$doc:"D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]"}, clear:{$meth(){this.size=0;this.$version++;this.entries=Object.create(null);this.buckets={}},$flags:{NoArgs:!0},$textsig:null,$doc:"D.clear() -> None. Remove all items from D."},copy:{$meth(){return this.dict$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},classmethods:{fromkeys:{$meth:function(a,b){b=b||Sk.builtin.none.none$;let c=this===Sk.builtin.dict?new this:this.tp$call([],[]);return Sk.misceval.chain(c,d=>{c=d;return Sk.misceval.iterFor(Sk.abstr.iter(a),a=> c.mp$ass_subscript(a,b,!0))},()=>c)},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($type, iterable, value=None, /)",$doc:"Create a new dictionary with keys from iterable and values set to value."}},proto:{quick$lookup:function(a){a=this.entries[a.$savedKeyHash];if(void 0!==a)return a[1]},mp$lookup:function(b){const c=a(b);b="string"===typeof c?this.entries[c]:this.get$bucket_item(b,c);if(void 0!==b)return b[1]},get$size(){return this.size},sk$asarray(){return Object.values(this.entries).map(a=>a[0])},update$common:function(a, b,c){Sk.abstr.checkArgsLen(c,a,0,1);a=a[0];let d;void 0!==a&&(d=this.update$onearg(a));return Sk.misceval.chain(d,()=>{if(b)for(let a=0;avoid 0===a)&&delete this.buckets[b],d},set$bucket_item:function(a,b,c){let d=this.buckets[c];a=[a,b];void 0===d?(this.buckets[c]=[a],c="#"+c+"_0"):(b=d.indexOf(void 0), -1!==b?(c="#"+c+"_"+b,d[b]=a):(c="#"+c+"_"+d.length,d.push(a)));this.entries[c]=a},pop$item:function(b){const c=a(b);"string"===typeof c?(b=this.entries[c],delete this.entries[c]):b=this.pop$bucket_item(b,c);if(void 0!==b)return this.size--,this.$version++,b},dict$merge:function(a){if(a.tp$iter===Sk.builtin.dict.prototype.tp$iter){var b=a.tp$iter();for(let c=b.tp$iternext();void 0!==c;c=b.tp$iternext()){const b=a.mp$subscript(c);this.set$item(c,b)}}else return b=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$keys), Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(b,[]),b=>Sk.misceval.iterFor(Sk.abstr.iter(b),b=>Sk.misceval.chain(a.mp$subscript(b,!0),a=>{this.set$item(b,a)})))},dict$merge_seq:function(a){let b=0;return Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{if(!Sk.builtin.checkIterable(a))throw new Sk.builtin.TypeError("cannot convert dictionary update sequence element #"+b+" to a sequence");a=Sk.misceval.arrayFromIterable(a);if(2!==a.length)throw new Sk.builtin.ValueError("dictionary update sequence element #"+ b+" has length "+a.length+"; 2 is required");this.set$item(a[0],a[1]);b++})}}});const h={tp$getattr:Sk.generic.getAttr,tp$as_number:!0,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,$r(){if(this.in$repr)return new Sk.builtin.str("...");this.in$repr=!0;let a=Sk.misceval.arrayFromIterable(this);a=a.map(a=>Sk.misceval.objectRepr(a));this.in$repr=!1;return new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+a.join(", ")+"])")},tp$richcompare(a,c){if(!(Sk.builtin.checkAnySet(a)||a instanceof d|| a instanceof n))return Sk.builtin.NotImplemented.NotImplemented$;const e=this.sq$length(),f=a.sq$length();switch(c){case "NotEq":case "Eq":let d;this===a?d=!0:e===f&&(d=b(this,a));return"NotEq"===c?!d:d;case "Lt":return ef&&b(a,this);case "GtE":return e>=f&&b(a,this)}},nb$subtract(a){const b=c(this);return b.difference.$meth.call(b,a)},nb$and(a){const b=c(this);return b.intersection.$meth.call(b,a)},nb$or(a){const b=c(this);return b.union.$meth.call(b, a)},nb$xor(a){const b=c(this);return b.symmetric_difference.$meth.call(b,a)},sq$length(){return this.dict.get$size()}};var d=e("dict_keys",{sq$contains(a){return void 0!==this.dict.mp$lookup(a)},tp$iter(){return new k(this.dict)}},function(){return new A(this.dict)}),g=e("dict_values",{tp$iter(){return new w(this.dict)}},function(){return new y(this.dict)}),n=e("dict_items",{sq$contains(a){if(!(a instanceof Sk.builtin.tuple&&2===a.sq$length()))return!1;var b=a.mp$subscript(new Sk.builtin.int_(0)); a=a.mp$subscript(new Sk.builtin.int_(1));b=this.dict.mp$lookup(b);return void 0===b?!1:b===a||Sk.misceval.richCompareBool(b,a,"Eq")},tp$iter(){return new p(this.dict)}},function(){return new t(this.dict)}),k=f("dict_keyiterator",function(){const a=this.next$item();return a&&a[0]}),p=f("dict_itemiterator",function(){const a=this.next$item();return a&&new Sk.builtin.tuple([a[0],a[1]])}),w=f("dict_valueiterator",function(){const a=this.next$item();return a&&a[1]}),A=f("dict_reversekeyiterator",k.prototype.tp$iternext, !0),t=f("dict_reverseitemiterator",p.prototype.tp$iternext,!0),y=f("dict_reversevalueiterator",w.prototype.tp$iternext,!0);Sk.builtin.dict.py2$methods={has_key:{$name:"has_key",$flags:{OneArg:!0},$meth(a){return new Sk.builtin.bool(this.sq$contains(a))},$doc:"D.has_key(k) -> True if D has a key k, else False"},keys:{$name:"keys",$meth(){return new Sk.builtin.list(this.sk$asarray())},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$name:"items", $meth(){return new Sk.builtin.list(this.$items().map(([a,b])=>new Sk.builtin.tuple([a,b])))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$name:"values",$meth(){return new Sk.builtin.list(this.$items().map(([,a])=>a))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"}}},function(m,q){function a(a,b){Object.defineProperties(a,{entries:{get:()=>{const a=Object.create(null);Object.entries(b).forEach(([b, c])=>{b=Sk.unfixReserved(b);b.includes("$")||(b=new Sk.builtin.str(b),a[b.$savedKeyHash]=[b,c])});return a},configurable:!0},size:{get:()=>Object.keys(b).map(a=>Sk.unfixReserved(a)).filter(a=>!a.includes("$")).length,configurable:!0}})}Sk.builtin.mappingproxy=Sk.abstr.buildNativeClass("mappingproxy",{constructor:function(c){Sk.asserts.assert(this instanceof Sk.builtin.mappingproxy,"bad call to mapping proxy, use 'new'");this.mapping=new Sk.builtin.dict([]);void 0!==c&&a(this.mapping,c)},slots:{tp$getattr:Sk.generic.getAttr, tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$new(a,b){Sk.abstr.checkNoKwargs("mappingproxy",b);Sk.abstr.checkOneArg("mappingproxy",a,b);a=a[0];if(!Sk.builtin.checkMapping(a))throw new Sk.builtin.TypeError("mappingproxy() argument must be a mapping, not "+Sk.abstr.typeName(a));b=new Sk.builtin.mappingproxy;b.mapping=a;return b},tp$richcompare(a,b){return Sk.misceval.richCompareBool(this.mapping,a,b)},tp$str(){return this.mapping.tp$str()},$r(){return new Sk.builtin.str("mappingproxy("+ Sk.misceval.objectRepr(this.mapping)+")")},mp$subscript(a,b){return this.mapping.mp$subscript(a,b)},sq$contains(a){return this.mapping.sq$contains(a)},sq$length(){return this.mapping.sq$length()},tp$iter(){return this.mapping.tp$iter()},tp$as_number:!0,nb$or(a){a instanceof Sk.builtin.mappingproxy&&(a=a.mapping);return Sk.abstr.numberBinOp(this.mapping,a,"BitOr")},nb$reflected_or(a){a instanceof Sk.builtin.mappingproxy&&(a=a.mapping);return Sk.abstr.numberBinOp(a,this.mapping,"BitOr")},nb$inplace_or(a){throw new Sk.builtin.TypeError("'|=' is not supported by "+ Sk.abstr.typeName(this)+"; use '|' instead");}},methods:{get:{$meth(a,b){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$get),a,b)},$flags:{FastCall:!0},$textsig:null,$doc:"D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None."},keys:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$keys),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$items), [])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$values),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> a set-like object providing a view on D's values"},copy:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$copy),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},proto:{str$get:new Sk.builtin.str("get"), str$copy:new Sk.builtin.str("copy"),str$keys:new Sk.builtin.str("keys"),str$items:new Sk.builtin.str("items"),str$values:new Sk.builtin.str("values"),mp$lookup(a){return this.mapping.mp$lookup(a)}},flags:{sk$acceptable_as_base_class:!1}})},function(m,q){Sk.builtin.property=Sk.abstr.buildNativeClass("property",{constructor:function(a,c,b,e){this.prop$get=a||Sk.builtin.none.none$;this.prop$set=c||Sk.builtin.none.none$;this.prop$del=b||Sk.builtin.none.none$;this.prop$doc=e||a&&a.$doc||Sk.builtin.none.none$}, slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(a,c){a=Sk.abstr.copyKeywordsToNamedArgs("property",["fget","fset","fdel","doc"],a,c,Array(4).fill(Sk.builtin.none.none$));this.prop$get=a[0];this.prop$set=a[1];this.prop$del=a[2];Sk.builtin.checkNone(a[3])?Sk.builtin.checkNone(a[0])||(this.prop$doc=a[0].$doc||a[3]):this.prop$doc=a[3]},tp$doc:"Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, 'I'm the 'x' property.')\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n 'I am the 'x' property.'\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", tp$descr_get(a,c){if(null===a)return this;if(void 0===this.prop$get)throw new Sk.builtin.AttributeError("unreadable attribute");return Sk.misceval.callsimOrSuspendArray(this.prop$get,[a])},tp$descr_set(a,c){let b;b=null==c?this.prop$del:this.prop$set;if(Sk.builtin.checkNone(b))throw new Sk.builtin.AttributeError("can't "+(null==c?"delete":"set")+" attribute");if(!b.tp$call)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(b)+"' is not callable");return null==c?b.tp$call([a]):b.tp$call([a,c])}}, methods:{getter:{$meth(a){return new Sk.builtin.property(a,this.prop$set,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},setter:{$meth(a){return new Sk.builtin.property(this.prop$get,a,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},deleter:{$meth(a){return new Sk.builtin.property(this.prop$get,this.prop$set,a,this.prop$doc)},$flags:{OneArg:!0}}},getsets:{fget:{$get(){return this.prop$get}},fset:{$get(){return this.prop$set}},fdel:{$get(){return this.prop$del}},__doc__:{$get(){return this.prop$doc}, $set(a){this.prop$doc=a=a||Sk.builtin.none.none$}}}});Sk.builtin.classmethod=Sk.abstr.buildNativeClass("classmethod",{constructor:function(a){this.cm$callable=a;this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(a,c){Sk.abstr.checkNoKwargs("classmethod",c);Sk.abstr.checkArgsLen("classmethod",a,1,1);this.cm$callable=a[0]},tp$doc:"classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", tp$descr_get(a,c){const b=this.cm$callable;if(void 0===b)throw new Sk.builtin.RuntimeError("uninitialized classmethod object");void 0===c&&(c=a.ob$type);return(a=b.tp$descr_get)?a.call(b,c):new Sk.builtin.method(b,c)}},getsets:{__func__:{$get(){return this.cm$callable}},__dict__:Sk.generic.getSetDict}});Sk.builtin.staticmethod=Sk.abstr.buildNativeClass("staticmethod",{constructor:function(a){this.sm$callable=a;this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new, tp$init(a,c){Sk.abstr.checkNoKwargs("staticmethod",c);Sk.abstr.checkArgsLen("staticmethod",a,1,1);this.sm$callable=a[0]},tp$doc:"staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", tp$descr_get(a,c){if(void 0===this.sm$callable)throw new Sk.builtin.RuntimeError("uninitialized staticmethod object");return this.sm$callable}},getsets:{__func__:{$get(){return this.sm$callable}},__dict__:Sk.generic.getSetDict}})},function(m,q){function a(a,b){return function(c){if(c instanceof Sk.builtin.int_){let e=this.v;c=c.v;if("number"===typeof e&&"number"===typeof c){const b=a(e,c);if(d(b))return new Sk.builtin.int_(b)}e=n(e);c=n(c);return new Sk.builtin.int_(b(e,c))}return Sk.builtin.NotImplemented.NotImplemented$}} function c(a,b){return function(c){if(c instanceof Sk.builtin.int_){let d=this.v;c=c.v;if("number"===typeof d&&"number"===typeof c)return a(d,c);d=n(d);c=n(c);return b(d,c)}return Sk.builtin.NotImplemented.NotImplemented$}}function b(a,b){return function(){const c=this.v;return"number"===typeof c?new Sk.builtin.int_(a(c)):new Sk.builtin.int_(b(c))}}function e(){return new Sk.builtin.int_(this.v)}function f(a,b){return function(c){if(c instanceof Sk.builtin.int_){let d=this.v;c=c.v;if(0===c)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero"); if("number"===typeof d&&"number"===typeof c)return new Sk.builtin.int_(a(d,c));d=n(d);c=n(c);return new Sk.builtin.int_(JSBI.numberIfSafe(b(d,c)))}return Sk.builtin.NotImplemented.NotImplemented$}}function l(a,b){return function(c){if(c instanceof Sk.builtin.int_){let d=this.v;c=c.v;if(0===d)return new Sk.builtin.int_(this.v);if("number"===typeof c){if(0>c)throw new Sk.builtin.ValueError("negative shift count");if("number"===typeof d){const b=a(d,c);if(void 0!==b)return new Sk.builtin.int_(b)}c=JSBI.BigInt(c)}else if(JSBI.lessThan(JSBI.BigInt(0)))throw new Sk.builtin.ValueError("negative shift count"); d=n(d);return new Sk.builtin.int_(b(d,c))}return Sk.builtin.NotImplemented.NotImplemented$}}function h(a,b){return function(c){if(c instanceof Sk.builtin.int_){var d=this.v;c=c.v;if("number"===typeof d&&"number"===typeof c)return d=a(d,c),0>d&&(d+=4294967296),new Sk.builtin.int_(d);d=n(d);c=n(c);return new Sk.builtin.int_(JSBI.numberIfSafe(b(d,c)))}return Sk.builtin.NotImplemented.NotImplemented$}}function d(a){return a<=Number.MAX_SAFE_INTEGER&&a>=-Number.MAX_SAFE_INTEGER}function g(a){return a<= Number.MAX_SAFE_INTEGER&&a>=-Number.MAX_SAFE_INTEGER?+a:JSBI.BigInt(a)}function n(a){return"number"===typeof a?JSBI.BigInt(a):a}Sk.builtin.int_=Sk.abstr.buildNativeClass("int",{constructor:function(a){Sk.asserts.assert(this instanceof Sk.builtin.int_,"bad call to int use 'new'");let b;if("number"===typeof a||JSBI.__isBigInt(a))b=a;else if(void 0===a)b=0;else if("string"===typeof a)b=g(a);else{if(a.nb$int)return a.nb$int();Sk.asserts.fail("bad argument to int constructor")}this.v=b},slots:{tp$as_number:!0, tp$doc:"int(x=0) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", $r(){return new Sk.builtin.str(this.v.toString())},tp$hash(){const a=this.v;return"number"===typeof a?a:JSBI.toNumber(JSBI.remainder(a,JSBI.__MAX_SAFE))},tp$new(a,b){1===a.length+(b?b.length:0)?(b=a[0],a=Sk.builtin.none.none$):(a=Sk.abstr.copyKeywordsToNamedArgs("int",[null,"base"],a,b,[new Sk.builtin.int_(0),Sk.builtin.none.none$]),b=a[0],a=a[1]);a=a!==Sk.builtin.none.none$?Sk.misceval.asIndexOrThrow(a):null;if(b instanceof Sk.builtin.str)null===a&&(a=10),b=new Sk.builtin.int_(Sk.str2number(b.v, a));else{if(null!==a)throw new Sk.builtin.TypeError("int() can't convert non-string with explicit base");if(b.nb$int)b=b.nb$int();else if(a=Sk.abstr.lookupSpecial(b,Sk.builtin.str.$trunc)){a=Sk.misceval.callsimArray(a,[]);if(!Sk.builtin.checkInt(a))throw new Sk.builtin.TypeError(Sk.builtin.str.$trunc.$jsstr()+" returned non-Integral (type "+Sk.abstr.typeName(b)+")");b=new Sk.builtin.int_(a.v)}else throw new Sk.builtin.TypeError("int() argument must be a string, a bytes-like object or a number, not '"+ Sk.abstr.typeName(b)+"'");}if(this===Sk.builtin.int_.prototype)return b;a=new this.constructor;a.v=b.v;return a},tp$getattr:Sk.generic.getAttr,ob$eq:c((a,b)=>a==b,JSBI.equal),ob$ne:c((a,b)=>a!=b,JSBI.notEqual),ob$gt:c((a,b)=>a>b,JSBI.greaterThan),ob$ge:c((a,b)=>a>=b,JSBI.greaterThanOrEqual),ob$lt:c((a,b)=>aa<=b,JSBI.lessThanOrEqual),nb$int:e,nb$index(){return this.v},nb$float(){var a=this.v;if("number"===typeof a)return new Sk.builtin.float_(a);a=parseFloat(JSBI.toNumber(a)); if(Infinity===a||-Infinity===a)throw new Sk.builtin.OverflowError("int too large to convert to float");return new Sk.builtin.float_(a)},nb$isnegative(){const a=this.v;return"number"===typeof a?0>a:JSBI.lessThan(a,JSBI.__ZERO)},nb$ispositive(){const a=this.v;return"number"===typeof a?0>a:JSBI.greaterThanOrEqual(a,JSBI.__ZERO)},nb$bool(){return 0!==this.v},nb$positive:e,nb$negative:b(a=>-a,JSBI.unaryMinus),nb$add:a((a,b)=>a+b,(a,b)=>JSBI.numberIfSafe(JSBI.add(a,b))),nb$subtract:a((a,b)=>a-b,(a,b)=> JSBI.numberIfSafe(JSBI.subtract(a,b))),nb$multiply:a((a,b)=>a*b,JSBI.multiply),nb$divide(a){return Sk.__future__.division?this.nb$float().nb$divide(a):this.nb$floor_divide(a)},nb$floor_divide:f((a,b)=>Math.floor(a/b),JSBI.divide),nb$remainder:f((a,b)=>a-Math.floor(a/b)*b,JSBI.remainder),nb$divmod(a){const b=this.nb$floor_divide(a);a=this.nb$remainder(a);return b===Sk.builtin.NotImplemented.NotImplemented$||a===Sk.builtin.NotImplemented.NotImplemented$?Sk.builtin.NotImplemented.NotImplemented$:new Sk.builtin.tuple([b, a])},nb$and:h((a,b)=>a&b,JSBI.bitwiseAnd),nb$or:h((a,b)=>a|b,JSBI.bitwiseOr),nb$xor:h((a,b)=>a^b,JSBI.bitwiseXor),nb$abs:b(Math.abs,a=>JSBI.lessThan(a,JSBI.__ZERO)?JSBI.unaryMinus(a):a),nb$lshift:l((a,b)=>{if(53>b&&(a=2*a*p[b],d(a)))return a},JSBI.leftShift),nb$rshift:l((a,b)=>{const c=a>>b;return 0c?c&Math.pow(2,32-b)-1:c},(a,b)=>JSBI.numberIfSafe(JSBI.signedRightShift(a,b))),nb$invert:b(a=>~a,JSBI.bitwiseNot),nb$power(a,b){let c;void 0!==b&&Sk.builtin.checkNone(b)&&(b=void 0);if(a instanceof Sk.builtin.int_&&(void 0===b||b instanceof Sk.builtin.int_)){let e=this.v,f=a.v;if("number"===typeof e&&"number"===typeof f){const a=Math.pow(e,f);if(d(a)&&(c=0>f?new Sk.builtin.float_(a):new Sk.builtin.int_(a),void 0===b))return c}if(void 0!==b){if(a.nb$isnegative())throw new Sk.builtin.ValueError("pow() 2nd argument cannot be negative when 3rd argument specified");if(0===b.v)throw new Sk.builtin.ValueError("pow() 3rd argument cannot be 0");return void 0!==c?c.nb$remainder(b):new Sk.builtin.int_(JSBI.powermod(n(e), n(f),n(b.v)))}return new Sk.builtin.int_(JSBI.exponentiate(n(e),n(f)))}return Sk.builtin.NotImplemented.NotImplemented$},nb$long(){return new Sk.builtin.lng(this.v)}},getsets:{real:{$get:e,$doc:"the real part of a complex number"},imag:{$get(){return new Sk.builtin.int_(0)},$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth:e,$flags:{NoArgs:!0},$textsig:null,$doc:"Returns self, the complex conjugate of any int."},bit_length:{$meth(){return new Sk.builtin.int_(Sk.builtin.bin(this).sq$length()- 2)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6"},to_bytes:{$meth(){throw new Sk.builtin.NotImplementedError("Not yet implemented in Skulpt");},$flags:{FastCall:!0},$textsig:"($self, /, length, byteorder, *, signed=False)",$doc:"Return an array of bytes representing an integer.\n\n length\n Length of bytes object to use. An OverflowError is raised if the\n integer is not representable with the given number of bytes.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Determines whether two's complement is used to represent the integer.\n If signed is False and a negative integer is given, an OverflowError\n is raised."}, __trunc__:{$meth:e,$flags:{NoArgs:!0},$textsig:null,$doc:"Truncating an Integral returns itself."},__floor__:{$meth:e,$flags:{NoArgs:!0},$textsig:null,$doc:"Flooring an Integral returns itself."},__ceil__:{$meth:e,$flags:{NoArgs:!0},$textsig:null,$doc:"Ceiling of an Integral returns itself."},__round__:{$meth(a){return this.round$(a)},$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"Rounding an Integral returns itself.\nRounding with an ndigits argument also returns an integer."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([new Sk.builtin.int_(this.v)])}, $flags:{NoArgs:!0},$textsig:"($self, /)",$doc:Sk.builtin.none.none$},__format__:{$meth:Sk.formatting.mkNumber__format__(!1),$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:Sk.builtin.none.none$}},proto:{str$(a,b){a=void 0===a||10===a?this.v.toString():this.v.toString(a);b||void 0===b||"-"===a[0]&&(a=a.substring(1));return a},round$(a){a=void 0===a?0:Sk.misceval.asIndexSized(a);var b=this.v,c=Math.pow(10,-a);if(0JSBI.toNumber(e)?b=JSBI.multiply(JSBI.multiply(d,a),c):JSBI.multiply(JSBI.multiply(JSBI.add(d,JSBI.BigInt(1),a),c));return new Sk.builtin.int_(b)}}}});Sk.exportSymbol("Sk.builtin.int_",Sk.builtin.int_);const k=/_(?=[^_])/g;Sk.str2number= function(a,b){var c=a,e=!1,f;a=a.replace(/^\s+|\s+$/g,"");"-"===a.charAt(0)&&(e=!0,a=a.substring(1));"+"===a.charAt(0)&&(a=a.substring(1));if(null===b||void 0===b)b=10;if((2>b||36= 2 and <= 36");"string"===typeof b&&(b=Number(b));if("0x"===a.substring(0,2).toLowerCase())if(16===b||0===b)a=a.substring(2),b=16;else{if(34>b)throw new Sk.builtin.ValueError("invalid literal for int() with base "+b+": '"+c+"'");}else if("0b"===a.substring(0, 2).toLowerCase())if(2===b||0===b)a=a.substring(2),b=2;else{if(12>b)throw new Sk.builtin.ValueError("invalid literal for int() with base "+b+": '"+c+"'");}else if("0o"===a.substring(0,2).toLowerCase())if(8===b||0===b)a=a.substring(2),b=8;else{if(25>b)throw new Sk.builtin.ValueError("invalid literal for int() with base "+b+": '"+c+"'");}else if("0"===a.charAt(0)){if("0"===a)return 0;if(8===b||0===b)b=8}0===b&&(b=10);if(-1!==a.indexOf("_")){if(-1!==a.indexOf("__"))throw new Sk.builtin.ValueError("invalid literal for int() with base "+ b+": '"+c+"'");a=10!==b?a.replace(k,""):a.charAt(0)+a.substring(1).replace(k,"")}if(0===a.length)throw new Sk.builtin.ValueError("invalid literal for int() with base "+b+": '"+c+"'");for(f=0;f=g?h=g-48:65<=g&&90>=g?h=g-65+10:97<=g&&122>=g&&(h=g-97+10);if(h>=b)throw new Sk.builtin.ValueError("invalid literal for int() with base "+b+": '"+c+"'");}e&&(a="-"+a);h=parseInt(a,b);if(d(h))return h;c=!1;"-"===a[0]&&(c=!0,a=a.substring(1));b=JSBI.BigInt(b); e=JSBI.BigInt(1);f=JSBI.BigInt(0);for(g=a.length-1;0<=g;g--)h=a.charCodeAt(g),48<=h&&57>=h?h-=48:65<=h&&90>=h?h=h-65+10:97<=h&&122>=h&&(h=h-97+10),h=JSBI.multiply(JSBI.BigInt(h),e),f=JSBI.add(f,h),e=JSBI.multiply(e,b);c&&(f=JSBI.multiply(f,JSBI.BigInt(-1)));return a=f};Sk.builtin.int_.py2$methods={};Sk.longFromStr=function(a,b){if(Sk.__future__.python3)return new Sk.builtin.int_(g(a));a=Sk.str2number(a,b);return new Sk.builtin.lng(a)};Sk.exportSymbol("Sk.longFromStr",Sk.longFromStr);Sk.builtin.int_.withinThreshold= d;Sk.builtin.int_.stringToNumberOrBig=g;const p=[.5,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,0x800000000000,281474976710656,562949953421312,0x4000000000000, 0x8000000000000,4503599627370496,9007199254740992];Sk.builtin.lng=Sk.abstr.buildNativeClass("long",{base:Sk.builtin.int_,constructor:function(a){Sk.builtin.int_.call(this,a)},slots:{$r(){return new Sk.builtin.str(this.v.toString()+"L")},tp$as_number:!0,nb$negative(){return new Sk.builtin.lng(w.nb$negative.call(this).v)},nb$positive(){return new Sk.builtin.lng(w.nb$positive.call(this).v)}}});const w=Sk.builtin.int_.prototype},function(m,q){const a=Sk.builtin.int_.prototype;Sk.builtin.bool=Sk.abstr.buildNativeClass("bool", {constructor:function(a){return Sk.misceval.isTrue(a)?Sk.builtin.bool.true$:Sk.builtin.bool.false$},base:Sk.builtin.int_,slots:{tp$doc:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",tp$new(a,b){Sk.abstr.checkNoKwargs("bool",b);Sk.abstr.checkArgsLen("bool",a,0,1);return new Sk.builtin.bool(a[0])},$r(){return this.v?this.str$True: this.str$False},tp$as_number:!0,nb$and(c){return c.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v&c.v):a.nb$and.call(this,c)},nb$or(c){return c.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v|c.v):a.nb$or.call(this,c)},nb$xor(c){return c.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v^c.v):a.nb$xor.call(this,c)}},flags:{sk$acceptable_as_base_class:!1},methods:{__format__:{$meth(){return this.$r()},$flags:{OneArg:!0}}},proto:{str$False:new Sk.builtin.str("False"),str$True:new Sk.builtin.str("True")}}); Sk.exportSymbol("Sk.builtin.bool",Sk.builtin.bool);Sk.builtin.bool.true$=Object.create(Sk.builtin.bool.prototype,{v:{value:1,enumerable:!0}});Sk.builtin.bool.false$=Object.create(Sk.builtin.bool.prototype,{v:{value:0,enumerable:!0}})},function(m,q){function a(){return new Sk.builtin.float_(this.v)}function c(a){return function(b){const c=this.v;b=b.v;if("number"!==typeof b)if(JSBI.__isBigInt(b)){if(b=parseFloat(JSBI.toNumber(b)),Infinity==b||-Infinity==b)throw new Sk.builtin.OverflowError("int too large to convert to float"); }else return Sk.builtin.NotImplemented.NotImplemented$;return a(c,b)}}function b(a){const b=c(a);return function(a,c){if(void 0!==c&&!Sk.builtin.checkNone(c))throw new Sk.builtin.TypeError("pow() 3rd argument not allowed unless all arguments are integers");return b.call(this,a)}}function e(a,b){if(0===b)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return Infinity===a?Infinity===b||-Infinity===a?new Sk.builtin.float_(NaN):0>b?new Sk.builtin.float_(-Infinity):new Sk.builtin.float_(Infinity): -Infinity===a?Infinity===b||-Infinity===a?new Sk.builtin.float_(NaN):0>b?new Sk.builtin.float_(Infinity):new Sk.builtin.float_(-Infinity):new Sk.builtin.float_(a/b)}function f(a,b){if(Infinity===a||-Infinity===a)return new Sk.builtin.float_(NaN);if(0===b)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return Infinity===b?0>a?new Sk.builtin.float_(-1):new Sk.builtin.float_(0):-Infinity===b?0>a||0!==a?new Sk.builtin.float_(0):new Sk.builtin.float_(-1):new Sk.builtin.float_(Math.floor(a/ b))}function l(a,b){if(0===b)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");if(0===a)return new Sk.builtin.float_(0);if(Infinity===b)return Infinity===a||-Infinity===this.v?new Sk.builtin.float_(NaN):0a?0c&&(c+=b):0>b&&0!==c&&(c+=b);0===c&&(0>b?c=-0:-Infinity===Infinity/c&&(c=0));return new Sk.builtin.float_(c)}function h(a,b){if(0>a&&0!==b%1)throw new Sk.builtin.ValueError("negative number cannot be raised to a fractional power"); if(0===a&&0>b)throw new Sk.builtin.ZeroDivisionError("0.0 cannot be raised to a negative power");const c=Math.pow(a,b);if(Infinity===Math.abs(c)&&Infinity!==Math.abs(a)&&Infinity!==Math.abs(b))throw new Sk.builtin.OverflowError("Numerical result out of range");return new Sk.builtin.float_(c)}const d=Object.create(null,{Infinity:{value:314159},"-Infinity":{value:-314159},NaN:{value:0}});Sk.builtin.float_=Sk.abstr.buildNativeClass("float",{constructor:function(a){Sk.asserts.assert(this instanceof Sk.builtin.float_, "bad call to float use 'new'");if("number"===typeof a)this.v=a;else if(void 0===a)this.v=0;else if("string"===typeof a)this.v=parseFloat(a);else{if(a.nb$float)return a.nb$float();Sk.asserts.fail("bad argument to float constructor")}},slots:{tp$gettattr:Sk.generic.getAttr,tp$as_number:!0,tp$doc:"Convert a string or number to a floating point number, if possible.",tp$hash(){const a=this.v;let b=d[a];if(void 0!==b)return b;b=Number.isInteger(a)?this.nb$int().tp$hash():Math.floor(Math.random()*Number.MAX_SAFE_INTEGER- Number.MAX_SAFE_INTEGER/2);return d[this.v]=b},$r(){return new Sk.builtin.str(this.str$(10,!0))},tp$new(a,b){if(b&&b.length)throw new Sk.builtin.TypeError("float() takes no keyword arguments");if(a&&1a?Math.ceil(a):Math.floor(a);if(!Number.isInteger(a))throw new Sk.builtin.ValueError("cannot convert float "+Sk.misceval.objectRepr(this)+" to integer");return Sk.builtin.int_.withinThreshold(a)?new Sk.builtin.int_(a):new Sk.builtin.int_(JSBI.BigInt(a))},nb$float:a,nb$long(){return new Sk.builtin.lng(this.nb$int().v)},nb$add:c((a,b)=>new Sk.builtin.float_(a+b)),nb$subtract:c((a,b)=>new Sk.builtin.float_(a-b)),nb$reflected_subtract:c((a, b)=>new Sk.builtin.float_(b-a)),nb$multiply:c((a,b)=>new Sk.builtin.float_(a*b)),nb$divide:c(e),nb$reflected_divide:c((a,b)=>e(b,a)),nb$floor_divide:c(f),nb$reflected_floor_divide:c((a,b)=>f(b,a)),nb$remainder:c(l),nb$reflected_remainder:c((a,b)=>l(b,a)),nb$divmod:c((a,b)=>new Sk.builtin.tuple([f(a,b),l(a,b)])),nb$reflected_divmod:c((a,b)=>new Sk.builtin.tuple([f(b,a),l(b,a)])),nb$power:b(h),nb$reflected_power:b((a,b)=>h(b,a)),nb$abs(){return new Sk.builtin.float_(Math.abs(this.v))},nb$negative(){return new Sk.builtin.float_(-this.v)}, nb$positive(){return new Sk.builtin.float_(this.v)},nb$bool(){return 0!==this.v},nb$isnegative(){return 0>this.v},nb$ispositive(){return 0<=this.v},ob$eq:c((a,b)=>a==b),ob$ne:c((a,b)=>a!=b),ob$gt:c((a,b)=>a>b),ob$ge:c((a,b)=>a>=b),ob$lt:c((a,b)=>aa<=b)},getsets:{real:{$get:a,$doc:"the real part of a complex number"},imag:{$get(){return new Sk.builtin.float_(0)},$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth:a,$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return self, the complex conjugate of any float."}, __trunc__:{$meth(){return this.nb$int()},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return the Integral closest to x between 0 and x."},__round__:{$meth(a){return this.round$(a)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, ndigits=None, /)",$doc:"Return the Integral closest to x, rounding half toward even.\n\nWhen an argument is passed, work like built-in round(x, ndigits)."},is_integer:{$meth(){return new Sk.builtin.bool(Number.isInteger(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)", $doc:"Return True if the float is an integer."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([this])},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:Sk.builtin.none.none$},__format__:{$meth:Sk.formatting.mkNumber__format__(!0),$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:Sk.builtin.none.none$}}});const g=/_[eE]|[eE]_|\._|_\.|[+-]_|__/,n=/_(?=[^_])/g;Sk.builtin.float_.PyFloat_Check=function(a){return void 0===a?!1:Sk.builtin.checkNumber(a)||Sk.builtin.checkFloat(a)||a.ob$type.$isSubType(Sk.builtin.float_)? !0:!1};Sk.builtin.float_.prototype.toFixed=function(a){a=Sk.builtin.asnum$(a);return this.v.toFixed(a)};Sk.builtin.float_.prototype.round$=function(a){var b=Sk.builtin.asnum$(this);var c=void 0===a?0:Sk.misceval.asIndexSized(a);if(Sk.__future__.bankers_rounding){b*=Math.pow(10,c);var d=Math.round(b);c=(.5===(0c.length?b.toExponential():b.toExponential(11));if(0>c.indexOf("e")&&0<=c.indexOf(".")){for(;"0"== c.charAt(c.length-1);)c=c.substring(0,c.length-1);"."==c.charAt(c.length-1)&&(c+="0")}c=c.replace(/\.0+e/,"e","i");c=c.replace(/(e[-+])([1-9])$/,"$10$2");c=c.replace(/0+(e.*)/,"$1")}else c=b.toString(a);0===this.v&&-Infinity===1/this.v&&(c="-"+c);0>c.indexOf(".")&&0>c.indexOf("E")&&0>c.indexOf("e")&&(c+=".0");return c};Sk.builtin.float_.py2$methods={}},function(m,q){function a(a){let b=a.v;if("number"===typeof b)return b;a.nb$float&&(b=a.nb$float());if(void 0===b)throw new Sk.builtin.TypeError("a float is required"); return b.v}function c(a,b,c){if(c===Sk.builtin.complex.prototype)return new Sk.builtin.complex(a,b);c=new c.constructor;Sk.builtin.complex.call(c,a,b);return c}function b(a,b){return function(c){const d=this.real,e=this.imag;var f=c.real;const g=c.v;if("number"===typeof f)c=c.imag;else if("number"===typeof g)f=g,c=0;else if(JSBI.__isBigInt(g)){if(void 0===b){if(f=parseFloat(JSBI.toNumber(g)),Infinity==f||-Infinity==f)throw new Sk.builtin.OverflowError("int too large to convert to float");}else f= g.toString();c=0}else return Sk.builtin.NotImplemented.NotImplemented$;return a(d,e,f,c)}}function e(a,b,c,d){var e=Math.abs(c);const f=Math.abs(d);if(e>=f){if(0===e)throw new Sk.builtin.ZeroDivisionError("complex division by zero");e=d/c;c+=d*e;d=(a+b*e)/c;a=(b-a*e)/c}else f>=e?(e=c/d,c=c*e+d,Sk.asserts.assert(0!==d),d=(a*e+b)/c,a=(b*e-a)/c):a=d=NaN;return new Sk.builtin.complex(d,a)}function f(a,b,c,d){if(0===c&&0===d){d=1;var e=0}else if(0===a&&0===b){if(0!==d||0>c)throw new Sk.builtin.ZeroDivisionError("complex division by zero"); e=d=0}else{const f=Math.hypot(a,b);e=Math.pow(f,c);a=Math.atan2(b,a);c*=a;0!==d&&(e/=Math.exp(a*d),c+=d*Math.log(f));d=e*Math.cos(c);e*=Math.sin(c)}return new Sk.builtin.complex(d,e)}function l(a,b,c){let d=1;var e=new Sk.builtin.complex(1,0);for(a=new Sk.builtin.complex(a,b);0=d;)c&d&&(e=new Sk.builtin.complex(e.real*a.real-e.imag*a.imag,e.real*a.imag+a.real*e.imag)),d<<=1,a=new Sk.builtin.complex(a.real*a.real-a.imag*a.imag,2*a.real*a.imag);return e}function h(a,b,c,d,e){e=!1;switch(b){case "e":case "f":case "g":break; case "E":e=!0;b="e";break;case "F":e=!0;b="f";break;case "r":if(0!==c)throw Error("Bad internall call");c=17;b="g";break;default:throw Error("Bad internall call");}if(isNaN(a))a="nan";else if(Infinity===a)a="inf";else if(-Infinity===a)a="-inf";else{d&h.Py_DTSF_ADD_DOT_0&&(b="g");var f="%"+(d&h.Py_DTSF_ALT?"#":"");null!=c&&(f=f+"."+c);f=new Sk.builtin.str(f+b);a=f.nb$remainder(new Sk.builtin.float_(a));a=a.v}d&h.Py_DTSF_SIGN&&"-"!==a[0]&&(a="+"+a);e&&(a=a.toUpperCase());return a}Sk.builtin.complex= Sk.abstr.buildNativeClass("complex",{constructor:function(a,b){Sk.asserts.assert(this instanceof Sk.builtin.complex,"bad call to complex constructor, use 'new'");this.real=a;this.imag=b},slots:{tp$as_number:!0,tp$doc:"Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.",tp$hash(){var a=(new Sk.builtin.float_(this.real)).tp$hash();a=1003*(new Sk.builtin.float_(this.imag)).tp$hash()+a;return Sk.builtin.int_.withinThreshold(a)? a:(new Sk.builtin.int_(JSBI.BigInt(a))).tp$hash()},tp$getattr:Sk.generic.getAttr,tp$new(b,e){b=Sk.abstr.copyKeywordsToNamedArgs("complex",["real","imag"],b,e,[null,null]);{var f=b[1],g;let k=e=!1;var h=b[0];if(null!=h&&h.constructor===Sk.builtin.complex&&null==f)e=h;else if(Sk.builtin.checkString(h)){if(null!=f)throw new Sk.builtin.TypeError("complex() can't take second arg if first is a string");e=Sk.builtin.complex.complex_subtype_from_string(h,this)}else{if(null!=f&&Sk.builtin.checkString(f))throw new Sk.builtin.TypeError("complex() second arg can't be a string"); null==h?b=null:(b=Sk.abstr.lookupSpecial(h,Sk.builtin.str.$complex),b=void 0!==b?Sk.misceval.callsimArray(b,[]):null);if(null!=b&&b!==Sk.builtin.NotImplemented.NotImplemented$){if(!d(b))throw new Sk.builtin.TypeError("__complex__ should return a complex object");h=b}if(null!=h&&void 0===h.nb$float)throw new Sk.builtin.TypeError("complex() first argument must be a string or a number, not '"+Sk.abstr.typeName(h)+"'");if(null!=f&&void 0===f.nb$float)throw new Sk.builtin.TypeError("complex() second argument must be a number, not '"+ Sk.abstr.typeName(h)+"'");null==h?h=b=0:d(h)?(b=h.real,h=h.imag,e=!0):(b=a(h),h=0);null==f?f=g=0:d(f)?(g=f.real,f=f.imag,k=!0):(g=a(f),f=0);!0===k&&(b-=f);!0===e&&(g+=h);e=c(b,g,this)}}return e},tp$richcompare(a,c){if("Eq"!==c&&"NotEq"!==c){if(Sk.builtin.checkNumber(a)||d(a))throw new Sk.builtin.TypeError("no ordering relation is defined for complex numbers");return Sk.builtin.NotImplemented.NotImplemented$}return b(function(a,b,d,e){a=a==d&&b==e;return"Eq"===c?a:!a},!0).call(this,a)},$r(){{var a, b;let e=a="";var c=this.real;var d=this.imag;if(b=0===c)b=1==(c?0>c?-1:1:0>1/c?-1:1);b?(c="",b=h(d,"g",null,0,null)):(c=a=h(c,"g",null,0,null),b=h(d,"g",null,h.Py_DTSF_SIGN,null),0===d&&-Infinity===1/d&&b&&"-"!==b[0]&&(b="-"+b),a="(",e=")");d=new Sk.builtin.str(""+a+c+b+"j"+e)}return d},nb$int(){throw new Sk.builtin.TypeError("can't convert complex to int");},nb$long(){throw new Sk.builtin.TypeError("can't convert complex to long");},nb$float(){throw new Sk.builtin.TypeError("can't convert complex to float"); },nb$positive(){return new Sk.builtin.complex(this.real,this.imag)},nb$negative(){return new Sk.builtin.complex(-this.real,-this.imag)},nb$bool(){return this.real||this.imag},nb$add:b((a,b,c,d)=>new Sk.builtin.complex(a+c,b+d)),nb$subtract:b((a,b,c,d)=>new Sk.builtin.complex(a-c,b-d)),nb$reflected_subtract:b((a,b,c,d)=>new Sk.builtin.complex(c-a,d-b)),nb$multiply:b((a,b,c,d)=>new Sk.builtin.complex(c*a-d*b,a*d+b*c)),nb$divide:b(e),nb$reflected_divide:b((a,b,c,d)=>e(c,d,a,b)),nb$floor_divide(a){throw new Sk.builtin.TypeError("can't take floor of complex number."); },nb$reflected_floor_divide(a){throw new Sk.builtin.TypeError("can't take floor of complex number.");},nb$remainder(a){throw new Sk.builtin.TypeError("can't mod complex numbers.");},nb$reflected_remainder(a){throw new Sk.builtin.TypeError("can't mod complex numbers.");},nb$divmod(a){throw new Sk.builtin.TypeError("can't take floor or mod of complex number.");},nb$power(a,b){if(null!=b&&!Sk.builtin.checkNone(b))throw new Sk.builtin.ValueError("complex modulo");return k.call(this,a)},nb$abs(){var a= this.real;const b=this.imag;if(!Number.isFinite(a)||!Number.isFinite(b))return Infinity===a||-Infinity===a?new Sk.builtin.float_(Math.abs(a)):Infinity===b||-Infinity===b?new Sk.builtin.float_(Math.abs(b)):new Sk.builtin.float_(NaN);a=Math.hypot(a,b);if(!Number.isFinite(a))throw new Sk.builtin.OverflowError("absolute value too large");return new Sk.builtin.float_(a)}},getsets:{real:{$get(){return new Sk.builtin.float_(this.real)},$doc:"the real part of a complex number"},imag:{$get(){return new Sk.builtin.float_(this.imag)}, $doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth(){return new Sk.builtin.complex(this.real,-this.imag)},$flags:{NoArgs:!0},$textsig:null,$doc:"complex.conjugate() -> complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([new Sk.builtin.float_(this.real),new Sk.builtin.float_(this.imag)])},$flags:{NoArgs:!0},$textsig:null,$doc:Sk.builtin.none.none$},__format__:{$meth(a){if(Sk.builtin.checkString(a))throw new Sk.builtin.NotImplementedError("__format__ is not implemented for complex type."); throw new Sk.builtin.TypeError("__format__ requires str");},$flags:{OneArg:!0},$textsig:null,$doc:"complex.__format__() -> str\n\nConvert to a string according to format_spec."}}});Sk.exportSymbol("Sk.builtin.complex",Sk.builtin.complex);const d=Sk.builtin.checkComplex,g=/_[eE]|[eE]_|\._|_\.|[+-]_|_j|j_/,n=/_(?=[^_])/g;Sk.builtin.complex.complex_subtype_from_string=function(a,b){b=b||Sk.builtin.complex.prototype;var d=0,e=0,f=!1;if(Sk.builtin.checkString(a))a=Sk.ffi.remapToJs(a);else if("string"!== typeof a)throw new TypeError("provided unsupported string-alike argument");if(-1!==a.indexOf("\x00")||0===a.length||""===a)throw new Sk.builtin.ValueError("complex() arg is a malformed string");var h=0;a=a.replace(/inf|infinity/gi,"Infinity");for(a=a.replace(/nan/gi,"NaN");" "===a[h];)h++;if("("===a[h])for(f=!0,h++;" "===a[h];)h++;if(-1!==a.indexOf("_")){if(g.test(a))throw new Sk.builtin.ValueError("could not convert string to complex: '"+a+"'");a=a.charAt(0)+a.substring(1).replace(n,"")}var k=/^(?:[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+\.?))(?:[eE][+-]?\d+)?|NaN|Infinity))/; var l=a.substr(h);var p=l.match(k);if(null!==p)if(h+=p[0].length,"j"===a[h]||"J"===a[h])e=parseFloat(p[0]),h++;else if("+"===a[h]||"-"===a[h]){d=parseFloat(p[0]);p=a.substr(h).match(k);null!==p?(e=parseFloat(p[0]),h+=p[0].length):(e="+"===a[h]?1:-1,h++);if("j"!==a[h]&&"J"!==a[h])throw new Sk.builtin.ValueError("complex() arg is malformed string");h++}else d=parseFloat(p[0]);else p=p=l.match(/^([+-]?[jJ])/),null!==p&&(e=1===p[0].length?1:"+"===p[0][0]?1:-1,h+=p[0].length);for(;" "===a[h];)h++;if(f){if(")"!== a[h])throw new Sk.builtin.ValueError("complex() arg is malformed string");for(h++;" "===a[h];)h++}if(a.length!==h)throw new Sk.builtin.ValueError("complex() arg is malformed string");return c(d,e,b)};const k=b((a,b,c,d)=>{const g=c|0;return 0===d&&c===g?(100g?a=f(a,b,g,0):0a)throw new Sk.builtin.TypeError("length should not be negative");const {start:c,stop:b,step:e}=this.slice$indices(a);return new Sk.builtin.tuple([new Sk.builtin.int_(c),new Sk.builtin.int_(b),new Sk.builtin.int_(e)])},$doc:"S.indices(len) -> (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.", $textsig:null,$flags:{OneArg:!0}}},proto:{slice$as_indices(a){let c;var b=a?a=>Sk.misceval.asIndexSized(a,null,"slice indices must be integers or None or have an __index__ method"):a=>Sk.misceval.asIndexOrThrow(a,"slice indices must be integers or None or have an __index__ method");if(Sk.builtin.checkNone(this.step))c=1;else if(c=b(this.step),0===c)throw new Sk.builtin.ValueError("slice step cannot be zero");a=Sk.builtin.checkNone(this.start)?null:b(this.start);b=Sk.builtin.checkNone(this.stop)?null: b(this.stop);return{start:a,stop:b,step:c}},$wrt(a,c,b,e,f){f=f?b=>JSBI.__isBigInt(b)?JSBI.add(b,JSBI.BigInt(a)):b+a:b=>b+a;0c&&(c=f(c),0>c&&(c=0)),null===b?b=a:b>a?b=a:0>b&&(b=f(b))):(null===c?c=a-1:c>=a?c=a-1:0>c&&(c=f(c)),null===b?b=-1:0>b&&(b=f(b),0>b&&(b=-1)));return{start:c,stop:b,step:e}},slice$indices(a,c){let {start:b,stop:e,step:f}=this.slice$as_indices(!0,c);return this.$wrt(a,b,e,f,c)},sssiter$(a,c){let {start:b,stop:e,step:f}=this.slice$indices(a,!0);if(0e;a+=f)c(a)}},flags:{sk$acceptable_as_base_class:!1}});Sk.builtin.slice.startEnd$wrt=function(a,c,b){a=a.sq$length();void 0===c||Sk.builtin.checkNone(c)?c=0:(c=Sk.misceval.asIndexSized(c,null,"slice indices must be integers or have an __index__ method"),0>c&&(c+=a,0>c&&(c=0)));void 0===b||Sk.builtin.checkNone(b)?b=a:(b=Sk.misceval.asIndexSized(b,null,"slice indices must be integers or have an __index__ method"),0>b?(b+=a,0>b&&(b=0)):b>a&&(b=a));return{start:c,end:b}}},function(m, q){function a(a){return function(b){return Sk.builtin.checkAnySet(b)?a.call(this,b):Sk.builtin.NotImplemented.NotImplemented$}}function c(a){a instanceof Sk.builtin.set&&a.tp$hash===Sk.builtin.none.none$&&(a=new Sk.builtin.frozenset(Sk.misceval.arrayFromIterable(a)));return a}m={};Sk.builtin.set=Sk.abstr.buildNativeClass("set",{constructor:function(a){void 0===a?a=[]:Array.isArray(a)||(a=Sk.misceval.arrayFromIterable(a));Sk.asserts.assert(this instanceof Sk.builtin.set,"Bad call to set - must be called with an Array and 'new'"); const b=[];for(let c=0;c new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.",tp$init(a,b){Sk.abstr.checkNoKwargs("set",b);Sk.abstr.checkArgsLen("set",a,0,1);this.set$clear();return(a=a[0])&&this.set$update(a)},tp$new:Sk.generic.new, $r(){if(this.in$repr)return new Sk.builtin.str(Sk.abstr.typeName(this)+"(...)");this.in$repr=!0;const a=this.sk$asarray().map(a=>Sk.misceval.objectRepr(a));this.in$repr=!1;return Sk.__future__.python3?0===a.length?new Sk.builtin.str(Sk.abstr.typeName(this)+"()"):this.ob$type!==Sk.builtin.set?new Sk.builtin.str(Sk.abstr.typeName(this)+"({"+a.join(", ")+"})"):new Sk.builtin.str("{"+a.join(", ")+"}"):new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+a.join(", ")+"])")},tp$iter(){return new b(this)},tp$richcompare(a, b){if(!Sk.builtin.checkAnySet(a))return Sk.builtin.NotImplemented.NotImplemented$;switch(b){case "NotEq":case "Eq":return a=this===a?!0:this.get$size()!==a.get$size()?!1:Sk.misceval.isTrue(this.set$issubset(a)),"Eq"===b?a:!a;case "LtE":return this===a||Sk.misceval.isTrue(this.set$issubset(a));case "GtE":return this===a||Sk.misceval.isTrue(a.set$issubset(this));case "Lt":return this.get$size()a.get$size()&&Sk.misceval.isTrue(a.set$issubset(this))}}, nb$subtract:a(function(a){return this.difference.$meth.call(this,a)}),nb$and:a(function(a){return this.intersection.$meth.call(this,a)}),nb$or:a(function(a){return this.union.$meth.call(this,a)}),nb$xor:a(function(a){return this.symmetric_difference.$meth.call(this,a)}),nb$inplace_subtract:a(function(a){a===this&&(a=a.set$copy());return Sk.misceval.chain(this.difference_update.$meth.call(this,a),()=>this)}),nb$inplace_and:a(function(a){return Sk.misceval.chain(this.intersection_update.$meth.call(this, a),()=>this)}),nb$inplace_or:a(function(a){return Sk.misceval.chain(this.update.$meth.call(this,a),()=>this)}),nb$inplace_xor:a(function(a){a===this&&(a=a.set$copy());return Sk.misceval.chain(this.symmetric_difference_update.$meth.call(this,a),()=>this)}),sq$length(){return this.get$size()},sq$contains(a){a=c(a);return this.v.sq$contains(a)}},methods:{add:{$meth(a){this.set$add(a);return Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Add an element to a set.\n\nThis has no effect if the element is already present."}, clear:{$meth(){this.set$clear();return Sk.builtin.none.none$},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove all elements from this set."},copy:{$meth(){return this.set$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a shallow copy of a set."},discard:{$meth(a){a=c(a);this.set$discard(a);return Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing."},difference:{$meth(...a){const b=this.set$copy(); return Sk.misceval.chain(Sk.misceval.iterArray(a,a=>b.set$difference_update(a)),()=>b)},$flags:{MinArgs:0},$textsig:null,$doc:"Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)"},difference_update:{$meth(...a){return Sk.misceval.chain(Sk.misceval.iterArray(a,a=>this.set$difference_update(a)),()=>Sk.builtin.none.none$)},$flags:{MinArgs:0},$textsig:null,$doc:"Remove all elements of another set from this set."},intersection:{$meth(...a){return this.set$intersection_multi(...a)}, $flags:{MinArgs:0},$textsig:null,$doc:"Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)"},intersection_update:{$meth(...a){return Sk.misceval.chain(this.set$intersection_multi(...a),a=>{this.swap$bodies(a);return Sk.builtin.none.none$})},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the intersection of itself and another."},isdisjoint:{$meth(a){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{if(this.sq$contains(a))return new Sk.misceval.Break(Sk.builtin.bool.false$)}), a=>a||Sk.builtin.bool.true$)},$flags:{OneArg:!0},$textsig:null,$doc:"Return True if two sets have a null intersection."},issubset:{$meth(a){Sk.builtin.checkAnySet(a)||(a=this.set$make_basetype(a));return Sk.misceval.chain(a,a=>this.set$issubset(a))},$flags:{OneArg:!0},$textsig:null,$doc:"Report whether another set contains this set."},issuperset:{$meth(a){Sk.builtin.checkAnySet(a)||(a=this.set$make_basetype(a));return Sk.misceval.chain(a,a=>a.set$issubset(this))},$flags:{OneArg:!0},$textsig:null, $doc:"Report whether this set contains another set."},pop:{$meth(){if(0===this.get$size())throw new Sk.builtin.KeyError("pop from an empty set");return Sk.misceval.callsimArray(this.v.popitem,[this.v]).v[0]},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return an arbitrary set element.\nRaises KeyError if the set is empty."},remove:{$meth(a){const b=c(a);if(this.v.mp$lookup(b))return this.v.mp$ass_subscript(b),Sk.builtin.none.none$;throw new Sk.builtin.KeyError(a);},$flags:{OneArg:!0},$textsig:null, $doc:"Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError."},symmetric_difference:{$meth(a){let b;return Sk.misceval.chain(this.set$make_basetype(a),a=>{b=a;return b.set$symmetric_diff_update(this)},()=>b)},$flags:{OneArg:!0},$textsig:null,$doc:"Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)"},symmetric_difference_update:{$meth(a){Sk.builtin.checkAnySet(a)||(a=this.set$make_basetype(a)); return Sk.misceval.chain(a,a=>this.set$symmetric_diff_update(a),()=>Sk.builtin.none.none$)},$flags:{OneArg:!0},$textsig:null,$doc:"Update a set with the symmetric difference of itself and another."},union:{$meth(...a){const b=this.set$copy();return Sk.misceval.chain(Sk.misceval.iterArray(a,a=>b.set$update(a)),()=>b)},$flags:{MinArgs:0},$textsig:null,$doc:"Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)"},update:{$meth(...a){return Sk.misceval.chain(Sk.misceval.iterArray(a, a=>this.set$update(a)),()=>Sk.builtin.none.none$)},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the union of itself and others."}},proto:Object.assign(m,{sk$asarray(){return this.v.sk$asarray()},get$size(){return this.v.sq$length()},set$add(a){this.v.mp$ass_subscript(a,!0)},set$make_basetype(a){return Sk.misceval.chain(Sk.misceval.arrayFromIterable(a,!0),a=>new this.sk$builtinBase(a))},set$discard(a){return this.v.pop$item(a)},set$clear(){this.v=new Sk.builtin.dict([])},set$copy(){const a= new this.sk$builtinBase;a.v=this.v.dict$copy();return a},set$difference_update(a){return Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{this.set$discard(a)})},set$intersection(a){const b=new this.sk$builtinBase;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{this.sq$contains(a)&&b.set$add(a)}),()=>b)},set$intersection_multi(...a){if(!a.length)return this.set$copy();let b=this;return Sk.misceval.chain(Sk.misceval.iterArray(a,a=>Sk.misceval.chain(b.set$intersection(a),a=>{b=a})),()=>b)}, set$issubset(a){const b=this.get$size(),c=a.get$size();if(b>c)return Sk.builtin.bool.false$;for(let b=this.tp$iter(),c=b.tp$iternext();void 0!==c;c=b.tp$iternext())if(!a.sq$contains(c))return Sk.builtin.bool.false$;return Sk.builtin.bool.true$},set$symmetric_diff_update(a){return Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{void 0===this.set$discard(a)&&this.set$add(a)})},set$update(a){return Sk.misceval.iterFor(Sk.abstr.iter(a),a=>{this.set$add(a)})},swap$bodies(a){this.v=a.v}})});Sk.exportSymbol("Sk.builtin.set", Sk.builtin.set);q=Sk.builtin.set.prototype;Sk.builtin.frozenset=Sk.abstr.buildNativeClass("frozenset",{constructor:function(a){void 0===a&&(a=[]);Sk.asserts.assert(Array.isArray(a)&&this instanceof Sk.builtin.frozenset,"bad call to frozen set - must be called with an Array and 'new'");const b=[];for(let c=0;c empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", tp$hash(){let a=1927868237;const b=this.sk$asarray();a*=b.length+1;for(let c=0;ca.length?new Sk.builtin.frozenset(a): Sk.builtin.frozenset.$emptyset)},$r:q.$r,tp$iter:q.tp$iter,tp$richcompare:q.tp$richcompare,nb$subtract:q.nb$subtract,nb$and:q.nb$and,nb$or:q.nb$or,nb$xor:q.nb$xor,sq$length:q.sq$length,sq$contains:q.sq$contains},methods:{copy:Object.assign({},q.copy.d$def,{$meth(){return this.constructor===this.sk$builtinBase?this:new Sk.builtin.frozenset(this.sk$asarray())}}),difference:q.difference.d$def,intersection:q.intersection.d$def,isdisjoint:q.isdisjoint.d$def,issubset:q.issubset.d$def,issuperset:q.issuperset.d$def, symmetric_difference:q.symmetric_difference.d$def,union:q.union.d$def},proto:Object.assign({$subtype_new(a,b){const c=new this.constructor;return Sk.misceval.chain(Sk.builtin.frozenset.prototype.tp$new(a),a=>{c.v=a.v;return c})}},m)});Sk.builtin.frozenset.$emptyset=Object.create(Sk.builtin.frozenset.prototype,{v:{value:new Sk.builtin.dict([]),enumerable:!0},in$repr:{value:!1,enumerable:!0}});Sk.exportSymbol("Sk.builtin.frozenset",Sk.builtin.frozenset);var b=Sk.abstr.buildIteratorClass("set_iterator", {constructor:function(a){this.$index=0;this.$seq=a.sk$asarray();this.$orig=a},iternext:Sk.generic.iterNextWithArrayCheckSize,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$acceptable_as_base_class:!1}})},function(m,q){Sk.builtin.print=function(a,c){let [b,e,f]=Sk.abstr.copyKeywordsToNamedArgs("print",["sep","end","file","flush"],[],c);if(void 0===b||Sk.builtin.checkNone(b))b=" ";else if(Sk.builtin.checkString(b))b=b.$jsstr();else throw new Sk.builtin.TypeError("sep must be None or a string, not "+ Sk.abstr.typeName(b));if(void 0===e||Sk.builtin.checkNone(e))e="\n";else if(Sk.builtin.checkString(e))e=e.$jsstr();else throw new Sk.builtin.TypeError("end must be None or a string, not "+Sk.abstr.typeName(e));let l;if(void 0!==f&&!Sk.builtin.checkNone(f)&&(l=Sk.abstr.lookupSpecial(f,Sk.builtin.str.$write),void 0===l))throw new Sk.builtin.AttributeError("'"+Sk.abstr.typeName(f)+"' object has no attribute 'write'");const h=new Sk.builtin.str(a.map(a=>(new Sk.builtin.str(a)).toString()).join(b)+e); if(void 0!==l)Sk.misceval.callsimArray(l,[h]);else return Sk.misceval.chain(Sk.importModule("sys",!1,!0),a=>(l=Sk.abstr.lookupSpecial(a.$d.stdout,Sk.builtin.str.$write))&&Sk.misceval.callsimOrSuspendArray(l,[h]))};Sk.builtin.print.co_fastcall=1},function(m,q){Sk.builtin.module=Sk.abstr.buildNativeClass("module",{constructor:function(){this.$d={}},slots:{tp$doc:"Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.",tp$getattr(a,c){var b=this.$d[a.$mangled]; if(void 0!==b)return b;b=this.ob$type.$typeLookup(a);if(void 0!==b){const a=b.tp$descr_get;return a?a.call(b,this,this.ob$type,c):b}const e=this.$d.__getattr__;if(void 0!==e)return b=Sk.misceval.tryCatch(()=>Sk.misceval.callsimOrSuspendArray(e,[a]),a=>{if(!(a instanceof Sk.builtin.AttributeError))throw a;}),c?b:Sk.misceval.retryOptionalSuspensionOrThrow(b)},tp$setattr:Sk.generic.setAttr,tp$new:Sk.generic.new,tp$init(a,c){const [b,e]=Sk.abstr.copyKeywordsToNamedArgs("module",["name","doc"],a,c,[Sk.builtin.none.none$]); Sk.builtin.pyCheckType("module","string",b);this.init$dict(b,e)},$r(){let a=this.get$name();if(void 0!==a){var c=this.get$mod_reprf();if(void 0!==c)return Sk.misceval.callsimOrSuspendArray(c,[this])}a=void 0===a?"'?'":a;c=this.from$file();c=void 0===c?this.empty_or$loader():c;return new Sk.builtin.str("")}},getsets:{__dict__:{$get(){return new Sk.builtin.mappingproxy(this.$d)}}},methods:{__dir__:{$meth(){const a=this.tp$getattr(Sk.builtin.str.$dict);if(!Sk.builtin.checkMapping(a))throw new Sk.builtin.TypeError("__dict__ is not a dictionary"); const c=a.mp$lookup(Sk.builtin.str.$dir);return void 0!==c?Sk.misceval.callsimOrSuspendArray(c,[]):new Sk.builtin.list(Sk.misceval.arrayFromIterable(a))},$flags:{NoArgs:!0},$doc:"__dir__() -> list\nspecialized dir() implementation"}},proto:{init$dict(a,c){this.$d.__name__=a;this.$d.__doc__=c;this.$d.__package__=Sk.builtin.none.none$;this.$d.__spec__=Sk.builtin.none.none$;this.$d.__loader__=Sk.builtin.none.none$},sk$attrError(){const a=this.get$name();return void 0===a?"module":"module "+a},get$name(){const a= this.tp$getattr(Sk.builtin.str.$name);return a&&Sk.misceval.objectRepr(a)},from$file(){const a=this.tp$getattr(Sk.builtin.str.$file);return a&&" from "+Sk.misceval.objectRepr(a)},empty_or$loader(){if(this.$js&&this.$js.includes("$builtinmodule"))return" (built-in)";const a=this.tp$getattr(Sk.builtin.str.$loader);return void 0===a||Sk.builtin.checkNone(a)?"":" ("+Sk.misceval.objectRepr(a)+")"},get$mod_reprf(){const a=this.tp$getattr(Sk.builtin.str.$loader);return a&&a.tp$getattr(this.str$mod_repr)}, str$mod_repr:new Sk.builtin.str("module_repr")}});Sk.exportSymbol("Sk.builtin.module",Sk.builtin.module)},function(m,q){Sk.builtin.structseq_types={};Sk.builtin.make_structseq=function(a,c,b,e){const f=a+"."+c,l=[];a=[];for(let c in b)l.push(c),a.push(b[c]);b={};for(let c=0;c")}},iternext(a,c){var b=this;this.gi$running=!0;void 0===c&&(c=Sk.builtin.none.none$);this.gi$sentvalue=c;c=[this];this.func_closure&& c.push(this.func_closure);return function l(c){if(c instanceof Sk.misceval.Suspension){if(a)return new Sk.misceval.Suspension(l,c);c=Sk.misceval.retryOptionalSuspensionOrThrow(c)}b.gi$running=!1;Sk.asserts.assert(void 0!==c);if(c!==Sk.builtin.none.none$)return b.gi$resumeat=c[0],c=c[1]}(this.func_code.apply(this.func_globals,c))},methods:{send:{$meth(a){return this.tp$iternext(!0,a)},$flags:{OneArg:!0},$doc:"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration."}}}); Sk.exportSymbol("Sk.builtin.generator",Sk.builtin.generator);Sk.builtin.makeGenerator=function(a,c){var b,e=new Sk.builtin.generator(null,null,null);e.tp$iternext=a;for(b in c)c.hasOwnProperty(b)&&(e[b]=c[b]);return e};Sk.exportSymbol("Sk.builtin.makeGenerator",Sk.builtin.makeGenerator)},function(m,q){Sk.builtin.file=function(a,c,b){var e;if(!(this instanceof Sk.builtin.file))return new Sk.builtin.file(a,c,b);this.mode=c;this.name=Sk.ffi.remapToJs(a);this.closed=!1;if("/dev/stdout"===this.name)this.data$= Sk.builtin.none.none$,this.fileno=1;else if("/dev/stdin"===this.name)this.fileno=0;else if("/dev/stderr"===this.name)this.fileno=2;else{if(Sk.inBrowser)if(this.fileno=10,b=document.getElementById(a.v),null==b)if("w"==c.v||"a"==c.v)this.data$="";else throw new Sk.builtin.IOError("[Errno 2] No such file or directory: '"+a.v+"'");else"textarea"==b.nodeName.toLowerCase()?this.data$=b.value:this.data$=b.textContent;else this.fileno=11,this.data$=Sk.read(a.v);this.lineList=this.data$.split("\n");this.lineList= this.lineList.slice(0,-1);for(e in this.lineList)this.lineList[e]+="\n";this.currentLine=0}this.pos$=0;Sk.fileopen&&10<=this.fileno&&Sk.fileopen(this);return this};Sk.abstr.setUpInheritance("file",Sk.builtin.file,Sk.builtin.object);Sk.abstr.setUpBuiltinMro(Sk.builtin.file);Sk.builtin.file.prototype.$r=function(){return new Sk.builtin.str("<"+(this.closed?"closed":"open")+"file '"+this.name+"', mode '"+Sk.ffi.remapToJs(this.mode)+"'>")};Sk.builtin.file.prototype.tp$iter=function(){var a={tp$iter:function(){return a}, $obj:this,$index:this.currentLine,$lines:this.lineList,tp$iternext:function(){if(!(a.$index>=a.$lines.length))return new Sk.builtin.str(a.$lines[a.$index++])}};return a};Sk.abstr.setUpSlots(Sk.builtin.file);Sk.builtin.file.prototype.__enter__=new Sk.builtin.func(function(a){return a});Sk.builtin.file.prototype.__exit__=new Sk.builtin.func(function(a){return Sk.misceval.callsimArray(Sk.builtin.file.prototype.close,[a])});Sk.builtin.file.prototype.close=new Sk.builtin.func(function(a){a.closed=!0;return Sk.builtin.none.none$}); Sk.builtin.file.prototype.flush=new Sk.builtin.func(function(a){});Sk.builtin.file.prototype.fileno=new Sk.builtin.func(function(a){return this.fileno});Sk.builtin.file.prototype.isatty=new Sk.builtin.func(function(a){return!1});Sk.builtin.file.prototype.read=new Sk.builtin.func(function(a,c){var b=a.data$.length;if(a.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var e=void 0===c?b:Sk.ffi.remapToJs(c);e=new Sk.builtin.str(a.data$.substr(a.pos$,e));a.pos$=void 0===c?b:a.pos$+ Sk.ffi.remapToJs(c);a.pos$>=b&&(a.pos$=b);return e});Sk.builtin.file.$readline=function(a,c,b){if(0===a.fileno){a=Sk.ffi.remapToJs(b);a=Sk.inputfun(a?a:"");if(a instanceof Promise||a&&"function"===typeof a.then){var e=new Sk.misceval.Suspension;e.resume=function(){if(e.data.error)throw e.data.error;return new Sk.builtin.str(e.data.result)};e.data={type:"Sk.promise",promise:a};return e}return new Sk.builtin.str(a)}c="";a.currentLine{b=Sk.ffi.remapToJs(a);e[b]=Sk.ffi.remapToJs(c)});return e}if(a instanceof Sk.builtin.list||a instanceof Sk.builtin.tuple){e=[];for(c=0;cb;f+=e)d.push(new Sk.builtin.int_(f));else{a=f=JSBI.BigInt(a);e=JSBI.BigInt(e);b=JSBI.BigInt(b);if(JSBI.greaterThan(e,JSBI.__ZERO))for(;JSBI.lessThan(f,b);)d.push(new Sk.builtin.int_(c(f))),f=JSBI.add(f,e);else for(;JSBI.greaterThan(f,b);)d.push(new Sk.builtin.int_(c(f))),f=JSBI.add(f,e);a=c(a);e=c(e);b=c(b)}return new Sk.builtin.range_(a,b,e,d)}function c(a){return JSBI.lessThan(a,JSBI.__MAX_SAFE)&& JSBI.greaterThan(a,JSBI.__MIN_SAFE)?JSBI.toNumber(a):a}Sk.builtin.range_=Sk.abstr.buildNativeClass("range",{constructor:function(a,b,c,d){this.start=a;this.stop=b;this.step=c;this.v=d},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"range(stop) -> range object\nrange(start, stop[, step]) -> range object\n\nReturn an object that produces a sequence of integers from start (inclusive)\nto stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\nstart defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\nThese are exactly the valid indices for a list of 4 elements.\nWhen step is given, it specifies the increment (or decrement).", tp$new(b,c){Sk.abstr.checkNoKwargs("range",c);Sk.abstr.checkArgsLen("range",b,1,3);return a(b[0],b[1],b[2])},$r(){let a="range("+this.start+", "+this.stop;1!=this.step&&(a+=", "+this.step);return new Sk.builtin.str(a+")")},tp$richcompare(a,b){if("Eq"!==b&&"NotEq"!==b||a.ob$type!==Sk.builtin.range_)return Sk.builtin.NotImplemented.NotImplemented$;a=new Sk.builtin.list(a.v);return(new Sk.builtin.list(this.v)).tp$richcompare(a,b)},tp$iter(){return new b(this)},nb$bool(){return 0!==this.v.length},sq$contains(a){const b= this.v;for(let c=0;ca&&(a=this.v.length+a);if(0>a||a>=this.v.length)throw new Sk.builtin.IndexError("range object index out of range");return this.v[a]}if(a.constructor===Sk.builtin.slice){const b=[],c=this.v;a.sssiter$(c.length,a=>{b.push(c[a])});let {start:d,stop:e,step:f}=a.slice$indices(c.length);d=Sk.misceval.asIndex(c[d])|| this.start;e=Sk.misceval.asIndex(c[e])||this.stop;f="number"===typeof this.step?f*this.step:JSBI.multiply(this.step,JSBI.BigInt(f));return new Sk.builtin.range_(d,e,f,b)}throw new Sk.builtin.TypeError("range indices must be integers or slices, not "+Sk.abstr.typeName(a));}},getsets:{start:{$get(){return new Sk.builtin.int_(this.start)}},step:{$get(){return new Sk.builtin.int_(this.step)}},stop:{$get(){return new Sk.builtin.int_(this.stop)}}},methods:{__reversed__:{$meth(){return new e(this)},$flags:{NoArgs:!0}, $textsig:null,$doc:"Return a reverse iterator."},count:{$meth(a){let b=0;for(let c=0;c integer -- return number of occurrences of value"},index:{$meth(a){for(let b=0;b integer -- return index of value.\nRaise ValueError if the value is not present."}},proto:{sk$asarray(){return this.v.slice(0)}},flags:{sk$acceptable_as_base_class:!1}});var b=Sk.abstr.buildIteratorClass("range_iterator",{constructor:function(a){this.$index=0;this.$seq=a.v},iternext(){return this.$seq[this.$index++]},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$acceptable_as_base_class:!1}}), e=Sk.abstr.buildIteratorClass("range_reverseiterator",{constructor:function(a){this.$seq=a.v;this.$index=this.$seq.length-1},iternext(){return this.$seq[this.$index--]},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$acceptable_as_base_class:!1}});Sk.builtin.range=Sk.builtin.xrange=function(b,c,e){b=a(b,c,e);return new Sk.builtin.list(b.v)}},function(m,q){Sk.builtin.enumerate=Sk.abstr.buildIteratorClass("enumerate",{constructor:function(a,c){if(!(this instanceof Sk.builtin.enumerate))throw TypeError("Failed to construct 'enumerate': Please use the 'new' operator"); this.$iterable=a;this.$index=c;return this},iternext(a){const c=Sk.misceval.chain(this.$iterable.tp$iternext(a),a=>{if(void 0!==a)return new Sk.builtin.tuple([new Sk.builtin.int_(this.$index++),a])});return a?c:Sk.misceval.retryOptionalSuspensionOrThrow(c)},slots:{tp$doc:"Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", tp$new(a,c){let [b,e]=Sk.abstr.copyKeywordsToNamedArgs("enumerate",["iterable","start"],a,c,[new Sk.builtin.int_(0)]);b=Sk.abstr.iter(b);e=Sk.misceval.asIndexOrThrow(e);if(this===Sk.builtin.enumerate.prototype)return new Sk.builtin.enumerate(b,e);a=new this.constructor;Sk.builtin.enumerate.call(a,b,e);return a}}});Sk.exportSymbol("Sk.builtin.enumerate",Sk.builtin.enumerate)},function(m,q){Sk.builtin.filter_=Sk.abstr.buildIteratorClass("filter",{constructor:function(a,c){this.$func=a;this.$iterable= c},iternext(a){const c=Sk.misceval.iterFor(this.$iterable,a=>Sk.misceval.chain(this.check$filter(a),a=>a?new Sk.misceval.Break(a):void 0));return a?c:Sk.misceval.retryOptionalSuspensionOrThrow(c)},slots:{tp$doc:"Return an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.",tp$new(a,c){let [b,e]=Sk.abstr.copyKeywordsToNamedArgs("filter",["predicate","iterable"],a,c,[]);b=Sk.builtin.checkNone(b)?null:b;e=Sk.abstr.iter(e); if(this===Sk.builtin.filter_.prototype)return new Sk.builtin.filter_(b,e);a=new this.constructor;Sk.builtin.filter_.call(a,b,e);return a}},proto:{check$filter(a){let c;c=null===this.$func?a:Sk.misceval.callsimOrSuspendArray(this.$func,[a]);return Sk.misceval.chain(c,b=>Sk.misceval.isTrue(b)?a:void 0)}}});Sk.exportSymbol("Sk.builtin.filter_",Sk.builtin.filter_)},function(m,q){Sk.builtin.map_=Sk.abstr.buildIteratorClass("map",{constructor:function(a,c){this.$func=a;this.$iters=c},iternext(a){const c= [],b=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,b=>Sk.misceval.chain(b.tp$iternext(a),a=>{if(void 0===a)return new Sk.misceval.Break(!0);c.push(a)})),a=>a?void 0:Sk.misceval.callsimOrSuspendArray(this.$func,c));return a?b:Sk.misceval.retryOptionalSuspensionOrThrow(b)},slots:{tp$doc:"map(func, *iterables) --\x3e map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.",tp$new(a,c){this===Sk.builtin.map_.prototype&& Sk.abstr.checkNoKwargs("map",c);Sk.abstr.checkArgsLen("map",a,2);c=a[0];const b=[];for(let c=1;cthis.$idx)){var c= Sk.misceval.tryCatch(()=>Sk.abstr.objectGetItem(this.$seq,new Sk.builtin.int_(this.$idx--),a),a=>{if(a instanceof Sk.builtin.IndexError)this.$idx=-1;else throw a;});return a?c:Sk.misceval.retryOptionalSuspensionOrThrow(c)}},slots:{tp$doc:"Return a reverse iterator over the values of the given sequence.",tp$new(a,c){this===Sk.builtin.reversed.prototype&&Sk.abstr.checkNoKwargs("reversed",c);Sk.abstr.checkArgsLen("reversed",a,1,1);a=a[0];c=Sk.abstr.lookupSpecial(a,Sk.builtin.str.$reversed);if(void 0!== c)return Sk.misceval.callsimArray(c,[]);if(!Sk.builtin.checkSequence(a)||void 0===Sk.abstr.lookupSpecial(a,Sk.builtin.str.$len))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(a)+"' object is not a sequence");if(this===Sk.builtin.reversed.prototype)return new Sk.builtin.reversed(a);c=new this.constructor;Sk.builtin.reversed.call(c,a);return c}},methods:{__length_hint__:{$meth:function(){return 0<=this.$idx?new Sk.builtin.int_(this.$idx):new Sk.builtin.int_(0)},$flags:{NoArgs:!0}}}})},function(m, q){Sk.builtin.zip_=Sk.abstr.buildIteratorClass("zip",{constructor:function(a){this.$iters=a;0===a.length&&(this.tp$iternext=()=>{})},iternext(a){const c=[],b=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,b=>Sk.misceval.chain(b.tp$iternext(a),a=>{if(void 0===a)return new Sk.misceval.Break(!0);c.push(a)})),a=>a?void 0:new Sk.builtin.tuple(c));return a?b:Sk.misceval.retryOptionalSuspensionOrThrow(b)},slots:{tp$doc:"zip(iter1 [,iter2 [...]]) --\x3e zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", tp$new(a,c){this===Sk.builtin.zip_.prototype&&Sk.abstr.checkNoKwargs("zip",c);c=[];for(let b=0;b":a.T_RARROW,".":a.T_DOT,"...":a.T_ELLIPSIS,"/":a.T_SLASH,"//":a.T_DOUBLESLASH,"//=":a.T_DOUBLESLASHEQUAL,"/=":a.T_SLASHEQUAL,":":a.T_COLON,";":a.T_SEMI,"<":a.T_LESS,"<<":a.T_LEFTSHIFT,"<<=":a.T_LEFTSHIFTEQUAL,"<=":a.T_LESSEQUAL,"=":a.T_EQUAL,"==":a.T_EQEQUAL,">":a.T_GREATER,">=":a.T_GREATEREQUAL,">>":a.T_RIGHTSHIFT,">>=":a.T_RIGHTSHIFTEQUAL,"@":a.T_AT,"@=":a.T_ATEQUAL,"[":a.T_LSQB,"]":a.T_RSQB,"^":a.T_CIRCUMFLEX,"^=":a.T_CIRCUMFLEXEQUAL,"{":a.T_LBRACE, "|":a.T_VBAR,"|=":a.T_VBAREQUAL,"}":a.T_RBRACE,"~":a.T_TILDE};var c={};(function(){for(var b in a)c[a[b]]=b})();["tok_name","ISTERMINAL","ISNONTERMINAL","ISEOF"].concat(Object.keys(c).map(function(a){return c[a]}));Sk.token={};Sk.token.tokens=a;Sk.token.tok_name=c;Sk.token.EXACT_TOKEN_TYPES=m;Sk.token.ISTERMINAL=function(b){return b=a.T_NT_OFFSET};Sk.token.ISEOF=function(b){return b==a.T_ENDMARKER};Sk.exportSymbol("Sk.token",Sk.token);Sk.exportSymbol("Sk.token.tokens", Sk.token.tokens);Sk.exportSymbol("Sk.token.tok_name",Sk.token.tok_name);Sk.exportSymbol("Sk.token.EXACT_TOKEN_TYPES");Sk.exportSymbol("Sk.token.ISTERMINAL",Sk.token.ISTERMINAL);Sk.exportSymbol("Sk.token.ISNONTERMINAL",Sk.token.ISNONTERMINAL);Sk.exportSymbol("Sk.token.ISEOF",Sk.token.ISEOF)},function(m,q){function a(a,b,c,d,e){this.type=a;this.string=b;this.start=c;this.end=d;this.line=e}function c(a){return"("+Array.prototype.slice.call(arguments).join("|")+")"}function b(a){return c.apply(null,arguments)+ "?"}function e(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}function f(){return" FR RF Br BR Fr r B R b bR f rb rB F Rf U rF u RB br fR fr rf Rb".split(" ")}function l(a){a?delete Sk.token.EXACT_TOKEN_TYPES["<>"]:Sk.token.EXACT_TOKEN_TYPES["<>"]=Sk.token.tokens.T_NOTEQUAL;t=Object.keys(Sk.token.EXACT_TOKEN_TYPES).sort();y=c.apply(this,t.reverse().map(function(a){return a&&k.test(a)?a.replace(n,"\\$&"):a}));B=c("\\r?\\n",y)}var h=Sk.token.tokens;const d=Sk.builtin.SyntaxError,g=Sk.builtin.SyntaxError; a.prototype.exact_type=function(){return this.type==h.T_OP&&this.string in Sk.token.EXACT_TOKEN_TYPES?Sk.token.EXACT_TOKEN_TYPES[this.string]:this.type};var n=/[\\^$.*+?()[\]{}|]/g,k=RegExp(n.source);const p=function(){var a=c("[A-Z]","[a-z]","[\\u{10B99}-\\u{10B9C}\\u{112A9}\\u{115DC}-\\u{115DD}\\u034F\\u115F-\\u1160\\u17B4-\\u17B5\\u2065\\u3164\\uFFA0\\uFFF0-\\uFFF8\\u{E0000}\\u{E0002}-\\u{E001F}\\u{E0080}-\\u{E00FF}\\u{E01F0}-\\u{E0FFF}\\u{112A9}\\u00D7]","[\\u02B0-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0374\\u037A\\u0559\\u06E5-\\u06E6\\u07F4-\\u07F5\\u0971\\u1C78-\\u1C7D\\u1D2C-\\u1D6A\\u1DFD-\\u1DFF\\u2E2F\\u30FC\\uA67F\\uA69C-\\uA69D\\uA717-\\uA71F\\uA788\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F\\uFF70\\uFF9E-\\uFF9F\\u{16F93}-\\u{16F9F}\\u02D0-\\u02D1\\u0640\\u07FA\\u0E46\\u0EC6\\u1843\\u1AA7\\u1C7B\\u3005\\u3031-\\u3035\\u309D-\\u309E\\u30FC-\\u30FE\\uA015\\uA60C\\uA9CF\\uA9E6\\uAA70\\uAADD\\uAAF3-\\uAAF4\\uFF70\\u{16B42}-\\u{16B43}\\u{16FE0}-\\u{16FE1}\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D2C-\\u1D6A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F\\uFF9E-\\uFF9F\\u02B2\\u1D62\\u1DA4\\u1DA8\\u2071\\u2C7C\\u2E18-\\u2E19\\u2E2F]", "[\\u2135-\\u2138\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u3006\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uF900-\\uFA6D\\uFA70-\\uFAD9\\u{17000}-\\u{187F1}\\u{18800}-\\u{18AF2}\\u{1B170}-\\u{1B2FB}\\u{20000}-\\u{2A6D6}\\u{2A700}-\\u{2B734}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u{2F800}-\\u{2FA1D}\\uAAC0\\uAAC2\\uFE20-\\uFE2F\\u{10D22}-\\u{10D23}\\u{1135D}\\u00AA\\u00BA\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uFA0E-\\uFA0F\\uFA11\\uFA13-\\uFA14\\uFA1F\\uFA21\\uFA23-\\uFA24\\uFA27-\\uFA29\\u{20000}-\\u{2A6D6}\\u{2A700}-\\u{2B734}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u115F-\\u1160\\u3164\\uFFA0\\u0673\\u17A3-\\u17A4\\u0E40-\\u0E44\\u0EC0-\\u0EC4\\u19B5-\\u19B7\\u19BA\\uAAB5-\\uAAB6\\uAAB9\\uAABB-\\uAABC]", "[\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u2170-\\u217F\\u2160-\\u216F]","_","[\\u1885-\\u1886\\u2118\\u212E\\u309B-\\u309C]"),b=c(a,"[\\u104A-\\u104B\\u102B-\\u102C\\u102D-\\u1030\\u1031\\u1032-\\u1036\\u1038\\u103B-\\u103C\\u103D-\\u103E\\u1056-\\u1057\\u1058-\\u1059\\u105E-\\u1060\\u1062\\u1067-\\u1068\\u1071-\\u1074\\u1082\\u1083-\\u1084\\u1085-\\u1086\\u109C\\u109D\\u1037\\u1039-\\u103A\\u1087-\\u108C\\u108D\\u108F\\u109A-\\u109B\\uA9E5\\uAA7B\\uAA7C\\uAA7D\\uA9E6\\uAA70\\u104A-\\u104B]","[\\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\\u0F7F\\u102B-\\u102C\\u1031\\u1038\\u103B-\\u103C\\u1056-\\u1057\\u1062\\u1067-\\u1068\\u1083-\\u1084\\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\\u1B82\\u1BA1\\u1BA6-\\u1BA7\\u1BE7\\u1BEA-\\u1BEC\\u1BEE\\u1C24-\\u1C2B\\u1C34-\\u1C35\\u1CF2-\\u1CF3\\uA823-\\uA824\\uA827\\uA880-\\uA881\\uA8B4-\\uA8C3\\uA952\\uA983\\uA9B4-\\uA9B5\\uA9BA-\\uA9BB\\uA9BD-\\uA9BF\\uAA2F-\\uAA30\\uAA33-\\uAA34\\uAA4D\\uAAEB\\uAAEE-\\uAAEF\\uAAF5\\uABE3-\\uABE4\\uABE6-\\uABE7\\uABE9-\\uABEA\\u{11000}\\u{11002}\\u{11082}\\u{110B0}-\\u{110B2}\\u{110B7}-\\u{110B8}\\u{1112C}\\u{11145}-\\u{11146}\\u{11182}\\u{111B3}-\\u{111B5}\\u{111BF}\\u{1122C}-\\u{1122E}\\u{11232}-\\u{11233}\\u{112E0}-\\u{112E2}\\u{11302}-\\u{11303}\\u{1133E}-\\u{1133F}\\u{11341}-\\u{11344}\\u{11347}-\\u{11348}\\u{1134B}-\\u{1134C}\\u{11357}\\u{11362}-\\u{11363}\\u{11435}-\\u{11437}\\u{11440}-\\u{11441}\\u{11445}\\u{114B0}-\\u{114B2}\\u{114B9}\\u{114BB}-\\u{114BE}\\u{114C1}\\u{115AF}-\\u{115B1}\\u{115B8}-\\u{115BB}\\u{115BE}\\u{11630}-\\u{11632}\\u{1163B}-\\u{1163C}\\u{1163E}\\u{116AC}\\u{116AE}-\\u{116AF}\\u{11720}-\\u{11721}\\u{11726}\\u{1182C}-\\u{1182E}\\u{11838}\\u{11A39}\\u{11A57}-\\u{11A58}\\u{11A97}\\u{11C2F}\\u{11C3E}\\u{11CA9}\\u{11CB1}\\u{11CB4}\\u{11D8A}-\\u{11D8E}\\u{11D93}-\\u{11D94}\\u{11D96}\\u{11EF5}-\\u{11EF6}\\u{16F51}-\\u{16F7E}\\u0F3E-\\u0F3F\\u1087-\\u108C\\u108F\\u109A-\\u109B\\u1B44\\u1BAA\\u1CE1\\u1CF7\\u302E-\\u302F\\uA953\\uA9C0\\uAA7B\\uAA7D\\uABEC\\u{111C0}\\u{11235}\\u{1134D}\\u{116B6}\\u{1D16D}-\\u{1D172}\\u09BE\\u09D7\\u0B3E\\u0B57\\u0BBE\\u0BD7\\u0CC2\\u0CD5-\\u0CD6\\u0D3E\\u0D57\\u0DCF\\u0DDF\\u302E-\\u302F\\u{1133E}\\u{11357}\\u{114B0}\\u{114BD}\\u{115AF}\\u{1D165}\\u{1D16E}-\\u{1D172}]", "[\\u{1D7CE}-\\u{1D7FF}\\uFF10-\\uFF19]","\\u2040","[\\u00B7\\u0387\\u1369-\\u1371\\u19DA]");if(!1===RegExp().unicode)return new RegExp("^"+a+"+"+b+"*$","u");a=c("[A-Z]","[a-z]","_");b=c(a,"[0-9]");return new RegExp("^"+a+"+"+b+"*$")}();(function(a){return c.apply(null,arguments)+"*"})("\\\\\\r?\\n[ \\f\\t]*");b("#[^\\r\\n]*");m=c("[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?","\\.[0-9](?:_?[0-9])*")+b("[eE][-+]?[0-9](?:_?[0-9])*");var w=c(m,"[0-9](?:_?[0-9])*[eE][-+]?[0-9](?:_?[0-9])*"),A=c("[0-9](?:_?[0-9])*[jJ]", w+"[jJ]");m=c.apply(null,f());q=c(m+"'''",m+'"""');c(m+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'",m+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*"');var t,y,B;l(!0);Sk.token.setupTokens=l;var E=c(m+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*"+c("'","\\\\\\r?\\n"),m+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*'+c('"',"\\\\\\r?\\n")),F=c("\\\\\\r?\\n|$","#[^\\r\\n]*",q),K={};m=f();for(let a of m)K[a+"'"]="^[^'\\\\]*(?:\\\\.[^'\\\\]*)*'",K[a+'"']='^[^"\\\\]*(?:\\\\.[^"\\\\]*)*"',K[a+"'''"]="^[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''", K[a+'"""']='^[^"\\\\]*(?:(?:\\\\.|"(?!""))[^"\\\\]*)*"""';let G=[],U=[];for(let a of m)G.push(a+'"'),G.push(a+"'"),U.push(a+'"""'),U.push(a+"'''");Sk._tokenize=function(b,f,k,n){var l=Sk.__future__.python3?"":"(?:L?)";l=c("0[xX](?:_?[0-9a-fA-F])+"+l,"0[bB](?:_?[01])+"+l,Sk.__future__.silent_octal_literal?"0([oO]?)(?:_?[0-7])+"+l:"0([oO])(?:_?[0-7])+"+l,"(?:0(?:_?0)*|[1-9](?:_?[0-9])*)"+l);l=c(A,w,l);l="[ \\f\\t]*"+c(F,l,B,E,"\\w+");l=new RegExp(l);var m=0,t=0,q=0,y="",u=0,C=null,N=[0],H,R=void 0, X=void 0,J,T;void 0!==k&&("utf-8-sig"==k&&(k="utf-8"),n(new a(h.T_ENCODING,k,[0,0],[0,0],"")));for(var D=k="";;){try{k=D,D=f()}catch(Q){D=""}m+=1;var x=0,P=D.length;if(y){if(!D)throw new d("EOF in multi-line string",b,X[0],X[1]);R.lastIndex=0;var r=R.exec(D);if(r)x=J=r[0].length,n(new a(h.T_STRING,y+D.substring(0,J),X,[m,J],C+D)),y="",u=0,C=null;else{u&&"\\\n"!==D.substring(D.length-2)&&"\\\r\n"!==D.substring(D.length-3)?(n(new a(h.T_ERRORTOKEN,y+D,X,[m,D.length],C)),y="",C=null):(y+=D,C+=D);continue}}else if(0!= t||q){if(!D)throw new d("EOF in multi-line statement",b,m,0);q=0}else{if(!D)break;for(H=0;xN[N.length-1]&&(N.push(H),n(new a(h.T_INDENT, D.substring(x),[m,0],[m,x],D)));for(;H":Sk.token.tokens.T_GREATER,"=":Sk.token.tokens.T_EQUAL,".":Sk.token.tokens.T_DOT,"%":Sk.token.tokens.T_PERCENT,"`":Sk.token.tokens.T_BACKQUOTE,"{":Sk.token.tokens.T_LBRACE,"}":Sk.token.tokens.T_RBRACE,"@":Sk.token.tokens.T_AT,"@=":Sk.token.tokens.T_ATEQUAL, "==":Sk.token.tokens.T_EQEQUAL,"!=":Sk.token.tokens.T_NOTEQUAL,"<>":Sk.token.tokens.T_NOTEQUAL,"<=":Sk.token.tokens.T_LESSEQUAL,">=":Sk.token.tokens.T_GREATEREQUAL,"~":Sk.token.tokens.T_TILDE,"^":Sk.token.tokens.T_CIRCUMFLEX,"<<":Sk.token.tokens.T_LEFTSHIFT,">>":Sk.token.tokens.T_RIGHTSHIFT,"**":Sk.token.tokens.T_DOUBLESTAR,"+=":Sk.token.tokens.T_PLUSEQUAL,"-=":Sk.token.tokens.T_MINEQUAL,"*=":Sk.token.tokens.T_STAREQUAL,"/=":Sk.token.tokens.T_SLASHEQUAL,"%=":Sk.token.tokens.T_PERCENTEQUAL,"&=":Sk.token.tokens.T_AMPEREQUAL, "|=":Sk.token.tokens.T_VBAREQUAL,"^=":Sk.token.tokens.T_CIRCUMFLEXEQUAL,"<<=":Sk.token.tokens.T_LEFTSHIFTEQUAL,">>=":Sk.token.tokens.T_RIGHTSHIFTEQUAL,"**=":Sk.token.tokens.T_DOUBLESTAREQUAL,"//":Sk.token.tokens.T_DOUBLESLASH,"//=":Sk.token.tokens.T_DOUBLESLASHEQUAL,"->":Sk.token.tokens.T_RARROW,"...":Sk.token.tokens.T_ELLIPSIS};Sk.ParseTables={sym:{and_expr:257,and_test:258,annassign:259,arglist:260,argument:261,arith_expr:262,assert_stmt:263,async_funcdef:264,async_stmt:265,atom:266,atom_expr:267, augassign:268,break_stmt:269,classdef:270,comp_for:271,comp_if:272,comp_iter:273,comp_op:274,comparison:275,compound_stmt:276,continue_stmt:277,debugger_stmt:278,decorated:279,decorator:280,decorators:281,del_stmt:282,dictorsetmaker:283,dotted_as_name:284,dotted_as_names:285,dotted_name:286,encoding_decl:287,eval_input:288,except_clause:289,expr:290,expr_stmt:291,exprlist:292,factor:293,file_input:294,flow_stmt:295,for_stmt:296,funcdef:297,global_stmt:298,if_stmt:299,import_as_name:300,import_as_names:301, import_from:302,import_name:303,import_stmt:304,lambdef:305,lambdef_nocond:306,nonlocal_stmt:307,not_test:308,or_test:309,parameters:310,pass_stmt:311,power:312,print_stmt:313,raise_stmt:314,return_stmt:315,shift_expr:316,simple_stmt:317,single_input:256,sliceop:318,small_stmt:319,star_expr:320,stmt:321,subscript:322,subscriptlist:323,suite:324,term:325,test:326,test_nocond:327,testlist:328,testlist_comp:329,testlist_star_expr:330,tfpdef:331,trailer:332,try_stmt:333,typedargslist:334,varargslist:335, vfpdef:336,while_stmt:337,with_item:338,with_stmt:339,xor_expr:340,yield_arg:341,yield_expr:342,yield_stmt:343},number2symbol:{256:"single_input",257:"and_expr",258:"and_test",259:"annassign",260:"arglist",261:"argument",262:"arith_expr",263:"assert_stmt",264:"async_funcdef",265:"async_stmt",266:"atom",267:"atom_expr",268:"augassign",269:"break_stmt",270:"classdef",271:"comp_for",272:"comp_if",273:"comp_iter",274:"comp_op",275:"comparison",276:"compound_stmt",277:"continue_stmt",278:"debugger_stmt", 279:"decorated",280:"decorator",281:"decorators",282:"del_stmt",283:"dictorsetmaker",284:"dotted_as_name",285:"dotted_as_names",286:"dotted_name",287:"encoding_decl",288:"eval_input",289:"except_clause",290:"expr",291:"expr_stmt",292:"exprlist",293:"factor",294:"file_input",295:"flow_stmt",296:"for_stmt",297:"funcdef",298:"global_stmt",299:"if_stmt",300:"import_as_name",301:"import_as_names",302:"import_from",303:"import_name",304:"import_stmt",305:"lambdef",306:"lambdef_nocond",307:"nonlocal_stmt", 308:"not_test",309:"or_test",310:"parameters",311:"pass_stmt",312:"power",313:"print_stmt",314:"raise_stmt",315:"return_stmt",316:"shift_expr",317:"simple_stmt",318:"sliceop",319:"small_stmt",320:"star_expr",321:"stmt",322:"subscript",323:"subscriptlist",324:"suite",325:"term",326:"test",327:"test_nocond",328:"testlist",329:"testlist_comp",330:"testlist_star_expr",331:"tfpdef",332:"trailer",333:"try_stmt",334:"typedargslist",335:"varargslist",336:"vfpdef",337:"while_stmt",338:"with_item",339:"with_stmt", 340:"xor_expr",341:"yield_arg",342:"yield_expr",343:"yield_stmt"},dfas:{256:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],257:[[[[44,1]],[[45,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],258:[[[[46,1]],[[47,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1, 35:1,38:1,43:1}],259:[[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],{48:1}],260:[[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],261:[[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],262:[[[[55,1]],[[30,0],[43,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],263:[[[[24,1]],[[49, 2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],{24:1}],264:[[[[10,1]],[[56,2]],[[0,2]]],{10:1}],265:[[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],{10:1}],266:[[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,33:1,35:1,38:1}],267:[[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1,35:1,38:1}],268:[[[[67,1],[68,1],[69,1], [70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],{67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:1,75:1,76:1,77:1,78:1,79:1}],269:[[[[39,1]],[[0,1]]],{39:1}],270:[[[[13,1]],[[25,2]],[[48,3],[35,4]],[[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],{13:1}],271:[[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],{10:1,34:1}],272:[[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],{37:1}],273:[[[[87,1],[54,1]],[[0,1]]],{10:1,34:1,37:1}],274:[[[[88,1],[89,1], [8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],{8:1,83:1,88:1,89:1,90:1,91:1,92:1,93:1,94:1}],275:[[[[95,1]],[[96,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],276:[[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],{4:1,10:1,13:1,20:1,21:1,34:1,37:1,41:1,42:1}],277:[[[[40,1]],[[0,1]]],{40:1}],278:[[[[17,1]],[[0,1]]],{17:1}],279:[[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],{41:1}],280:[[[[41,1]], [[105,2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],{41:1}],281:[[[[106,1]],[[106,1],[0,1]]],{41:1}],282:[[[[27,1]],[[82,2]],[[0,2]]],{27:1}],283:[[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],284:[[[[105,1]],[[108, 2],[0,1]],[[25,3]],[[0,3]]],{25:1}],285:[[[[109,1]],[[52,0],[0,1]]],{25:1}],286:[[[[25,1]],[[110,0],[0,1]]],{25:1}],287:[[[[25,1]],[[0,1]]],{25:1}],288:[[[[111,1]],[[2,1],[112,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],289:[[[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],{113:1}],290:[[[[114,1]],[[115,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],291:[[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111, 4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],292:[[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],{6:1,7:1,9:1,11:1,12:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],293:[[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],294:[[[[2,0],[112,1],[121,0]],[[0,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1, 17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1,112:1}],295:[[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],{5:1,23:1,31:1,39:1,40:1}],296:[[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],{34:1}],297:[[[[4,1]],[[25,2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],{4:1}],298:[[[[26,1]],[[25,2]],[[52,1],[0,2]]],{26:1}],299:[[[[37,1]],[[49,2]], [[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{37:1}],300:[[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],{25:1}],301:[[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],{25:1}],302:[[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],{36:1}],303:[[[[32,1]],[[133,2]],[[0,2]]],{32:1}],304:[[[[134,1],[135,1]],[[0,1]]],{32:1,36:1}],305:[[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48,2]],[[0,4]]],{14:1}],306:[[[[14,1]], [[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],{14:1}],307:[[[[18,1]],[[25,2]],[[52,1],[0,2]]],{18:1}],308:[[[[8,1],[137,2]],[[46,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],309:[[[[138,1]],[[139,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],310:[[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],{35:1}],311:[[[[28,1]],[[0,1]]],{28:1}],312:[[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1, 35:1,38:1}],313:[[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],{16:1}],314:[[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],{5:1}],315:[[[[23,1]],[[111,2],[0,1]],[[0,2]]],{23:1}],316:[[[[143,1]],[[144,0],[142,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],317:[[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1, 15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],318:[[[[48,1]],[[49,2],[0,1]],[[0,2]]],{48:1}],319:[[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],320:[[[[15,1]],[[95,2]],[[0,2]]],{15:1}],321:[[[[1,1],[3,1]],[[0,1]]],{4:1,5:1,6:1,7:1, 8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],322:[[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],323:[[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],324:[[[[1,1],[2,2]], [[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],{2:1,5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],325:[[[[120,1]],[[161,0],[15,0],[162,0],[41,0],[163,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],326:[[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],327:[[[[165, 1],[84,1]],[[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],328:[[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],329:[[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],330:[[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1, 22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],331:[[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],{25:1}],332:[[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],{35:1,38:1,110:1}],333:[[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]],[[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],{20:1}],334:[[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0, 5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],335:[[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52,8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]], [[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],336:[[[[25,1]],[[0,1]]],{25:1}],337:[[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{21:1}],338:[[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],339:[[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],{42:1}],340:[[[[172,1]],[[173,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1, 35:1,38:1,43:1}],341:[[[[111,2],[36,1]],[[49,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,36:1,38:1,43:1}],342:[[[[31,1]],[[174,2],[0,1]],[[0,2]]],{31:1}],343:[[[[62,1]],[[0,1]]],{31:1}]},states:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],[[[44,1]],[[45,0],[0,1]]],[[[46,1]],[[47,0],[0,1]]],[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],[[[55,1]],[[30,0],[43,0], [0,1]]],[[[24,1]],[[49,2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],[[[10,1]],[[56,2]],[[0,2]]],[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],[[[67,1],[68,1],[69,1],[70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],[[[39,1]],[[0,1]]],[[[13,1]],[[25,2]],[[48,3],[35,4]], [[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],[[[87,1],[54,1]],[[0,1]]],[[[88,1],[89,1],[8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],[[[95,1]],[[96,0],[0,1]]],[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],[[[40,1]],[[0,1]]],[[[17,1]],[[0,1]]],[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],[[[41,1]],[[105, 2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],[[[106,1]],[[106,1],[0,1]]],[[[27,1]],[[82,2]],[[0,2]]],[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],[[[105,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[109,1]],[[52,0],[0,1]]],[[[25,1]],[[110,0],[0,1]]],[[[25,1]],[[0,1]]],[[[111,1]],[[2,1],[112,2]],[[0,2]]], [[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],[[[114,1]],[[115,0],[0,1]]],[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111,4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],[[[2,0],[112,1],[121,0]],[[0,1]]],[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],[[[4,1]],[[25, 2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],[[[26,1]],[[25,2]],[[52,1],[0,2]]],[[[37,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],[[[32,1]],[[133,2]],[[0,2]]],[[[134,1],[135,1]],[[0,1]]],[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48, 2]],[[0,4]]],[[[14,1]],[[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],[[[18,1]],[[25,2]],[[52,1],[0,2]]],[[[8,1],[137,2]],[[46,2]],[[0,2]]],[[[138,1]],[[139,0],[0,1]]],[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],[[[28,1]],[[0,1]]],[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],[[[23,1]],[[111, 2],[0,1]],[[0,2]]],[[[143,1]],[[144,0],[142,0],[0,1]]],[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],[[[48,1]],[[49,2],[0,1]],[[0,2]]],[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],[[[15,1]],[[95,2]],[[0,2]]],[[[1,1],[3,1]],[[0,1]]],[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],[[[1,1],[2,2]],[[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],[[[120,1]],[[161,0],[15,0],[162, 0],[41,0],[163,0],[0,1]]],[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],[[[165,1],[84,1]],[[0,1]]],[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]], [[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0,5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52, 8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]],[[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[25,1]],[[0,1]]],[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],[[[172,1]],[[173,0],[0,1]]],[[[111,2], [36,1]],[[49,2]],[[0,2]]],[[[31,1]],[[174,2],[0,1]],[[0,2]]],[[[62,1]],[[0,1]]]],labels:[[0,"EMPTY"],[317,null],[4,null],[276,null],[1,"def"],[1,"raise"],[1,"True"],[3,null],[1,"not"],[1,"null"],[55,null],[2,null],[25,null],[1,"class"],[1,"lambda"],[16,null],[1,"print"],[1,"debugger"],[1,"nonlocal"],[52,null],[1,"try"],[1,"while"],[31,null],[1,"return"],[1,"assert"],[1,null],[1,"global"],[1,"del"],[1,"pass"],[54,null],[15,null],[1,"yield"],[1,"import"],[1,"False"],[1,"for"],[7,null],[1,"from"],[1, "if"],[9,null],[1,"break"],[1,"continue"],[49,null],[1,"with"],[14,null],[316,null],[19,null],[308,null],[1,"and"],[11,null],[326,null],[22,null],[261,null],[12,null],[35,null],[271,null],[325,null],[297,null],[339,null],[296,null],[26,null],[283,null],[8,null],[342,null],[329,null],[10,null],[266,null],[332,null],[45,null],[38,null],[40,null],[50,null],[46,null],[41,null],[42,null],[36,null],[43,null],[48,null],[44,null],[37,null],[39,null],[324,null],[260,null],[292,null],[1,"in"],[309,null],[273, null],[327,null],[272,null],[28,null],[21,null],[27,null],[29,null],[1,"is"],[30,null],[20,null],[290,null],[274,null],[333,null],[299,null],[270,null],[337,null],[279,null],[265,null],[281,null],[264,null],[286,null],[280,null],[320,null],[1,"as"],[284,null],[23,null],[328,null],[0,null],[1,"except"],[340,null],[18,null],[330,null],[268,null],[259,null],[312,null],[293,null],[321,null],[269,null],[277,null],[314,null],[315,null],[343,null],[1,"else"],[310,null],[51,null],[1,"elif"],[300,null],[301, null],[285,null],[303,null],[302,null],[335,null],[275,null],[258,null],[1,"or"],[334,null],[267,null],[34,null],[262,null],[33,null],[319,null],[13,null],[295,null],[263,null],[291,null],[311,null],[307,null],[313,null],[282,null],[298,null],[304,null],[278,null],[318,null],[322,null],[5,null],[6,null],[47,null],[17,null],[24,null],[305,null],[306,null],[323,null],[289,null],[1,"finally"],[331,null],[336,null],[338,null],[257,null],[32,null],[341,null]],keywords:{False:33,"null":9,True:6,and:47, as:108,assert:24,"break":39,"class":13,"continue":40,"debugger":17,def:4,del:27,elif:130,"else":127,except:113,"finally":168,"for":34,from:36,global:26,"if":37,"import":32,"in":83,is:92,lambda:14,nonlocal:18,not:8,or:139,pass:28,print:16,raise:5,"return":23,"try":20,"while":21,"with":42,yield:31},tokens:{0:112,1:25,2:11,3:7,4:2,5:159,6:160,7:35,8:61,9:38,10:64,11:48,12:52,13:146,14:43,15:30,16:15,17:162,18:115,19:45,20:94,21:89,22:50,23:110,24:163,25:12,26:59,27:90,28:88,29:91,30:93,31:22,32:173, 33:144,34:142,35:53,36:74,37:78,38:68,39:79,40:69,41:72,42:73,43:75,44:77,45:67,46:71,47:161,48:76,49:41,50:70,51:129,52:19,54:29,55:10},start:256}},function(m,q){function a(a,c){this.filename=a;this.grammar=c;this.p_flags=0;return this}function c(b,c){void 0===c&&(c="file_input");b=new a(b,Sk.ParseTables);"file_input"===c?b.setup(Sk.ParseTables.sym.file_input):Sk.asserts.fail("todo;");return b}a.FUTURE_PRINT_FUNCTION="print_function";a.FUTURE_UNICODE_LITERALS="unicode_literals";a.FUTURE_DIVISION= "division";a.FUTURE_ABSOLUTE_IMPORT="absolute_import";a.FUTURE_WITH_STATEMENT="with_statement";a.FUTURE_NESTED_SCOPES="nested_scopes";a.FUTURE_GENERATORS="generators";a.CO_FUTURE_PRINT_FUNCTION=65536;a.CO_FUTURE_UNICODE_LITERALS=131072;a.CO_FUTURE_DIVISON=8192;a.CO_FUTURE_ABSOLUTE_IMPORT=16384;a.CO_FUTURE_WITH_STATEMENT=32768;a.prototype.setup=function(a){a=a||this.grammar.start;this.stack=[{dfa:this.grammar.dfas[a],state:0,node:{type:a,value:null,context:null,children:[]}}];this.used_names={}};a.prototype.addtoken= function(a,c,f){var b,e=this.classify(a,c,f);a:for(;;){var d=this.stack[this.stack.length-1];var g=d.dfa[0];var n=g[d.state];for(b=0;bm);this.shift(a,c,p,f);for(f=p;1===g[f].length&&0===g[f][0][0]&&g[f][0][1]===f;){this.pop();if(0===this.stack.length)return!0;d=this.stack[this.stack.length-1];f=d.state;g=d.dfa[0]}return!1}if(256<=m&&(k=this.grammar.dfas[m],k=k[1],k.hasOwnProperty(e))){this.push(m, this.grammar.dfas[m],p,f);continue a}}b:{g=[0,d.state];for(d=n.length;d--;)if(n[d][0]===g[0]&&n[d][1]===g[1]){n=!0;break b}n=!1}if(n){if(this.pop(),0===this.stack.length)throw new Sk.builtin.SyntaxError("too much input",this.filename);}else throw a=f[0][0],new Sk.builtin.SyntaxError("bad input",this.filename,a,f);}};a.prototype.classify=function(b,c,f){if(b===Sk.token.tokens.T_NAME){this.used_names[c]=!0;var e=this.grammar.keywords.hasOwnProperty(c)&&this.grammar.keywords[c];"print"===c&&(this.p_flags& a.CO_FUTURE_PRINT_FUNCTION||!0===Sk.__future__.print_function)&&(e=!1);if(e)return e}e=this.grammar.tokens.hasOwnProperty(b)&&this.grammar.tokens[b];if(!e){c="#"+b;for(let a in Sk.token.tokens)if(Sk.token.tokens[a]==b){c=a;break}throw new Sk.builtin.SyntaxError("bad token "+c,this.filename,f[0][0],f);}return e};a.prototype.shift=function(a,c,f,l){var b=this.stack[this.stack.length-1].dfa,d=this.stack[this.stack.length-1].node;d.children.push({type:a,value:c,lineno:l[0][0],col_offset:l[0][1],children:null}); this.stack[this.stack.length-1]={dfa:b,state:f,node:d}};a.prototype.push=function(a,c,f,l){a={type:a,value:null,lineno:l[0][0],col_offset:l[0][1],children:[]};this.stack[this.stack.length-1]={dfa:this.stack[this.stack.length-1].dfa,state:f,node:this.stack[this.stack.length-1].node};this.stack.push({dfa:c,state:0,node:a})};a.prototype.pop=function(){var a=this.stack.pop().node;if(a)if(0!==this.stack.length){var c=this.stack[this.stack.length-1].node;c.children.push(a)}else this.rootnode=a,this.rootnode.used_names= this.used_names};Sk.parse=function(a,e){var b=Sk.token.tokens.T_COMMENT,l=Sk.token.tokens.T_NL,h=Sk.token.tokens.T_OP,d=Sk.token.tokens.T_ENDMARKER,g=Sk.token.tokens.T_ENCODING,n=!1,k=c(a);Sk._tokenize(a,function(a){var b=a.split("\n").reverse().map(function(a){return a+"\n"});return function(){if(0===b.length)throw new Sk.builtin.Exception("EOF");return b.pop()}}(e),"utf-8",function(a){var c=null;a.type!==b&&a.type!==l&&a.type!==g&&(a.type===h&&(c=Sk.OpMap[a.string]),k.addtoken(c||a.type,a.string, [a.start,a.end,a.line]),a.type===d&&(n=!0))});if(!n)throw new Sk.builtin.SyntaxError("incomplete input",this.filename);return{cst:k.rootnode,flags:k.p_flags}};Sk.parseTreeDump=function(a,c){var b;c=c||"";var e=""+c;if(256<=a.type)for(e+=Sk.ParseTables.number2symbol[a.type]+"\n",b=0;b=c(d)||g+2== c(d)&&b(d,g+1).type==z.T_COMMA)throw new Sk.builtin.SyntaxError("named arguments must follow bare *",a.c_filename,d.lineno);m=b(d,g+1);m.type==z.T_COMMA?(g+=2,g=N(a,d,g,n,v)):(l=C(a,m),g+=3,ga.c_feature_version)return f(a,v,"Async functions are only supported in Python 3.5 and greater"),null;e(v,r.funcdef);var I=k(b(v,p));if(d(a,I,b(v,p),0))return null;var L=u(a,b(v,p+1));if(!L)return null;if(b(v,p+2).type==z.T_RARROW){l=x(a,b(v,p+3));if(!l)return null;p+=2}if(b(v,p+3).type==z.T_TYPE_COMMENT){m=z.T_NEW_TYPE_COMMENT(b(v,p+3));if(!m)return null;p+=1}var M=t(a,b(v,p+3));if(!M)return null;if(1":return Sk.astnodes.RShift; case "&":return Sk.astnodes.BitAnd;case "^":return Sk.astnodes.BitXor;case "|":return Sk.astnodes.BitOr;case "*":return"*"===c.value.charAt(1)?Sk.astnodes.Pow:Sk.astnodes.Mult;case "@":if(Sk.__future__.python3)return Sk.astnodes.MatMult;default:Sk.asserts.fail("invalid augassign")}}function W(a,d){Sk.asserts.assert(0=b);Sk.asserts.assert("{"==a.charAt(b-1));Sk.asserts.assert("}"==a.charAt(c)||"!"==a.charAt(c)||":"==a.charAt(c));a=a.substring(b,c);/^\s*$/.test(a)&&f(d,e,"f-string: empty expression not allowed"); try{let b=Sk.parse("","("+a+")");var g=Sk.astFromParse(b.cst,"",b.flags)}catch(Y){throw Y.traceback&&Y.traceback[0]&&(g=Y.traceback[0],g.lineno=(g.lineno||1)-1+e.lineno,g.filename=d.c_filename),Y;}Sk.asserts.assert(1==g.body.length&&g.body[0].constructor===Sk.astnodes.Expr);return g.body[0].value}function H(a,b,c,d,e,g,h){Sk.asserts.assert("{"==a.charAt(b));b++;var k=b;let n=null,l=0,p=0,m,v,I=()=>f(g,h,"f-string: expecting '}'");for(Sk.asserts.assert(b<=c);b=c&&I(),v=a.charAt(b),b++,"s"!=v&&"r"!=v&&"a"!=v&&f(g,h,"f-string: invalid conversion character: expected 's', 'r', or 'a'"));b>=c&&I();":"==a.charAt(b)&&(b++,b>=c&&I(),[m,b]=ba(a,b,c,d,e+1,g,h));(b>=c||"}"!=a.charAt(b))&&I();b++;return[new Sk.astnodes.FormattedValue(k,v,m,h.lineno,h.col_offset),b]}function ba(a,b,c,d,e,f,g){let h=[],k=a=>{if(-1!==a.indexOf("}")){if(/(^|[^}])}(}})*($|[^}])/.test(a))throw new SyntaxError("f-string: single '}' is not allowed", g.lineno,g.col_offset);a=a.replace(/}}/g,"}")}h.push(new Sk.astnodes.Str(new Sk.builtin.str(a),g.lineno,g.col_offset,f.end_lineno,g.end_col_offset))};for(;bd&&(n=-1,c=d))}if(-1===n){k(a.substring(b,c));b=c;break}else if(n+1Number.MAX_SAFE_INTEGER&&Math.floor(c)===c&&-1===b.indexOf("e")&& -1===b.indexOf("E")?Sk.longFromStr(b,0):a?new Sk.builtin.int_(-c):new Sk.builtin.int_(c)}function J(a,d){var f,g;e(d,r.subscript);var h=b(d,0);var k=f=g=null;if(h.type===z.T_DOT)return new Sk.astnodes.Ellipsis;if(1===c(d)&&h.type===r.test)return new Sk.astnodes.Index(x(a,h));h.type===r.test&&(g=x(a,h));h.type===z.T_COLON?1=h.length){if("None"===h)return new Sk.astnodes.NameConstant(Sk.builtin.none.none$,d.lineno,d.col_offset);if("True"===h)return new Sk.astnodes.NameConstant(Sk.builtin.bool.true$,d.lineno,d.col_offset);if("False"===h)return new Sk.astnodes.NameConstant(Sk.builtin.bool.false$,d.lineno,d.col_offset)}a= k(h,a);return new Sk.astnodes.Name(a,Sk.astnodes.Load,d.lineno,d.col_offset,d.end_lineno,d.end_col_offset);case z.T_STRING:g=[];for(var n=0;n=B&&f(m,v,"Truncated \\xNN escape"),u+=String.fromCharCode(parseInt(L.substr(t+1,2),16)),t+=2):y||"u"!==q?y||"U"!==q?u+="\\"+q:(t+8>=B&&f(m,v,"Truncated \\UXXXXXXXX escape"),u+=String.fromCodePoint(parseInt(L.substr(t+1,8),16)),t+=8):(t+4>=B&&f(m,v,"Truncated \\uXXXX escape"),u+=String.fromCharCode(parseInt(L.substr(t+1,4),16)),t+=4))):y&&1273-h&&b(g,3-h).type==r.comp_for){if(h)return f(a,d,"dict unpacking cannot be used in dict comprehension"), null;h=g;Sk.asserts.assert(3>11&7;this.__namespaces=c||[]}function c(a,b,c,e,f){this.symFlags={};this.name=b;this.varnames=[];this.children=[];this.blockType=c;this.returnsValue=this.varkeywords=this.varargs=this.generator=this.childHasFree=this.hasFree=this.isNested=!1;this.lineno=f;this.table=a;a.cur&& (a.cur.nested||"function"===a.cur.blockType)&&(this.isNested=!0);e.scopeId=l++;a.stss[e.scopeId]=this;this.symbols={}}function b(a){this.filename=a;this.top=this.cur=null;this.stack=[];this.curClass=this.global=null;this.tmpname=0;this.stss={}}function e(a,b){var c;for(c=0;c>11&7;return 3==a||2==a}));return this._funcGlobals}; c.prototype.get_frees=function(){Sk.asserts.assert("function"==this.get_type(),"get_frees only valid for function scopes");this._funcFrees||(this._funcFrees=this._identsMatching(function(a){return 4==(a>>11&7)}));return this._funcFrees};c.prototype.get_methods=function(){var a;Sk.asserts.assert("class"==this.get_type(),"get_methods only valid for class scopes");if(!this._classMethods){var b=[];for(a=0;a>11&7};b.prototype.getStsForAst=function(a){Sk.asserts.assert(void 0!==a.scopeId,"ast wasn't added to st?");a=this.stss[a.scopeId];Sk.asserts.assert(void 0!==a,"unknown sym tab entry");return a};b.prototype.SEQStmt=function(a){var b,c;if(null!==a){Sk.asserts.assert(Sk.isArrayLike(a),"SEQ: nodes isn't array? got "+a.toString());var e=a.length;for(c=0;cd||127<=d&&256>d?b+("\\x"+("0"+d.toString(16)).substr(-2)):256<=d?b+("\\u"+("000"+d.toString(16)).substr(-4)):b+a.charAt(c)}return b+'"'}var l;Sk.gensymcount=0;c.prototype.activateScope=function(){var a=this;l=function(){var b,c=a.blocks[a.curblock];if(null===c._next)for(b=0;b","").replace(" ","_"))}; var h=Sk.builtin.str.reservedWords_;a.prototype.makeConstant=function(a){var b,c="";for(b=0;b Sk.execLimit) {throw new Sk.builtin.TimeLimitError(Sk.timeoutMsg())}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(a=a+"if ($dateNow - Sk.lastYield > Sk.yieldLimit) {"+("var $susp = $saveSuspension({data: {type: 'Sk.yield'}, resume: function() {}}, '"+this.filename+"',$currLineNo,$currColNo);"),a+="$susp.$blk = $blk;$susp.optional = true;return $susp;}", this.u.doesSuspend=!0);return a};a.prototype._jumpfalse=function(a,b){a=this._gr("jfalse","(",a,"===false||!Sk.misceval.isTrue(",a,"))");l("if(",a,"){/*test failed */$blk=",b,";continue;}")};a.prototype._jumpundef=function(a,b){l("if(",a,"===undefined){$blk=",b,";continue;}")};a.prototype._jumpnotundef=function(a,b){l("if(",a,"!==undefined){$blk=",b,";continue;}")};a.prototype._jumptrue=function(a,b){a=this._gr("jtrue","(",a,"===true||Sk.misceval.isTrue(",a,"))");l("if(",a,"){/*test passed */$blk=", b,";continue;}")};a.prototype._jump=function(a){null===this.u.blocks[this.u.curblock]._next&&(l("$blk=",a,";"),this.u.blocks[this.u.curblock]._next=a)};a.prototype._checkSuspension=function(a){if(this.u.canSuspend){var b=this.newBlock("function return or resume suspension");this._jump(b);this.setBlock(b);a=a||{lineno:"$currLineNo",col_offset:"$currColNo"};l("if ($ret && $ret.$isSuspension) { return $saveSuspension($ret,'"+this.filename+"',"+a.lineno+","+a.col_offset+"); }");this.u.doesSuspend=!0; this.u.tempsToSave=this.u.tempsToSave.concat(this.u.localtemps)}else l("if ($ret && $ret.$isSuspension) { $ret = Sk.misceval.retryOptionalSuspensionOrThrow($ret); }")};a.prototype.cunpackstarstoarray=function(a,b){if(!a||0==a.length)return"[]";let c=!1;for(let d of a){if(b&&c)throw new Sk.builtin.SyntaxError("Extended argument unpacking is not permitted in Python 2");d.constructor===Sk.astnodes.Starred&&(c=!0)}if(c){b=this._gr("unpack","[]");for(let c of a)c.constructor!==Sk.astnodes.Starred?l(b, ".push(",this.vexpr(c),");"):(l("$ret = Sk.misceval.iterFor(Sk.abstr.iter(",this.vexpr(c.value),"), function(e) { ",b,".push(e); });"),this._checkSuspension());return b}return"["+a.map(a=>this.vexpr(a)).join(",")+"]"};a.prototype.ctuplelistorset=function(a,b,c){var d;Sk.asserts.assert("tuple"===c||"list"===c||"set"===c);var e=!1;for(d=0;d=c.length&&(c=this.vexpr(f),"dict"===a?(a=this.vexpr(h),l(b,".mp$ass_subscript(",a,",",c,");")):"list"===a?l(b,".v.push(",c,");"):"set"===a&&l(b,".v.mp$ass_subscript(",c,", true);"),this._jump(g),this.setBlock(g));this._jump(d);this.setBlock(k);return b};a.prototype.cyield=function(a){if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'yield' outside function",this.filename,a.lineno);var b="Sk.builtin.none.none$";a.value&&(b=this.vexpr(a.value)); a=this.newBlock("after yield");l("return [/*resume*/",a,",/*ret*/",b,"];");this.setBlock(a);return"$gen.gi$sentvalue"};a.prototype.ccompare=function(a){var b;Sk.asserts.assert(a.ops.length===a.comparators.length);var c=this.vexpr(a.left);var d=a.ops.length;var e=this.newBlock("done");var f=this._gr("compareres","null");for(b=0;b 0) { throw new Sk.builtin.RuntimeError("super(): no arguments") };'),c="[$gbl.__class__,self]");l("$ret = (",b,".tp$call)?",b,".tp$call(",c,",",d,") : Sk.misceval.applyOrSuspend(", b,",undefined,undefined,",d,",",c,");");this._checkSuspension(a);return this._gr("call","$ret")};a.prototype.cslice=function(a){Sk.asserts.assert(a instanceof Sk.astnodes.Slice);if(Sk.__future__.python3){var b=a.lower?this.vexpr(a.lower):"Sk.builtin.none.none$";var c=a.upper?this.vexpr(a.upper):"Sk.builtin.none.none$"}else b=a.lower?this.vexpr(a.lower):a.step?"Sk.builtin.none.none$":"new Sk.builtin.int_(0)",c=a.upper?this.vexpr(a.upper):a.step?"Sk.builtin.none.none$":"new Sk.builtin.int_(2147483647)"; a=a.step?this.vexpr(a.step):"Sk.builtin.none.none$";return this._gr("slice","new Sk.builtins['slice'](",b,",",c,",",a,")")};a.prototype.eslice=function(a){var b;Sk.asserts.assert(a instanceof Array);var c=[];for(b=0;bthis.u.lineno&&(this.u.lineno=a.lineno,this.u.linenoSet=!1);switch(a.constructor){case Sk.astnodes.BoolOp:return this.cboolop(a);case Sk.astnodes.BinOp:return this._gr("binop","Sk.abstr.numberBinOp(",this.vexpr(a.left),",",this.vexpr(a.right),",'",a.op.prototype._astname,"')");case Sk.astnodes.UnaryOp:return this._gr("unaryop", "Sk.abstr.numberUnaryOp(",this.vexpr(a.operand),",'",a.op.prototype._astname,"')");case Sk.astnodes.Lambda:return this.clambda(a);case Sk.astnodes.IfExp:return this.cifexp(a);case Sk.astnodes.Dict:return this.cdict(a);case Sk.astnodes.ListComp:return this.clistcomp(a);case Sk.astnodes.DictComp:return this.cdictcomp(a);case Sk.astnodes.SetComp:return this.csetcomp(a);case Sk.astnodes.GeneratorExp:return this.cgenexp(a);case Sk.astnodes.Yield:return this.cyield(a);case Sk.astnodes.Compare:return this.ccompare(a); case Sk.astnodes.Call:return b=this.ccall(a),this.annotateSource(a),b;case Sk.astnodes.Num:if("number"===typeof a.n)return a.n;if(a.n instanceof Sk.builtin.lng)return this.makeConstant("new Sk.builtin.lng('"+a.n.v.toString()+"')");if(a.n instanceof Sk.builtin.int_)return"number"===typeof a.n.v?this.makeConstant("new Sk.builtin.int_("+a.n.v+")"):this.makeConstant("new Sk.builtin.int_('"+a.n.v.toString()+"')");if(a.n instanceof Sk.builtin.float_)return a=0===a.n.v&&-Infinity===1/a.n.v?"-0":a.n.v,this.makeConstant("new Sk.builtin.float_("+ a+")");if(a.n instanceof Sk.builtin.complex)return this.makeConstant("new Sk.builtin.complex("+(0===a.n.real&&-Infinity===1/a.n.real?"-0":a.n.real)+", "+(0===a.n.imag&&-Infinity===1/a.n.imag?"-0":a.n.imag)+")");Sk.asserts.fail("unhandled Num type");case Sk.astnodes.Bytes:if(Sk.__future__.python3){b=[];a=a.s.$jsstr();for(c=0;c";this.u.blocks[b]._next=null;return b};a.prototype.setBlock=function(a){Sk.asserts.assert(0<=a&&a0) { $err=err; $blk=$exc.pop(); } else { throw err; } }};";h+="var $saveSuspension = function($child, $filename, $lineno, $colno) {var susp = new Sk.misceval.Suspension(); susp.child=$child;susp.resume=function(){"+a.scopename+".$wakingSuspension=susp; return "+a.scopename+"("+(a.ste.generator?"$gen":"")+"); };susp.data=susp.child.data;susp.$blk=$blk;susp.$loc=$loc;susp.$gbl=$gbl;susp.$exc=$exc;susp.$err=$err;susp.$postfinally=$postfinally;susp.$filename=$filename;susp.$lineno=$lineno;susp.$colno=$colno;susp.optional=susp.child.optional;"+ (f?"susp.$cell=$cell;":"");e={};for(b=0;ba?this.vexpr(a):"undefined"));k&&k.vararg&&(w=k.vararg);k&&k.kwarg&&(K=k.kwarg);if(!Sk.__future__.python3&&k&&k.kwonlyargs&&0!=k.kwonlyargs.length)throw new Sk.builtin.SyntaxError("Keyword-only arguments are not supported in Python 2"); var G=this.enterScope(c,a,a.lineno,this.canSuspend);f=this.u.ste.generator;var U=this.u.ste.hasFree;var C=this.u.ste.childHasFree;var N=this.newBlock("codeobj entry");this.u.prefixCode="var "+G+"=(function "+this.niceName(c.v)+"$(";var u=[];if(f){if(K)throw new Sk.builtin.SyntaxError(c.v+"(): keyword arguments in generators not supported",this.filename,a.lineno);if(w)throw new Sk.builtin.SyntaxError(c.v+"(): variable number of arguments in generators not supported",this.filename,a.lineno);u.push("$gen")}else{K&& (u.push("$kwa"),this.u.tempsToSave.push("$kwa"));for(g=0;k&&g0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }});";h.call(this,G);if(k){for(let a of k.args)d.push(a.arg.v); for(let a of k.kwonlyargs||[])d.push(a.arg.v);this.u.argnames=d}this.exitScope();0"),null,a.args,function(b){b=this.vexpr(a.body);l("return ",b,";")})};a.prototype.cifexp=function(a){var b=this.newBlock("next of ifexp"),c=this.newBlock("end of ifexp"),d=this._gr("res","null"),e=this.vexpr(a.test);this._jumpfalse(e,b);l(d,"=",this.vexpr(a.body),";");this._jump(c); this.setBlock(b);l(d,"=",this.vexpr(a.orelse),";");this._jump(c);this.setBlock(c);return d};a.prototype.cgenexpgen=function(a,b,c){var d=this.newBlock("start for "+b),e=this.newBlock("skip for "+b);this.newBlock("if cleanup for "+b);var f=this.newBlock("end for "+b),g=a[b];if(0===b)var h="$loc.$iter0";else{var m=this.vexpr(g.iter);h="$loc."+this.gensym("iter");l(h,"=","Sk.abstr.iter(",m,");")}this._jump(d);this.setBlock(d);this.annotateSource(c);l("$ret = Sk.abstr.iternext(",h,this.u.canSuspend?", true": ", false",");");this._checkSuspension(c);m=this._gr("next","$ret");this._jumpundef(m,f);this.vexpr(g.target,m);var n=g.ifs?g.ifs.length:0;for(h=0;h=a.length&&(this.annotateSource(c),a=this.vexpr(c),l("return [",e,"/*resume*/,",a,"/*ret*/];"),this.setBlock(e));this._jump(d);this.setBlock(f);1===b&&l("return Sk.builtin.none.none$;")};a.prototype.cgenexp=function(a){var b=this.buildcodeobj(a, new Sk.builtin.str(""),null,null,function(b){this.cgenexpgen(a.generators,0,a.elt)});b=this._gr("gener","Sk.misceval.callsimArray(",b,");");l(b,".gi$locals.$iter0=Sk.abstr.iter(",this.vexpr(a.generators[0].iter),");");return b};a.prototype.cclass=function(a){Sk.asserts.assert(a instanceof Sk.astnodes.ClassDef);var b=this.vseqexpr(a.decorator_list);var c=this.vseqexpr(a.bases);var d=this.enterScope(a.name,a,a.lineno);var e=this.newBlock("class entry");this.u.prefixCode="var "+d+"=(function $"+ a.name.v+"$class_outer($globals,$locals,$cell){var $gbl=$globals,$loc=$locals;$free=$globals;";this.u.switchCode+="(function $"+a.name.v+"$_closure($cell){";this.u.switchCode+="var $blk="+e+",$exc=[],$ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;";null!==Sk.execLimit&&(this.u.switchCode+="if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}");null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.switchCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}"); this.u.switchCode+="while(true){try{";this.u.switchCode+=this.outputInterruptTest();this.u.switchCode+="switch($blk){";this.u.suffixCode="}}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }}}";this.u.suffixCode+="}).call(null, $cell);});";this.u.private_=a.name;this.cbody(a.body, a.name);l("return;");this.exitScope();l("$ret = Sk.misceval.buildClass($gbl,",d,",",a.name.$r().v,",[",c,"], $cell);");for(let a of b)l("$ret = Sk.misceval.callsimOrSuspendArray(",a,", [$ret]);"),this._checkSuspension();this.nameop(a.name,Sk.astnodes.Store,"$ret")};a.prototype.ccontinue=function(a){var b=this.peekFinallyBlock();if(0==this.u.continueBlocks.length)throw new Sk.builtin.SyntaxError("'continue' outside loop",this.filename,a.lineno);a=this.u.continueBlocks[this.u.continueBlocks.length- 1];Sk.asserts.assert(this.u.breakBlocks.length===this.u.continueBlocks.length);b&&b.breakDepth==this.u.continueBlocks.length?l("$postfinally={isBreak:true,gotoBlock:",a,"};"):this._jump(a)};a.prototype.cbreak=function(a){var b=this.peekFinallyBlock();if(0===this.u.breakBlocks.length)throw new Sk.builtin.SyntaxError("'break' outside loop",this.filename,a.lineno);a=this.u.breakBlocks[this.u.breakBlocks.length-1];b&&b.breakDepth==this.u.breakBlocks.length?l("$postfinally={isBreak:true,gotoBlock:",a, "};"):this._jump(a)};a.prototype.vstmt=function(a,b){this.u.lineno=a.lineno;this.u.linenoSet=!1;this.u.localtemps=[];if(Sk.debugging&&this.u.canSuspend){var c=this.newBlock("debug breakpoint for line "+a.lineno);l("if (Sk.breakpoints('"+this.filename+"',"+a.lineno+","+a.col_offset+")) {","var $susp = $saveSuspension({data: {type: 'Sk.debug'}, resume: function() {}}, '"+this.filename+"',"+a.lineno+","+a.col_offset+");","$susp.$blk = "+c+";","$susp.optional = true;","return $susp;","}");this._jump(c); this.setBlock(c);this.u.doesSuspend=!0}this.annotateSource(a);switch(a.constructor){case Sk.astnodes.FunctionDef:this.cfunction(a,b);break;case Sk.astnodes.ClassDef:this.cclass(a);break;case Sk.astnodes.Return:if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'return' outside function",this.filename,a.lineno);c=a.value?this.vexpr(a.value):"Sk.builtin.none.none$";0==this.u.finallyBlocks.length?l("return ",c,";"):(l("$postfinally={returning:",c,"};"),this._jump(this.peekFinallyBlock().blk)); break;case Sk.astnodes.Delete:this.vseqexpr(a.targets);break;case Sk.astnodes.Assign:var d=a.targets.length;c=this.vexpr(a.value);for(b=0;b"!==a.name.v){var b=a.name.$r().v;b=b.substring(1,b.length-1);l(a.scopename,".co_name=new Sk.builtins['str']('",b,"');");this.stack.length&&"class"==this.u.ste.blockType&&l(a.scopename,".co_qualname=new Sk.builtins['str']('"+this.u.name.v+"."+b+"');")}for(var c in a.consts)a.consts.hasOwnProperty(c)&& (a.suffixCode+=c+" = "+a.consts[c]+";")};a.prototype.cbody=function(a,b){var c=0;const d=this.maybeCDocstringOfBody(a);null!==d&&(l("$loc.__doc__ = ",d,";"),c=1);for(;c"),a,0,this.canSuspend),c=this.newBlock("module entry");this.u.prefixCode="var "+b+"=(function($forcegbl){";this.u.varDeclsCode="var $gbl = $forcegbl || {}, $blk="+c+",$exc=[],$loc=$gbl,$cell={},$err=undefined;$loc.__file__=new Sk.builtins.str('"+this.filename+"');var $ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;";null!==Sk.execLimit&&(this.u.varDeclsCode+= "if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}");null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.varDeclsCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}");this.u.varDeclsCode+="if ("+b+".$wakingSuspension!==undefined) { $wakeFromSuspension(); }if (Sk.retainGlobals) { if (Sk.globals) { $gbl = Sk.globals; Sk.globals = $gbl; $loc = $gbl; } if (Sk.globals) { $gbl = Sk.globals; Sk.globals = $gbl; $loc = $gbl; $loc.__file__=new Sk.builtins.str('"+ this.filename+"');} else { Sk.globals = $gbl; }} else { Sk.globals = $gbl; }";this.u.switchCode="while(true){try{";this.u.switchCode+=this.outputInterruptTest();this.u.switchCode+="switch($blk){";this.u.suffixCode="}";this.u.suffixCode+="}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} } });"; switch(a.constructor){case Sk.astnodes.Module:this.cbody(a.body);l("return $loc;");break;default:Sk.asserts.fail("todo; unhandled case in compilerMod")}this.exitScope();this.result.push(this.outputAllUnits());return b};Sk.compile=function(b,c,e,f){e=Sk.__future__;Sk.__future__=Object.create(Sk.__future__);var d=Sk.parse(c,b),g=Sk.astFromParse(d.cst,c,d.flags);d=d.flags;var h=Sk.symboltable(g,c);b=new a(c,h,d,f,b);c=b.cmod(g);Sk.__future__=e;return{funcname:"$compiledmod",code:"$compiledmod = function() {"+ b.result.join("")+"\nreturn "+c+";}();"}};Sk.exportSymbol("Sk.compile",Sk.compile);Sk.resetCompiler=function(){Sk.gensymcount=0};Sk.exportSymbol("Sk.resetCompiler",Sk.resetCompiler);Sk.fixReserved=b;Sk.exportSymbol("Sk.fixReserved",Sk.fixReserved);Sk.unfixReserved=function(a){return a.replace(/_\$rw\$$/,"")};Sk.exportSymbol("Sk.unfixReserved",Sk.unfixReserved);Sk.mangleName=e;Sk.exportSymbol("Sk.mangleName",Sk.mangleName);Sk.reservedWords_=h;Sk.exportSymbol("Sk.reservedWords_",Sk.reservedWords_)}, function(m,q){Sk.sysmodules=new Sk.builtin.dict([]);Sk.realsyspath=void 0;Sk.importSearchPathForName=function(a,c,b){var e=a.replace(/\./g,"/"),f=function(a,b){return Sk.misceval.chain(Sk.misceval.tryCatch(function(){return Sk.read(a)},function(a){}),function(c){if(void 0!==c)return new Sk.misceval.Break({filename:a,code:c,packagePath:b})})};void 0===b&&(b=Sk.realsyspath);return Sk.misceval.iterFor(b.tp$iter(),function(a){return Sk.misceval.chain(f(a.v+"/"+e+c,!1),function(b){return b?b:f(a.v+"/"+ e+"/__init__"+c,a.v+"/"+e)})})};Sk.importSetUpPath=function(a){if(!Sk.realsyspath){var c=[new Sk.builtin.str("src/builtin"),new Sk.builtin.str("src/lib"),new Sk.builtin.str(".")];for(a=0;ad;++d)a+=" ";c[b-1]="/* "+a+b+" */ "+c[b-1]}return c.join("\n")};e=f(e);Sk.debugout(e)}e+="\n"+a.funcname+";";e=Sk.global.eval(e);k.$d={__name__:new Sk.builtin.str(b),__doc__:Sk.builtin.none.none$,__package__:a.packagePath?new Sk.builtin.str(b):B?new Sk.builtin.str(A+B):q?q:Sk.builtin.none.none$};a.packagePath&&(k.$d.__path__=new Sk.builtin.tuple([new Sk.builtin.str(a.packagePath)]));return e(k.$d)}},function(b){var c;if(void 0===b){if(l&&!p)return; throw new Sk.builtin.ImportError("No module named "+a);}if(b!==k.$d){for(c in k.$d)b[c]||(b[c]=k.$d[c]);k.$d=b}if(Sk.onAfterImport&&"function"===typeof Sk.onAfterImport)try{Sk.onAfterImport(a)}catch(U){}if(p)return m.tp$setattr(new Sk.builtin.str(y[y.length-1]),k),p;f&&f.tp$setattr(new Sk.builtin.str(a),k);return k})});return h?E:Sk.misceval.retryOptionalSuspensionOrThrow(E)};Sk.importModule=function(a,c,b){return Sk.importModuleInternal_(a,c,void 0,void 0,void 0,!1,b)};Sk.importMain=function(a,c, b){Sk.dateSet=!1;Sk.filesLoaded=!1;Sk.sysmodules=new Sk.builtin.dict([]);Sk.realsyspath=void 0;Sk.resetCompiler();return Sk.importModuleInternal_(a,c,"__main__",void 0,void 0,!1,b)};Sk.importMainWithBody=function(a,c,b,e){Sk.dateSet=!1;Sk.filesLoaded=!1;Sk.sysmodules=new Sk.builtin.dict([]);Sk.realsyspath=void 0;Sk.resetCompiler();return Sk.importModuleInternal_(a,c,"__main__",b,void 0,!1,e)};Sk.importBuiltinWithBody=function(a,c,b,e){return Sk.importModuleInternal_(a,c,"__builtin__."+a,b,void 0, !1,e)};Sk.builtin.__import__=function(a,c,b,e,f){var l=Sk.globals,h;void 0===f&&(f=Sk.__future__.absolute_import?0:-1);if(0!==f&&c.__package__&&c.__package__!==Sk.builtin.none.none$){if((h=c.__package__.v)&&0=c.length)throw new Sk.builtin.ValueError("Attempted relative import beyond toplevel package");c.length-=f-1;h=c.join(".")}var d=Sk.sysmodules.quick$lookup(new Sk.builtin.str(h))}if(0>1);this.lt(c,a.getitem(l))?f=l:e=l+1}Sk.asserts.assert(e===f);for(l=b;l>e;l--)a.setitem(l,a.getitem(l-1));a.setitem(e,c)}};Sk.builtin.timSort.prototype.count_run=function(a){var c;if(1>=a.len){var b=a.len;var e=!1}else if(b=2,this.lt(a.getitem(a.base+1),a.getitem(a.base)))for(e=!0,c=a.base+2;cc.len)){this.merge_init();for(a=this.merge_compute_minrun(c.len);0f&&(g=f);d+=b;g+=b}else{for(f=b+1;gf&&(g=f);h=b-d;d=b-g;g=h}Sk.asserts.assert(-1<=d>1),e(c.getitem(c.base+b),a)?d=b+1:g=b;Sk.asserts.assert(d==g);return g};Sk.builtin.timSort.prototype.merge_init=function(){this.min_gallop=this.MIN_GALLOP;this.pending=[]};Sk.builtin.timSort.prototype.merge_lo=function(a,c){var b, e,f;Sk.asserts.assert(0=l)break}else{this.setitem(h,a.popleft());h++;if(1==a.len)return;b++;e=0;if(b>=l)break}for(l+=1;;){this.min_gallop=l-=1=a.len)return;this.setitem(h,c.popleft());h++;if(0===c.len)return;e=this.gallop(a.getitem(a.base),c,0,!1);for(f=c.base;f=l)break}else{h--;this.setitem(h,g);c.len--;if(1==c.len)return;e++;b=0;if(e>=l)break}}for(l+= 1;;){this.min_gallop=l-=1a.base+m-1;f--)h--,this.setitem(h,a.getitem(f));a.len-=b;if(0===a.len)return;h--;this.setitem(h,c.popright());if(1==c.len)return;d=a.getitem(a.base+a.len-1);m=this.gallop(d,c,c.len-1,!1);e=c.len-m;for(f=c.base+c.len-1;f>c.base+m-1;f--)h--,this.setitem(h,c.getitem(f));c.len-=e;if(1>=c.len)return;h--;this.setitem(h,a.popright());if(0===a.len)return;if(ba.base-1;f--)h--,this.setitem(h,a.getitem(f));for(f=c.base+c.len-1;f>c.base-1;f--)h--,this.setitem(h,c.getitem(f))}};Sk.builtin.timSort.prototype.merge_at=function(a){0>a&&(a=this.pending.length+a);var c=this.pending[a];var b=this.pending[a+1];Sk.asserts.assert(0>=1;return a+c};Sk.builtin.listSlice=function(a,c,b){this.list=a;this.base=c;this.len=b};Sk.builtin.listSlice.prototype.copyitems=function(){var a=this.base,c=this.base+this.len;Sk.asserts.assert(0<=a<=c);return new Sk.builtin.listSlice(new Sk.builtin.list(this.list.v.slice(a, c)),0,this.len)};Sk.builtin.listSlice.prototype.advance=function(a){this.base+=a;this.len-=a;Sk.asserts.assert(this.base<=this.list.sq$length())};Sk.builtin.listSlice.prototype.getitem=function(a){return this.list.v[a]};Sk.builtin.listSlice.prototype.setitem=function(a,c){this.list.v[a]=c};Sk.builtin.listSlice.prototype.popleft=function(){var a=this.list.v[this.base];this.base++;this.len--;return a};Sk.builtin.listSlice.prototype.popright=function(){this.len--;return this.list.v[this.base+this.len]}; Sk.builtin.listSlice.prototype.reverse=function(){for(var a,c,b=this.list,e=this.base,f=e+this.len-1;e same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", tp$new:Sk.generic.new,tp$init(a,c){Sk.abstr.checkNoKwargs("super",c);Sk.abstr.checkArgsLen("super",a,1,2);c=a[0];a=a[1];if(!Sk.builtin.checkClass(c))throw new Sk.builtin.TypeError("must be type, not "+Sk.abstr.typeName(c));this.obj=a;this.type=c;null!=this.obj&&(this.obj_type=this.$supercheck(c,this.obj))},$r(){return this.obj?new Sk.builtin.str(", <"+Sk.abstr.typeName(this.obj)+" object>>"):new Sk.builtin.str(", NULL>")},tp$getattr(a,c){let b=this.obj_type;if(null==b)return Sk.generic.getAttr.call(this,a,c);var e=b.prototype.tp$mro;const f=e.length;if(a===Sk.builtin.str.$class)return Sk.generic.getAttr.call(this,a,c);let l;for(l=0;l+1=f)return Sk.generic.getAttr.call(this,a,c);a=a.$mangled;let h;for(;l module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module."}, abs:{$meth:Sk.builtin.abs,$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the absolute value of the argument."},all:{$meth:Sk.builtin.all,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True."},any:{$meth:Sk.builtin.any,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False."}, ascii:{$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."},bin:{$meth:Sk.builtin.bin,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'"}, callable:{$meth:Sk.builtin.callable,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method."},chr:{$meth:Sk.builtin.chr,$flags:{OneArg:!0},$textsig:"($module, i, /)",$doc:"Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."},delattr:{$meth:Sk.builtin.delattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)", $doc:"Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''"},dir:{$meth:Sk.builtin.dir,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes."}, divmod:{$meth:Sk.builtin.divmod,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return the tuple (x//y, x%y). Invariant: div*y + mod == x."},eval_$rw$:{$name:"eval",$meth:Sk.builtin.eval_,$flags:{MinArgs:1,MaxArgs:3},$textsig:"($module, source, globals=None, locals=None, /)",$doc:"Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it."}, format:{$meth:Sk.builtin.format,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, value, format_spec='', /)",$doc:"Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails."},getattr:{$meth:Sk.builtin.getattr,$flags:{MinArgs:2,MaxArgs:3},$textsig:null,$doc:"getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case."}, globals:{$meth:Sk.builtin.globals,$flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa."},hasattr:{$meth:Sk.builtin.hasattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)",$doc:"Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError."}, hash:{$meth:Sk.builtin.hash,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true."},hex:{$meth:Sk.builtin.hex,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'"},id:{$meth:Sk.builtin.id,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)"}, input:{$meth:Sk.builtin.input,$flags:{MinArgs:0,MaxArgs:1},$textsig:"($module, prompt=None, /)",$doc:"Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available."},isinstance:{$meth:Sk.builtin.isinstance,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, class_or_tuple, /)", $doc:"Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc."},issubclass:{$meth:Sk.builtin.issubclass,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, cls, class_or_tuple, /)",$doc:"Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc."}, iter:{$meth:Sk.builtin.iter,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, iterable /)",$doc:"iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel."},len:{$meth:Sk.builtin.len,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the number of items in a container."},locals:{$meth:Sk.builtin.locals, $flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees."},max:{$meth:Sk.builtin.max,$flags:{FastCall:!0},$textsig:null,$doc:"max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument."}, min:{$meth:Sk.builtin.min,$flags:{FastCall:!0},$textsig:null,$doc:"min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument."},next:{$name:"next",$meth:Sk.builtin.next_,$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration."}, oct:{$meth:Sk.builtin.oct,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'"},open:{$meth:Sk.builtin.open,$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"open(name[, mode[, buffering]]) -> file object\n\nOpen a file using the file() type, returns a file object. This is the\npreferred way to open a file. See file.__doc__ for further information."},ord:{$meth:Sk.builtin.ord,$flags:{OneArg:!0},$textsig:"($module, c, /)", $doc:"Return the Unicode code point for a one-character string."},pow:{$meth:Sk.builtin.pow,$flags:{MinArgs:2,MaxArgs:3},$textsig:"($module, x, y, z=None, /)",$doc:"Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form."},print:{$meth:Sk.builtin.print,$flags:{FastCall:!0},$textsig:null,$doc:"print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream."}, repr:{$meth:Sk.builtin.repr,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj."},round:{$meth:Sk.builtin.round,$flags:{NamedArgs:["number","ndigits"]},$textsig:"($module, /, number, ndigits=None)",$doc:"Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative."}, setattr:{$meth:Sk.builtin.setattr,$flags:{MinArgs:3,MaxArgs:3},$textsig:"($module, obj, name, value, /)",$doc:"Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''"},sorted:{$meth:Sk.builtin.sorted,$flags:{NamedArgs:[null,"cmp","key","reverse"],Defaults:[Sk.builtin.none.none$,Sk.builtin.none.none$,Sk.builtin.bool.false$]},$textsig:"($module, iterable, /, *, key=None, reverse=False)",$doc:"Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order."}, sum:{$meth:Sk.builtin.sum,$flags:{NamedArgs:[null,"start"],Defaults:[new Sk.builtin.int_(0)]},$textsig:"($module, iterable, /, start=0)",$doc:"Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types."},vars:{$meth:Sk.builtin.vars,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__."}}); Sk.setupObjects=function(a){a?(Sk.builtins.filter=Sk.builtin.filter_,Sk.builtins.map=Sk.builtin.map_,Sk.builtins.zip=Sk.builtin.zip_,Sk.builtins.range=Sk.builtin.range_,delete Sk.builtins.xrange,delete Sk.builtins.StandardError,delete Sk.builtins.unicode,delete Sk.builtins.basestring,delete Sk.builtins.long_$rw$,Sk.builtin.int_.prototype.$r=function(){return new Sk.builtin.str(this.v.toString())},delete Sk.builtin.int_.prototype.tp$str,delete Sk.builtin.bool.prototype.tp$str,delete Sk.builtins.raw_input, delete Sk.builtin.str.prototype.decode,Sk.builtins.bytes=Sk.builtin.bytes,Sk.builtins.ascii=new Sk.builtin.sk_method({$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."}, null,"builtins")):(Sk.builtins.range=new Sk.builtin.sk_method({$meth:Sk.builtin.range,$name:"range",$flags:{MinArgs:1,MaxArgs:3}},void 0,"builtins"),Sk.builtins.xrange=new Sk.builtin.sk_method({$meth:Sk.builtin.xrange,$name:"xrange",$flags:{MinArgs:1,MaxArgs:3}},null,"builtins"),Sk.builtins.filter=new Sk.builtin.func(Sk.builtin.filter),Sk.builtins.map=new Sk.builtin.func(Sk.builtin.map),Sk.builtins.zip=new Sk.builtin.func(Sk.builtin.zip),Sk.builtins.StandardError=Sk.builtin.Exception,Sk.builtins.unicode= Sk.builtin.str,Sk.builtins.basestring=Sk.builtin.str,Sk.builtins.long_$rw$=Sk.builtin.lng,Sk.builtin.int_.prototype.$r=function(){const a=this.v;return"number"===typeof a?new Sk.builtin.str(a.toString()):new Sk.builtin.str(a.toString()+"L")},Sk.builtin.int_.prototype.tp$str=function(){return new Sk.builtin.str(this.v.toString())},Sk.builtin.bool.prototype.tp$str=function(){return this.$r()},Sk.builtins.raw_input=new Sk.builtin.func(Sk.builtin.raw_input),Sk.builtin.str.prototype.decode=Sk.builtin.str.$py2decode, delete Sk.builtins.bytes,delete Sk.builtins.ascii)};Sk.exportSymbol("Sk.setupObjects",Sk.setupObjects);Sk.exportSymbol("Sk.builtins",Sk.builtins)},function(m,q){Sk.builtin.str.$empty=new Sk.builtin.str("");Sk.builtin.str.$emptystr=Sk.builtin.str.$empty;Sk.builtin.str.$utf8=new Sk.builtin.str("utf-8");Sk.builtin.str.$ascii=new Sk.builtin.str("ascii");Sk.builtin.str.$default_factory=new Sk.builtin.str("default_factory");Sk.builtin.str.$imag=new Sk.builtin.str("imag");Sk.builtin.str.$real=new Sk.builtin.str("real"); Sk.builtin.str.$abs=new Sk.builtin.str("__abs__");Sk.builtin.str.$bytes=new Sk.builtin.str("__bytes__");Sk.builtin.str.$call=new Sk.builtin.str("__call__");Sk.builtin.str.$class=new Sk.builtin.str("__class__");Sk.builtin.str.$cmp=new Sk.builtin.str("__cmp__");Sk.builtin.str.$complex=new Sk.builtin.str("__complex__");Sk.builtin.str.$contains=new Sk.builtin.str("__contains__");Sk.builtin.str.$copy=new Sk.builtin.str("__copy__");Sk.builtin.str.$dict=new Sk.builtin.str("__dict__");Sk.builtin.str.$dir= new Sk.builtin.str("__dir__");Sk.builtin.str.$doc=new Sk.builtin.str("__doc__");Sk.builtin.str.$enter=new Sk.builtin.str("__enter__");Sk.builtin.str.$eq=new Sk.builtin.str("__eq__");Sk.builtin.str.$exit=new Sk.builtin.str("__exit__");Sk.builtin.str.$index=new Sk.builtin.str("__index__");Sk.builtin.str.$init=new Sk.builtin.str("__init__");Sk.builtin.str.$int_=new Sk.builtin.str("__int__");Sk.builtin.str.$iter=new Sk.builtin.str("__iter__");Sk.builtin.str.$file=new Sk.builtin.str("__file__");Sk.builtin.str.$float_= new Sk.builtin.str("__float__");Sk.builtin.str.$format=new Sk.builtin.str("__format__");Sk.builtin.str.$ge=new Sk.builtin.str("__ge__");Sk.builtin.str.$getattr=new Sk.builtin.str("__getattr__");Sk.builtin.str.$getattribute=new Sk.builtin.str("__getattribute__");Sk.builtin.str.$getitem=new Sk.builtin.str("__getitem__");Sk.builtin.str.$gt=new Sk.builtin.str("__gt__");Sk.builtin.str.$keys=new Sk.builtin.str("keys");Sk.builtin.str.$le=new Sk.builtin.str("__le__");Sk.builtin.str.$len=new Sk.builtin.str("__len__"); Sk.builtin.str.$length_hint=new Sk.builtin.str("__length_hint__");Sk.builtin.str.$loader=new Sk.builtin.str("__loader__");Sk.builtin.str.$lt=new Sk.builtin.str("__lt__");Sk.builtin.str.$module=new Sk.builtin.str("__module__");Sk.builtin.str.$missing=new Sk.builtin.str("__missing__");Sk.builtin.str.$name=new Sk.builtin.str("__name__");Sk.builtin.str.$ne=new Sk.builtin.str("__ne__");Sk.builtin.str.$new=new Sk.builtin.str("__new__");Sk.builtin.str.$next=new Sk.builtin.str("__next__");Sk.builtin.str.$path= new Sk.builtin.str("__path__");Sk.builtin.str.$qualname=new Sk.builtin.str("__qualname__");Sk.builtin.str.$repr=new Sk.builtin.str("__repr__");Sk.builtin.str.$reversed=new Sk.builtin.str("__reversed__");Sk.builtin.str.$round=new Sk.builtin.str("__round__");Sk.builtin.str.$setattr=new Sk.builtin.str("__setattr__");Sk.builtin.str.$setitem=new Sk.builtin.str("__setitem__");Sk.builtin.str.$str=new Sk.builtin.str("__str__");Sk.builtin.str.$trunc=new Sk.builtin.str("__trunc__");Sk.builtin.str.$write=new Sk.builtin.str("write"); Sk.misceval.op2method_={Eq:Sk.builtin.str.$eq,NotEq:Sk.builtin.str.$ne,Gt:Sk.builtin.str.$gt,GtE:Sk.builtin.str.$ge,Lt:Sk.builtin.str.$lt,LtE:Sk.builtin.str.$le}}]);}).call(this || window)