diff --git a/vm/squeak.js b/vm/squeak.js index 008113a..e526708 100644 --- a/vm/squeak.js +++ b/vm/squeak.js @@ -1 +1 @@ -!function(){"use strict";if(self.Squeak||(self.Squeak={}),!Squeak.Settings){var settings;try{if(settings=self.localStorage,settings["squeak-foo:"]="bar","bar"!==settings["squeak-foo:"])throw Error();delete settings["squeak-foo:"]}catch(e){settings={}}Squeak.Settings=settings}function CroquetPlugin(){return{getModuleName:function(){return"CroquetPlugin"},interpreterProxy:null,setInterpreter:function(e){return this.interpreterProxy=e,!0},primitiveGatherEntropy:function(e){var t=this.interpreterProxy.stackObjectValue(0);return this.interpreterProxy.failed()?null:t.isBytes()?(window.crypto.getRandomValues(t.bytes),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0):this.interpreterProxy.primitiveFail()}}}function registerCroquetPlugin(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("CroquetPlugin",CroquetPlugin()):self.setTimeout(registerCroquetPlugin,100)}function SocketPlugin(){return{getModuleName:function(){return"SocketPlugin (http-only)"},interpreterProxy:null,primHandler:null,handleCounter:0,needProxy:new Set,status:0,lookupCache:{localhost:{address:[127,0,0,1],validUntil:Number.MAX_SAFE_INTEGER}},lastLookup:null,lookupSemaIdx:0,TCP_Socket_Type:0,Resolver_Uninitialized:0,Resolver_Ready:1,Resolver_Busy:2,Resolver_Error:3,Socket_InvalidSocket:-1,Socket_Unconnected:0,Socket_WaitingForConnection:1,Socket_Connected:2,Socket_OtherEndClosed:3,Socket_ThisEndClosed:4,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},_signalSemaphore:function(e){e<=0||this.primHandler.signalSemaphoreWithIndex(e)},_signalLookupSemaphore:function(){this._signalSemaphore(this.lookupSemaIdx)},_getAddressFromLookupCache:function(e,t){if(e){if(e.match(/^\d+\.\d+\.\d+\.\d+$/)){var i=e.split(".").map(function(e){return+e});if(i.every(function(e){return e<=255}))return new Uint8Array(i)}i=this.lookupCache[e];if(i&&(t||i.validUntil>=Date.now()))return new Uint8Array(i.address)}return null},_addAddressFromResponseToLookupCache:function(e){var t,i,r,s,n;e&&0===e.Status&&e.Question&&e.Answer&&(i=e.Question[0],(t=function(e,t){e[t]&&e[t].replace&&(e[t]=e[t].replace(/\.$/,""))})(i,"name"),e.Answer.forEach(function(e){t(e,"name"),t(e,"data")}),r=i.name,s=null,n=86400,e.Answer.some(function(e){if(e.name===r){if(e.TTL&&(n=Math.min(n,e.TTL)),1===e.type)return s=e.data.split(".").map(function(e){return+e}),!0;5===e.type&&(r=e.data)}return!1}))&&(this.lookupCache[i.name]={address:s,validUntil:Date.now()+1e3*n})},_compareAddresses:function(e,i){return e.every(function(e,t){return i[t]===e})},_reverseLookupNameForAddress:function(t){var i=this,r=null;return Object.keys(this.lookupCache).some(function(e){return!!i._compareAddresses(t,i.lookupCache[e].address)&&(r=e,!0)}),r||t.join(".")},_newSocketHandle:function(e,t,i,r){var l=this;return{hostAddress:null,host:null,port:null,connSemaIndex:t,readSemaIndex:i,writeSemaIndex:r,webSocket:null,sendBuffer:null,sendTimeout:null,response:null,responseReadUntil:0,responseReceived:!1,status:l.Socket_Unconnected,_signalConnSemaphore:function(){l._signalSemaphore(this.connSemaIndex)},_signalReadSemaphore:function(){l._signalSemaphore(this.readSemaIndex)},_signalWriteSemaphore:function(){l._signalSemaphore(this.writeSemaIndex)},_otherEndClosed:function(){this.status=l.Socket_OtherEndClosed,this.webSocket=null,this._signalConnSemaphore()},_hostAndPort:function(){return this.host+":"+this.port},_requestNeedsProxy:function(){return l.needProxy.has(this._hostAndPort())},_getURL:function(e,t){var i="";return(t||this._requestNeedsProxy())&&(i="object"==typeof SqueakJS&&SqueakJS.options.proxy||"https://corsproxy.io/?"),443!==this.port?i+="http://"+this._hostAndPort()+e:i+="https://"+this.host+e,i},_performRequest:function(){if(this.webSocket)this._performWebSocketSend();else{var e=new TextDecoder("utf-8").decode(this.sendBuffer),t=this.sendBuffer.findIndex(function(e,t,i){return"\r"===i[t]&&"\r"===i[t+2]&&"\n"===i[t+1]&&"\n"===i[t+3]}),i=(this.sendBuffer=0<=t?this.sendBuffer.subarray(t+4):null,e.split("\r\n\r\n")[0].split("\n")),t=i[0].split(" "),e=t[0];if("GET"!==e&&"PUT"!==e&&"POST"!==e)return this._otherEndClosed(),-1;for(var t=t[1],r=!1,s=!1,n=null,a=1;a>>8,t[3]=255&e.length,4):127===i?(t[2]=e.length>>>56,t[3]=e.length>>>48&255,t[4]=e.length>>>40&255,t[5]=e.length>>>32&255,t[6]=e.length>>>24&255,t[7]=e.length>>>16&255,t[8]=e.length>>>8&255,t[9]=255&e.length,10):2,i=new Uint8Array(4),t.set(i,r),i=e,t.set(i,r+=4),e=t),this.response&&this.response.length?this.response.push(e):this.response=[e],this.responseReceived=!0,this._signalReadSemaphore()},_performWebSocketSend:function(){var e,t=this.sendBuffer[0],t=15&t;if(0==t)return console.error("No support for WebSocket frame continuation yet!"),!0;if(1==t)e=!1;else{if(2!=t)return 8==t?(this.webSocket.close(),void(this.webSocket=null)):9==t||10==t?void 0:void console.error("Unsupported WebSocket frame opcode "+t);e=!0}var i,t=this.sendBuffer[1],r=t>>>7,t=127&t,s=126===t?(t=this.sendBuffer[2]<<8|this.sendBuffer[3],4):127===t?(t=this.sendBuffer[2]<<56|this.sendBuffer[3]<<48|this.sendBuffer[4]<<40|this.sendBuffer[5]<<32|this.sendBuffer[6]<<24|this.sendBuffer[7]<<16|this.sendBuffer[8]<<8|this.sendBuffer[9],10):2,n=(r&&(i=this.sendBuffer.subarray(s,s+4),s+=4),this.sendBuffer.subarray(s,s+t));s+=t,r&&(n=n.map(function(e,t){return e^i[3&t]})),t=e?n:Squeak.bytesAsString(n),this.sendBuffer=this.sendBuffer.subarray(s),this.webSocket.send(t),0e?((i=t.subarray(e))?this.response[0]=i:this.response.shift(),t=t.subarray(0,e)):this.response.shift(),this.responseReceived&&0===this.response.length&&!this.webSocket&&(this.responseSentCompletly=!0),t)},send:function(e,t,i){null!==this.sendTimeout&&self.clearTimeout(this.sendTimeout),this.lastSend=Date.now();e=e.bytes.subarray(t,i);return null===this.sendBuffer?this.sendBuffer=e.slice():(t=this.sendBuffer.byteLength+e.byteLength,(i=new Uint8Array(t)).set(this.sendBuffer,0),i.set(e,this.sendBuffer.byteLength),this.sendBuffer=i),this.sendTimeout=self.setTimeout(this._performRequest.bind(this),50),e.byteLength}}},primitiveHasSocketAccess:function(e){return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0},primitiveInitializeNetwork:function(e){return 1===e&&(this.lookupSemaIdx=this.interpreterProxy.stackIntegerValue(0),this.status=this.Resolver_Ready,this.interpreterProxy.pop(e),!0)},primitiveResolverNameLookupResult:function(e){var t;return 0===e&&(this.lastLookup&&this.lastLookup.substr?(t=this._getAddressFromLookupCache(this.lastLookup,!0),this.interpreterProxy.popthenPush(e+1,t?this.primHandler.makeStByteArray(t):this.interpreterProxy.nilObject())):this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverStartNameLookup:function(e){var t,i,r,s,n;return 1===e&&(t=this.lastLookup=this.interpreterProxy.stackValue(0).bytesAsString(),this._getAddressFromLookupCache(t,!1)?(this.status=this.Resolver_Ready,this._signalLookupSemaphore()):(i="https://9.9.9.9:5053/dns-query?name="+encodeURIComponent(this.lastLookup)+"&type=A",self.fetch?(r=this,self.fetch(i,{method:"GET",mode:"cors",credentials:"omit",cache:"no-store",referrer:"no-referrer",referrerPolicy:"no-referrer"}).then(function(e){return e.json()}).then(function(e){r._addAddressFromResponseToLookupCache(e)}).catch(function(e){console.error("Name lookup failed",e)}).then(function(){t===r.lastLookup&&(r.status=r.Resolver_Ready,r._signalLookupSemaphore())})):(r=this,s=function(){t===r.lastLookup&&(r.status=r.Resolver_Ready,r._signalLookupSemaphore())},(n=new XMLHttpRequest).open("GET",i,!0),n.timeout=2e3,n.responseType="json",n.onload=function(e){r._addAddressFromResponseToLookupCache(this.response),s()},n.onerror=function(){console.error("Name lookup failed",n.statusText),s()},n.send()),!0&&(this.status=this.Resolver_Busy,this._signalLookupSemaphore())),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverAddressLookupResult:function(e){var t;return 0===e&&(this.lastLookup&&this.lastLookup.every?(t=this._reverseLookupNameForAddress(this.lastLookup),t=this.primHandler.makeStString(t),this.interpreterProxy.popthenPush(e+1,t)):this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverStartAddressLookup:function(e){return 1===e&&(this.lastLookup=this.interpreterProxy.stackBytes(0),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),this.status=this.Resolver_Ready,this._signalLookupSemaphore(),!0)},primitiveResolverStatus:function(e){return 0===e&&(this.interpreterProxy.popthenPush(e+1,this.status),!0)},primitiveResolverAbortLookup:function(e){return 0===e&&(this.lastLookup=null,this.status=this.Resolver_Ready,this._signalLookupSemaphore(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketRemoteAddress:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(this.interpreterProxy.popthenPush(e+1,t.hostAddress?this.primHandler.makeStByteArray(t.hostAddress):this.interpreterProxy.nilObject()),!0)},primitiveSocketRemotePort:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(this.interpreterProxy.popthenPush(e+1,t.port),!0)},primitiveSocketConnectionStatus:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(void 0===(t=t.status)&&(t=this.Socket_InvalidSocket),this.interpreterProxy.popthenPush(e+1,t),!0)},primitiveSocketConnectToPort:function(e){var t,i,r;return 3===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(2).handle)&&(i=this.interpreterProxy.stackBytes(1),r=this.interpreterProxy.stackIntegerValue(0),t.connect(i,r),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCloseConnection:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(t.close(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCreate3Semaphores:function(e){var t,i,r,s,n;return 7===e&&(t=this.interpreterProxy.stackIntegerValue(0),i=this.interpreterProxy.stackIntegerValue(1),r=this.interpreterProxy.stackIntegerValue(2),s=this.interpreterProxy.stackIntegerValue(3),this.interpreterProxy.stackIntegerValue(5)===this.TCP_Socket_Type)&&(n="{SqueakJS Socket #"+ ++this.handleCounter+"}",(n=this.primHandler.makeStString(n)).handle=this._newSocketHandle(s,r,i,t),this.interpreterProxy.popthenPush(e+1,n),!0)},primitiveSocketDestroy:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(t.destroy(),this.interpreterProxy.popthenPush(e+1,t.status),!0)},primitiveSocketReceiveDataAvailable:function(e){var t,i;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(i=this.interpreterProxy.falseObject(),t.dataAvailable()&&(i=this.interpreterProxy.trueObject()),this.interpreterProxy.popthenPush(e+1,i),!0)},primitiveSocketReceiveDataBufCount:function(e){var t,i,r,s;return 4===e&&void 0!==(s=this.interpreterProxy.stackObjectValue(3).handle)&&(t=this.interpreterProxy.stackObjectValue(2),!((i=this.interpreterProxy.stackIntegerValue(1)-1)+(r=this.interpreterProxy.stackIntegerValue(0))>t.bytes.length||(s=s.recv(r),t.bytes.set(s,i),this.interpreterProxy.popthenPush(e+1,s.length),0)))},primitiveSocketSendDataBufCount:function(e){var t,i,r,s;return 4===e&&void 0!==(s=this.interpreterProxy.stackObjectValue(3).handle)&&(t=this.interpreterProxy.stackObjectValue(2),!((i=this.interpreterProxy.stackIntegerValue(1)-1)<0||(r=i+this.interpreterProxy.stackIntegerValue(0))>t.length||(s=s.send(t,i,r),this.interpreterProxy.popthenPush(e+1,s),0)))},primitiveSocketSendDone:function(e){return 1===e&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0)},primitiveSocketListenWithOrWithoutBacklog:function(e){return!(e<2||(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),0))}}}function registerSocketPlugin(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SocketPlugin",SocketPlugin()):self.setTimeout(registerSocketPlugin,100)}function SpeechPlugin(){return{getModuleName:function(){return"SpeechPlugin"},interpreterProxy:null,primHandler:null,voiceInput:null,semaphoreIndex:null,shouldListen:!1,recognition:null,synth:self.speechSynthesis,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},primitiveSpeak:function(e){if(1===e)t=this.interpreterProxy.stackValue(0).bytesAsString();else{if(2!==e)return!1;var t=this.interpreterProxy.stackValue(1).bytesAsString(),i=this.interpreterProxy.stackValue(0).bytesAsString(),r=this.synth.getVoices().filter(function(e){return e.name===i})}t=new SpeechSynthesisUtterance(t);return r&&0>0)+t:[e,t]}}),Object.subclass("Squeak.Object","initialization",{initInstanceOf:function(e,t,i,r){this.sqClass=e,this.hash=i;var i=e.pointers[Squeak.Class_format],s=(i>>1&63)+(i>>10&192)-1;this._format=i>>7&15,this._format<8?6!=this._format?0>10&255,a=this.decodeWords(1+t,i,s),this.pointers=this.decodePointers(1+t,a,e),this.bytes=this.decodeBytes(o-(1+t),i,1+t,3&this._format)):8<=this._format?0>1:i[n]||42424242}return r},decodeWords:function(e,t,i){for(var r=new DataView(t.buffer,t.byteOffset),s=new Uint32Array(e),n=0;n>4]),i.push(t[15&this.bytes[s]]),r=256*r+this.bytes[s];var e=e?"-":"",n=9007199254740991");case"LargePositiveInteger":return this.bytesAsNumberString(!1);case"LargeNegativeInteger":return this.bytesAsNumberString(!0);case"Character":var t=this.pointers?this.pointers[0]:this.hash;return"$"+String.fromCharCode(t)+" ("+t.toString()+")";case"CompiledMethod":return this.methodAsString();case"CompiledBlock":return"[] in "+this.blockOuterCode().sqInstName()}return/^[aeiou]/i.test(e)?"an"+e:"a"+e}},"accessing",{pointersSize:function(){return this.pointers?this.pointers.length:0},bytesSize:function(){return this.bytes?this.bytes.length:0},wordsSize:function(){return this.isFloat?2:this.words?this.words.length:0},instSize:function(){var e=this._format;return 4>>2):null)},setAddr:function(e){var t=this.snapshotSize();return this.oop=e+4*t.header,e+4*(t.header+t.body)},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:63<++e?2:this.sqClass.isCompact?0:1,body:e}},addr:function(){return this.oop-4*this.snapshotSize().header},totalBytes:function(){var e=this.snapshotSize();return 4*(e.header+e.body)},writeTo:function(e,t,i){this.bytes&&(this._format|=3&-this.bytes.length);var r=t,s=this.snapshotSize(),n=(15&this._format)<<8|(4095&this.hash)<<17;switch(s.header){case 2:e.setUint32(t,s.body<<2|Squeak.HeaderTypeSizeAndClass),e.setUint32(t+=4,this.sqClass.oop|Squeak.HeaderTypeSizeAndClass),e.setUint32(t+=4,n|Squeak.HeaderTypeSizeAndClass),t+=4;break;case 1:e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeClass),e.setUint32(t+=4,n|s.body<<2|Squeak.HeaderTypeClass),t+=4;break;case 0:var a=i.compactClasses.indexOf(this.sqClass)+1;e.setUint32(t,n|a<<12|s.body<<2|Squeak.HeaderTypeShort),t+=4}if(this.isFloat)e.setFloat64(t,this.float),t+=8;else if(this.words)for(var o=0;o>7&15},classInstSize:function(){var e=this.pointers[Squeak.Class_format];return(e>>10&192)+(e>>1&63)-1},classInstIsBytes:function(){var e=this.classInstFormat();return 8<=e&&e<=11},classInstIsPointers:function(){return this.classInstFormat()<=4},instVarNames:function(){for(var e=3;e<=4;e++){var t=this.pointers[e].pointers;if(t&&t.length&&t[0].bytes)return t.map(function(e){return e.bytesAsString()})}return[]},allInstVarNames:function(){var e=this.superclass();return e.isNil?this.instVarNames():e.allInstVarNames().concat(this.instVarNames())},superclass:function(){return this.pointers[0]},className:function(){if(!this.pointers)return"_NOTACLASS_";for(var e=6;e<=7;e++)if((r=this.pointers[e])&&r.bytes)return r.bytesAsString();for(var t=5;t<=6;t++){var i=this.pointers[t];if(i&&i.pointers)for(var r,e=6;e<=7;e++)if((r=i.pointers[e])&&r.bytes)return r.bytesAsString()+" class"}return"_SOMECLASS_"},defaultInst:function(){return Squeak.Object},classInstProto:function(e){if(this.instProto)return this.instProto;var t=this.defaultInst();try{var i="UndefinedObject"===(i=(e=e||this.className()).replace(/[^A-Za-z0-9]/g,"_"))?"nil":"True"===i?"true_":"False"===i?"false_":(/^[AEIOU]/.test(i)?"an":"a")+i;(t=new Function("return function "+i+"() {};")()).prototype=this.defaultInst().prototype}catch(e){}return Object.defineProperty(this,"instProto",{value:t}),t}},"as method",{methodSignFlag:function(){return!1},methodNumLits:function(){return this.pointers[0]>>9&255},methodNumArgs:function(){return this.pointers[0]>>24&15},methodPrimitiveIndex:function(){var e=805306879&this.pointers[0];return 511>19):e},methodClassForSuper:function(){return this.pointers[this.methodNumLits()].pointers[Squeak.Assn_value]},methodNeedsLargeFrame:function(){return 0<(131072&this.pointers[0])},methodAddPointers:function(e){this.pointers=e},methodTempCount:function(){return this.pointers[0]>>18&63},methodGetLiteral:function(e){return this.pointers[1+e]},methodGetSelector:function(e){return this.pointers[1+e]},methodAsString:function(){return"aCompiledMethod"}},"as context",{contextHome:function(){return this.contextIsBlock()?this.pointers[Squeak.BlockContext_home]:this},contextIsBlock:function(){return"number"==typeof this.pointers[Squeak.BlockContext_argumentCount]},contextMethod:function(){return this.contextHome().pointers[Squeak.Context_method]},contextSender:function(){return this.pointers[Squeak.Context_sender]},contextSizeWithStack:function(e){return e&&e.activeContext===this?e.sp+1:(e=this.pointers[Squeak.Context_stackPointer],Squeak.Context_tempFrameStart+("number"==typeof e?e:0))}}),Squeak.Object.subclass("Squeak.ObjectSpur","initialization",{initInstanceOf:function(e,t,i,r){this.sqClass=e,this.hash=i;var i=e.pointers[Squeak.Class_format],s=65535&i,i=i>>16&31;(this._format=i)<12?i<10?0>(a?3:1),h=32767&c,f=a?this.decodeWords64(1+h,u,s):this.decodeWords(1+h,u,s),p=a?2*(1+h):1+h;this.pointers=this.decodePointers(1+h,f,e,n,a),this.bytes=this.decodeBytes(l-p,u,p,3&this._format),a&&(this.pointers[0]=2147483648&u[1]|c);break;default:throw Error("Unknown object format: "+this._format)}this.mark=!1},decodeWords64:function(e,t,i){for(var r=new Array(e),s=0;s>1:s.makeLargeFromSmall((o-(o>>>0))/4294967296>>>0,o>>>0):o>>1;else if(2==(3&o)){if(o<0||8589934591>>(s?3:2))}else s&&4==(7&o)?n[a]=this.decodeSmallFloat((o-(o>>>0))/4294967296>>>0,o>>>0,s):(n[a]=i[o]||42424242,n[a])}return n},decodeSmallFloat:function(e,t,i){var r=0,s=0,n=(8&t)<<28;return 0==(e|4294967280&t)?r=n:(r=939524096+(e>>>4)|n,s=t>>>4|(15&e)<<28),i.makeFloat(new Uint32Array([s,r]))},overhead64:function(e){var t,i=0,r=0,s=0;return this._format<=5?i=-2&e.length:24<=this._format?(i=1+(e[0]>>3&32767),t=28<=this._format,1==(1&i)&&(i+=t?1:-1),s=e.length/2,r=e.length-i):s=(r=e.length)/2,{bytes:4*i,sizeHeader:255<=r&&s<255}},initInstanceOfChar:function(e,t){this.oop=t<<2|2,this.sqClass=e,this.hash=t,this._format=7,this.mark=!0},initInstanceOfFloat:function(e,t){this.sqClass=e,this.hash=0,this._format=10,this.isFloat=!0,this.float=this.decodeFloat(t,!0,!0)},initInstanceOfLargeInt:function(e,t){this.sqClass=e,this.hash=0,this._format=16,this.bytes=new Uint8Array(t)},classNameFromImage:function(e,t){e=e[t[this.oop][Squeak.Class_name]];return e&&16<=e._format&&e._format<24?(t=t[e.oop],t=e.decodeBytes(t.length,t,0,7&e._format),Squeak.bytesAsString(t)):"Class"},renameFromImage:function(e,t,i){var i=i[this.sqClass];return(i=i&&(i.instProto||i.classInstProto(i.classNameFromImage(e,t))))?((e=new i).oop=this.oop,e.sqClass=this.sqClass,e._format=this._format,e.hash=this.hash,e):this}},"accessing",{instSize:function(){return this._format<2?this.pointersSize():this.sqClass.classInstSize()},indexableSize:function(e){var t=this._format;return t<2?-1:3===t&&e.vm.isContext(this)?this.pointers[Squeak.Context_stackPointer]:t<6?this.pointersSize()-this.instSize():t<12?this.wordsSize():t<16?this.shortsSize():t<24?this.bytesSize():4*this.pointersSize()+this.bytesSize()},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:255<=e?2:0,body:e=(e=e+(1&e)+2)<4?4:e}},writeTo:function(e,t,i,r){var s=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0,n=(this.bytes&&(s+=this.bytes.length+3>>>2,this._format|=3&-this.bytes.length),t),a=this._format<<24|4194303&this.sqClass.hash,o=s<<24|4194303&this.hash;if(255<=s&&(e.setUint32(t,s,i),o=255<<24|4194303&this.hash,e.setUint32(t+=4,o,i),t+=4),e.setUint32(t,a,i),e.setUint32(t+=4,o,i),t+=4,this.isFloat)e.setFloat64(t,this.float,i),t+=8;else if(this.words)for(var u=0;u>16&31},classInstSize:function(){return 65535&this.pointers[Squeak.Class_format]},classInstIsBytes:function(){var e=this.classInstFormat();return 16<=e&&e<=23},classInstIsPointers:function(){return this.classInstFormat()<=6},classByteSizeOfInstance:function(e){var t=this.classInstFormat(),i=this.classInstSize();return 4*(i=(i=(i=(i+=t<9?e:16<=t?(e+3)/4|0:12<=t?(e+1)/2|0:10<=t?e:2*e)+(1&i))+(255<=i?4:2))<4?4:i)}},"as compiled block",{blockOuterCode:function(){return this.pointers[this.pointers.length-1]}},"as method",{methodSignFlag:function(){return this.pointers[0]<0},methodNumLits:function(){return 32767&this.pointers[0]},methodPrimitiveIndex:function(){return 0==(65536&this.pointers[0])?0:this.bytes[1]+256*this.bytes[2]},methodAsString:function(){var e=this.pointers[this.pointers.length-1].pointers[Squeak.ClassBinding_value],t=this.pointers[this.pointers.length-2];return t.pointers&&(t=t.pointers[Squeak.AdditionalMethodState_selector]),e.className()+">>"+t.bytesAsString()}}),Object.subclass("Squeak.Image","about",{about:function(){}},"initializing",{initialize:function(e){this.headRoom=1e8,this.totalMemory=0,this.name=e,this.gcCount=0,this.gcMilliseconds=0,this.pgcCount=0,this.pgcMilliseconds=0,this.gcTenured=0,this.allocationCount=0,this.oldSpaceCount=0,this.youngSpaceCount=0,this.newSpaceCount=0,this.hasNewInstances={}},readFromBuffer:function(r,t,i){console.log("squeak: reading "+this.name+" ("+r.byteLength+" bytes)"),this.startupTime=Date.now();for(var s=new DataView(r),n=!1,a=0,e=function(){var e=s.getUint32(a,n);return a+=4,e},o=e,u=4,N=function(e,t){if(t){for(var i=[];i.length>>24,O=(255===F&&(F=y,y=e(),S=e()),U+a-8-v),I=4194303&y,G=4194303&S,w=N(F,(x=y>>>24&31)<10&&0>>2,P=o(),_=o();break;case Squeak.HeaderTypeClass:P=_-Squeak.HeaderTypeClass,C=(_=o())>>>2&63;break;case Squeak.HeaderTypeShort:C=_>>>2&63,P=_>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var x,V,O=a-4-v,G=_>>>17&4095,w=N(--C,(x=_>>>8&15)<5);(V=new Squeak.Object).initFromImage(O,P,x,G),P<32&&(V.hash|=268435456),p&&(p.nextObject=V),this.oldSpaceCount++,p=V,d[f+O]=V,m[O]=w}this.firstOldObject=d[f+4],this.lastOldObject=V,this.lastOldObject.nextObject=null,this.oldSpaceBytes=R}this.totalMemory=this.oldSpaceBytes+this.headRoom,this.totalMemory=1e6*Math.ceil(this.totalMemory/1e6);var L=d[D],J=this.isSpur?this.spurClassTable(d,m,k,L):m[d[m[L.oop][Squeak.splOb_CompactClasses]].oop],j=null;for(V=this.firstOldObject,p=null;V;)p=j,j=V.renameFromImage(d,m,J),p?p.nextObject=j:this.firstOldObject=j,d[f+V.oop]=j,V=V.nextObject;this.lastOldObject=j,this.lastOldObject.nextObject=null;var q=d[D],Y=m[d[m[q.oop][Squeak.splOb_CompactClasses]].oop],Q=d[m[q.oop][Squeak.splOb_ClassFloat]],B=(this.isSpur&&(this.initImmediateClasses(d,m,q),Y=this.spurClassTable(d,m,k,q),E=this.getCharacter.bind(this),this.initSpurOverrides()),this.firstOldObject),M=0,$=function(){if(B){for(var e=M+(this.oldSpaceCount/20|0);B&&M=n.length)return 0;t=2147483652+4*a,n[a++]=e}else{if(s+e.totalBytes()>r.byteLength)return 0;t=s+4*(e.snapshotSize().header+1),s=e.writeTo(r,s,this),l.push(e)}u[e.oop]=t}return t}function h(){for(var e=this.firstOldObject;e;)e.mark=!1,e=e.nextObject;return this.weakObjects=null,!1}for(c=c.bind(this),h=h.bind(this),c(i);0>>2,p=n(),d=n();break;case Squeak.HeaderTypeClass:p=d-Squeak.HeaderTypeClass,f=(d=n())>>>2&63;break;case Squeak.HeaderTypeShort:f=d>>>2&63,p=d>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var m=s,v=d>>>8&15,g=d>>>17&4095,k=function(e,t){if(t<5){for(var i=[];i.length>>3;for(var i=(e>>=3)<0,r=(i&&(e=-e,0!==(t=-t))&&e--,0===e?4:e<=255?5:e<=65535?6:e<=16777215?7:8),i=i?this.largeNegIntClass:this.largePosIntClass,s=new i.instProto,n=(this.registerObjectSpur(s),this.hasNewInstances[i.oop]=!0,s.initInstanceOfLargeInt(i,r),s.bytes),a=0;a<4;a++)n[a]=255&t,t>>=8;for(a=4;a>=8;return s},ensureClassesInTable:function(){for(var e=this.firstOldObject,t=1024;e;){var i=e.sqClass;if(0===i.hash&&this.enterIntoClassTable(i),i.hash>t&&(t=i.hash),this.classTable[i.hash]!==i)throw Error("Class not in class table");e=e.nextObject}return 1+(t>>10)},classTableBytes:function(e){return 4*(4108+1028*e)},writeFreeLists:function(e,t,i,r){return e.setUint32(t,167772178,i),e.setUint32(t+=4,536870912,i),t=t+4+128},writeClassTable:function(e,t,i,r,s){e.setUint32(t,4104,i),e.setUint32(t+=4,4278190080,i),e.setUint32(t+=4,33554448,i),e.setUint32(t+=4,4278190080,i),t+=4;for(var n=0;n>2||2!=(3&e.oop))throw Error("Bad immediate char");return e.oop}if(e.oop<0)throw Error("temporary oop");return e.oop<48?e.oop:e.oop+t}for(a(this.formatVersion()),a(64),a(t+this.oldSpaceBytes+16),a(this.firstOldObject.addr()),a(o(this.specialObjectsArray)),this.savedHeaderWords.forEach(a),a(t+this.oldSpaceBytes+16);n<64;)a(0);var u=0,n=(l=this.firstOldObject).writeTo(i,n,r,o),l=l.nextObject;for(u++,n=l.writeTo(i,n,r,o),l=l.nextObject,u++,n=l.writeTo(i,n,r,o),l=l.nextObject,u++,n=this.writeFreeLists(i,n,r,o),n=this.writeClassTable(i,n,r,o,e);l;)n=l.writeTo(i,n,r,o),l=l.nextObject,u++;if(a(1241513987),a(8388608),a(0),a(0),n!==i.byteLength)throw Error("wrong image size");if(u!==this.oldSpaceCount)throw Error("wrong object count");e=Date.now()-s;return console.log("Wrote "+u+" objects in "+e+" ms, image size "+n+" bytes"),i.buffer},storeImageSegmentSpur:function(e,t,i){return this.vm.warnOnce("not implemented for Spur yet: primitive 98 (primitiveStoreImageSegment)"),!1},loadImageSegmentSpur:function(e,t){return this.vm.warnOnce("not implemented for Spur yet: primitive 99 (primitiveLoadImageSegment)"),null}}),Object.subclass("Squeak.Interpreter","initialization",{initialize:function(e,t){console.log("squeak: initializing interpreter "+Squeak.vmVersion+" ("+Squeak.vmDate+")"),this.Squeak=Squeak,this.image=e,(this.image.vm=this).primHandler=new Squeak.Primitives(this,t),this.loadImageState(),this.hackImage(),this.initVMState(),this.loadInitialContext(),this.initCompiler(),console.log("squeak: ready")},loadImageState:function(){this.specialObjects=this.image.specialObjectsArray.pointers,this.specialSelectors=this.specialObjects[Squeak.splOb_SpecialSelectors].pointers,this.nilObj=this.specialObjects[Squeak.splOb_NilObject],this.falseObj=this.specialObjects[Squeak.splOb_FalseObject],this.trueObj=this.specialObjects[Squeak.splOb_TrueObject],this.hasClosures=this.image.hasClosures,this.getGlobals=this.globalsGetter(),this.hasClosures||this.findMethod("UnixFileDirectory class>>pathNameDelimiter")||(this.primHandler.emulateMac=!0),6501==this.image.version&&(this.primHandler.reverseDisplay=!0)},initVMState:function(){this.byteCodeCount=0,this.sendCount=0,this.interruptCheckCounter=0,this.interruptCheckCounterFeedBackReset=1e3,this.interruptChecksEveryNms=3,this.lowSpaceThreshold=1e6,this.signalLowSpace=!1,this.nextPollTick=0,this.nextWakeupTick=0,this.lastTick=0,this.interruptKeycode=2094,this.interruptPending=!1,this.pendingFinalizationSignals=0,this.freeContexts=this.nilObj,this.freeLargeContexts=this.nilObj,this.reclaimableContextCount=0,this.nRecycledContexts=0,this.nAllocatedContexts=0,this.methodCacheSize=1024,this.methodCacheMask=this.methodCacheSize-1,this.methodCacheRandomish=0,this.methodCache=[];for(var e=0;e>wordSize",literal:{index:1,old:8,hack:4},enabled:!0},{method:"ReleaseBuilder class>>prepareEnvironment",bytecode:{pc:28,old:216,hack:135},enabled:("object"==typeof location?location.hash:"").includes("wizard=false")}].forEach(function(t){try{var e,i,r,s,n=t.enabled&&this.findMethod(t.method);n&&(e=t.primitive,i=t.bytecode,r=t.literal,s=!0,e?n.pointers[0]|=e:i&&n.bytes[i.pc]===i.old?n.bytes[i.pc]=i.hack:i&&n.bytes[i.pc]===i.hack?s=!1:r&&n.pointers[r.index].pointers[1]===r.old?n.pointers[r.index].pointers[1]=r.hack:r&&n.pointers[r.index].pointers[1]===r.hack?s=!1:(s=!1,console.warn("Not hacking "+t.method)),s)&&console.warn("Hacking "+t.method)}catch(e){console.error("Failed to hack "+t.method+" with error "+e)}},this)}},"interpreting",{interpretOne:function(e){if(this.method.methodSignFlag())return this.interpretOneSistaWithExtensions(e,0,0);if(!this.method.compiled){var t,i,r=this.Squeak;switch(this.byteCodeCount++,t=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&t]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.homeContext.pointers[r.Context_tempFrameStart+(15&t)]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&t));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 92:case 93:case 94:case 95:return void this.push(this.method.methodGetLiteral(31&t).pointers[r.Assn_value]);case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:return this.receiver.dirty=!0,void(this.receiver.pointers[7&t]=this.pop());case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:return void(this.homeContext.pointers[r.Context_tempFrameStart+(7&t)]=this.pop());case 112:return void this.push(this.receiver);case 113:return void this.push(this.trueObj);case 114:return void this.push(this.falseObj);case 115:return void this.push(this.nilObj);case 116:return void this.push(-1);case 117:return void this.push(0);case 118:return void this.push(1);case 119:return void this.push(2);case 120:return void this.doReturn(this.receiver);case 121:return void this.doReturn(this.trueObj);case 122:return void this.doReturn(this.falseObj);case 123:return void this.doReturn(this.nilObj);case 124:return void this.doReturn(this.pop());case 125:return void this.doReturn(this.pop(),this.activeContext.pointers[r.BlockContext_caller]);case 126:case 127:return void this.nono();case 128:return void this.extendedPush(this.nextByte());case 129:return void this.extendedStore(this.nextByte());case 130:return void this.extendedStorePop(this.nextByte());case 131:return i=this.nextByte(),void this.send(this.method.methodGetSelector(31&i),i>>5,!1);case 132:return void this.doubleExtendedDoAnything(this.nextByte());case 133:return i=this.nextByte(),void this.send(this.method.methodGetSelector(31&i),i>>5,!0);case 134:return i=this.nextByte(),void this.send(this.method.methodGetSelector(63&i),i>>6,!1);case 135:return void this.pop();case 136:return void this.push(this.top());case 137:return void this.push(this.exportThisContext());case 138:return void this.pushNewArray(this.nextByte());case 139:return void this.callPrimBytecode(129);case 140:return i=this.nextByte(),void this.push(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]);case 141:return i=this.nextByte(),void(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]=this.top());case 142:return i=this.nextByte(),void(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]=this.pop());case 143:return void this.pushClosureCopy();case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:return void(this.pc+=1+(7&t));case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.jumpIfFalse(1+(7&t));case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:return i=this.nextByte(),this.pc+=256*((7&t)-4)+i,void((7&t)<4&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 168:case 169:case 170:case 171:return void this.jumpIfTrue(256*(3&t)+this.nextByte());case 172:case 173:case 174:case 175:return void this.jumpIfFalse(256*(3&t)+this.nextByte());case 176:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 177:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 178:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 180:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 181:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 182:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 183:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 184:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 185:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 186:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 187:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&t));case 188:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 189:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 190:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&t));case 191:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&t));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return void(this.primHandler.quickSendOther(this.receiver,15&t)||this.sendSpecial(16+(15&t)));case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 216:case 217:case 218:case 219:case 220:case 221:case 222:case 223:return void this.send(this.method.methodGetSelector(15&t),0,!1);case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:return void this.send(this.method.methodGetSelector(15&t),1,!1);case 240:case 241:case 242:case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:return void this.send(this.method.methodGetSelector(15&t),2,!1)}throw Error("not a bytecode: "+t)}if(e){if(!this.compiler.enableSingleStepping(this.method))return this.method.compiled=null,this.interpretOne(e);this.breakNow()}this.method.compiled(this)},interpretOneSistaWithExtensions:function(e,t,i){var r,s,n=this.Squeak;switch(this.byteCodeCount++,r=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&r]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.method.methodGetLiteral(15&r).pointers[n.Assn_value]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&r));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return void this.push(this.homeContext.pointers[n.Context_tempFrameStart+(7&r)]);case 72:case 73:case 74:case 75:return void this.push(this.homeContext.pointers[n.Context_tempFrameStart+(3&r)+8]);case 76:return void this.push(this.receiver);case 77:return void this.push(this.trueObj);case 78:return void this.push(this.falseObj);case 79:return void this.push(this.nilObj);case 80:return void this.push(0);case 81:return void this.push(1);case 82:return 0==i?void this.push(this.exportThisContext()):void this.nono();case 83:return void this.push(this.top());case 84:case 85:case 86:case 87:return void this.nono();case 88:return void this.doReturn(this.receiver);case 89:return void this.doReturn(this.trueObj);case 90:return void this.doReturn(this.falseObj);case 91:return void this.doReturn(this.nilObj);case 92:return void this.doReturn(this.pop());case 93:return void this.doReturn(this.nilObj,this.activeContext.pointers[n.BlockContext_caller]);case 94:return 0==t?void this.doReturn(this.pop(),this.activeContext.pointers[n.BlockContext_caller]):void this.nono();case 95:return;case 96:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 97:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 98:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 100:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 101:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 102:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 103:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 104:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 105:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 106:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 107:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&r));case 108:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 109:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 110:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&r));case 111:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&r));case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return void(this.primHandler.quickSendOther(this.receiver,15&r)||this.sendSpecial(16+(15&r)));case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return void this.send(this.method.methodGetSelector(15&r),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.send(this.method.methodGetSelector(15&r),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return void this.send(this.method.methodGetSelector(15&r),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return void(this.pc+=1+(7&r));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return void this.jumpIfTrue(1+(7&r));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return void this.jumpIfFalse(1+(7&r));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return this.receiver.dirty=!0,void(this.receiver.pointers[7&r]=this.pop());case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return void(this.homeContext.pointers[n.Context_tempFrameStart+(7&r)]=this.pop());case 216:return void this.pop();case 217:return void this.nono();case 218:case 219:case 220:case 221:case 222:case 223:return void this.nono();case 224:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,(t<<8)+a,i);case 225:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,t,(i<<8)+(a<128?a:a-256));case 226:return a=this.nextByte(),void this.push(this.receiver.pointers[a+(t<<8)]);case 227:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)).pointers[n.Assn_value]);case 228:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)));case 229:return a=this.nextByte(),void this.push(this.homeContext.pointers[n.Context_tempFrameStart+a]);case 230:return void this.nono();case 231:return void this.pushNewArray(this.nextByte());case 232:return a=this.nextByte(),void this.push(a+(i<<8));case 233:return a=this.nextByte(),void this.push(this.image.getCharacter(a+(i<<8)));case 234:return a=this.nextByte(),void this.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(i<<3),!1);case 235:var a=this.nextByte(),o=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=i?void this.sendSuperDirected(o,(7&a)+((63&i)<<3)):void this.send(o,(7&a)+(i<<3),!0);case 236:return void this.nono();case 237:o=this.nextByte()+(i<<8);return this.pc+=o,void(o<0&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 238:return void this.jumpIfTrue(this.nextByte()+(i<<8));case 239:return void this.jumpIfFalse(this.nextByte()+(i<<8));case 240:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.pop());case 241:return(s=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(s.pointers[n.Assn_value]=this.pop());case 242:return void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()]=this.pop());case 243:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.top());case 244:return(s=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(s.pointers[n.Assn_value]=this.top());case 245:return void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()]=this.top());case 246:case 247:return void this.nono();case 248:return void this.callPrimBytecode(245);case 249:return void this.pushFullClosure(t);case 250:return void this.pushClosureCopyExtended(t,i);case 251:return a=this.nextByte(),void this.push(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]);case 252:return a=this.nextByte(),void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]=this.top());case 253:return a=this.nextByte(),void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]=this.pop());case 254:case 255:return void this.nono()}throw Error("not a bytecode: "+r)},interpret:function(e,t){if(this.frozen)return"frozen";for(this.isIdle=!1,this.breakOutOfInterpreter=!1,this.breakAfter(e||500);!1===this.breakOutOfInterpreter;)this.method.compiled?this.method.compiled(this):this.interpretOne();return"function"==typeof this.breakOutOfInterpreter?this.breakOutOfInterpreter(t):(e="break"==this.breakOutOfInterpreter?"break":this.isIdle?this.nextWakeupTick?Math.max(1,this.nextWakeupTick-this.primHandler.millisecondClockValue()):"sleep":0,t&&t(e),e)},goIdle:function(){var e=0!==this.nextWakeupTick,t=(this.forceInterruptCheck(),this.checkForInterrupts(),0!==this.nextWakeupTick);this.isIdle=t||!e,this.breakOut()},freeze:function(e){this.frozen=!0,this.breakOutOfInterpreter=function(e){if(e)return t=e,"frozen";throw Error("need function to restart interpreter")}.bind(this);var t,i=function(){if(this.frozen=!1,!t)throw Error("no continue function");t(0)}.bind(this);return e&&self.setTimeout(function(){e(i)},0),i},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.method.bytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e,t=this.primHandler.millisecondClockValue();t=this.nextWakeupTick&&(this.nextWakeupTick=0,(e=this.specialObjects[Squeak.splOb_TheTimerSemaphore]).isNil||this.primHandler.synchronousSignal(e)),0=this.breakOutTick&&this.breakOut()},extendedPush:function(e){var t=63&e;switch(e>>6){case 0:this.push(this.receiver.pointers[t]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+t]);break;case 2:this.push(this.method.methodGetLiteral(t));break;case 3:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value])}},extendedStore:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.top();break;case 2:this.nono();break;case 3:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.pop();break;case 2:this.nono();break;case 3:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(e){var t=this.nextByte();switch(e>>5){case 0:this.send(this.method.methodGetSelector(t),31&e,!1);break;case 1:this.send(this.method.methodGetSelector(t),31&e,!0);break;case 2:this.push(this.receiver.pointers[t]);break;case 3:this.push(this.method.methodGetLiteral(t));break;case 4:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value]);break;case 5:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 6:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 7:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(e){var t=this.pop();t.isTrue?this.pc+=e:t.isFalse||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},jumpIfFalse:function(e){var t=this.pop();t.isFalse?this.pc+=e:t.isTrue||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)},callPrimBytecode:function(e){this.pc+=2,this.primFailCode&&(this.method.bytes[this.pc]===e&&this.stackTopPut(this.getErrorObjectFromPrimFailCode()),this.primFailCode=0)},getErrorObjectFromPrimFailCode:function(){var e=this.specialObjects[Squeak.splOb_PrimErrTableIndex];if(e&&e.pointers){e=e.pointers[this.primFailCode-1];if(e)return e}return this.primFailCode}},"closures",{pushNewArray:function(e){var t=127>4,e=256*this.nextByte()+this.nextByte(),r=this.encodeSqueakPC(this.pc,this.method),s=this.newClosure(t,r,i);if(s.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>3&7)+8*this.div(e,16),i=r+(t<<8),e=this.encodeSqueakPC(this.pc,this.method),a=this.newClosure(s,e,n);if(a.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>6&1)?this.vm.nilObj:this.activeContext,t=this.method.methodGetLiteral(t+(e<<8)),n=this.newFullClosure(s,r,t);if(1==(i>>7&1))throw Error("on-stack receiver not yet supported");if(n.pointers[Squeak.ClosureFull_receiver]=this.receiver,(this.reclaimableContextCount=0)>"+e.bytesAsString())),this.popNandPush(t,c),this.findSelectorInClass(u,1,i)},lookupSelectorInDict:function(e,t){for(var i=e.pointersSize(),r=(i-Squeak.MethodDict_selectorStart-1&t.hash)+Squeak.MethodDict_selectorStart,s=!1;;){var n=e.pointers[r];if(n===t)return e.pointers[Squeak.MethodDict_array].pointers[r-Squeak.MethodDict_selectorStart];if(n.isNil)return this.nilObj;if(++r===i){if(s)return this.nilObj;r=Squeak.MethodDict_selectorStart,s=!0}}},executeNewMethod:function(e,t,i,r,s,n){if(this.sendCount++,t===this.breakOnMethod&&this.breakNow("executing method "+this.printMethod(t,s,n)),this.logSends){for(var a=" ",o=this.activeContext;!o.isNil;)a+="| ",o=o.pointers[Squeak.Context_sender];var u=this.activeContext.pointers.slice(this.sp+1-i,this.sp+1);console.log(this.sendCount+a+this.printMethod(t,s,n,u))}if(this.breakOnContextChanged&&(this.breakOnContextChanged=!1,this.breakNow()),!(0Squeak.Message_lookupClass&&(r.pointers[Squeak.Message_lookupClass]=i),r},primitivePerform:function(e){var t=this.stackValue(e-1),i=this.stackValue(e),e=e-1,r=this.sp-e,s=this.activeContext.pointers,s=(this.arrayCopy(s,1+r,s,r,e),this.sp--,this.findSelectorInClass(t,e,this.getClass(i)));return this.executeNewMethod(i,s.method,s.argCount,s.primIndex,s.mClass,t),!0},primitivePerformWithArgs:function(e,t){var i=t?3:2,r=this.stackValue(i),s=this.stackValue(i-1),n=this.stackValue(i-2);if(n.sqClass!==this.specialObjects[Squeak.splOb_ClassArray])return!1;var a=t?this.top():this.getClass(r);if(t)for(var o=this.getClass(r);o!==a;)if((o=o.pointers[Squeak.Class_superclass]).isNil)return!1;var t=n.pointersSize(),i=this.sp-(i-1),u=this.activeContext.pointers,n=(this.arrayCopy(n.pointers,0,u,i,t),this.sp+=t-e,this.findSelectorInClass(s,t,a));return this.executeNewMethod(r,n.method,n.argCount,n.primIndex,n.mClass,s),!0},primitiveInvokeObjectAsMethod:function(e,t){for(var i=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e),r=0;r=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return this.popNandPush(2,e),!0;var t,i;if(-4294967295<=e&&e<=4294967295)return e=(t=e<0)?-e:e,t=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,(i=(t=this.instantiateClass(this.specialObjects[t],4)).bytes)[0]=255&e,i[1]=e>>8&255,i[2]=e>>16&255,i[3]=e>>24&255,this.popNandPush(2,t),!0}return!1},pop2AndPushBoolResult:function(e){return!!this.success&&(this.popNandPush(2,e?this.trueObj:this.falseObj),!0)}},"numbers",{getClass:function(e){return this.isSmallInt(e)?this.specialObjects[Squeak.splOb_ClassInteger]:e.sqClass},canBeSmallInt:function(e){return e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt},isSmallInt:function(e){return"number"==typeof e},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,1)},quickDivide:function(e,t){var i;return 0!==t&&(i=e/t|0)*t===e?i:Squeak.NonSmallInt},div:function(e,t){return 0===t?Squeak.NonSmallInt:Math.floor(e/t)},mod:function(e,t){return 0===t?Squeak.NonSmallInt:e-Math.floor(e/t)*t},safeShift:function(e,t){var i;return t<0?t<-31?e<0?-1:0:e>>-t:31>t===e?i:Squeak.NonSmallInt}},"utils",{isContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]||e.sqClass===this.specialObjects[Squeak.splOb_ClassBlockContext]},isMethodContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]},instantiateClass:function(e,t){return this.image.instantiateClass(e,t,this.nilObj)},arrayFill:function(e,t,i,r){for(var s=t;s>",t=t.bytesAsString();if(i&&i.length)for(var a=t.split(/(?<=:)/),o=0;o>"+i.bytesAsString()}),s||(e?"("+e.pointers[Squeak.Context_receiver]+")>>?":"?>>?")},allInstancesOf:function(e,t){"string"==typeof e&&(e=this.globalNamed(e));for(var i=[],r=this.image.someInstanceOf(e);r;)t?t(r):i.push(r),r=this.image.nextInstanceAfter(r);return i},globalNamed:function(i){return this.allGlobalsDo(function(e,t){if(e.bytesAsString()===i)return t})},allGlobalsDo:function(e){for(var t=this.getGlobals(),i=0;it+200&&(e.isNil||r.push("..."),r=r.slice(0,t).concat(["..."]).concat(r.slice(-200)));var n,a,o=[],u=r.length,l="";for(i&&this.logSends&&(l=Array((""+this.sendCount).length+2).join(" "));0>")[0],n=e.split(">>")[1];return this.allMethodsDo(function(e,t,i){if(n.length==i.bytesSize()&&n==i.bytesAsString()&&s==e.className())return r=t}),r},breakAfter:function(e){this.breakOutTick=this.primHandler.millisecondClockValue()+e},breakNow:function(e){e&&console.log("Break: "+e),this.breakOutOfInterpreter="break"},breakOn:function(e){return this.breakOnMethod=e&&this.findMethod(e)},breakOnReturnFromThisContext:function(){this.breakOnContextChanged=!1,this.breakOnContextReturned=this.activeContext},breakOnSendOrReturn:function(){this.breakOnContextChanged=!0,this.breakOnContextReturned=null},printContext:function(e,t){if(!this.isContext(e))return"NOT A CONTEXT: "+i(e);function i(e){e="number"==typeof e||"object"==typeof e?e.sqInstName():"<"+e+">";return e=(e=JSON.stringify(e).slice(1,-1)).length>t-3?e.slice(0,t-3)+"...":e}t=t||72;for(var r="number"==typeof e.pointers[Squeak.BlockContext_argumentCount],s=e.pointers[Squeak.Context_closure],n=!r&&!s.isNil,a=r?e.pointers[Squeak.BlockContext_home]:e,n=n?s.pointers[Squeak.Closure_numArgs]:a.pointers[Squeak.Context_method].methodTempCount(),o=this.decodeSqueakSP(0),u=a.contextSizeWithStack(this)-1,l=o+1,c=l+n-1,h=l+a.pointers[Squeak.Context_method].methodNumArgs()-1,f="",p=o;p<=u;p++){var d="";p===o?d="=rcvr":(p<=c&&(d="=tmp"+(p-l)),p<=h&&(d+="/arg"+(p-l))),f+="\nctx["+p+"]"+d+": "+i(a.pointers[p])}if(r){f+="\n";var s=e.pointers[Squeak.BlockContext_argumentCount],m=this.decodeSqueakSP(1),h=m+s,v=e===this.activeContext?this.sp:e.pointers[Squeak.Context_stackPointer];v");for(p=m;p<=v;p++)f+="\nblk["+p+"]"+(d=p ",this.pc),this.activeContext.pointers.slice(0,this.sp+1))},willSendOrReturn:function(){var e,t=this.method.bytes[this.pc];if(this.method.methodSignFlag()){if(96<=t&&t<=127)i=this.specialSelectors[2*(t-96)];else if(128<=t&&t<=175)i=this.method.methodGetSelector(15&t);else if(234==t||235==t)this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3);else if(88<=t&&t<=94)return!0}else{if(120<=t&&t<=125)return!0;if(t<131||200==t)return!1;if(176<=t)return!0;if(t<=134){if(132===t){if(1>5)return!1;e=this.method.bytes[this.pc+2]}else e=this.method.bytes[this.pc+1]&(134===t?63:31);var i=this.method.methodGetLiteral(e);if("blockCopy:"!==i.bytesAsString())return!0}}return!1},nextSendSelector:function(){var e,t,i=this.method.bytes[this.pc];if(this.method.methodSignFlag())if(96<=i&&i<=127)e=this.specialSelectors[2*(i-96)];else if(128<=i&&i<=175)e=this.method.methodGetSelector(15&i);else{if(234!=i&&235!=i)return null;this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3)}else{if(i<131||200==i)return null;if(208<=i)e=this.method.methodGetLiteral(15&i);else if(176<=i)e=this.specialSelectors[2*(i-176)];else if(i<=134){if(132===i){if(1>5)return null;t=this.method.bytes[this.pc+2]}else t=this.method.bytes[this.pc+1]&(134===i?63:31);e=this.method.methodGetLiteral(t)}}if(e){i=e.bytesAsString();if("blockCopy:"!==i)return i}}}),Object.subclass("Squeak.InterpreterProxy","initialization",{VM_PROXY_MAJOR:1,VM_PROXY_MINOR:11,initialize:function(t){this.vm=t,this.remappableOops=[],Object.defineProperty(this,"successFlag",{get:function(){return t.primHandler.success},set:function(e){t.primHandler.success=e}})},majorVersion:function(){return this.VM_PROXY_MAJOR},minorVersion:function(){return this.VM_PROXY_MINOR}},"success",{failed:function(){return!this.successFlag},primitiveFail:function(){this.successFlag=!1},primitiveFailFor:function(e){this.successFlag=!1},success:function(e){e||(this.successFlag=!1)}},"stack access",{pop:function(e){this.vm.popN(e)},popthenPush:function(e,t){this.vm.popNandPush(e,t)},push:function(e){this.vm.push(e)},pushBool:function(e){this.vm.push(e?this.vm.trueObj:this.vm.falseObj)},pushInteger:function(e){this.vm.push(e)},pushFloat:function(e){this.vm.push(this.floatObjectOf(e))},stackValue:function(e){return this.vm.stackValue(e)},stackIntegerValue:function(e){e=this.vm.stackValue(e);return"number"==typeof e?e:(this.successFlag=!1,0)},stackFloatValue:function(e){this.vm.success=!0;e=this.vm.stackIntOrFloat(e);return this.vm.success?e:(this.successFlag=!1,0)},stackObjectValue:function(e){e=this.vm.stackValue(e);return"number"!=typeof e?e:(this.successFlag=!1,this.vm.nilObj)},stackBytes:function(e){e=this.vm.stackValue(e);return e.bytes||("number"!=typeof e&&e.isBytes()||(this.successFlag=!1),[])},stackWords:function(e){e=this.vm.stackValue(e);return e.words||("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackInt32Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsInt32Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackInt16Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsInt16Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackUint16Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsUint16Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])}},"object access",{isBytes:function(e){return"number"!=typeof e&&e.isBytes()},isWords:function(e){return"number"!=typeof e&&e.isWords()},isWordsOrBytes:function(e){return"number"!=typeof e&&e.isWordsOrBytes()},isPointers:function(e){return"number"!=typeof e&&e.isPointers()},isIntegerValue:function(e){return"number"==typeof e&&-1073741824<=e&&e<=1073741823},isArray:function(e){return e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]},isMemberOf:function(e,t){var i=e.sqClass.pointers[Squeak.Class_name].bytes;if(t.length!==i.length)return!1;for(var r=0;r=e.pointers.length)return this.successFlag=!1;e.pointers[t]=i}},"constant access",{isKindOfInteger:function(e){return"number"==typeof e||e.sqClass==this.classLargeNegativeInteger()||e.sqClass==this.classLargePositiveInteger()},classArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassArray]},classBitmap:function(){return this.vm.specialObjects[Squeak.splOb_ClassBitmap]},classSmallInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassInteger]},classLargePositiveInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger]},classLargeNegativeInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargeNegativeInteger]},classPoint:function(){return this.vm.specialObjects[Squeak.splOb_ClassPoint]},classString:function(){return this.vm.specialObjects[Squeak.splOb_ClassString]},classByteArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassByteArray]},nilObject:function(){return this.vm.nilObj},falseObject:function(){return this.vm.falseObj},trueObject:function(){return this.vm.trueObj}},"vm functions",{clone:function(e){return this.vm.image.clone(e)},instantiateClassindexableSize:function(e,t){return this.vm.instantiateClass(e,t)},methodArgumentCount:function(){return this.argCount},makePointwithxValueyValue:function(e,t){return this.vm.primHandler.makePointWithXandY(e,t)},pushRemappableOop:function(e){this.remappableOops.push(e)},popRemappableOop:function(){return this.remappableOops.pop()},showDisplayBitsLeftTopRightBottom:function(e,t,i,r,s){t>5,!0);if(6===e)return i.send(this.method.methodGetLiteral(63&r),r>>6,!1)}return 7===e?i.doPop():8===e?i.doDup():9===e?i.pushActiveContext():(r=this.method.bytes[this.pc++],10===e?r<128?i.pushNewArray(r):i.popIntoNewArray(r-128):(a=this.method.bytes[this.pc++],11===e?i.callPrimitive(r+256*a):12===e?i.pushRemoteTemp(r,a):13===e?i.storeIntoRemoteTemp(r,a):14===e?i.popIntoRemoteTemp(r,a):(n=this.method.bytes[this.pc++],i.pushClosureCopy(r>>4,15&r,256*a+n))))}}),Squeak.InstructionStream.subclass("Squeak.InstructionStreamSista","decoding",{interpretNextInstructionFor:function(e){return this.interpretNextInstructionExtFor(e,0,0)},interpretNextInstructionExtFor:function(e,t,i){this.Squeak;var r=this.method.bytes[this.pc++];switch(r){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return e.pushReceiverVariable(15&r);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return e.pushLiteralVariable(this.method.methodGetLiteral(15&r));case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return e.pushConstant(this.method.methodGetLiteral(31&r));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return e.pushTemporaryVariable(15&r);case 72:case 73:case 74:case 75:return e.pushTemporaryVariable(8+(3&r));case 76:return e.pushReceiver();case 77:return e.pushConstant(this.vm.trueObj);case 78:return e.pushConstant(this.vm.falseObj);case 79:return e.pushConstant(this.vm.nilObj);case 80:return e.pushConstant(0);case 81:return e.pushConstant(1);case 82:return e.pushActiveContext();case 83:return e.doDup();case 88:return e.methodReturnReceiver();case 89:return e.methodReturnConstant(this.vm.trueObj);case 90:return e.methodReturnConstant(this.vm.falseObj);case 91:return e.methodReturnConstant(this.vm.nilObj);case 92:return e.methodReturnTop();case 93:return e.blockReturnConstant(this.vm.nilObj);case 94:if(0===t)return e.blockReturnTop();break;case 95:return e.nop();case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return e.send(this.vm.specialSelectors[2*(r-96)],this.vm.specialSelectors[2*(r-96)+1],!1);case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return e.send(this.method.methodGetLiteral(15&r),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return e.send(this.method.methodGetLiteral(15&r),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return e.send(this.method.methodGetLiteral(15&r),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return e.jump(1+(7&r));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return e.jumpIf(!0,1+(7&r));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return e.jumpIf(!1,1+(7&r));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return e.popIntoReceiverVariable(7&r);case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return e.popIntoTemporaryVariable(r-208);case 216:return e.doPop()}var s=this.method.bytes[this.pc++];switch(r){case 224:return this.interpretNextInstructionExtFor(e,(t<<8)+s,i);case 225:return this.interpretNextInstructionExtFor(e,t,(i<<8)+(s<128?s:s-256));case 226:return e.pushReceiverVariable(s+(t<<8));case 227:return e.pushLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 228:return e.pushConstant(this.method.methodGetLiteral(s+(t<<8)));case 229:return e.pushTemporaryVariable(s);case 231:return s<128?e.pushNewArray(s):e.popIntoNewArray(s-128);case 232:return e.pushConstant(s+(i<<8));case 233:return e.pushConstant("$"+s+(i<<8));case 234:return e.send(this.method.methodGetSelector((s>>3)+(t<<5)),(7&s)+(i<<3),!1);case 235:var n=this.method.methodGetSelector((s>>3)+(t<<5));return 64<=i?e.sendSuperDirected(n):e.send(n,(7&s)+(i<<3),!0);case 237:return e.jump(s+(i<<8));case 238:return e.jumpIf(!0,s+(i<<8));case 239:return e.jumpIf(!1,s+(i<<8));case 240:return e.popIntoReceiverVariable(s+(t<<8));case 241:return e.popIntoLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 242:return e.popIntoTemporaryVariable(s);case 243:return e.storeIntoReceiverVariable(s+(t<<8));case 244:return e.storeIntoLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 245:return e.storeIntoTemporaryVariable(s)}var a=this.method.bytes[this.pc++];switch(r){case 248:return e.callPrimitive(s+(a<<8));case 249:var o=s+(t<<8),u=63&a,l=this.method.methodGetLiteral(o);return e.pushFullClosure(o,u,l.methodNumArgs());case 250:o=(7&s)+8*this.mod(t,16),u=(s>>3&7)+8*this.div(t,16);return e.pushClosureCopy(u,o,a+(i<<8));case 251:return e.pushRemoteTemp(s,a);case 252:return e.storeIntoRemoteTemp(s,a);case 253:return e.popIntoRemoteTemp(s,a)}throw Error("Unknown bytecode: "+r)}}),Object.subclass("Squeak.InstructionPrinter","initialization",{initialize:function(e,t){this.method=e,this.vm=t}},"printing",{printInstructions:function(e,t,i){this.indent=e,this.highlight=t,this.highlightPC=i,this.innerIndents={},this.result="",this.scanner=new(this.method.methodSignFlag()?Squeak.InstructionStreamSista:Squeak.InstructionStream)(this.method,this.vm),this.oldPC=this.scanner.pc,this.endPC=0,this.done=!1;try{for(;!this.done;)this.scanner.interpretNextInstructionFor(this)}catch(e){this.print("!!! "+e.message)}return this.result},print:function(e){this.oldPC===this.highlightPC?this.highlight&&(this.result+=this.highlight):this.indent&&(this.result+=this.indent),this.result+=this.oldPC;for(var t=0;tthis.oldPC&&(this.result+=" "),this.result+=(this.method.bytes[t]+256).toString(16).substr(-2).toUpperCase();this.result+="> "+e+"\n",this.oldPC=this.scanner.pc}},"decoding",{blockReturnConstant:function(e){this.print("blockReturn: "+e.toString())},blockReturnTop:function(){this.print("blockReturn")},doDup:function(){this.print("dup")},doPop:function(){this.print("pop")},jump:function(e){this.print("jumpTo: "+(this.scanner.pc+e)),this.scanner.pc+e>this.endPC&&(this.endPC=this.scanner.pc+e)},jumpIf:function(e,t){this.print((e?"jumpIfTrue: ":"jumpIfFalse: ")+(this.scanner.pc+t)),this.scanner.pc+t>this.endPC&&(this.endPC=this.scanner.pc+t)},methodReturnReceiver:function(){this.print("return: receiver"),this.done=this.scanner.pc>this.endPC},methodReturnTop:function(){this.print("return: topOfStack"),this.done=this.scanner.pc>this.endPC},methodReturnConstant:function(e){this.print("returnConst: "+e.toString()),this.done=this.scanner.pc>this.endPC},nop:function(){this.print("nop")},popIntoLiteralVariable:function(e){this.print("popIntoBinding: "+e.assnKeyAsString())},popIntoReceiverVariable:function(e){this.print("popIntoInstVar: "+e)},popIntoTemporaryVariable:function(e){this.print("popIntoTemp: "+e)},pushActiveContext:function(){this.print("push: thisContext")},pushConstant:function(e){e=e.sqInstName?e.sqInstName():e.toString();this.print("pushConst: "+e)},pushLiteralVariable:function(e){this.print("pushBinding: "+e.assnKeyAsString())},pushReceiver:function(){this.print("push: self")},pushReceiverVariable:function(e){this.print("pushInstVar: "+e)},pushTemporaryVariable:function(e){this.print("pushTemp: "+e)},send:function(e,t,i){this.print((i?"superSend: #":"send: #")+(e.bytesAsString?e.bytesAsString():e))},sendSuperDirected:function(e){this.print("directedSuperSend: #"+(e.bytesAsString?e.bytesAsString():e))},storeIntoLiteralVariable:function(e){this.print("storeIntoBinding: "+e.assnKeyAsString())},storeIntoReceiverVariable:function(e){this.print("storeIntoInstVar: "+e)},storeIntoTemporaryVariable:function(e){this.print("storeIntoTemp: "+e)},pushNewArray:function(e){this.print("push: (Array new: "+e+")")},popIntoNewArray:function(e){this.print("pop: "+e+" into: (Array new: "+e+")")},pushRemoteTemp:function(e,t){this.print("push: "+e+" ofTemp: "+t)},storeIntoRemoteTemp:function(e,t){this.print("storeInto: "+e+" ofTemp: "+t)},popIntoRemoteTemp:function(e,t){this.print("popInto: "+e+" ofTemp: "+t)},pushClosureCopy:function(e,t,i){var r=this.scanner.pc,s=r+i;this.print("closure("+r+"-"+(s-1)+"): "+e+" copied, "+t+" args");for(var n=r;nthis.endPC&&(this.endPC=s)},pushFullClosure:function(e,t,i){this.print("pushFullClosure: (self literalAt: "+e+") numCopied: "+t+" numArgs: "+i)},callPrimitive:function(e){this.print("primitive: "+e)}}),Object.subclass("Squeak.Primitives","initialization",{initialize:function(e,t){this.vm=e,this.oldPrims=!this.vm.image.hasClosures,this.allowAccessBeyondSP=this.oldPrims,this.deferDisplayUpdates=!1,this.semaphoresToSignal=[],this.initDisplay(t),this.initAtCache(),this.initModules(),this.initPlugins(),e.image.isSpur&&(this.charFromInt=this.charFromIntSpur,this.charToInt=this.charToIntSpur,this.identityHash=this.identityHashSpur)},initDisplay:function(e){this.display=e},initModules:function(){this.loadedModules={},this.builtinModules={},this.patchModules={},this.interpreterProxy=new Squeak.InterpreterProxy(this.vm)},initPlugins:function(){}},"dispatch",{quickSendOther:function(e,t){switch(this.success=!0,t){case 0:return this.popNandPushIfOK(2,this.objectAt(!0,!0,!1));case 1:return this.popNandPushIfOK(3,this.objectAtPut(!0,!0,!1));case 2:return this.popNandPushIfOK(1,this.objectSize(!0));case 6:return this.popNandPushBoolIfOK(2,this.vm.stackValue(1)===this.vm.stackValue(0));case 7:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 8:return this.popNandPushIfOK(2,this.doBlockCopy());case 9:return this.primitiveBlockValue(0);case 10:return this.primitiveBlockValue(1)}return!1},doPrimitive:function(e,t,i){switch(this.success=!0,e){case 1:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)+this.stackInteger(0));case 2:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)-this.stackInteger(0));case 3:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)this.stackInteger(0));case 5:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)<=this.stackInteger(0));case 6:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)>=this.stackInteger(0));case 7:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)===this.stackInteger(0));case 8:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)!==this.stackInteger(0));case 9:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)*this.stackInteger(0));case 10:return this.popNandPushIntIfOK(t+1,this.vm.quickDivide(this.stackInteger(1),this.stackInteger(0)));case 11:return this.popNandPushIntIfOK(t+1,this.vm.mod(this.stackInteger(1),this.stackInteger(0)));case 12:return this.popNandPushIntIfOK(t+1,this.vm.div(this.stackInteger(1),this.stackInteger(0)));case 13:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)/this.stackInteger(0)|0);case 14:return this.popNandPushIfOK(t+1,this.doBitAnd());case 15:return this.popNandPushIfOK(t+1,this.doBitOr());case 16:return this.popNandPushIfOK(t+1,this.doBitXor());case 17:return this.popNandPushIfOK(t+1,this.doBitShift());case 18:return this.primitiveMakePoint(t,!1);case 19:return!1;case 20:return this.vm.warnOnce("missing primitive: 20 (primitiveRemLargeIntegers)"),!1;case 21:return this.vm.warnOnce("missing primitive: 21 (primitiveAddLargeIntegers)"),!1;case 22:return this.vm.warnOnce("missing primitive: 22 (primitiveSubtractLargeIntegers)"),!1;case 23:return this.primitiveLessThanLargeIntegers(t);case 24:return this.primitiveGreaterThanLargeIntegers(t);case 25:return this.primitiveLessOrEqualLargeIntegers(t);case 26:return this.primitiveGreaterOrEqualLargeIntegers(t);case 27:return this.primitiveEqualLargeIntegers(t);case 28:return this.primitiveNotEqualLargeIntegers(t);case 29:return this.vm.warnOnce("missing primitive: 29 (primitiveMultiplyLargeIntegers)"),!1;case 30:return this.vm.warnOnce("missing primitive: 30 (primitiveDivideLargeIntegers)"),!1;case 31:return this.vm.warnOnce("missing primitive: 31 (primitiveModLargeIntegers)"),!1;case 32:return this.vm.warnOnce("missing primitive: 32 (primitiveDivLargeIntegers)"),!1;case 33:return this.vm.warnOnce("missing primitive: 33 (primitiveQuoLargeIntegers)"),!1;case 34:return this.vm.warnOnce("missing primitive: 34 (primitiveBitAndLargeIntegers)"),!1;case 35:return this.vm.warnOnce("missing primitive: 35 (primitiveBitOrLargeIntegers)"),!1;case 36:return this.vm.warnOnce("missing primitive: 36 (primitiveBitXorLargeIntegers)"),!1;case 37:return this.vm.warnOnce("missing primitive: 37 (primitiveBitShiftLargeIntegers)"),!1;case 38:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 39:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 40:return this.popNandPushFloatIfOK(t+1,this.stackInteger(0));case 41:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)+this.stackFloat(0));case 42:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)-this.stackFloat(0));case 43:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)this.stackFloat(0));case 45:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)<=this.stackFloat(0));case 46:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)>=this.stackFloat(0));case 47:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)===this.stackFloat(0));case 48:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)!==this.stackFloat(0));case 49:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)*this.stackFloat(0));case 50:return this.popNandPushFloatIfOK(t+1,this.safeFDiv(this.stackFloat(1),this.stackFloat(0)));case 51:return this.popNandPushIfOK(t+1,this.floatAsSmallInt(this.stackFloat(0)));case 52:return this.popNandPushFloatIfOK(t+1,this.floatFractionPart(this.stackFloat(0)));case 53:return this.popNandPushIntIfOK(t+1,this.frexp_exponent(this.stackFloat(0))-1);case 54:return this.popNandPushFloatIfOK(t+1,this.ldexp(this.stackFloat(1),this.stackFloat(0)));case 55:return this.popNandPushFloatIfOK(t+1,Math.sqrt(this.stackFloat(0)));case 56:return this.popNandPushFloatIfOK(t+1,Math.sin(this.stackFloat(0)));case 57:return this.popNandPushFloatIfOK(t+1,Math.atan(this.stackFloat(0)));case 58:return this.popNandPushFloatIfOK(t+1,Math.log(this.stackFloat(0)));case 59:return this.popNandPushFloatIfOK(t+1,Math.exp(this.stackFloat(0)));case 60:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 61:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 62:return this.popNandPushIfOK(t+1,this.objectSize(!1));case 63:return this.popNandPushIfOK(t+1,this.objectAt(!1,!0,!1));case 64:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!0,!1));case 65:return this.vm.warnOnce("missing primitive: 65 (primitiveNext)"),!1;case 66:return this.vm.warnOnce("missing primitive: 66 (primitiveNextPut)"),!1;case 67:return this.vm.warnOnce("missing primitive: 67 (primitiveAtEnd)"),!1;case 68:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 69:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 70:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(0),0));case 71:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(1),this.stackPos32BitInt(0)));case 72:return this.primitiveArrayBecome(t,!1,!0);case 73:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 74:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 75:return this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0)));case 76:return this.primitiveStoreStackp(t);case 77:return this.popNandPushIfOK(t+1,this.someInstanceOf(this.stackNonInteger(0)));case 78:return this.popNandPushIfOK(t+1,this.nextInstanceAfter(this.stackNonInteger(0)));case 79:return this.primitiveNewMethod(t);case 80:return this.popNandPushIfOK(t+1,this.doBlockCopy());case 81:return this.primitiveBlockValue(t);case 82:return this.primitiveBlockValueWithArgs(t);case 83:return this.vm.primitivePerform(t);case 84:return this.vm.primitivePerformWithArgs(t,!1);case 85:return this.primitiveSignal();case 86:return this.primitiveWait();case 87:return this.primitiveResume();case 88:return this.primitiveSuspend();case 89:return this.vm.flushMethodCache();case 90:return this.primitiveMousePoint(t);case 91:return this.primitiveTestDisplayDepth(t);case 92:return this.vm.warnOnce("missing primitive: 92 (primitiveSetDisplayMode)"),!1;case 93:return this.primitiveInputSemaphore(t);case 94:return this.primitiveGetNextEvent(t);case 95:return this.primitiveInputWord(t);case 96:return this.namedPrimitive("BitBltPlugin","primitiveCopyBits",t);case 97:return this.primitiveSnapshot(t);case 98:return this.primitiveStoreImageSegment(t);case 99:return this.primitiveLoadImageSegment(t);case 100:return this.vm.primitivePerformWithArgs(t,!0);case 101:return this.primitiveBeCursor(t);case 102:return this.primitiveBeDisplay(t);case 103:return this.primitiveScanCharacters(t);case 104:return this.vm.warnOnce("missing primitive: 104 (primitiveDrawLoop)"),!1;case 105:return this.popNandPushIfOK(t+1,this.doStringReplace());case 106:return this.primitiveScreenSize(t);case 107:return this.primitiveMouseButtons(t);case 108:return this.primitiveKeyboardNext(t);case 109:return this.primitiveKeyboardPeek(t);case 110:return this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(t+1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(t+1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(t);case 114:return this.primitiveExitToDebugger(t);case 115:return this.primitiveChangeClass(t);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(t,i);case 118:return this.primitiveDoPrimitiveWithArgs(t);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return this.primitiveCalloutToFFI(t,i);case 121:return this.primitiveImageName(t);case 122:return this.primitiveReverseDisplay(t);case 123:return this.vm.warnOnce("missing primitive: 123 (primitiveValueUninterruptably)"),!1;case 124:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(t+1,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(t);case 127:return this.primitiveShowDisplayRect(t);case 128:return this.primitiveArrayBecome(t,!0,!0);case 129:return this.popNandPushIfOK(t+1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(t);case 131:return this.primitivePartialGC(t);case 132:return this.popNandPushBoolIfOK(t+1,this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return this.popNIfOK(t);case 134:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(t+1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(t);case 137:return this.popNandPushIfOK(t+1,this.secondClock());case 138:return this.popNandPushIfOK(t+1,this.someObject());case 139:return this.popNandPushIfOK(t+1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(t);case 141:return this.primitiveClipboardText(t);case 142:return this.popNandPushIfOK(t+1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(t);case 145:return this.primitiveConstantFill(t);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",t);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",t);case 148:return this.popNandPushIfOK(t+1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(t);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(t);case 151:if(this.oldPrims)return this.primitiveFileClose(t);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(t);case 153:if(this.oldPrims)return this.primitiveFileOpen(t);case 154:if(this.oldPrims)return this.primitiveFileRead(t);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(t);case 156:if(this.oldPrims)return this.primitiveFileDelete(t);case 157:if(this.oldPrims)return this.primitiveFileSize(t);break;case 158:return this.oldPrims?this.primitiveFileWrite(t):(this.vm.warnOnce("missing primitive: 158 (primitiveCompareWith)"),!1);case 159:return this.oldPrims?this.primitiveFileRename(t):this.popNandPushIntIfOK(t+1,1664525*this.stackSigned53BitInt(0)&268435455);case 160:return this.oldPrims?this.primitiveDirectoryCreate(t):this.primitiveAdoptInstance(t);case 161:return this.oldPrims?this.primitiveDirectoryDelimitor(t):(this.vm.warnOnce("missing primitive: 161 (primitiveSetIdentityHash)"),!1);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(t);break;case 163:return this.oldPrims?this.primitiveDirectoryDelete(t):(this.vm.warnOnce("missing primitive: 163 (primitiveGetImmutability)"),!1);case 164:return this.popNandPushIfOK(t+1,this.vm.trueObj);case 165:case 166:return this.primitiveIntegerAtAndPut(t);case 167:return!1;case 168:return this.primitiveCopyObject(t);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(t):this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)!==this.vm.stackValue(0));case 170:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStart",t):this.primitiveAsCharacter(t);case 171:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",t):this.popNandPushIfOK(t+1,this.stackNonInteger(0).hash);case 172:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStop",t):(this.vm.warnOnce("missing primitive: 172 (primitiveFetchMourner)"),this.popNandPushIfOK(t,this.vm.nilObj));case 173:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 174:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 175:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySilence",t):this.vm.image.isSpur?this.popNandPushIfOK(t+1,this.behaviorHash(this.stackNonInteger(0))):(this.vm.warnOnce("primitive 175 called in non-spur image"),this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0))));case 176:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primWaveTableSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.vm.image.isSpur?4194303:4095);case 177:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primFMSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.allInstancesOf(this.stackNonInteger(0)));case 178:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primPluckedSoundmixSampleCountintostartingAtpan",t):!1;case 179:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primSampledSoundmixSampleCountintostartingAtpan",t);break;case 180:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixFMSound",t):!1;case 181:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixPluckedSound",t):this.primitiveSizeInBytesOfInstance(t);case 182:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol",t):this.primitiveSizeInBytes(t);case 183:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveApplyReverb",t):this.primitiveIsPinned(t);case 184:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixLoopedSampledSound",t):this.primitivePin(t);case 185:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixSampledSound",t):this.primitiveExitCriticalSection(t);case 186:if(this.oldPrims)break;return this.primitiveEnterCriticalSection(t);case 187:if(this.oldPrims)break;return this.primitiveTestAndSetOwnershipOfCriticalSection(t);case 188:if(this.oldPrims)break;return this.primitiveExecuteMethodArgsArray(t);case 189:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundInsertSamples",t):!1;case 190:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartRecording",t);case 191:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStopRecording",t);case 192:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundGetRecordingSampleRate",t);case 193:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundRecordSamples",t);case 194:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundSetRecordLevel",t);break;case 195:case 196:case 197:case 198:case 199:return!1;case 200:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveInitializeNetwork",t):this.primitiveClosureCopyWithCopiedValues(t);case 201:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartNameLookup",t):this.primitiveClosureValue(t);case 202:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverNameLookupResult",t):this.primitiveClosureValue(t);case 203:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartAddressLookup",t):this.primitiveClosureValue(t);case 204:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAddressLookupResult",t):this.primitiveClosureValue(t);case 205:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAbortLookup",t):this.primitiveClosureValue(t);case 206:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverLocalAddress",t):this.primitiveClosureValueWithArgs(t);case 207:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStatus",t):this.primitiveFullClosureValue(t);case 208:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverError",t):this.primitiveFullClosureValueWithArgs(t);case 209:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketCreate",t):this.primitiveFullClosureValueNoContextSwitch(t);case 210:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketDestroy",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 211:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketConnectionStatus",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 212:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketError",t):this.popNandPushIfOK(t+1,this.objectSize(!1));case 213:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalAddress",t);case 214:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalPort",t);case 215:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemoteAddress",t);case 216:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemotePort",t);case 217:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketConnectToPort",t);case 218:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketListenWithOrWithoutBacklog",t):(this.vm.warnOnce("missing primitive: 218 (tryNamedPrimitiveInForWithArgs"),!1);case 219:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCloseConnection",t);case 220:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAbortConnection",t);break;case 221:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataBufCount",t):this.primitiveClosureValueNoContextSwitch(t);case 222:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataAvailable",t):this.primitiveClosureValueNoContextSwitch(t);case 223:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDataBufCount",t);case 224:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDone",t);case 225:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAccept",t);break;case 230:return this.primitiveRelinquishProcessorForMicroseconds(t);case 231:return this.primitiveForceDisplayUpdate(t);case 232:return this.vm.warnOnce("missing primitive: 232 (primitiveFormPrint)"),!1;case 233:return this.primitiveSetFullScreen(t);case 234:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveDecompressFromByteArray",t);case 235:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompareString",t);case 236:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveConvert8BitSigned",t);case 237:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompressToByteArray",t);case 238:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortOpen",t);case 239:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortClose",t);break;case 240:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortWrite",t):this.popNandPushIfOK(t+1,this.microsecondClockUTC());case 241:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortRead",t):this.popNandPushIfOK(t+1,this.microsecondClockLocal());case 242:if(this.oldPrims)break;return this.primitiveSignalAtUTCMicroseconds(t);case 243:return this.oldPrims?this.namedPrimitive("MiscPrimitivePlugin","primitiveTranslateStringWithTable",t):(this.vm.warnOnce("missing primitive: 243 (primitiveUpdateTimeZone)"),!1);case 244:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindFirstInString",t);case 245:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveIndexOfAsciiInString",t);case 246:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindSubstring",t);break;case 248:return this.primitiveArrayBecome(t,!1,!1);case 249:return this.primitiveArrayBecome(t,!1,!0);case 254:return this.primitiveVMParameter(t);case 521:return this.namedPrimitive("MIDIPlugin","primitiveMIDIClosePort",t);case 522:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetClock",t);case 523:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortCount",t);case 524:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortDirectionality",t);case 525:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortName",t);case 526:return this.namedPrimitive("MIDIPlugin","primitiveMIDIOpenPort",t);case 527:return this.namedPrimitive("MIDIPlugin","primitiveMIDIParameterGetOrSet",t);case 528:return this.namedPrimitive("MIDIPlugin","primitiveMIDIRead",t);case 529:return this.namedPrimitive("MIDIPlugin","primitiveMIDIWrite",t);case 550:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeMono",t);case 551:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeStereo",t);case 552:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeMono",t);case 553:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeStereo",t);case 571:return this.primitiveUnloadModule(t);case 572:return this.primitiveListBuiltinModule(t);case 573:return this.primitiveListLoadedModule(t);case 575:return this.vm.warnOnce("missing primitive: 575 (primitiveHighBit)"),!1;case 576:return this.vm.primitiveInvokeObjectAsMethod(t,i);case 578:return this.vm.warnOnce("missing primitive: 578 (primitiveSuspendAndBackupPC)"),!1}return console.error("primitive "+e+" not implemented yet"),!1},namedPrimitive:function(e,t,i){var r,s=""===e?this:this.loadedModules[e],n=(void 0===s&&(s=this.loadModule(e),this.loadedModules[e]=s),!1),a=this.vm.sp;return s?(this.interpreterProxy.argCount=i,"function"==typeof(r=s[this.interpreterProxy.primitiveName=t])?n=s[t](i):"string"==typeof r?n=this[r](i):this.vm.warnOnce("missing primitive: "+e+"."+t)):this.vm.warnOnce("missing module: "+e+" ("+t+")"),(!0===n||!1!==n&&this.success)&&this.vm.sp!==a-i&&!this.vm.frozen&&this.vm.warnOnce("stack unbalanced after primitive "+e+"."+t,"error"),!0===n||!1===n?n:this.success},doNamedPrimitive:function(e,t){if(t.pointersSize()<2)return!1;var i=t.pointers[1];if(4!==i.pointersSize())return!1;this.primMethod=t;t=i.pointers[0].bytesAsString(),i=i.pointers[1].bytesAsString();return this.namedPrimitive(t,i,e)},fakePrimitive:function(e,t,i){return this.vm.warnOnce("faking primitive: "+e),void 0===t?this.vm.popN(i):this.vm.popNandPush(i+1,this.makeStObject(t)),!0}},"modules",{loadModule:function(e){var t,i=Squeak.externalModules[e]||this.builtinModules[e]||this.loadModuleDynamically(e);return i?(this.patchModules[e]&&this.patchModule(i,e),i.setInterpreter&&!i.setInterpreter(this.interpreterProxy)?(console.log("Wrong interpreter proxy version: "+e),null):("function"==typeof(t=i.initialiseModule)?i.initialiseModule():"string"==typeof t&&this[t](),this.interpreterProxy.failed()?(console.log("Module initialization failed: "+e),null):(i.getModuleName&&(e=i.getModuleName()),console.log("Loaded module: "+e),i))):null},loadModuleDynamically:function(e){},patchModule:function(e,t){var i,r=this.patchModules[t];for(i in r)e[i]=r[i]},unloadModule:function(e){var t=this.loadedModules[e];if(!e||!t||t===this)return null;delete this.loadedModules[e];var i=t.unloadModule;return"function"==typeof i?t.unloadModule(this):"string"==typeof i&&this[i](this),console.log("Unloaded module: "+e),t},loadFunctionFrom:function(e,t){var i=""===t?this:this.loadedModules[t];if(void 0===i&&(i=this.loadModule(t),this.loadedModules[t]=i),i){var r=i[e];if("function"==typeof r)return r.bind(i);if("string"==typeof r)return this[r].bind(this);this.vm.warnOnce("missing primitive: "+t+"."+e)}return null},primitiveUnloadModule:function(e){var t=this.stackNonInteger(0).bytesAsString();return!!t&&(this.unloadModule(t),this.popNIfOK(e))},primitiveListBuiltinModule:function(e){var t,i=this.stackInteger(0)-1;return!!this.success&&(t=Object.keys(this.builtinModules),this.popNandPushIfOK(e+1,this.makeStObject(t[i])))},primitiveListLoadedModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var i,r=[];for(i in this.loadedModules){var s=this.loadedModules[i];s&&(s=s.getModuleName?s.getModuleName():i,r.push(s))}return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))}},"stack access",{popNIfOK:function(e){return!!this.success&&(this.vm.popN(e),!0)},pop2andPushBoolIfOK:function(e){return this.vm.success=this.success,this.vm.pop2AndPushBoolResult(e)},popNandPushBoolIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,t?this.vm.trueObj:this.vm.falseObj),!0)},popNandPushIfOK:function(e,t){return!(!this.success||null==t||(this.vm.popNandPush(e,t),0))},popNandPushIntIfOK:function(e,t){return!(!this.success||!this.vm.canBeSmallInt(t)||(this.vm.popNandPush(e,t),0))},popNandPushFloatIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,this.makeFloat(t)),!0)},stackNonInteger:function(e){return this.checkNonInteger(this.vm.stackValue(e))},stackInteger:function(e){return this.checkSmallInt(this.vm.stackValue(e))},stackPos32BitInt:function(e){return this.positive32BitValueOf(this.vm.stackValue(e))},pos32BitIntFor:function(e){if(0<=e&&e<=Squeak.MaxSmallInt)return e;for(var t=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],t=this.vm.instantiateClass(t,4),i=t.bytes,r=0;r<4;r++)i[r]=e>>>8*r&255;return t},pos53BitIntFor:function(e){if(e<=4294967295)return this.pos32BitIntFor(e);if(9007199254740991=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return e;for(var t=e<0,i=t?-e:e,e=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,t=this.vm.instantiateClass(this.vm.specialObjects[e],4),r=t.bytes,s=0;s<4;s++)r[s]=i>>>8*s&255;return t},stackFloat:function(e){return this.checkFloat(this.vm.stackValue(e))},stackBoolean:function(e){return this.checkBoolean(this.vm.stackValue(e))},stackSigned53BitInt:function(e){e=this.vm.stackValue(e);if("number"==typeof e)return e;var t=e.bytesSize();if(t<=7){for(var i=e.bytes,r=0,s=0,n=1;s>>20&2047)&&(t.setFloat64(0,e*Math.pow(2,64)),i=(t.getUint32(0)>>>20&2047)-64),i-1022)},ldexp:function(e,t){for(var i=Math.min(3,Math.ceil(Math.abs(t)/1023)),r=e,s=0;sthis.stackSigned53BitInt(0))},primitiveLessOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)<=this.stackSigned53BitInt(0))},primitiveGreaterOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)>=this.stackSigned53BitInt(0))},primitiveEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)===this.stackSigned53BitInt(0))},primitiveNotEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)!==this.stackSigned53BitInt(0))}},"utils",{floatOrInt:function(e){return e.isFloat?e.float:"number"==typeof e?e:0},positive32BitValueOf:function(e){if("number"==typeof e)return 0<=e?e:(this.success=!1,0);if(!this.isA(e,Squeak.splOb_ClassLargePositiveInteger)||4!==e.bytesSize())return this.success=!1,0;for(var t=e.bytes,i=0,r=0,s=1;r<4;r++,s*=256)i+=t[r]*s;return i},checkFloat:function(e){return e.isFloat?e.float:"number"==typeof e?e:(this.success=!1,0)},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,0)},checkNonInteger:function(e){return"number"!=typeof e?e:(this.success=!1,this.vm.nilObj)},checkBoolean:function(e){return!!e.isTrue||!e.isFalse&&(this.success=!1)},indexableSize:function(e){return"number"==typeof e?-1:e.indexableSize(this)},isA:function(e,t){return e.sqClass===this.vm.specialObjects[t]},isKindOf:function(e,t){for(var i=e.sqClass,r=this.vm.specialObjects[t];!i.isNil;){if(i===r)return!0;i=i.pointers[Squeak.Class_superclass]}return!1},isAssociation:function(e){return"number"!=typeof e&&2==e.pointersSize()},ensureSmallInt:function(e){return e===(0|e)&&this.vm.canBeSmallInt(e)?e:(this.success=!1,0)},charFromInt:function(e){var t,i=this.vm.specialObjects[Squeak.splOb_CharacterTable].pointers[e];return i||(t=this.vm.specialObjects[Squeak.splOb_ClassCharacter],(i=this.vm.instantiateClass(t,0)).pointers[0]=e),i},charFromIntSpur:function(e){return this.vm.image.getCharacter(e)},charToInt:function(e){return e.pointers[0]},charToIntSpur:function(e){return e.hash},makeFloat:function(e){var t=this.vm.specialObjects[Squeak.splOb_ClassFloat],t=this.vm.instantiateClass(t,2);return t.float=e,t},makeLargeIfNeeded:function(e){return this.vm.canBeSmallInt(e)?e:this.makeLargeInt(e)},makeLargeInt:function(e){if(e<0)throw Error("negative large ints not implemented yet");if(4294967295r.size?(this.success=!1,s):i?s.pointers[n-1]:s.isPointers()?s.pointers[n-1+r.ivarOffset]:s.isWords()?r.convertChars?this.charFromInt(1073741823&s.words[n-1]):this.pos32BitIntFor(s.words[n-1]):s.isBytes()?r.convertChars?this.charFromInt(255&s.bytes[n-1]):255&s.bytes[n-1]:n-1-(e=4*s.pointersSize())<0?(this.success=!1,s):255&s.bytes[n-1-e]},objectAtPut:function(e,t,i){var r,s=this.stackNonInteger(2),n=this.stackPos32BitInt(1);if(!this.success)return s;if(e){if((r=this.atPutCache[s.hash&this.atCacheMask]).array!==s)return this.success=!1,s}else{if(s.isFloat)return e=this.stackPos32BitInt(0),!this.success||1!=n&&2!=n?this.success=!1:((o=s.floatData()).setUint32(1==n?0:4,e,!1),s.float=o.getFloat64(0)),this.vm.stackValue(0);r=this.makeAtCacheInfo(this.atPutCache,this.vm.specialSelectors[34],s,t,i)}if(n<1||n>r.size)return this.success=!1,s;var a,e=this.vm.stackValue(0);if(i)return s.dirty=!0,s.pointers[n-1]=e;if(s.isPointers())return s.dirty=!0,s.pointers[n-1+r.ivarOffset]=e;if(s.isWords()){if(t){if(e.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,e;if("number"!=typeof(a=this.charToInt(e)))return this.success=!1,e}else a=this.stackPos32BitInt(0);this.success&&(s.words[n-1]=a)}else{if(t){if(e.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,e;if("number"!=typeof(a=this.charToInt(e)))return this.success=!1,e}else{if("number"!=typeof e)return this.success=!1,e;a=e}if(a<0||255this.vm.image.bytesLeft()?(console.warn("squeak: out of memory, failing allocation"),this.success=!1,this.vm.primFailCode=Squeak.PrimErrNoMemory,null):this.vm.instantiateClass(e,t)},someObject:function(){return this.vm.image.firstOldObject},nextObject:function(e){return this.vm.image.objectAfter(e)||0},someInstanceOf:function(e){e=this.vm.image.someInstanceOf(e);return e||(this.success=!1,0)},nextInstanceAfter:function(e){e=this.vm.image.nextInstanceAfter(e);return e||(this.success=!1,0)},allInstancesOf:function(e){var e=this.vm.image.allInstancesOf(e),t=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],e.length);return t.pointers=e,t},identityHash:function(e){return e.hash},identityHashSpur:function(e){var t=e.hash;return 0=t.pointers.length)return!1;for(var r=t.pointers[Squeak.Context_stackPointer];r=s)){this.vm.popN(2);for(var n=0;n=i.length)return!1;if(e<2)t=i[r];else{if((t=this.stackInteger(0))<-32768||32767=i.length)return!1;if(e<2)t=this.signed32BitIntegerFor(i[r]);else{if(t=this.stackSigned32BitInt(0),!this.success)return!1;i[r]=t}return this.popNandPushIfOK(e+1,t),!0},primitiveConstantFill:function(e){var t=this.stackNonInteger(1),i=this.stackPos32BitInt(0);if(!this.success||!t.isWordsOrBytes())return!1;var r=t.words||t.bytes;if(r){if(r===t.bytes&&255t)s=i[t];else{if(!(t<0&&r&&r.length>-t-1))return!1;s=r[-t-1]}}return this.vm.popNandPush(e+1,this.makeStObject(s)),!0},setLowSpaceThreshold:function(){var e=this.stackInteger(0);return this.success&&(this.vm.lowSpaceThreshold=e),this.vm.stackValue(1)},primitiveVMParameter:function(e){var t=this.vm.image.isSpur?71:44;switch(e){case 0:for(var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t),r=0;r","<=",">=","=","~=","*","/","\\\\","@","bitShift:","//","bitAnd:","bitOr:","at:","at:put:","size","next","nextPut:","atEnd","==","class","blockCopy:","value","value:","do:","new","new:","x","y"],this.doitCounter=0}},"accessing",{compile:function(e,t,i){e.methodSignFlag()||(void 0===e.compiled?e.compiled=!1:(this.singleStep=!1,this.debug=this.comments,t=t&&t.className(),i=i&&i.bytesAsString(),e.compiled=this.generate(e,t,i)))},enableSingleStepping:function(r,s,n){var e,t,i;return r.compiled&&r.compiled.canSingleStep||(this.singleStep=!0,this.debug=!0,s||this.vm.allMethodsDo(function(e,t,i){if(t===r)return s=e,n=i,!0}),e=s&&s.className(),t=n&&n.bytesAsString(),i=s&&s.allInstVarNames(),r.compiled=this.generate(r,e,t,i),r.compiled.canSingleStep=!0),!0},functionNameFor:function(e,t){var i;return void 0===e||"?"===e?"DOIT_"+ ++this.doitCounter:/[^a-zA-Z0-9:_]/.test(t)?(i=t.replace(/./g,function(e){return{"|":"OR","~":"NOT","<":"LT","=":"EQ",">":"GT","&":"AND","@":"AT","*":"TIMES","+":"PLUS","\\":"MOD","-":"MINUS",",":"COMMA","/":"DIV","?":"IF"}[e]||"OPERATOR"}),e.replace(/[ ]/,"_")+"__"+i+"__"):(e+"_"+t).replace(/[: ]/g,"_")}},"generating",{generate:function(e,t,i,r){for(this.method=e,this.pc=0,this.endPC=0,this.prevPC=0,this.source=[],this.sourceLabels={},this.needsLabel={},this.sourcePos={},this.needsVar={},this.needsBreak=!1,t&&i&&this.source.push("// ",t,">>",i,"\n"),this.instVarNames=r,this.allVars=["context","stack","rcvr","inst[","temp[","lit["],this.sourcePos.context=this.source.length,this.source.push("var context = vm.activeContext;\n"),this.sourcePos.stack=this.source.length,this.source.push("var stack = context.pointers;\n"),this.sourcePos.rcvr=this.source.length,this.source.push("var rcvr = vm.receiver;\n"),this.sourcePos["inst["]=this.source.length,this.source.push("var inst = rcvr.pointers;\n"),this.sourcePos["temp["]=this.source.length,this.source.push("var temp = vm.homeContext.pointers;\n"),this.sourcePos["lit["]=this.source.length,this.source.push("var lit = vm.method.pointers;\n"),this.sourcePos["loop-start"]=this.source.length,this.source.push("while (true) switch (vm.pc) {\ncase 0:\n"),this.done=!1;!this.done;){var s=e.bytes[this.pc++],n=0;switch(248&s){case 0:case 8:this.generatePush("inst[",15&s,"]");break;case 16:case 24:this.generatePush("temp[",6+(15&s),"]");break;case 32:case 40:case 48:case 56:this.generatePush("lit[",1+(31&s),"]");break;case 64:case 72:case 80:case 88:this.generatePush("lit[",1+(31&s),"].pointers[1]");break;case 96:this.generatePopInto("inst[",7&s,"]");break;case 104:this.generatePopInto("temp[",6+(7&s),"]");break;case 112:switch(s){case 112:this.generatePush("rcvr");break;case 113:this.generatePush("vm.trueObj");break;case 114:this.generatePush("vm.falseObj");break;case 115:this.generatePush("vm.nilObj");break;case 116:this.generatePush("-1");break;case 117:this.generatePush("0");break;case 118:this.generatePush("1");break;case 119:this.generatePush("2")}break;case 120:switch(s){case 120:this.generateReturn("rcvr");break;case 121:this.generateReturn("vm.trueObj");break;case 122:this.generateReturn("vm.falseObj");break;case 123:this.generateReturn("vm.nilObj");break;case 124:this.generateReturn("stack[vm.sp]");break;case 125:this.generateBlockReturn();break;default:throw Error("unusedBytecode")}break;case 128:case 136:this.generateExtended(s);break;case 144:this.generateJump(1+(7&s));break;case 152:this.generateJumpIf(!1,1+(7&s));break;case 160:n=e.bytes[this.pc++],this.generateJump(256*((7&s)-4)+n);break;case 168:n=e.bytes[this.pc++],this.generateJumpIf(s<172,256*(3&s)+n);break;case 176:case 184:this.generateNumericOp(s);break;case 192:case 200:this.generateQuickPrim(s);break;case 208:case 216:this.generateSend("lit[",1+(15&s),"]",0,!1);break;case 224:case 232:this.generateSend("lit[",1+(15&s),"]",1,!1);break;case 240:case 248:this.generateSend("lit[",1+(15&s),"]",2,!1)}}r=this.functionNameFor(t,i);return this.singleStep?(this.debug&&this.source.push("// all valid PCs have a label;\n"),this.source.push("default: throw Error('invalid PC');\n}")):(this.sourcePos["loop-end"]=this.source.length,this.source.push("default: vm.interpretOne(true); return;\n}"),this.deleteUnneededLabels()),this.deleteUnneededVariables(),new Function("'use strict';\nreturn function "+r+"(vm) {\n"+this.source.join("")+"}")()},generateExtended:function(e){switch(e){case 128:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePush("inst[",63&t,"]");case 1:return void this.generatePush("temp[",6+(63&t),"]");case 2:return void this.generatePush("lit[",1+(63&t),"]");case 3:return void this.generatePush("lit[",1+(63&t),"].pointers[1]")}case 129:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generateStoreInto("inst[",63&t,"]");case 1:return void this.generateStoreInto("temp[",6+(63&t),"]");case 2:throw Error("illegal store into literal");case 3:return void this.generateStoreInto("lit[",1+(63&t),"].pointers[1]")}return;case 130:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePopInto("inst[",63&t,"]");case 1:return void this.generatePopInto("temp[",6+(63&t),"]");case 2:throw Error("illegal pop into literal");case 3:return void this.generatePopInto("lit[",1+(63&t),"].pointers[1]")}case 131:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!1);case 132:switch(t=this.method.bytes[this.pc++],i=this.method.bytes[this.pc++],t>>5){case 0:return void this.generateSend("lit[",1+i,"]",31&t,!1);case 1:return void this.generateSend("lit[",1+i,"]",31&t,!0);case 2:return void this.generatePush("inst[",i,"]");case 3:return void this.generatePush("lit[",1+i,"]");case 4:return void this.generatePush("lit[",1+i,"].pointers[1]");case 5:return void this.generateStoreInto("inst[",i,"]");case 6:return void this.generatePopInto("inst[",i,"]");case 7:return void this.generateStoreInto("lit[",1+i,"].pointers[1]")}case 133:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!0);case 134:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(63&t),"]",t>>6,!1);case 135:return void this.generateInstruction("pop","vm.sp--");case 136:return this.needsVar.stack=!0,void this.generateInstruction("dup","var dup = stack[vm.sp]; stack[++vm.sp] = dup");case 137:return this.needsVar.stack=!0,void this.generateInstruction("push thisContext","stack[++vm.sp] = vm.exportThisContext()");case 138:var t=this.method.bytes[this.pc++];return void this.generateClosureTemps(127&t,127>4,i<<8|r)}},generatePush:function(e,t,i,r,s){this.debug&&this.generateDebugCode("push",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push("stack[++vm.sp] = ",e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(";\n")},generateStoreInto:function(e,t,i,r,s){this.debug&&this.generateDebugCode("store into",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(" = stack[vm.sp];\n"),this.generateDirty(e,t)},generatePopInto:function(e,t,i,r,s){this.debug&&this.generateDebugCode("pop into",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(" = stack[vm.sp--];\n"),this.generateDirty(e,t)},generateReturn:function(e){this.debug&&this.generateDebugCode("return",e),this.generateLabel(),this.needsVar[e]=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(",e,"); return;\n"),this.needsBreak=!1,this.done=this.pc>this.endPC},generateBlockReturn:function(){this.debug&&this.generateDebugCode("block return"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(stack[vm.sp--], context.pointers[0]); return;\n"),this.needsBreak=!1},generateJump:function(e){var t=this.pc+e;this.debug&&this.generateDebugCode("jump to "+t),this.generateLabel(),this.needsVar.context=!0,this.source.push("vm.pc = ",t,"; "),e<0&&this.source.push("\nif (vm.interruptCheckCounter-- <= 0) {\n"," vm.checkForInterrupts();\n"," if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n","}\n"),this.singleStep&&this.source.push("\nif (vm.breakOutOfInterpreter) return;\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateJumpIf:function(e,t){t=this.pc+t;this.debug&&this.generateDebugCode("jump if "+e+" to "+t),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",e,"Obj) {vm.pc = ",t,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return; else "),this.source.push("continue}\n","else if (cond !== vm.",!e,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[16+(15&e)]),this.generateLabel(),e){case 192:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-1]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp]) === 'number' && b>0 && b<=a.pointers.length) {\n"," stack[--vm.sp] = a.pointers[b-1];","} else { var c = vm.primHandler.objectAt(true,true,false); if (vm.primHandler.success) stack[--vm.sp] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(16); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 193:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-2]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp-1]) === 'number' && b>0 && b<=a.pointers.length) {\n"," var c = stack[vm.sp]; stack[vm.sp-=2] = a.pointers[b-1] = c; a.dirty = true;","} else { vm.primHandler.objectAtPut(true,true,false); if (vm.primHandler.success) stack[vm.sp-=2] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(17); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 194:return this.needsVar.stack=!0,this.source.push("if (stack[vm.sp].sqClass === vm.specialObjects[7]) stack[vm.sp] = stack[vm.sp].pointersSize();\n","else if (stack[vm.sp].sqClass === vm.specialObjects[6]) stack[vm.sp] = stack[vm.sp].bytesSize();\n","else { vm.pc = ",this.pc,"; vm.sendSpecial(18); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return this.needsVar.stack=!0,void this.source.push("var cond = stack[vm.sp-1] === stack[vm.sp];\nstack[--vm.sp] = cond ? vm.trueObj : vm.falseObj;\n");case 199:return this.needsVar.stack=!0,void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",16+(15&e),"); return}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",16+(15&e),"); return;\n"),void(this.needsLabel[this.pc]=!0)}this.needsVar.rcvr=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",16+(15&e),");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a + b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(0); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 177:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a - b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(1); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 178:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a < b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(2); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 179:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a > b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(3); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 180:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a <= b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(4); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 181:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a >= b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(5); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 182:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a === b ? vm.trueObj : vm.falseObj;\n","} else if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.trueObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(6); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 183:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a !== b ? vm.trueObj : vm.falseObj;\n","} else if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(7); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 184:return void this.source.push("vm.success = true; vm.resultIsFloat = false; if(!vm.pop2AndPushNumResult(vm.stackIntOrFloat(1) * vm.stackIntOrFloat(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(8); return}\n");case 185:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.quickDivide(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(9); return}\n");case 186:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.mod(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(10); return}\n");case 187:return void this.source.push("vm.success = true; if(!vm.primHandler.primitiveMakePoint(1, true)) { vm.pc = ",this.pc,"; vm.sendSpecial(11); return}\n");case 188:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.safeShift(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(12); return}\n");case 189:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.div(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(13); return}\n");case 190:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) & vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(14); return}\n");case 191:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) | vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(15); return}\n")}},generateSend:function(e,t,i,r,s){this.debug&&this.generateDebugCode("send "+("lit["===e?this.method.pointers[t].bytesAsString():"...")),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; vm.send(",e,t,i,", ",r,", ",s,"); ","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateClosureTemps:function(e,t){if(this.debug&&this.generateDebugCode("closure temps"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var array = vm.instantiateClass(vm.specialObjects[7], ",e,");\n"),t){for(var i=0;ithis.endPC&&(this.endPC=i)},generateCallPrimitive:function(e){this.debug&&this.generateDebugCode("call primitive "+e),this.generateLabel(),129===this.method.bytes[this.pc]&&(this.needsVar.stack=!0,this.source.push("if (vm.primFailCode) {stack[vm.sp] = vm.getErrorObjectFromPrimFailCode(); vm.primFailCode = 0;}\n"))},generateDirty:function(e,t){switch(e){case"inst[":this.source.push("rcvr.dirty = true;\n");break;case"lit[":this.source.push(e,t,"].dirty = true;\n");break;case"temp[":break;default:throw Error("unexpected target "+e)}},generateLabel:function(){this.prevPC&&(this.sourceLabels[this.prevPC]=this.source.length,this.source.push("case ",this.prevPC,":\n")),this.prevPC=this.pc},generateDebugCode:function(e,t,i,r,s,n){this.needsBreak&&(this.source.push("if (vm.breakOutOfInterpreter) {vm.pc = ",this.prevPC,"; return}\n"),this.needsLabel[this.prevPC]=!0);for(var a=[],o=this.prevPC;o ",e),t)switch(this.source.push(" "),t){case"vm.nilObj":this.source.push("nil");break;case"vm.trueObj":this.source.push("true");break;case"vm.falseObj":this.source.push("false");break;case"rcvr":this.source.push("self");break;case"stack[vm.sp]":this.source.push("top of stack");break;case"inst[":this.instVarNames?this.source.push(this.instVarNames[i]):this.source.push("inst var ",i);break;case"temp[":this.source.push("tmp",i-6),"]"!==r&&this.source.push("[",s,"]");break;case"lit[":var u=this.method.pointers[i];"]"===r?this.source.push(u):this.source.push(u.pointers[0].bytesAsString());break;default:this.source.push(t)}this.source.push("\n"),this.needsBreak=this.singleStep},generateInstruction:function(e,t){this.debug&&this.generateDebugCode(e),this.generateLabel(),this.source.push(t,";\n")},deleteUnneededLabels:function(){var e,t=!1;for(e in this.sourceLabels)if(this.needsLabel[e])t=!0;else for(var i=0;i<3;i++)this.source[this.sourceLabels[e]+i]="";t||(this.source[this.sourcePos["loop-start"]]="",this.source[this.sourcePos["loop-end"]]="")},deleteUnneededVariables:function(){this.needsVar.stack&&(this.needsVar.context=!0),this.needsVar["inst["]&&(this.needsVar.rcvr=!0);for(var e=0;e{this.audioInContext=new AudioContext,this.audioInSource=this.audioInContext.createMediaStreamSource(e),t(this.audioInContext,this.audioInSource)}).catch(e=>i("cannot access microphone. "+e.name+": "+e.message)):i("test: audio input not supported")},stopAudioIn:function(){this.audioInSource&&(this.audioInSource.disconnect(),this.audioInSource=null,this.audioInContext.close(),this.audioInContext=null)}}),Object.extend(Squeak,"known classes",{BitBlt_dest:0,BitBlt_source:1,BitBlt_halftone:2,BitBlt_combinationRule:3,BitBlt_destX:4,BitBlt_destY:5,BitBlt_width:6,BitBlt_height:7,BitBlt_sourceX:8,BitBlt_sourceY:9,BitBlt_clipX:10,BitBlt_clipY:11,BitBlt_clipW:12,BitBlt_clipH:13,BitBlt_colorMap:14,BitBlt_warpBase:15,Form_bits:0,Form_width:1,Form_height:2,Form_depth:3,Form_offset:4}),Object.extend(Squeak.Primitives.prototype,"display",{displayDirty:function(){}}),Object.extend(Squeak.Primitives.prototype,"display",{initDisplay:function(e){this.display=e,this.display.vm=this.vm,this.indexedColors=[4294967295,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]},primitiveBeCursor:function(e){if(this.display.cursorCanvas){var t=this.loadForm(this.stackNonInteger(e),!0),i=1===e?this.loadForm(this.stackNonInteger(0)):null;if(!this.success||!t)return!1;var r=this.display.cursorCanvas,s=r.getContext("2d"),n={left:0,top:0,right:t.width,bottom:t.height},i=(r.width=t.width,r.height=t.height,1===t.depth?i?(t=this.cursorMergeMask(t,i),this.showForm(s,t,n,[0,4278190335,4294967295,4278190080])):this.showForm(s,t,n,[0,4278190080]):this.showForm(s,t,n,!0),this.display.context.canvas),s=i.offsetWidth/i.width,n=this.display.highdpi?window.devicePixelRatio:1;r.style.width=(r.width*n*s|0)+"px",r.style.height=(r.height*n*s|0)+"px",this.display.cursorOffsetX=t.offsetX*s|0,this.display.cursorOffsetY=t.offsetY*s|0}return this.vm.popN(e),!0},cursorMergeMask:function(e,t){for(var i=new Uint32Array(16),r=0;r<16;r++){for(var s=e.bits[r],n=t.bits[r],a=2147483648,o=0,u=0;u<16;u++)o=o|(n&a)>>u|(s&a)>>u+1,a>>>=1;i[r]=o}return{obj:e.obj,bits:i,depth:2,width:16,height:16,offsetX:e.offsetX,offsetY:e.offsetY,msb:!0,pixPerWord:16,pitch:1}},primitiveBeDisplay:function(e){var t=this.vm.stackValue(0);return this.vm.specialObjects[Squeak.splOb_TheDisplay]=t,this.vm.popN(e),!0},primitiveReverseDisplay:function(e){if(this.reverseDisplay=!this.reverseDisplay,this.redrawDisplay(),this.display.cursorCanvas){for(var t=this.display.cursorCanvas,i=t.getContext("2d"),t=i.getImageData(0,0,t.width,t.height),r=new Uint32Array(t.data.buffer),s=0;si.left&&(i.left=e.left),e.righti.top&&(i.top=e.top),e.bottom>16)+((255&I)<<16);h[f]=p}this.swappedColors=h}this.reverseDisplay&&(h=r?r.map(function(e){return 16777215^e}):(this.reversedColors||(this.reversedColors=h.map(function(e){return 16777215^e})),this.reversedColors));for(var d=(1<>>k&d],(k-=t.depth)<0&&(k=32-t.depth,b=t.bits[++g]);n++}break;case 16:for(m=s%2?0:16,v=0;v>>k;c[y++]=((31744&F)>>7)+((992&F)<<6)+((31&F)<<19)+4278190080,(k-=16)<0&&(k=16,b=t.bits[++g])}n++}break;case 32:for(var O=r?0:4278190080,v=0;v>16|(255&I)<<16|O;c[y++]=p}n++}break;default:throw Error("depth not implemented")}u.data!==l&&u.data.set(l),e.putImageData(u,i.left,i.top)}},primitiveDeferDisplayUpdates:function(e){var t=this.stackBoolean(0);return!!this.success&&(this.deferDisplayUpdates=t,this.vm.popN(e),!0)},primitiveForceDisplayUpdate:function(e){return this.vm.breakOut(),this.vm.popN(e),!0},primitiveScanCharacters:function(e){if(6!==e)return!1;var t=this.stackInteger(0),i=this.stackNonInteger(1),r=this.stackInteger(2),s=this.stackNonInteger(3),n=this.stackInteger(4),e=this.stackInteger(5);if(!this.success)return!1;if(i.pointersSize()<258||!s.isBytes())return!1;if(!(0i.pitch*i.height))return null;this.vm.warnOnce("loadForm(): "+i.bits.length+" !== "+i.pitch+"*"+i.height+"="+i.pitch*i.height)}}return i},theDisplay:function(){return this.loadForm(this.vm.specialObjects[Squeak.splOb_TheDisplay])},displayDirty:function(e,t){this.deferDisplayUpdates||e!=this.vm.specialObjects[Squeak.splOb_TheDisplay]||this.displayUpdate(this.theDisplay(),t)},displayUpdate:function(e,t){this.showForm(this.display.context,e,t),this.display.lastTick=this.vm.lastTick,this.display.idle=0},primitiveBeep:function(e){var t,i=Squeak.startAudioOut();return i?((t=i.createOscillator()).connect(i.destination),t.type="square",t.frequency.value=880,t.start(),t.stop(i.currentTime+.05)):this.vm.warnOnce("could not initialize audio"),this.popNIfOK(e)}}),Object.extend(Squeak,"files",{fsck:function(t,i,r,s,n){if(i=i||"",s=s||{dirs:[],files:[]},n=n||{dirs:0,files:0,bytes:0,deleted:0},!r&&(r={},Object.keys(Squeak.Settings).forEach(function(e){e=e.match(/squeak-file(\.lz)?:(.*)$/);e&&(r[e[2]]=!0)}),window.SqueakDBFake&&Object.keys(SqueakDBFake.bigFiles).forEach(function(e){r[e]=!0}),"undefined"!=typeof indexedDB))return this.dbTransaction("readonly","fsck cursor",function(e){e=e.openCursor();e.onsuccess=function(e){e=e.target.result;e?(r[e.key]=e.value.byteLength,e.continue()):Squeak.fsck(t,i,r,s,n)},e.onerror=function(e){console.error("fsck failed")}});var e,a=Squeak.dirList(i);for(e in a){var o=i+"/"+e;a[e][3]?(n.dirs++,"squeak:"+o in Squeak.Settings?Squeak.fsck(null,o,r,s,n):s.dirs.push(o)):(n.files++,o in r?(r[o]=null,n.bytes+=a[e][4]):s.files.push(o))}if(""===i){console.log("squeak fsck: "+n.dirs+" directories, "+n.files+" files, "+(n.bytes/1e6).toFixed(1)+" MBytes");var u=[];for(o in r)null!==(c=r[o])&&u.push({path:o,size:c});for(var l=0;lSqueakDBFake.bigFileThreshold?(SqueakDBFake.bigFiles[t]||console.log("File "+t+" ("+e.byteLength+" bytes) too large, storing in memory only"),SqueakDBFake.bigFiles[t]=e):(e=Squeak.bytesAsString(new Uint8Array(e)),"object"==typeof LZString?(i=LZString.compressToUTF16(e),Squeak.Settings["squeak-file.lz:"+t]=i,delete Squeak.Settings["squeak-file:"+t]):Squeak.Settings["squeak-file:"+t]=e);var i,r={};return setTimeout(function(){r.onsuccess&&r.onsuccess()},0),r},delete:function(e){delete Squeak.Settings["squeak-file:"+e],delete Squeak.Settings["squeak-file.lz:"+e],delete SqueakDBFake.bigFiles[e];var t={};return setTimeout(function(){t.onsuccess&&t.onsuccess()},0),t},openCursor:function(){var e={};return setTimeout(function(){e.onsuccess&&e.onsuccess({target:e})},0),e}}),SqueakDBFake},fileGet:function(e,t,i){i=i||function(e){console.log(e)};var r,s=this.splitFilePath(e);return s.basename?(Squeak.debugFiles&&(console.log("Reading "+s.fullname),r=t,t=function(e){console.log("Read "+e.byteLength+" bytes from "+s.fullname),r(e)}),window.SqueakDBFake&&SqueakDBFake.bigFiles[s.fullname]?t(SqueakDBFake.bigFiles[s.fullname]):void this.dbTransaction("readonly","get "+e,function(e){e=e.get(s.fullname);e.onerror=function(e){i(e.target.error.name)},e.onsuccess=function(e){if(void 0!==this.result)return t(this.result);Squeak.fetchTemplateFile(s.fullname,function(e){t(e)},function(){if("undefined"==typeof indexedDB)return i("file not found: "+s.fullname);var e=Squeak.dbFake().get(s.fullname);e.onerror=function(e){i("file not found: "+s.fullname)},e.onsuccess=function(e){t(this.result)}})}})):i("Invalid path: "+e)},filePut:function(e,t,i){var r=this.splitFilePath(e);if(!r.basename)return null;var s=this.dirList(r.dirname);if(!s)return null;var n=s[r.basename],a=this.totalSeconds();if(n){if(n[3])return null}else n=[r.basename,a,0,!1,0],s[r.basename]=n;return Squeak.debugFiles&&(console.log("Writing "+r.fullname+" ("+t.byteLength+" bytes)"),0>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return null;case Squeak.FFITypeBool:if(e.isTrue)return!0;if(e.isFalse)return!1;if("number"==typeof e)return!!e;if(e.isFloat)return!!e.float;throw Error("FFI: expected bool, got "+e);case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:if("number"==typeof e)return e;throw Error("FFI: expected integer, got "+e);case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"==typeof e)return e;if(e.isFloat)return e.float;throw Error("FFI: expected float, got "+e);default:throw Error("FFI: unimplemented atomic arg type: "+i)}case Squeak.FFIFlagAtomicPointer:switch(i=(s&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeUnsignedChar8:if(e.bytes)return e.bytesAsString();if(e.words)return String.fromChar.apply(null,e.wordsAsUint8Array());if(this.interpreterProxy.isWordsOrBytes(e))return"";if(e.pointers&&e.pointers[0].jsData)if((r=e.pointers[0].jsData)instanceof"string")return r;throw Error("FFI: expected string, got "+e);case Squeak.FFITypeUnsignedInt8:if(e.bytes)return e.bytes;if(e.words)return e.wordsAsUint8Array();if(this.interpreterProxy.isWordsOrBytes(e))return new Uint8Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Uint8Array)return r;if(r instanceof ArrayBuffer)return new Uint8Array(r)}throw Error("FFI: expected bytes, got "+e);case Squeak.FFITypeUnsignedInt32:if(e.words)return e.words;if(this.interpreterProxy.isWords(e))return new Uint32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Uint32Array)return r;if(r instanceof ArrayBuffer)return new Uint32Array(r)}throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSignedInt32:if(e.words)return e.wordsAsInt32Array();if(this.interpreterProxy.isWords(e))return new Int32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Int32Array)return r;if(r instanceof ArrayBuffer)return new Int32Array(r)}throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSingleFloat:if(e.words)return e.wordsAsFloat32Array();if(e.isFloat)return new Float32Array([e.float]);if(this.interpreterProxy.isWords(e))return new Float32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Float32Array)return r;if(r instanceof ArrayBuffer)return new Float32Array(r)}throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeDoubleFloat:if(e.words)return e.wordsAsFloat64Array();if(e.isFloat)return new Float64Array([e.float]);if(this.interpreterProxy.isWords(e))return new Float64Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Float64Array)return r;if(r instanceof ArrayBuffer)return new Float64Array(r)}throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeVoid:if(e.words)return e.words.buffer;if(e.bytes)return e.bytes.buffer;if(e.isNil||this.interpreterProxy.isWordsOrBytes(e))return new ArrayBuffer(0);if(e.pointers&&e.pointers[0].jsData)if((r=e.pointers[0].jsData)instanceof ArrayBuffer)return r;throw Error("FFI: expected words or bytes, got "+e);default:throw Error("FFI: unimplemented atomic array arg type: "+i)}default:throw Error("FFI: unimplemented arg type flags: "+s)}},ffiResultToSt:function(e,t){var i,r=t.pointers[0].words[0];switch(r&Squeak.FFIFlagMask){case Squeak.FFIFlagAtomic:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return this.vm.nilObj;case Squeak.FFITypeBool:return e?this.vm.trueObj:this.vm.falseObj;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"!=typeof e)throw Error("FFI: expected number, got "+e);return this.makeStObject(e);default:throw Error("FFI: unimplemented atomic return type: "+i)}case Squeak.FFIFlagAtomicPointer:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar8:return this.makeStString(e);default:return this.ffiMakeStExternalData(e,t)}default:throw Error("FFI: unimplemented return type flags: "+r)}},ffiNextExtAddr:0,ffiMakeStExternalAddress:function(){var e=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalAddress],4);return new Uint32Array(e.bytes.buffer)[0]=++this.ffiNextExtAddr,e},ffiMakeStExternalData:function(e,t){var i=this.ffiMakeStExternalAddress(),e=(i.jsData=e,this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalData],0));return e.pointers[0]=i,e.pointers[1]=t,e},ffiDataFromStack:function(e){e=this.stackNonInteger(e);return void 0!==e.jsData?e.jsData:e.bytes||e.words||(this.vm.warnOnce("FFI: expected ExternalAddress with jsData, got "+e),void(this.success=!1))},ffi_primitiveFFIAllocate:function(e){var t,i=this.stackInteger(0);return!!this.success&&((t=this.ffiMakeStExternalAddress()).jsData=new ArrayBuffer(i),this.popNandPushIfOK(e+1,t))},ffi_primitiveFFIFree:function(e){var t=this.stackNonInteger(0);return!!this.success&&(void 0===t.jsData?(this.vm.warnOnce("primitiveFFIFree: expected ExternalAddress with jsData, got "+t),!1):(delete t.jsData,!0))},primitiveCalloutToFFI:function(e,t){t=t.pointers[1];if(!this.isKindOf(t,Squeak.splOb_ClassExternalFunction))return!1;for(var i=[],r=e-1;0<=r;r--)i.push(this.vm.stackValue(r));return this.ffiDoCallout(e,t,i)},ffi_primitiveCalloutWithArgs:function(e){var t=this.stackNonInteger(1),i=this.stackNonInteger(0);return!!this.isKindOf(t,Squeak.splOb_ClassExternalFunction)&&this.ffiDoCallout(e,t,i.pointers)},ffi_primitiveFFIGetLastError:function(e){return this.popNandPushIfOK(e+1,this.ffi_lastError)},ffi_primitiveFFIIntegerAt:function(e){var t,i=this.ffiDataFromStack(3),r=this.stackInteger(2),s=this.stackInteger(1),n=this.stackBoolean(0);if(!this.success)return!1;if(r<0||s<1||8i.length||(i=i[t-1],!(t=this.fileOpen(i,!1)))||(i=this.makeFileHandle(i,t,!1),this.popNandPushIfOK(e+1,i),0))},primitiveDropRequestFileName:function(e){var t=this.stackInteger(0),i=this.display.droppedFiles||[];return!(t<1||t>i.length)&&(i=this.makeStString(this.filenameToSqueak(i[t-1])),this.popNandPushIfOK(e+1,i))}}),Object.extend(Squeak.Primitives.prototype,"FilePlugin",{primitiveDirectoryCreate:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.dirCreate(t),this.success||(t=Squeak.splitFilePath(t),Squeak.debugFiles&&console.warn("Directory not created: "+t.fullname)),this.popNIfOK(e))},primitiveDirectoryDelete:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.dirDelete(t),this.popNIfOK(e))},primitiveDirectoryDelimitor:function(e){var t=this.emulateMac?":":"/";return this.popNandPushIfOK(1,this.charFromInt(t.charCodeAt(0)))},primitiveDirectoryEntry:function(e){var t,i=this.stackNonInteger(1),r=this.stackNonInteger(0);return!!this.success&&(r=r.bytesAsString(),r=this.filenameFromSqueak(r),i=i.bytesAsString(),i=this.filenameFromSqueak(i),(t=Squeak.dirList(i,!0))?(t="."===r?[".",0,0,!0,0]:t[r],this.popNandPushIfOK(e+1,this.makeStObject(t)),!0):(r=Squeak.splitFilePath(i),Squeak.debugFiles&&console.log("Directory not found: "+r.fullname),!1))},primitiveDirectoryLookup:function(e){var t=this.stackInteger(0),i=this.stackNonInteger(1);if(!this.success)return!1;var i=i.bytesAsString(),r=this.filenameFromSqueak(i),s=Squeak.dirList(r,!0);if(!s)return n=Squeak.splitFilePath(r),Squeak.debugFiles&&console.log("Directory not found: "+n.fullname),!1;Squeak.debugFiles&&1===t&&console.log("Reading directory "+r+" with "+Object.keys(s).length+" entries");var n=s[Object.keys(s).sort()[t-1]];return"/"===i&&(1===t?((n=n||[0,0,0,0,0])[0]="SqueakJS",n[3]=!0):n=null),this.popNandPushIfOK(e+1,this.makeStObject(n)),!0},primitiveDirectorySetMacTypeAndCreator:function(e){return this.popNIfOK(e)},primitiveFileAtEnd:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeStObject(t.filePos>=t.file.size)),0))},primitiveFileClose:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(this.fileClose(t.file),this.vm.breakOut(),t.file=null),this.popNIfOK(e))},primitiveFileDelete:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.fileDelete(t),this.popNIfOK(e))},primitiveFileFlush:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(Squeak.flushFile(t.file),this.vm.breakOut()),this.popNIfOK(e))},primitiveFileGetPosition:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.filePos)),0))},makeFileHandle:function(e,t,i){e=this.makeStString("squeakjs:"+e);return e.file=t,e.fileWrite=i,e.filePos=0,e},primitiveFileOpen:function(e){var t=this.stackBoolean(0),i=this.stackNonInteger(1);return!!this.success&&(i=this.filenameFromSqueak(i.bytesAsString()),!!(i=this.fileOpen(i,t)))&&(i=this.makeFileHandle(i.name,i,t),this.popNandPushIfOK(e+1,i),!0)},primitiveFileRead:function(s){var n,a=this.stackInteger(0),o=this.stackInteger(1)-1,u=this.stackNonInteger(2),l=this.stackNonInteger(3);return!!(this.success&&u.isWordsOrBytes()&&l.file)&&(a?((n=u.bytes)||(n=u.wordsAsUint8Array(),o*=4,a*=4),!(o<0||o+a>n.length)&&("string"==typeof l.file?(this.popNandPushIfOK(s+1,0),!0):this.fileContentsDo(l.file,function(e){if(!e.contents)return this.popNandPushIfOK(s+1,0);var t=e.contents,i=n;a=Math.min(a,e.size-l.filePos);for(var r=0;r>=2),this.popNandPushIfOK(s+1,Math.max(0,a))}.bind(this)))):this.popNandPushIfOK(s+1,0))},primitiveFileRename:function(e){var t=this.stackNonInteger(1),i=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),i=this.filenameFromSqueak(i.bytesAsString()),this.success=Squeak.fileRename(t,i),this.vm.breakOut(),this.popNIfOK(e))},primitiveFileSetPosition:function(e){var t=this.stackPos32BitInt(0),i=this.stackNonInteger(1);return!(!this.success||!i.file)&&(i.filePos=t,this.popNIfOK(e))},primitiveFileSize:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.file.size)),0))},primitiveFileStdioHandles:function(e){var t=[null,this.makeFileHandle("console.log","log",!0),this.makeFileHandle("console.error","error",!0)];return this.popNandPushIfOK(e+1,this.makeStArray(t)),!0},primitiveFileTruncate:function(e){var t=this.stackPos32BitInt(0),i=this.stackNonInteger(1);return!!(this.success&&i.file&&i.fileWrite)&&(i.file.size>t&&(i.file.size=t,i.file.modified=!0,i.filePos>i.file.size)&&(i.filePos=i.file.size),this.popNIfOK(e))},primitiveDisableFileAccess:function(e){return this.fakePrimitive("FilePlugin.primitiveDisableFileAccess",0,e)},primitiveFileWrite:function(n){var a,o=this.stackInteger(0),u=this.stackInteger(1)-1,e=this.stackNonInteger(2),l=this.stackNonInteger(3);return!!(this.success&&l.file&&l.fileWrite)&&(o?((a=e.bytes)||(a=e.wordsAsUint8Array(),u*=4,o*=4),!!a&&!(u<0||u+o>a.length)&&("string"==typeof l.file?(this.fileConsoleWrite(l.file,a,u,o),this.popNandPushIfOK(n+1,o),!0):this.fileContentsDo(l.file,function(e){var t,i=a,r=e.contents||[];l.filePos+o>r.length&&(t=0===r.length?l.filePos+o:Math.max(l.filePos+o,r.length+1e4),e.contents=new Uint8Array(t),e.contents.set(r),r=e.contents);for(var s=0;se.size&&(e.size=l.filePos),e.modified=!0,this.popNandPushIfOK(n+1,o)}.bind(this)))):this.popNandPushIfOK(n+1,0))},fileOpen:function(e,t){"undefined"==typeof SqueakFiles&&(window.SqueakFiles={});e=Squeak.splitFilePath(e);if(!e.basename)return null;var i=Squeak.dirList(e.dirname,!0);if(!i)return null;var i=i[e.basename],r=null;if(i){if(s=SqueakFiles[e.fullname])return++s.refCount,s}else{if(!t)return Squeak.debugFiles&&console.log("File not found: "+e.fullname),null;if(r=new Uint8Array,!(i=Squeak.filePut(e.fullname,r.buffer)))return Squeak.debugFiles&&console.log("Cannot create file: "+e.fullname),null}var s={name:e.fullname,size:i[4],contents:r,modified:!1,refCount:1};return SqueakFiles[s.name]=s},fileClose:function(e){Squeak.flushFile(e),0==--e.refCount&&delete SqueakFiles[e.name]},fileContentsDo:function(r,s){if(r.contents)s(r);else{if(!1===r.contents)return!1;this.vm.freeze(function(t){var i=function(e){console.warn("File get failed: "+e),r.contents=!1,t(),s(r)}.bind(this),e=function(e){if(null==e)return i(r.name);r.contents=this.asUint8Array(e),t(),s(r)}.bind(this);Squeak.fileGet(r.name,e,i)}.bind(this))}return!0},fileConsoleBuffer:{log:"",error:""},fileConsoleWrite:function(e,t,i,r){t=t.subarray(i,i+r),i=this.fileConsoleBuffer[e]+Squeak.bytesAsString(t),r=i.match("([^]*)\n(.*)");r&&(console[e](r[1]),i=r[2]),this.fileConsoleBuffer[e]=i},fileConsoleFlush:function(e){var t=this.fileConsoleBuffer[e];t&&(console[e](t),this.fileConsoleBuffer[e]="")}}),Object.extend(Squeak.Primitives.prototype,"JPEGReadWriter2Plugin",{jpeg2_primJPEGPluginIsPresent:function(e){return this.popNandPushIfOK(e+1,this.vm.trueObj)},jpeg2_primImageHeight:function(e){var t=this.stackNonInteger(0).wordsOrBytes();return!!t&&(t=t[1],this.popNandPushIfOK(e+1,t))},jpeg2_primImageWidth:function(e){var t=this.stackNonInteger(0).wordsOrBytes();return!!t&&(t=t[0],this.popNandPushIfOK(e+1,t))},jpeg2_primJPEGCompressStructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGDecompressStructSize:function(e){return this.popNandPushIfOK(e+1,8)},jpeg2_primJPEGErrorMgr2StructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGReadHeaderfromByteArrayerrorMgr:function(e){var t,i=this.stackNonInteger(2).wordsOrBytes(),r=this.stackNonInteger(1).bytes;return!(!i||!r)&&(t=this.vm.freeze(),this.jpeg2_readImageFromBytes(r,function(e){this.jpeg2state={src:r,img:e},i[0]=e.width,i[1]=e.height,t()}.bind(this),function(){i[0]=0,i[1]=0,t()}.bind(this)),this.popNIfOK(e))},jpeg2_primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgr:function(e){var t=this.stackNonInteger(3).bytes,i=this.stackNonInteger(2).pointers,r=this.stackBoolean(1);if(!this.success||!t||!i)return!1;var s=this.jpeg2state;if(!s||s.src!==t)return console.error("jpeg read did not match header info"),!1;t=i[Squeak.Form_depth],s=this.jpeg2_getPixelsFromImage(s.img),i=i[Squeak.Form_bits].words;if(32===t)this.jpeg2_copyPixelsToForm32(s,i);else{if(16!==t)return!1;r?this.jpeg2_ditherPixelsToForm16(s,i):this.jpeg2_copyPixelsToForm16(s,i)}return this.popNIfOK(e)},jpeg2_primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgr:function(e){var t,i,r,s,n,a;return!(e<6||(t=this.stackNonInteger(4).bytes,n=this.stackNonInteger(3).pointers,i=this.stackInteger(2),!(this.success&&t&&n)))&&(r=n[Squeak.Form_width],s=n[Squeak.Form_height],a=n[Squeak.Form_depth],n=n[Squeak.Form_bits].words,32!==a?(this.vm.warnOnce("JPEG2WriteImage: only 32 bit depth supported"),!1):(a=this.jpeg2_writeFormToBytes(n,r,s,i,t),this.popNandPushIfOK(e+1,a)))},jpeg2_writeFormToBytes:function(e,t,i,r,s){for(var n=document.createElement("canvas"),a=n.getContext("2d"),t=(n.width=t,n.height=i,a.createImageData(t,i)),o=t.data,u=0;u>16&255,o[4*u+1]=l>>8&255,o[4*u+2]=255&l,o[4*u+3]=255}a.putImageData(t,0,0);i=n.toDataURL("image/jpeg",r/100);return this.jpeg2_dataURLToBytes(i,s)},jpeg2_dataURLToBytes:function(e,t){e=e.split(",")[1];if(!e)return 0;if(3*e.length/4-3>t.length)return 0;var i=atob(e);if(i.length>t.length)return 0;for(var r=0;r>3<<10|s[4*o+1]>>3<<5|s[4*o+2]>>3;0==(65535&(u=(u=0===u?1:u)<<16|s[4*o+4]>>3<<10|s[4*o+5]>>3<<5|s[4*o+6]>>3))&&(u|=1),t[o>>1]=u}},jpeg2_ditherPixelsToForm16:function(e,t){for(var i=e.width>>1,r=e.height,s=e.data,n=[2,0,14,12,1,3,13,15],a=[10,8,6,4,9,11,5,7],o=0;o>8,b=15&k,y=k>>4,c=g>8)>>4,h=g<(15&k)?1+y:y,y=(k=496*f>>8)>>4,f=g<(15&k)?1+y:y,y=(k=496*p>>8)>>4,p=v<(15&k)?1+y:y,y=(k=496*d>>8)>>4,d=v<(15&k)?1+y:y,y=(k=496*m>>8)>>4;b=c<<10|h<<5|f;0==(65535&(b=(b=0===b?1:b)<<16|p<<10|d<<5|(m=v<(15&k)?1+y:y)))&&(b|=1),t[l>>3]=b}}}),Object.extend(Squeak.Primitives.prototype,"ScratchPluginAdditions",{scratch_primitiveOpenURL:function(e){var t,i,r=this.stackNonInteger(0).bytesAsString();return""!=r&&(/^\/SqueakJS\//.test(r)&&(r=r.slice(10),t=Squeak.splitFilePath(r),i=Squeak.Settings["squeak-template:"+t.dirname])&&(r=JSON.parse(i).url+"/"+t.basename),window.open(r,"_blank"),this.popNIfOK(e))},scratch_primitiveGetFolderPath:function(e){var t,i=this.stackInteger(0);return!!this.success&&!!(t=1===i?"/":t)&&(this.vm.popNandPush(e+1,this.makeStString(this.filenameToSqueak(t))),!0)}}),Object.extend(Squeak.Primitives.prototype,"SoundPlugin",{snd_primitiveSoundStart:function(e){return this.snd_primitiveSoundStartWithSemaphore(e)},snd_primitiveSoundStartWithSemaphore:function(e){var t=this.stackInteger(e-1),i=this.stackInteger(e-2),r=this.stackBoolean(e-3),s=3>>t}var w=0,A=0,C=0,P=null,_=null,e="ADPCMCodecPlugin 3 November 2014 (e)",x=null;function r(){return e}function V(e){for(var t,i=0,r=e;;){if(!(0<(t=r-w)))return i+=o(C,0-t),C&=o(255,8-(w-=r)),i;i+=a(C,t),r-=w,C=P[++A-1],w=8}}function k(e,t){for(var i,r,s=t,n=e;;){if(!((r=(i=8-w)-n)<0))return C+=a(s,r),w+=n,self;C+=o(s,0-r),P[++A-1]=C,s&=a(1,(C=w=0)-r)-1,n-=i}}function s(){var e,t,i,r,s,n,a,o,u,l=_.stackValue(1),c=_.stackIntegerValue(0),h=_.fetchIntegerofObject(0,l),f=_.fetchIntegerofObject(1,l),p=_.fetchIntegerofObject(2,l),d=_.fetchIntegerofObject(3,l),m=_.fetchIntegerofObject(4,l),v=_.fetchIntegerofObject(5,l);if(C=_.fetchIntegerofObject(6,l),w=_.fetchIntegerofObject(7,l),A=_.fetchIntegerofObject(8,l),P=_.fetchBytesofObject(9,l),u=_.fetchInt16ArrayofObject(10,l),o=_.fetchIntegerofObject(12,l),n=_.fetchIntegerofObject(13,l),x=_.fetchInt16ArrayofObject(14,l),a=_.fetchInt16ArrayofObject(15,l),_.failed())return null;for(i=1;i<=c;i++){if(1==(i&v))32767<(h=V(16))&&(h-=65536),f=V(6);else{for(t=V(n),s=x[f],r=0,e=m;0>>=1,e>>>=1;r+=s,0<(t&p)?h-=r:h+=r,32767>>=1,h>>>=1,e>>>=1;a+=c,o+=h,0<(t&S)?u-=a:u+=a,0<(i&S)?l-=o:l+=o,32767=s&&(i=r);return i}(p,c[l]):d);else{for((i=c[++l-1]-p)<(n=0)&&(n=m,i=0-i),s=t=0,e=v;0>>=1,e>>>=1;s+=a,0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ADPCMCodecPlugin",{primitiveDecodeStereo:n,primitiveEncodeStereo:l,setInterpreter:c,primitiveEncodeMono:u,primitiveDecodeMono:s,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function q(e){return"number"==typeof e?k.classSmallInteger():e.sqClass}function f(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function B(e,t){return 0|Math.floor(e/t)}function R(e,t){return 31>>t}function o(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function e(e,t){return new Float32Array(e.buffer,e.byteOffset+4*t)}var r=12,M=2,N=3,T=1,E=0,L=6,G=0,X=4,Z=1,J=2,Y=3,Q=6,$=0,ee=2,te=1,ie=3,re=16,se=11,ne=13,ae=10,oe=18,ue=15,le=21,ce=16,he=4,fe=5,pe=2,de=3,me=10,ve=0,ge=1,ke=18,be=19,ye=20,Se=16,Fe=28,Oe=22,Ie=17,we=10,Ae=4,Ce=65536,Pe=100,_e=121,xe=122,Ve=114,je=112,qe=101,Be=102,u=104,Me=103,Ne=120,Te=119,Ee=113,Le=123,Re=115,De=108,We=105,ze=106,Ue=110,Ke=107,He=109,Ge=111,Xe=118,Ze=117,Je=116,Ye=8,Qe=9,$e=7,et=2,tt=1,it=0,rt=6,st=2,nt=255,at=256,ot=65280,ut=4,lt=65535,ct=1,ht=7,ft=5,pt=254,dt=1,mt=5,vt=8,gt=3,l=0,kt=6,bt=7,yt=2,St=4,Ft=4,Ot=5,It=6,wt=6,At=2,Ct=5,Pt=4,_t=3,xt=1,Vt=6,jt=7,qt=8,Bt=9,Mt=4,Nt=5,Tt=10,Et=12,Lt=16,Rt=14,Dt=15,Wt=13,zt=15,Ut=14,Kt=18,Ht=19,Gt=20,Xt=16,Zt=21,Jt=17,Yt=10,Qt=12,$t=51,ei=50,ti=53,ii=48,ri=52,si=49,ni=13,ai=14,oi=109,ui=111,li=108,ci=110,hi=10,fi=69,pi=43,di=45,mi=42,vi=44,gi=24,ki=97,bi=107,yi=103,Si=93,Fi=91,Oi=101,Ii=105,wi=99,Ai=95,Ci=88,Pi=113,_i=46,xi=47,Vi=37,ji=39,qi=36,Bi=38,Mi=11,Ni=12,Ti=17,Ei=16,Li=128,Ri=66,Di=67,Wi=68,zi=0,Ui=1097753705,Ki=256,Hi=63,Gi=8,Xi=9,Zi=80,Ji=82,Yi=84,Qi=86,$i=1,er=34,tr=35,ir=33,rr=32,sr=2,nr=64,ar=96,or=106,ur=102,lr=92,cr=90,hr=100,fr=104,pr=98,dr=94,p=3,d=5,n=null,mr="BitBltPlugin",vr=null,gr=0,kr=0,m=0,br=0,S=0,yr=0,v=0,g=null,k=null,Sr=null,Fr="B2DPlugin 14 November 2014 (e)",Or=null,b=0,W=null,c=null;function z(){return c[$t]}function Ir(e){c[$t]=e}function wr(){return c[ei]}function Ar(e,t){e=e+U()-1&~(U()-1);return t>>5&31)<<3,t=(s>>>10&31)<<3,s=(r+=r>>>5)+((i+=i>>>5)<<8)+((t+=t>>>5)<<16)+(255<<24)):s=0===h(e,ue)?0:Bs(e)[s]),bu(s)}function rs(e){return h(e,ae)}function ss(e){return Ou(s()-e+4)}function ns(e,t){Iu(s()-e+4,t)}function as(e){return Ou(s()-e+5)}function os(e,t){Iu(s()-e+5,t)}function us(e){return Ou(s()-e+0)}function ls(e,t){Iu(s()-e+0,t)}function cs(e){return Ou(s()-e+1)}function hs(e,t){Iu(s()-e+1,t)}function fs(e){return Ou(s()-e+2)}function ps(e,t){Iu(s()-e+2,t)}function ds(e){return Ou(s()-e+3)}function ms(e,t){Iu(s()-e+3,t)}function vs(e,t,i){for(var r,s,n=f(e),a=e.wordsAsInt32Array(),o=0,u=0;u<=n-1;u++){if(r=_o(u,a),!(0<=(s=xo(u,a))&&s<=t))return;o+=r}return o===i}function gs(e,t,i,r,s,n,a){if((e=e,o=t,k.isWords(e)&&((e=f(e))===3*o||e===6*o))&&(function(e){var t,i,r;if(k.isWords(e)){for(r=f(e),t=e.wordsAsInt32Array(),i=0;i<=r-1;i++)if(!Kn(t[i]))return;return 1}}(a)&&vs(i,e=f(a),t)&&vs(r,e,t)&&vs(n,e,t))){for(var o=s,i=t,u=f(o),l=o.wordsAsInt32Array(),c=0,h=0;h<=u-1;h++)c+=_o(h,l);return!!(c===i)}}function ks(e){var t,i;return(Ca(e)&pt)===ut?(t=Hn(i=e)?Nu(i):0,Yn(i)+t=cn()&&Jn(i)-t>=cn()?0:void jr(i)):(Ca(e)&pt)===rt?(i=Hn(t=e)?_u(t):0,Gr(t)+i=cn()&&Kr(t)-i>=cn()?0:void jr(t)):void jr(e)}function bs(){return[1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0,.1950903220161282,.38268343236509,.555570233019602,.707106781186547,.831469612302545,.9238795325112865,.98078528040323,1]}function ys(){return[0,.1950903220161282,.3826834323650897,.555570233019602,.707106781186547,.831469612302545,.923879532511287,.98078528040323,1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0]}function Ss(e,t){return e<0?0:t<=e?t-1:e}function Fs(){var e=D(To(),K()),t=D(Bo(),K())+1;for(e<0&&(e=0),t>No()&&(t=No());e>1,u=a+=(i=as(e))-f>>1,o+=(r+=h-l>>1)-n>>1,u+=(s+=f-c>>1)-a>>1,ps(e,r),ms(e,s),ns(e,o),os(e,u),ls(p,o),hs(p,u),ps(p,n),ms(p,a),ns(p,t),os(p,i),p)}function Ts(e,t){var i,r=Yr(e)[ve]>>8,s=xu(e)[ve]>>8;snt)return;return 0!=(Ca(e)&nt)}(e)||$s(e)>=hn()||ks(e),e+=h(e,tt)}function H(){return c[Ci]}function Ls(e){c[Ci]=e}function Rs(){return c[Pi]}function Ds(e){c[Pi]=e}function Ws(){return c[_i]}function zs(){return c[xi]}function Us(e){var t,i=D(To(),K());i<_s()&&(i=_s()),(t=D(Bo()+U()-1,K()))>ws()&&(t=ws()),(e=D(e,K()))=Cs()||t<_s()||i>=ws()||(i=i,t=t,e=e,(vr||Rn())&&vr(i,t,e))}function Ks(e){Pa(e,Ca(e)|Ce)}function Hs(e){Pa(e,Ca(e)&~Ce)}function Gs(e,t){I(e,Ye,t)}function Xs(e){return h(e,$e)}function Zs(e,t){return I(e,$e,t)}function Js(e,t){I(e,Qe,t)}function Ys(){return e(c,18)}function y(e){return h(e,Ft)}function Qs(e,t){I(e,Ft,t)}function $s(e){return h(e,Ot)}function en(e,t){I(e,Ot,t)}function tn(e){return h(e,It)}function rn(e,t){I(e,It,t)}function sn(e,t){for(var i=uu(),r=e,s=mu();s>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,h=n>>16,o||(c=Ss(c,i),h=Ss(h,t)),0<=c&&0<=h&&c>16)<0||s<=r)&&n>16)>16,h=Ar(g=s,n),p=Cr(0,n),u=z(),l=wr();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,++g,c+=r;d=c>>16}u=4042322160|D(z(),K()),l=K();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,g+=a,c+=R(r,l);d=c>>16}u=z(),l=wr();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,++g,c+=r;d=c>>16}return g}(o,i,e,t,n,l);n>16,r>>16)>=n&&u>16,l>>16),h=t[c],f=(c-1)*(c-1),p=n,d=a;for(d>vn(e)&&(d=vn(e));p>16,l>>16)>=f;)W[p]=h,++p,u+=r,l+=s;for(o=_(u>>16,l>>16);o>16,p>>16),g=(v-1)*(v-1),k=n,b=vn(e),y=Ar(n,b=a>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,++k,f+=r,p+=s;for(c=_(f>>16,p>>16);c>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,k+=d,f+=R(r,u),p+=R(s,u);for(c=_(f>>16,p>>16);c>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,++k,f+=r,p+=s;for(c=_(f>>16,p>>16);c>16,u>>16),p=t[f],e=qn(e),c=(e-1)*(e-1),h=(f+1)*(f+1),l=_(o>>16,u>>16),d=n,m=a;for(;d>16,u>>16)<=h;)W[d]=p,++d,o+=r,u+=s;for(l=_(o>>16,u>>16);h>16,f>>16),e=qn(e),g=(e-1)*(e-1),k=(b+1)*(b+1),m=_(h>>16,f>>16),p=Ar(S=n,a),v=Cr(0,a),S>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,++S,h+=r,f+=s;for(m=_(h>>16,f>>16);k>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,S+=o,h+=R(r,c),f+=R(s,c);for(m=_(h>>16,f>>16);k>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,++S,h+=r,f+=s;for(m=_(h>>16,f>>16);k>>0>>0}function yn(e,t,i){if(0!==e){var t=tR(No(),K())?R(No(),K()):i;if(tcn()&&(i=cn()),tBo()&&Mo(i),i>jo()&&qo(i),!(i<=t))if(Un(e))an(e,t,i);else{if(c[Ri]=e,t=t,c[Di]=t,t=i,c[Wi]=t,(i=(Ca(e)&ot)>>>8)<=1)return!0;switch(i){case 0:case 1:break;case 2:ln();break;case 3:kn();break;case 4:case 5:nn()}}}return!1}function Sn(){for(var e,t,i=H();_n()i)return!1;if(((t=Ca(e))&pt)===st)return!0;if(!ka(1))return!1;switch(t){case 0:case 1:case 2:case 3:break;case 4:Go(g[_n()],H());break;case 5:a=f=h=l=u=c=r=n=s=void 0;var r,s=g[_n()],n=H();if(u=Nu(s),c=u>>1,h=y(s),f=$s(s),Go(s,f),l=Xs(s),a=$n(s),Qs(s,h-c),Zs(s,l+u),0>1,a=Kr(p),h=$s(p),Ho(p,h),c=Xs(p),o=0;o<=5;o++)xu(p)[o]=Yr(p)[o];if(0===(f=Yr(p)[pe])&&Yr(p)[he],((f=0<=f?1:-1)<0?function(e,t,i,r){var s;Yr(e)[ve]=Yr(e)[ve]-256*i,s=xu(e)[ve],xu(e)[ve]=s+256*(t-i),s=xu(e)[ge],xu(e)[ge]=s+256*t,Jr(e,r-i)}:function(e,t,i,r){var s;Yr(e)[ve]=Yr(e)[ve]+256*i,s=xu(e)[ve],xu(e)[ve]=s-256*(t-i),s=xu(e)[ge],xu(e)[ge]=s+256*t,Jr(e,r-i+t)})(p,l,u,a),0===c&&(Yr(p)[ve]=256*Zr(p)),Zs(p,c+l),f=0-c-u,Cu(p,0),Pu(p,f),(u<=0&&f<0?Hs:Ks)(p),Ts(p,l),h!==d){for(o=h;o<=d-1;o++)Yo(p,o);Zs(p,Xs(p)-(d-h))}}Wn(e),xn(_n()+1)}return!1}function Fn(){var e,t,i;for(t=cn();a()=cn())return!1;if(Oo(i),Hn(e)&&!function(e){var t,i,r,s;switch(s=function(e){return Ca(e)>>>1}(e),kr=e,s){case 0:case 1:break;case 2:gr=Tu(kr);break;case 3:gr=function(e){return h(e,Ie)}(kr)}switch(r=gr,s){case 0:case 1:break;case 2:gr=function(e){return h(e,Xt)}(kr);break;case 3:gr=function(e){return h(e,Se)}(kr)}if(0===(s=gr))return;if(!ka(3))return;t=1+(tn(e)<<1),r=y(e)+r,-1===(i=In(s,t))?Vo(s,t,r):Do(i)=fn()&&sn(i,t)}return t=s()?-1:i}function wn(){return Ko()===vt}function An(){Au(wu()+3)}function Cn(){return Fr}function Pn(e,t){var i;return e===t||(i=0==(i=$s(e)-$s(t))?y(e)-y(t):i)<0}function _n(){return c[Mi]}function xn(e){c[Mi]=e}function Vn(){return c[Ni]}function jn(e){c[Ni]=e}function qn(e){return h(e,Tt)}function Bn(e){return o(Or,e+Et)}function Mn(){return 0!==c[Ti]}function Nn(e){c[Ti]=e}function Tn(){return 0!==c[Ei]}function En(e){c[Ei]=e}function Ln(e,t){var i,r=In(e,t);if(-1===r)return!1;if(0===r)An();else if(Uo(r,Ou(0)),Ro(r,Lo(0)),Wo(r,Do(0)),An(),!(s()<=3)){for(i=0,r=3;rNo()&&As(No()),e=R(_s(),K()),c[qi]=e,e=R(Vs(),K()),c[Bi]=e,e=R(ws(),K()),c[Vi]=e,e=R(Cs(),K()),c[ji]=e,jn(0),Mr(0),g=o(Or,b),n=o(Or,b),Es(),S||(0===Vn()?Ls(hn()):(function e(t,i,r){var s;var n;var a;var o;var u;var l;var c;var h;var f;var p;if((h=r+1-i)<=1)return 0;a=t[i];u=t[r];n=Pn(a,u);n||(f=t[i],t[i]=t[r],t[r]=f,p=a,a=u,u=p);if(h<=2)return 0;p=i+r>>1;o=t[p];n=Pn(a,o);n?(n=Pn(o,u))||(f=t[r],t[r]=t[p],t[p]=f,o=u):(f=t[i],t[i]=t[p],t[p]=f,o=a);if(h<=3)return 0;l=i;c=r;s=!0;for(;s;){for(n=!0;n;)n=l<=--c&&(f=t[c],Pn(o,f));for(n=!0;n;)n=++l<=c&&Pn(f=t[l],o);(s=l<=c)&&(f=t[l],t[l]=t[c],t[c]=f)}e(t,i,c);e(t,l,r)}(g,0,Vn()-1),Ls($s(g[0])),H()f(yr)||(t=k.fetchPointerofObject(t,yr),f(t=k.fetchPointerofObject(0,t))!==h(e,ne))?null:t.wordsAsInt32Array()}function na(e,t,i,r,s,n,a){var o,u,l,c,h;if(r!==s||0!==n&&0!==a){if(e=6*e,i=i?(o=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[0+e],c=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[1+e],u=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[2+e],h=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[3+e],l=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[4+e],(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[5+e]):(o=0|t[0+e],c=0|t[1+e],u=0|t[2+e],h=0|t[3+e],l=0|t[4+e],0|t[5+e]),o===u&&c===h||u===l&&h===i)return o===l&&c===i?void 0:(w()[0]=o,w()[1]=c,A()[0]=l,A()[1]=i,gu(2),ma(n,w(),A(),a,r,s));w()[0]=o,w()[1]=c,A()[0]=u,A()[1]=h,C()[0]=l,C()[1]=i,gu(3),t=ta(w(),A(),C(),0!==n&&0!==a),S||da(n,a,r,s,t)}}function aa(e){var t=c[65];return f(e)>1,d=A()[1]-w()[1]>>1,m=A()[0]+w()[0]>>1,v=A()[1]+w()[1]>>1,g=0;g<=15;g++){if(n=p,a=d,o=m,u=v,f=h=c=l=void 0,l=bs()[2*(s=g)+0]*n+o|0,h=ys()[2*s+0]*a+u|0,w()[0]=l,w()[1]=h,c=bs()[2*s+2]*n+o|0,f=ys()[2*s+2]*a+u|0,C()[0]=c,C()[1]=f,n=bs()[2*s+1]*n+o|0,o=ys()[2*s+1]*a+u|0,n=2*n-(l+c>>1),o=2*o-(h+f>>1),A()[0]=n,A()[1]=o,gu(3),s=ta(w(),A(),C(),0!==e&&0!==t),S)return;if(da(e,t,i,r,s),S)return}}function O(e,t){var i;return q(t)===k.classPoint()&&("number"==typeof(i=k.fetchPointerofObject(0,t))||i.isFloat)&&(e[0]="number"==typeof i?i:0|k.floatValueOf(i),"number"==typeof(i=k.fetchPointerofObject(1,t))||i.isFloat)?void(e[1]="number"==typeof i?i:0|k.floatValueOf(i)):k.primitiveFail()}function ha(){var e,t,i;return 2!==k.methodArgumentCount()?d:0!==(i=Fo(k.stackValue(2)))?i:(t=k.stackObjectValue(0),e=k.stackObjectValue(1),k.failed()?p:0!==(i=fa(k.fetchPointerofObject(T,br)))?i:ia(k.fetchPointerofObject(M,br))?ua(k.fetchPointerofObject(N,br))?f(e)>1),d=6*s;0=cs(u)?(Qs(o,us(u)),en(o,cs(u)-h),Qr(o,fs(u)),$r(o,ds(u)-h),Hr(o,ss(u)),Xr(o,as(u)-h)):(Qs(o,ss(u)),en(o,as(u)-h),Qr(o,fs(u)),$r(o,ds(u)-h),Hr(o,us(u)),Xr(o,cs(u)-h)),rn(o,Rs()),Gs(o,l),Js(o,c),a&&(I(n,Se,t),Vu(n,e),I(n,ye,e)),d-=6}Su()}function ma(e,t,i,r,s,n){var a,o=0===e||0===r?(a=Dr(Lt)?(b=(a=b)+Lt,Pa(a,ut),wa(a,0),Aa(a,Lt),a):0,0):(a=Dr(Zt)?(b=(o=b)+Zt,Pa(o,ft),wa(o,0),Aa(o,Zt),o):0,e>>1);if(S)return 0;la(a,t,i,o,s,n),Hn(a)&&(I(a,Xt,r),Eu(a,e),I(a,Gt,e))}function va(e){return"number"==typeof e?We:k.isWords(e)?f(e)yu()?Ge:0)):ze}function ga(e){0===strcmp(e,mr)&&(vr=Sr=0)}function ka(e){return!(Li+b+Vn()+Br()+e>wu()&&($o(xt),1))}function ba(){return 0!==c[Hi]}function ya(e){c[Hi]=e}function h(e,t){return Or[e+t]}function I(e,t,i){return Or[e+t]=i}function Sa(){return c[Gi]}function Fa(){return c[Xi]}function Oa(e){c[Xi]=e}function Ia(e){return h(e,et)}function wa(e,t){I(e,et,t)}function Aa(e,t){I(e,tt,t)}function Ca(e){return h(e,it)<}function Pa(e,t){return I(e,it,t)}function w(){return o(c,Zi)}function A(){return o(c,Ji)}function C(){return o(c,Yi)}function _a(){return o(c,Qi)}function xa(){_n()>=Vn()&&0===Br()&&x(vt),H()>=hn()&&x(vt)}function Va(){var e;return 0!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(0)))?k.primitiveFailFor(e):(x(vt),void V())}function ja(){var e;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),yt))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=aa(e))?ka(1)?(0Bo()&&Mo(c),c>jo()&&qo(c),x(gt),V(),k.pop(2),m&&(F(Oi,1),F(hr,k.ioMicroMSecs()-v))}function so(){var e;return 0!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(0)))?k.primitiveFailFor(e):(e=ba(),V(),k.pop(1),void k.pushBool(e))}function no(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(1)))?k.primitiveFailFor(e):(e=k.booleanValueOf(k.stackValue(0)),k.failed()?k.primitiveFailFor(p):(ya(!0===e?1:0),V(),void k.pop(1)))}function ao(){var e,t,i;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=k.stackValue(1),t=kt,i=vt,t=0===(e=Fo(e))?Ko()!==t&&Ko()!==i?(tu(At),Je):0:e)?k.primitiveFailFor(t):(i=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=!1,Ko()!==vt&&((e=On())?(iu(n[a()],i),x(bt)):x(dt)),k.failed()?null:(V(),k.pop(2),k.pushBool(!e),void(m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v))))))}function oo(){var e,t;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),gt))||0!==(e=fa(k.fetchPointerofObject(T,br)))?k.primitiveFailFor(e):ua(k.fetchPointerofObject(N,br))?(0!==Os()&&(0==(H()&Pr())&&Fs(),Is(0)),e=k.stackObjectValue(0),t=Fn(),S?k.primitiveFailFor(u):(t&&ru(e),k.failed()?k.primitiveFailFor(Ze):(t?x(St):(Su(),qo(0),x(mt)),V(),k.pop(2),k.pushBool(!t),void(m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)))))):k.primitiveFailFor(Le)}function uo(){var e,t;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),dt))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),(t=Sn())&&(iu(g[_n()],e),xn(_n()+1)),k.failed()?k.primitiveFailFor(Xe):(t?x(yt):(x(gt),Is(1),qr(0),Su()),V(),k.pop(2),k.pushBool(!t),void(m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)))))}function lo(){var e,t,i,r,s,n,a;return 6!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(a=P(k.stackValue(6),l))?k.primitiveFailFor(a):(a=k.positive32BitValueOf(k.stackValue(0)),n=k.positive32BitValueOf(k.stackValue(1)),s=k.stackIntegerValue(2),r=k.stackIntegerValue(3),i=k.stackIntegerValue(4),t=k.stackIntegerValue(5),k.failed()?k.primitiveFailFor(p):Dr(we)?Kn(n)&&Kn(a)?(b=(e=b)+we,Pa(e,st),Aa(e,we),wa(e,t),Qs(e,i),en(e,r),rn(e,s),Gs(e,j(n)),Js(e,j(a)),S?k.primitiveFailFor(u):void(k.failed()||(V(),k.pop(6)))):k.primitiveFailFor(Ze):k.primitiveFailFor(Ge))}function co(){var e,t,i;if(1!==k.methodArgumentCount())return k.primitiveFailFor(d);if(0!==(e=P(k.stackValue(1),l)))return k.primitiveFailFor(e);if(i=k.stackIntegerValue(0),k.failed())return k.primitiveFailFor(p);for(t=0;0===t;){if(!Dr(we))return k.primitiveFailFor(Ge);b=(t=b)+Ae,Pa(t,at),Aa(t,Ae),wa(t,i)}k.failed()||(V(),k.pop(2),k.pushInteger(t))}function ho(){var e;return 0!==(e=ha())?k.primitiveFailFor(e):(So(),S?su():(function(){var e;for(;!wn();){if(m&&(v=k.ioMicroMSecs()),e=Sn(),m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)),S)return x(dt);if(e)return x(yt),$o(Pt);if(qr(0),Su(),Is(1),m&&(v=k.ioMicroMSecs()),0!==Os()&&0==(H()&Pr())&&Fs(),Is(0),e=Fn(),m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)),S)return x(gt);if(e)return x(St),$o(Ct);if(Su(),qo(0),m&&(v=k.ioMicroMSecs()),(H()&Pr())===Pr()&&(Us(H()),xa()),m&&(F(yi,1),F(ur,k.ioMicroMSecs()-v)),S)return x(mt);if(wn())return;if(qr(0),Ls(H()+1),m&&(v=k.ioMicroMSecs()),e=On(),m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v)),S)return x(kt);if(e)return x(bt),$o(wt)}}(),void su()))}function fo(){var e;if(0!==(e=ha()))return k.primitiveFailFor(e);So(),su()}function po(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackIntegerValue(0),k.failed()?k.primitiveFailFor(p):(Co(e),V(),void k.pop(1)))}function mo(){var e,t=k.stackValue(0);return!k.isBytes(t)||256<=((e=t).bytes?e.bytes.length:e.words?4*e.words.length:0)||(t.bytes,e=!1,(t=t.bytesAsString())!==mr&&(mr=t,e=!0),e&&!Rn())?k.primitiveFail():void k.pop(1)}function vo(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),!(!k.failed()&&k.isPointers(e)&&2<=f(e))||(O(w(),k.fetchPointerofObject(0,e)),O(A(),k.fetchPointerofObject(1,e)),k.failed())?k.primitiveFailFor(p):(xs(w()[0]),js(w()[1]),As(A()[0]),Ps(A()[1]),V(),void k.pop(1)))}function go(){var e,t;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=e,t=qs(),Nn(0),pa(e,t,8)&&(Nn(1),t[1]=256*t[1],t[3]=256*t[3],t[5]=256*t[5],t[7]=256*t[7]),k.failed()?k.primitiveFailFor(Te):(V(),void k.pop(1))))}function ko(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackIntegerValue(0),k.failed()?k.primitiveFailFor(p):(Ds(e),V(),void k.pop(1)))}function bo(){var e,t;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()||(e=e,En(0),t=pa(e,e=Ys(),6),k.failed()||t&&(En(1),e[2]=e[2]+Ws(),e[5]=e[5]+zs()),k.failed())?k.primitiveFailFor(p):(V(),void k.pop(1)))}function yo(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):q(e=k.stackValue(0))!==k.classPoint()||(O(w(),e),k.failed())?k.primitiveFailFor(p):(e=w()[0],c[_i]=e,e=w()[1],c[xi]=e,V(),void k.pop(1))}function So(){var e,t=Ko();if(t===l){if(Dn(),S)return;t=dt}if(t===dt){if(m&&(v=k.ioMicroMSecs()),e=Sn(),m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)),S)return x(dt);if(e)return x(yt),$o(Pt);qr(0),Su(),Is(1),t=gt}if(t===gt){if(m&&(v=k.ioMicroMSecs()),0!==Os()&&0==(H()&Pr())&&Fs(),Is(0),e=Fn(),m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)),S)return x(gt);if(e)return x(St),$o(Ct);t=mt,Su(),qo(0)}if(t===mt){if(m&&(v=k.ioMicroMSecs()),(H()&Pr())===Pr()&&(Us(H()),xa()),m&&(F(yi,1),F(ur,k.ioMicroMSecs()-v)),S)return x(mt);if(wn())return;t=kt,qr(0),Ls(H()+1)}if(t===kt)return m&&(v=k.ioMicroMSecs()),e=On(),m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v)),S?x(kt):e?(x(bt),$o(wt)):void x(dt)}function Fo(e){return k.failed()?Pe:"number"==typeof e?qe:k.isPointers(e)?f(e)r;)n[s]=n[s-1],--s;n[s]=t}}function Co(e){var t;4<=e&&(t=4),2<=e&&e<4&&(t=2),e=t=e<2?1:t,c[ii]=e,1===t&&(xr(0),Ir(4294967295),_r(0)),2===t&&(xr(1),Ir(4244438268),_r(1)),4===t&&(xr(2),Ir(4042322160),_r(3)),e=2*K(),c[ei]=e,t=K(),c[ti]=t}function Po(e){return!1!=((k=e).majorVersion()==t)&&k.minorVersion()>=i}function _o(e,t){return(0|t[e])>>>16}function xo(e,t){return 65535&(0|t[e])}function Vo(e,t,i){Wr()&&(Uo(0,e),Ro(0,t),Wo(0,i),3!==s())&&bn(0,s()-3)&&(Uo(0,pu()),Ro(0,lu()),Wo(0,hu()),du(e),cu(t),fu(i))}function jo(){return c[tr]}function qo(e){c[tr]=e}function Bo(){return c[er]}function Mo(e){c[er]=e}function No(){return c[ir]}function To(){return c[rr]}function Eo(e){c[rr]=e}function _(e,t){return e*e+t*t}function Lo(e){return Ou(e+1)}function Ro(e,t){return Iu(e+1,t)}function Do(e){return Ou(e+2)}function Wo(e,t){return Iu(e+2,t)}function zo(e){return Ou(e)}function Uo(e,t){return Iu(e,t)}function Ko(){return c[sr]}function x(e){return c[sr]=e}function Ho(e,t){var i,r,s,n,a,o,u,l,c;if(!Hn(e)&&t>=Gr(e))return Zs(e,0);a=y(e),o=$s(e),c=h(e,12),u=h(e,13),l=2*(c-a),c=a+Kr(e)-2*c,s=2*(u-o),u=o+(i=Gr(e))-2*u,n=B(16777216,n=(n=2*(i=i-o))<2?2:n),r=l*(l=n),r+=(l=c*(c=((c=65535&l)*c>>>16)+c*(l=l>>>16&255)*2+(l*l<<16)>>>8)*2)>>1,s=s*n,s+=(n=u*c*2)>>1,Zs(e,i),(u=Yr(e))[ve]=256*a,u[ge]=256*o,u[pe]=r,u[de]=s,u[he]=l,u[fe]=n,(o=$s(e))!==t&&(Zo(e,t),Zs(e,i-(t-o)))}function Go(e,t){var i,r,s,n,a,o,u;if(!Hn(e)&&t>=Yn(e))return Zs(e,0);if(u=Jn(e)-y(e),i=Yn(e)-$s(e),s=0<=u?(a=1,n=u,0):(a=-1,n=0-u,1-i),u=0==i?(o=u,s=0):n>16,r+=n+32768>>16,s+=e[he],n+=e[fe];return e[ve]=i,e[ge]=r,e[pe]=s,e[de]=n,i>>8}function Zo(e,t){Qs(e,Xo(Yr(e),t))}function Jo(e){var t,i=y(e)+ea(e);0<(t=h(e,Wt)+h(e,Ut))&&(i+=$n(e),t-=h(e,zt)),Qn(e,t),Qs(e,i)}function Yo(e,t){var i=_u(e),r=i>>1,s=h(e,ke)+1,n=h(e,be)+1;Cu(e,s),Pu(e,n),r<=s&&Hs(e),0<=n&&Ks(e),n+r<0?Xo(Yr(e),t):Yr(e)[ve]=256*Zr(e),Xo(xu(e),t),Ts(e,i)}function Qo(e){var t,i,r,s,n,a,o=ju(e)+1,u=Bu(e)+1;qu(e,o),Mu(e,u),(i=(t=Nu(e))>>1)<=o&&Hs(e),0<=u&&Ks(e),r=y(e),Jo(e),s=y(e),(o<=t||0<=u+i)&&(o=r,t=s,i=ju(u=e),r=Bu(u),s=Nu(u),e=s>>1,n=Tu(u),a=$n(u),t-=o,i>>8&255,n=e>>>16&255,t=e>>>24&255,Mn()&&(i=(t*(a=qs())[6]+a[7])/t,n=(n*a[0]+a[1])*i|0,s=(s*a[2]+a[3])*i|0,r=(r*a[4]+a[5])*i|0,t=t*i|0,n=Math.max(n,0),n=Math.min(n,255),s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),t=Math.max(t,0),t=Math.min(t,255)),t<1?0:(t<255&&ba()&&$o(_t),r+(s<<8)+(n<<16)+(t<<24))):e}function vu(e){var t,i,r,s,n;Tn()?(t=0|e[0],i=0|e[1],r=e,s=Ys(),n=(s[0]*t+s[1]*i+s[2])*U()|0,t=(s[3]*t+s[4]*i+s[5])*U()|0,r[0]=n,r[1]=t):(e[0]=(e[0]+Ws())*U(),e[1]=(e[1]+zs())*U())}function gu(e){0>8,e=C()[0]-w()[0],t=C()[1]-w()[1],0===(i=(e=128+(0|Math.sqrt(e*e+t*t))>>8)>>8&255,t=e>>>24&255,s=(e>>>16&255)*(n=qs())[0]+n[1]|0,r=r*n[2]+n[3]|0,i=i*n[4]+n[5]|0,t=t*n[6]+n[7]|0,s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),i=Math.max(i,0),i=Math.min(i,255),t=Math.max(t,0),(t=Math.min(t,255))<16?0:i+(r<<8)+(s<<16)+(t<<24)):e}function yu(){return c[$i]}function Su(){Au(yu())}function Fu(e){return!!ka(e)&&(Au(wu()-e),!0)}function s(){return yu()-wu()}function Ou(e){return c[wu()+e]}function Iu(e,t){return c[wu()+e]=t}function wu(){return c[hi]}function Au(e){c[hi]=e}function Cu(e,t){I(e,ke,t)}function Pu(e,t){I(e,be,t)}function _u(e){return h(e,ye)}function xu(e){return o(Or,e+Oe)}function Vu(e,t){I(e,Ie,t)}function ju(e){return h(e,Kt)}function qu(e,t){I(e,Kt,t)}function Bu(e){return h(e,Ht)}function Mu(e,t){I(e,Ht,t)}function Nu(e){return h(e,Gt)}function Tu(e){return h(e,Jt)}function Eu(e,t){I(e,Jt,t)}function Lu(e){c=e.wordsAsInt32Array()}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("B2DPlugin",{primitiveMergeFillFrom:ro,primitiveCopyBuffer:za,primitiveAddRect:Da,primitiveAddGradientFill:Ta,primitiveSetClipRect:vo,initialiseModule:Rn,primitiveSetBitBltPlugin:mo,primitiveRegisterExternalEdge:lo,primitiveGetClipRect:Za,primitiveAddBezier:qa,primitiveInitializeProcessing:io,primitiveRenderImage:ho,primitiveGetOffset:$a,primitiveSetDepth:ko,primitiveAddBezierShape:Ba,primitiveSetEdgeTransform:bo,getModuleName:Cn,primitiveGetTimes:eo,primitiveNextActiveEdgeEntry:ao,primitiveAddBitmapFill:Ma,primitiveGetDepth:Ya,primitiveAbortProcessing:Va,primitiveNextGlobalEdgeEntry:uo,primitiveGetFailureReason:Qa,primitiveDisplaySpanBuffer:Ua,moduleUnloaded:ga,primitiveGetCounts:Ja,primitiveChangedActiveEdgeEntry:Wa,primitiveRenderScanline:fo,primitiveGetBezierStats:Xa,primitiveFinishedProcessing:Ha,setInterpreter:Po,primitiveNeedsFlush:so,primitiveAddLine:Ea,primitiveSetOffset:yo,primitiveNextFillEntry:oo,primitiveInitializeBuffer:to,primitiveDoProfileStats:Ka,primitiveAddActiveEdgeEntry:ja,primitiveSetAALevel:po,primitiveNeedsFlushPut:no,primitiveAddCompressedShape:Na,primitiveSetColorTransform:go,primitiveAddOval:La,primitiveRegisterExternalFill:co,primitiveAddPolygon:Ra,primitiveGetAALevel:Ga}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function O(e){return"number"==typeof e?K.classSmallInteger():e.sqClass}function Q(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function I(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function C(e,t){return 0|Math.floor(e/t)}function P(e,t){return 31>>t}function w(e,t){return t<0?t<-31?0:e>>>0-t:31>>5&31)+(i>>>10&31),i=gi(e>>>16,t>>>16,5,3),be+(31&i)+(i>>>5&31)+(i>>>10&31)):(i=gi(e,t,8,3),be+(255&i)+(i>>>8&255)+(i>>>16&255));return t}function yt(e,t){var i,r,s,n;if((B&(ce|ue))==(ce|ue))if(T<16)for(i=G[T]&Ie,n=t,s=1;s<=D;s++)Gi(r=n&i,Hi(r)+1),n=k(n,T);else 16===T?(Gi(r=qi(65535&t,5,Fe),Hi(r)+1),Gi(r=qi(t>>>16,5,Fe),Hi(r)+1)):Gi(r=qi(t,8,Fe),Hi(r)+1);return t}function St(e,t){return e+t}function Ft(e,t){var i,r,s=e>>>24;return 0==s?t:255==s?e:(r=(16711935&e)*s+(16711935&t)*(i=255-s)+16711935)+(r-65537>>>8&16711935)>>>8&16711935|((r=(16711935&(e>>>8|16711680))*s+(t>>>8&16711935)*i+16711935)+(r-65537>>>8&16711935)>>>8&16711935)<<8}function Ot(e,t){return It(e,t,!1)}function It(e,t,i){var r,s,n,a,o,u,l,c,h,f,p,d,m;if(T<16)return t;if(h=255-et,o=t,1===D)i&&0===e||(o=(p=(16711935&e)*et+(16711935&t)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935|((p=(e>>>8&16711935)*et+(t>>>8&16711935)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935)<<8);else for(r=G[T],m=R,d=t,a=e,n=1;n<=D;n++){if(l=a&r,!(0==(m&r)||i&&0==l)){for(f=d&r,s=0,c=1;c<=3;c++)s|=P(31&C((31&k(l,u=5*(c-1)))*et+(31&k(f,u))*h+254,255),u);o=o&~P(r,16*(n-1))|P(s,16*(n-1))}m=k(m,T),a=k(a,T),d=k(d,T)}return o}function wt(e,t){var i=255-(e>>>24),r=((16711935&t)*i>>>8&16711935)+(16711935&e),t=((t>>>8&16711935)*i>>>8&16711935)+(e>>>8&16711935);return(16711935&t)<<8|255*(16777472&t)|(16711935&r|255*(16777472&r)>>>8)}function At(e,t){return 0===e?t:It(e,t,!0)}function Ct(e,t){return e&t}function Pt(e,t){return e&~t}function _t(e,t){return~e&t}function xt(e,t){return~e&~t}function Vt(e,t){return~t}function jt(e,t){return~e|t}function qt(e,t){return~e|~t}function Bt(e,t){return~e}function Mt(e,t){return~e^t}function Nt(e,t){return e|t}function Tt(e,t){return e|~t}function Et(e,t){return e^t}function Lt(e,t){return 0}function Rt(){j<=W?(J=ot,z=W,x=kt):(J=ot+(j-W),x=kt-(j-W),z=j),j+Se>>2],0==(16777215&e)){for(t+=4,r+=4;0!=--i&&0==(16777215&(e=y[t>>>2]));)t+=4,r+=4;++i}else a=N[r>>>2],a=_i(e,a),N[r>>>2]=a,t+=4,r+=4;++n,++o}}(),m=(d=z)+x,p=(v=U)+_,!0):16===T?(function(){var e,t,i,r,s,n,a,o,u,l,c,h,f;u=_+1,l=Y,h=U,i=16*(1&z),L&&(i=16-i);H=P(65535,16-i);for(;0!=--u;){for(s=l*F+4*J,a=h*g+4*(z>>1),e=4*(3&h),f=(3&J)-1,n=x+1,i=65535===(o=H)?16:0;0!=--n;)t=Me[e+(f=f+1&3)],r=y[s>>>2],0!=(16777215&r)&&(c=N[a>>>2],c=k(c&=~o,i),r=P(0===(r=Xt(r=_i(r,c=(31744&c)<<9|(992&c)<<6|(31&c)<<3|4278190080),t))?1:r,i),Zt(a,r,o)),s+=4,L?0===i&&(a+=4):0!==i&&(a+=4),i^=16,o=~o;++l,++h}}(),m=(d=z)+x,p=(v=U)+_,!0):8===T&&(function(){var e,t,i,r,s,n,a,o,u,l,c,h,f;s=Ut(),o=B&~le,l=_+1,c=Y,H=8*(3&z),L&&(H=24-H);Xe=A^P(255,H),a=0==(1&z)?0:522133279;0==(1&(f=U))&&(a^=522133279);for(;0!=--l;){for(a^=522133279,i=c*F+4*J,n=f*g+4*(z>>2),r=x+1,e=H,u=Xe;0!=--r;)t=(y[i>>>2]&~a)+a,31<(h=C(((h=16777215&t)>>>16)+(h>>>8&255)+(255&h),3))&&(224>>2],h=k(h&=~u,e),h=s[h],t=P(t=ci(t=_i(t,h),o),e),Zt(n,t,u)),i+=4,u=L?0===e?(n+=4,e=24,16777215):(e-=8,u>>>8|4278190080):32===e?(n+=4,e=0,4294967040):(e+=8,u<<8|255),a^=522133279;++c,++f}}(),m=(d=z)+x,p=(v=U)+_,!0);if(T<8)return!1;if(8===T&&0==(B&ce))return!1;32===T&&!function(){for(var e,t,i,r,s,n=_+1,a=Y,o=U;0!=--n;){for(t=a*F+4*J,r=o*g+4*z,i=x+1;0!=--i;)if(255==(s=(e=y[t>>>2])>>>24)){for(N[r>>>2]=e,t+=4,r+=4;0!=--i&&(e=y[t>>>2])>>>24==255;)N[r>>>2]=e,t+=4,r+=4;++i}else if(0==s){for(t+=4,r+=4;0!=--i&&(e=y[t>>>2])>>>24==0;)t+=4,r+=4;++i}else s=wt(e,N[r>>>2]),N[r>>>2]=s,t+=4,r+=4;++a,++o}}();16===T&&!function(){var e,t,i,r,s,n,a,o,u,l=_+1,c=Y,h=U,f=16*(1&z);for(H=P(65535,16-(f=L?16-f:f));0!=--l;){for(r=c*F+4*J,n=h*g+4*(z>>1),e=4*(3&h),u=(3&J)-1,s=x+1,f=65535===(a=H)?16:0;0!=--s;)t=Me[e+(u=u+1&3)],255==(o=(i=y[r>>>2])>>>24)?Zt(n,i=P(0===(i=Xt(i,t))?1:i,f),a):0!=o&&(o=N[n>>>2],Zt(n,i=P(0===(i=Xt(i=wt(i,o=(31744&(o=k(o&=~a,f)))<<9|(992&o)<<6|(31&o)<<3|4278190080),t))?1:i,f),a)),r+=4,L?0===f&&(n+=4):0!==f&&(n+=4),f^=16,a=~a;++c,++h}}();8===T&&!function(){var e,t,i,r,s,n,a,o,u=Ut(),l=B&~le,c=_+1,h=Y,f=U;for(H=8*(3&z),Xe=A^P(255,H=L?24-H:H),n=0==(1&z)?0:522133279,0==(1&U)&&(n^=522133279);0!=--c;){for(n^=522133279,i=h*F+4*J,s=f*g+4*(z>>2),r=x+1,e=H,a=Xe;0!=--r;)31<(o=(t=(y[i>>>2]&~n)+n)>>>24)&&(o<224&&(o=N[s>>>2],t=wt(t,o=u[o=k(o&=~a,e)])),Zt(s,t=P(t=ci(t,l),e),a)),i+=4,a=L?0===e?(s+=4,e=24,16777215):(e-=8,a>>>8|4278190080):24===e?(s+=4,e=0,4294967040):(e+=8,a<<8|255),n^=522133279;++h,++f}}();return m=(d=z)+x,p=(v=U)+_,!0}())return;if(30===M||31===M){if(1!==K.methodArgumentCount())return K.primitiveFail();if(et=K.stackIntegerValue(0),!(!K.failed()&&0<=et&&et<=255))return K.primitiveFail()}be=0,Ht(),(Ye?function(){var e,t,i,r,s,n;for(i=X[M+1],n=1;n<=_;n++){if(t=Je?A:ei(U+n-1),R=H,r=N[E>>>2],e=i(t,r),r=R&e|r&~R,N[E>>>2]=r,E+=4,R=A,3===M)for(r=t,s=2;s<=Ze-1;s++)N[E>>>2]=r,E+=4;else for(s=2;s<=Ze-1;s++)r=N[E>>>2],e=i(t,r),N[E>>>2]=e,E+=4;1>>2],e=i(t,r),r=R&e|r&~R,N[E>>>2]=r,E+=4),E+=_e}}:(function(){var e;it===xe&&Y<=U&&(Y>>2],S+=a):l=0,R=H,f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,o=N[E>>>2],e=n(t&r,o),o=R&e|o&~R,N[E>>>2]=o,E+=a,R=A,3===M)if(0===b&&r===A)if(-1===Re)for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,N[E>>>2]=f,E+=a;else for(u=2;u<=Ze-1;u++)N[E>>>2]=l,E+=a,l=y[S>>>2],S+=a;else for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,N[E>>>2]=t&r,E+=a;else for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,e=n(t&r,N[E>>>2]),N[E>>>2]=e,E+=a;1>>2],S+=a,t=w(l&p,s)|w(f&i,b),o=N[E>>>2],e=n(t&r,o),o=R&e|o&~R,N[E>>>2]=o,E+=a),S+=tt,E+=_e}})))(),22!==M&&32!==M||(d=m=v=p=0);m=0>>2],f=0,o=lt,l=Ee,h=e,t===(ce|ue))for(;a=k(u,o)&i,c=Oe[a&Ie],f|=P(c&r,l),l+=n,0!=(4294967264&(o+=s))&&(st?o+=32:o-=32,u=y[(S+=4)>>>2]),0!=--h;);else for(;a=k(u,o)&i,c=ci(a,t),f|=P(c&r,l),l+=n,0!=(4294967264&(o+=s))&&(st?o+=32:o-=32,u=y[(S+=4)>>>2]),0!=--h;);return lt=o,f}(m,e,r,h,t,f),Ee=i,R===A?(c=g(n&l,N[E>>>2]),N[E>>>2]=R&c):(c=g(n&l,(n=N[E>>>2])&R),n=R&c|n&~R,N[E>>>2]=n),E+=4,m=2===s?(R=Xe,d):(R=A,D),0!=--s;);S+=tt,E+=_e}}function Ut(){return[0,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]}function Kt(e,t,i){return e>>16&255)]<<10)+(Be[t+(e>>>8&255)]<<5)+Be[t+(255&e)]}function Zt(e,t,i){var r=N[e>>>2];N[e>>>2]=r=r&i|t}function Jt(e,t){e=K.fetchPointerofObject(e,t);return"number"==typeof e?e:-2147483648<=(t=K.floatValueOf(e))&&t<=2147483647?0|t:(K.primitiveFail(),0)}function Yt(e,t,i){e=K.fetchPointerofObject(e,t);return"number"==typeof e?e:e.isNil?i:-2147483648<=(t=K.floatValueOf(e))&&t<=2147483647?0|t:(K.primitiveFail(),0)}function Qt(e,t){return 32!==T?t:0===t?0:0!=(4278190080&t)?t:t|4278190080&e}function $t(){return e}function ei(e){return De[e-C(e,e=ze)*e|0]}function ti(e){return!!e.isNil||0===M||5===M||10===M||15===M}function ii(){for(var e,t,i,r,s,n,a=0;a<=255;a++)for(e=0;e<=15;e++)i=e,s=n=s=r=void 0,n=Te[(r=255&(t=a))>>>3],s=i<(s=Ne[7&r])?n+1:n,n=Te[(r=t>>>8&255)>>>3],s|=i>>16&255)>>>3],t=s|=i>loadBitBltDestForm: destBitsSize != destPitch * destHeight, expected "+g+"*"+Ve+"="+g*Ve+", got "+e)}N=N.wordsOrBytes()}return!0}function ni(e){return ai(e,!1)}function ai(e,t){if(V=e,He=t,M=K.fetchIntegerofObject(ee,V),K.failed()||M<0||ge-2>loadBitBltSourceForm: sourceBitsSize != sourcePitch * sourceHeight, expected "+F+"*"+rt+"="+F*rt+", got "+e)}y=y.wordsOrBytes()}return!0}())return!1;if(!function(){var e,t,i;if(B=Ie=Fe=0,Oe=we=Ae=null,!(e=K.fetchPointerofObject(u,V)).isNil){if(B=ce,i=!1,K.isWords(e))t=Q(e),Oe=e.words,i=!0;else{if(!(K.isPointers(e)&&3<=Q(e)))return!1;if(Ae=oi(K.fetchPointerofObject(0,e)),we=oi(K.fetchPointerofObject(1,e)),(e=K.fetchPointerofObject(2,e)).isNil)t=0;else{if(!K.isWords(e))return!1;t=Q(e),Oe=e.words}B|=le}if(0!=(t&t-1))return!1;Ie=t-1,Fe=0,512===t&&(Fe=3),4096===t&&(Fe=4),32768===t&&(Fe=5),0===t?(Oe=null,Ie=0):B|=ue,i&&Ri(),!function(e,t){return!e||!t||0===e[ke]&&0===e[ve]&&0===e[ae]&&0===e[a]&&16711680===t[ke]&&65280===t[ve]&&255===t[ae]&&4278190080===t[a]}(Ae,we)?B|=oe:Ae=we=null}return!0}())return!1;0==(B&le)&&Ri(),ot=Yt(ie,V,0),ut=Yt(re,V,0)}return!!function(){var e;if(Je)De=null;else{if(K.isPointers(We)&&4<=Q(We))e=K.fetchPointerofObject(fe,We),ze=K.fetchIntegerofObject(de,We),K.isWords(e)||(Je=!0);else{if(K.isPointers(We)||!K.isWords(We))return!1;ze=Q(e=We)}De=e.wordsOrBytes()}return!0}()&&(j=Yt(n,V,0),q=Yt(o,V,0),Se=Yt(s,V,je),ye=Yt(r,V,Ve),!K.failed())&&(j<0&&(Se+=j,j=0),q<0&&(ye+=q,q=0),je>>14)>=at||(t=t>>>14)>=rt?0:(t=t*F+4*k(e,dt),k(y[t>>>2],lt=mt[e&pt])&vt)}function bi(e,t){var i,r,s,n,a;if(32===T)return e===t?0:t;for(a=G[r=T],s=0,n=1;n<=D;n++)s|=i=(e&a)===(i=t&a)?0:i,a=P(a,r);return s}function yi(e,t){return fi(~e,t,T,D)}function Si(e,t){return 0===e?t:e|fi(~e,t,T,D)}function Fi(e,t){var i,r,s,n,a;if(1===D)return t;if(i=0,s=P(1,T)-1,n=P(s,(D-1)*T),i|=P(t&s,r=32-T)|k(t&n,r),!(D<=2))for(a=2;a<=D>>1;a++)s=P(s,T),n=k(n,T),i|=P(t&s,r-=2*T)|k(t&n,r);return i}function Oi(){return ni(K.stackValue(K.methodArgumentCount()))?(Dt(),K.failed()||(Wi(),K.failed())?null:(K.pop(K.methodArgumentCount()),22===M||32===M?(K.pop(1),K.pushInteger(be)):void 0)):K.primitiveFail()}function Ii(){var e,t,i,r,s,n,a,o,u,l,c,h,f;if(6!==K.methodArgumentCount())return K.primitiveFail();if(l=K.stackIntegerValue(0),s=K.stackObjectValue(1),o=K.stackObjectValue(2),O(s)!==K.classArray()||O(o)!==K.classArray())return K.primitiveFail();if(256!==Q(o))return K.primitiveFail();if(K.failed())return null;if(n=Q(s)-2,i=K.stackIntegerValue(3),c=K.stackIntegerValue(4),f=K.stackObjectValue(5),!K.isBytes(f))return K.primitiveFail();if(!(0>1,s=1;s<=l;s++)if(W+=a,(i-=u)<0&&(qe+=o,i+=l),s>1,s=1;s<=u;s++)if(qe+=o,(i-=l)<0&&(W+=a,i+=u),s=se+12))return K.primitiveFail();(s=Ke-1)<=0&&(s=1);y=Jt(se,V),i=Jt(se+3,V),(I=Kt(y,i,s))<0&&(y=i-s*I);m=Jt(se+1,V),i=Jt(se+4,V),(S=Kt(m,i,s))<0&&(m=i-s*S);g=Jt(se+9,V),i=Jt(se+6,V),(l=Kt(g,i,s))<0&&(g=i-s*l);c=Jt(se+10,V),i=Jt(se+7,V),(n=Kt(c,i,s))<0&&(c=i-s*n);if(K.failed())return;if(2===K.methodArgumentCount())if(w=K.stackIntegerValue(1),(k=K.stackValue(0)).isNil){if(Z<16)return K.primitiveFail()}else{if(Q(k)>>=1;for(vt=G[Z],pt=P(1,dt=5-gt)-1,e=0;e<=pt;e++)mt[e]=st?32-P(e+1,gt):P(e,gt)})(),1>1,f=i>>1,d=r>>1,s>>1):(c=C(t,a),f=C(i,a),d=C(r,a),C(s,a));p=e;do{F=J,k=Y,O=I=S=b=0,w=0,h=a;do{for(A=F,y=k,u=a;g=ki(A,y),25===M&&0===g||(++w,Z<16?g=n[g]:16===Z&&(g=ji(g)),b+=255&g,S+=g>>>8&255,I+=g>>>16&255,O+=g>>>24),A+=c,y+=f,0!=--u;);}while(F+=d,k+=v,0!=--h)}while(g=0===w||25===M&&w>1?0:(4===w?(I>>>=2,S>>>=2,b>>>=2,O>>>=2):(I=C(I,w),S=C(S,w),b=C(b,w),O=C(O,w)),ci(g=0===(g=(O<<24)+(I<<16)+(S<<8)+b)&&0>>2]),N[E>>>2]=R&d):(a=N[E>>>2],d=u(r&p,a&R),a=R&d|a&~R,N[E>>>2]=a),E+=4,O=2===i?(R=Xe,F):(R=A,D),0!=--i;);y+=I,m+=S,g+=l,c+=n,E+=_e}}(),m=0>>=8),s=255&(e>>>=8),e=255&(e>>>=8),255!=(n=255&Ce)&&(e=e*n>>>8,s=s*n>>>8,r=r*n>>>8,a=a*n>>>8),t=255&(n=t),o=255&(i=Pe),ct&&(t=ct[t],o=ct[o]),255<(a=(t*(255-a)>>>8)+(o*a>>>8))&&(a=255),Le&&(a=Le[a]),t=255&(n>>>=8),o=255&(i>>>=8),ct&&(t=ct[t],o=ct[o]),255<(r=(t*(255-r)>>>8)+(o*r>>>8))&&(r=255),Le&&(r=Le[r]),t=255&(n>>>=8),o=255&(i>>>=8),ct&&(t=ct[t],o=ct[o]),255<(t=(t*(255-s)>>>8)+(o*s>>>8))&&(t=255),i>>>=8,((((o=255<(o=((255&(n>>>=8))*(255-e)>>>8)+e)?255:o)<<8)+(t=Le?Le[t]:t)<<8)+r<<8)+a)}function xi(e,t){if(0===e)return t;for(var i,r,s=e,n=t,a=T,o=D,u=G[a],l=0,c=1;c<=o;c++)r=k(s&u,(c-1)*a),i=k(n&u,(c-1)*a),32!==a&&(i=16===a?(r=4278190080|ji(r),4278190080|ji(i)):(r=4278190080|qi(r,a,32),4278190080|qi(i,a,32))),r=_i(r,i),l|=P(r=32!==a?qi(r,32,a):r,(c-1)*a),u=P(u,a);return l}function Vi(e,t){for(var i,r,s,n,a=G[T],o=16===T?(r=5,31):(r=8,255),u=R,l=t,c=e,h=1;h<=D;h++)0<(u&a)&&(n=l&a,i=c&a,s=T<16?i==n?0:1:((s=gi(i,n,r,3))&o)+(k(s,r)&o)+(k(k(s,r),r)&o),be+=s),u=k(u,T),c=k(c,T),l=k(l,T);return t}function ji(e){return(31&e)<<3|(992&e)<<6|(31744&e)<<9}function qi(e,t,i){var r,s,n,a;return 0<(r=i-t)?(a=P(1,t)-1,s=(n=P(e,r))&(a=P(a,r)),a=P(a,i),s+((n=P(n,r))&a)+(P(n,r)&P(a,i))):0==r?5===t?32767&e:8===t?16777215&e:e:0===e?e:(a=P(1,i)-1,s=(n=k(e,r=t-i))&a,a=P(a,i),0===(s=s+((n=k(n,r))&a)+(k(n,r)&P(a,i)))?1:s)}function Bi(e,t){return T<16?di(e,t,T,D):16===T?di(e,t,5,3)+(di(e>>>16,t>>>16,5,3)<<16):di(e,t,8,4)}function Mi(e,t){return T<16?mi(e,t,T,D):16===T?mi(e,t,5,3)+(mi(e>>>16,t>>>16,5,3)<<16):mi(e,t,8,4)}function Ni(e,t){e=~e;return T<16?mi(e,t,T,D):16===T?mi(e,t,5,3)+(mi(e>>>16,t>>>16,5,3)<<16):mi(e,t,8,4)}function Ti(e,t){return T<16?vi(e,t,T,D):16===T?vi(e,t,5,3)+(vi(e>>>16,t>>>16,5,3)<<16):vi(e,t,8,4)}function Ei(e,t){return T<16?gi(e,t,T,D):16===T?gi(e,t,5,3)+(gi(e>>>16,t>>>16,5,3)<<16):gi(e,t,8,4)}function Li(e){return!1!=((K=e).majorVersion()==t)&&K.minorVersion()>=i}function Ri(){var e,t=e=0;if(!(Z<=8)){if(16===Z&&(t=5),0===Fe){if(T<=8)return;16===T&&(e=5),32===T&&(e=8)}else e=Fe;Di(t=32===Z?8:t,e)}}function Di(e,t){var i,r=[0,0,0,0],s=[0,0,0,0],n=t-e;0!=n&&(n<=0?(i=P(1,t)-1,s[ke]=P(i,2*e-n),s[ve]=P(i,e-n),s[ae]=P(i,0-n),s[a]=0):(i=P(1,e)-1,s[ke]=P(i,2*e),s[ve]=P(i,e),s[ae]=i),r[ke]=3*n,r[ve]=2*n,r[ae]=n,r[a]=0,Ae=r,we=s,B=B|ce|oe)}function Wi(){K.showDisplayBitsLeftTopRightBottom(xe,d,v,m,p)}function zi(e,t){return e}function Ui(e,t){return e-t}function Ki(e,t){var i,r,s,n,a;if((B&(ce|ue))==(ce|ue))for(i=G[T],r=t,n=R,s=1;s<=D;s++)0!=(n&i)&&(a=r&i,Gi(a=T<16?a:qi(a,16===T?5:8,Fe),Hi(a)+1)),n=k(n,T),r=k(r,T);return t}function Hi(e){return Oe[e&Ie]}function Gi(e,t){Oe[e&Ie]=t}function Xi(){var e,t,i,r;Ue&&(ht||ui())&&(i=ht,r=!1,"number"==typeof(e=K.fetchPointerofObject(fe,xe))&&(i(e,d,v,m-d,p-v),r=!(N=g=0)),Ye||"number"==typeof(t=K.fetchPointerofObject(fe,it))&&(r&&t===e||i(t,0,0,0,0),y=F=0),Ue=!1)}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("BitBltPlugin",{primitiveCopyBits:Oi,copyBits:Dt,moduleUnloaded:hi,primitiveDrawLoop:wi,primitiveDisplayString:Ii,initialiseModule:ri,loadBitBltFrom:ni,setInterpreter:Li,primitiveWarpBits:Ci,getModuleName:$t,primitivePixelValueAt:Ai,copyBitsFromtoat:Wt}):self.setTimeout(e,100)}()}(),registerCroquetPlugin(),!function(){var t=1,i=11;function r(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function v(e,t){return 0|Math.floor(e/t)}function g(e,t){return 31>2)===O&&k===u&&k===s&&u===s),!1===n.failed())}function f(){for(var e,t,i,r=0,s=o;r>1,r=k>>2,f=1;f<=y;f++)for(c=g(1,f),h=c>>1,t=v(k,c),l=1;l<=h;l++)for(o=(m=(l-1)*t)=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("FFTPlugin",{primitiveFFTTransformData:m,setInterpreter:w,primitiveFFTPermuteData:p,primitiveFFTScaleData:d,getModuleName:c}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function o(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}var u=null,e="FloatArrayPlugin 3 November 2014 (e)";function r(){return e}function s(){var e,t,i,r,s=u.stackObjectValue(0),n=u.stackObjectValue(1);if(u.failed())return null;if(u.success(u.isWords(s)),u.success(u.isWords(n)),u.failed())return null;if(i=o(s),u.success(i===o(n)),u.failed())return null;for(r=n.wordsAsFloat32Array(),e=s.wordsAsFloat32Array(),t=0;t<=i-1;t++)r[t]=r[t]+e[t];u.pop(1)}function n(){var e,t,i,r=u.stackFloatValue(0),s=u.stackObjectValue(1);if(u.failed())return null;if(u.success(u.isWords(s)),u.failed())return null;for(t=o(s),i=s.wordsAsFloat32Array(),e=0;e<=t-1;e++)i[e]=i[e]+r;u.pop(1)}function a(){var e=u.stackIntegerValue(0),t=u.stackObjectValue(1);return u.failed()||(u.success(u.isWords(t)),u.success(0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("FloatArrayPlugin",{primitiveMulFloatArray:v,primitiveEqual:p,primitiveAtPut:l,primitiveAt:a,primitiveNormalize:k,primitiveSubFloatArray:b,primitiveDivFloatArray:c,primitiveAddScalar:n,primitiveDotProduct:f,primitiveSubScalar:y,setInterpreter:F,primitiveSum:S,getModuleName:r,primitiveHashArray:d,primitiveMulScalar:g,primitiveLength:m,primitiveAddFloatArray:s,primitiveDivScalar:h}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function W(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function z(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}var U=null,r="GeniePlugin v2.0 14 November 2014 (e)";function K(e,t){var i=e[0],e=e[1],i=t[0]-i,t=t[1]-e;return i*i+t*t}function s(){return r}function H(e){console.log(r+": "+e)}function n(){var N,T,e,t,i,r,E,s,n,a,o,u,l,c,h,L,f,p,d,m,v,g,k,b,y,R,S,F,O=U.stackValue(11),I=U.stackValue(10),w=U.stackValue(9),A=U.stackValue(8),C=U.stackValue(7),P=U.stackValue(6),_=U.stackValue(5),x=U.stackValue(4),D=U.stackIntegerValue(3),V=U.stackValue(2),j=U.stackValue(1),q=U.stackValue(0);if(!U.failed())if(U.failed())H("failed 1");else if(U.success(U.isWords(O)&&U.isWords(I)&&U.isWords(w)&&U.isWords(A)&&U.isWords(C)&&U.isWords(P)&&U.isWords(_)&&U.isWords(x)&&U.isWords(V)&&U.isWords(j)&&U.isWords(q)),U.failed())H("failed 2");else if(U.success(U.isMemberOf(O,"PointArray")&&U.isMemberOf(I,"PointArray")),U.failed())H("failed 3");else if(a=O.wordsAsInt32Array(),h=I.wordsAsInt32Array(),L=w.wordsAsInt32Array(),E=A.wordsAsInt32Array(),u=C.wordsAsInt32Array(),n=P.wordsAsInt32Array(),R=_.wordsAsInt32Array(),N=x.wordsAsInt32Array(),p=V.wordsAsInt32Array(),S=j.wordsAsInt32Array(),f=q.wordsAsInt32Array(),I=W(I)>>>1,k=W(w)>>>1,s=W(A)>>>1,w=W(P),A=W(V),U.success(A===W(j)&&A===W(q)&&s=k-1&&W(O)>>>1>=k&&s-1<=w&&s<=I&&W(_)>=k-1&&W(x)>=s-1),U.failed())H("failed 5");else if(P=D>>>1,l=(T=1&D)?0:P*P>>>10,f[S[p[0]=0]=0]=2,v=0-l,(o=s)-1<=I&&o-1<=w){for(m=1;m<=o;m++)v=v+(n[e=m-1]+K(z(h,e<<1),a)>>>7)+l,S[m]=v,p[m]=v*m,f[m]=m+1;for(v=S[0]-l,g=1;g<=k;g++){for(y=p[0],v=v+(u[t=g-1]+K(z(a,d=t<<1),h)>>>7)+l,S[0]=v,p[0]=v*g,f[0]=g+1,o=s,m=1;m<=o;m++)B=(e=m-1)<<1,b=p[m],F=p[e],c=u[t]+K(z(a,d),z(h,m<<1))>>>7,0===(v=S[m])?b+=c:(b=b+v+c*f[m],c+=v),r=n[e]+K(z(h,B),z(a,g<<1))>>>7,0===(v=S[e])?F+=r:(F=F+v+r*f[e],r+=v),T?y=1<<29:y+=(K(z(E,B),z(L,d))+K(z(h,B),z(a,d)))*(16+(B=N[e],M=R[t],(M=180<(M=Math.abs(M-B))?360-M:M)*M>>>6))>>>11,B=y<=b&&y<=F?(i=y,v=0,1):b<=F?(i=b,v=c+l,f[m]+1):(i=F,v=r+l,f[e]+1),y=p[m],p[m]=Math.min(i,1<<29),S[m]=Math.min(v,1<<29),f[m]=B;v=S[0]}var B,M,V=i;U.failed()||U.popthenPush(13,V)}else U.primitiveFail();return null}function a(){return U.failed()||U.popthenPush(1,2e3),null}function o(e){return!1!=((U=e).majorVersion()==t)&&U.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("GeniePlugin",{primVersionNO:a,setInterpreter:o,primSameClassAbsoluteStrokeDistanceMyPoints_otherPoints_myVectors_otherVectors_mySquaredLengths_otherSquaredLengths_myAngles_otherAngles_maxSizeAndReferenceFlag_rowBase_rowInsertRemove_rowInsertRemoveCount:n,getModuleName:s}):self.setTimeout(e,100)}()}(),!function(){var t=1,E=11;function I(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function n(e,t){return 0|Math.floor(e/t)}function i(e,t){return 31>>3)*m[a]+(t>>>3),s=((7&i)<<3)+(7&t),i=se[r][s],++e<8*m[f]?m[u]=e:(m[u]=0,m[l]++);return i}(),e-=j,t=function(){var e,t,i,r,s;t=e=v[u],i=v[l],r=v[h],s=v[d],0!==r&&0!==s&&(t=n(t,r),i=n(i,s));r=(i>>>3)*v[a]+(t>>>3),s=((7&i)<<3)+(7&t),i=ne[r][s],++e<8*v[f]?v[u]=e:(v[u]=0,v[l]++);return i}(),r=s+(z*(t-=j)>>16)+O[te],r=Math.min(r,V),r=Math.max(r,0),O[te]=r&g,r&=V-g,r=Math.max(r,1),t=s-(L*e>>16)-(R*t>>16)+O[c],t=Math.min(t,V),t=Math.max(t,0),O[c]=t&g,t&=V-g,t=Math.max(t,1),s=s+(K*e>>16)+O[o],s=Math.min(s,V),s=Math.max(s,0),O[o]=s&g,s&=V-g,s=Math.max(s,1),k[i]=4278190080+(r<<16)+(t<<8)+s}function T(e){var t;return s>>e)}function he(){return e}function fe(e,t){var i,r,s=e[0]>>>24;if(!(Q>>24&255))return-1}return-1}function pe(){var e,t=e=B[u],i=B[l],r=B[h],s=B[d];return 0!==r&&0!==s&&(t=n(t,r),i=n(i,s)),r=(i>>>3)*B[a]+(t>>>3),s=le[r][((7&i)<<3)+(7&t)],++e<8*B[f]?B[u]=e:(B[u]=0,B[l]++),s}function de(){var e,t,i;if(4!==q.methodArgumentCount())return q.primitiveFail();if(g=q.stackIntegerValue(0),e=q.stackObjectValue(1),q.failed())return null;if(!q.isWords(e)||3!==I(e))return q.primitiveFail();if(O=e.wordsAsInt32Array(),e=q.stackObjectValue(2),q.failed())return null;if(!q.isWords(e))return q.primitiveFail();if(b=I(e),k=e.wordsAsInt32Array(),e=q.stackObjectValue(3),q.failed())return null;if(!ye(e))return q.primitiveFail();for(B[u]=0,t=B[l]=0;t<=b-1;t++)i=pe(),i+=O[c],i=Math.min(i,V),O[c]=i&g,i&=V-g,i=Math.max(i,1),k[t]=4278190080+(i<<16)+(i<<8)+i;q.pop(4)}function me(){var e,t;return 4!==q.methodArgumentCount()?q.primitiveFail():(g=q.stackIntegerValue(0),e=q.stackObjectValue(1),q.failed()?null:q.isWords(e)&&3===I(e)?(O=e.wordsAsInt32Array(),e=q.stackObjectValue(2),q.failed()?null:q.isWords(e)?(b=I(e),k=e.wordsAsInt32Array(),e=q.stackObjectValue(3),q.failed()?null:q.isPointers(e)&&3===I(e)&&ye(q.fetchPointerofObject(0,e))&&(t=q.fetchPointerofObject(1,e),M(m,t))&&N(se,t)&&(t=q.fetchPointerofObject(2,e),M(v,t))&&N(ne,t)?(ce(),void q.pop(4)):q.primitiveFail()):q.primitiveFail()):q.primitiveFail())}function ve(){var e,t,i;return 5!==q.methodArgumentCount()?q.primitiveFail():(i=q.stackObjectValue(0),q.failed()?null:I(e=i)<5||!q.isPointers(e)||"number"==typeof(t=q.fetchPointerofObject(0,e))||!q.isBytes(t)||(y=t.bytes,t=(t=t).bytes?t.bytes.length:t.words?4*t.words.length:0,S=q.fetchIntegerofObject(1,e),F=q.fetchIntegerofObject(2,e),r=q.fetchIntegerofObject(3,e),s=q.fetchIntegerofObject(4,e),q.failed())||(t>>4,0!==(n&=15)){if(r+=s,n=ke(T(n),n),r<0||A<=r)return q.primitiveFail();e[ue[r]]=n}else{if(15!=s)return;r+=s}++r}}(t,B),q.failed())?null:(i=q.stackValue(0),q.storeIntegerofObjectwithValue(1,i,S),q.storeIntegerofObjectwithValue(3,i,r),q.storeIntegerofObjectwithValue(4,i,s),q.storeIntegerofObjectwithValue(p,q.stackValue(3),B[p]),void q.pop(5)))):q.primitiveFail()):q.primitiveFail()):q.primitiveFail()))}function ge(){var e,t;if(2!==q.methodArgumentCount())return q.primitiveFail();if(e=q.stackObjectValue(0),q.failed())return null;if(!q.isWords(e)||I(e)!==A)return q.primitiveFail();if(t=e.wordsAsInt32Array(),e=q.stackObjectValue(1),q.failed())return null;if(!q.isWords(e)||I(e)!==A)return q.primitiveFail();for(var i,r,s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b,y=e.wordsAsInt32Array(),S=t,F=new Array(64),O=0;O<=w-1;O++){for(i=-1,n=1;n<=w-1;n++)-1===i&&0!==y[n*w+O]&&(i=n);if(-1===i)for(r=y[O]*S[0]<<2,s=0;s<=w-1;s++)F[s*w+O]=r;else f=(m=((v=y[2*w+O]*S[2*w+O])+(g=y[6*w+O]*S[6*w+O]))*_)+g*(0-H),p=m+v*x,u=(a=(v=y[O]*S[O])+(g=y[4*w+O]*S[4*w+O])<<13)+p,h=a-p,l=(o=v-g<<13)+f,c=o-f,a=y[7*w+O]*S[7*w+O],o=y[5*w+O]*S[5*w+O],f=y[3*w+O]*S[3*w+O],m=a+(p=y[w+O]*S[w+O]),v=o+f,g=a+f,k=o+p,p*=U,a=(a*=C)+(m*=0-D)+(g=g*(0-G)+(b=(g+k)*W)),o=(o*=X)+(v*=0-Z)+(k=k*(0-P)+b),f=(f*=J)+v+g,F[O]=u+(p=p+m+k)>>11,F[7*w+O]=u-p>>11,F[+w+O]=l+f>>11,F[6*w+O]=l-f>>11,F[2*w+O]=c+o>>11,F[5*w+O]=c-o>>11,F[3*w+O]=h+a>>11,F[4*w+O]=h-a>>11}for(O=0;O<=A-w;O+=w)v=F[O+2],g=F[O+6],u=(a=F[O]+F[O+4]<<13)+(p=(m=(v+g)*_)+v*x),h=a-p,l=(o=F[O]-F[O+4]<<13)+(f=m+g*(0-H)),c=o-f,a=F[O+7],o=F[O+5],f=F[O+3],m=a+(p=F[O+1]),v=o+f,g=a+f,a=(a*=C)+(m*=0-D)+(g=g*(0-G)+(b=(g+(k=o+p))*W)),o=(o*=X)+(v*=0-Z)+(k=k*(0-P)+b),f=(f*=J)+v+g,p=(p*=U)+m+k,d=Math.min((u+p>>18)+j,V),d=Math.max(d,0),y[O]=d,d=Math.min((u-p>>18)+j,V),d=Math.max(d,0),y[O+7]=d,d=Math.min((l+f>>18)+j,V),d=Math.max(d,0),y[O+1]=d,d=Math.min((l-f>>18)+j,V),d=Math.max(d,0),y[O+6]=d,d=Math.min((c+o>>18)+j,V),d=Math.max(d,0),y[O+2]=d,d=Math.min((c-o>>18)+j,V),d=Math.max(d,0),y[O+5]=d,d=Math.min((h+a>>18)+j,V),d=Math.max(d,0),y[O+3]=d,d=Math.min((h-a>>18)+j,V),d=Math.max(d,0),y[O+4]=d;q.pop(2)}function ke(e,t){return e=E}function ye(e){return M(B,e)&&N(le,e)}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("JPEGReaderPlugin",{setInterpreter:be,primitiveIdctInt:ge,primitiveColorConvertMCU:me,primitiveColorConvertGrayscaleMCU:de,primitiveDecodeMCU:ve,getModuleName:he}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function y(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function p(e,t){return 0|Math.floor(e/t)}function s(e,t){return e-p(e,t)*t|0}var S=null,n=0,e="KedamaPlugin 3 November 2014 (e)",a=0,r=0,o=0,u=0;function k(e,t){var i;return 0===e?0<=t?90:270:(i=Math.atan(t/e),0<=e?0<=t?i/.0174532925199433:360+i/.0174532925199433:180+i/.0174532925199433)}function l(e){var e=90-e,t=e/360|0;return e<0&&--t,.0174532925199433*(e-360*t)}function c(){var e,t,i,r,s,n,a,o,u,l=S.stackValue(0),c=S.stackValue(1),h=S.stackValue(2),f=S.stackValue(3),p=S.stackIntegerValue(4),d=S.stackIntegerValue(5),m=S.stackValue(6);if(S.failed())return null;if(!S.isWords(m))return S.primitiveFail(),null;if(!S.isWords(f))return S.primitiveFail(),null;if(!S.isWords(h))return S.primitiveFail(),null;if(!S.isWords(c))return S.primitiveFail(),null;if(!S.isBytes(l))return S.primitiveFail(),null;if(p*d!==y(m))return S.primitiveFail(),null;if(r=y(f),y(h)!==r)return S.primitiveFail(),null;if(y(c)!==r)return S.primitiveFail(),null;if(y(l)!==r)return S.primitiveFail(),null;for(a=f.wordsAsFloat32Array(),u=h.wordsAsFloat32Array(),e=c.words,s=l.bytes,t=m.words,i=0;i<=r-1;i++)n=0|a[i],o=0|u[i],0!==s[i]&&0<=n&&0<=o&&n>>16;return e<0?0-r:r}function g(){var e=S.stackIntegerValue(0);if(S.failed())return null;n=65536&e,S.pop(1)}function b(){var e,t,i,r,s,n,a=S.stackIntegerValue(0),o=S.stackIntegerValue(1),u=S.stackValue(2),l=S.stackValue(3);if(S.failed())return null;if((t=y(l))!==y(u))return S.primitiveFail(),null;if(a<-32)return S.primitiveFail(),null;if(8>>0-n:31=i}function Z(){var e=S.stackFloatValue(0),t=S.stackValue(1),i=S.stackIntegerValue(2);return S.failed()?null:!S.isWords(t)||y(t)>>16;return e<0?0-r:r}function v(){var e=O.stackIntegerValue(0);if(O.failed())return null;s=65536&e,O.pop(1)}function g(){var e,t,i,r,s,n,a=O.stackIntegerValue(0),o=O.stackIntegerValue(1),u=O.stackValue(2),l=O.stackValue(3);if(O.failed())return null;if((t=F(l))!==F(u))return O.primitiveFail(),null;if(a<-32)return O.primitiveFail(),null;if(8>>0-n:31=a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>=t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>=a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>=t[r];O.pop(4),O.push(u)}function W(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>=s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>=t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>=s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>=t;O.pop(4),O.push(u)}function z(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>t[r];O.pop(4),O.push(u)}function U(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>t;O.pop(4),O.push(u)}function K(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]<=a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]<=t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]<=a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]<=t[r];O.pop(4),O.push(u)}function H(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]<=s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]<=t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]<=s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]<=t;O.pop(4),O.push(u)}function G(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>>0,o[r]=i);if(!l&&!d)for(o=u.words,n=h.words,r=p-1;r<=f-1;r++)1===s[r]&&(o[r]=n[c+r-p]);O.pop(4)}function oe(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p,d,m,v=O.stackObjectValue(0),g=O.stackObjectValue(1),k=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(g)),O.success(O.isWords(k)),O.success(O.isWords(v)),O.failed())return null;if(l=F(g),O.success(l===F(k)),O.success(l===F(v)),O.failed())return null;if(o=O.isMemberOf(g,"WordArray"),u=O.isMemberOf(k,"WordArray"),o&&u){if(!O.isMemberOf(v,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(v,"KedamaFloatArray"))return O.primitiveFail(),null;if(u)if(o)for(d=k.words,p=g.words,m=v.words,a=0;a<=l-1;a++)f=b(h=d[a],c=p[a]),m[a]=f;else for(d=k.words,r=g.wordsAsFloat32Array(),n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(h=d[a])/(e=r[a]),i=Math.floor(i),n[a]=h-i*e;else if(o)for(s=k.wordsAsFloat32Array(),p=g.words,n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(t=s[a])/(c=p[a]),i=Math.floor(i),n[a]=t-i*c;else for(s=k.wordsAsFloat32Array(),r=g.wordsAsFloat32Array(),n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(t=s[a])/(e=r[a]),i=Math.floor(i),n[a]=t-i*e;O.pop(4),O.push(v)}function ue(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p=O.stackObjectValue(0),d=O.stackValue(1),m=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(m)),O.success(O.isWords(p)),O.failed())return null;if(l=F(m),O.success(l===F(p)),O.failed())return null;if(o="number"==typeof d,u=O.isMemberOf(m,"WordArray"),o&&u){if(!O.isMemberOf(p,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(p,"KedamaFloatArray"))return O.primitiveFail(),null;if(u)if(o)for(h=m.words,a=d,f=p.words,n=0;n<=l-1;n++)f[n]=b(h[n],a);else for(h=m.words,e=O.floatValueOf(d),s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(c=h[n])/e,i=Math.floor(i),s[n]=c-i*e;else if(o)for(r=m.wordsAsFloat32Array(),a=d,s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(t=r[n])/a,i=Math.floor(i),s[n]=t-i*a;else for(r=m.wordsAsFloat32Array(),e=O.floatValueOf(d),s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(t=r[n])/e,i=Math.floor(i),s[n]=t-i*e;O.pop(4),O.push(p)}function le(){var e,t,i,r,s,n,a,o,u,l,c=O.stackObjectValue(0),h=O.stackObjectValue(1),f=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(h)),O.success(O.isWords(f)),O.success(O.isWords(c)),O.failed())return null;if(a=F(h),O.success(a===F(f)),O.success(a===F(c)),O.failed())return null;if(s=O.isMemberOf(h,"WordArray"),n=O.isMemberOf(f,"WordArray"),s&&n){if(!O.isMemberOf(c,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(c,"KedamaFloatArray"))return O.primitiveFail(),null;if(n)if(s)for(u=f.words,o=h.words,l=c.words,r=0;r<=a-1;r++)l[r]=u[r]-o[r];else for(u=f.words,e=h.wordsAsFloat32Array(),i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=u[r]-e[r];else if(s)for(t=f.wordsAsFloat32Array(),o=h.words,i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=t[r]-o[r];else for(t=f.wordsAsFloat32Array(),e=h.wordsAsFloat32Array(),i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=t[r]-e[r];O.pop(4),O.push(c)}function ce(){var e,t,i,r,s,n,a,o,u,l,c=O.stackObjectValue(0),h=O.stackValue(1),f=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(f)),O.success(O.isWords(c)),O.failed())return null;if(o=F(f),O.success(o===F(c)),O.failed())return null;if(n="number"==typeof h,a=O.isMemberOf(f,"WordArray"),n&&a){if(!O.isMemberOf(c,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(c,"KedamaFloatArray"))return O.primitiveFail(),null;if(a)if(n)for(u=f.words,s=h,l=c.words,r=0;r<=o-1;r++)l[r]=u[r]-s;else for(u=f.words,e=O.floatValueOf(h),i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=u[r]-e;else if(n)for(t=f.wordsAsFloat32Array(),s=h,i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=t[r]-s;else for(t=f.wordsAsFloat32Array(),e=O.floatValueOf(h),i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=t[r]-e;O.pop(4),O.push(c)}function q(e){e=90-e/.0174532925199433;return 0=i}function ke(){var e=O.stackFloatValue(0),t=O.stackValue(1),i=O.stackIntegerValue(2);return O.failed()?null:!O.isWords(t)||F(t)>=1),R=Z*M[m]|0,M[m]),l=M[k],c=M[b];for(i=(h=Z*h|0)/Z,c=c,t=(l=l)<=0?1:1-(t=(1-i)/l)/(Math.exp(t)-1),c=d*(c+1),s=Math.cos(c),r=Math.sin(c),s=function(e,t,i,r){var s,n,a,o,u,l,c;if(0<(o=v(0,e,t,i,r)))for(u=0,s=o,n=v(l=1,e,t,i,r);0=H),T.failed())return null;var v,g,k,b,y,S,F,O,I,w=m,A=v,C=k,P=w;for(P=.6*$((M=w)[45]),m=.6*$(M[50]),v=.4*$(M[46]),k=.15*$(M[47]),y=.06*$(M[48]),F=.04*$(M[49]),g=.15*$(M[34]),b=.06*$(M[35]),S=.04*$(M[36]),O=.022*$(M[37]),I=.03*$(M[38]),8<=B&&(16e3<=G?te(19,7500,600):B=6),7<=B&&(16e3<=G?te(18,6500,500):B=6),6<=B&&te(17,M[24],M[25]),5<=B&&te(16,M[22],M[23]),te(15,M[20],M[21]),te(14,M[18],M[19]),te(13,M[16],M[17]),te(12,M[12],M[13]),te(20,M[26],M[27]),te(22,M[30],M[31]),he(21,M[28],M[29]),he(23,M[32],M[33]),ie(1,M[26],M[27],P),ie(2,M[30],M[31],m),ie(3,M[12],M[13],v),ie(4,M[16],M[17],k),ie(5,M[18],M[19],y),ie(6,M[20],M[21],F),ie(7,M[16],M[40],g),ie(8,M[18],M[41],b),ie(9,M[20],M[42],S),ie(10,M[22],M[43],O),ie(11,M[24],M[44],I),0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("Klatt",{setInterpreter:O,primitiveSynthesizeFrameIntoStartingAt:a,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,P=11;function v(e){return"number"==typeof e?j.classSmallInteger():e.sqClass}function _(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function x(e,t){return 0|Math.floor(e/t)}function V(e,t){return e-x(e,t)*t|0}function p(e,t){return 31>>t}var m=0,j=null,s="LargeIntegers v1.5 (e)",g=1,k=2;function L(e,t,i){var r,s,n,a;if(t<1||i<1)return j.primitiveFail();if(s=e,!((e=Math.min(i,o(s.bytes,_(s))))>3),r=1+(e-1>>3),t=V(t-1,8),e=7-V(e-1,8),i==r)return n=p(255,t)&d(255,e),0!=(S(s,i)&n);if(0!==d(S(s,i),t))return 1;for(a=1+i;a<=r-1;a++)if(0!==S(s,a))return 1;return 0!=(255&p(S(s,r),e))}}function u(e,t){var i=j.instantiateClassindexableSize(v(e),t),r=_(e),r=r>>=16,t+=16),e<256||(e>>>=8,t+=8),e<16||(e>>>=4,t+=4),e<4||(e>>>=2,t+=2),e<2||(e>>>=1,++t),t+e}function y(e){for(var t=e,e=t<0?j.classLargeNegativeInteger():j.classLargePositiveInteger(),i=c(t),e=j.instantiateClassindexableSize(e,i),r=e.bytes,s=1;s<=i;s++)r[s-1]=h(t,s);return e}function M(e,t){var i,r,s=_(e);return 0===(r=o(e.bytes,s))?0:(r=r+t+7>>3,i=j.instantiateClassindexableSize(v(e),r),function(e,t,i,r,s){for(var n,a,o,u=e>>3,l=V(e,8),c=u-1,h=0;h<=c;h++)r[h]=0;if(0===l)return b(r,u,s-1,t,0);for(o=8-l,c=i-1,h=n=0;h<=c;h++)a=t[h],r[h+u]=255&(n|p(a,l)),n=d(a,o);0!==n&&(r[s-1]=n)}(t,e.bytes,s,i.bytes,r),i)}function N(e,t,i){var r,i=o(e.bytes,i),s=i+7>>3,i=i-t;return i<=0?j.instantiateClassindexableSize(v(e),0):(i=7+i>>3,r=j.instantiateClassindexableSize(v(e),i),function(e,t,i,r,s){var n,a,o,u,l,c,h=e>>3,f=V(e,8);if(0===f)return b(r,0,s-1,t,h);for(u=8-f,a=d(t[h],f),l=i-1,n=c=1+h;n<=l;n++)o=t[n],r[n-c]=255&(a|p(o,u)),a=d(o,f);0!==a&&(r[s-1]=a)}(t,e.bytes,s,r.bytes,i),r)}function i(e,t){var i,r,s,n=_(e),a=_(t),o=v(e),t=n<=a?(r=e,i=n,s=t,a):(r=t,i=a,s=e,n),a=j.instantiateClassindexableSize(o,t),e=function(e,t,i,r,s){for(var n=0,a=t-1,o=0;o<=a;o++)n=(n>>>8)+e[o]+i[o],s[o]=255&n;for(a=r-1,o=t;o<=a;o++)n=(n>>>8)+i[o],s[o]=255&n;return n>>>8}(r.bytes,i,s.bytes,t,a.bytes);return 0>>8,c=255&v,f=d<3?0:y[d-3];;){if(!((g>>8),c=k[m-1]*(255&u),o=y[p-1]-l-(255&c),y[p-1]=255&o,l=h+(c>>>8)-(o>>=8),++p;if(0>>8)+y[p-1]+k[m-1],y[p-1]=255&l,++p;F[O-P]=u}e=N(e,t,T(n)-1),r=j.instantiateClassindexableSize(j.classArray(),2),j.stObjectatput(r,1,s),j.stObjectatput(r,2,e)}return r}function T(e){return("number"==typeof e?c:_)(e)}function R(e,t,i,r){var s=_(e),n=_(t),a=_(i);if(!(s<=a))return j.primitiveFail();if(!(n<=a))return j.primitiveFail();if(!(0<=r&&r<=255))return j.primitiveFail();for(var o,u,l,c=j.instantiateClassindexableSize(j.classLargePositiveInteger(),a),h=e.bytes,e=s,f=t.bytes,p=n,d=i.bytes,s=a,m=r,v=c.bytes,g=e-1,k=p-1,b=s-1,y=0,S=0;S<=g;S++){for(l=v[0]+h[S]*f[0],l+=(u=l*m&255)*d[0],o=1;o<=k;o++)l=(l>>>8)+v[o]+h[S]*f[o]+u*d[o],v[o-1]=255&l;for(o=p;o<=b;o++)l=(l>>>8)+v[o]+u*d[o],v[o-1]=255&l;v[b]=255&(l=(l>>>8)+y),y=l>>>8}for(S=e;S<=b;S++){for(l=v[0],l+=(u=l*m&255)*d[0],o=1;o<=b;o++)l=(l>>>8)+v[o]+u*d[o],v[o-1]=255&l;v[b]=255&(l=(l>>>8)+y),y=l>>>8}if(0!==y||1!==F(d,v,s))for(S=l=0;S<=b;S++)l=l+v[S]-d[S],v[S]=255&l,l>>=8;return C(c)}function f(e,t,i){var r,s,n,a,o,u,l,c,h,f,p,d=_(e),m=_(t),t=d<=m?(n=e,s=d,r=t,m):(n=t,s=m,r=e,d),m=i?j.classLargeNegativeInteger():j.classLargePositiveInteger(),e=j.instantiateClassindexableSize(m,t+s),v=n.bytes,d=s,g=r.bytes,i=t,k=e.bytes;if(!(1===d&&0===v[0]||1===i&&0===g[0]))for(p=d-1,h=i-1,c=0;c<=p;c++)if(0!==(u=v[c])){for(f=c,o=l=0;o<=h;o++)l=(a=g[o]*u+l+k[f])>>>8,k[f]=255&a,++f;k[f]=l}return w(e)}function S(e,t){return t>_(e)?0:E(e,t)}function O(e,t){var i,r,s,n,a=v(e)===j.classLargeNegativeInteger(),o=_(e),u=_(t);if(o===u){for(;1>=8;for(m=c;m<=f-1;m++)d+=h[m],p[m]=255&d,d>>=8;return(u?A:C)(a)}function D(){return s}function I(e){var t,i;if("number"==typeof e)return 1;if(0!==(i=T(e))&&0!==E(e,i)){if(4h(1073741823,4);if(!(E(e,4)e?1:te?1:t=P}function E(e,t){return e.bytes[t-1]}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("LargeIntegers",{primDigitAddWith:G,primDigitBitShiftMagnitude:Q,primGetModuleName:ue,primDigitBitLogicWithOp:Z,primCheckIfCModuleExists:U,primDigitCompare:ee,primDigitMultiplyNegative:se,primDigitBitShift:Y,primNormalizePositive:fe,primDigitSubtractWith:oe,_primDigitBitShift:K,primDigitMultiplyWithNegative:ne,primDigitSubtract:ae,primDigitDivNegative:ie,primNormalizeNegative:he,primDigitBitOr:J,primMontgomeryTimesModulo:le,primDigitBitAnd:X,primDigitDivWithNegative:re,setInterpreter:pe,primNormalize:ce,primDigitBitXor:$,primDigitCompareWith:te,primDigitAdd:H,getModuleName:D,primAsLargeInteger:z,primAnyBitFromTo:W}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function h(e){return"number"==typeof e?p.classSmallInteger():e.sqClass}function f(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}var p=null,d=0,m=0,v=0,g=0,e="Matrix2x3Plugin 3 November 2014 (e)";function r(){return e}function k(e){return p.failed()?null:p.isWords(e)&&6===f(e)?e.wordsAsFloat32Array():(p.primitiveFail(),null)}function b(e){var t,i;if(!p.failed())return h(e)===p.classPoint()&&((t="number"==typeof(i=p.fetchPointerofObject(0,e)))||i.isFloat)&&(d=t?i:p.floatValueOf(i),(t="number"==typeof(i=p.fetchPointerofObject(1,e)))||i.isFloat)?void(m=t?i:p.floatValueOf(i)):p.primitiveFail()}function y(e){var t,i=d-e[2],r=m-e[5],s=e[0]*e[4]-e[1]*e[3];if(0==s)return p.primitiveFail();t=i*e[4]-e[1]*r,r=e[0]*r-i*e[3],v=t*(s=1/s),g=r*s}function S(e){v=d*e[0]+m*e[1]+e[2],g=d*e[3]+m*e[4]+e[5]}function n(e){return-1073741824<=e&&v<=1073741823}function s(e){var t,i,r,s,n,a,o,u=k(t=p.stackObjectValue(0)),l=k(p.stackObjectValue(1)),c=k(p.stackObjectValue(2));if(p.failed())return null;i=l,u=u,r=c[0]*l[0]+c[1]*l[3],s=c[0]*l[1]+c[1]*l[4],n=c[0]*l[2]+c[1]*l[5]+c[2],a=c[3]*l[0]+c[4]*l[3],o=c[3]*l[1]+c[4]*l[4],i=c[3]*l[2]+c[4]*l[5]+c[5],u[0]=r,u[1]=s,u[2]=n,u[3]=a,u[4]=o,u[5]=i,p.popthenPush(e+1,t)}function a(e){var t;if(b(p.stackObjectValue(0)),t=k(p.stackObjectValue(1)),p.failed())return null;y(t),p.failed()||O(e)}function o(e){var t,i,r,s,n,a,o,u=p.stackObjectValue(0),l=p.stackObjectValue(1),c=k(p.stackObjectValue(2));return p.failed()?null:h(l)!==h(u)||!p.isPointers(l)||2!==f(l)?p.primitiveFail():(b(p.fetchPointerofObject(0,l)),p.failed()||(a=d,o=m,y(c),s=i=v,n=r=g,b(p.fetchPointerofObject(1,l)),p.failed())?null:(l=d,t=m,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=l,m=o,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=a,m=t,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),p.failed()||(u=I(u,s,n,i,r)),void(p.failed()||p.popthenPush(e+1,u))))}function u(e){var t=k(p.stackObjectValue(0));if(p.failed())return null;p.pop(1),p.pushBool(1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5])}function l(e){var t=k(p.stackObjectValue(0));if(p.failed())return null;p.pop(1),p.pushBool(1===t[0]&&0===t[1]&&0===t[3]&&1===t[4])}function c(e){var t;if(b(p.stackObjectValue(0)),t=k(p.stackObjectValue(1)),p.failed())return null;S(t),O(e)}function F(e){var t,i,r,s,n,a,o,u=p.stackObjectValue(0),l=p.stackObjectValue(1),c=k(p.stackObjectValue(2));return p.failed()?null:h(l)!==h(u)||!p.isPointers(l)||2!==f(l)?p.primitiveFail():(b(p.fetchPointerofObject(0,l)),p.failed()||(a=d,o=m,S(c),s=i=v,n=r=g,b(p.fetchPointerofObject(1,l)),p.failed())?null:(l=d,t=m,S(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=l,m=o,S(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=a,m=t,S(c),s=Math.min(s,v),i=Math.max(i,v),u=I(u,s,Math.min(n,g),i,Math.max(r,g)),void(p.failed()||p.popthenPush(e+1,u))))}function O(e){return g+=.5,n(v+=.5)&&n(g)?void p.popthenPush(e+1,p.makePointwithxValueyValue(0|v,0|g)):p.primitiveFail()}function I(e,t,i,r,s){var t=t+.5;return n(t)&&n(r=r+.5)&&n(i=i+.5)&&n(s=s+.5)?(p.pushRemappableOop(e),e=p.makePointwithxValueyValue(0|t,0|i),p.pushRemappableOop(e),t=p.makePointwithxValueyValue(0|r,0|s),e=p.popRemappableOop(),i=p.popRemappableOop(),p.storePointerofObjectwithValue(0,i,e),p.storePointerofObjectwithValue(1,i,t),i):p.primitiveFail()}function w(e){return!1!=((p=e).majorVersion()==t)&&p.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("Matrix2x3Plugin",{primitiveInvertPoint:a,primitiveInvertRectInto:o,primitiveIsIdentity:u,primitiveComposeMatrix:s,setInterpreter:w,primitiveTransformRectInto:F,primitiveIsPureTranslation:l,getModuleName:r,primitiveTransformPoint:c}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function r(e,t){return e-(0|Math.floor(e/t))*t|0}var d=null,e="MiscPrimitivePlugin 3 November 2014 (e)";function h(e,t,i){for(var r,s,n=0;n<=3;n++)t[i+n-1]=255&(r=e,31<(s=8*(3-n))?0:r>>>s);return i+4}function f(e,t,i){return e<=223?(t[i-1]=e,i+1):e<=7935?(t[i-1]=224+(e>>8),t[i]=r(e,256),i+2):(t[i-1]=255,h(e,t,i+1))}function s(){return e}function n(e){d.stackValue(3);var t,i,r,s,n,a=d.stackBytes(2),o=d.stackBytes(1),u=d.stackBytes(0);if(!d.failed()){for(s=a.length,n=o.length,r=1;r<=Math.min(s,n);r++)if((t=u[a[r-1]])!==(i=u[o[r-1]]))return t>>8&255)==(n=255&u)&&(u>>>16&255)==n&&(u>>>24&255)==n,r=s;r>>2))return d.primitiveFail(),null;if(1==(i=3&t))for(r=f[n-1],++n,r=(r|=r<<8)|r<<16,a=1;a<=l;a++)h[o-1]=r,++o;if(2==i){for(r=0,a=1;a<=4;a++)r=r<<8|f[n-1],++n;for(a=1;a<=l;a++)h[o-1]=r,++o}if(3==i)for(u=1;u<=l;u++){for(r=0,a=1;a<=4;a++)r=r<<8|f[n-1],++n;h[o-1]=r,++o}}if(d.failed())return null;d.pop(e)}function l(e){d.stackValue(3);var t,i,r=d.stackBytes(2),s=d.stackBytes(1),n=d.stackIntegerValue(0);if(!d.failed())if(256!==s.length)d.failed()||d.popthenPush(e+1,0);else{for(t=n,i=r.length;t<=i&&0===s[r[t-1]];)++t;i>>14)+101*r&16383)&268435455;d.failed()||d.popthenPush(e+1,i)}return null}function v(e){d.stackValue(4);var t,i=d.stackBytes(3),r=d.stackIntegerValue(2),s=d.stackIntegerValue(1),n=d.stackBytes(0);if(d.failed())return null;for(t=r;t<=s;t++)i[t-1]=n[i[t-1]];if(d.failed())return null;d.pop(e)}function g(e){return!1!=((d=e).majorVersion()==t)&&d.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("MiscPrimitivePlugin",{primitiveConvert8BitSigned:o,primitiveCompareString:n,primitiveTranslateStringWithTable:v,primitiveStringHash:m,primitiveCompressToByteArray:a,primitiveFindSubstring:c,primitiveIndexOfAsciiInString:p,setInterpreter:g,primitiveDecompressFromByteArray:u,getModuleName:s,primitiveFindFirstInString:l}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function x(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function V(e,t){return 0|Math.floor(e/t)}function j(e,t){return e-V(e,t)*t|0}var q=null,e="ScratchPlugin 3 November 2014 (e)";function d(e,t,i,r,s){var n,a=V(i,60),i=j(i,60),o=(1e3-r)*s,u=(1e3-V(r*i,60))*s,r=(1e3-V(r*(60-i),60))*s,i=V(1e3*s,3922);o=V(o,3922),u=V(u,3922),r=V(r,3922),0===a&&(n=(i<<16)+(r<<8)+o),1===a&&(n=(u<<16)+(i<<8)+o),2===a&&(n=(o<<16)+(i<<8)+r),3===a&&(n=(o<<16)+(u<<8)+i),4===a&&(n=(r<<16)+(o<<8)+i),e[t]=n=0===(n=5===a?(i<<16)+(o<<8)+u:n)?1:n}function B(e){return q.success(q.isWordsOrBytes(e)),q.failed()?0:e.wordsAsFloat64Array()}function M(e){return q.success(q.isWords(e)),q.failed()?0:e.words}function r(){return e}function m(e,t,i,r,s){r=s-r;return 0==r?0:(s=e===s?V(60*(t-i),r):t===s?120+V(60*(i-e),r):240+V(60*(e-t),r))<0?s+360:s}function l(e,t,i){var r;return 0===e?t:0===t?e:0===(r=((r=1024-i)*(e>>>16&255)+i*(t>>>16&255)>>10<<16)+(r*(e>>>8&255)+i*(t>>>8&255)>>10<<8)+(r*(255&e)+i*(255&t)>>10))?1:r}function y(e,t,i,r,s){var n,a,o,u=t>>>10;return u<-1||r<=u||(o=i>>>10)<-1||s<=o?0:(t=1023&t,-1===u&&(t=u=0),i=1023&i,-1===o&&(i=o=0),a=16777215&e[n=o*r+u],0<(t=u===r-1?0:t)&&(a=l(a,16777215&e[n+1],t)),0===(i=o===s-1?0:i)?a:(s=16777215&e[n=(o+1)*r+u],0>>16&255,r+=o>>>8&255,e+=255&o,++n);a=0===n?0:(V(u,n)<<16)+(V(r,n)<<8)+V(e,n),m[c*p+l]=a}return q.pop(3),0}function n(){var e,t,i,r,s,n=q.stackValue(2),a=q.stackValue(1),o=q.stackIntegerValue(0),u=M(n),l=x(n),c=M(a);if(q.success(x(a)===l),q.failed())return null;for(t=0;t<=l-1;t++)0!=(s=16777215&u[t])&&(e=m(i=r=s>>>16&255,e=s>>>8&255,s=255&s,r=s<(r=e=r>>1),q.failed())return null;for(i=a.wordsAsInt16Array(),e=o.wordsAsInt16Array(),u&&s++,t=1;t<=r;t++)e[n++]=i[s],s+=2;return q.pop(3),0}function c(){var e,t,i,r,s,n,a,o,u,l,c=q.stackValue(3),h=q.stackValue(2),f=q.stackIntegerValue(1),p=q.stackIntegerValue(0),d=M(c),m=M(h),c=x(c);if(q.success(x(h)===c),q.failed())return null;for(V(c,f),e=f>>1,t=(r=V(c,f))>>1,n=p/100,u=0;u<=f-1;u++)for(l=0;l<=r-1;l++)o=(u-e)/e,i=(l-t)/t,o=(s=Math.pow(Math.sqrt(o*o+i*i),n))<=1?(i=Math.atan2(i,o),a=1024*(e+s*Math.cos(i)*e)|0,1024*(t+s*Math.sin(i)*t)|0):(a=1024*u,1024*l),s=y(d,a,o,f,r),m[l*f+u]=s;return q.pop(4),0}function h(){var e,t,i,r,s,n,a,o,u=M(q.stackValue(11)),l=q.stackIntegerValue(10),c=q.stackIntegerValue(9),h=M(q.stackValue(8)),f=q.stackIntegerValue(7),p=q.stackIntegerValue(6),d=q.stackIntegerValue(5),m=q.stackIntegerValue(4),v=q.stackIntegerValue(3),g=q.stackIntegerValue(2),k=q.stackIntegerValue(1),b=q.stackIntegerValue(0);if(q.success(0<=d&&0<=m),q.success(d+2*k<=l),q.success(m+2*b<=c),q.success(0<=v&&0<=g),q.success(v+k<=f),q.success(g+b<=p),q.failed())return null;for(o=0;o<=b-1;o++)for(n=l*(m+2*o)+d,t=f*(g+o)+v,a=0;a<=k-1;a++)s=16711680&(r=u[n]),i=65280&r,e=255&r,s+=16711680&(r=u[n+1]),e+=255&r,i=(i+=65280&r)+(65280&(r=u[n+l])),e+=255&r,s=(s+=16711680&r)+(16711680&(r=u[n+l+1])),h[t]=s>>>2&16711680|(i+=65280&r)>>>2&65280|(e+=255&r)>>>2,n+=2,++t;return q.pop(12),0}function f(){var e,t,i,r,s,n,a=M(q.stackValue(11)),o=q.stackIntegerValue(10),u=q.stackIntegerValue(9),l=M(q.stackValue(8)),c=q.stackIntegerValue(7),h=q.stackIntegerValue(6),f=q.stackIntegerValue(5),p=q.stackIntegerValue(4),d=q.stackIntegerValue(3),m=q.stackIntegerValue(2),v=q.stackIntegerValue(1),g=q.stackIntegerValue(0);if(q.success(0<=f&&0<=p),q.success(f+2*v<=o),q.success(p+2*g<=u),q.success(0<=d&&0<=m),q.success(d+v<=c),q.success(m+g<=h),q.failed())return null;for(n=0;n<=g-1;n++)for(r=o*(p+2*n)+f,e=c*(m+n)+d,s=0;s<=v-1;s++)t=a[r],i=a[r+o+1],l[e]=(65280&t)+(65280&i)>>>1&65280|(255&t)+(255&i)>>>1|(16711680&t)+(16711680&i)>>>1&16711680,r+=2,++e;return q.pop(12),0}function p(){var e,t,i,r,s,n,a,o,u=q.stackValue(2),l=q.stackValue(1),c=q.stackIntegerValue(0),h=M(u),f=x(u),p=M(l);if(q.success(x(l)===f),q.failed())return null;for(i=0;i<=f-1;i++)0!=(n=16777215&h[i])&&(r=s=a=n>>>16&255,(e=255&n)<(s=(n=n>>>8&255)>>16&255,(e=255&n)<(s=(n=n>>>8&255)>>10)*y+(t>>>10)],u=t>>>10>>10>>10>>16&255)+d*(u>>>16&255)+m*(l>>>16&255)+v*(c>>>16&255))>>>20&255)<<16)|((h=p*(o>>>8&255)+d*(u>>>8&255)+m*(l>>>8&255)+v*(c>>>8&255))>>>20&255)<<8|(h=p*(255&o)+d*(255&u)+m*(255&l)+v*(255&c))>>>20&255)&&(s=1),r[a*O+n]=s,t+=g;i+=k}return q.pop(6),0}function b(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b,y=q.stackValue(5),S=q.stackValue(4),F=q.stackIntegerValue(3),O=M(y),I=M(S),y=x(y),w=q.stackIntegerValue(2),A=q.stackValue(1),C=q.stackValue(0),P=B(A),_=B(C);if(q.success(x(S)===y),q.failed())return null;for(u=V(y,F),e=j(Math.random(),w)-1,d=0;d<=e/2-1;d++)for(k=j(Math.random(),F),b=j(Math.random(),u),f=j(Math.random(),8),a=-4;a<=4;a++)for(o=-4;o<=4;o++)(i=a*a+o*o)<25&&0>1)<(t=(n=V(d,v))>>1)?(u=t/(a=e),1):(u=1,(a=t)=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ScratchPlugin",{primitiveCondenseSound:a,getModuleName:r,primitiveFisheye:c,primitiveWaterRipples1:b,primitiveHalfSizeDiagonal:f,primitiveScale:k,primitiveDoubleSize:o,setInterpreter:F,primitiveWhirl:S,primitiveBlur:s,primitiveBrightnessShift:n,primitiveHalfSizeAverage:h,primitiveSaturationShift:g,primitiveHueShift:p,primitiveInterpolate:v,primitiveExtractChannel:u}):self.setTimeout(e,100)}()}(),registerSocketPlugin(),registerSpeechPlugin(),registerSqueakSSL(),!function(){var t=1,i=11;function I(e,t){return e-(0|Math.floor(e/t))*t|0}var x=511,V=512,S=32768,F=536870912,j=null,e="SoundGenerationPlugin 3 November 2014 (e)";function r(){return e}function s(){var e,t,i,r,s,n,a,o,u=j.stackValue(3),l=j.stackInt16Array(2),c=j.stackIntegerValue(1),h=j.stackIntegerValue(0),f=j.fetchInt32ArrayofObject(7,u),p=j.fetchInt32ArrayofObject(8,u),d=j.fetchIntegerofObject(9,u),m=j.fetchIntegerofObject(10,u),v=j.fetchIntegerofObject(11,u),g=j.fetchInt16ArrayofObject(12,u),k=j.fetchInt16ArrayofObject(13,u);if(j.failed())return null;for(n=c;n<=c+h-1;n++){for(e=t=0,o=1;o<=d;o++)(i=v-f[o-1])<1&&(i+=m),e+=(a=p[o-1])*g[i-1],t+=a*k[i-1];(s=32767<(s=l[(r=2*n-1)-1]+(e>>15))?32767:s)<-32767&&(s=-32767),l[r-1]=s,g[v-1]=s,(s=32767<(s=l[++r-1]+(t>>15))?32767:s)<-32767&&(s=-32767),l[r-1]=s,k[v-1]=s,v=I(v,m)+1}if(j.failed())return null;j.storeIntegerofObjectwithValue(11,u,v),j.pop(3)}function n(){var e,t,i,r,s,n,a,o=j.stackValue(5),u=j.stackIntegerValue(4),l=j.stackInt16Array(3),c=j.stackIntegerValue(2),h=j.stackIntegerValue(1),f=j.stackIntegerValue(0),p=j.fetchIntegerofObject(3,o),d=j.fetchIntegerofObject(4,o),m=j.fetchIntegerofObject(5,o),v=j.fetchIntegerofObject(7,o),g=j.fetchInt16ArrayofObject(8,o),k=j.fetchIntegerofObject(9,o),b=j.fetchIntegerofObject(10,o),y=j.fetchIntegerofObject(11,o),S=j.fetchIntegerofObject(14,o),F=j.fetchIntegerofObject(15,o),O=j.fetchIntegerofObject(16,o);if(j.failed())return null;for(e=0!==S&&0!==O,i=c+u-1,a=c;a<=i;a++)n=p*g[b>>15]>>15,e?(r=S*g[F>>15],(F=I(F+O,k))<0&&(F+=k),(b=I(b+y+r,k))<0&&(b+=k)):b=I(b+y,k),0>15))?32767:s)<-32767&&(s=-32767),l[t-1]=s),0>15))?32767:s)<-32767&&(s=-32767),l[t-1]=s),0!==d&&(p+=d,0>15,t=g*k>>15,i=2*m-1,s=m+p-1,h=m;h<=s;h++){if((o=(c=A<(c=(P+=_)>>9)&&F>9:c)+1)>w){if(w>9)}u=n=O[c-1]*(V-(a=P&x))+O[o-1]*a>>9,r&&(u=I[c-1]*(V-a)+I[o-1]*a>>9),0>15))?32767:l)<-32767&&(l=-32767),d[i-1]=l),++i,0>15))?32767:l)<-32767&&(l=-32767),d[i-1]=l),++i,0!==b&&(k+=b,(0>15,t=g*k>>15)}if(S-=p,j.failed())return null;j.storeIntegerofObjectwithValue(3,f,k),j.storeIntegerofObjectwithValue(4,f,b),j.storeIntegerofObjectwithValue(7,f,S),j.storeIntegerofObjectwithValue(19,f,P),j.pop(5)}function o(){var e,t,i,r,s,n,a,o=j.stackValue(5),u=j.stackIntegerValue(4),l=j.stackInt16Array(3),c=j.stackIntegerValue(2),h=j.stackIntegerValue(1),f=j.stackIntegerValue(0),p=j.fetchIntegerofObject(3,o),d=j.fetchIntegerofObject(4,o),m=j.fetchIntegerofObject(5,o),v=j.fetchIntegerofObject(7,o),g=j.fetchInt16ArrayofObject(8,o),k=j.fetchIntegerofObject(9,o),b=j.fetchIntegerofObject(10,o),y=j.fetchIntegerofObject(11,o);if(j.failed())return null;for(t=c+u-1,n=s=k,a=c;a<=t;a++)y<=(s=n+b)&&(s=S+(s-y)),r=g[(n>>15)-1]+g[(s>>15)-1]>>1,r=(g[(n>>15)-1]=r)*p>>15,n=s,0>15))?32767:i)<-32767&&(i=-32767),l[e-1]=i),0>15))?32767:i)<-32767&&(i=-32767),l[e-1]=i),0!==d&&(p+=d,0>>16);n<=g&&i<=t;)s=v[n-1]*f>>15,0>15))?32767:r)<-32767&&(r=-32767),u[e-1]=r),0>15))?32767:r)<-32767&&(r=-32767),u[e-1]=r),0!==p&&(f+=p,0>>16,k-=s<<16),n=b+(k>>>16),++i;if(m-=o,j.failed())return null;j.storeIntegerofObjectwithValue(3,a,f),j.storeIntegerofObjectwithValue(4,a,p),j.storeIntegerofObjectwithValue(7,a,m),j.storeIntegerofObjectwithValue(11,a,k),j.storeIntegerofObjectwithValue(12,a,b),j.pop(5)}function l(e){return!1!=((j=e).majorVersion()==t)&&j.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SoundGenerationPlugin",{primitiveMixFMSound:n,primitiveMixSampledSound:u,setInterpreter:l,getModuleName:r,primitiveApplyReverb:s,primitiveMixPluckedSound:o,primitiveMixLoopedSampledSound:a}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function b(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function y(e,t){return 0|Math.floor(e/t)}var S=null,e="StarSqueakPlugin 3 November 2014 (e)";function F(e){return S.success(S.isWords(e)),S.failed()?0:e.words}function r(){return e}function s(){var e,t,i,r,s,n,a,o,u,l,c,h=S.stackValue(4),f=S.stackValue(3),p=S.stackIntegerValue(2),d=S.stackIntegerValue(1),m=S.stackIntegerValue(0),v=F(h),g=F(f);if(S.success(b(h)===b(f)),S.success(b(h)===p*d),S.failed())return null;for(e=(2*m+1)*(2*m+1),l=0;l<=d-1;l++)for((n=l-m)<0&&(n=0),d<=(i=l+m)&&(i=d-1),o=0;o<=p-1;o++){for((s=o-m)<0&&(s=0),p<=(t=o+m)&&(t=p-1),a=0,c=n;c<=i;c++)for(r=c*p,u=s;u<=t;u++)a+=v[r+u];g[l*p+o]=y(a,e)}S.pop(5)}function n(){var e,t=S.stackValue(1),i=S.stackIntegerValue(0),r=F(t),s=b(t);if(S.failed())return null;for(e=0;e<=s-1;e++)r[e]=r[e]*i>>>10;S.pop(2)}function a(){var e,t,i,r,s,n,a,o,u,l,c=S.stackValue(6),h=S.stackValue(5),f=S.stackIntegerValue(4),p=S.stackIntegerValue(3),d=S.stackIntegerValue(2),m=S.stackIntegerValue(1),v=S.stackIntegerValue(0),g=F(c),k=F(h);if(S.success(b(h)===f*p),S.success(b(h)===b(c)*d*d),S.failed())return null;for((r=0)<(4&m)&&(r+=65536),0<(2&m)&&(r+=256),0<(1&m)&&++r,n=-1,o=0;o<=y(p,d)-1;o++)for(a=0;a<=y(f,d)-1;a++)for(u=g[++n],i=(u=255<(u=(l=v)<0?l<-31?0:u>>>0-l:31=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("StarSqueakPlugin",{primitiveDiffuseFromToWidthHeightDelta:s,primitiveEvaporateRate:n,setInterpreter:o,primitiveMapFromToWidthHeightPatchSizeRgbFlagsShift:a,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,o=11;function i(e){return"number"==typeof e?O.classSmallInteger():e.sqClass}function y(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function S(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function u(e,t){return e-(0|Math.floor(e/t))*t|0}function n(e,t){return 31>>16),h=65535&(l=re(n+1,a,o,t,i)),(c=l>>>16)<=a&&F<=a){for(r=function(e,t){V[P]=e-F,b[P]=t,e=$[e-F],_[e]++,e=t<257?w[t-1]:w[256+(t-1>>>7)];return X[e]++,++j,++P===x||0==(4095&P)&&fe()}(a,n-o),u=1;u<=a-1;u++)E(++n);s=!1,++n}else f=g[n],V[P]=f,b[P]=0,_[f]++,r=++P===x||0==(4095&P)&&fe(),++n<=e&&!r&&(E(n),s=!0,o=h,a=c);if(r)return v=n,!0}v=n}return!1}function ie(e){for(var t=i(e);!t.isNil&&7<=t.classInstSize();)t=t.superclass();return!t.isNil&&(a=t.classInstSize(),1)}function re(e,t,i,r,s){var n,a,o,u,l,c=t<<16|i;if(f<=t)return c;if(!(0<(i=e-(l=A[pe(e+F-1)]))&&i>2t))return O.primitiveFail();for(d|=n(t,m),m+=e;8<=m&&q>>=8,m-=8}function ne(){var e,t,i,r;return 3!==O.methodArgumentCount()?O.primitiveFail():(t=O.stackIntegerValue(0),e=O.stackIntegerValue(1),r=O.stackIntegerValue(2),i=O.stackObjectValue(3),O.failed()?null:function(e){var t;if(O.isPointers(e)&&15<=y(e)&&(t=O.fetchPointerofObject(0,e),O.isBytes(t))){if(0===a){if(!ie(e))return;if(y(e)=x))||(b=t.words,t=O.fetchPointerofObject(a+7,e),!O.isWords(t))||y(t)!==D||(_=t.words,t=O.fetchPointerofObject(a+8,e),!O.isWords(t))||y(t)!==c||(X=t.words,P=O.fetchIntegerofObject(a+9,e),j=O.fetchIntegerofObject(a+10,e),O.failed()))):void 0}}(i)?(r=te(r,e,t),O.failed()||(O.storeIntegerofObjectwithValue(a+2,i,s),O.storeIntegerofObjectwithValue(a+3,i,v),O.storeIntegerofObjectwithValue(a+9,i,P),O.storeIntegerofObjectwithValue(a+10,i,j)),void(O.failed()||(O.pop(4),O.pushBool(r)))):O.primitiveFail())}function ae(){var e,t,i,r,s,n;if(2!==O.methodArgumentCount())return O.primitiveFail();if(e=O.stackIntegerValue(0),r=O.stackObjectValue(1),O.failed())return null;if(!O.isWords(r))return O.primitiveFail();for(n=y(r),s=r.wordsAsInt32Array(),i=0;i<=n-1;i++)t=s[i],s[i]=e<=t?t-e:0;O.pop(2)}function oe(){var e,t;if(2!==O.methodArgumentCount())return O.primitiveFail();if(e=O.stackValue(0),!O.isWords(e))return O.primitiveFail();if(k=e.words,G=y(e),e=O.stackValue(1),!O.isWords(e))return O.primitiveFail();if(Y=e.words,Q=y(e),t=O.stackValue(2),!O.isPointers(t))return O.primitiveFail();if(0===r){if(!function(e){for(var t=i(e);!t.isNil&&13<=t.classInstSize();)t=t.superclass();return!t.isNil&&(r=t.classInstSize(),1)}(t))return O.primitiveFail();if(y(t)>>16)-1)&&(s+=R(i)),c=de(k,G),e=65535&c,0<(i=c>>>16)&&(e+=R(i)),n<=B+s)return d=o,m=a,N=u;for(l=(t=B)-e,r=1;r<=s;r++)g[t+r]=g[l+r];B+=s}}(),void(O.failed()||(O.storeIntegerofObjectwithValue(2,t,B+1),O.storeIntegerofObjectwithValue(r+0,t,T),O.storeIntegerofObjectwithValue(r+1,t,d),O.storeIntegerofObjectwithValue(r+2,t,m),O.storeIntegerofObjectwithValue(r+4,t,N+1),O.pop(2)))):O.primitiveFail()))}function ue(){var e,t,i,r,s,n,a,o;if(4!==O.methodArgumentCount())return O.primitiveFail();if(i=O.stackObjectValue(0),o=O.stackIntegerValue(1),a=O.stackIntegerValue(2),e=O.positive32BitValueOf(O.stackValue(3)),O.failed())return 0;if(!(O.isBytes(i)&&a<=o&&0>>16&65535,r=--a;r<=o;r++)s=u(s+t[r],65521),n=u(n+s,65521);O.popthenPush(5,O.positive32BitIntegerFor((n<<16)+s))}function le(){var e,t,i,r,s,n;if(4!==O.methodArgumentCount())return O.primitiveFail();if(t=O.stackObjectValue(0),n=O.stackIntegerValue(1),s=O.stackIntegerValue(2),i=O.positive32BitValueOf(O.stackValue(3)),O.failed())return 0;if(!(O.isBytes(t)&&s<=n&&0>>8;O.popthenPush(5,O.positive32BitIntegerFor(i))}function ce(){var e,t,i,r,s;return 4!==O.methodArgumentCount()?O.primitiveFail():(t=O.stackObjectValue(0),i=O.stackObjectValue(1),e=O.stackObjectValue(2),s=O.stackObjectValue(3),r=O.stackObjectValue(4),O.failed()?null:function(e){var t;if(0===a){if(!ie(e))return;if(y(e)=a+3&&(t=O.fetchPointerofObject(0,e),O.isBytes(t)?(g=t.bytes,I=S(t),q=O.fetchIntegerofObject(1,e),B=O.fetchIntegerofObject(2,e),d=O.fetchIntegerofObject(a+0,e),m=O.fetchIntegerofObject(a+1,e),!O.failed()):O.primitiveFail())}(r)&&O.isPointers(t)&&2<=y(t)&&O.isPointers(i)&&2<=y(i)&&O.isPointers(s)&&3<=y(s)&&O.isPointers(e)&&3<=y(e)?(s=function(e,t,i,r){var s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b;if(k=O.fetchPointerofObject(0,e),m=O.fetchIntegerofObject(1,e),d=O.fetchIntegerofObject(2,e),!(m<=d&&O.isBytes(k)&&d<=S(k)))return O.primitiveFail();if(f=k.bytes,k=O.fetchPointerofObject(0,t),!(O.isWords(k)&&d<=y(k)&&O.fetchIntegerofObject(1,t)===m&&O.fetchIntegerofObject(2,t)===d))return O.primitiveFail();if(a=k.words,k=O.fetchPointerofObject(0,i),!O.isWords(k))return O.primitiveFail();if(p=y(k),v=k.words,k=O.fetchPointerofObject(1,i),!O.isWords(k)||p!==y(k))return O.primitiveFail();if(g=k.words,k=O.fetchPointerofObject(0,r),!O.isWords(k))return O.primitiveFail();if(u=y(k),o=k.words,k=O.fetchPointerofObject(1,r),!O.isWords(k)||u!==y(k))return O.primitiveFail();l=k.words,L(0,0),b=0;for(;m>>7)])=o}function fe(){var e;return P===x||0==(4095&P)&&!(10*j<=P||(e=P-j)<=j)&&4*e<=j}function pe(e){return e=g[e],32767&(s<<5^e)}function de(e,t){var i,r,s=e[0]>>>24;if(16>>24&255))return O.primitiveFail(),0}return 0}function R(e){for(var t,i,r,s;m>>s,m-=e,t}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ZipPlugin",{primitiveZipSendBlock:ce,primitiveUpdateAdler32:ue,primitiveUpdateGZipCrc32:le,primitiveDeflateUpdateHashTable:ae,setInterpreter:he,getModuleName:se,primitiveDeflateBlock:ne,primitiveInflateDecompressBlock:oe}):self.setTimeout(e,100)}()}();var LZString$1={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_f:String.fromCharCode,compressToBase64:function(e){if(null==e)return"";var t,i,r,s,n,a,o,u="",l=0;for(e=LZString$1.compress(e);l<2*e.length;)l%2==0?(t=e.charCodeAt(l/2)>>8,i=255&e.charCodeAt(l/2),r=l/2+1>8:NaN):(t=255&e.charCodeAt((l-1)/2),(l+1)/2>8,r=255&e.charCodeAt((l+1)/2)):i=r=NaN),l+=3,s=t>>2,n=(3&t)<<4|i>>4,a=(15&i)<<2|r>>6,o=63&r,isNaN(i)?a=o=64:isNaN(r)&&(o=64),u=u+LZString$1._keyStr.charAt(s)+LZString$1._keyStr.charAt(n)+LZString$1._keyStr.charAt(a)+LZString$1._keyStr.charAt(o);return u},decompressFromBase64:function(e){if(null==e)return"";var t,i,r,s,n,a,o="",u=0,l=0,c=LZString$1._f;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,r=(15&n)<<4|(n=LZString$1._keyStr.indexOf(e.charAt(l++)))>>2,s=(3&n)<<6|(a=LZString$1._keyStr.indexOf(e.charAt(l++))),u%2==0?(t=i<<8,64!=n&&(o+=c(t|r)),64!=a&&(t=s<<8)):(o+=c(t|i),64!=n&&(t=r<<8),64!=a&&(o+=c(t|s))),u+=3;return LZString$1.decompress(o)},compressToUTF16:function(e){if(null==e)return"";var t,i,r,s="",n=0,a=LZString$1._f;for(e=LZString$1.compress(e),t=0;t>1)),r=(1&i)<<14;break;case 1:s+=a(r+(i>>2)+32),r=(3&i)<<13;break;case 2:s+=a(r+(i>>3)+32),r=(7&i)<<12;break;case 3:s+=a(r+(i>>4)+32),r=(15&i)<<11;break;case 4:s+=a(r+(i>>5)+32),r=(31&i)<<10;break;case 5:s+=a(r+(i>>6)+32),r=(63&i)<<9;break;case 6:s+=a(r+(i>>7)+32),r=(127&i)<<8;break;case 7:s+=a(r+(i>>8)+32),r=(255&i)<<7;break;case 8:s+=a(r+(i>>9)+32),r=(511&i)<<6;break;case 9:s+=a(r+(i>>10)+32),r=(1023&i)<<5;break;case 10:s+=a(r+(i>>11)+32),r=(2047&i)<<4;break;case 11:s+=a(r+(i>>12)+32),r=(4095&i)<<3;break;case 12:s+=a(r+(i>>13)+32),r=(8191&i)<<2;break;case 13:s+=a(r+(i>>14)+32),r=(16383&i)<<1;break;case 14:s+=a(r+(i>>15)+32,32+(32767&i)),n=0}return s+a(r+32)},decompressFromUTF16:function(e){if(null==e)return"";for(var t,i,r="",s=0,n=0,a=LZString$1._f;n>14),t=(16383&i)<<2;break;case 2:r+=a(t|i>>13),t=(8191&i)<<3;break;case 3:r+=a(t|i>>12),t=(4095&i)<<4;break;case 4:r+=a(t|i>>11),t=(2047&i)<<5;break;case 5:r+=a(t|i>>10),t=(1023&i)<<6;break;case 6:r+=a(t|i>>9),t=(511&i)<<7;break;case 7:r+=a(t|i>>8),t=(255&i)<<8;break;case 8:r+=a(t|i>>7),t=(127&i)<<9;break;case 9:r+=a(t|i>>6),t=(63&i)<<10;break;case 10:r+=a(t|i>>5),t=(31&i)<<11;break;case 11:r+=a(t|i>>4),t=(15&i)<<12;break;case 12:r+=a(t|i>>3),t=(7&i)<<13;break;case 13:r+=a(t|i>>2),t=(3&i)<<14;break;case 14:r+=a(t|i>>1),t=(1&i)<<15;break;case 15:r+=a(t|i),s=0}n++}return LZString$1.decompress(r)},compress:function(e){if(null==e)return"";for(var t,i,r,s,n={},a={},o="",u=2,l=3,c=2,h="",f=0,p=0,d=LZString$1._f,m=0;m>=1}else{for(i=1,t=0;t>=1}0==--u&&(u=Math.pow(2,c),c++),delete a[o]}else for(i=n[o],t=0;t>=1;0==--u&&(u=Math.pow(2,c),c++),n[s]=l++,o=String(r)}if(""!==o){if(Object.prototype.hasOwnProperty.call(a,o)){if(o.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--u&&(u=Math.pow(2,c),c++),delete a[o]}else for(i=n[o],t=0;t>=1;0==--u&&(u=Math.pow(2,c),c++)}for(i=2,t=0;t>=1;for(;;){if(f<<=1,15==p){h+=d(f);break}p++}return h},decompress:function(e){if(null==e)return"";if(""==e)return null;for(var t,i,r,s,n,a,o=[],u=4,l=4,c=3,h="",f="",p=LZString$1._f,d={string:e,val:e.charCodeAt(0),position:32768,index:1},m=0;m<3;m+=1)o[m]=m;for(i=0,s=Math.pow(2,2),n=1;n!=s;)r=d.val&d.position,d.position>>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0d.string.length)return"";for(i=0,s=Math.pow(2,c),n=1;n!=s;)r=d.val&d.position,d.position>>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>4,n=1>6:64,a=2>2)+p.charAt(s)+p.charAt(n)+p.charAt(a));return o.join("")},i.decode=function(e){var t,i,r,s,n,a,o,u=0,l=0,c=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;for(e.charAt(e.length-1)===p.charAt(64)&&c--,e.charAt(e.length-2)===p.charAt(64)&&c--,o=new(f.uint8array?Uint8Array:Array)(c);u>2,i=(3&n)<<6|(a=p.indexOf(e.charAt(u++))),o[l++]=r<<2|s>>4,64!==n&&(o[l++]=t),64!==a&&(o[l++]=i);return o}},{"./support":27,"./utils":29}],2:[function(e,t,i){var r=e("./external"),s=e("./stream/DataWorker"),n=e("./stream/DataLengthProbe"),a=e("./stream/Crc32Probe"),n=e("./stream/DataLengthProbe");function o(e,t,i,r,s){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=r,this.compressedContent=s}o.prototype={getContentWorker:function(){var e=new s(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new n("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new s(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,i){return e.pipe(new a).pipe(new n("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new n("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(e,t,i){var r=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(e,t,i){var d=e("./utils");var m=function(){for(var e=[],t=0;t<256;t++){for(var i=t,r=0;r<8;r++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t){if(void 0===e||!e.length)return 0;if("string"!==d.getTypeOf(e)){var i=0|t,r=e,s=e.length,n=0,a=m,o=n+s;i^=-1;for(var u=n;u>>8^a[255&(i^r[u])];return-1^i}var l=0|t,c=e,s=e.length,n=0,h=m,f=n+s;l^=-1;for(var p=n;p>>8^h[255&(l^c.charCodeAt(p))];return-1^l}},{"./utils":29}],5:[function(e,t,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,t,i){e=e("es6-promise").Promise;t.exports={Promise:e}},{"es6-promise":37}],7:[function(e,t,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=e("pako"),n=e("./utils"),a=e("./stream/GenericWorker"),o=r?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=new s[e]({raw:!0,level:t.level||-1}),this.meta={};var i=this;this._pako.onData=function(e){i.push({data:e,meta:i.meta})}}i.magic="\b\0",n.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,this._pako.push(n.transformTo(o,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},i.compressWorker=function(e){return new u("Deflate",e)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(e,t,i){function k(e,t){for(var i="",r=0;r>>=8;return i}function r(e,t,i,r,s,n){var a=e.file,o=e.compression,u=n!==y.utf8encode,l=b.transformTo("string",n(a.name)),c=b.transformTo("string",y.utf8encode(a.name)),h=a.comment,n=b.transformTo("string",n(h)),f=b.transformTo("string",y.utf8encode(h)),p=c.length!==a.name.length,h=f.length!==h.length,d="",m=a.dir,v=a.date,g={crc32:0,compressedSize:0,uncompressedSize:0},i=(t&&!i||(g.crc32=e.crc32,g.compressedSize=e.compressedSize,g.uncompressedSize=e.uncompressedSize),0),e=(t&&(i|=8),u||!p&&!h||(i|=2048),0),t=0,v=(m&&(e|=16),"UNIX"===s?(t=798,e|=(u=a.unixPermissions,s=m,(65535&(u?u:s?16893:33204))<<16)):(t=20,e|=63&(a.dosPermissions||0)),m=v.getUTCHours(),m<<=6,m=(m=(m|v.getUTCMinutes())<<5)|v.getUTCSeconds()/2,u=v.getUTCFullYear()-1980,u=(u=((u<<=4)|v.getUTCMonth()+1)<<5)|v.getUTCDate(),p&&(s=k(1,1)+k(S(l),4)+c,d+="up"+k(s.length,2)+s),h&&(a=k(1,1)+k(S(n),4)+f,d+="uc"+k(a.length,2)+a),""),v=(v=(v=(v=(v=(v=(v=(v=(v=(v+="\n\0")+k(i,2))+o.magic)+k(m,2))+k(u,2))+k(g.crc32,4))+k(g.compressedSize,4))+k(g.uncompressedSize,4))+k(l.length,2))+k(d.length,2);return{fileRecord:F.LOCAL_FILE_HEADER+v+l+d,dirRecord:F.CENTRAL_FILE_HEADER+k(t,2)+v+k(n.length,2)+"\0\0\0\0"+k(e,4)+k(r,4)+l+d+n}}var b=e("../utils"),s=e("../stream/GenericWorker"),y=e("../utf8"),S=e("../crc32"),F=e("../signature");function n(e,t,i,r){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}b.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-r-1))/i:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name,this.streamFiles&&!e.file.dir?(e=r(e,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t=r(e,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),this.streamFiles&&!e.file.dir)this.push({data:(e=e,F.DATA_DESCRIPTOR+k(e.crc32,4)+k(e.compressedSize,4)+k(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""}(e))&&n.call(this,s,!0),"string"===r&&!1===i.binary&&!1===i.base64);i.binary=!s;(t instanceof c&&0===t.uncompressedSize||i.dir||!t||0===t.length)&&(i.base64=!1,i.binary=!0,t="",i.compression="STORE");r=null,r=t instanceof c||t instanceof o?t:p.isNode&&p.isStream(t)?new d(e,t):a.prepareContent(e,t,i.binary,i.optimizedBinaryString,i.base64),s=new h(e,r,i);this.files[e]=s},v=function(e){return"/"!==e.slice(-1)&&(e+="/"),e};function g(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,i,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],i=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(i,r)},filter:function(i){var r=[];return this.forEach(function(e,t){i(e,t)&&r.push(t)}),r},file:function(e,t,i){var r,s;return 1===arguments.length?g(e)?(r=e,this.filter(function(e,t){return!t.dir&&r.test(e)})):(s=this.files[this.root+e])&&!s.dir?s:null:(e=this.root+e,m.call(this,e,t,i),this)},folder:function(i){var e,t;return i?g(i)?this.filter(function(e,t){return t.dir&&i.test(e)}):(e=this.root+i,e=n.call(this,e),(t=this.clone()).root=e.name,t):this},remove:function(i){i=this.root+i;var e=this.files[i];if(e||("/"!==i.slice(-1)&&(i+="/"),e=this.files[i]),e&&!e.dir)delete this.files[i];else for(var t=this.filter(function(e,t){return t.name.slice(0,i.length)===i}),r=0;r=this.index;t--)i=(i<<8)+this.byteAt(t);return this.index+=e,i},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=s},{"../utils":29}],16:[function(e,t,i){var r=e("./Uint8ArrayReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=s},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(e,t,i){var r=e("./DataReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},s.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},s.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},s.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=s},{"../utils":29,"./DataReader":15}],18:[function(e,t,i){var r=e("./ArrayReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.readData=function(e){var t;return this.checkOffset(e),0===e?new Uint8Array(0):(t=this.data.subarray(this.zero+this.index,this.zero+this.index+e),this.index+=e,t)},t.exports=s},{"../utils":29,"./ArrayReader":14}],19:[function(e,t,i){var r=e("../utils"),s=e("../support"),n=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||s.uint8array?"nodebuffer"===t?new o(e):s.uint8array?new u(r.transformTo("uint8array",e)):new n(r.transformTo("array",e)):new a(e)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(e,t,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],21:[function(e,t,i){var r=e("./GenericWorker"),s=e("../utils");function n(e){r.call(this,"ConvertWorker to "+e),this.destType=e}s.inherits(n,r),n.prototype.processChunk=function(e){this.push({data:s.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":29,"./GenericWorker":25}],22:[function(e,t,i){var r=e("./GenericWorker"),s=e("../crc32");function n(){r.call(this,"Crc32Probe")}e("../utils").inherits(n,r),n.prototype.processChunk=function(e){this.streamInfo.crc32=s(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(e,t,i){var r=e("../utils"),s=e("./GenericWorker");function n(e){s.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(n,s),n.prototype.processChunk=function(e){var t;e&&(t=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=t+e.data.length),s.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":29,"./GenericWorker":25}],24:[function(e,t,i){var r=e("../utils"),s=e("./GenericWorker");function n(e){s.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(n,s),n.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished)||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0)},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":29,"./GenericWorker":25}],25:[function(e,t,i){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i "+e:e}},t.exports=r},{}],26:[function(a,o,e){!function(u){var l=a("../utils"),s=a("./ConvertWorker"),n=a("./GenericWorker"),c=a("../base64"),t=a("../nodejs/NodejsStreamOutputAdapter"),i=a("../external");function r(e,o){return new i.Promise(function(t,i){var r=[],s=e._internalType,n=e._outputType,a=e._mimeType;e.on("data",function(e,t){r.push(e),o&&o(t)}).on("error",function(e){r=[],i(e)}).on("end",function(){try{var e=function(e,t,i){switch(e){case"blob":return l.newBlob(l.transformTo("arraybuffer",t),i);case"base64":return c.encode(t);default:return l.transformTo(e,t)}}(n,function(e,t){for(var i=0,r=null,s=0,n=0;n>>6:(i<65536?t[s++]=224|i>>>12:(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63),t[s++]=128|i>>>6&63),t[s++]=128|63&i);return t},s.utf8decode=function(e){if(l.nodebuffer)return u.transformTo("nodebuffer",e).toString("utf-8");for(var t,i,r=e=u.transformTo(l.uint8array?"uint8array":"array",e),s=r.length,n=new Array(2*s),a=0,o=0;o>10&1023,n[a++]=56320|1023&t)}return n.length!==a&&(n.subarray?n=n.subarray(0,a):n.length=a),u.applyFromCharCode(n)},u.inherits(n,i),n.prototype.processChunk=function(e){var t=u.transformTo(l.uint8array?"uint8array":"array",e.data),i=(this.leftOver&&this.leftOver.length&&(l.uint8array?(i=t,(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)):t=this.leftOver.concat(t),this.leftOver=null),function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+h[e[i]]>t?i:t}(t)),r=t;i!==t.length&&(l.uint8array?(r=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(r=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:s.utf8decode(r),meta:e.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=n,u.inherits(a,i),a.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=a},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(e,t,o){var u=e("./support"),l=e("./base64"),i=e("./nodejsUtils"),r=e("asap"),c=e("./external");function s(e){return e}function h(e,t){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){var t;this.extraFields[1]&&(t=r(this.extraFields[1].value),this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS)&&(this.diskNumberStart=t.readInt(4))},readExtraFields:function(e){var t,i,r,s=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index>>6:(i<65536?t[s++]=224|i>>>12:(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63),t[s++]=128|i>>>6&63),t[s++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new u.Buf8(e.length),i=0,r=t.length;i>10&1023,n[a++]=56320|1023&i)}return c(n,a)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+l[e[i]]>t?i:t}},{"./common":41}],43:[function(e,t,i){t.exports=function(e,t,i,r){for(var s=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,r){var s=o,n=r+i;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,N,t){var o,h=e("../utils/common"),u=e("./trees"),f=e("./adler32"),p=e("./crc32"),T=e("./messages"),l=0,c=4,d=0,m=-2,E=-1,L=4,R=2,v=8,D=9,i=286,W=30,z=19,U=2*i+1,K=15,g=3,k=258,b=k+g+1,y=42,S=113,F=1,O=2,I=3,w=4;function A(e,t){return e.msg=T[t],t}function C(e){return(e<<1)-(4e.avail_out?e.avail_out:i)&&(h.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending)&&(t.pending_out=0)}function x(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,_(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function j(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function n(e,t){var i,r,s=e.max_chain_length,n=e.strstart,a=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,l=e.window,c=e.w_mask,h=e.prev,f=e.strstart+k,p=l[n+a-1],d=l[n+a];e.prev_length>=e.good_match&&(s>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(i=t)+a]===d&&l[i+a-1]===p&&l[i]===l[n]&&l[++i]===l[n+1]){for(n+=2,i++;l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&nu&&0!=--s);return a<=e.lookahead?a:e.lookahead}function q(e){var t,i,r,s,n,a,o,u,l,c=e.w_size;do{if(u=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-b)){for(h.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=i=e.hash_size;r=e.head[--t],e.head[t]=c<=r?r-c:0,--i;);for(t=i=c;r=e.prev[--t],e.prev[t]=c<=r?r-c:0,--i;);u+=c}if(0===e.strm.avail_in)break;if(n=e.strm,a=e.window,o=e.strstart+e.lookahead,u=u,l=void 0,l=n.avail_in,i=0===(l=u=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(r=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(s=e.strstart+e.lookahead-g,r=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=s&&(e.ins_h=(e.ins_h<>1,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=n,o.method=i,M(e)}o=[new a(0,0,0,0,function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===l)return F;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,x(e,!1),0===e.strm.avail_out))return F;if(e.strstart-e.block_start>=e.w_size-b&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),F)}),new a(4,4,8,4,r),new a(4,5,16,8,r),new a(4,6,32,32,r),new a(4,4,16,16,s),new a(8,16,32,32,s),new a(8,16,128,128,s),new a(8,32,128,256,s),new a(32,128,258,1024,s),new a(32,258,258,4096,s)],t.deflateInit=function(e,t){return G(e,t,v,15,8,0)},t.deflateInit2=G,t.deflateReset=M,t.deflateResetKeep=B,t.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?m:(e.state.gzhead=t,d)},t.deflate=function(e,t){var i,r,s,n;if(!e||!e.state||5>8&255),V(r,r.gzhead.time>>16&255),V(r,r.gzhead.time>>24&255),V(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),V(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(V(r,255&r.gzhead.extra.length),V(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=p(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(V(r,0),V(r,0),V(r,0),V(r,0),V(r,0),V(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),V(r,3),r.status=S)):(a=v+(r.w_bits-8<<4)<<8,a|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=S,j(r,a),0!==r.strstart&&(j(r,e.adler>>>16),j(r,65535&e.adler)),e.adler=1)),69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending!==r.pending_buf_size));)V(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending===r.pending_buf_size)){n=1;break}}while(n=r.gzindexs&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending===r.pending_buf_size)){n=1;break}}while(n=r.gzindexs&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),0===n&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&_(e),r.pending+2<=r.pending_buf_size&&(V(r,255&e.adler),V(r,e.adler>>8&255),e.adler=0,r.status=S)):r.status=S),0!==r.pending){if(_(e),0===e.avail_out)return r.last_flush=-1,d}else if(0===e.avail_in&&C(t)<=C(i)&&t!==c)return A(e,-5);if(666===r.status&&0!==e.avail_in)return A(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==l&&666!==r.status){var a=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===l)return F;break}if(e.match_length=0,i=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?F:O}(r,t):3===r.strategy?function(e,t){for(var i,r,s,n,a=e.window;;){if(e.lookahead<=k){if(q(e),e.lookahead<=k&&t===l)return F;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(i=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?F:O}(r,t):o[r.level].func(r,t);if(a!==I&&a!==w||(r.status=666),a===F||a===I)return 0===e.avail_out&&(r.last_flush=-1),d;if(a===O&&(1===t?u._tr_align(r):5!==t&&(u._tr_stored_block(r,0,0,!1),3===t)&&(P(r.head),0===r.lookahead)&&(r.strstart=0,r.block_start=0,r.insert=0),_(e),0===e.avail_out))return r.last_flush=-1,d}return t!==c||!(r.wrap<=0)&&(2===r.wrap?(V(r,255&e.adler),V(r,e.adler>>8&255),V(r,e.adler>>16&255),V(r,e.adler>>24&255),V(r,255&e.total_in),V(r,e.total_in>>8&255),V(r,e.total_in>>16&255),V(r,e.total_in>>24&255)):(j(r,e.adler>>>16),j(r,65535&e.adler)),_(e),0=i.w_size&&(0===n&&(P(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new h.Buf8(i.w_size),h.arraySet(u,t,l-i.w_size,i.w_size,0),t=u,l=i.w_size),u=e.avail_in,a=e.next_in,o=e.input,e.avail_in=l,e.next_in=0,e.input=t,q(i);i.lookahead>=g;){for(r=i.strstart,s=i.lookahead-(g-1);i.ins_h=(i.ins_h<>>=r=i>>>24,F-=r,0===(r=i>>>16&255))p[f++]=65535&i;else{if(!(16&r)){if(0==(64&r)){i=O[(65535&i)+(S&(1<>>=r,F-=r),F<15&&(S+=c[l++]<>>=r=i>>>24,F-=r,!(16&(r=i>>>16&255))){if(0==(64&r)){i=I[(65535&i)+(S&(1<>>=r,F-=r,(r=f-d)>3)<<3))-1,e.next_in=l-=s,e.next_out=f,e.avail_in=l>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new V.Buf16(320),this.work=new V.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=R,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new V.Buf32(r),t.distcode=t.distdyn=new V.Buf32(s),t.sane=1,t.back=-1,E):L}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):L}function u(e,t){var i,r;return!e||!e.state||(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(V.arraySet(e.window,t,i-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(r<(s=e.wsize-e.wnext)&&(s=r),V.arraySet(e.window,t,i-r,s,e.wnext),(r-=s)?(V.arraySet(e.window,t,i-r,r,0),e.wnext=r,e.whave=e.wsize):(e.wnext+=s,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,i.check=q(i.check,C,2,0),c=l=0,i.mode=2;else if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31)e.msg="incorrect header check",i.mode=30;else if(8!=(15&l))e.msg="unknown compression method",i.mode=30;else{if(c-=4,F=8+(15&(l>>>=4)),0===i.wbits)i.wbits=F;else if(F>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(C[0]=255&l,C[1]=l>>>8&255,i.check=q(i.check,C,2,0)),c=l=0,i.mode=3;case 3:for(;c<32;){if(0===o)break e;o--,l+=r[n++]<>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,i.check=q(i.check,C,4,0)),c=l=0,i.mode=4;case 4:for(;c<16;){if(0===o)break e;o--,l+=r[n++]<>8),512&i.flags&&(C[0]=255&l,C[1]=l>>>8&255,i.check=q(i.check,C,2,0)),c=l=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===o)break e;o--,l+=r[n++]<>>8&255,i.check=q(i.check,C,2,0)),c=l=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((p=o<(p=i.length)?o:p)&&(i.head&&(F=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),V.arraySet(i.head.extra,r,n,p,F)),512&i.flags&&(i.check=q(i.check,r,p,n)),o-=p,n+=p,i.length-=p),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===o)break e;for(p=0;F=r[n+p++],i.head&&F&&i.length<65536&&(i.head.name+=String.fromCharCode(F)),F&&p>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===o)break e;o--,l+=r[n++]<>>=7&c,c-=7&c,i.mode=27;else{for(;c<3;){if(0===o)break e;o--,l+=r[n++]<>>=1)){case 0:i.mode=14;break;case 1:_=x=void 0;var _,x=i;if(U){for(W=new V.Buf32(512),z=new V.Buf32(32),_=0;_<144;)x.lens[_++]=8;for(;_<256;)x.lens[_++]=9;for(;_<280;)x.lens[_++]=7;for(;_<288;)x.lens[_++]=8;for(M(N,x.lens,0,288,W,0,x.work,{bits:9}),_=0;_<32;)x.lens[_++]=5;M(T,x.lens,0,32,z,0,x.work,{bits:5}),U=!1}if(x.lencode=W,x.lenbits=9,x.distcode=z,x.distbits=5,i.mode=20,6!==t)break;l>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}l>>>=2,c-=2}break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,l+=r[n++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&l,c=l=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(p=i.length){if(0===(p=u<(p=o>>=5,c-=5,i.ndist=1+(31&l),l>>>=5,c-=5,i.ncode=4+(15&l),l>>>=4,c-=4,286>>=3,c-=3}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,I={bits:i.lenbits},O=M(0,i.lens,0,19,i.lencode,0,i.work,I),i.lenbits=I.bits,O){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=v,c-=v,i.lens[i.have++]=k;else{if(16===k){for(w=v+2;c>>=v,c-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}F=i.lens[i.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===k){for(w=v+3;c>>=v)),l>>>=3,c=c-v-3}else{for(w=v+7;c>>=v)),l>>>=7,c=c-v-7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;p--;)i.lens[i.have++]=F}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,I={bits:i.lenbits},O=M(N,i.lens,0,i.nlen,i.lencode,0,i.work,I),i.lenbits=I.bits,O){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,I={bits:i.distbits},O=M(T,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,I),i.distbits=I.bits,O){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=o&&258<=u){e.next_out=a,e.avail_out=u,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=c,B(e,f),a=e.next_out,s=e.output,u=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;g=(A=i.lencode[l&(1<>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>b)])>>>16&255,k=65535&A,!(b+(v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=b,c-=b,i.back+=b}if(l>>>=v,c-=v,i.back+=v,i.length=k,0===g){i.mode=26;break}if(32&g){i.back=-1,i.mode=12;break}if(64&g){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&g,i.mode=22;case 22:if(i.extra){for(w=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;g=(A=i.distcode[l&(1<>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>b)])>>>16&255,k=65535&A,!(b+(v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=b,c-=b,i.back+=b}if(l>>>=v,c-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=30;break}i.offset=k,i.extra=15&g,i.mode=24;case 24:if(i.extra){for(w=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===u)break e;if(i.offset>(p=f-u)){if((p=i.offset-p)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}d=p>i.wnext?(p-=i.wnext,i.wsize-p):i.wnext-p,p>i.length&&(p=i.length),m=i.window}else m=s,d=a-i.offset,p=i.length;for(u-=p=up?(m=j[q+a[b]],P[_+a[b]]):(m=96,0),u=1<<(d=k-I),y=l=1<>I)+(l-=u)]=d<<24|m<<16|v|0,0!==l;);for(u=1<>=1;if(C=0!==u?(C&u-1)+u:0,b++,0==--x[k]){if(k===S)break;k=t[i+a[b]]}if(F>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function M(e,t,i){e.bi_valid>r-i?(e.bi_buf|=t<>r-e.bi_valid,e.bi_valid+=i-r):(e.bi_buf|=t<>>=1,i<<=1,0<--t;);return i>>>1}function W(e,t,i){for(var r,s=new Array(A+1),n=0,a=1;a<=A;a++)s[a]=n=n+i[a-1]<<1;for(r=0;r<=t;r++){var o=e[2*r+1];0!==o&&(e[2*r]=D(s[o]++,o))}}function z(e){for(var t=0;t>1;1<=i;i--)T(e,n,i);for(s=u;i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,n,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,n[2*s]=n[2*i]+n[2*r],e.depth[s]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,n[2*i+1]=n[2*r+1]=s,e.heap[1]=s++,T(e,n,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,h,f,p,d,m=e,v=t.dyn_tree,g=t.max_code,k=t.stat_desc.static_tree,b=t.stat_desc.has_stree,y=t.stat_desc.extra_bits,S=t.stat_desc.extra_base,F=t.stat_desc.max_length,O=0,I=0;I<=A;I++)m.bl_count[I]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c>=7;a>>=1)if(1&t&&0!==e.dyn_ltree[2*i])return c;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(i=32;i>>3,(n=e.static_len+3+7>>>3)<=s&&(s=n)):s=n=i+5,i+4<=s&&-1!==t)J(e,t,i,r);else if(4===e.strategy||n===s)M(e,2+(r?1:0),3),H(e,I,C);else{M(e,4+(r?1:0),3);var o,u=e,t=e.l_desc.max_code+1,i=e.d_desc.max_code+1,l=a+1;for(M(u,t-257,5),M(u,i-1,5),M(u,l-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(_[i]+p+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},e._tr_align=function(e){M(e,2,3),N(e,g,I),16===(e=e).bi_valid?(s(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,i){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[10])(10)}),!function(o){var u,l,c,h,f,p,d,t,m,v,r,e;void 0===o||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)||(e=o.document,u=function(){return o.URL||o.webkitURL||o},l=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in l,h=/constructor/i.test(o.HTMLElement)||o.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),p=o.setImmediate||o.setTimeout,d=function(e){p(function(){throw e},0)},t=4e4,m=function(e){setTimeout(function(){"string"==typeof e?u().revokeObjectURL(e):e.remove()},t)},v=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},e=(r=function(e,i,t){t||(e=v(e));var r,s,n=this,t="application/octet-stream"===e.type,a=function(){for(var e=n,t="writestart progress write writeend".split(" "),i=void 0,r=(t=[].concat(t)).length;r--;){var s=e["on"+t[r]];if("function"==typeof s)try{s.call(e,i||e)}catch(e){d(e)}}};n.readyState=n.INIT,c?(r=u().createObjectURL(e),p(function(){var e,t;l.href=r,l.download=i,e=l,t=new MouseEvent("click"),e.dispatchEvent(t),a(),m(r),n.readyState=n.DONE},0)):(f||t&&h)&&o.FileReader?((s=new FileReader).onloadend=function(){var e=f?s.result:s.result.replace(/^data:[^;]*;/,"data:attachment/file;");o.open(e,"_blank")||(o.location.href=e),n.readyState=n.DONE,a()},s.readAsDataURL(e),n.readyState=n.INIT):(r=r||u().createObjectURL(e),!t&&o.open(r,"_blank")||(o.location.href=r),n.readyState=n.DONE,a(),m(r))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob)||(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,o.FileSaver_saveAs=function(e,t,i){return new r(e,t||e.name||"download",i)})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0),!function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node,COMMON_JS=(NODE_JS&&(root=global),!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports),AMD="function"==typeof define&&define.amd,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");(t=NODE_JS?nodeWrap(t):t).create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=e[s]<>2]|=t<>2]|=(192|t>>6)<>2]|=(224|t>>12)<>2]|=(240|t>>18)<>2]|=(128|t>>12&63)<>2]|=(128|t>>6&63)<>2]|=(128|63&t)<>2]|=EXTRA[3&t],this.block=e[16],56<=t&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash())},Sha1.prototype.hash=function(){for(var e,t=this.h0,i=this.h1,r=this.h2,s=this.h3,n=this.h4,a=this.blocks,o=16;o<80;++o)e=a[o-3]^a[o-8]^a[o-14]^a[o-16],a[o]=e<<1|e>>>31;for(o=0;o<20;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i&r|~i&s)+n+1518500249+a[o]<<0)<<5|n>>>27)+(t&(i=i<<30|i>>>2)|~t&r)+s+1518500249+a[o+1]<<0)<<5|s>>>27)+(n&(t=t<<30|t>>>2)|~n&i)+r+1518500249+a[o+2]<<0)<<5|r>>>27)+(s&(n=n<<30|n>>>2)|~s&t)+i+1518500249+a[o+3]<<0)<<5|i>>>27)+(r&(s=s<<30|s>>>2)|~r&n)+t+1518500249+a[o+4]<<0,r=r<<30|r>>>2;for(;o<40;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i^r^s)+n+1859775393+a[o]<<0)<<5|n>>>27)+(t^(i=i<<30|i>>>2)^r)+s+1859775393+a[o+1]<<0)<<5|s>>>27)+(n^(t=t<<30|t>>>2)^i)+r+1859775393+a[o+2]<<0)<<5|r>>>27)+(s^(n=n<<30|n>>>2)^t)+i+1859775393+a[o+3]<<0)<<5|i>>>27)+(r^(s=s<<30|s>>>2)^n)+t+1859775393+a[o+4]<<0,r=r<<30|r>>>2;for(;o<60;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i&r|i&s|r&s)+n-1894007588+a[o]<<0)<<5|n>>>27)+(t&(i=i<<30|i>>>2)|t&r|i&r)+s-1894007588+a[o+1]<<0)<<5|s>>>27)+(n&(t=t<<30|t>>>2)|n&i|t&i)+r-1894007588+a[o+2]<<0)<<5|r>>>27)+(s&(n=n<<30|n>>>2)|s&t|n&t)+i-1894007588+a[o+3]<<0)<<5|i>>>27)+(r&(s=s<<30|s>>>2)|r&n|s&n)+t-1894007588+a[o+4]<<0,r=r<<30|r>>>2;for(;o<80;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i^r^s)+n-899497514+a[o]<<0)<<5|n>>>27)+(t^(i=i<<30|i>>>2)^r)+s-899497514+a[o+1]<<0)<<5|s>>>27)+(n^(t=t<<30|t>>>2)^i)+r-899497514+a[o+2]<<0)<<5|r>>>27)+(s^(n=n<<30|n>>>2)^t)+i-899497514+a[o+3]<<0)<<5|i>>>27)+(r^(s=s<<30|s>>>2)^n)+t-899497514+a[o+4]<<0,r=r<<30|r>>>2;this.h0=this.h0+t<<0,this.h1=this.h1+i<<0,this.h2=this.h2+r<<0,this.h3=this.h3+s<<0,this.h4=this.h4+n<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&define(function(){return exports}))}(),Object.extend(Squeak,{vmPath:"/",platformSubtype:"Browser",osVersion:navigator.userAgent,windowSystem:"HTML"}),window.SqueakJS={};var canUseMouseOffset=navigator.userAgent.match("AppleWebKit/");function updateMousePos(e,t,i){var r=canUseMouseOffset?e.offsetX:e.layerX,e=canUseMouseOffset?e.offsetY:e.layerY,r=(i.cursorCanvas&&(i.cursorCanvas.style.left=r+t.offsetLeft+i.cursorOffsetX+"px",i.cursorCanvas.style.top=e+t.offsetTop+i.cursorOffsetY+"px"),r*t.width/t.offsetWidth|0),e=e*t.height/t.offsetHeight|0;i.mouseX=Math.max(0,Math.min(i.width,r)),i.mouseY=Math.max(0,Math.min(i.height,e))}function recordMouseEvent(e,t,i,r,s){if(updateMousePos(t,i,r),r.vm){var n=r.buttons&Squeak.Mouse_All;switch(e){case"mousedown":switch(t.button||0){case 0:n=Squeak.Mouse_Red;break;case 1:n=Squeak.Mouse_Yellow;break;case 2:n=Squeak.Mouse_Blue}n===Squeak.Mouse_Red&&(t.altKey||t.metaKey)&&(n=Squeak.Mouse_Yellow),s.swapButtons&&(n==Squeak.Mouse_Yellow?n=Squeak.Mouse_Blue:n==Squeak.Mouse_Blue&&(n=Squeak.Mouse_Yellow));break;case"mousemove":break;case"mouseup":n=0}r.buttons=n|recordModifiers(t,r),r.eventQueue&&(r.eventQueue.push([Squeak.EventTypeMouse,t.timeStamp,r.mouseX,r.mouseY,r.buttons&Squeak.Mouse_All,r.buttons>>3]),r.signalInputEvent)&&r.signalInputEvent(),r.idle=0,"mouseup"==e?r.runFor&&r.runFor(100):r.runNow&&r.runNow()}}function recordKeyboardEvent(e,t,i){var r;i.vm&&(r=i.buttons>>3<<8|e,i.eventQueue?(i.eventQueue.push([Squeak.EventTypeKeyboard,t,e,Squeak.EventKeyChar,i.buttons>>3,e]),i.signalInputEvent&&i.signalInputEvent(),i.keys[0]=r):r===i.vm.interruptKeycode?i.vm.interruptPending=!0:i.keys.push(r),i.idle=0,i.runNow)&&i.runNow()}function recordDragDropEvent(e,t,i,r){r.vm&&r.eventQueue&&(updateMousePos(t,i,r),r.eventQueue.push([Squeak.EventTypeDragDropFiles,t.timeStamp,e,r.mouseX,r.mouseY,r.buttons>>3,r.droppedFiles.length]),r.signalInputEvent)&&r.signalInputEvent()}function fakeCmdOrCtrlKey(e,t,i){i.buttons&=~Squeak.Keyboard_All,i.buttons|=Squeak.Keyboard_Cmd|Squeak.Keyboard_Ctrl,i.keys=[],recordKeyboardEvent(e,t,i)}function makeSqueakEvent(e,t,i){t[0]=e[0],t[1]=e[1]-i&Squeak.MillisecondClockMask;for(var r=2;rl.width&&(i.font="bold 24px sans-serif"),i.textAlign="center",i.textBaseline="middle",i.fillText(e,l.width/2,l.height/2)},h.showProgress=function(e,t){var i=h.context,r=l.width/3|0,s=.5*l.width-r/2,n=.5*l.height+48;i.fillStyle=(t=t||{}).background||"#000",i.fillRect(s,n,r,24),i.lineWidth=2,i.strokeStyle=t.color||"#F90",i.strokeRect(s,n,r,24),i.fillStyle=t.color||"#F90",i.fillRect(s,n,r*e,24)},h.executeClipboardPaste=function(e,t){if(!h.vm)return!0;try{h.clipboardString=e,fakeCmdOrCtrlKey("v".charCodeAt(0),t,h)}catch(e){console.error("paste error "+e)}},h.executeClipboardCopy=function(e,t){if(!h.vm)return!0;h.clipboardStringChanged=!1,fakeCmdOrCtrlKey((e||"c").charCodeAt(0),t,h);for(var i=Date.now();!h.clipboardStringChanged&&Date.now()-i<500;)h.vm.interpret(20);if(h.clipboardStringChanged)try{return h.clipboardString}catch(e){console.error("copy error "+e)}},l.onmousedown=function(e){return o(),recordMouseEvent("mousedown",e,l,h,c),e.preventDefault(),!1},l.onmouseup=function(e){recordMouseEvent("mouseup",e,l,h,c),o(),e.preventDefault()},l.onmousemove=function(e){recordMouseEvent("mousemove",e,l,h,c),e.preventDefault()},l.oncontextmenu=function(){return!1},{state:"idle",button:0,x:0,y:0,dist:0,down:{}});function u(e){if(e.touches.length)for(var t=f.x=f.y=0;t',e.setAttribute("style","position:fixed;right:0;bottom:0;background-color:rgba(128,128,128,0.5);border-radius:5px"),l.parentElement.appendChild(e),e.onmousedown=function(e){l.contentEditable=!0,l.setAttribute("autocomplete","off"),l.setAttribute("autocorrect","off"),l.setAttribute("autocapitalize","off"),l.setAttribute("spellcheck","off"),l.focus(),e.preventDefault()},e.ontouchstart=e.onmousedown),document.ondragover=function(e){e.preventDefault(),t(e)?(e.dataTransfer.dropEffect="copy",recordDragDropEvent(Squeak.EventDragMove,e,l,h)):e.dataTransfer.dropEffect="none"},document.ondragenter=function(e){t(e)&&recordDragDropEvent(Squeak.EventDragEnter,e,l,h)},document.ondragleave=function(e){t(e)&&recordDragDropEvent(Squeak.EventDragLeave,e,l,h)},document.ondrop=function(r){var s,n,a,o;return r.preventDefault(),t(r)&&(s=[].slice.call(r.dataTransfer.files),n=[],o=null,h.droppedFiles=[],s.forEach(function(t){var i=c.root+t.name,e=(h.droppedFiles.push(i),new FileReader);e.onload=function(){var e=this.result;Squeak.filePut(i,e),n.push(i),a||!/.*image$/.test(i)||h.vm&&!confirm("Run "+t.name+" now?\n(cancel to use as file)")||(a=e,o=i),n.length==s.length&&(a?h.vm?(h.quitFlag=!0,c.onQuit=function(e,t,i){i.onQuit=null,SqueakJS.appName=o.replace(/.*\//,"").replace(/\.image$/,""),SqueakJS.runImage(a,o,t,i)}):(SqueakJS.appName=o.replace(/.*\//,"").replace(/\.image$/,""),SqueakJS.runImage(a,o,h,c)):recordDragDropEvent(Squeak.EventDragDrop,r,l,h))},e.readAsArrayBuffer(t)})),!1},m(),window.onresize=m,h}function setupSpinner(t,e){e=e.spinner;return e?(e.onmousedown=function(e){confirm(SqueakJS.appName+" is busy. Interrupt?")&&(t.interruptPending=!0)},e.style):null}var spinnerAngle=0,becameBusy=0,loop;function updateSpinner(e,t,i,r){r=i.lastTick-r.lastTick<500;!(0===t)||r?(e.display="none",becameBusy=0):0===becameBusy?becameBusy=i.lastTick:1e3=Date.now()))return new Uint8Array(i.address)}return null},_addAddressFromResponseToLookupCache:function(e){var t,i,r,s,n;e&&0===e.Status&&e.Question&&e.Answer&&(i=e.Question[0],(t=function(e,t){e[t]&&e[t].replace&&(e[t]=e[t].replace(/\.$/,""))})(i,"name"),e.Answer.forEach(function(e){t(e,"name"),t(e,"data")}),r=i.name,s=null,n=86400,e.Answer.some(function(e){if(e.name===r){if(e.TTL&&(n=Math.min(n,e.TTL)),1===e.type)return s=e.data.split(".").map(function(e){return+e}),!0;5===e.type&&(r=e.data)}return!1}))&&(this.lookupCache[i.name]={address:s,validUntil:Date.now()+1e3*n})},_compareAddresses:function(e,i){return e.every(function(e,t){return i[t]===e})},_reverseLookupNameForAddress:function(t){var i=this,r=null;return Object.keys(this.lookupCache).some(function(e){return!!i._compareAddresses(t,i.lookupCache[e].address)&&(r=e,!0)}),r||t.join(".")},_newSocketHandle:function(e,t,i,r){var l=this;return{hostAddress:null,host:null,port:null,connSemaIndex:t,readSemaIndex:i,writeSemaIndex:r,webSocket:null,sendBuffer:null,sendTimeout:null,response:null,responseReadUntil:0,responseReceived:!1,status:l.Socket_Unconnected,_signalConnSemaphore:function(){l._signalSemaphore(this.connSemaIndex)},_signalReadSemaphore:function(){l._signalSemaphore(this.readSemaIndex)},_signalWriteSemaphore:function(){l._signalSemaphore(this.writeSemaIndex)},_otherEndClosed:function(){this.status=l.Socket_OtherEndClosed,this.webSocket=null,this._signalConnSemaphore()},_hostAndPort:function(){return this.host+":"+this.port},_requestNeedsProxy:function(){return l.needProxy.has(this._hostAndPort())},_getURL:function(e,t){var i="";return(t||this._requestNeedsProxy())&&(i="object"==typeof SqueakJS&&SqueakJS.options.proxy||"https://corsproxy.io/?"),443!==this.port?i+="http://"+this._hostAndPort()+e:i+="https://"+this.host+e,i},_performRequest:function(){if(this.webSocket)this._performWebSocketSend();else{var e=new TextDecoder("utf-8").decode(this.sendBuffer),t=this.sendBuffer.findIndex(function(e,t,i){return"\r"===i[t]&&"\r"===i[t+2]&&"\n"===i[t+1]&&"\n"===i[t+3]}),i=(this.sendBuffer=0<=t?this.sendBuffer.subarray(t+4):null,e.split("\r\n\r\n")[0].split("\n")),t=i[0].split(" "),e=t[0];if("GET"!==e&&"PUT"!==e&&"POST"!==e)return this._otherEndClosed(),-1;for(var t=t[1],r=!1,s=!1,n=null,a=1;a>>8,t[3]=255&e.length,4):127===i?(t[2]=e.length>>>56,t[3]=e.length>>>48&255,t[4]=e.length>>>40&255,t[5]=e.length>>>32&255,t[6]=e.length>>>24&255,t[7]=e.length>>>16&255,t[8]=e.length>>>8&255,t[9]=255&e.length,10):2,i=new Uint8Array(4),t.set(i,r),i=e,t.set(i,r+=4),e=t),this.response&&this.response.length?this.response.push(e):this.response=[e],this.responseReceived=!0,this._signalReadSemaphore()},_performWebSocketSend:function(){var e,t=this.sendBuffer[0],t=15&t;if(0==t)return console.error("No support for WebSocket frame continuation yet!"),!0;if(1==t)e=!1;else{if(2!=t)return 8==t?(this.webSocket.close(),void(this.webSocket=null)):9==t||10==t?void 0:void console.error("Unsupported WebSocket frame opcode "+t);e=!0}var i,t=this.sendBuffer[1],r=t>>>7,t=127&t,s=126===t?(t=this.sendBuffer[2]<<8|this.sendBuffer[3],4):127===t?(t=this.sendBuffer[2]<<56|this.sendBuffer[3]<<48|this.sendBuffer[4]<<40|this.sendBuffer[5]<<32|this.sendBuffer[6]<<24|this.sendBuffer[7]<<16|this.sendBuffer[8]<<8|this.sendBuffer[9],10):2,n=(r&&(i=this.sendBuffer.subarray(s,s+4),s+=4),this.sendBuffer.subarray(s,s+t));s+=t,r&&(n=n.map(function(e,t){return e^i[3&t]})),t=e?n:Squeak.bytesAsString(n),this.sendBuffer=this.sendBuffer.subarray(s),this.webSocket.send(t),0e?((i=t.subarray(e))?this.response[0]=i:this.response.shift(),t=t.subarray(0,e)):this.response.shift(),this.responseReceived&&0===this.response.length&&!this.webSocket&&(this.responseSentCompletly=!0),t)},send:function(e,t,i){null!==this.sendTimeout&&self.clearTimeout(this.sendTimeout),this.lastSend=Date.now();e=e.bytes.subarray(t,i);return null===this.sendBuffer?this.sendBuffer=e.slice():(t=this.sendBuffer.byteLength+e.byteLength,(i=new Uint8Array(t)).set(this.sendBuffer,0),i.set(e,this.sendBuffer.byteLength),this.sendBuffer=i),this.sendTimeout=self.setTimeout(this._performRequest.bind(this),50),e.byteLength}}},primitiveHasSocketAccess:function(e){return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0},primitiveInitializeNetwork:function(e){return 1===e&&(this.lookupSemaIdx=this.interpreterProxy.stackIntegerValue(0),this.status=this.Resolver_Ready,this.interpreterProxy.pop(e),!0)},primitiveResolverNameLookupResult:function(e){var t;return 0===e&&(this.lastLookup&&this.lastLookup.substr?(t=this._getAddressFromLookupCache(this.lastLookup,!0),this.interpreterProxy.popthenPush(e+1,t?this.primHandler.makeStByteArray(t):this.interpreterProxy.nilObject())):this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverStartNameLookup:function(e){var t,i,r,s,n;return 1===e&&(t=this.lastLookup=this.interpreterProxy.stackValue(0).bytesAsString(),this._getAddressFromLookupCache(t,!1)?(this.status=this.Resolver_Ready,this._signalLookupSemaphore()):(i="https://9.9.9.9:5053/dns-query?name="+encodeURIComponent(this.lastLookup)+"&type=A",self.fetch?(r=this,self.fetch(i,{method:"GET",mode:"cors",credentials:"omit",cache:"no-store",referrer:"no-referrer",referrerPolicy:"no-referrer"}).then(function(e){return e.json()}).then(function(e){r._addAddressFromResponseToLookupCache(e)}).catch(function(e){console.error("Name lookup failed",e)}).then(function(){t===r.lastLookup&&(r.status=r.Resolver_Ready,r._signalLookupSemaphore())})):(r=this,s=function(){t===r.lastLookup&&(r.status=r.Resolver_Ready,r._signalLookupSemaphore())},(n=new XMLHttpRequest).open("GET",i,!0),n.timeout=2e3,n.responseType="json",n.onload=function(e){r._addAddressFromResponseToLookupCache(this.response),s()},n.onerror=function(){console.error("Name lookup failed",n.statusText),s()},n.send()),!0&&(this.status=this.Resolver_Busy,this._signalLookupSemaphore())),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverAddressLookupResult:function(e){var t;return 0===e&&(this.lastLookup&&this.lastLookup.every?(t=this._reverseLookupNameForAddress(this.lastLookup),t=this.primHandler.makeStString(t),this.interpreterProxy.popthenPush(e+1,t)):this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveResolverStartAddressLookup:function(e){return 1===e&&(this.lastLookup=this.interpreterProxy.stackBytes(0),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),this.status=this.Resolver_Ready,this._signalLookupSemaphore(),!0)},primitiveResolverStatus:function(e){return 0===e&&(this.interpreterProxy.popthenPush(e+1,this.status),!0)},primitiveResolverAbortLookup:function(e){return 0===e&&(this.lastLookup=null,this.status=this.Resolver_Ready,this._signalLookupSemaphore(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketRemoteAddress:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(this.interpreterProxy.popthenPush(e+1,t.hostAddress?this.primHandler.makeStByteArray(t.hostAddress):this.interpreterProxy.nilObject()),!0)},primitiveSocketRemotePort:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(this.interpreterProxy.popthenPush(e+1,t.port),!0)},primitiveSocketConnectionStatus:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(void 0===(t=t.status)&&(t=this.Socket_InvalidSocket),this.interpreterProxy.popthenPush(e+1,t),!0)},primitiveSocketConnectToPort:function(e){var t,i,r;return 3===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(2).handle)&&(i=this.interpreterProxy.stackBytes(1),r=this.interpreterProxy.stackIntegerValue(0),t.connect(i,r),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCloseConnection:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(t.close(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCreate3Semaphores:function(e){var t,i,r,s,n;return 7===e&&(t=this.interpreterProxy.stackIntegerValue(0),i=this.interpreterProxy.stackIntegerValue(1),r=this.interpreterProxy.stackIntegerValue(2),s=this.interpreterProxy.stackIntegerValue(3),this.interpreterProxy.stackIntegerValue(5)===this.TCP_Socket_Type)&&(n="{SqueakJS Socket #"+ ++this.handleCounter+"}",(n=this.primHandler.makeStString(n)).handle=this._newSocketHandle(s,r,i,t),this.interpreterProxy.popthenPush(e+1,n),!0)},primitiveSocketDestroy:function(e){var t;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(t.destroy(),this.interpreterProxy.popthenPush(e+1,t.status),!0)},primitiveSocketReceiveDataAvailable:function(e){var t,i;return 1===e&&void 0!==(t=this.interpreterProxy.stackObjectValue(0).handle)&&(i=this.interpreterProxy.falseObject(),t.dataAvailable()&&(i=this.interpreterProxy.trueObject()),this.interpreterProxy.popthenPush(e+1,i),!0)},primitiveSocketReceiveDataBufCount:function(e){var t,i,r,s;return 4===e&&void 0!==(s=this.interpreterProxy.stackObjectValue(3).handle)&&(t=this.interpreterProxy.stackObjectValue(2),!((i=this.interpreterProxy.stackIntegerValue(1)-1)+(r=this.interpreterProxy.stackIntegerValue(0))>t.bytes.length||(s=s.recv(r),t.bytes.set(s,i),this.interpreterProxy.popthenPush(e+1,s.length),0)))},primitiveSocketSendDataBufCount:function(e){var t,i,r,s;return 4===e&&void 0!==(s=this.interpreterProxy.stackObjectValue(3).handle)&&(t=this.interpreterProxy.stackObjectValue(2),!((i=this.interpreterProxy.stackIntegerValue(1)-1)<0||(r=i+this.interpreterProxy.stackIntegerValue(0))>t.length||(s=s.send(t,i,r),this.interpreterProxy.popthenPush(e+1,s),0)))},primitiveSocketSendDone:function(e){return 1===e&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0)},primitiveSocketListenWithOrWithoutBacklog:function(e){return!(e<2||(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),0))}}}function registerSocketPlugin(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SocketPlugin",SocketPlugin()):self.setTimeout(registerSocketPlugin,100)}function SpeechPlugin(){return{getModuleName:function(){return"SpeechPlugin"},interpreterProxy:null,primHandler:null,voiceInput:null,semaphoreIndex:null,shouldListen:!1,recognition:null,synth:self.speechSynthesis,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},primitiveSpeak:function(e){if(1===e)t=this.interpreterProxy.stackValue(0).bytesAsString();else{if(2!==e)return!1;var t=this.interpreterProxy.stackValue(1).bytesAsString(),i=this.interpreterProxy.stackValue(0).bytesAsString(),r=this.synth.getVoices().filter(function(e){return e.name===i})}t=new SpeechSynthesisUtterance(t);return r&&0>0)+t:[e,t]}}),Object.subclass("Squeak.Object","initialization",{initInstanceOf:function(e,t,i,r){this.sqClass=e,this.hash=i;var i=e.pointers[Squeak.Class_format],s=(i>>1&63)+(i>>10&192)-1;this._format=i>>7&15,this._format<8?6!=this._format?0>10&255,a=this.decodeWords(1+t,i,s),this.pointers=this.decodePointers(1+t,a,e),this.bytes=this.decodeBytes(o-(1+t),i,1+t,3&this._format)):8<=this._format?0>1:i[n]||42424242}return r},decodeWords:function(e,t,i){for(var r=new DataView(t.buffer,t.byteOffset),s=new Uint32Array(e),n=0;n>4]),i.push(t[15&this.bytes[s]]),r=256*r+this.bytes[s];var e=e?"-":"",n=9007199254740991");case"LargePositiveInteger":return this.bytesAsNumberString(!1);case"LargeNegativeInteger":return this.bytesAsNumberString(!0);case"Character":var t=this.pointers?this.pointers[0]:this.hash;return"$"+String.fromCharCode(t)+" ("+t.toString()+")";case"CompiledMethod":return this.methodAsString();case"CompiledBlock":return"[] in "+this.blockOuterCode().sqInstName()}return/^[aeiou]/i.test(e)?"an"+e:"a"+e}},"accessing",{pointersSize:function(){return this.pointers?this.pointers.length:0},bytesSize:function(){return this.bytes?this.bytes.length:0},wordsSize:function(){return this.isFloat?2:this.words?this.words.length:0},instSize:function(){var e=this._format;return 4>>2):null)},setAddr:function(e){var t=this.snapshotSize();return this.oop=e+4*t.header,e+4*(t.header+t.body)},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:63<++e?2:this.sqClass.isCompact?0:1,body:e}},addr:function(){return this.oop-4*this.snapshotSize().header},totalBytes:function(){var e=this.snapshotSize();return 4*(e.header+e.body)},writeTo:function(e,t,i){this.bytes&&(this._format|=3&-this.bytes.length);var r=t,s=this.snapshotSize(),n=(15&this._format)<<8|(4095&this.hash)<<17;switch(s.header){case 2:e.setUint32(t,s.body<<2|Squeak.HeaderTypeSizeAndClass),e.setUint32(t+=4,this.sqClass.oop|Squeak.HeaderTypeSizeAndClass),e.setUint32(t+=4,n|Squeak.HeaderTypeSizeAndClass),t+=4;break;case 1:e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeClass),e.setUint32(t+=4,n|s.body<<2|Squeak.HeaderTypeClass),t+=4;break;case 0:var a=i.compactClasses.indexOf(this.sqClass)+1;e.setUint32(t,n|a<<12|s.body<<2|Squeak.HeaderTypeShort),t+=4}if(this.isFloat)e.setFloat64(t,this.float),t+=8;else if(this.words)for(var o=0;o>7&15},classInstSize:function(){var e=this.pointers[Squeak.Class_format];return(e>>10&192)+(e>>1&63)-1},classInstIsBytes:function(){var e=this.classInstFormat();return 8<=e&&e<=11},classInstIsPointers:function(){return this.classInstFormat()<=4},instVarNames:function(){for(var e=3;e<=4;e++){var t=this.pointers[e].pointers;if(t&&t.length&&t[0].bytes)return t.map(function(e){return e.bytesAsString()})}return[]},allInstVarNames:function(){var e=this.superclass();return e.isNil?this.instVarNames():e.allInstVarNames().concat(this.instVarNames())},superclass:function(){return this.pointers[0]},className:function(){if(!this.pointers)return"_NOTACLASS_";for(var e=6;e<=7;e++)if((r=this.pointers[e])&&r.bytes)return r.bytesAsString();for(var t=5;t<=6;t++){var i=this.pointers[t];if(i&&i.pointers)for(var r,e=6;e<=7;e++)if((r=i.pointers[e])&&r.bytes)return r.bytesAsString()+" class"}return"_SOMECLASS_"},defaultInst:function(){return Squeak.Object},classInstProto:function(e){if(this.instProto)return this.instProto;var t=this.defaultInst();try{var i="UndefinedObject"===(i=(e=e||this.className()).replace(/[^A-Za-z0-9]/g,"_"))?"nil":"True"===i?"true_":"False"===i?"false_":(/^[AEIOU]/.test(i)?"an":"a")+i;(t=new Function("return function "+i+"() {};")()).prototype=this.defaultInst().prototype}catch(e){}return Object.defineProperty(this,"instProto",{value:t}),t}},"as method",{methodSignFlag:function(){return!1},methodNumLits:function(){return this.pointers[0]>>9&255},methodNumArgs:function(){return this.pointers[0]>>24&15},methodPrimitiveIndex:function(){var e=805306879&this.pointers[0];return 511>19):e},methodClassForSuper:function(){return this.pointers[this.methodNumLits()].pointers[Squeak.Assn_value]},methodNeedsLargeFrame:function(){return 0<(131072&this.pointers[0])},methodAddPointers:function(e){this.pointers=e},methodTempCount:function(){return this.pointers[0]>>18&63},methodGetLiteral:function(e){return this.pointers[1+e]},methodGetSelector:function(e){return this.pointers[1+e]},methodAsString:function(){return"aCompiledMethod"}},"as context",{contextHome:function(){return this.contextIsBlock()?this.pointers[Squeak.BlockContext_home]:this},contextIsBlock:function(){return"number"==typeof this.pointers[Squeak.BlockContext_argumentCount]},contextMethod:function(){return this.contextHome().pointers[Squeak.Context_method]},contextSender:function(){return this.pointers[Squeak.Context_sender]},contextSizeWithStack:function(e){return e&&e.activeContext===this?e.sp+1:(e=this.pointers[Squeak.Context_stackPointer],Squeak.Context_tempFrameStart+("number"==typeof e?e:0))}}),Squeak.Object.subclass("Squeak.ObjectSpur","initialization",{initInstanceOf:function(e,t,i,r){this.sqClass=e,this.hash=i;var i=e.pointers[Squeak.Class_format],s=65535&i,i=i>>16&31;(this._format=i)<12?i<10?0>(a?3:1),h=32767&c,f=a?this.decodeWords64(1+h,u,s):this.decodeWords(1+h,u,s),p=a?2*(1+h):1+h;this.pointers=this.decodePointers(1+h,f,e,n,a),this.bytes=this.decodeBytes(l-p,u,p,3&this._format),a&&(this.pointers[0]=2147483648&u[1]|c);break;default:throw Error("Unknown object format: "+this._format)}this.mark=!1},decodeWords64:function(e,t,i){for(var r=new Array(e),s=0;s>1:s.makeLargeFromSmall((o-(o>>>0))/4294967296>>>0,o>>>0):o>>1;else if(2==(3&o)){if(o<0||8589934591>>(s?3:2))}else s&&4==(7&o)?n[a]=this.decodeSmallFloat((o-(o>>>0))/4294967296>>>0,o>>>0,s):(n[a]=i[o]||42424242,n[a])}return n},decodeSmallFloat:function(e,t,i){var r=0,s=0,n=(8&t)<<28;return 0==(e|4294967280&t)?r=n:(r=939524096+(e>>>4)|n,s=t>>>4|(15&e)<<28),i.makeFloat(new Uint32Array([s,r]))},overhead64:function(e){var t,i=0,r=0,s=0;return this._format<=5?i=-2&e.length:24<=this._format?(i=1+(e[0]>>3&32767),t=28<=this._format,1==(1&i)&&(i+=t?1:-1),s=e.length/2,r=e.length-i):s=(r=e.length)/2,{bytes:4*i,sizeHeader:255<=r&&s<255}},initInstanceOfChar:function(e,t){this.oop=t<<2|2,this.sqClass=e,this.hash=t,this._format=7,this.mark=!0},initInstanceOfFloat:function(e,t){this.sqClass=e,this.hash=0,this._format=10,this.isFloat=!0,this.float=this.decodeFloat(t,!0,!0)},initInstanceOfLargeInt:function(e,t){this.sqClass=e,this.hash=0,this._format=16,this.bytes=new Uint8Array(t)},classNameFromImage:function(e,t){e=e[t[this.oop][Squeak.Class_name]];return e&&16<=e._format&&e._format<24?(t=t[e.oop],t=e.decodeBytes(t.length,t,0,7&e._format),Squeak.bytesAsString(t)):"Class"},renameFromImage:function(e,t,i){var i=i[this.sqClass];return(i=i&&(i.instProto||i.classInstProto(i.classNameFromImage(e,t))))?((e=new i).oop=this.oop,e.sqClass=this.sqClass,e._format=this._format,e.hash=this.hash,e):this}},"accessing",{instSize:function(){return this._format<2?this.pointersSize():this.sqClass.classInstSize()},indexableSize:function(e){var t=this._format;return t<2?-1:3===t&&e.vm.isContext(this)?this.pointers[Squeak.Context_stackPointer]:t<6?this.pointersSize()-this.instSize():t<12?this.wordsSize():t<16?this.shortsSize():t<24?this.bytesSize():4*this.pointersSize()+this.bytesSize()},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:255<=e?2:0,body:e=(e=e+(1&e)+2)<4?4:e}},writeTo:function(e,t,i,r){var s=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0,n=(this.bytes&&(s+=this.bytes.length+3>>>2,this._format|=3&-this.bytes.length),t),a=this._format<<24|4194303&this.sqClass.hash,o=s<<24|4194303&this.hash;if(255<=s&&(e.setUint32(t,s,i),o=255<<24|4194303&this.hash,e.setUint32(t+=4,o,i),t+=4),e.setUint32(t,a,i),e.setUint32(t+=4,o,i),t+=4,this.isFloat)e.setFloat64(t,this.float,i),t+=8;else if(this.words)for(var u=0;u>16&31},classInstSize:function(){return 65535&this.pointers[Squeak.Class_format]},classInstIsBytes:function(){var e=this.classInstFormat();return 16<=e&&e<=23},classInstIsPointers:function(){return this.classInstFormat()<=6},classByteSizeOfInstance:function(e){var t=this.classInstFormat(),i=this.classInstSize();return 4*(i=(i=(i=(i+=t<9?e:16<=t?(e+3)/4|0:12<=t?(e+1)/2|0:10<=t?e:2*e)+(1&i))+(255<=i?4:2))<4?4:i)}},"as compiled block",{blockOuterCode:function(){return this.pointers[this.pointers.length-1]}},"as method",{methodSignFlag:function(){return this.pointers[0]<0},methodNumLits:function(){return 32767&this.pointers[0]},methodPrimitiveIndex:function(){return 0==(65536&this.pointers[0])?0:this.bytes[1]+256*this.bytes[2]},methodAsString:function(){var e=this.pointers[this.pointers.length-1].pointers[Squeak.ClassBinding_value],t=this.pointers[this.pointers.length-2];return t.pointers&&(t=t.pointers[Squeak.AdditionalMethodState_selector]),e.className()+">>"+t.bytesAsString()}}),Object.subclass("Squeak.Image","about",{about:function(){}},"initializing",{initialize:function(e){this.headRoom=1e8,this.totalMemory=0,this.name=e,this.gcCount=0,this.gcMilliseconds=0,this.pgcCount=0,this.pgcMilliseconds=0,this.gcTenured=0,this.allocationCount=0,this.oldSpaceCount=0,this.youngSpaceCount=0,this.newSpaceCount=0,this.hasNewInstances={}},readFromBuffer:function(r,t,i){console.log("squeak: reading "+this.name+" ("+r.byteLength+" bytes)"),this.startupTime=Date.now();for(var s=new DataView(r),n=!1,a=0,e=function(){var e=s.getUint32(a,n);return a+=4,e},o=e,u=4,N=function(e,t){if(t){for(var i=[];i.length>>24,O=(255===F&&(F=y,y=e(),S=e()),U+a-8-v),I=4194303&y,G=4194303&S,w=N(F,(x=y>>>24&31)<10&&0>>2,P=o(),_=o();break;case Squeak.HeaderTypeClass:P=_-Squeak.HeaderTypeClass,C=(_=o())>>>2&63;break;case Squeak.HeaderTypeShort:C=_>>>2&63,P=_>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var x,V,O=a-4-v,G=_>>>17&4095,w=N(--C,(x=_>>>8&15)<5);(V=new Squeak.Object).initFromImage(O,P,x,G),P<32&&(V.hash|=268435456),p&&(p.nextObject=V),this.oldSpaceCount++,p=V,d[f+O]=V,m[O]=w}this.firstOldObject=d[f+4],this.lastOldObject=V,this.lastOldObject.nextObject=null,this.oldSpaceBytes=R}this.totalMemory=this.oldSpaceBytes+this.headRoom,this.totalMemory=1e6*Math.ceil(this.totalMemory/1e6);var L=d[D],J=this.isSpur?this.spurClassTable(d,m,k,L):m[d[m[L.oop][Squeak.splOb_CompactClasses]].oop],j=null;for(V=this.firstOldObject,p=null;V;)p=j,j=V.renameFromImage(d,m,J),p?p.nextObject=j:this.firstOldObject=j,d[f+V.oop]=j,V=V.nextObject;this.lastOldObject=j,this.lastOldObject.nextObject=null;var q=d[D],Y=m[d[m[q.oop][Squeak.splOb_CompactClasses]].oop],Q=d[m[q.oop][Squeak.splOb_ClassFloat]],B=(this.isSpur&&(this.initImmediateClasses(d,m,q),Y=this.spurClassTable(d,m,k,q),E=this.getCharacter.bind(this),this.initSpurOverrides()),this.firstOldObject),M=0,$=function(){if(B){for(var e=M+(this.oldSpaceCount/20|0);B&&M=n.length)return 0;t=2147483652+4*a,n[a++]=e}else{if(s+e.totalBytes()>r.byteLength)return 0;t=s+4*(e.snapshotSize().header+1),s=e.writeTo(r,s,this),l.push(e)}u[e.oop]=t}return t}function h(){for(var e=this.firstOldObject;e;)e.mark=!1,e=e.nextObject;return this.weakObjects=null,!1}for(c=c.bind(this),h=h.bind(this),c(i);0>>2,p=n(),d=n();break;case Squeak.HeaderTypeClass:p=d-Squeak.HeaderTypeClass,f=(d=n())>>>2&63;break;case Squeak.HeaderTypeShort:f=d>>>2&63,p=d>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var m=s,v=d>>>8&15,g=d>>>17&4095,k=function(e,t){if(t<5){for(var i=[];i.length>>3;for(var i=(e>>=3)<0,r=(i&&(e=-e,0!==(t=-t))&&e--,0===e?4:e<=255?5:e<=65535?6:e<=16777215?7:8),i=i?this.largeNegIntClass:this.largePosIntClass,s=new i.instProto,n=(this.registerObjectSpur(s),this.hasNewInstances[i.oop]=!0,s.initInstanceOfLargeInt(i,r),s.bytes),a=0;a<4;a++)n[a]=255&t,t>>=8;for(a=4;a>=8;return s},ensureClassesInTable:function(){for(var e=this.firstOldObject,t=1024;e;){var i=e.sqClass;if(0===i.hash&&this.enterIntoClassTable(i),i.hash>t&&(t=i.hash),this.classTable[i.hash]!==i)throw Error("Class not in class table");e=e.nextObject}return 1+(t>>10)},classTableBytes:function(e){return 4*(4108+1028*e)},writeFreeLists:function(e,t,i,r){return e.setUint32(t,167772178,i),e.setUint32(t+=4,536870912,i),t=t+4+128},writeClassTable:function(e,t,i,r,s){e.setUint32(t,4104,i),e.setUint32(t+=4,4278190080,i),e.setUint32(t+=4,33554448,i),e.setUint32(t+=4,4278190080,i),t+=4;for(var n=0;n>2||2!=(3&e.oop))throw Error("Bad immediate char");return e.oop}if(e.oop<0)throw Error("temporary oop");return e.oop<48?e.oop:e.oop+t}for(a(this.formatVersion()),a(64),a(t+this.oldSpaceBytes+16),a(this.firstOldObject.addr()),a(o(this.specialObjectsArray)),this.savedHeaderWords.forEach(a),a(t+this.oldSpaceBytes+16);n<64;)a(0);var u=0,n=(l=this.firstOldObject).writeTo(i,n,r,o),l=l.nextObject;for(u++,n=l.writeTo(i,n,r,o),l=l.nextObject,u++,n=l.writeTo(i,n,r,o),l=l.nextObject,u++,n=this.writeFreeLists(i,n,r,o),n=this.writeClassTable(i,n,r,o,e);l;)n=l.writeTo(i,n,r,o),l=l.nextObject,u++;if(a(1241513987),a(8388608),a(0),a(0),n!==i.byteLength)throw Error("wrong image size");if(u!==this.oldSpaceCount)throw Error("wrong object count");e=Date.now()-s;return console.log("Wrote "+u+" objects in "+e+" ms, image size "+n+" bytes"),i.buffer},storeImageSegmentSpur:function(e,t,i){return this.vm.warnOnce("not implemented for Spur yet: primitive 98 (primitiveStoreImageSegment)"),!1},loadImageSegmentSpur:function(e,t){return this.vm.warnOnce("not implemented for Spur yet: primitive 99 (primitiveLoadImageSegment)"),null}}),Object.subclass("Squeak.Interpreter","initialization",{initialize:function(e,t){console.log("squeak: initializing interpreter "+Squeak.vmVersion+" ("+Squeak.vmDate+")"),this.Squeak=Squeak,this.image=e,(this.image.vm=this).primHandler=new Squeak.Primitives(this,t),this.loadImageState(),this.hackImage(),this.initVMState(),this.loadInitialContext(),this.initCompiler(),console.log("squeak: ready")},loadImageState:function(){this.specialObjects=this.image.specialObjectsArray.pointers,this.specialSelectors=this.specialObjects[Squeak.splOb_SpecialSelectors].pointers,this.nilObj=this.specialObjects[Squeak.splOb_NilObject],this.falseObj=this.specialObjects[Squeak.splOb_FalseObject],this.trueObj=this.specialObjects[Squeak.splOb_TrueObject],this.hasClosures=this.image.hasClosures,this.getGlobals=this.globalsGetter(),this.hasClosures||this.findMethod("UnixFileDirectory class>>pathNameDelimiter")||(this.primHandler.emulateMac=!0),6501==this.image.version&&(this.primHandler.reverseDisplay=!0)},initVMState:function(){this.byteCodeCount=0,this.sendCount=0,this.interruptCheckCounter=0,this.interruptCheckCounterFeedBackReset=1e3,this.interruptChecksEveryNms=3,this.lowSpaceThreshold=1e6,this.signalLowSpace=!1,this.nextPollTick=0,this.nextWakeupTick=0,this.lastTick=0,this.interruptKeycode=2094,this.interruptPending=!1,this.pendingFinalizationSignals=0,this.freeContexts=this.nilObj,this.freeLargeContexts=this.nilObj,this.reclaimableContextCount=0,this.nRecycledContexts=0,this.nAllocatedContexts=0,this.methodCacheSize=1024,this.methodCacheMask=this.methodCacheSize-1,this.methodCacheRandomish=0,this.methodCache=[];for(var e=0;e>wordSize",literal:{index:1,old:8,hack:4},enabled:!0},{method:"ReleaseBuilder class>>prepareEnvironment",bytecode:{pc:28,old:216,hack:135},enabled:("object"==typeof location?location.hash:"").includes("wizard=false")}].forEach(function(t){try{var e,i,r,s,n=t.enabled&&this.findMethod(t.method);n&&(e=t.primitive,i=t.bytecode,r=t.literal,s=!0,e?n.pointers[0]|=e:i&&n.bytes[i.pc]===i.old?n.bytes[i.pc]=i.hack:i&&n.bytes[i.pc]===i.hack?s=!1:r&&n.pointers[r.index].pointers[1]===r.old?n.pointers[r.index].pointers[1]=r.hack:r&&n.pointers[r.index].pointers[1]===r.hack?s=!1:(s=!1,console.warn("Not hacking "+t.method)),s)&&console.warn("Hacking "+t.method)}catch(e){console.error("Failed to hack "+t.method+" with error "+e)}},this)}},"interpreting",{interpretOne:function(e){if(this.method.methodSignFlag())return this.interpretOneSistaWithExtensions(e,0,0);if(!this.method.compiled){var t,i,r=this.Squeak;switch(this.byteCodeCount++,t=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&t]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.homeContext.pointers[r.Context_tempFrameStart+(15&t)]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&t));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 92:case 93:case 94:case 95:return void this.push(this.method.methodGetLiteral(31&t).pointers[r.Assn_value]);case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:return this.receiver.dirty=!0,void(this.receiver.pointers[7&t]=this.pop());case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:return void(this.homeContext.pointers[r.Context_tempFrameStart+(7&t)]=this.pop());case 112:return void this.push(this.receiver);case 113:return void this.push(this.trueObj);case 114:return void this.push(this.falseObj);case 115:return void this.push(this.nilObj);case 116:return void this.push(-1);case 117:return void this.push(0);case 118:return void this.push(1);case 119:return void this.push(2);case 120:return void this.doReturn(this.receiver);case 121:return void this.doReturn(this.trueObj);case 122:return void this.doReturn(this.falseObj);case 123:return void this.doReturn(this.nilObj);case 124:return void this.doReturn(this.pop());case 125:return void this.doReturn(this.pop(),this.activeContext.pointers[r.BlockContext_caller]);case 126:case 127:return void this.nono();case 128:return void this.extendedPush(this.nextByte());case 129:return void this.extendedStore(this.nextByte());case 130:return void this.extendedStorePop(this.nextByte());case 131:return i=this.nextByte(),void this.send(this.method.methodGetSelector(31&i),i>>5,!1);case 132:return void this.doubleExtendedDoAnything(this.nextByte());case 133:return i=this.nextByte(),void this.send(this.method.methodGetSelector(31&i),i>>5,!0);case 134:return i=this.nextByte(),void this.send(this.method.methodGetSelector(63&i),i>>6,!1);case 135:return void this.pop();case 136:return void this.push(this.top());case 137:return void this.push(this.exportThisContext());case 138:return void this.pushNewArray(this.nextByte());case 139:return void this.callPrimBytecode(129);case 140:return i=this.nextByte(),void this.push(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]);case 141:return i=this.nextByte(),void(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]=this.top());case 142:return i=this.nextByte(),void(this.homeContext.pointers[r.Context_tempFrameStart+this.nextByte()].pointers[i]=this.pop());case 143:return void this.pushClosureCopy();case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:return void(this.pc+=1+(7&t));case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.jumpIfFalse(1+(7&t));case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:return i=this.nextByte(),this.pc+=256*((7&t)-4)+i,void((7&t)<4&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 168:case 169:case 170:case 171:return void this.jumpIfTrue(256*(3&t)+this.nextByte());case 172:case 173:case 174:case 175:return void this.jumpIfFalse(256*(3&t)+this.nextByte());case 176:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 177:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 178:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 180:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 181:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 182:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 183:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 184:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 185:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 186:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 187:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&t));case 188:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 189:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 190:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&t));case 191:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&t));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return void(this.primHandler.quickSendOther(this.receiver,15&t)||this.sendSpecial(16+(15&t)));case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 216:case 217:case 218:case 219:case 220:case 221:case 222:case 223:return void this.send(this.method.methodGetSelector(15&t),0,!1);case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:return void this.send(this.method.methodGetSelector(15&t),1,!1);case 240:case 241:case 242:case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:return void this.send(this.method.methodGetSelector(15&t),2,!1)}throw Error("not a bytecode: "+t)}if(e){if(!this.compiler.enableSingleStepping(this.method))return this.method.compiled=null,this.interpretOne(e);this.breakNow()}this.method.compiled(this)},interpretOneSistaWithExtensions:function(e,t,i){var r,s,n=this.Squeak;switch(this.byteCodeCount++,r=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&r]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.method.methodGetLiteral(15&r).pointers[n.Assn_value]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&r));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return void this.push(this.homeContext.pointers[n.Context_tempFrameStart+(7&r)]);case 72:case 73:case 74:case 75:return void this.push(this.homeContext.pointers[n.Context_tempFrameStart+(3&r)+8]);case 76:return void this.push(this.receiver);case 77:return void this.push(this.trueObj);case 78:return void this.push(this.falseObj);case 79:return void this.push(this.nilObj);case 80:return void this.push(0);case 81:return void this.push(1);case 82:return 0==i?void this.push(this.exportThisContext()):void this.nono();case 83:return void this.push(this.top());case 84:case 85:case 86:case 87:return void this.nono();case 88:return void this.doReturn(this.receiver);case 89:return void this.doReturn(this.trueObj);case 90:return void this.doReturn(this.falseObj);case 91:return void this.doReturn(this.nilObj);case 92:return void this.doReturn(this.pop());case 93:return void this.doReturn(this.nilObj,this.activeContext.pointers[n.BlockContext_caller]);case 94:return 0==t?void this.doReturn(this.pop(),this.activeContext.pointers[n.BlockContext_caller]):void this.nono();case 95:return;case 96:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 97:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 98:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 100:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 101:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 102:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 103:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 104:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&r));case 105:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 106:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 107:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&r));case 108:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 109:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&r));case 110:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&r));case 111:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&r));case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return void(this.primHandler.quickSendOther(this.receiver,15&r)||this.sendSpecial(16+(15&r)));case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return void this.send(this.method.methodGetSelector(15&r),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.send(this.method.methodGetSelector(15&r),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return void this.send(this.method.methodGetSelector(15&r),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return void(this.pc+=1+(7&r));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return void this.jumpIfTrue(1+(7&r));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return void this.jumpIfFalse(1+(7&r));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return this.receiver.dirty=!0,void(this.receiver.pointers[7&r]=this.pop());case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return void(this.homeContext.pointers[n.Context_tempFrameStart+(7&r)]=this.pop());case 216:return void this.pop();case 217:return void this.nono();case 218:case 219:case 220:case 221:case 222:case 223:return void this.nono();case 224:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,(t<<8)+a,i);case 225:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,t,(i<<8)+(a<128?a:a-256));case 226:return a=this.nextByte(),void this.push(this.receiver.pointers[a+(t<<8)]);case 227:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)).pointers[n.Assn_value]);case 228:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)));case 229:return a=this.nextByte(),void this.push(this.homeContext.pointers[n.Context_tempFrameStart+a]);case 230:return void this.nono();case 231:return void this.pushNewArray(this.nextByte());case 232:return a=this.nextByte(),void this.push(a+(i<<8));case 233:return a=this.nextByte(),void this.push(this.image.getCharacter(a+(i<<8)));case 234:return a=this.nextByte(),void this.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(i<<3),!1);case 235:var a=this.nextByte(),o=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=i?void this.sendSuperDirected(o,(7&a)+((63&i)<<3)):void this.send(o,(7&a)+(i<<3),!0);case 236:return void this.nono();case 237:o=this.nextByte()+(i<<8);return this.pc+=o,void(o<0&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 238:return void this.jumpIfTrue(this.nextByte()+(i<<8));case 239:return void this.jumpIfFalse(this.nextByte()+(i<<8));case 240:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.pop());case 241:return(s=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(s.pointers[n.Assn_value]=this.pop());case 242:return void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()]=this.pop());case 243:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.top());case 244:return(s=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(s.pointers[n.Assn_value]=this.top());case 245:return void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()]=this.top());case 246:case 247:return void this.nono();case 248:return void this.callPrimBytecode(245);case 249:return void this.pushFullClosure(t);case 250:return void this.pushClosureCopyExtended(t,i);case 251:return a=this.nextByte(),void this.push(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]);case 252:return a=this.nextByte(),void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]=this.top());case 253:return a=this.nextByte(),void(this.homeContext.pointers[n.Context_tempFrameStart+this.nextByte()].pointers[a]=this.pop());case 254:case 255:return void this.nono()}throw Error("not a bytecode: "+r)},interpret:function(e,t){if(this.frozen)return"frozen";for(this.isIdle=!1,this.breakOutOfInterpreter=!1,this.breakAfter(e||500);!1===this.breakOutOfInterpreter;)this.method.compiled?this.method.compiled(this):this.interpretOne();return"function"==typeof this.breakOutOfInterpreter?this.breakOutOfInterpreter(t):(e="break"==this.breakOutOfInterpreter?"break":this.isIdle?this.nextWakeupTick?Math.max(1,this.nextWakeupTick-this.primHandler.millisecondClockValue()):"sleep":0,t&&t(e),e)},goIdle:function(){var e=0!==this.nextWakeupTick,t=(this.forceInterruptCheck(),this.checkForInterrupts(),0!==this.nextWakeupTick);this.isIdle=t||!e,this.breakOut()},freeze:function(e){this.frozen=!0,this.breakOutOfInterpreter=function(e){if(e)return t=e,"frozen";throw Error("need function to restart interpreter")}.bind(this);var t,i=function(){if(this.frozen=!1,!t)throw Error("no continue function");t(0)}.bind(this);return e&&self.setTimeout(function(){e(i)},0),i},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.method.bytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e,t=this.primHandler.millisecondClockValue();t=this.nextWakeupTick&&(this.nextWakeupTick=0,(e=this.specialObjects[Squeak.splOb_TheTimerSemaphore]).isNil||this.primHandler.synchronousSignal(e)),0=this.breakOutTick&&this.breakOut()},extendedPush:function(e){var t=63&e;switch(e>>6){case 0:this.push(this.receiver.pointers[t]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+t]);break;case 2:this.push(this.method.methodGetLiteral(t));break;case 3:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value])}},extendedStore:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.top();break;case 2:this.nono();break;case 3:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.pop();break;case 2:this.nono();break;case 3:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(e){var t=this.nextByte();switch(e>>5){case 0:this.send(this.method.methodGetSelector(t),31&e,!1);break;case 1:this.send(this.method.methodGetSelector(t),31&e,!0);break;case 2:this.push(this.receiver.pointers[t]);break;case 3:this.push(this.method.methodGetLiteral(t));break;case 4:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value]);break;case 5:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 6:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 7:var i=this.method.methodGetLiteral(t);i.dirty=!0,i.pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(e){var t=this.pop();t.isTrue?this.pc+=e:t.isFalse||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},jumpIfFalse:function(e){var t=this.pop();t.isFalse?this.pc+=e:t.isTrue||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)},callPrimBytecode:function(e){this.pc+=2,this.primFailCode&&(this.method.bytes[this.pc]===e&&this.stackTopPut(this.getErrorObjectFromPrimFailCode()),this.primFailCode=0)},getErrorObjectFromPrimFailCode:function(){var e=this.specialObjects[Squeak.splOb_PrimErrTableIndex];if(e&&e.pointers){e=e.pointers[this.primFailCode-1];if(e)return e}return this.primFailCode}},"closures",{pushNewArray:function(e){var t=127>4,e=256*this.nextByte()+this.nextByte(),r=this.encodeSqueakPC(this.pc,this.method),s=this.newClosure(t,r,i);if(s.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>3&7)+8*this.div(e,16),i=r+(t<<8),e=this.encodeSqueakPC(this.pc,this.method),a=this.newClosure(s,e,n);if(a.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>6&1)?this.vm.nilObj:this.activeContext,t=this.method.methodGetLiteral(t+(e<<8)),n=this.newFullClosure(s,r,t);if(1==(i>>7&1))throw Error("on-stack receiver not yet supported");if(n.pointers[Squeak.ClosureFull_receiver]=this.receiver,(this.reclaimableContextCount=0)>"+e.bytesAsString())),this.popNandPush(t,c),this.findSelectorInClass(u,1,i)},lookupSelectorInDict:function(e,t){for(var i=e.pointersSize(),r=(i-Squeak.MethodDict_selectorStart-1&t.hash)+Squeak.MethodDict_selectorStart,s=!1;;){var n=e.pointers[r];if(n===t)return e.pointers[Squeak.MethodDict_array].pointers[r-Squeak.MethodDict_selectorStart];if(n.isNil)return this.nilObj;if(++r===i){if(s)return this.nilObj;r=Squeak.MethodDict_selectorStart,s=!0}}},executeNewMethod:function(e,t,i,r,s,n){if(this.sendCount++,t===this.breakOnMethod&&this.breakNow("executing method "+this.printMethod(t,s,n)),this.logSends){for(var a=" ",o=this.activeContext;!o.isNil;)a+="| ",o=o.pointers[Squeak.Context_sender];var u=this.activeContext.pointers.slice(this.sp+1-i,this.sp+1);console.log(this.sendCount+a+this.printMethod(t,s,n,u))}if(this.breakOnContextChanged&&(this.breakOnContextChanged=!1,this.breakNow()),!(0Squeak.Message_lookupClass&&(r.pointers[Squeak.Message_lookupClass]=i),r},primitivePerform:function(e){var t=this.stackValue(e-1),i=this.stackValue(e),e=e-1,r=this.sp-e,s=this.activeContext.pointers,s=(this.arrayCopy(s,1+r,s,r,e),this.sp--,this.findSelectorInClass(t,e,this.getClass(i)));return this.executeNewMethod(i,s.method,s.argCount,s.primIndex,s.mClass,t),!0},primitivePerformWithArgs:function(e,t){var i=t?3:2,r=this.stackValue(i),s=this.stackValue(i-1),n=this.stackValue(i-2);if(n.sqClass!==this.specialObjects[Squeak.splOb_ClassArray])return!1;var a=t?this.top():this.getClass(r);if(t)for(var o=this.getClass(r);o!==a;)if((o=o.pointers[Squeak.Class_superclass]).isNil)return!1;var t=n.pointersSize(),i=this.sp-(i-1),u=this.activeContext.pointers,n=(this.arrayCopy(n.pointers,0,u,i,t),this.sp+=t-e,this.findSelectorInClass(s,t,a));return this.executeNewMethod(r,n.method,n.argCount,n.primIndex,n.mClass,s),!0},primitiveInvokeObjectAsMethod:function(e,t){for(var i=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e),r=0;r=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return this.popNandPush(2,e),!0;var t,i;if(-4294967295<=e&&e<=4294967295)return e=(t=e<0)?-e:e,t=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,(i=(t=this.instantiateClass(this.specialObjects[t],4)).bytes)[0]=255&e,i[1]=e>>8&255,i[2]=e>>16&255,i[3]=e>>24&255,this.popNandPush(2,t),!0}return!1},pop2AndPushBoolResult:function(e){return!!this.success&&(this.popNandPush(2,e?this.trueObj:this.falseObj),!0)}},"numbers",{getClass:function(e){return this.isSmallInt(e)?this.specialObjects[Squeak.splOb_ClassInteger]:e.sqClass},canBeSmallInt:function(e){return e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt},isSmallInt:function(e){return"number"==typeof e},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,1)},quickDivide:function(e,t){var i;return 0!==t&&(i=e/t|0)*t===e?i:Squeak.NonSmallInt},div:function(e,t){return 0===t?Squeak.NonSmallInt:Math.floor(e/t)},mod:function(e,t){return 0===t?Squeak.NonSmallInt:e-Math.floor(e/t)*t},safeShift:function(e,t){var i;return t<0?t<-31?e<0?-1:0:e>>-t:31>t===e?i:Squeak.NonSmallInt}},"utils",{isContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]||e.sqClass===this.specialObjects[Squeak.splOb_ClassBlockContext]},isMethodContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]},instantiateClass:function(e,t){return this.image.instantiateClass(e,t,this.nilObj)},arrayFill:function(e,t,i,r){for(var s=t;s>",t=t.bytesAsString();if(i&&i.length)for(var a=t.split(/(?<=:)/),o=0;o>"+i.bytesAsString()}),s||(e?"("+e.pointers[Squeak.Context_receiver]+")>>?":"?>>?")},allInstancesOf:function(e,t){"string"==typeof e&&(e=this.globalNamed(e));for(var i=[],r=this.image.someInstanceOf(e);r;)t?t(r):i.push(r),r=this.image.nextInstanceAfter(r);return i},globalNamed:function(i){return this.allGlobalsDo(function(e,t){if(e.bytesAsString()===i)return t})},allGlobalsDo:function(e){for(var t=this.getGlobals(),i=0;it+200&&(e.isNil||r.push("..."),r=r.slice(0,t).concat(["..."]).concat(r.slice(-200)));var n,a,o=[],u=r.length,l="";for(i&&this.logSends&&(l=Array((""+this.sendCount).length+2).join(" "));0>")[0],n=e.split(">>")[1];return this.allMethodsDo(function(e,t,i){if(n.length==i.bytesSize()&&n==i.bytesAsString()&&s==e.className())return r=t}),r},breakAfter:function(e){this.breakOutTick=this.primHandler.millisecondClockValue()+e},breakNow:function(e){e&&console.log("Break: "+e),this.breakOutOfInterpreter="break"},breakOn:function(e){return this.breakOnMethod=e&&this.findMethod(e)},breakOnReturnFromThisContext:function(){this.breakOnContextChanged=!1,this.breakOnContextReturned=this.activeContext},breakOnSendOrReturn:function(){this.breakOnContextChanged=!0,this.breakOnContextReturned=null},printContext:function(e,t){if(!this.isContext(e))return"NOT A CONTEXT: "+i(e);function i(e){e="number"==typeof e||"object"==typeof e?e.sqInstName():"<"+e+">";return e=(e=JSON.stringify(e).slice(1,-1)).length>t-3?e.slice(0,t-3)+"...":e}t=t||72;for(var r="number"==typeof e.pointers[Squeak.BlockContext_argumentCount],s=e.pointers[Squeak.Context_closure],n=!r&&!s.isNil,a=r?e.pointers[Squeak.BlockContext_home]:e,n=n?s.pointers[Squeak.Closure_numArgs]:a.pointers[Squeak.Context_method].methodTempCount(),o=this.decodeSqueakSP(0),u=a.contextSizeWithStack(this)-1,l=o+1,c=l+n-1,h=l+a.pointers[Squeak.Context_method].methodNumArgs()-1,f="",p=o;p<=u;p++){var d="";p===o?d="=rcvr":(p<=c&&(d="=tmp"+(p-l)),p<=h&&(d+="/arg"+(p-l))),f+="\nctx["+p+"]"+d+": "+i(a.pointers[p])}if(r){f+="\n";var s=e.pointers[Squeak.BlockContext_argumentCount],m=this.decodeSqueakSP(1),h=m+s,v=e===this.activeContext?this.sp:e.pointers[Squeak.Context_stackPointer];v");for(p=m;p<=v;p++)f+="\nblk["+p+"]"+(d=p ",this.pc),this.activeContext.pointers.slice(0,this.sp+1))},willSendOrReturn:function(){var e,t=this.method.bytes[this.pc];if(this.method.methodSignFlag()){if(96<=t&&t<=127)i=this.specialSelectors[2*(t-96)];else if(128<=t&&t<=175)i=this.method.methodGetSelector(15&t);else if(234==t||235==t)this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3);else if(88<=t&&t<=94)return!0}else{if(120<=t&&t<=125)return!0;if(t<131||200==t)return!1;if(176<=t)return!0;if(t<=134){if(132===t){if(1>5)return!1;e=this.method.bytes[this.pc+2]}else e=this.method.bytes[this.pc+1]&(134===t?63:31);var i=this.method.methodGetLiteral(e);if("blockCopy:"!==i.bytesAsString())return!0}}return!1},nextSendSelector:function(){var e,t,i=this.method.bytes[this.pc];if(this.method.methodSignFlag())if(96<=i&&i<=127)e=this.specialSelectors[2*(i-96)];else if(128<=i&&i<=175)e=this.method.methodGetSelector(15&i);else{if(234!=i&&235!=i)return null;this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3)}else{if(i<131||200==i)return null;if(208<=i)e=this.method.methodGetLiteral(15&i);else if(176<=i)e=this.specialSelectors[2*(i-176)];else if(i<=134){if(132===i){if(1>5)return null;t=this.method.bytes[this.pc+2]}else t=this.method.bytes[this.pc+1]&(134===i?63:31);e=this.method.methodGetLiteral(t)}}if(e){i=e.bytesAsString();if("blockCopy:"!==i)return i}}}),Object.subclass("Squeak.InterpreterProxy","initialization",{VM_PROXY_MAJOR:1,VM_PROXY_MINOR:11,initialize:function(t){this.vm=t,this.remappableOops=[],Object.defineProperty(this,"successFlag",{get:function(){return t.primHandler.success},set:function(e){t.primHandler.success=e}})},majorVersion:function(){return this.VM_PROXY_MAJOR},minorVersion:function(){return this.VM_PROXY_MINOR}},"success",{failed:function(){return!this.successFlag},primitiveFail:function(){this.successFlag=!1},primitiveFailFor:function(e){this.successFlag=!1},success:function(e){e||(this.successFlag=!1)}},"stack access",{pop:function(e){this.vm.popN(e)},popthenPush:function(e,t){this.vm.popNandPush(e,t)},push:function(e){this.vm.push(e)},pushBool:function(e){this.vm.push(e?this.vm.trueObj:this.vm.falseObj)},pushInteger:function(e){this.vm.push(e)},pushFloat:function(e){this.vm.push(this.floatObjectOf(e))},stackValue:function(e){return this.vm.stackValue(e)},stackIntegerValue:function(e){e=this.vm.stackValue(e);return"number"==typeof e?e:(this.successFlag=!1,0)},stackFloatValue:function(e){this.vm.success=!0;e=this.vm.stackIntOrFloat(e);return this.vm.success?e:(this.successFlag=!1,0)},stackObjectValue:function(e){e=this.vm.stackValue(e);return"number"!=typeof e?e:(this.successFlag=!1,this.vm.nilObj)},stackBytes:function(e){e=this.vm.stackValue(e);return e.bytes||("number"!=typeof e&&e.isBytes()||(this.successFlag=!1),[])},stackWords:function(e){e=this.vm.stackValue(e);return e.words||("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackInt32Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsInt32Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackInt16Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsInt16Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])},stackUint16Array:function(e){e=this.vm.stackValue(e);return e.words?e.wordsAsUint16Array():("number"!=typeof e&&e.isWords()||(this.successFlag=!1),[])}},"object access",{isBytes:function(e){return"number"!=typeof e&&e.isBytes()},isWords:function(e){return"number"!=typeof e&&e.isWords()},isWordsOrBytes:function(e){return"number"!=typeof e&&e.isWordsOrBytes()},isPointers:function(e){return"number"!=typeof e&&e.isPointers()},isIntegerValue:function(e){return"number"==typeof e&&-1073741824<=e&&e<=1073741823},isArray:function(e){return e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]},isMemberOf:function(e,t){var i=e.sqClass.pointers[Squeak.Class_name].bytes;if(t.length!==i.length)return!1;for(var r=0;r=e.pointers.length)return this.successFlag=!1;e.pointers[t]=i}},"constant access",{isKindOfInteger:function(e){return"number"==typeof e||e.sqClass==this.classLargeNegativeInteger()||e.sqClass==this.classLargePositiveInteger()},classArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassArray]},classBitmap:function(){return this.vm.specialObjects[Squeak.splOb_ClassBitmap]},classSmallInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassInteger]},classLargePositiveInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger]},classLargeNegativeInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargeNegativeInteger]},classPoint:function(){return this.vm.specialObjects[Squeak.splOb_ClassPoint]},classString:function(){return this.vm.specialObjects[Squeak.splOb_ClassString]},classByteArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassByteArray]},nilObject:function(){return this.vm.nilObj},falseObject:function(){return this.vm.falseObj},trueObject:function(){return this.vm.trueObj}},"vm functions",{clone:function(e){return this.vm.image.clone(e)},instantiateClassindexableSize:function(e,t){return this.vm.instantiateClass(e,t)},methodArgumentCount:function(){return this.argCount},makePointwithxValueyValue:function(e,t){return this.vm.primHandler.makePointWithXandY(e,t)},pushRemappableOop:function(e){this.remappableOops.push(e)},popRemappableOop:function(){return this.remappableOops.pop()},showDisplayBitsLeftTopRightBottom:function(e,t,i,r,s){t>5,!0);if(6===e)return i.send(this.method.methodGetLiteral(63&r),r>>6,!1)}return 7===e?i.doPop():8===e?i.doDup():9===e?i.pushActiveContext():(r=this.method.bytes[this.pc++],10===e?r<128?i.pushNewArray(r):i.popIntoNewArray(r-128):(a=this.method.bytes[this.pc++],11===e?i.callPrimitive(r+256*a):12===e?i.pushRemoteTemp(r,a):13===e?i.storeIntoRemoteTemp(r,a):14===e?i.popIntoRemoteTemp(r,a):(n=this.method.bytes[this.pc++],i.pushClosureCopy(r>>4,15&r,256*a+n))))}}),Squeak.InstructionStream.subclass("Squeak.InstructionStreamSista","decoding",{interpretNextInstructionFor:function(e){return this.interpretNextInstructionExtFor(e,0,0)},interpretNextInstructionExtFor:function(e,t,i){this.Squeak;var r=this.method.bytes[this.pc++];switch(r){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return e.pushReceiverVariable(15&r);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return e.pushLiteralVariable(this.method.methodGetLiteral(15&r));case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return e.pushConstant(this.method.methodGetLiteral(31&r));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return e.pushTemporaryVariable(15&r);case 72:case 73:case 74:case 75:return e.pushTemporaryVariable(8+(3&r));case 76:return e.pushReceiver();case 77:return e.pushConstant(this.vm.trueObj);case 78:return e.pushConstant(this.vm.falseObj);case 79:return e.pushConstant(this.vm.nilObj);case 80:return e.pushConstant(0);case 81:return e.pushConstant(1);case 82:return e.pushActiveContext();case 83:return e.doDup();case 88:return e.methodReturnReceiver();case 89:return e.methodReturnConstant(this.vm.trueObj);case 90:return e.methodReturnConstant(this.vm.falseObj);case 91:return e.methodReturnConstant(this.vm.nilObj);case 92:return e.methodReturnTop();case 93:return e.blockReturnConstant(this.vm.nilObj);case 94:if(0===t)return e.blockReturnTop();break;case 95:return e.nop();case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return e.send(this.vm.specialSelectors[2*(r-96)],this.vm.specialSelectors[2*(r-96)+1],!1);case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return e.send(this.method.methodGetLiteral(15&r),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return e.send(this.method.methodGetLiteral(15&r),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return e.send(this.method.methodGetLiteral(15&r),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return e.jump(1+(7&r));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return e.jumpIf(!0,1+(7&r));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return e.jumpIf(!1,1+(7&r));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return e.popIntoReceiverVariable(7&r);case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return e.popIntoTemporaryVariable(r-208);case 216:return e.doPop()}var s=this.method.bytes[this.pc++];switch(r){case 224:return this.interpretNextInstructionExtFor(e,(t<<8)+s,i);case 225:return this.interpretNextInstructionExtFor(e,t,(i<<8)+(s<128?s:s-256));case 226:return e.pushReceiverVariable(s+(t<<8));case 227:return e.pushLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 228:return e.pushConstant(this.method.methodGetLiteral(s+(t<<8)));case 229:return e.pushTemporaryVariable(s);case 231:return s<128?e.pushNewArray(s):e.popIntoNewArray(s-128);case 232:return e.pushConstant(s+(i<<8));case 233:return e.pushConstant("$"+s+(i<<8));case 234:return e.send(this.method.methodGetSelector((s>>3)+(t<<5)),(7&s)+(i<<3),!1);case 235:var n=this.method.methodGetSelector((s>>3)+(t<<5));return 64<=i?e.sendSuperDirected(n):e.send(n,(7&s)+(i<<3),!0);case 237:return e.jump(s+(i<<8));case 238:return e.jumpIf(!0,s+(i<<8));case 239:return e.jumpIf(!1,s+(i<<8));case 240:return e.popIntoReceiverVariable(s+(t<<8));case 241:return e.popIntoLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 242:return e.popIntoTemporaryVariable(s);case 243:return e.storeIntoReceiverVariable(s+(t<<8));case 244:return e.storeIntoLiteralVariable(this.method.methodGetLiteral(s+(t<<8)));case 245:return e.storeIntoTemporaryVariable(s)}var a=this.method.bytes[this.pc++];switch(r){case 248:return e.callPrimitive(s+(a<<8));case 249:var o=s+(t<<8),u=63&a,l=this.method.methodGetLiteral(o);return e.pushFullClosure(o,u,l.methodNumArgs());case 250:o=(7&s)+8*this.mod(t,16),u=(s>>3&7)+8*this.div(t,16);return e.pushClosureCopy(u,o,a+(i<<8));case 251:return e.pushRemoteTemp(s,a);case 252:return e.storeIntoRemoteTemp(s,a);case 253:return e.popIntoRemoteTemp(s,a)}throw Error("Unknown bytecode: "+r)}}),Object.subclass("Squeak.InstructionPrinter","initialization",{initialize:function(e,t){this.method=e,this.vm=t}},"printing",{printInstructions:function(e,t,i){this.indent=e,this.highlight=t,this.highlightPC=i,this.innerIndents={},this.result="",this.scanner=new(this.method.methodSignFlag()?Squeak.InstructionStreamSista:Squeak.InstructionStream)(this.method,this.vm),this.oldPC=this.scanner.pc,this.endPC=0,this.done=!1;try{for(;!this.done;)this.scanner.interpretNextInstructionFor(this)}catch(e){this.print("!!! "+e.message)}return this.result},print:function(e){this.oldPC===this.highlightPC?this.highlight&&(this.result+=this.highlight):this.indent&&(this.result+=this.indent),this.result+=this.oldPC;for(var t=0;tthis.oldPC&&(this.result+=" "),this.result+=(this.method.bytes[t]+256).toString(16).substr(-2).toUpperCase();this.result+="> "+e+"\n",this.oldPC=this.scanner.pc}},"decoding",{blockReturnConstant:function(e){this.print("blockReturn: "+e.toString())},blockReturnTop:function(){this.print("blockReturn")},doDup:function(){this.print("dup")},doPop:function(){this.print("pop")},jump:function(e){this.print("jumpTo: "+(this.scanner.pc+e)),this.scanner.pc+e>this.endPC&&(this.endPC=this.scanner.pc+e)},jumpIf:function(e,t){this.print((e?"jumpIfTrue: ":"jumpIfFalse: ")+(this.scanner.pc+t)),this.scanner.pc+t>this.endPC&&(this.endPC=this.scanner.pc+t)},methodReturnReceiver:function(){this.print("return: receiver"),this.done=this.scanner.pc>this.endPC},methodReturnTop:function(){this.print("return: topOfStack"),this.done=this.scanner.pc>this.endPC},methodReturnConstant:function(e){this.print("returnConst: "+e.toString()),this.done=this.scanner.pc>this.endPC},nop:function(){this.print("nop")},popIntoLiteralVariable:function(e){this.print("popIntoBinding: "+e.assnKeyAsString())},popIntoReceiverVariable:function(e){this.print("popIntoInstVar: "+e)},popIntoTemporaryVariable:function(e){this.print("popIntoTemp: "+e)},pushActiveContext:function(){this.print("push: thisContext")},pushConstant:function(e){e=e.sqInstName?e.sqInstName():e.toString();this.print("pushConst: "+e)},pushLiteralVariable:function(e){this.print("pushBinding: "+e.assnKeyAsString())},pushReceiver:function(){this.print("push: self")},pushReceiverVariable:function(e){this.print("pushInstVar: "+e)},pushTemporaryVariable:function(e){this.print("pushTemp: "+e)},send:function(e,t,i){this.print((i?"superSend: #":"send: #")+(e.bytesAsString?e.bytesAsString():e))},sendSuperDirected:function(e){this.print("directedSuperSend: #"+(e.bytesAsString?e.bytesAsString():e))},storeIntoLiteralVariable:function(e){this.print("storeIntoBinding: "+e.assnKeyAsString())},storeIntoReceiverVariable:function(e){this.print("storeIntoInstVar: "+e)},storeIntoTemporaryVariable:function(e){this.print("storeIntoTemp: "+e)},pushNewArray:function(e){this.print("push: (Array new: "+e+")")},popIntoNewArray:function(e){this.print("pop: "+e+" into: (Array new: "+e+")")},pushRemoteTemp:function(e,t){this.print("push: "+e+" ofTemp: "+t)},storeIntoRemoteTemp:function(e,t){this.print("storeInto: "+e+" ofTemp: "+t)},popIntoRemoteTemp:function(e,t){this.print("popInto: "+e+" ofTemp: "+t)},pushClosureCopy:function(e,t,i){var r=this.scanner.pc,s=r+i;this.print("closure("+r+"-"+(s-1)+"): "+e+" copied, "+t+" args");for(var n=r;nthis.endPC&&(this.endPC=s)},pushFullClosure:function(e,t,i){this.print("pushFullClosure: (self literalAt: "+e+") numCopied: "+t+" numArgs: "+i)},callPrimitive:function(e){this.print("primitive: "+e)}}),Object.subclass("Squeak.Primitives","initialization",{initialize:function(e,t){this.vm=e,this.oldPrims=!this.vm.image.hasClosures,this.allowAccessBeyondSP=this.oldPrims,this.deferDisplayUpdates=!1,this.semaphoresToSignal=[],this.initDisplay(t),this.initAtCache(),this.initModules(),this.initPlugins(),e.image.isSpur&&(this.charFromInt=this.charFromIntSpur,this.charToInt=this.charToIntSpur,this.identityHash=this.identityHashSpur)},initDisplay:function(e){this.display=e},initModules:function(){this.loadedModules={},this.builtinModules={},this.patchModules={},this.interpreterProxy=new Squeak.InterpreterProxy(this.vm)},initPlugins:function(){}},"dispatch",{quickSendOther:function(e,t){switch(this.success=!0,t){case 0:return this.popNandPushIfOK(2,this.objectAt(!0,!0,!1));case 1:return this.popNandPushIfOK(3,this.objectAtPut(!0,!0,!1));case 2:return this.popNandPushIfOK(1,this.objectSize(!0));case 6:return this.popNandPushBoolIfOK(2,this.vm.stackValue(1)===this.vm.stackValue(0));case 7:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 8:return this.popNandPushIfOK(2,this.doBlockCopy());case 9:return this.primitiveBlockValue(0);case 10:return this.primitiveBlockValue(1)}return!1},doPrimitive:function(e,t,i){switch(this.success=!0,e){case 1:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)+this.stackInteger(0));case 2:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)-this.stackInteger(0));case 3:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)this.stackInteger(0));case 5:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)<=this.stackInteger(0));case 6:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)>=this.stackInteger(0));case 7:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)===this.stackInteger(0));case 8:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)!==this.stackInteger(0));case 9:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)*this.stackInteger(0));case 10:return this.popNandPushIntIfOK(t+1,this.vm.quickDivide(this.stackInteger(1),this.stackInteger(0)));case 11:return this.popNandPushIntIfOK(t+1,this.vm.mod(this.stackInteger(1),this.stackInteger(0)));case 12:return this.popNandPushIntIfOK(t+1,this.vm.div(this.stackInteger(1),this.stackInteger(0)));case 13:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)/this.stackInteger(0)|0);case 14:return this.popNandPushIfOK(t+1,this.doBitAnd());case 15:return this.popNandPushIfOK(t+1,this.doBitOr());case 16:return this.popNandPushIfOK(t+1,this.doBitXor());case 17:return this.popNandPushIfOK(t+1,this.doBitShift());case 18:return this.primitiveMakePoint(t,!1);case 19:return!1;case 20:return this.vm.warnOnce("missing primitive: 20 (primitiveRemLargeIntegers)"),!1;case 21:return this.vm.warnOnce("missing primitive: 21 (primitiveAddLargeIntegers)"),!1;case 22:return this.vm.warnOnce("missing primitive: 22 (primitiveSubtractLargeIntegers)"),!1;case 23:return this.primitiveLessThanLargeIntegers(t);case 24:return this.primitiveGreaterThanLargeIntegers(t);case 25:return this.primitiveLessOrEqualLargeIntegers(t);case 26:return this.primitiveGreaterOrEqualLargeIntegers(t);case 27:return this.primitiveEqualLargeIntegers(t);case 28:return this.primitiveNotEqualLargeIntegers(t);case 29:return this.vm.warnOnce("missing primitive: 29 (primitiveMultiplyLargeIntegers)"),!1;case 30:return this.vm.warnOnce("missing primitive: 30 (primitiveDivideLargeIntegers)"),!1;case 31:return this.vm.warnOnce("missing primitive: 31 (primitiveModLargeIntegers)"),!1;case 32:return this.vm.warnOnce("missing primitive: 32 (primitiveDivLargeIntegers)"),!1;case 33:return this.vm.warnOnce("missing primitive: 33 (primitiveQuoLargeIntegers)"),!1;case 34:return this.vm.warnOnce("missing primitive: 34 (primitiveBitAndLargeIntegers)"),!1;case 35:return this.vm.warnOnce("missing primitive: 35 (primitiveBitOrLargeIntegers)"),!1;case 36:return this.vm.warnOnce("missing primitive: 36 (primitiveBitXorLargeIntegers)"),!1;case 37:return this.vm.warnOnce("missing primitive: 37 (primitiveBitShiftLargeIntegers)"),!1;case 38:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 39:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 40:return this.popNandPushFloatIfOK(t+1,this.stackInteger(0));case 41:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)+this.stackFloat(0));case 42:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)-this.stackFloat(0));case 43:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)this.stackFloat(0));case 45:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)<=this.stackFloat(0));case 46:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)>=this.stackFloat(0));case 47:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)===this.stackFloat(0));case 48:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)!==this.stackFloat(0));case 49:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)*this.stackFloat(0));case 50:return this.popNandPushFloatIfOK(t+1,this.safeFDiv(this.stackFloat(1),this.stackFloat(0)));case 51:return this.popNandPushIfOK(t+1,this.floatAsSmallInt(this.stackFloat(0)));case 52:return this.popNandPushFloatIfOK(t+1,this.floatFractionPart(this.stackFloat(0)));case 53:return this.popNandPushIntIfOK(t+1,this.frexp_exponent(this.stackFloat(0))-1);case 54:return this.popNandPushFloatIfOK(t+1,this.ldexp(this.stackFloat(1),this.stackFloat(0)));case 55:return this.popNandPushFloatIfOK(t+1,Math.sqrt(this.stackFloat(0)));case 56:return this.popNandPushFloatIfOK(t+1,Math.sin(this.stackFloat(0)));case 57:return this.popNandPushFloatIfOK(t+1,Math.atan(this.stackFloat(0)));case 58:return this.popNandPushFloatIfOK(t+1,Math.log(this.stackFloat(0)));case 59:return this.popNandPushFloatIfOK(t+1,Math.exp(this.stackFloat(0)));case 60:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 61:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 62:return this.popNandPushIfOK(t+1,this.objectSize(!1));case 63:return this.popNandPushIfOK(t+1,this.objectAt(!1,!0,!1));case 64:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!0,!1));case 65:return this.vm.warnOnce("missing primitive: 65 (primitiveNext)"),!1;case 66:return this.vm.warnOnce("missing primitive: 66 (primitiveNextPut)"),!1;case 67:return this.vm.warnOnce("missing primitive: 67 (primitiveAtEnd)"),!1;case 68:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 69:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 70:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(0),0));case 71:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(1),this.stackPos32BitInt(0)));case 72:return this.primitiveArrayBecome(t,!1,!0);case 73:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 74:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 75:return this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0)));case 76:return this.primitiveStoreStackp(t);case 77:return this.popNandPushIfOK(t+1,this.someInstanceOf(this.stackNonInteger(0)));case 78:return this.popNandPushIfOK(t+1,this.nextInstanceAfter(this.stackNonInteger(0)));case 79:return this.primitiveNewMethod(t);case 80:return this.popNandPushIfOK(t+1,this.doBlockCopy());case 81:return this.primitiveBlockValue(t);case 82:return this.primitiveBlockValueWithArgs(t);case 83:return this.vm.primitivePerform(t);case 84:return this.vm.primitivePerformWithArgs(t,!1);case 85:return this.primitiveSignal();case 86:return this.primitiveWait();case 87:return this.primitiveResume();case 88:return this.primitiveSuspend();case 89:return this.vm.flushMethodCache();case 90:return this.primitiveMousePoint(t);case 91:return this.primitiveTestDisplayDepth(t);case 92:return this.vm.warnOnce("missing primitive: 92 (primitiveSetDisplayMode)"),!1;case 93:return this.primitiveInputSemaphore(t);case 94:return this.primitiveGetNextEvent(t);case 95:return this.primitiveInputWord(t);case 96:return this.namedPrimitive("BitBltPlugin","primitiveCopyBits",t);case 97:return this.primitiveSnapshot(t);case 98:return this.primitiveStoreImageSegment(t);case 99:return this.primitiveLoadImageSegment(t);case 100:return this.vm.primitivePerformWithArgs(t,!0);case 101:return this.primitiveBeCursor(t);case 102:return this.primitiveBeDisplay(t);case 103:return this.primitiveScanCharacters(t);case 104:return this.vm.warnOnce("missing primitive: 104 (primitiveDrawLoop)"),!1;case 105:return this.popNandPushIfOK(t+1,this.doStringReplace());case 106:return this.primitiveScreenSize(t);case 107:return this.primitiveMouseButtons(t);case 108:return this.primitiveKeyboardNext(t);case 109:return this.primitiveKeyboardPeek(t);case 110:return this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(t+1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(t+1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(t);case 114:return this.primitiveExitToDebugger(t);case 115:return this.primitiveChangeClass(t);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(t,i);case 118:return this.primitiveDoPrimitiveWithArgs(t);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return this.primitiveCalloutToFFI(t,i);case 121:return this.primitiveImageName(t);case 122:return this.primitiveReverseDisplay(t);case 123:return this.vm.warnOnce("missing primitive: 123 (primitiveValueUninterruptably)"),!1;case 124:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(t+1,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(t);case 127:return this.primitiveShowDisplayRect(t);case 128:return this.primitiveArrayBecome(t,!0,!0);case 129:return this.popNandPushIfOK(t+1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(t);case 131:return this.primitivePartialGC(t);case 132:return this.popNandPushBoolIfOK(t+1,this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return this.popNIfOK(t);case 134:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(t+1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(t);case 137:return this.popNandPushIfOK(t+1,this.secondClock());case 138:return this.popNandPushIfOK(t+1,this.someObject());case 139:return this.popNandPushIfOK(t+1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(t);case 141:return this.primitiveClipboardText(t);case 142:return this.popNandPushIfOK(t+1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(t);case 145:return this.primitiveConstantFill(t);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",t);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",t);case 148:return this.popNandPushIfOK(t+1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(t);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(t);case 151:if(this.oldPrims)return this.primitiveFileClose(t);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(t);case 153:if(this.oldPrims)return this.primitiveFileOpen(t);case 154:if(this.oldPrims)return this.primitiveFileRead(t);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(t);case 156:if(this.oldPrims)return this.primitiveFileDelete(t);case 157:if(this.oldPrims)return this.primitiveFileSize(t);break;case 158:return this.oldPrims?this.primitiveFileWrite(t):(this.vm.warnOnce("missing primitive: 158 (primitiveCompareWith)"),!1);case 159:return this.oldPrims?this.primitiveFileRename(t):this.popNandPushIntIfOK(t+1,1664525*this.stackSigned53BitInt(0)&268435455);case 160:return this.oldPrims?this.primitiveDirectoryCreate(t):this.primitiveAdoptInstance(t);case 161:return this.oldPrims?this.primitiveDirectoryDelimitor(t):(this.vm.warnOnce("missing primitive: 161 (primitiveSetIdentityHash)"),!1);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(t);break;case 163:return this.oldPrims?this.primitiveDirectoryDelete(t):(this.vm.warnOnce("missing primitive: 163 (primitiveGetImmutability)"),!1);case 164:return this.popNandPushIfOK(t+1,this.vm.trueObj);case 165:case 166:return this.primitiveIntegerAtAndPut(t);case 167:return!1;case 168:return this.primitiveCopyObject(t);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(t):this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)!==this.vm.stackValue(0));case 170:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStart",t):this.primitiveAsCharacter(t);case 171:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",t):this.popNandPushIfOK(t+1,this.stackNonInteger(0).hash);case 172:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStop",t):(this.vm.warnOnce("missing primitive: 172 (primitiveFetchMourner)"),this.popNandPushIfOK(t,this.vm.nilObj));case 173:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 174:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 175:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySilence",t):this.vm.image.isSpur?this.popNandPushIfOK(t+1,this.behaviorHash(this.stackNonInteger(0))):(this.vm.warnOnce("primitive 175 called in non-spur image"),this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0))));case 176:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primWaveTableSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.vm.image.isSpur?4194303:4095);case 177:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primFMSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.allInstancesOf(this.stackNonInteger(0)));case 178:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primPluckedSoundmixSampleCountintostartingAtpan",t):!1;case 179:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primSampledSoundmixSampleCountintostartingAtpan",t);break;case 180:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixFMSound",t):!1;case 181:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixPluckedSound",t):this.primitiveSizeInBytesOfInstance(t);case 182:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol",t):this.primitiveSizeInBytes(t);case 183:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveApplyReverb",t):this.primitiveIsPinned(t);case 184:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixLoopedSampledSound",t):this.primitivePin(t);case 185:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixSampledSound",t):this.primitiveExitCriticalSection(t);case 186:if(this.oldPrims)break;return this.primitiveEnterCriticalSection(t);case 187:if(this.oldPrims)break;return this.primitiveTestAndSetOwnershipOfCriticalSection(t);case 188:if(this.oldPrims)break;return this.primitiveExecuteMethodArgsArray(t);case 189:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundInsertSamples",t):!1;case 190:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartRecording",t);case 191:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStopRecording",t);case 192:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundGetRecordingSampleRate",t);case 193:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundRecordSamples",t);case 194:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundSetRecordLevel",t);break;case 195:case 196:case 197:case 198:case 199:return!1;case 200:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveInitializeNetwork",t):this.primitiveClosureCopyWithCopiedValues(t);case 201:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartNameLookup",t):this.primitiveClosureValue(t);case 202:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverNameLookupResult",t):this.primitiveClosureValue(t);case 203:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartAddressLookup",t):this.primitiveClosureValue(t);case 204:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAddressLookupResult",t):this.primitiveClosureValue(t);case 205:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAbortLookup",t):this.primitiveClosureValue(t);case 206:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverLocalAddress",t):this.primitiveClosureValueWithArgs(t);case 207:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStatus",t):this.primitiveFullClosureValue(t);case 208:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverError",t):this.primitiveFullClosureValueWithArgs(t);case 209:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketCreate",t):this.primitiveFullClosureValueNoContextSwitch(t);case 210:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketDestroy",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 211:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketConnectionStatus",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 212:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketError",t):this.popNandPushIfOK(t+1,this.objectSize(!1));case 213:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalAddress",t);case 214:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalPort",t);case 215:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemoteAddress",t);case 216:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemotePort",t);case 217:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketConnectToPort",t);case 218:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketListenWithOrWithoutBacklog",t):(this.vm.warnOnce("missing primitive: 218 (tryNamedPrimitiveInForWithArgs"),!1);case 219:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCloseConnection",t);case 220:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAbortConnection",t);break;case 221:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataBufCount",t):this.primitiveClosureValueNoContextSwitch(t);case 222:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataAvailable",t):this.primitiveClosureValueNoContextSwitch(t);case 223:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDataBufCount",t);case 224:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDone",t);case 225:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAccept",t);break;case 230:return this.primitiveRelinquishProcessorForMicroseconds(t);case 231:return this.primitiveForceDisplayUpdate(t);case 232:return this.vm.warnOnce("missing primitive: 232 (primitiveFormPrint)"),!1;case 233:return this.primitiveSetFullScreen(t);case 234:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveDecompressFromByteArray",t);case 235:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompareString",t);case 236:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveConvert8BitSigned",t);case 237:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompressToByteArray",t);case 238:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortOpen",t);case 239:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortClose",t);break;case 240:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortWrite",t):this.popNandPushIfOK(t+1,this.microsecondClockUTC());case 241:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortRead",t):this.popNandPushIfOK(t+1,this.microsecondClockLocal());case 242:if(this.oldPrims)break;return this.primitiveSignalAtUTCMicroseconds(t);case 243:return this.oldPrims?this.namedPrimitive("MiscPrimitivePlugin","primitiveTranslateStringWithTable",t):(this.vm.warnOnce("missing primitive: 243 (primitiveUpdateTimeZone)"),!1);case 244:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindFirstInString",t);case 245:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveIndexOfAsciiInString",t);case 246:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindSubstring",t);break;case 248:return this.primitiveArrayBecome(t,!1,!1);case 249:return this.primitiveArrayBecome(t,!1,!0);case 254:return this.primitiveVMParameter(t);case 521:return this.namedPrimitive("MIDIPlugin","primitiveMIDIClosePort",t);case 522:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetClock",t);case 523:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortCount",t);case 524:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortDirectionality",t);case 525:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortName",t);case 526:return this.namedPrimitive("MIDIPlugin","primitiveMIDIOpenPort",t);case 527:return this.namedPrimitive("MIDIPlugin","primitiveMIDIParameterGetOrSet",t);case 528:return this.namedPrimitive("MIDIPlugin","primitiveMIDIRead",t);case 529:return this.namedPrimitive("MIDIPlugin","primitiveMIDIWrite",t);case 550:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeMono",t);case 551:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeStereo",t);case 552:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeMono",t);case 553:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeStereo",t);case 571:return this.primitiveUnloadModule(t);case 572:return this.primitiveListBuiltinModule(t);case 573:return this.primitiveListLoadedModule(t);case 575:return this.vm.warnOnce("missing primitive: 575 (primitiveHighBit)"),!1;case 576:return this.vm.primitiveInvokeObjectAsMethod(t,i);case 578:return this.vm.warnOnce("missing primitive: 578 (primitiveSuspendAndBackupPC)"),!1}return console.error("primitive "+e+" not implemented yet"),!1},namedPrimitive:function(e,t,i){var r,s=""===e?this:this.loadedModules[e],n=(void 0===s&&(s=this.loadModule(e),this.loadedModules[e]=s),!1),a=this.vm.sp;return s?(this.interpreterProxy.argCount=i,"function"==typeof(r=s[this.interpreterProxy.primitiveName=t])?n=s[t](i):"string"==typeof r?n=this[r](i):this.vm.warnOnce("missing primitive: "+e+"."+t)):this.vm.warnOnce("missing module: "+e+" ("+t+")"),(!0===n||!1!==n&&this.success)&&this.vm.sp!==a-i&&!this.vm.frozen&&this.vm.warnOnce("stack unbalanced after primitive "+e+"."+t,"error"),!0===n||!1===n?n:this.success},doNamedPrimitive:function(e,t){if(t.pointersSize()<2)return!1;var i=t.pointers[1];if(4!==i.pointersSize())return!1;this.primMethod=t;t=i.pointers[0].bytesAsString(),i=i.pointers[1].bytesAsString();return this.namedPrimitive(t,i,e)},fakePrimitive:function(e,t,i){return this.vm.warnOnce("faking primitive: "+e),void 0===t?this.vm.popN(i):this.vm.popNandPush(i+1,this.makeStObject(t)),!0}},"modules",{loadModule:function(e){var t,i=Squeak.externalModules[e]||this.builtinModules[e]||this.loadModuleDynamically(e);return i?(this.patchModules[e]&&this.patchModule(i,e),i.setInterpreter&&!i.setInterpreter(this.interpreterProxy)?(console.log("Wrong interpreter proxy version: "+e),null):("function"==typeof(t=i.initialiseModule)?i.initialiseModule():"string"==typeof t&&this[t](),this.interpreterProxy.failed()?(console.log("Module initialization failed: "+e),null):(i.getModuleName&&(e=i.getModuleName()),console.log("Loaded module: "+e),i))):null},loadModuleDynamically:function(e){},patchModule:function(e,t){var i,r=this.patchModules[t];for(i in r)e[i]=r[i]},unloadModule:function(e){var t=this.loadedModules[e];if(!e||!t||t===this)return null;delete this.loadedModules[e];var i=t.unloadModule;return"function"==typeof i?t.unloadModule(this):"string"==typeof i&&this[i](this),console.log("Unloaded module: "+e),t},loadFunctionFrom:function(e,t){var i=""===t?this:this.loadedModules[t];if(void 0===i&&(i=this.loadModule(t),this.loadedModules[t]=i),i){var r=i[e];if("function"==typeof r)return r.bind(i);if("string"==typeof r)return this[r].bind(this);this.vm.warnOnce("missing primitive: "+t+"."+e)}return null},primitiveUnloadModule:function(e){var t=this.stackNonInteger(0).bytesAsString();return!!t&&(this.unloadModule(t),this.popNIfOK(e))},primitiveListBuiltinModule:function(e){var t,i=this.stackInteger(0)-1;return!!this.success&&(t=Object.keys(this.builtinModules),this.popNandPushIfOK(e+1,this.makeStObject(t[i])))},primitiveListLoadedModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var i,r=[];for(i in this.loadedModules){var s=this.loadedModules[i];s&&(s=s.getModuleName?s.getModuleName():i,r.push(s))}return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))}},"stack access",{popNIfOK:function(e){return!!this.success&&(this.vm.popN(e),!0)},pop2andPushBoolIfOK:function(e){return this.vm.success=this.success,this.vm.pop2AndPushBoolResult(e)},popNandPushBoolIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,t?this.vm.trueObj:this.vm.falseObj),!0)},popNandPushIfOK:function(e,t){return!(!this.success||null==t||(this.vm.popNandPush(e,t),0))},popNandPushIntIfOK:function(e,t){return!(!this.success||!this.vm.canBeSmallInt(t)||(this.vm.popNandPush(e,t),0))},popNandPushFloatIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,this.makeFloat(t)),!0)},stackNonInteger:function(e){return this.checkNonInteger(this.vm.stackValue(e))},stackInteger:function(e){return this.checkSmallInt(this.vm.stackValue(e))},stackPos32BitInt:function(e){return this.positive32BitValueOf(this.vm.stackValue(e))},pos32BitIntFor:function(e){if(0<=e&&e<=Squeak.MaxSmallInt)return e;for(var t=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],t=this.vm.instantiateClass(t,4),i=t.bytes,r=0;r<4;r++)i[r]=e>>>8*r&255;return t},pos53BitIntFor:function(e){if(e<=4294967295)return this.pos32BitIntFor(e);if(9007199254740991=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return e;for(var t=e<0,i=t?-e:e,e=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,t=this.vm.instantiateClass(this.vm.specialObjects[e],4),r=t.bytes,s=0;s<4;s++)r[s]=i>>>8*s&255;return t},stackFloat:function(e){return this.checkFloat(this.vm.stackValue(e))},stackBoolean:function(e){return this.checkBoolean(this.vm.stackValue(e))},stackSigned53BitInt:function(e){e=this.vm.stackValue(e);if("number"==typeof e)return e;var t=e.bytesSize();if(t<=7){for(var i=e.bytes,r=0,s=0,n=1;s>>20&2047)&&(t.setFloat64(0,e*Math.pow(2,64)),i=(t.getUint32(0)>>>20&2047)-64),i-1022)},ldexp:function(e,t){for(var i=Math.min(3,Math.ceil(Math.abs(t)/1023)),r=e,s=0;sthis.stackSigned53BitInt(0))},primitiveLessOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)<=this.stackSigned53BitInt(0))},primitiveGreaterOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)>=this.stackSigned53BitInt(0))},primitiveEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)===this.stackSigned53BitInt(0))},primitiveNotEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)!==this.stackSigned53BitInt(0))}},"utils",{floatOrInt:function(e){return e.isFloat?e.float:"number"==typeof e?e:0},positive32BitValueOf:function(e){if("number"==typeof e)return 0<=e?e:(this.success=!1,0);if(!this.isA(e,Squeak.splOb_ClassLargePositiveInteger)||4!==e.bytesSize())return this.success=!1,0;for(var t=e.bytes,i=0,r=0,s=1;r<4;r++,s*=256)i+=t[r]*s;return i},checkFloat:function(e){return e.isFloat?e.float:"number"==typeof e?e:(this.success=!1,0)},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,0)},checkNonInteger:function(e){return"number"!=typeof e?e:(this.success=!1,this.vm.nilObj)},checkBoolean:function(e){return!!e.isTrue||!e.isFalse&&(this.success=!1)},indexableSize:function(e){return"number"==typeof e?-1:e.indexableSize(this)},isA:function(e,t){return e.sqClass===this.vm.specialObjects[t]},isKindOf:function(e,t){for(var i=e.sqClass,r=this.vm.specialObjects[t];!i.isNil;){if(i===r)return!0;i=i.pointers[Squeak.Class_superclass]}return!1},isAssociation:function(e){return"number"!=typeof e&&2==e.pointersSize()},ensureSmallInt:function(e){return e===(0|e)&&this.vm.canBeSmallInt(e)?e:(this.success=!1,0)},charFromInt:function(e){var t,i=this.vm.specialObjects[Squeak.splOb_CharacterTable].pointers[e];return i||(t=this.vm.specialObjects[Squeak.splOb_ClassCharacter],(i=this.vm.instantiateClass(t,0)).pointers[0]=e),i},charFromIntSpur:function(e){return this.vm.image.getCharacter(e)},charToInt:function(e){return e.pointers[0]},charToIntSpur:function(e){return e.hash},makeFloat:function(e){var t=this.vm.specialObjects[Squeak.splOb_ClassFloat],t=this.vm.instantiateClass(t,2);return t.float=e,t},makeLargeIfNeeded:function(e){return this.vm.canBeSmallInt(e)?e:this.makeLargeInt(e)},makeLargeInt:function(e){if(e<0)throw Error("negative large ints not implemented yet");if(4294967295r.size?(this.success=!1,s):i?s.pointers[n-1]:s.isPointers()?s.pointers[n-1+r.ivarOffset]:s.isWords()?r.convertChars?this.charFromInt(1073741823&s.words[n-1]):this.pos32BitIntFor(s.words[n-1]):s.isBytes()?r.convertChars?this.charFromInt(255&s.bytes[n-1]):255&s.bytes[n-1]:n-1-(e=4*s.pointersSize())<0?(this.success=!1,s):255&s.bytes[n-1-e]},objectAtPut:function(e,t,i){var r,s=this.stackNonInteger(2),n=this.stackPos32BitInt(1);if(!this.success)return s;if(e){if((r=this.atPutCache[s.hash&this.atCacheMask]).array!==s)return this.success=!1,s}else{if(s.isFloat)return e=this.stackPos32BitInt(0),!this.success||1!=n&&2!=n?this.success=!1:((o=s.floatData()).setUint32(1==n?0:4,e,!1),s.float=o.getFloat64(0)),this.vm.stackValue(0);r=this.makeAtCacheInfo(this.atPutCache,this.vm.specialSelectors[34],s,t,i)}if(n<1||n>r.size)return this.success=!1,s;var a,e=this.vm.stackValue(0);if(i)return s.dirty=!0,s.pointers[n-1]=e;if(s.isPointers())return s.dirty=!0,s.pointers[n-1+r.ivarOffset]=e;if(s.isWords()){if(t){if(e.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,e;if("number"!=typeof(a=this.charToInt(e)))return this.success=!1,e}else a=this.stackPos32BitInt(0);this.success&&(s.words[n-1]=a)}else{if(t){if(e.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,e;if("number"!=typeof(a=this.charToInt(e)))return this.success=!1,e}else{if("number"!=typeof e)return this.success=!1,e;a=e}if(a<0||255this.vm.image.bytesLeft()?(console.warn("squeak: out of memory, failing allocation"),this.success=!1,this.vm.primFailCode=Squeak.PrimErrNoMemory,null):this.vm.instantiateClass(e,t)},someObject:function(){return this.vm.image.firstOldObject},nextObject:function(e){return this.vm.image.objectAfter(e)||0},someInstanceOf:function(e){e=this.vm.image.someInstanceOf(e);return e||(this.success=!1,0)},nextInstanceAfter:function(e){e=this.vm.image.nextInstanceAfter(e);return e||(this.success=!1,0)},allInstancesOf:function(e){var e=this.vm.image.allInstancesOf(e),t=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],e.length);return t.pointers=e,t},identityHash:function(e){return e.hash},identityHashSpur:function(e){var t=e.hash;return 0=t.pointers.length)return!1;for(var r=t.pointers[Squeak.Context_stackPointer];r=s)){this.vm.popN(2);for(var n=0;n=i.length)return!1;if(e<2)t=i[r];else{if((t=this.stackInteger(0))<-32768||32767=i.length)return!1;if(e<2)t=this.signed32BitIntegerFor(i[r]);else{if(t=this.stackSigned32BitInt(0),!this.success)return!1;i[r]=t}return this.popNandPushIfOK(e+1,t),!0},primitiveConstantFill:function(e){var t=this.stackNonInteger(1),i=this.stackPos32BitInt(0);if(!this.success||!t.isWordsOrBytes())return!1;var r=t.words||t.bytes;if(r){if(r===t.bytes&&255t)s=i[t];else{if(!(t<0&&r&&r.length>-t-1))return!1;s=r[-t-1]}}return this.vm.popNandPush(e+1,this.makeStObject(s)),!0},setLowSpaceThreshold:function(){var e=this.stackInteger(0);return this.success&&(this.vm.lowSpaceThreshold=e),this.vm.stackValue(1)},primitiveVMParameter:function(e){var t=this.vm.image.isSpur?71:44;switch(e){case 0:for(var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t),r=0;r","<=",">=","=","~=","*","/","\\\\","@","bitShift:","//","bitAnd:","bitOr:","at:","at:put:","size","next","nextPut:","atEnd","==","class","blockCopy:","value","value:","do:","new","new:","x","y"],this.doitCounter=0}},"accessing",{compile:function(e,t,i){e.methodSignFlag()||(void 0===e.compiled?e.compiled=!1:(this.singleStep=!1,this.debug=this.comments,t=t&&t.className(),i=i&&i.bytesAsString(),e.compiled=this.generate(e,t,i)))},enableSingleStepping:function(r,s,n){var e,t,i;return r.compiled&&r.compiled.canSingleStep||(this.singleStep=!0,this.debug=!0,s||this.vm.allMethodsDo(function(e,t,i){if(t===r)return s=e,n=i,!0}),e=s&&s.className(),t=n&&n.bytesAsString(),i=s&&s.allInstVarNames(),r.compiled=this.generate(r,e,t,i),r.compiled.canSingleStep=!0),!0},functionNameFor:function(e,t){var i;return void 0===e||"?"===e?"DOIT_"+ ++this.doitCounter:/[^a-zA-Z0-9:_]/.test(t)?(i=t.replace(/./g,function(e){return{"|":"OR","~":"NOT","<":"LT","=":"EQ",">":"GT","&":"AND","@":"AT","*":"TIMES","+":"PLUS","\\":"MOD","-":"MINUS",",":"COMMA","/":"DIV","?":"IF"}[e]||"OPERATOR"}),e.replace(/[ ]/,"_")+"__"+i+"__"):(e+"_"+t).replace(/[: ]/g,"_")}},"generating",{generate:function(e,t,i,r){for(this.method=e,this.pc=0,this.endPC=0,this.prevPC=0,this.source=[],this.sourceLabels={},this.needsLabel={},this.sourcePos={},this.needsVar={},this.needsBreak=!1,t&&i&&this.source.push("// ",t,">>",i,"\n"),this.instVarNames=r,this.allVars=["context","stack","rcvr","inst[","temp[","lit["],this.sourcePos.context=this.source.length,this.source.push("var context = vm.activeContext;\n"),this.sourcePos.stack=this.source.length,this.source.push("var stack = context.pointers;\n"),this.sourcePos.rcvr=this.source.length,this.source.push("var rcvr = vm.receiver;\n"),this.sourcePos["inst["]=this.source.length,this.source.push("var inst = rcvr.pointers;\n"),this.sourcePos["temp["]=this.source.length,this.source.push("var temp = vm.homeContext.pointers;\n"),this.sourcePos["lit["]=this.source.length,this.source.push("var lit = vm.method.pointers;\n"),this.sourcePos["loop-start"]=this.source.length,this.source.push("while (true) switch (vm.pc) {\ncase 0:\n"),this.done=!1;!this.done;){var s=e.bytes[this.pc++],n=0;switch(248&s){case 0:case 8:this.generatePush("inst[",15&s,"]");break;case 16:case 24:this.generatePush("temp[",6+(15&s),"]");break;case 32:case 40:case 48:case 56:this.generatePush("lit[",1+(31&s),"]");break;case 64:case 72:case 80:case 88:this.generatePush("lit[",1+(31&s),"].pointers[1]");break;case 96:this.generatePopInto("inst[",7&s,"]");break;case 104:this.generatePopInto("temp[",6+(7&s),"]");break;case 112:switch(s){case 112:this.generatePush("rcvr");break;case 113:this.generatePush("vm.trueObj");break;case 114:this.generatePush("vm.falseObj");break;case 115:this.generatePush("vm.nilObj");break;case 116:this.generatePush("-1");break;case 117:this.generatePush("0");break;case 118:this.generatePush("1");break;case 119:this.generatePush("2")}break;case 120:switch(s){case 120:this.generateReturn("rcvr");break;case 121:this.generateReturn("vm.trueObj");break;case 122:this.generateReturn("vm.falseObj");break;case 123:this.generateReturn("vm.nilObj");break;case 124:this.generateReturn("stack[vm.sp]");break;case 125:this.generateBlockReturn();break;default:throw Error("unusedBytecode")}break;case 128:case 136:this.generateExtended(s);break;case 144:this.generateJump(1+(7&s));break;case 152:this.generateJumpIf(!1,1+(7&s));break;case 160:n=e.bytes[this.pc++],this.generateJump(256*((7&s)-4)+n);break;case 168:n=e.bytes[this.pc++],this.generateJumpIf(s<172,256*(3&s)+n);break;case 176:case 184:this.generateNumericOp(s);break;case 192:case 200:this.generateQuickPrim(s);break;case 208:case 216:this.generateSend("lit[",1+(15&s),"]",0,!1);break;case 224:case 232:this.generateSend("lit[",1+(15&s),"]",1,!1);break;case 240:case 248:this.generateSend("lit[",1+(15&s),"]",2,!1)}}r=this.functionNameFor(t,i);return this.singleStep?(this.debug&&this.source.push("// all valid PCs have a label;\n"),this.source.push("default: throw Error('invalid PC');\n}")):(this.sourcePos["loop-end"]=this.source.length,this.source.push("default: vm.interpretOne(true); return;\n}"),this.deleteUnneededLabels()),this.deleteUnneededVariables(),new Function("'use strict';\nreturn function "+r+"(vm) {\n"+this.source.join("")+"}")()},generateExtended:function(e){switch(e){case 128:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePush("inst[",63&t,"]");case 1:return void this.generatePush("temp[",6+(63&t),"]");case 2:return void this.generatePush("lit[",1+(63&t),"]");case 3:return void this.generatePush("lit[",1+(63&t),"].pointers[1]")}case 129:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generateStoreInto("inst[",63&t,"]");case 1:return void this.generateStoreInto("temp[",6+(63&t),"]");case 2:throw Error("illegal store into literal");case 3:return void this.generateStoreInto("lit[",1+(63&t),"].pointers[1]")}return;case 130:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePopInto("inst[",63&t,"]");case 1:return void this.generatePopInto("temp[",6+(63&t),"]");case 2:throw Error("illegal pop into literal");case 3:return void this.generatePopInto("lit[",1+(63&t),"].pointers[1]")}case 131:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!1);case 132:switch(t=this.method.bytes[this.pc++],i=this.method.bytes[this.pc++],t>>5){case 0:return void this.generateSend("lit[",1+i,"]",31&t,!1);case 1:return void this.generateSend("lit[",1+i,"]",31&t,!0);case 2:return void this.generatePush("inst[",i,"]");case 3:return void this.generatePush("lit[",1+i,"]");case 4:return void this.generatePush("lit[",1+i,"].pointers[1]");case 5:return void this.generateStoreInto("inst[",i,"]");case 6:return void this.generatePopInto("inst[",i,"]");case 7:return void this.generateStoreInto("lit[",1+i,"].pointers[1]")}case 133:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!0);case 134:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(63&t),"]",t>>6,!1);case 135:return void this.generateInstruction("pop","vm.sp--");case 136:return this.needsVar.stack=!0,void this.generateInstruction("dup","var dup = stack[vm.sp]; stack[++vm.sp] = dup");case 137:return this.needsVar.stack=!0,void this.generateInstruction("push thisContext","stack[++vm.sp] = vm.exportThisContext()");case 138:var t=this.method.bytes[this.pc++];return void this.generateClosureTemps(127&t,127>4,i<<8|r)}},generatePush:function(e,t,i,r,s){this.debug&&this.generateDebugCode("push",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push("stack[++vm.sp] = ",e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(";\n")},generateStoreInto:function(e,t,i,r,s){this.debug&&this.generateDebugCode("store into",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(" = stack[vm.sp];\n"),this.generateDirty(e,t)},generatePopInto:function(e,t,i,r,s){this.debug&&this.generateDebugCode("pop into",e,t,i,r,s),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,i),void 0!==r)&&this.source.push(r,s),this.source.push(" = stack[vm.sp--];\n"),this.generateDirty(e,t)},generateReturn:function(e){this.debug&&this.generateDebugCode("return",e),this.generateLabel(),this.needsVar[e]=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(",e,"); return;\n"),this.needsBreak=!1,this.done=this.pc>this.endPC},generateBlockReturn:function(){this.debug&&this.generateDebugCode("block return"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(stack[vm.sp--], context.pointers[0]); return;\n"),this.needsBreak=!1},generateJump:function(e){var t=this.pc+e;this.debug&&this.generateDebugCode("jump to "+t),this.generateLabel(),this.needsVar.context=!0,this.source.push("vm.pc = ",t,"; "),e<0&&this.source.push("\nif (vm.interruptCheckCounter-- <= 0) {\n"," vm.checkForInterrupts();\n"," if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n","}\n"),this.singleStep&&this.source.push("\nif (vm.breakOutOfInterpreter) return;\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateJumpIf:function(e,t){t=this.pc+t;this.debug&&this.generateDebugCode("jump if "+e+" to "+t),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",e,"Obj) {vm.pc = ",t,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return; else "),this.source.push("continue}\n","else if (cond !== vm.",!e,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[16+(15&e)]),this.generateLabel(),e){case 192:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-1]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp]) === 'number' && b>0 && b<=a.pointers.length) {\n"," stack[--vm.sp] = a.pointers[b-1];","} else { var c = vm.primHandler.objectAt(true,true,false); if (vm.primHandler.success) stack[--vm.sp] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(16); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 193:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-2]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp-1]) === 'number' && b>0 && b<=a.pointers.length) {\n"," var c = stack[vm.sp]; stack[vm.sp-=2] = a.pointers[b-1] = c; a.dirty = true;","} else { vm.primHandler.objectAtPut(true,true,false); if (vm.primHandler.success) stack[vm.sp-=2] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(17); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 194:return this.needsVar.stack=!0,this.source.push("if (stack[vm.sp].sqClass === vm.specialObjects[7]) stack[vm.sp] = stack[vm.sp].pointersSize();\n","else if (stack[vm.sp].sqClass === vm.specialObjects[6]) stack[vm.sp] = stack[vm.sp].bytesSize();\n","else { vm.pc = ",this.pc,"; vm.sendSpecial(18); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return this.needsVar.stack=!0,void this.source.push("var cond = stack[vm.sp-1] === stack[vm.sp];\nstack[--vm.sp] = cond ? vm.trueObj : vm.falseObj;\n");case 199:return this.needsVar.stack=!0,void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",16+(15&e),"); return}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",16+(15&e),"); return;\n"),void(this.needsLabel[this.pc]=!0)}this.needsVar.rcvr=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",16+(15&e),");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a + b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(0); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 177:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a - b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(1); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 178:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a < b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(2); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 179:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a > b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(3); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 180:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a <= b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(4); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 181:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a >= b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(5); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 182:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a === b ? vm.trueObj : vm.falseObj;\n","} else if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.trueObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(6); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 183:return this.needsVar.stack=!0,void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a !== b ? vm.trueObj : vm.falseObj;\n","} else if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(7); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 184:return void this.source.push("vm.success = true; vm.resultIsFloat = false; if(!vm.pop2AndPushNumResult(vm.stackIntOrFloat(1) * vm.stackIntOrFloat(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(8); return}\n");case 185:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.quickDivide(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(9); return}\n");case 186:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.mod(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(10); return}\n");case 187:return void this.source.push("vm.success = true; if(!vm.primHandler.primitiveMakePoint(1, true)) { vm.pc = ",this.pc,"; vm.sendSpecial(11); return}\n");case 188:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.safeShift(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(12); return}\n");case 189:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.div(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(13); return}\n");case 190:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) & vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(14); return}\n");case 191:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) | vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(15); return}\n")}},generateSend:function(e,t,i,r,s){this.debug&&this.generateDebugCode("send "+("lit["===e?this.method.pointers[t].bytesAsString():"...")),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; vm.send(",e,t,i,", ",r,", ",s,"); ","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateClosureTemps:function(e,t){if(this.debug&&this.generateDebugCode("closure temps"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var array = vm.instantiateClass(vm.specialObjects[7], ",e,");\n"),t){for(var i=0;ithis.endPC&&(this.endPC=i)},generateCallPrimitive:function(e){this.debug&&this.generateDebugCode("call primitive "+e),this.generateLabel(),129===this.method.bytes[this.pc]&&(this.needsVar.stack=!0,this.source.push("if (vm.primFailCode) {stack[vm.sp] = vm.getErrorObjectFromPrimFailCode(); vm.primFailCode = 0;}\n"))},generateDirty:function(e,t){switch(e){case"inst[":this.source.push("rcvr.dirty = true;\n");break;case"lit[":this.source.push(e,t,"].dirty = true;\n");break;case"temp[":break;default:throw Error("unexpected target "+e)}},generateLabel:function(){this.prevPC&&(this.sourceLabels[this.prevPC]=this.source.length,this.source.push("case ",this.prevPC,":\n")),this.prevPC=this.pc},generateDebugCode:function(e,t,i,r,s,n){this.needsBreak&&(this.source.push("if (vm.breakOutOfInterpreter) {vm.pc = ",this.prevPC,"; return}\n"),this.needsLabel[this.prevPC]=!0);for(var a=[],o=this.prevPC;o ",e),t)switch(this.source.push(" "),t){case"vm.nilObj":this.source.push("nil");break;case"vm.trueObj":this.source.push("true");break;case"vm.falseObj":this.source.push("false");break;case"rcvr":this.source.push("self");break;case"stack[vm.sp]":this.source.push("top of stack");break;case"inst[":this.instVarNames?this.source.push(this.instVarNames[i]):this.source.push("inst var ",i);break;case"temp[":this.source.push("tmp",i-6),"]"!==r&&this.source.push("[",s,"]");break;case"lit[":var u=this.method.pointers[i];"]"===r?this.source.push(u):this.source.push(u.pointers[0].bytesAsString());break;default:this.source.push(t)}this.source.push("\n"),this.needsBreak=this.singleStep},generateInstruction:function(e,t){this.debug&&this.generateDebugCode(e),this.generateLabel(),this.source.push(t,";\n")},deleteUnneededLabels:function(){var e,t=!1;for(e in this.sourceLabels)if(this.needsLabel[e])t=!0;else for(var i=0;i<3;i++)this.source[this.sourceLabels[e]+i]="";t||(this.source[this.sourcePos["loop-start"]]="",this.source[this.sourcePos["loop-end"]]="")},deleteUnneededVariables:function(){this.needsVar.stack&&(this.needsVar.context=!0),this.needsVar["inst["]&&(this.needsVar.rcvr=!0);for(var e=0;e{this.audioInContext=new AudioContext,this.audioInSource=this.audioInContext.createMediaStreamSource(e),t(this.audioInContext,this.audioInSource)}).catch(e=>i("cannot access microphone. "+e.name+": "+e.message)):i("test: audio input not supported")},stopAudioIn:function(){this.audioInSource&&(this.audioInSource.disconnect(),this.audioInSource=null,this.audioInContext.close(),this.audioInContext=null)}}),Object.extend(Squeak,"known classes",{BitBlt_dest:0,BitBlt_source:1,BitBlt_halftone:2,BitBlt_combinationRule:3,BitBlt_destX:4,BitBlt_destY:5,BitBlt_width:6,BitBlt_height:7,BitBlt_sourceX:8,BitBlt_sourceY:9,BitBlt_clipX:10,BitBlt_clipY:11,BitBlt_clipW:12,BitBlt_clipH:13,BitBlt_colorMap:14,BitBlt_warpBase:15,Form_bits:0,Form_width:1,Form_height:2,Form_depth:3,Form_offset:4}),Object.extend(Squeak.Primitives.prototype,"display",{displayDirty:function(){}}),Object.extend(Squeak.Primitives.prototype,"display",{initDisplay:function(e){this.display=e,this.display.vm=this.vm,this.indexedColors=[4294967295,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]},primitiveBeCursor:function(e){if(this.display.cursorCanvas){var t=this.loadForm(this.stackNonInteger(e),!0),i=1===e?this.loadForm(this.stackNonInteger(0)):null;if(!this.success||!t)return!1;var r=this.display.cursorCanvas,s=r.getContext("2d"),n={left:0,top:0,right:t.width,bottom:t.height},i=(r.width=t.width,r.height=t.height,1===t.depth?i?(t=this.cursorMergeMask(t,i),this.showForm(s,t,n,[0,4278190335,4294967295,4278190080])):this.showForm(s,t,n,[0,4278190080]):this.showForm(s,t,n,!0),this.display.context.canvas),s=i.offsetWidth/i.width,n=this.display.highdpi?window.devicePixelRatio:1;r.style.width=(r.width*n*s|0)+"px",r.style.height=(r.height*n*s|0)+"px",this.display.cursorOffsetX=t.offsetX*s|0,this.display.cursorOffsetY=t.offsetY*s|0}return this.vm.popN(e),!0},cursorMergeMask:function(e,t){for(var i=new Uint32Array(16),r=0;r<16;r++){for(var s=e.bits[r],n=t.bits[r],a=2147483648,o=0,u=0;u<16;u++)o=o|(n&a)>>u|(s&a)>>u+1,a>>>=1;i[r]=o}return{obj:e.obj,bits:i,depth:2,width:16,height:16,offsetX:e.offsetX,offsetY:e.offsetY,msb:!0,pixPerWord:16,pitch:1}},primitiveBeDisplay:function(e){var t=this.vm.stackValue(0);return this.vm.specialObjects[Squeak.splOb_TheDisplay]=t,this.vm.popN(e),!0},primitiveReverseDisplay:function(e){if(this.reverseDisplay=!this.reverseDisplay,this.redrawDisplay(),this.display.cursorCanvas){for(var t=this.display.cursorCanvas,i=t.getContext("2d"),t=i.getImageData(0,0,t.width,t.height),r=new Uint32Array(t.data.buffer),s=0;si.left&&(i.left=e.left),e.righti.top&&(i.top=e.top),e.bottom>16)+((255&I)<<16);h[f]=p}this.swappedColors=h}this.reverseDisplay&&(h=r?r.map(function(e){return 16777215^e}):(this.reversedColors||(this.reversedColors=h.map(function(e){return 16777215^e})),this.reversedColors));for(var d=(1<>>k&d],(k-=t.depth)<0&&(k=32-t.depth,b=t.bits[++g]);n++}break;case 16:for(m=s%2?0:16,v=0;v>>k;c[y++]=((31744&F)>>7)+((992&F)<<6)+((31&F)<<19)+4278190080,(k-=16)<0&&(k=16,b=t.bits[++g])}n++}break;case 32:for(var O=r?0:4278190080,v=0;v>16|(255&I)<<16|O;c[y++]=p}n++}break;default:throw Error("depth not implemented")}u.data!==l&&u.data.set(l),e.putImageData(u,i.left,i.top)}},primitiveDeferDisplayUpdates:function(e){var t=this.stackBoolean(0);return!!this.success&&(this.deferDisplayUpdates=t,this.vm.popN(e),!0)},primitiveForceDisplayUpdate:function(e){return this.vm.breakOut(),this.vm.popN(e),!0},primitiveScanCharacters:function(e){if(6!==e)return!1;var t=this.stackInteger(0),i=this.stackNonInteger(1),r=this.stackInteger(2),s=this.stackNonInteger(3),n=this.stackInteger(4),e=this.stackInteger(5);if(!this.success)return!1;if(i.pointersSize()<258||!s.isBytes())return!1;if(!(0i.pitch*i.height))return null;this.vm.warnOnce("loadForm(): "+i.bits.length+" !== "+i.pitch+"*"+i.height+"="+i.pitch*i.height)}}return i},theDisplay:function(){return this.loadForm(this.vm.specialObjects[Squeak.splOb_TheDisplay])},displayDirty:function(e,t){this.deferDisplayUpdates||e!=this.vm.specialObjects[Squeak.splOb_TheDisplay]||this.displayUpdate(this.theDisplay(),t)},displayUpdate:function(e,t){this.showForm(this.display.context,e,t),this.display.lastTick=this.vm.lastTick,this.display.idle=0},primitiveBeep:function(e){var t,i=Squeak.startAudioOut();return i?((t=i.createOscillator()).connect(i.destination),t.type="square",t.frequency.value=880,t.start(),t.stop(i.currentTime+.05)):this.vm.warnOnce("could not initialize audio"),this.popNIfOK(e)}}),Object.extend(Squeak,"files",{fsck:function(t,i,r,s,n){if(i=i||"",s=s||{dirs:[],files:[]},n=n||{dirs:0,files:0,bytes:0,deleted:0},!r&&(r={},Object.keys(Squeak.Settings).forEach(function(e){e=e.match(/squeak-file(\.lz)?:(.*)$/);e&&(r[e[2]]=!0)}),window.SqueakDBFake&&Object.keys(SqueakDBFake.bigFiles).forEach(function(e){r[e]=!0}),"undefined"!=typeof indexedDB))return this.dbTransaction("readonly","fsck cursor",function(e){e=e.openCursor();e.onsuccess=function(e){e=e.target.result;e?(r[e.key]=e.value.byteLength,e.continue()):Squeak.fsck(t,i,r,s,n)},e.onerror=function(e){console.error("fsck failed")}});var e,a=Squeak.dirList(i);for(e in a){var o=i+"/"+e;a[e][3]?(n.dirs++,"squeak:"+o in Squeak.Settings?Squeak.fsck(null,o,r,s,n):s.dirs.push(o)):(n.files++,o in r?(r[o]=null,n.bytes+=a[e][4]):s.files.push(o))}if(""===i){console.log("squeak fsck: "+n.dirs+" directories, "+n.files+" files, "+(n.bytes/1e6).toFixed(1)+" MBytes");var u=[];for(o in r)null!==(c=r[o])&&u.push({path:o,size:c});for(var l=0;lSqueakDBFake.bigFileThreshold?(SqueakDBFake.bigFiles[t]||console.log("File "+t+" ("+e.byteLength+" bytes) too large, storing in memory only"),SqueakDBFake.bigFiles[t]=e):(e=Squeak.bytesAsString(new Uint8Array(e)),"object"==typeof LZString?(i=LZString.compressToUTF16(e),Squeak.Settings["squeak-file.lz:"+t]=i,delete Squeak.Settings["squeak-file:"+t]):Squeak.Settings["squeak-file:"+t]=e);var i,r={};return setTimeout(function(){r.onsuccess&&r.onsuccess()},0),r},delete:function(e){delete Squeak.Settings["squeak-file:"+e],delete Squeak.Settings["squeak-file.lz:"+e],delete SqueakDBFake.bigFiles[e];var t={};return setTimeout(function(){t.onsuccess&&t.onsuccess()},0),t},openCursor:function(){var e={};return setTimeout(function(){e.onsuccess&&e.onsuccess({target:e})},0),e}}),SqueakDBFake},fileGet:function(e,t,i){i=i||function(e){console.log(e)};var r,s=this.splitFilePath(e);return s.basename?(Squeak.debugFiles&&(console.log("Reading "+s.fullname),r=t,t=function(e){console.log("Read "+e.byteLength+" bytes from "+s.fullname),r(e)}),window.SqueakDBFake&&SqueakDBFake.bigFiles[s.fullname]?t(SqueakDBFake.bigFiles[s.fullname]):void this.dbTransaction("readonly","get "+e,function(e){e=e.get(s.fullname);e.onerror=function(e){i(e.target.error.name)},e.onsuccess=function(e){if(void 0!==this.result)return t(this.result);Squeak.fetchTemplateFile(s.fullname,function(e){t(e)},function(){if("undefined"==typeof indexedDB)return i("file not found: "+s.fullname);var e=Squeak.dbFake().get(s.fullname);e.onerror=function(e){i("file not found: "+s.fullname)},e.onsuccess=function(e){t(this.result)}})}})):i("Invalid path: "+e)},filePut:function(e,t,i){var r=this.splitFilePath(e);if(!r.basename)return null;var s=this.dirList(r.dirname);if(!s)return null;var n=s[r.basename],a=this.totalSeconds();if(n){if(n[3])return null}else n=[r.basename,a,0,!1,0],s[r.basename]=n;return Squeak.debugFiles&&(console.log("Writing "+r.fullname+" ("+t.byteLength+" bytes)"),0>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return null;case Squeak.FFITypeBool:if(e.isTrue)return!0;if(e.isFalse)return!1;if("number"==typeof e)return!!e;if(e.isFloat)return!!e.float;throw Error("FFI: expected bool, got "+e);case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:if("number"==typeof e)return e;throw Error("FFI: expected integer, got "+e);case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"==typeof e)return e;if(e.isFloat)return e.float;throw Error("FFI: expected float, got "+e);default:throw Error("FFI: unimplemented atomic arg type: "+i)}case Squeak.FFIFlagAtomicPointer:switch(i=(s&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeUnsignedChar8:if(e.bytes)return e.bytesAsString();if(e.words)return String.fromChar.apply(null,e.wordsAsUint8Array());if(this.interpreterProxy.isWordsOrBytes(e))return"";if(e.pointers&&e.pointers[0].jsData)if((r=e.pointers[0].jsData)instanceof"string")return r;throw Error("FFI: expected string, got "+e);case Squeak.FFITypeUnsignedInt8:if(e.bytes)return e.bytes;if(e.words)return e.wordsAsUint8Array();if(this.interpreterProxy.isWordsOrBytes(e))return new Uint8Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Uint8Array)return r;if(r instanceof ArrayBuffer)return new Uint8Array(r)}throw Error("FFI: expected bytes, got "+e);case Squeak.FFITypeUnsignedInt32:if(e.words)return e.words;if(this.interpreterProxy.isWords(e))return new Uint32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Uint32Array)return r;if(r instanceof ArrayBuffer)return new Uint32Array(r)}throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSignedInt32:if(e.words)return e.wordsAsInt32Array();if(this.interpreterProxy.isWords(e))return new Int32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Int32Array)return r;if(r instanceof ArrayBuffer)return new Int32Array(r)}throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSingleFloat:if(e.words)return e.wordsAsFloat32Array();if(e.isFloat)return new Float32Array([e.float]);if(this.interpreterProxy.isWords(e))return new Float32Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Float32Array)return r;if(r instanceof ArrayBuffer)return new Float32Array(r)}throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeDoubleFloat:if(e.words)return e.wordsAsFloat64Array();if(e.isFloat)return new Float64Array([e.float]);if(this.interpreterProxy.isWords(e))return new Float64Array(0);if(e.pointers&&e.pointers[0].jsData){if((r=e.pointers[0].jsData)instanceof Float64Array)return r;if(r instanceof ArrayBuffer)return new Float64Array(r)}throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeVoid:if(e.words)return e.words.buffer;if(e.bytes)return e.bytes.buffer;if(e.isNil||this.interpreterProxy.isWordsOrBytes(e))return new ArrayBuffer(0);if(e.pointers&&e.pointers[0].jsData)if((r=e.pointers[0].jsData)instanceof ArrayBuffer)return r;throw Error("FFI: expected words or bytes, got "+e);default:throw Error("FFI: unimplemented atomic array arg type: "+i)}default:throw Error("FFI: unimplemented arg type flags: "+s)}},ffiResultToSt:function(e,t){var i,r=t.pointers[0].words[0];switch(r&Squeak.FFIFlagMask){case Squeak.FFIFlagAtomic:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return this.vm.nilObj;case Squeak.FFITypeBool:return e?this.vm.trueObj:this.vm.falseObj;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"!=typeof e)throw Error("FFI: expected number, got "+e);return this.makeStObject(e);default:throw Error("FFI: unimplemented atomic return type: "+i)}case Squeak.FFIFlagAtomicPointer:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar8:return this.makeStString(e);default:return this.ffiMakeStExternalData(e,t)}default:throw Error("FFI: unimplemented return type flags: "+r)}},ffiNextExtAddr:0,ffiMakeStExternalAddress:function(){var e=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalAddress],4);return new Uint32Array(e.bytes.buffer)[0]=++this.ffiNextExtAddr,e},ffiMakeStExternalData:function(e,t){var i=this.ffiMakeStExternalAddress(),e=(i.jsData=e,this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalData],0));return e.pointers[0]=i,e.pointers[1]=t,e},ffiDataFromStack:function(e){e=this.stackNonInteger(e);return void 0!==e.jsData?e.jsData:e.bytes||e.words||(this.vm.warnOnce("FFI: expected ExternalAddress with jsData, got "+e),void(this.success=!1))},ffi_primitiveFFIAllocate:function(e){var t,i=this.stackInteger(0);return!!this.success&&((t=this.ffiMakeStExternalAddress()).jsData=new ArrayBuffer(i),this.popNandPushIfOK(e+1,t))},ffi_primitiveFFIFree:function(e){var t=this.stackNonInteger(0);return!!this.success&&(void 0===t.jsData?(this.vm.warnOnce("primitiveFFIFree: expected ExternalAddress with jsData, got "+t),!1):(delete t.jsData,!0))},primitiveCalloutToFFI:function(e,t){t=t.pointers[1];if(!this.isKindOf(t,Squeak.splOb_ClassExternalFunction))return!1;for(var i=[],r=e-1;0<=r;r--)i.push(this.vm.stackValue(r));return this.ffiDoCallout(e,t,i)},ffi_primitiveCalloutWithArgs:function(e){var t=this.stackNonInteger(1),i=this.stackNonInteger(0);return!!this.isKindOf(t,Squeak.splOb_ClassExternalFunction)&&this.ffiDoCallout(e,t,i.pointers)},ffi_primitiveFFIGetLastError:function(e){return this.popNandPushIfOK(e+1,this.ffi_lastError)},ffi_primitiveFFIIntegerAt:function(e){var t,i=this.ffiDataFromStack(3),r=this.stackInteger(2),s=this.stackInteger(1),n=this.stackBoolean(0);if(!this.success)return!1;if(r<0||s<1||8i.length||(i=i[t-1],!(t=this.fileOpen(i,!1)))||(i=this.makeFileHandle(i,t,!1),this.popNandPushIfOK(e+1,i),0))},primitiveDropRequestFileName:function(e){var t=this.stackInteger(0),i=this.display.droppedFiles||[];return!(t<1||t>i.length)&&(i=this.makeStString(this.filenameToSqueak(i[t-1])),this.popNandPushIfOK(e+1,i))}}),Object.extend(Squeak.Primitives.prototype,"FilePlugin",{primitiveDirectoryCreate:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.dirCreate(t),this.success||(t=Squeak.splitFilePath(t),Squeak.debugFiles&&console.warn("Directory not created: "+t.fullname)),this.popNIfOK(e))},primitiveDirectoryDelete:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.dirDelete(t),this.popNIfOK(e))},primitiveDirectoryDelimitor:function(e){var t=this.emulateMac?":":"/";return this.popNandPushIfOK(1,this.charFromInt(t.charCodeAt(0)))},primitiveDirectoryEntry:function(e){var t,i=this.stackNonInteger(1),r=this.stackNonInteger(0);return!!this.success&&(r=r.bytesAsString(),r=this.filenameFromSqueak(r),i=i.bytesAsString(),i=this.filenameFromSqueak(i),(t=Squeak.dirList(i,!0))?(t="."===r?[".",0,0,!0,0]:t[r],this.popNandPushIfOK(e+1,this.makeStObject(t)),!0):(r=Squeak.splitFilePath(i),Squeak.debugFiles&&console.log("Directory not found: "+r.fullname),!1))},primitiveDirectoryLookup:function(e){var t=this.stackInteger(0),i=this.stackNonInteger(1);if(!this.success)return!1;var i=i.bytesAsString(),r=this.filenameFromSqueak(i),s=Squeak.dirList(r,!0);if(!s)return n=Squeak.splitFilePath(r),Squeak.debugFiles&&console.log("Directory not found: "+n.fullname),!1;Squeak.debugFiles&&1===t&&console.log("Reading directory "+r+" with "+Object.keys(s).length+" entries");var n=s[Object.keys(s).sort()[t-1]];return"/"===i&&(1===t?((n=n||[0,0,0,0,0])[0]="SqueakJS",n[3]=!0):n=null),this.popNandPushIfOK(e+1,this.makeStObject(n)),!0},primitiveDirectorySetMacTypeAndCreator:function(e){return this.popNIfOK(e)},primitiveFileAtEnd:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeStObject(t.filePos>=t.file.size)),0))},primitiveFileClose:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(this.fileClose(t.file),this.vm.breakOut(),t.file=null),this.popNIfOK(e))},primitiveFileDelete:function(e){var t=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),this.success=Squeak.fileDelete(t),this.popNIfOK(e))},primitiveFileFlush:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(Squeak.flushFile(t.file),this.vm.breakOut()),this.popNIfOK(e))},primitiveFileGetPosition:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.filePos)),0))},makeFileHandle:function(e,t,i){e=this.makeStString("squeakjs:"+e);return e.file=t,e.fileWrite=i,e.filePos=0,e},primitiveFileOpen:function(e){var t=this.stackBoolean(0),i=this.stackNonInteger(1);return!!this.success&&(i=this.filenameFromSqueak(i.bytesAsString()),!!(i=this.fileOpen(i,t)))&&(i=this.makeFileHandle(i.name,i,t),this.popNandPushIfOK(e+1,i),!0)},primitiveFileRead:function(s){var n,a=this.stackInteger(0),o=this.stackInteger(1)-1,u=this.stackNonInteger(2),l=this.stackNonInteger(3);return!!(this.success&&u.isWordsOrBytes()&&l.file)&&(a?((n=u.bytes)||(n=u.wordsAsUint8Array(),o*=4,a*=4),!(o<0||o+a>n.length)&&("string"==typeof l.file?(this.popNandPushIfOK(s+1,0),!0):this.fileContentsDo(l.file,function(e){if(!e.contents)return this.popNandPushIfOK(s+1,0);var t=e.contents,i=n;a=Math.min(a,e.size-l.filePos);for(var r=0;r>=2),this.popNandPushIfOK(s+1,Math.max(0,a))}.bind(this)))):this.popNandPushIfOK(s+1,0))},primitiveFileRename:function(e){var t=this.stackNonInteger(1),i=this.stackNonInteger(0);return!!this.success&&(t=this.filenameFromSqueak(t.bytesAsString()),i=this.filenameFromSqueak(i.bytesAsString()),this.success=Squeak.fileRename(t,i),this.vm.breakOut(),this.popNIfOK(e))},primitiveFileSetPosition:function(e){var t=this.stackPos32BitInt(0),i=this.stackNonInteger(1);return!(!this.success||!i.file)&&(i.filePos=t,this.popNIfOK(e))},primitiveFileSize:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file||(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.file.size)),0))},primitiveFileStdioHandles:function(e){var t=[null,this.makeFileHandle("console.log","log",!0),this.makeFileHandle("console.error","error",!0)];return this.popNandPushIfOK(e+1,this.makeStArray(t)),!0},primitiveFileTruncate:function(e){var t=this.stackPos32BitInt(0),i=this.stackNonInteger(1);return!!(this.success&&i.file&&i.fileWrite)&&(i.file.size>t&&(i.file.size=t,i.file.modified=!0,i.filePos>i.file.size)&&(i.filePos=i.file.size),this.popNIfOK(e))},primitiveDisableFileAccess:function(e){return this.fakePrimitive("FilePlugin.primitiveDisableFileAccess",0,e)},primitiveFileWrite:function(n){var a,o=this.stackInteger(0),u=this.stackInteger(1)-1,e=this.stackNonInteger(2),l=this.stackNonInteger(3);return!!(this.success&&l.file&&l.fileWrite)&&(o?((a=e.bytes)||(a=e.wordsAsUint8Array(),u*=4,o*=4),!!a&&!(u<0||u+o>a.length)&&("string"==typeof l.file?(this.fileConsoleWrite(l.file,a,u,o),this.popNandPushIfOK(n+1,o),!0):this.fileContentsDo(l.file,function(e){var t,i=a,r=e.contents||[];l.filePos+o>r.length&&(t=0===r.length?l.filePos+o:Math.max(l.filePos+o,r.length+1e4),e.contents=new Uint8Array(t),e.contents.set(r),r=e.contents);for(var s=0;se.size&&(e.size=l.filePos),e.modified=!0,this.popNandPushIfOK(n+1,o)}.bind(this)))):this.popNandPushIfOK(n+1,0))},fileOpen:function(e,t){"undefined"==typeof SqueakFiles&&(window.SqueakFiles={});e=Squeak.splitFilePath(e);if(!e.basename)return null;var i=Squeak.dirList(e.dirname,!0);if(!i)return null;var i=i[e.basename],r=null;if(i){if(s=SqueakFiles[e.fullname])return++s.refCount,s}else{if(!t)return Squeak.debugFiles&&console.log("File not found: "+e.fullname),null;if(r=new Uint8Array,!(i=Squeak.filePut(e.fullname,r.buffer)))return Squeak.debugFiles&&console.log("Cannot create file: "+e.fullname),null}var s={name:e.fullname,size:i[4],contents:r,modified:!1,refCount:1};return SqueakFiles[s.name]=s},fileClose:function(e){Squeak.flushFile(e),0==--e.refCount&&delete SqueakFiles[e.name]},fileContentsDo:function(r,s){if(r.contents)s(r);else{if(!1===r.contents)return!1;this.vm.freeze(function(t){var i=function(e){console.warn("File get failed: "+e),r.contents=!1,t(),s(r)}.bind(this),e=function(e){if(null==e)return i(r.name);r.contents=this.asUint8Array(e),t(),s(r)}.bind(this);Squeak.fileGet(r.name,e,i)}.bind(this))}return!0},fileConsoleBuffer:{log:"",error:""},fileConsoleWrite:function(e,t,i,r){t=t.subarray(i,i+r),i=this.fileConsoleBuffer[e]+Squeak.bytesAsString(t),r=i.match("([^]*)\n(.*)");r&&(console[e](r[1]),i=r[2]),this.fileConsoleBuffer[e]=i},fileConsoleFlush:function(e){var t=this.fileConsoleBuffer[e];t&&(console[e](t),this.fileConsoleBuffer[e]="")}}),Object.extend(Squeak.Primitives.prototype,"JPEGReadWriter2Plugin",{jpeg2_primJPEGPluginIsPresent:function(e){return this.popNandPushIfOK(e+1,this.vm.trueObj)},jpeg2_primImageHeight:function(e){var t=this.stackNonInteger(0).wordsOrBytes();return!!t&&(t=t[1],this.popNandPushIfOK(e+1,t))},jpeg2_primImageWidth:function(e){var t=this.stackNonInteger(0).wordsOrBytes();return!!t&&(t=t[0],this.popNandPushIfOK(e+1,t))},jpeg2_primJPEGCompressStructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGDecompressStructSize:function(e){return this.popNandPushIfOK(e+1,8)},jpeg2_primJPEGErrorMgr2StructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGReadHeaderfromByteArrayerrorMgr:function(e){var t,i=this.stackNonInteger(2).wordsOrBytes(),r=this.stackNonInteger(1).bytes;return!(!i||!r)&&(t=this.vm.freeze(),this.jpeg2_readImageFromBytes(r,function(e){this.jpeg2state={src:r,img:e},i[0]=e.width,i[1]=e.height,t()}.bind(this),function(){i[0]=0,i[1]=0,t()}.bind(this)),this.popNIfOK(e))},jpeg2_primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgr:function(e){var t=this.stackNonInteger(3).bytes,i=this.stackNonInteger(2).pointers,r=this.stackBoolean(1);if(!this.success||!t||!i)return!1;var s=this.jpeg2state;if(!s||s.src!==t)return console.error("jpeg read did not match header info"),!1;t=i[Squeak.Form_depth],s=this.jpeg2_getPixelsFromImage(s.img),i=i[Squeak.Form_bits].words;if(32===t)this.jpeg2_copyPixelsToForm32(s,i);else{if(16!==t)return!1;r?this.jpeg2_ditherPixelsToForm16(s,i):this.jpeg2_copyPixelsToForm16(s,i)}return this.popNIfOK(e)},jpeg2_primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgr:function(e){var t,i,r,s,n,a;return!(e<6||(t=this.stackNonInteger(4).bytes,n=this.stackNonInteger(3).pointers,i=this.stackInteger(2),!(this.success&&t&&n)))&&(r=n[Squeak.Form_width],s=n[Squeak.Form_height],a=n[Squeak.Form_depth],n=n[Squeak.Form_bits].words,32!==a?(this.vm.warnOnce("JPEG2WriteImage: only 32 bit depth supported"),!1):(a=this.jpeg2_writeFormToBytes(n,r,s,i,t),this.popNandPushIfOK(e+1,a)))},jpeg2_writeFormToBytes:function(e,t,i,r,s){for(var n=document.createElement("canvas"),a=n.getContext("2d"),t=(n.width=t,n.height=i,a.createImageData(t,i)),o=t.data,u=0;u>16&255,o[4*u+1]=l>>8&255,o[4*u+2]=255&l,o[4*u+3]=255}a.putImageData(t,0,0);i=n.toDataURL("image/jpeg",r/100);return this.jpeg2_dataURLToBytes(i,s)},jpeg2_dataURLToBytes:function(e,t){e=e.split(",")[1];if(!e)return 0;if(3*e.length/4-3>t.length)return 0;var i=atob(e);if(i.length>t.length)return 0;for(var r=0;r>3<<10|s[4*o+1]>>3<<5|s[4*o+2]>>3;0==(65535&(u=(u=0===u?1:u)<<16|s[4*o+4]>>3<<10|s[4*o+5]>>3<<5|s[4*o+6]>>3))&&(u|=1),t[o>>1]=u}},jpeg2_ditherPixelsToForm16:function(e,t){for(var i=e.width>>1,r=e.height,s=e.data,n=[2,0,14,12,1,3,13,15],a=[10,8,6,4,9,11,5,7],o=0;o>8,b=15&k,y=k>>4,c=g>8)>>4,h=g<(15&k)?1+y:y,y=(k=496*f>>8)>>4,f=g<(15&k)?1+y:y,y=(k=496*p>>8)>>4,p=v<(15&k)?1+y:y,y=(k=496*d>>8)>>4,d=v<(15&k)?1+y:y,y=(k=496*m>>8)>>4;b=c<<10|h<<5|f;0==(65535&(b=(b=0===b?1:b)<<16|p<<10|d<<5|(m=v<(15&k)?1+y:y)))&&(b|=1),t[l>>3]=b}}}),Object.extend(Squeak.Primitives.prototype,"ScratchPluginAdditions",{scratch_primitiveOpenURL:function(e){var t,i,r=this.stackNonInteger(0).bytesAsString();return""!=r&&(/^\/SqueakJS\//.test(r)&&(r=r.slice(10),t=Squeak.splitFilePath(r),i=Squeak.Settings["squeak-template:"+t.dirname])&&(r=JSON.parse(i).url+"/"+t.basename),window.open(r,"_blank"),this.popNIfOK(e))},scratch_primitiveGetFolderPath:function(e){var t,i=this.stackInteger(0);return!!this.success&&!!(t=1===i?"/":t)&&(this.vm.popNandPush(e+1,this.makeStString(this.filenameToSqueak(t))),!0)}}),Object.extend(Squeak.Primitives.prototype,"SoundPlugin",{snd_primitiveSoundStart:function(e){return this.snd_primitiveSoundStartWithSemaphore(e)},snd_primitiveSoundStartWithSemaphore:function(e){var t=this.stackInteger(e-1),i=this.stackInteger(e-2),r=this.stackBoolean(e-3),s=3>>t}var w=0,A=0,C=0,P=null,_=null,e="ADPCMCodecPlugin 3 November 2014 (e)",x=null;function r(){return e}function V(e){for(var t,i=0,r=e;;){if(!(0<(t=r-w)))return i+=o(C,0-t),C&=o(255,8-(w-=r)),i;i+=a(C,t),r-=w,C=P[++A-1],w=8}}function k(e,t){for(var i,r,s=t,n=e;;){if(!((r=(i=8-w)-n)<0))return C+=a(s,r),w+=n,self;C+=o(s,0-r),P[++A-1]=C,s&=a(1,(C=w=0)-r)-1,n-=i}}function s(){var e,t,i,r,s,n,a,o,u,l=_.stackValue(1),c=_.stackIntegerValue(0),h=_.fetchIntegerofObject(0,l),f=_.fetchIntegerofObject(1,l),p=_.fetchIntegerofObject(2,l),d=_.fetchIntegerofObject(3,l),m=_.fetchIntegerofObject(4,l),v=_.fetchIntegerofObject(5,l);if(C=_.fetchIntegerofObject(6,l),w=_.fetchIntegerofObject(7,l),A=_.fetchIntegerofObject(8,l),P=_.fetchBytesofObject(9,l),u=_.fetchInt16ArrayofObject(10,l),o=_.fetchIntegerofObject(12,l),n=_.fetchIntegerofObject(13,l),x=_.fetchInt16ArrayofObject(14,l),a=_.fetchInt16ArrayofObject(15,l),_.failed())return null;for(i=1;i<=c;i++){if(1==(i&v))32767<(h=V(16))&&(h-=65536),f=V(6);else{for(t=V(n),s=x[f],r=0,e=m;0>>=1,e>>>=1;r+=s,0<(t&p)?h-=r:h+=r,32767>>=1,h>>>=1,e>>>=1;a+=c,o+=h,0<(t&S)?u-=a:u+=a,0<(i&S)?l-=o:l+=o,32767=s&&(i=r);return i}(p,c[l]):d);else{for((i=c[++l-1]-p)<(n=0)&&(n=m,i=0-i),s=t=0,e=v;0>>=1,e>>>=1;s+=a,0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ADPCMCodecPlugin",{primitiveDecodeStereo:n,primitiveEncodeStereo:l,setInterpreter:c,primitiveEncodeMono:u,primitiveDecodeMono:s,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function q(e){return"number"==typeof e?k.classSmallInteger():e.sqClass}function f(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function B(e,t){return 0|Math.floor(e/t)}function R(e,t){return 31>>t}function o(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function e(e,t){return new Float32Array(e.buffer,e.byteOffset+4*t)}var r=12,M=2,N=3,T=1,E=0,L=6,G=0,X=4,Z=1,J=2,Y=3,Q=6,$=0,ee=2,te=1,ie=3,re=16,se=11,ne=13,ae=10,oe=18,ue=15,le=21,ce=16,he=4,fe=5,pe=2,de=3,me=10,ve=0,ge=1,ke=18,be=19,ye=20,Se=16,Fe=28,Oe=22,Ie=17,we=10,Ae=4,Ce=65536,Pe=100,_e=121,xe=122,Ve=114,je=112,qe=101,Be=102,u=104,Me=103,Ne=120,Te=119,Ee=113,Le=123,Re=115,De=108,We=105,ze=106,Ue=110,Ke=107,He=109,Ge=111,Xe=118,Ze=117,Je=116,Ye=8,Qe=9,$e=7,et=2,tt=1,it=0,rt=6,st=2,nt=255,at=256,ot=65280,ut=4,lt=65535,ct=1,ht=7,ft=5,pt=254,dt=1,mt=5,vt=8,gt=3,l=0,kt=6,bt=7,yt=2,St=4,Ft=4,Ot=5,It=6,wt=6,At=2,Ct=5,Pt=4,_t=3,xt=1,Vt=6,jt=7,qt=8,Bt=9,Mt=4,Nt=5,Tt=10,Et=12,Lt=16,Rt=14,Dt=15,Wt=13,zt=15,Ut=14,Kt=18,Ht=19,Gt=20,Xt=16,Zt=21,Jt=17,Yt=10,Qt=12,$t=51,ei=50,ti=53,ii=48,ri=52,si=49,ni=13,ai=14,oi=109,ui=111,li=108,ci=110,hi=10,fi=69,pi=43,di=45,mi=42,vi=44,gi=24,ki=97,bi=107,yi=103,Si=93,Fi=91,Oi=101,Ii=105,wi=99,Ai=95,Ci=88,Pi=113,_i=46,xi=47,Vi=37,ji=39,qi=36,Bi=38,Mi=11,Ni=12,Ti=17,Ei=16,Li=128,Ri=66,Di=67,Wi=68,zi=0,Ui=1097753705,Ki=256,Hi=63,Gi=8,Xi=9,Zi=80,Ji=82,Yi=84,Qi=86,$i=1,er=34,tr=35,ir=33,rr=32,sr=2,nr=64,ar=96,or=106,ur=102,lr=92,cr=90,hr=100,fr=104,pr=98,dr=94,p=3,d=5,n=null,mr="BitBltPlugin",vr=null,gr=0,kr=0,m=0,br=0,S=0,yr=0,v=0,g=null,k=null,Sr=null,Fr="B2DPlugin 14 November 2014 (e)",Or=null,b=0,W=null,c=null;function z(){return c[$t]}function Ir(e){c[$t]=e}function wr(){return c[ei]}function Ar(e,t){e=e+U()-1&~(U()-1);return t>>5&31)<<3,t=(s>>>10&31)<<3,s=(r+=r>>>5)+((i+=i>>>5)<<8)+((t+=t>>>5)<<16)+(255<<24)):s=0===h(e,ue)?0:Bs(e)[s]),bu(s)}function rs(e){return h(e,ae)}function ss(e){return Ou(s()-e+4)}function ns(e,t){Iu(s()-e+4,t)}function as(e){return Ou(s()-e+5)}function os(e,t){Iu(s()-e+5,t)}function us(e){return Ou(s()-e+0)}function ls(e,t){Iu(s()-e+0,t)}function cs(e){return Ou(s()-e+1)}function hs(e,t){Iu(s()-e+1,t)}function fs(e){return Ou(s()-e+2)}function ps(e,t){Iu(s()-e+2,t)}function ds(e){return Ou(s()-e+3)}function ms(e,t){Iu(s()-e+3,t)}function vs(e,t,i){for(var r,s,n=f(e),a=e.wordsAsInt32Array(),o=0,u=0;u<=n-1;u++){if(r=_o(u,a),!(0<=(s=xo(u,a))&&s<=t))return;o+=r}return o===i}function gs(e,t,i,r,s,n,a){if((e=e,o=t,k.isWords(e)&&((e=f(e))===3*o||e===6*o))&&(function(e){var t,i,r;if(k.isWords(e)){for(r=f(e),t=e.wordsAsInt32Array(),i=0;i<=r-1;i++)if(!Kn(t[i]))return;return 1}}(a)&&vs(i,e=f(a),t)&&vs(r,e,t)&&vs(n,e,t))){for(var o=s,i=t,u=f(o),l=o.wordsAsInt32Array(),c=0,h=0;h<=u-1;h++)c+=_o(h,l);return!!(c===i)}}function ks(e){var t,i;return(Ca(e)&pt)===ut?(t=Hn(i=e)?Nu(i):0,Yn(i)+t=cn()&&Jn(i)-t>=cn()?0:void jr(i)):(Ca(e)&pt)===rt?(i=Hn(t=e)?_u(t):0,Gr(t)+i=cn()&&Kr(t)-i>=cn()?0:void jr(t)):void jr(e)}function bs(){return[1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0,.1950903220161282,.38268343236509,.555570233019602,.707106781186547,.831469612302545,.9238795325112865,.98078528040323,1]}function ys(){return[0,.1950903220161282,.3826834323650897,.555570233019602,.707106781186547,.831469612302545,.923879532511287,.98078528040323,1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0]}function Ss(e,t){return e<0?0:t<=e?t-1:e}function Fs(){var e=D(To(),K()),t=D(Bo(),K())+1;for(e<0&&(e=0),t>No()&&(t=No());e>1,u=a+=(i=as(e))-f>>1,o+=(r+=h-l>>1)-n>>1,u+=(s+=f-c>>1)-a>>1,ps(e,r),ms(e,s),ns(e,o),os(e,u),ls(p,o),hs(p,u),ps(p,n),ms(p,a),ns(p,t),os(p,i),p)}function Ts(e,t){var i,r=Yr(e)[ve]>>8,s=xu(e)[ve]>>8;snt)return;return 0!=(Ca(e)&nt)}(e)||$s(e)>=hn()||ks(e),e+=h(e,tt)}function H(){return c[Ci]}function Ls(e){c[Ci]=e}function Rs(){return c[Pi]}function Ds(e){c[Pi]=e}function Ws(){return c[_i]}function zs(){return c[xi]}function Us(e){var t,i=D(To(),K());i<_s()&&(i=_s()),(t=D(Bo()+U()-1,K()))>ws()&&(t=ws()),(e=D(e,K()))=Cs()||t<_s()||i>=ws()||(i=i,t=t,e=e,(vr||Rn())&&vr(i,t,e))}function Ks(e){Pa(e,Ca(e)|Ce)}function Hs(e){Pa(e,Ca(e)&~Ce)}function Gs(e,t){I(e,Ye,t)}function Xs(e){return h(e,$e)}function Zs(e,t){return I(e,$e,t)}function Js(e,t){I(e,Qe,t)}function Ys(){return e(c,18)}function y(e){return h(e,Ft)}function Qs(e,t){I(e,Ft,t)}function $s(e){return h(e,Ot)}function en(e,t){I(e,Ot,t)}function tn(e){return h(e,It)}function rn(e,t){I(e,It,t)}function sn(e,t){for(var i=uu(),r=e,s=mu();s>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,P=S>>16,w||(C=Ss(C,m),P=Ss(P,d)),0<=C&&0<=P&&C>16,h=n>>16,o||(c=Ss(c,i),h=Ss(h,t)),0<=c&&0<=h&&c>16)<0||s<=r)&&n>16)>16,h=Ar(g=s,n),p=Cr(0,n),u=z(),l=wr();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,++g,c+=r;d=c>>16}u=4042322160|D(z(),K()),l=K();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,g+=a,c+=R(r,l);d=c>>16}u=z(),l=wr();for(;g>16===d;)f=D(g,o),W[f]=W[f]+v,++g,c+=r;d=c>>16}return g}(o,i,e,t,n,l);n>16,r>>16)>=n&&u>16,l>>16),h=t[c],f=(c-1)*(c-1),p=n,d=a;for(d>vn(e)&&(d=vn(e));p>16,l>>16)>=f;)W[p]=h,++p,u+=r,l+=s;for(o=_(u>>16,l>>16);o>16,p>>16),g=(v-1)*(v-1),k=n,b=vn(e),y=Ar(n,b=a>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,++k,f+=r,p+=s;for(c=_(f>>16,p>>16);c>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,k+=d,f+=R(r,u),p+=R(s,u);for(c=_(f>>16,p>>16);c>16,p>>16)>=g;)l=D(k,m),W[l]=W[l]+h,++k,f+=r,p+=s;for(c=_(f>>16,p>>16);c>16,u>>16),p=t[f],e=qn(e),c=(e-1)*(e-1),h=(f+1)*(f+1),l=_(o>>16,u>>16),d=n,m=a;for(;d>16,u>>16)<=h;)W[d]=p,++d,o+=r,u+=s;for(l=_(o>>16,u>>16);h>16,f>>16),e=qn(e),g=(e-1)*(e-1),k=(b+1)*(b+1),m=_(h>>16,f>>16),p=Ar(S=n,a),v=Cr(0,a),S>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,++S,h+=r,f+=s;for(m=_(h>>16,f>>16);k>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,S+=o,h+=R(r,c),f+=R(s,c);for(m=_(h>>16,f>>16);k>16,f>>16)<=k;)d=D(S,u),W[d]=W[d]+y,++S,h+=r,f+=s;for(m=_(h>>16,f>>16);k>>0>>0}function yn(e,t,i){if(0!==e){var t=tR(No(),K())?R(No(),K()):i;if(tcn()&&(i=cn()),tBo()&&Mo(i),i>jo()&&qo(i),!(i<=t))if(Un(e))an(e,t,i);else{if(c[Ri]=e,t=t,c[Di]=t,t=i,c[Wi]=t,(i=(Ca(e)&ot)>>>8)<=1)return!0;switch(i){case 0:case 1:break;case 2:ln();break;case 3:kn();break;case 4:case 5:nn()}}}return!1}function Sn(){for(var e,t,i=H();_n()i)return!1;if(((t=Ca(e))&pt)===st)return!0;if(!ka(1))return!1;switch(t){case 0:case 1:case 2:case 3:break;case 4:Go(g[_n()],H());break;case 5:a=f=h=l=u=c=r=n=s=void 0;var r,s=g[_n()],n=H();if(u=Nu(s),c=u>>1,h=y(s),f=$s(s),Go(s,f),l=Xs(s),a=$n(s),Qs(s,h-c),Zs(s,l+u),0>1,a=Kr(p),h=$s(p),Ho(p,h),c=Xs(p),o=0;o<=5;o++)xu(p)[o]=Yr(p)[o];if(0===(f=Yr(p)[pe])&&Yr(p)[he],((f=0<=f?1:-1)<0?function(e,t,i,r){var s;Yr(e)[ve]=Yr(e)[ve]-256*i,s=xu(e)[ve],xu(e)[ve]=s+256*(t-i),s=xu(e)[ge],xu(e)[ge]=s+256*t,Jr(e,r-i)}:function(e,t,i,r){var s;Yr(e)[ve]=Yr(e)[ve]+256*i,s=xu(e)[ve],xu(e)[ve]=s-256*(t-i),s=xu(e)[ge],xu(e)[ge]=s+256*t,Jr(e,r-i+t)})(p,l,u,a),0===c&&(Yr(p)[ve]=256*Zr(p)),Zs(p,c+l),f=0-c-u,Cu(p,0),Pu(p,f),(u<=0&&f<0?Hs:Ks)(p),Ts(p,l),h!==d){for(o=h;o<=d-1;o++)Yo(p,o);Zs(p,Xs(p)-(d-h))}}Wn(e),xn(_n()+1)}return!1}function Fn(){var e,t,i;for(t=cn();a()=cn())return!1;if(Oo(i),Hn(e)&&!function(e){var t,i,r,s;switch(s=function(e){return Ca(e)>>>1}(e),kr=e,s){case 0:case 1:break;case 2:gr=Tu(kr);break;case 3:gr=function(e){return h(e,Ie)}(kr)}switch(r=gr,s){case 0:case 1:break;case 2:gr=function(e){return h(e,Xt)}(kr);break;case 3:gr=function(e){return h(e,Se)}(kr)}if(0===(s=gr))return;if(!ka(3))return;t=1+(tn(e)<<1),r=y(e)+r,-1===(i=In(s,t))?Vo(s,t,r):Do(i)=fn()&&sn(i,t)}return t=s()?-1:i}function wn(){return Ko()===vt}function An(){Au(wu()+3)}function Cn(){return Fr}function Pn(e,t){var i;return e===t||(i=0==(i=$s(e)-$s(t))?y(e)-y(t):i)<0}function _n(){return c[Mi]}function xn(e){c[Mi]=e}function Vn(){return c[Ni]}function jn(e){c[Ni]=e}function qn(e){return h(e,Tt)}function Bn(e){return o(Or,e+Et)}function Mn(){return 0!==c[Ti]}function Nn(e){c[Ti]=e}function Tn(){return 0!==c[Ei]}function En(e){c[Ei]=e}function Ln(e,t){var i,r=In(e,t);if(-1===r)return!1;if(0===r)An();else if(Uo(r,Ou(0)),Ro(r,Lo(0)),Wo(r,Do(0)),An(),!(s()<=3)){for(i=0,r=3;rNo()&&As(No()),e=R(_s(),K()),c[qi]=e,e=R(Vs(),K()),c[Bi]=e,e=R(ws(),K()),c[Vi]=e,e=R(Cs(),K()),c[ji]=e,jn(0),Mr(0),g=o(Or,b),n=o(Or,b),Es(),S||(0===Vn()?Ls(hn()):(function e(t,i,r){var s;var n;var a;var o;var u;var l;var c;var h;var f;var p;if((h=r+1-i)<=1)return 0;a=t[i];u=t[r];n=Pn(a,u);n||(f=t[i],t[i]=t[r],t[r]=f,p=a,a=u,u=p);if(h<=2)return 0;p=i+r>>1;o=t[p];n=Pn(a,o);n?(n=Pn(o,u))||(f=t[r],t[r]=t[p],t[p]=f,o=u):(f=t[i],t[i]=t[p],t[p]=f,o=a);if(h<=3)return 0;l=i;c=r;s=!0;for(;s;){for(n=!0;n;)n=l<=--c&&(f=t[c],Pn(o,f));for(n=!0;n;)n=++l<=c&&Pn(f=t[l],o);(s=l<=c)&&(f=t[l],t[l]=t[c],t[c]=f)}e(t,i,c);e(t,l,r)}(g,0,Vn()-1),Ls($s(g[0])),H()f(yr)||(t=k.fetchPointerofObject(t,yr),f(t=k.fetchPointerofObject(0,t))!==h(e,ne))?null:t.wordsAsInt32Array()}function na(e,t,i,r,s,n,a){var o,u,l,c,h;if(r!==s||0!==n&&0!==a){if(e=6*e,i=i?(o=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[0+e],c=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[1+e],u=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[2+e],h=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[3+e],l=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[4+e],(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[5+e]):(o=0|t[0+e],c=0|t[1+e],u=0|t[2+e],h=0|t[3+e],l=0|t[4+e],0|t[5+e]),o===u&&c===h||u===l&&h===i)return o===l&&c===i?void 0:(w()[0]=o,w()[1]=c,A()[0]=l,A()[1]=i,gu(2),ma(n,w(),A(),a,r,s));w()[0]=o,w()[1]=c,A()[0]=u,A()[1]=h,C()[0]=l,C()[1]=i,gu(3),t=ta(w(),A(),C(),0!==n&&0!==a),S||da(n,a,r,s,t)}}function aa(e){var t=c[65];return f(e)>1,d=A()[1]-w()[1]>>1,m=A()[0]+w()[0]>>1,v=A()[1]+w()[1]>>1,g=0;g<=15;g++){if(n=p,a=d,o=m,u=v,f=h=c=l=void 0,l=bs()[2*(s=g)+0]*n+o|0,h=ys()[2*s+0]*a+u|0,w()[0]=l,w()[1]=h,c=bs()[2*s+2]*n+o|0,f=ys()[2*s+2]*a+u|0,C()[0]=c,C()[1]=f,n=bs()[2*s+1]*n+o|0,o=ys()[2*s+1]*a+u|0,n=2*n-(l+c>>1),o=2*o-(h+f>>1),A()[0]=n,A()[1]=o,gu(3),s=ta(w(),A(),C(),0!==e&&0!==t),S)return;if(da(e,t,i,r,s),S)return}}function O(e,t){var i;return q(t)===k.classPoint()&&("number"==typeof(i=k.fetchPointerofObject(0,t))||i.isFloat)&&(e[0]="number"==typeof i?i:0|k.floatValueOf(i),"number"==typeof(i=k.fetchPointerofObject(1,t))||i.isFloat)?void(e[1]="number"==typeof i?i:0|k.floatValueOf(i)):k.primitiveFail()}function ha(){var e,t,i;return 2!==k.methodArgumentCount()?d:0!==(i=Fo(k.stackValue(2)))?i:(t=k.stackObjectValue(0),e=k.stackObjectValue(1),k.failed()?p:0!==(i=fa(k.fetchPointerofObject(T,br)))?i:ia(k.fetchPointerofObject(M,br))?ua(k.fetchPointerofObject(N,br))?f(e)>1),d=6*s;0=cs(u)?(Qs(o,us(u)),en(o,cs(u)-h),Qr(o,fs(u)),$r(o,ds(u)-h),Hr(o,ss(u)),Xr(o,as(u)-h)):(Qs(o,ss(u)),en(o,as(u)-h),Qr(o,fs(u)),$r(o,ds(u)-h),Hr(o,us(u)),Xr(o,cs(u)-h)),rn(o,Rs()),Gs(o,l),Js(o,c),a&&(I(n,Se,t),Vu(n,e),I(n,ye,e)),d-=6}Su()}function ma(e,t,i,r,s,n){var a,o=0===e||0===r?(a=Dr(Lt)?(b=(a=b)+Lt,Pa(a,ut),wa(a,0),Aa(a,Lt),a):0,0):(a=Dr(Zt)?(b=(o=b)+Zt,Pa(o,ft),wa(o,0),Aa(o,Zt),o):0,e>>1);if(S)return 0;la(a,t,i,o,s,n),Hn(a)&&(I(a,Xt,r),Eu(a,e),I(a,Gt,e))}function va(e){return"number"==typeof e?We:k.isWords(e)?f(e)yu()?Ge:0)):ze}function ga(e){0===strcmp(e,mr)&&(vr=Sr=0)}function ka(e){return!(Li+b+Vn()+Br()+e>wu()&&($o(xt),1))}function ba(){return 0!==c[Hi]}function ya(e){c[Hi]=e}function h(e,t){return Or[e+t]}function I(e,t,i){return Or[e+t]=i}function Sa(){return c[Gi]}function Fa(){return c[Xi]}function Oa(e){c[Xi]=e}function Ia(e){return h(e,et)}function wa(e,t){I(e,et,t)}function Aa(e,t){I(e,tt,t)}function Ca(e){return h(e,it)<}function Pa(e,t){return I(e,it,t)}function w(){return o(c,Zi)}function A(){return o(c,Ji)}function C(){return o(c,Yi)}function _a(){return o(c,Qi)}function xa(){_n()>=Vn()&&0===Br()&&x(vt),H()>=hn()&&x(vt)}function Va(){var e;return 0!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(0)))?k.primitiveFailFor(e):(x(vt),void V())}function ja(){var e;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),yt))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=aa(e))?ka(1)?(0Bo()&&Mo(c),c>jo()&&qo(c),x(gt),V(),k.pop(2),m&&(F(Oi,1),F(hr,k.ioMicroMSecs()-v))}function so(){var e;return 0!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(0)))?k.primitiveFailFor(e):(e=ba(),V(),k.pop(1),void k.pushBool(e))}function no(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=Fo(k.stackValue(1)))?k.primitiveFailFor(e):(e=k.booleanValueOf(k.stackValue(0)),k.failed()?k.primitiveFailFor(p):(ya(!0===e?1:0),V(),void k.pop(1)))}function ao(){var e,t,i;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=k.stackValue(1),t=kt,i=vt,t=0===(e=Fo(e))?Ko()!==t&&Ko()!==i?(tu(At),Je):0:e)?k.primitiveFailFor(t):(i=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=!1,Ko()!==vt&&((e=On())?(iu(n[a()],i),x(bt)):x(dt)),k.failed()?null:(V(),k.pop(2),k.pushBool(!e),void(m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v))))))}function oo(){var e,t;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),gt))||0!==(e=fa(k.fetchPointerofObject(T,br)))?k.primitiveFailFor(e):ua(k.fetchPointerofObject(N,br))?(0!==Os()&&(0==(H()&Pr())&&Fs(),Is(0)),e=k.stackObjectValue(0),t=Fn(),S?k.primitiveFailFor(u):(t&&ru(e),k.failed()?k.primitiveFailFor(Ze):(t?x(St):(Su(),qo(0),x(mt)),V(),k.pop(2),k.pushBool(!t),void(m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)))))):k.primitiveFailFor(Le)}function uo(){var e,t;return m&&(v=k.ioMicroMSecs()),1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),dt))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),(t=Sn())&&(iu(g[_n()],e),xn(_n()+1)),k.failed()?k.primitiveFailFor(Xe):(t?x(yt):(x(gt),Is(1),qr(0),Su()),V(),k.pop(2),k.pushBool(!t),void(m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)))))}function lo(){var e,t,i,r,s,n,a;return 6!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(a=P(k.stackValue(6),l))?k.primitiveFailFor(a):(a=k.positive32BitValueOf(k.stackValue(0)),n=k.positive32BitValueOf(k.stackValue(1)),s=k.stackIntegerValue(2),r=k.stackIntegerValue(3),i=k.stackIntegerValue(4),t=k.stackIntegerValue(5),k.failed()?k.primitiveFailFor(p):Dr(we)?Kn(n)&&Kn(a)?(b=(e=b)+we,Pa(e,st),Aa(e,we),wa(e,t),Qs(e,i),en(e,r),rn(e,s),Gs(e,j(n)),Js(e,j(a)),S?k.primitiveFailFor(u):void(k.failed()||(V(),k.pop(6)))):k.primitiveFailFor(Ze):k.primitiveFailFor(Ge))}function co(){var e,t,i;if(1!==k.methodArgumentCount())return k.primitiveFailFor(d);if(0!==(e=P(k.stackValue(1),l)))return k.primitiveFailFor(e);if(i=k.stackIntegerValue(0),k.failed())return k.primitiveFailFor(p);for(t=0;0===t;){if(!Dr(we))return k.primitiveFailFor(Ge);b=(t=b)+Ae,Pa(t,at),Aa(t,Ae),wa(t,i)}k.failed()||(V(),k.pop(2),k.pushInteger(t))}function ho(){var e;return 0!==(e=ha())?k.primitiveFailFor(e):(So(),S?su():(function(){var e;for(;!wn();){if(m&&(v=k.ioMicroMSecs()),e=Sn(),m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)),S)return x(dt);if(e)return x(yt),$o(Pt);if(qr(0),Su(),Is(1),m&&(v=k.ioMicroMSecs()),0!==Os()&&0==(H()&Pr())&&Fs(),Is(0),e=Fn(),m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)),S)return x(gt);if(e)return x(St),$o(Ct);if(Su(),qo(0),m&&(v=k.ioMicroMSecs()),(H()&Pr())===Pr()&&(Us(H()),xa()),m&&(F(yi,1),F(ur,k.ioMicroMSecs()-v)),S)return x(mt);if(wn())return;if(qr(0),Ls(H()+1),m&&(v=k.ioMicroMSecs()),e=On(),m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v)),S)return x(kt);if(e)return x(bt),$o(wt)}}(),void su()))}function fo(){var e;if(0!==(e=ha()))return k.primitiveFailFor(e);So(),su()}function po(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackIntegerValue(0),k.failed()?k.primitiveFailFor(p):(Co(e),V(),void k.pop(1)))}function mo(){var e,t=k.stackValue(0);return!k.isBytes(t)||256<=((e=t).bytes?e.bytes.length:e.words?4*e.words.length:0)||(t.bytes,e=!1,(t=t.bytesAsString())!==mr&&(mr=t,e=!0),e&&!Rn())?k.primitiveFail():void k.pop(1)}function vo(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),!(!k.failed()&&k.isPointers(e)&&2<=f(e))||(O(w(),k.fetchPointerofObject(0,e)),O(A(),k.fetchPointerofObject(1,e)),k.failed())?k.primitiveFailFor(p):(xs(w()[0]),js(w()[1]),As(A()[0]),Ps(A()[1]),V(),void k.pop(1)))}function go(){var e,t;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()?k.primitiveFailFor(p):(e=e,t=qs(),Nn(0),pa(e,t,8)&&(Nn(1),t[1]=256*t[1],t[3]=256*t[3],t[5]=256*t[5],t[7]=256*t[7]),k.failed()?k.primitiveFailFor(Te):(V(),void k.pop(1))))}function ko(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackIntegerValue(0),k.failed()?k.primitiveFailFor(p):(Ds(e),V(),void k.pop(1)))}function bo(){var e,t;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):(e=k.stackObjectValue(0),k.failed()||(e=e,En(0),t=pa(e,e=Ys(),6),k.failed()||t&&(En(1),e[2]=e[2]+Ws(),e[5]=e[5]+zs()),k.failed())?k.primitiveFailFor(p):(V(),void k.pop(1)))}function yo(){var e;return 1!==k.methodArgumentCount()?k.primitiveFailFor(d):0!==(e=P(k.stackValue(1),l))?k.primitiveFailFor(e):q(e=k.stackValue(0))!==k.classPoint()||(O(w(),e),k.failed())?k.primitiveFailFor(p):(e=w()[0],c[_i]=e,e=w()[1],c[xi]=e,V(),void k.pop(1))}function So(){var e,t=Ko();if(t===l){if(Dn(),S)return;t=dt}if(t===dt){if(m&&(v=k.ioMicroMSecs()),e=Sn(),m&&(F(Ai,1),F(dr,k.ioMicroMSecs()-v)),S)return x(dt);if(e)return x(yt),$o(Pt);qr(0),Su(),Is(1),t=gt}if(t===gt){if(m&&(v=k.ioMicroMSecs()),0!==Os()&&0==(H()&Pr())&&Fs(),Is(0),e=Fn(),m&&(F(wi,1),F(pr,k.ioMicroMSecs()-v)),S)return x(gt);if(e)return x(St),$o(Ct);t=mt,Su(),qo(0)}if(t===mt){if(m&&(v=k.ioMicroMSecs()),(H()&Pr())===Pr()&&(Us(H()),xa()),m&&(F(yi,1),F(ur,k.ioMicroMSecs()-v)),S)return x(mt);if(wn())return;t=kt,qr(0),Ls(H()+1)}if(t===kt)return m&&(v=k.ioMicroMSecs()),e=On(),m&&(F(Ii,1),F(fr,k.ioMicroMSecs()-v)),S?x(kt):e?(x(bt),$o(wt)):void x(dt)}function Fo(e){return k.failed()?Pe:"number"==typeof e?qe:k.isPointers(e)?f(e)r;)n[s]=n[s-1],--s;n[s]=t}}function Co(e){var t;4<=e&&(t=4),2<=e&&e<4&&(t=2),e=t=e<2?1:t,c[ii]=e,1===t&&(xr(0),Ir(4294967295),_r(0)),2===t&&(xr(1),Ir(4244438268),_r(1)),4===t&&(xr(2),Ir(4042322160),_r(3)),e=2*K(),c[ei]=e,t=K(),c[ti]=t}function Po(e){return!1!=((k=e).majorVersion()==t)&&k.minorVersion()>=i}function _o(e,t){return(0|t[e])>>>16}function xo(e,t){return 65535&(0|t[e])}function Vo(e,t,i){Wr()&&(Uo(0,e),Ro(0,t),Wo(0,i),3!==s())&&bn(0,s()-3)&&(Uo(0,pu()),Ro(0,lu()),Wo(0,hu()),du(e),cu(t),fu(i))}function jo(){return c[tr]}function qo(e){c[tr]=e}function Bo(){return c[er]}function Mo(e){c[er]=e}function No(){return c[ir]}function To(){return c[rr]}function Eo(e){c[rr]=e}function _(e,t){return e*e+t*t}function Lo(e){return Ou(e+1)}function Ro(e,t){return Iu(e+1,t)}function Do(e){return Ou(e+2)}function Wo(e,t){return Iu(e+2,t)}function zo(e){return Ou(e)}function Uo(e,t){return Iu(e,t)}function Ko(){return c[sr]}function x(e){return c[sr]=e}function Ho(e,t){var i,r,s,n,a,o,u,l,c;if(!Hn(e)&&t>=Gr(e))return Zs(e,0);a=y(e),o=$s(e),c=h(e,12),u=h(e,13),l=2*(c-a),c=a+Kr(e)-2*c,s=2*(u-o),u=o+(i=Gr(e))-2*u,n=B(16777216,n=(n=2*(i=i-o))<2?2:n),r=l*(l=n),r+=(l=c*(c=((c=65535&l)*c>>>16)+c*(l=l>>>16&255)*2+(l*l<<16)>>>8)*2)>>1,s=s*n,s+=(n=u*c*2)>>1,Zs(e,i),(u=Yr(e))[ve]=256*a,u[ge]=256*o,u[pe]=r,u[de]=s,u[he]=l,u[fe]=n,(o=$s(e))!==t&&(Zo(e,t),Zs(e,i-(t-o)))}function Go(e,t){var i,r,s,n,a,o,u;if(!Hn(e)&&t>=Yn(e))return Zs(e,0);if(u=Jn(e)-y(e),i=Yn(e)-$s(e),s=0<=u?(a=1,n=u,0):(a=-1,n=0-u,1-i),u=0==i?(o=u,s=0):n>16,r+=n+32768>>16,s+=e[he],n+=e[fe];return e[ve]=i,e[ge]=r,e[pe]=s,e[de]=n,i>>8}function Zo(e,t){Qs(e,Xo(Yr(e),t))}function Jo(e){var t,i=y(e)+ea(e);0<(t=h(e,Wt)+h(e,Ut))&&(i+=$n(e),t-=h(e,zt)),Qn(e,t),Qs(e,i)}function Yo(e,t){var i=_u(e),r=i>>1,s=h(e,ke)+1,n=h(e,be)+1;Cu(e,s),Pu(e,n),r<=s&&Hs(e),0<=n&&Ks(e),n+r<0?Xo(Yr(e),t):Yr(e)[ve]=256*Zr(e),Xo(xu(e),t),Ts(e,i)}function Qo(e){var t,i,r,s,n,a,o=ju(e)+1,u=Bu(e)+1;qu(e,o),Mu(e,u),(i=(t=Nu(e))>>1)<=o&&Hs(e),0<=u&&Ks(e),r=y(e),Jo(e),s=y(e),(o<=t||0<=u+i)&&(o=r,t=s,i=ju(u=e),r=Bu(u),s=Nu(u),e=s>>1,n=Tu(u),a=$n(u),t-=o,i>>8&255,n=e>>>16&255,t=e>>>24&255,Mn()&&(i=(t*(a=qs())[6]+a[7])/t,n=(n*a[0]+a[1])*i|0,s=(s*a[2]+a[3])*i|0,r=(r*a[4]+a[5])*i|0,t=t*i|0,n=Math.max(n,0),n=Math.min(n,255),s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),t=Math.max(t,0),t=Math.min(t,255)),t<1?0:(t<255&&ba()&&$o(_t),r+(s<<8)+(n<<16)+(t<<24))):e}function vu(e){var t,i,r,s,n;Tn()?(t=0|e[0],i=0|e[1],r=e,s=Ys(),n=(s[0]*t+s[1]*i+s[2])*U()|0,t=(s[3]*t+s[4]*i+s[5])*U()|0,r[0]=n,r[1]=t):(e[0]=(e[0]+Ws())*U(),e[1]=(e[1]+zs())*U())}function gu(e){0>8,e=C()[0]-w()[0],t=C()[1]-w()[1],0===(i=(e=128+(0|Math.sqrt(e*e+t*t))>>8)>>8&255,t=e>>>24&255,s=(e>>>16&255)*(n=qs())[0]+n[1]|0,r=r*n[2]+n[3]|0,i=i*n[4]+n[5]|0,t=t*n[6]+n[7]|0,s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),i=Math.max(i,0),i=Math.min(i,255),t=Math.max(t,0),(t=Math.min(t,255))<16?0:i+(r<<8)+(s<<16)+(t<<24)):e}function yu(){return c[$i]}function Su(){Au(yu())}function Fu(e){return!!ka(e)&&(Au(wu()-e),!0)}function s(){return yu()-wu()}function Ou(e){return c[wu()+e]}function Iu(e,t){return c[wu()+e]=t}function wu(){return c[hi]}function Au(e){c[hi]=e}function Cu(e,t){I(e,ke,t)}function Pu(e,t){I(e,be,t)}function _u(e){return h(e,ye)}function xu(e){return o(Or,e+Oe)}function Vu(e,t){I(e,Ie,t)}function ju(e){return h(e,Kt)}function qu(e,t){I(e,Kt,t)}function Bu(e){return h(e,Ht)}function Mu(e,t){I(e,Ht,t)}function Nu(e){return h(e,Gt)}function Tu(e){return h(e,Jt)}function Eu(e,t){I(e,Jt,t)}function Lu(e){c=e.wordsAsInt32Array()}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("B2DPlugin",{primitiveMergeFillFrom:ro,primitiveCopyBuffer:za,primitiveAddRect:Da,primitiveAddGradientFill:Ta,primitiveSetClipRect:vo,initialiseModule:Rn,primitiveSetBitBltPlugin:mo,primitiveRegisterExternalEdge:lo,primitiveGetClipRect:Za,primitiveAddBezier:qa,primitiveInitializeProcessing:io,primitiveRenderImage:ho,primitiveGetOffset:$a,primitiveSetDepth:ko,primitiveAddBezierShape:Ba,primitiveSetEdgeTransform:bo,getModuleName:Cn,primitiveGetTimes:eo,primitiveNextActiveEdgeEntry:ao,primitiveAddBitmapFill:Ma,primitiveGetDepth:Ya,primitiveAbortProcessing:Va,primitiveNextGlobalEdgeEntry:uo,primitiveGetFailureReason:Qa,primitiveDisplaySpanBuffer:Ua,moduleUnloaded:ga,primitiveGetCounts:Ja,primitiveChangedActiveEdgeEntry:Wa,primitiveRenderScanline:fo,primitiveGetBezierStats:Xa,primitiveFinishedProcessing:Ha,setInterpreter:Po,primitiveNeedsFlush:so,primitiveAddLine:Ea,primitiveSetOffset:yo,primitiveNextFillEntry:oo,primitiveInitializeBuffer:to,primitiveDoProfileStats:Ka,primitiveAddActiveEdgeEntry:ja,primitiveSetAALevel:po,primitiveNeedsFlushPut:no,primitiveAddCompressedShape:Na,primitiveSetColorTransform:go,primitiveAddOval:La,primitiveRegisterExternalFill:co,primitiveAddPolygon:Ra,primitiveGetAALevel:Ga}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function O(e){return"number"==typeof e?K.classSmallInteger():e.sqClass}function Q(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function I(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function C(e,t){return 0|Math.floor(e/t)}function P(e,t){return 31>>t}function w(e,t){return t<0?t<-31?0:e>>>0-t:31>>5&31)+(i>>>10&31),i=gi(e>>>16,t>>>16,5,3),be+(31&i)+(i>>>5&31)+(i>>>10&31)):(i=gi(e,t,8,3),be+(255&i)+(i>>>8&255)+(i>>>16&255));return t}function yt(e,t){var i,r,s,n;if((B&(ce|ue))==(ce|ue))if(T<16)for(i=G[T]&Ie,n=t,s=1;s<=D;s++)Gi(r=n&i,Hi(r)+1),n=k(n,T);else 16===T?(Gi(r=qi(65535&t,5,Fe),Hi(r)+1),Gi(r=qi(t>>>16,5,Fe),Hi(r)+1)):Gi(r=qi(t,8,Fe),Hi(r)+1);return t}function St(e,t){return e+t}function Ft(e,t){var i,r,s=e>>>24;return 0==s?t:255==s?e:(r=(16711935&e)*s+(16711935&t)*(i=255-s)+16711935)+(r-65537>>>8&16711935)>>>8&16711935|((r=(16711935&(e>>>8|16711680))*s+(t>>>8&16711935)*i+16711935)+(r-65537>>>8&16711935)>>>8&16711935)<<8}function Ot(e,t){return It(e,t,!1)}function It(e,t,i){var r,s,n,a,o,u,l,c,h,f,p,d,m;if(T<16)return t;if(h=255-et,o=t,1===D)i&&0===e||(o=(p=(16711935&e)*et+(16711935&t)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935|((p=(e>>>8&16711935)*et+(t>>>8&16711935)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935)<<8);else for(r=G[T],m=R,d=t,a=e,n=1;n<=D;n++){if(l=a&r,!(0==(m&r)||i&&0==l)){for(f=d&r,s=0,c=1;c<=3;c++)s|=P(31&C((31&k(l,u=5*(c-1)))*et+(31&k(f,u))*h+254,255),u);o=o&~P(r,16*(n-1))|P(s,16*(n-1))}m=k(m,T),a=k(a,T),d=k(d,T)}return o}function wt(e,t){var i=255-(e>>>24),r=((16711935&t)*i>>>8&16711935)+(16711935&e),t=((t>>>8&16711935)*i>>>8&16711935)+(e>>>8&16711935);return(16711935&t)<<8|255*(16777472&t)|(16711935&r|255*(16777472&r)>>>8)}function At(e,t){return 0===e?t:It(e,t,!0)}function Ct(e,t){return e&t}function Pt(e,t){return e&~t}function _t(e,t){return~e&t}function xt(e,t){return~e&~t}function Vt(e,t){return~t}function jt(e,t){return~e|t}function qt(e,t){return~e|~t}function Bt(e,t){return~e}function Mt(e,t){return~e^t}function Nt(e,t){return e|t}function Tt(e,t){return e|~t}function Et(e,t){return e^t}function Lt(e,t){return 0}function Rt(){j<=W?(J=ot,z=W,x=kt):(J=ot+(j-W),x=kt-(j-W),z=j),j+Se>>2],0==(16777215&e)){for(t+=4,r+=4;0!=--i&&0==(16777215&(e=y[t>>>2]));)t+=4,r+=4;++i}else a=N[r>>>2],a=_i(e,a),N[r>>>2]=a,t+=4,r+=4;++n,++o}}(),m=(d=z)+x,p=(v=U)+_,!0):16===T?(function(){var e,t,i,r,s,n,a,o,u,l,c,h,f;u=_+1,l=Y,h=U,i=16*(1&z),L&&(i=16-i);H=P(65535,16-i);for(;0!=--u;){for(s=l*F+4*J,a=h*g+4*(z>>1),e=4*(3&h),f=(3&J)-1,n=x+1,i=65535===(o=H)?16:0;0!=--n;)t=Me[e+(f=f+1&3)],r=y[s>>>2],0!=(16777215&r)&&(c=N[a>>>2],c=k(c&=~o,i),r=P(0===(r=Xt(r=_i(r,c=(31744&c)<<9|(992&c)<<6|(31&c)<<3|4278190080),t))?1:r,i),Zt(a,r,o)),s+=4,L?0===i&&(a+=4):0!==i&&(a+=4),i^=16,o=~o;++l,++h}}(),m=(d=z)+x,p=(v=U)+_,!0):8===T&&(function(){var e,t,i,r,s,n,a,o,u,l,c,h,f;s=Ut(),o=B&~le,l=_+1,c=Y,H=8*(3&z),L&&(H=24-H);Xe=A^P(255,H),a=0==(1&z)?0:522133279;0==(1&(f=U))&&(a^=522133279);for(;0!=--l;){for(a^=522133279,i=c*F+4*J,n=f*g+4*(z>>2),r=x+1,e=H,u=Xe;0!=--r;)t=(y[i>>>2]&~a)+a,31<(h=C(((h=16777215&t)>>>16)+(h>>>8&255)+(255&h),3))&&(224>>2],h=k(h&=~u,e),h=s[h],t=P(t=ci(t=_i(t,h),o),e),Zt(n,t,u)),i+=4,u=L?0===e?(n+=4,e=24,16777215):(e-=8,u>>>8|4278190080):32===e?(n+=4,e=0,4294967040):(e+=8,u<<8|255),a^=522133279;++c,++f}}(),m=(d=z)+x,p=(v=U)+_,!0);if(T<8)return!1;if(8===T&&0==(B&ce))return!1;32===T&&!function(){for(var e,t,i,r,s,n=_+1,a=Y,o=U;0!=--n;){for(t=a*F+4*J,r=o*g+4*z,i=x+1;0!=--i;)if(255==(s=(e=y[t>>>2])>>>24)){for(N[r>>>2]=e,t+=4,r+=4;0!=--i&&(e=y[t>>>2])>>>24==255;)N[r>>>2]=e,t+=4,r+=4;++i}else if(0==s){for(t+=4,r+=4;0!=--i&&(e=y[t>>>2])>>>24==0;)t+=4,r+=4;++i}else s=wt(e,N[r>>>2]),N[r>>>2]=s,t+=4,r+=4;++a,++o}}();16===T&&!function(){var e,t,i,r,s,n,a,o,u,l=_+1,c=Y,h=U,f=16*(1&z);for(H=P(65535,16-(f=L?16-f:f));0!=--l;){for(r=c*F+4*J,n=h*g+4*(z>>1),e=4*(3&h),u=(3&J)-1,s=x+1,f=65535===(a=H)?16:0;0!=--s;)t=Me[e+(u=u+1&3)],255==(o=(i=y[r>>>2])>>>24)?Zt(n,i=P(0===(i=Xt(i,t))?1:i,f),a):0!=o&&(o=N[n>>>2],Zt(n,i=P(0===(i=Xt(i=wt(i,o=(31744&(o=k(o&=~a,f)))<<9|(992&o)<<6|(31&o)<<3|4278190080),t))?1:i,f),a)),r+=4,L?0===f&&(n+=4):0!==f&&(n+=4),f^=16,a=~a;++c,++h}}();8===T&&!function(){var e,t,i,r,s,n,a,o,u=Ut(),l=B&~le,c=_+1,h=Y,f=U;for(H=8*(3&z),Xe=A^P(255,H=L?24-H:H),n=0==(1&z)?0:522133279,0==(1&U)&&(n^=522133279);0!=--c;){for(n^=522133279,i=h*F+4*J,s=f*g+4*(z>>2),r=x+1,e=H,a=Xe;0!=--r;)31<(o=(t=(y[i>>>2]&~n)+n)>>>24)&&(o<224&&(o=N[s>>>2],t=wt(t,o=u[o=k(o&=~a,e)])),Zt(s,t=P(t=ci(t,l),e),a)),i+=4,a=L?0===e?(s+=4,e=24,16777215):(e-=8,a>>>8|4278190080):24===e?(s+=4,e=0,4294967040):(e+=8,a<<8|255),n^=522133279;++h,++f}}();return m=(d=z)+x,p=(v=U)+_,!0}())return;if(30===M||31===M){if(1!==K.methodArgumentCount())return K.primitiveFail();if(et=K.stackIntegerValue(0),!(!K.failed()&&0<=et&&et<=255))return K.primitiveFail()}be=0,Ht(),(Ye?function(){var e,t,i,r,s,n;for(i=X[M+1],n=1;n<=_;n++){if(t=Je?A:ei(U+n-1),R=H,r=N[E>>>2],e=i(t,r),r=R&e|r&~R,N[E>>>2]=r,E+=4,R=A,3===M)for(r=t,s=2;s<=Ze-1;s++)N[E>>>2]=r,E+=4;else for(s=2;s<=Ze-1;s++)r=N[E>>>2],e=i(t,r),N[E>>>2]=e,E+=4;1>>2],e=i(t,r),r=R&e|r&~R,N[E>>>2]=r,E+=4),E+=_e}}:(function(){var e;it===xe&&Y<=U&&(Y>>2],S+=a):l=0,R=H,f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,o=N[E>>>2],e=n(t&r,o),o=R&e|o&~R,N[E>>>2]=o,E+=a,R=A,3===M)if(0===b&&r===A)if(-1===Re)for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,N[E>>>2]=f,E+=a;else for(u=2;u<=Ze-1;u++)N[E>>>2]=l,E+=a,l=y[S>>>2],S+=a;else for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,N[E>>>2]=t&r,E+=a;else for(u=2;u<=Ze-1;u++)f=y[S>>>2],S+=a,t=w(l&p,s)|w(f&i,b),l=f,e=n(t&r,N[E>>>2]),N[E>>>2]=e,E+=a;1>>2],S+=a,t=w(l&p,s)|w(f&i,b),o=N[E>>>2],e=n(t&r,o),o=R&e|o&~R,N[E>>>2]=o,E+=a),S+=tt,E+=_e}})))(),22!==M&&32!==M||(d=m=v=p=0);m=0>>2],f=0,o=lt,l=Ee,h=e,t===(ce|ue))for(;a=k(u,o)&i,c=Oe[a&Ie],f|=P(c&r,l),l+=n,0!=(4294967264&(o+=s))&&(st?o+=32:o-=32,u=y[(S+=4)>>>2]),0!=--h;);else for(;a=k(u,o)&i,c=ci(a,t),f|=P(c&r,l),l+=n,0!=(4294967264&(o+=s))&&(st?o+=32:o-=32,u=y[(S+=4)>>>2]),0!=--h;);return lt=o,f}(m,e,r,h,t,f),Ee=i,R===A?(c=g(n&l,N[E>>>2]),N[E>>>2]=R&c):(c=g(n&l,(n=N[E>>>2])&R),n=R&c|n&~R,N[E>>>2]=n),E+=4,m=2===s?(R=Xe,d):(R=A,D),0!=--s;);S+=tt,E+=_e}}function Ut(){return[0,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]}function Kt(e,t,i){return e>>16&255)]<<10)+(Be[t+(e>>>8&255)]<<5)+Be[t+(255&e)]}function Zt(e,t,i){var r=N[e>>>2];N[e>>>2]=r=r&i|t}function Jt(e,t){e=K.fetchPointerofObject(e,t);return"number"==typeof e?e:-2147483648<=(t=K.floatValueOf(e))&&t<=2147483647?0|t:(K.primitiveFail(),0)}function Yt(e,t,i){e=K.fetchPointerofObject(e,t);return"number"==typeof e?e:e.isNil?i:-2147483648<=(t=K.floatValueOf(e))&&t<=2147483647?0|t:(K.primitiveFail(),0)}function Qt(e,t){return 32!==T?t:0===t?0:0!=(4278190080&t)?t:t|4278190080&e}function $t(){return e}function ei(e){return De[e-C(e,e=ze)*e|0]}function ti(e){return!!e.isNil||0===M||5===M||10===M||15===M}function ii(){for(var e,t,i,r,s,n,a=0;a<=255;a++)for(e=0;e<=15;e++)i=e,s=n=s=r=void 0,n=Te[(r=255&(t=a))>>>3],s=i<(s=Ne[7&r])?n+1:n,n=Te[(r=t>>>8&255)>>>3],s|=i>>16&255)>>>3],t=s|=i>loadBitBltDestForm: destBitsSize != destPitch * destHeight, expected "+g+"*"+Ve+"="+g*Ve+", got "+e)}N=N.wordsOrBytes()}return!0}function ni(e){return ai(e,!1)}function ai(e,t){if(V=e,He=t,M=K.fetchIntegerofObject(ee,V),K.failed()||M<0||ge-2>loadBitBltSourceForm: sourceBitsSize != sourcePitch * sourceHeight, expected "+F+"*"+rt+"="+F*rt+", got "+e)}y=y.wordsOrBytes()}return!0}())return!1;if(!function(){var e,t,i;if(B=Ie=Fe=0,Oe=we=Ae=null,!(e=K.fetchPointerofObject(u,V)).isNil){if(B=ce,i=!1,K.isWords(e))t=Q(e),Oe=e.words,i=!0;else{if(!(K.isPointers(e)&&3<=Q(e)))return!1;if(Ae=oi(K.fetchPointerofObject(0,e)),we=oi(K.fetchPointerofObject(1,e)),(e=K.fetchPointerofObject(2,e)).isNil)t=0;else{if(!K.isWords(e))return!1;t=Q(e),Oe=e.words}B|=le}if(0!=(t&t-1))return!1;Ie=t-1,Fe=0,512===t&&(Fe=3),4096===t&&(Fe=4),32768===t&&(Fe=5),0===t?(Oe=null,Ie=0):B|=ue,i&&Ri(),!function(e,t){return!e||!t||0===e[ke]&&0===e[ve]&&0===e[ae]&&0===e[a]&&16711680===t[ke]&&65280===t[ve]&&255===t[ae]&&4278190080===t[a]}(Ae,we)?B|=oe:Ae=we=null}return!0}())return!1;0==(B&le)&&Ri(),ot=Yt(ie,V,0),ut=Yt(re,V,0)}return!!function(){var e;if(Je)De=null;else{if(K.isPointers(We)&&4<=Q(We))e=K.fetchPointerofObject(fe,We),ze=K.fetchIntegerofObject(de,We),K.isWords(e)||(Je=!0);else{if(K.isPointers(We)||!K.isWords(We))return!1;ze=Q(e=We)}De=e.wordsOrBytes()}return!0}()&&(j=Yt(n,V,0),q=Yt(o,V,0),Se=Yt(s,V,je),ye=Yt(r,V,Ve),!K.failed())&&(j<0&&(Se+=j,j=0),q<0&&(ye+=q,q=0),je>>14)>=at||(t=t>>>14)>=rt?0:(t=t*F+4*k(e,dt),k(y[t>>>2],lt=mt[e&pt])&vt)}function bi(e,t){var i,r,s,n,a;if(32===T)return e===t?0:t;for(a=G[r=T],s=0,n=1;n<=D;n++)s|=i=(e&a)===(i=t&a)?0:i,a=P(a,r);return s}function yi(e,t){return fi(~e,t,T,D)}function Si(e,t){return 0===e?t:e|fi(~e,t,T,D)}function Fi(e,t){var i,r,s,n,a;if(1===D)return t;if(i=0,s=P(1,T)-1,n=P(s,(D-1)*T),i|=P(t&s,r=32-T)|k(t&n,r),!(D<=2))for(a=2;a<=D>>1;a++)s=P(s,T),n=k(n,T),i|=P(t&s,r-=2*T)|k(t&n,r);return i}function Oi(){return ni(K.stackValue(K.methodArgumentCount()))?(Dt(),K.failed()||(Wi(),K.failed())?null:(K.pop(K.methodArgumentCount()),22===M||32===M?(K.pop(1),K.pushInteger(be)):void 0)):K.primitiveFail()}function Ii(){var e,t,i,r,s,n,a,o,u,l,c,h,f;if(6!==K.methodArgumentCount())return K.primitiveFail();if(l=K.stackIntegerValue(0),s=K.stackObjectValue(1),o=K.stackObjectValue(2),O(s)!==K.classArray()||O(o)!==K.classArray())return K.primitiveFail();if(256!==Q(o))return K.primitiveFail();if(K.failed())return null;if(n=Q(s)-2,i=K.stackIntegerValue(3),c=K.stackIntegerValue(4),f=K.stackObjectValue(5),!K.isBytes(f))return K.primitiveFail();if(!(0>1,s=1;s<=l;s++)if(W+=a,(i-=u)<0&&(qe+=o,i+=l),s>1,s=1;s<=u;s++)if(qe+=o,(i-=l)<0&&(W+=a,i+=u),s=se+12))return K.primitiveFail();(s=Ke-1)<=0&&(s=1);y=Jt(se,V),i=Jt(se+3,V),(I=Kt(y,i,s))<0&&(y=i-s*I);m=Jt(se+1,V),i=Jt(se+4,V),(S=Kt(m,i,s))<0&&(m=i-s*S);g=Jt(se+9,V),i=Jt(se+6,V),(l=Kt(g,i,s))<0&&(g=i-s*l);c=Jt(se+10,V),i=Jt(se+7,V),(n=Kt(c,i,s))<0&&(c=i-s*n);if(K.failed())return;if(2===K.methodArgumentCount())if(w=K.stackIntegerValue(1),(k=K.stackValue(0)).isNil){if(Z<16)return K.primitiveFail()}else{if(Q(k)>>=1;for(vt=G[Z],pt=P(1,dt=5-gt)-1,e=0;e<=pt;e++)mt[e]=st?32-P(e+1,gt):P(e,gt)})(),1>1,f=i>>1,d=r>>1,s>>1):(c=C(t,a),f=C(i,a),d=C(r,a),C(s,a));p=e;do{F=J,k=Y,O=I=S=b=0,w=0,h=a;do{for(A=F,y=k,u=a;g=ki(A,y),25===M&&0===g||(++w,Z<16?g=n[g]:16===Z&&(g=ji(g)),b+=255&g,S+=g>>>8&255,I+=g>>>16&255,O+=g>>>24),A+=c,y+=f,0!=--u;);}while(F+=d,k+=v,0!=--h)}while(g=0===w||25===M&&w>1?0:(4===w?(I>>>=2,S>>>=2,b>>>=2,O>>>=2):(I=C(I,w),S=C(S,w),b=C(b,w),O=C(O,w)),ci(g=0===(g=(O<<24)+(I<<16)+(S<<8)+b)&&0>>2]),N[E>>>2]=R&d):(a=N[E>>>2],d=u(r&p,a&R),a=R&d|a&~R,N[E>>>2]=a),E+=4,O=2===i?(R=Xe,F):(R=A,D),0!=--i;);y+=I,m+=S,g+=l,c+=n,E+=_e}}(),m=0>>=8),s=255&(e>>>=8),e=255&(e>>>=8),255!=(n=255&Ce)&&(e=e*n>>>8,s=s*n>>>8,r=r*n>>>8,a=a*n>>>8),t=255&(n=t),o=255&(i=Pe),ct&&(t=ct[t],o=ct[o]),255<(a=(t*(255-a)>>>8)+(o*a>>>8))&&(a=255),Le&&(a=Le[a]),t=255&(n>>>=8),o=255&(i>>>=8),ct&&(t=ct[t],o=ct[o]),255<(r=(t*(255-r)>>>8)+(o*r>>>8))&&(r=255),Le&&(r=Le[r]),t=255&(n>>>=8),o=255&(i>>>=8),ct&&(t=ct[t],o=ct[o]),255<(t=(t*(255-s)>>>8)+(o*s>>>8))&&(t=255),i>>>=8,((((o=255<(o=((255&(n>>>=8))*(255-e)>>>8)+e)?255:o)<<8)+(t=Le?Le[t]:t)<<8)+r<<8)+a)}function xi(e,t){if(0===e)return t;for(var i,r,s=e,n=t,a=T,o=D,u=G[a],l=0,c=1;c<=o;c++)r=k(s&u,(c-1)*a),i=k(n&u,(c-1)*a),32!==a&&(i=16===a?(r=4278190080|ji(r),4278190080|ji(i)):(r=4278190080|qi(r,a,32),4278190080|qi(i,a,32))),r=_i(r,i),l|=P(r=32!==a?qi(r,32,a):r,(c-1)*a),u=P(u,a);return l}function Vi(e,t){for(var i,r,s,n,a=G[T],o=16===T?(r=5,31):(r=8,255),u=R,l=t,c=e,h=1;h<=D;h++)0<(u&a)&&(n=l&a,i=c&a,s=T<16?i==n?0:1:((s=gi(i,n,r,3))&o)+(k(s,r)&o)+(k(k(s,r),r)&o),be+=s),u=k(u,T),c=k(c,T),l=k(l,T);return t}function ji(e){return(31&e)<<3|(992&e)<<6|(31744&e)<<9}function qi(e,t,i){var r,s,n,a;return 0<(r=i-t)?(a=P(1,t)-1,s=(n=P(e,r))&(a=P(a,r)),a=P(a,i),s+((n=P(n,r))&a)+(P(n,r)&P(a,i))):0==r?5===t?32767&e:8===t?16777215&e:e:0===e?e:(a=P(1,i)-1,s=(n=k(e,r=t-i))&a,a=P(a,i),0===(s=s+((n=k(n,r))&a)+(k(n,r)&P(a,i)))?1:s)}function Bi(e,t){return T<16?di(e,t,T,D):16===T?di(e,t,5,3)+(di(e>>>16,t>>>16,5,3)<<16):di(e,t,8,4)}function Mi(e,t){return T<16?mi(e,t,T,D):16===T?mi(e,t,5,3)+(mi(e>>>16,t>>>16,5,3)<<16):mi(e,t,8,4)}function Ni(e,t){e=~e;return T<16?mi(e,t,T,D):16===T?mi(e,t,5,3)+(mi(e>>>16,t>>>16,5,3)<<16):mi(e,t,8,4)}function Ti(e,t){return T<16?vi(e,t,T,D):16===T?vi(e,t,5,3)+(vi(e>>>16,t>>>16,5,3)<<16):vi(e,t,8,4)}function Ei(e,t){return T<16?gi(e,t,T,D):16===T?gi(e,t,5,3)+(gi(e>>>16,t>>>16,5,3)<<16):gi(e,t,8,4)}function Li(e){return!1!=((K=e).majorVersion()==t)&&K.minorVersion()>=i}function Ri(){var e,t=e=0;if(!(Z<=8)){if(16===Z&&(t=5),0===Fe){if(T<=8)return;16===T&&(e=5),32===T&&(e=8)}else e=Fe;Di(t=32===Z?8:t,e)}}function Di(e,t){var i,r=[0,0,0,0],s=[0,0,0,0],n=t-e;0!=n&&(n<=0?(i=P(1,t)-1,s[ke]=P(i,2*e-n),s[ve]=P(i,e-n),s[ae]=P(i,0-n),s[a]=0):(i=P(1,e)-1,s[ke]=P(i,2*e),s[ve]=P(i,e),s[ae]=i),r[ke]=3*n,r[ve]=2*n,r[ae]=n,r[a]=0,Ae=r,we=s,B=B|ce|oe)}function Wi(){K.showDisplayBitsLeftTopRightBottom(xe,d,v,m,p)}function zi(e,t){return e}function Ui(e,t){return e-t}function Ki(e,t){var i,r,s,n,a;if((B&(ce|ue))==(ce|ue))for(i=G[T],r=t,n=R,s=1;s<=D;s++)0!=(n&i)&&(a=r&i,Gi(a=T<16?a:qi(a,16===T?5:8,Fe),Hi(a)+1)),n=k(n,T),r=k(r,T);return t}function Hi(e){return Oe[e&Ie]}function Gi(e,t){Oe[e&Ie]=t}function Xi(){var e,t,i,r;Ue&&(ht||ui())&&(i=ht,r=!1,"number"==typeof(e=K.fetchPointerofObject(fe,xe))&&(i(e,d,v,m-d,p-v),r=!(N=g=0)),Ye||"number"==typeof(t=K.fetchPointerofObject(fe,it))&&(r&&t===e||i(t,0,0,0,0),y=F=0),Ue=!1)}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("BitBltPlugin",{primitiveCopyBits:Oi,copyBits:Dt,moduleUnloaded:hi,primitiveDrawLoop:wi,primitiveDisplayString:Ii,initialiseModule:ri,loadBitBltFrom:ni,setInterpreter:Li,primitiveWarpBits:Ci,getModuleName:$t,primitivePixelValueAt:Ai,copyBitsFromtoat:Wt}):self.setTimeout(e,100)}()}(),registerCroquetPlugin(),!function(){var t=1,i=11;function r(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function v(e,t){return 0|Math.floor(e/t)}function g(e,t){return 31>2)===O&&k===u&&k===s&&u===s),!1===n.failed())}function f(){for(var e,t,i,r=0,s=o;r>1,r=k>>2,f=1;f<=y;f++)for(c=g(1,f),h=c>>1,t=v(k,c),l=1;l<=h;l++)for(o=(m=(l-1)*t)=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("FFTPlugin",{primitiveFFTTransformData:m,setInterpreter:w,primitiveFFTPermuteData:p,primitiveFFTScaleData:d,getModuleName:c}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function o(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}var u=null,e="FloatArrayPlugin 3 November 2014 (e)";function r(){return e}function s(){var e,t,i,r,s=u.stackObjectValue(0),n=u.stackObjectValue(1);if(u.failed())return null;if(u.success(u.isWords(s)),u.success(u.isWords(n)),u.failed())return null;if(i=o(s),u.success(i===o(n)),u.failed())return null;for(r=n.wordsAsFloat32Array(),e=s.wordsAsFloat32Array(),t=0;t<=i-1;t++)r[t]=r[t]+e[t];u.pop(1)}function n(){var e,t,i,r=u.stackFloatValue(0),s=u.stackObjectValue(1);if(u.failed())return null;if(u.success(u.isWords(s)),u.failed())return null;for(t=o(s),i=s.wordsAsFloat32Array(),e=0;e<=t-1;e++)i[e]=i[e]+r;u.pop(1)}function a(){var e=u.stackIntegerValue(0),t=u.stackObjectValue(1);return u.failed()||(u.success(u.isWords(t)),u.success(0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("FloatArrayPlugin",{primitiveMulFloatArray:v,primitiveEqual:p,primitiveAtPut:l,primitiveAt:a,primitiveNormalize:k,primitiveSubFloatArray:b,primitiveDivFloatArray:c,primitiveAddScalar:n,primitiveDotProduct:f,primitiveSubScalar:y,setInterpreter:F,primitiveSum:S,getModuleName:r,primitiveHashArray:d,primitiveMulScalar:g,primitiveLength:m,primitiveAddFloatArray:s,primitiveDivScalar:h}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function W(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function z(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}var U=null,r="GeniePlugin v2.0 14 November 2014 (e)";function K(e,t){var i=e[0],e=e[1],i=t[0]-i,t=t[1]-e;return i*i+t*t}function s(){return r}function H(e){console.log(r+": "+e)}function n(){var N,T,e,t,i,r,E,s,n,a,o,u,l,c,h,L,f,p,d,m,v,g,k,b,y,R,S,F,O=U.stackValue(11),I=U.stackValue(10),w=U.stackValue(9),A=U.stackValue(8),C=U.stackValue(7),P=U.stackValue(6),_=U.stackValue(5),x=U.stackValue(4),D=U.stackIntegerValue(3),V=U.stackValue(2),j=U.stackValue(1),q=U.stackValue(0);if(!U.failed())if(U.failed())H("failed 1");else if(U.success(U.isWords(O)&&U.isWords(I)&&U.isWords(w)&&U.isWords(A)&&U.isWords(C)&&U.isWords(P)&&U.isWords(_)&&U.isWords(x)&&U.isWords(V)&&U.isWords(j)&&U.isWords(q)),U.failed())H("failed 2");else if(U.success(U.isMemberOf(O,"PointArray")&&U.isMemberOf(I,"PointArray")),U.failed())H("failed 3");else if(a=O.wordsAsInt32Array(),h=I.wordsAsInt32Array(),L=w.wordsAsInt32Array(),E=A.wordsAsInt32Array(),u=C.wordsAsInt32Array(),n=P.wordsAsInt32Array(),R=_.wordsAsInt32Array(),N=x.wordsAsInt32Array(),p=V.wordsAsInt32Array(),S=j.wordsAsInt32Array(),f=q.wordsAsInt32Array(),I=W(I)>>>1,k=W(w)>>>1,s=W(A)>>>1,w=W(P),A=W(V),U.success(A===W(j)&&A===W(q)&&s=k-1&&W(O)>>>1>=k&&s-1<=w&&s<=I&&W(_)>=k-1&&W(x)>=s-1),U.failed())H("failed 5");else if(P=D>>>1,l=(T=1&D)?0:P*P>>>10,f[S[p[0]=0]=0]=2,v=0-l,(o=s)-1<=I&&o-1<=w){for(m=1;m<=o;m++)v=v+(n[e=m-1]+K(z(h,e<<1),a)>>>7)+l,S[m]=v,p[m]=v*m,f[m]=m+1;for(v=S[0]-l,g=1;g<=k;g++){for(y=p[0],v=v+(u[t=g-1]+K(z(a,d=t<<1),h)>>>7)+l,S[0]=v,p[0]=v*g,f[0]=g+1,o=s,m=1;m<=o;m++)B=(e=m-1)<<1,b=p[m],F=p[e],c=u[t]+K(z(a,d),z(h,m<<1))>>>7,0===(v=S[m])?b+=c:(b=b+v+c*f[m],c+=v),r=n[e]+K(z(h,B),z(a,g<<1))>>>7,0===(v=S[e])?F+=r:(F=F+v+r*f[e],r+=v),T?y=1<<29:y+=(K(z(E,B),z(L,d))+K(z(h,B),z(a,d)))*(16+(B=N[e],M=R[t],(M=180<(M=Math.abs(M-B))?360-M:M)*M>>>6))>>>11,B=y<=b&&y<=F?(i=y,v=0,1):b<=F?(i=b,v=c+l,f[m]+1):(i=F,v=r+l,f[e]+1),y=p[m],p[m]=Math.min(i,1<<29),S[m]=Math.min(v,1<<29),f[m]=B;v=S[0]}var B,M,V=i;U.failed()||U.popthenPush(13,V)}else U.primitiveFail();return null}function a(){return U.failed()||U.popthenPush(1,2e3),null}function o(e){return!1!=((U=e).majorVersion()==t)&&U.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("GeniePlugin",{primVersionNO:a,setInterpreter:o,primSameClassAbsoluteStrokeDistanceMyPoints_otherPoints_myVectors_otherVectors_mySquaredLengths_otherSquaredLengths_myAngles_otherAngles_maxSizeAndReferenceFlag_rowBase_rowInsertRemove_rowInsertRemoveCount:n,getModuleName:s}):self.setTimeout(e,100)}()}(),!function(){var t=1,E=11;function I(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function n(e,t){return 0|Math.floor(e/t)}function i(e,t){return 31>>3)*m[a]+(t>>>3),s=((7&i)<<3)+(7&t),i=se[r][s],++e<8*m[f]?m[u]=e:(m[u]=0,m[l]++);return i}(),e-=j,t=function(){var e,t,i,r,s;t=e=v[u],i=v[l],r=v[h],s=v[d],0!==r&&0!==s&&(t=n(t,r),i=n(i,s));r=(i>>>3)*v[a]+(t>>>3),s=((7&i)<<3)+(7&t),i=ne[r][s],++e<8*v[f]?v[u]=e:(v[u]=0,v[l]++);return i}(),r=s+(z*(t-=j)>>16)+O[te],r=Math.min(r,V),r=Math.max(r,0),O[te]=r&g,r&=V-g,r=Math.max(r,1),t=s-(L*e>>16)-(R*t>>16)+O[c],t=Math.min(t,V),t=Math.max(t,0),O[c]=t&g,t&=V-g,t=Math.max(t,1),s=s+(K*e>>16)+O[o],s=Math.min(s,V),s=Math.max(s,0),O[o]=s&g,s&=V-g,s=Math.max(s,1),k[i]=4278190080+(r<<16)+(t<<8)+s}function T(e){var t;return s>>e)}function he(){return e}function fe(e,t){var i,r,s=e[0]>>>24;if(!(Q>>24&255))return-1}return-1}function pe(){var e,t=e=B[u],i=B[l],r=B[h],s=B[d];return 0!==r&&0!==s&&(t=n(t,r),i=n(i,s)),r=(i>>>3)*B[a]+(t>>>3),s=le[r][((7&i)<<3)+(7&t)],++e<8*B[f]?B[u]=e:(B[u]=0,B[l]++),s}function de(){var e,t,i;if(4!==q.methodArgumentCount())return q.primitiveFail();if(g=q.stackIntegerValue(0),e=q.stackObjectValue(1),q.failed())return null;if(!q.isWords(e)||3!==I(e))return q.primitiveFail();if(O=e.wordsAsInt32Array(),e=q.stackObjectValue(2),q.failed())return null;if(!q.isWords(e))return q.primitiveFail();if(b=I(e),k=e.wordsAsInt32Array(),e=q.stackObjectValue(3),q.failed())return null;if(!ye(e))return q.primitiveFail();for(B[u]=0,t=B[l]=0;t<=b-1;t++)i=pe(),i+=O[c],i=Math.min(i,V),O[c]=i&g,i&=V-g,i=Math.max(i,1),k[t]=4278190080+(i<<16)+(i<<8)+i;q.pop(4)}function me(){var e,t;return 4!==q.methodArgumentCount()?q.primitiveFail():(g=q.stackIntegerValue(0),e=q.stackObjectValue(1),q.failed()?null:q.isWords(e)&&3===I(e)?(O=e.wordsAsInt32Array(),e=q.stackObjectValue(2),q.failed()?null:q.isWords(e)?(b=I(e),k=e.wordsAsInt32Array(),e=q.stackObjectValue(3),q.failed()?null:q.isPointers(e)&&3===I(e)&&ye(q.fetchPointerofObject(0,e))&&(t=q.fetchPointerofObject(1,e),M(m,t))&&N(se,t)&&(t=q.fetchPointerofObject(2,e),M(v,t))&&N(ne,t)?(ce(),void q.pop(4)):q.primitiveFail()):q.primitiveFail()):q.primitiveFail())}function ve(){var e,t,i;return 5!==q.methodArgumentCount()?q.primitiveFail():(i=q.stackObjectValue(0),q.failed()?null:I(e=i)<5||!q.isPointers(e)||"number"==typeof(t=q.fetchPointerofObject(0,e))||!q.isBytes(t)||(y=t.bytes,t=(t=t).bytes?t.bytes.length:t.words?4*t.words.length:0,S=q.fetchIntegerofObject(1,e),F=q.fetchIntegerofObject(2,e),r=q.fetchIntegerofObject(3,e),s=q.fetchIntegerofObject(4,e),q.failed())||(t>>4,0!==(n&=15)){if(r+=s,n=ke(T(n),n),r<0||A<=r)return q.primitiveFail();e[ue[r]]=n}else{if(15!=s)return;r+=s}++r}}(t,B),q.failed())?null:(i=q.stackValue(0),q.storeIntegerofObjectwithValue(1,i,S),q.storeIntegerofObjectwithValue(3,i,r),q.storeIntegerofObjectwithValue(4,i,s),q.storeIntegerofObjectwithValue(p,q.stackValue(3),B[p]),void q.pop(5)))):q.primitiveFail()):q.primitiveFail()):q.primitiveFail()))}function ge(){var e,t;if(2!==q.methodArgumentCount())return q.primitiveFail();if(e=q.stackObjectValue(0),q.failed())return null;if(!q.isWords(e)||I(e)!==A)return q.primitiveFail();if(t=e.wordsAsInt32Array(),e=q.stackObjectValue(1),q.failed())return null;if(!q.isWords(e)||I(e)!==A)return q.primitiveFail();for(var i,r,s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b,y=e.wordsAsInt32Array(),S=t,F=new Array(64),O=0;O<=w-1;O++){for(i=-1,n=1;n<=w-1;n++)-1===i&&0!==y[n*w+O]&&(i=n);if(-1===i)for(r=y[O]*S[0]<<2,s=0;s<=w-1;s++)F[s*w+O]=r;else f=(m=((v=y[2*w+O]*S[2*w+O])+(g=y[6*w+O]*S[6*w+O]))*_)+g*(0-H),p=m+v*x,u=(a=(v=y[O]*S[O])+(g=y[4*w+O]*S[4*w+O])<<13)+p,h=a-p,l=(o=v-g<<13)+f,c=o-f,a=y[7*w+O]*S[7*w+O],o=y[5*w+O]*S[5*w+O],f=y[3*w+O]*S[3*w+O],m=a+(p=y[w+O]*S[w+O]),v=o+f,g=a+f,k=o+p,p*=U,a=(a*=C)+(m*=0-D)+(g=g*(0-G)+(b=(g+k)*W)),o=(o*=X)+(v*=0-Z)+(k=k*(0-P)+b),f=(f*=J)+v+g,F[O]=u+(p=p+m+k)>>11,F[7*w+O]=u-p>>11,F[+w+O]=l+f>>11,F[6*w+O]=l-f>>11,F[2*w+O]=c+o>>11,F[5*w+O]=c-o>>11,F[3*w+O]=h+a>>11,F[4*w+O]=h-a>>11}for(O=0;O<=A-w;O+=w)v=F[O+2],g=F[O+6],u=(a=F[O]+F[O+4]<<13)+(p=(m=(v+g)*_)+v*x),h=a-p,l=(o=F[O]-F[O+4]<<13)+(f=m+g*(0-H)),c=o-f,a=F[O+7],o=F[O+5],f=F[O+3],m=a+(p=F[O+1]),v=o+f,g=a+f,a=(a*=C)+(m*=0-D)+(g=g*(0-G)+(b=(g+(k=o+p))*W)),o=(o*=X)+(v*=0-Z)+(k=k*(0-P)+b),f=(f*=J)+v+g,p=(p*=U)+m+k,d=Math.min((u+p>>18)+j,V),d=Math.max(d,0),y[O]=d,d=Math.min((u-p>>18)+j,V),d=Math.max(d,0),y[O+7]=d,d=Math.min((l+f>>18)+j,V),d=Math.max(d,0),y[O+1]=d,d=Math.min((l-f>>18)+j,V),d=Math.max(d,0),y[O+6]=d,d=Math.min((c+o>>18)+j,V),d=Math.max(d,0),y[O+2]=d,d=Math.min((c-o>>18)+j,V),d=Math.max(d,0),y[O+5]=d,d=Math.min((h+a>>18)+j,V),d=Math.max(d,0),y[O+3]=d,d=Math.min((h-a>>18)+j,V),d=Math.max(d,0),y[O+4]=d;q.pop(2)}function ke(e,t){return e=E}function ye(e){return M(B,e)&&N(le,e)}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("JPEGReaderPlugin",{setInterpreter:be,primitiveIdctInt:ge,primitiveColorConvertMCU:me,primitiveColorConvertGrayscaleMCU:de,primitiveDecodeMCU:ve,getModuleName:he}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function y(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function p(e,t){return 0|Math.floor(e/t)}function s(e,t){return e-p(e,t)*t|0}var S=null,n=0,e="KedamaPlugin 3 November 2014 (e)",a=0,r=0,o=0,u=0;function k(e,t){var i;return 0===e?0<=t?90:270:(i=Math.atan(t/e),0<=e?0<=t?i/.0174532925199433:360+i/.0174532925199433:180+i/.0174532925199433)}function l(e){var e=90-e,t=e/360|0;return e<0&&--t,.0174532925199433*(e-360*t)}function c(){var e,t,i,r,s,n,a,o,u,l=S.stackValue(0),c=S.stackValue(1),h=S.stackValue(2),f=S.stackValue(3),p=S.stackIntegerValue(4),d=S.stackIntegerValue(5),m=S.stackValue(6);if(S.failed())return null;if(!S.isWords(m))return S.primitiveFail(),null;if(!S.isWords(f))return S.primitiveFail(),null;if(!S.isWords(h))return S.primitiveFail(),null;if(!S.isWords(c))return S.primitiveFail(),null;if(!S.isBytes(l))return S.primitiveFail(),null;if(p*d!==y(m))return S.primitiveFail(),null;if(r=y(f),y(h)!==r)return S.primitiveFail(),null;if(y(c)!==r)return S.primitiveFail(),null;if(y(l)!==r)return S.primitiveFail(),null;for(a=f.wordsAsFloat32Array(),u=h.wordsAsFloat32Array(),e=c.words,s=l.bytes,t=m.words,i=0;i<=r-1;i++)n=0|a[i],o=0|u[i],0!==s[i]&&0<=n&&0<=o&&n>>16;return e<0?0-r:r}function g(){var e=S.stackIntegerValue(0);if(S.failed())return null;n=65536&e,S.pop(1)}function b(){var e,t,i,r,s,n,a=S.stackIntegerValue(0),o=S.stackIntegerValue(1),u=S.stackValue(2),l=S.stackValue(3);if(S.failed())return null;if((t=y(l))!==y(u))return S.primitiveFail(),null;if(a<-32)return S.primitiveFail(),null;if(8>>0-n:31=i}function Z(){var e=S.stackFloatValue(0),t=S.stackValue(1),i=S.stackIntegerValue(2);return S.failed()?null:!S.isWords(t)||y(t)>>16;return e<0?0-r:r}function v(){var e=O.stackIntegerValue(0);if(O.failed())return null;s=65536&e,O.pop(1)}function g(){var e,t,i,r,s,n,a=O.stackIntegerValue(0),o=O.stackIntegerValue(1),u=O.stackValue(2),l=O.stackValue(3);if(O.failed())return null;if((t=F(l))!==F(u))return O.primitiveFail(),null;if(a<-32)return O.primitiveFail(),null;if(8>>0-n:31=a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>=t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>=a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>=t[r];O.pop(4),O.push(u)}function W(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>=s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>=t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>=s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>=t;O.pop(4),O.push(u)}function z(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]>t[r];O.pop(4),O.push(u)}function U(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]>t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]>t;O.pop(4),O.push(u)}function K(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]<=a[r];else for(o=c.words,t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]<=t[r];else if(s)for(i=c.wordsAsFloat32Array(),a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]<=a[r];else for(i=c.wordsAsFloat32Array(),t=l.wordsAsFloat32Array(),e=u.bytes,r=0;r<=n-1;r++)e[r]=i[r]<=t[r];O.pop(4),O.push(u)}function H(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(a=F(c),O.success(a===F(u)),O.failed())return null;if(n="number"==typeof l,O.isMemberOf(c,"WordArray"))if(n)for(o=c.words,s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]<=s;else for(o=c.words,t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=o[r]<=t;else if(n)for(i=c.wordsAsFloat32Array(),s=l,e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]<=s;else for(i=c.wordsAsFloat32Array(),t=O.floatValueOf(l),e=u.bytes,r=0;r<=a-1;r++)e[r]=i[r]<=t;O.pop(4),O.push(u)}function G(){var e,t,i,r,s,n,a,o,u=O.stackObjectValue(0),l=O.stackObjectValue(1),c=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(l)),O.success(O.isWords(c)),O.success(O.isBytes(u)),O.failed())return null;if(n=F(l),O.success(n===F(c)),O.success(n===F(u)),O.failed())return null;if(s=O.isMemberOf(l,"WordArray"),O.isMemberOf(c,"WordArray"))if(s)for(o=c.words,a=l.words,e=u.bytes,r=0;r<=n-1;r++)e[r]=o[r]>>0,o[r]=i);if(!l&&!d)for(o=u.words,n=h.words,r=p-1;r<=f-1;r++)1===s[r]&&(o[r]=n[c+r-p]);O.pop(4)}function oe(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p,d,m,v=O.stackObjectValue(0),g=O.stackObjectValue(1),k=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(g)),O.success(O.isWords(k)),O.success(O.isWords(v)),O.failed())return null;if(l=F(g),O.success(l===F(k)),O.success(l===F(v)),O.failed())return null;if(o=O.isMemberOf(g,"WordArray"),u=O.isMemberOf(k,"WordArray"),o&&u){if(!O.isMemberOf(v,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(v,"KedamaFloatArray"))return O.primitiveFail(),null;if(u)if(o)for(d=k.words,p=g.words,m=v.words,a=0;a<=l-1;a++)f=b(h=d[a],c=p[a]),m[a]=f;else for(d=k.words,r=g.wordsAsFloat32Array(),n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(h=d[a])/(e=r[a]),i=Math.floor(i),n[a]=h-i*e;else if(o)for(s=k.wordsAsFloat32Array(),p=g.words,n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(t=s[a])/(c=p[a]),i=Math.floor(i),n[a]=t-i*c;else for(s=k.wordsAsFloat32Array(),r=g.wordsAsFloat32Array(),n=v.wordsAsFloat32Array(),a=0;a<=l-1;a++)i=(t=s[a])/(e=r[a]),i=Math.floor(i),n[a]=t-i*e;O.pop(4),O.push(v)}function ue(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p=O.stackObjectValue(0),d=O.stackValue(1),m=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(m)),O.success(O.isWords(p)),O.failed())return null;if(l=F(m),O.success(l===F(p)),O.failed())return null;if(o="number"==typeof d,u=O.isMemberOf(m,"WordArray"),o&&u){if(!O.isMemberOf(p,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(p,"KedamaFloatArray"))return O.primitiveFail(),null;if(u)if(o)for(h=m.words,a=d,f=p.words,n=0;n<=l-1;n++)f[n]=b(h[n],a);else for(h=m.words,e=O.floatValueOf(d),s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(c=h[n])/e,i=Math.floor(i),s[n]=c-i*e;else if(o)for(r=m.wordsAsFloat32Array(),a=d,s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(t=r[n])/a,i=Math.floor(i),s[n]=t-i*a;else for(r=m.wordsAsFloat32Array(),e=O.floatValueOf(d),s=p.wordsAsFloat32Array(),n=0;n<=l-1;n++)i=(t=r[n])/e,i=Math.floor(i),s[n]=t-i*e;O.pop(4),O.push(p)}function le(){var e,t,i,r,s,n,a,o,u,l,c=O.stackObjectValue(0),h=O.stackObjectValue(1),f=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(h)),O.success(O.isWords(f)),O.success(O.isWords(c)),O.failed())return null;if(a=F(h),O.success(a===F(f)),O.success(a===F(c)),O.failed())return null;if(s=O.isMemberOf(h,"WordArray"),n=O.isMemberOf(f,"WordArray"),s&&n){if(!O.isMemberOf(c,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(c,"KedamaFloatArray"))return O.primitiveFail(),null;if(n)if(s)for(u=f.words,o=h.words,l=c.words,r=0;r<=a-1;r++)l[r]=u[r]-o[r];else for(u=f.words,e=h.wordsAsFloat32Array(),i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=u[r]-e[r];else if(s)for(t=f.wordsAsFloat32Array(),o=h.words,i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=t[r]-o[r];else for(t=f.wordsAsFloat32Array(),e=h.wordsAsFloat32Array(),i=c.wordsAsFloat32Array(),r=0;r<=a-1;r++)i[r]=t[r]-e[r];O.pop(4),O.push(c)}function ce(){var e,t,i,r,s,n,a,o,u,l,c=O.stackObjectValue(0),h=O.stackValue(1),f=O.stackObjectValue(2);if(O.failed())return null;if(O.success(O.isWords(f)),O.success(O.isWords(c)),O.failed())return null;if(o=F(f),O.success(o===F(c)),O.failed())return null;if(n="number"==typeof h,a=O.isMemberOf(f,"WordArray"),n&&a){if(!O.isMemberOf(c,"WordArray"))return O.primitiveFail(),null}else if(!O.isMemberOf(c,"KedamaFloatArray"))return O.primitiveFail(),null;if(a)if(n)for(u=f.words,s=h,l=c.words,r=0;r<=o-1;r++)l[r]=u[r]-s;else for(u=f.words,e=O.floatValueOf(h),i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=u[r]-e;else if(n)for(t=f.wordsAsFloat32Array(),s=h,i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=t[r]-s;else for(t=f.wordsAsFloat32Array(),e=O.floatValueOf(h),i=c.wordsAsFloat32Array(),r=0;r<=o-1;r++)i[r]=t[r]-e;O.pop(4),O.push(c)}function q(e){e=90-e/.0174532925199433;return 0=i}function ke(){var e=O.stackFloatValue(0),t=O.stackValue(1),i=O.stackIntegerValue(2);return O.failed()?null:!O.isWords(t)||F(t)>=1),R=Z*M[m]|0,M[m]),l=M[k],c=M[b];for(i=(h=Z*h|0)/Z,c=c,t=(l=l)<=0?1:1-(t=(1-i)/l)/(Math.exp(t)-1),c=d*(c+1),s=Math.cos(c),r=Math.sin(c),s=function(e,t,i,r){var s,n,a,o,u,l,c;if(0<(o=v(0,e,t,i,r)))for(u=0,s=o,n=v(l=1,e,t,i,r);0=H),T.failed())return null;var v,g,k,b,y,S,F,O,I,w=m,A=v,C=k,P=w;for(P=.6*$((M=w)[45]),m=.6*$(M[50]),v=.4*$(M[46]),k=.15*$(M[47]),y=.06*$(M[48]),F=.04*$(M[49]),g=.15*$(M[34]),b=.06*$(M[35]),S=.04*$(M[36]),O=.022*$(M[37]),I=.03*$(M[38]),8<=B&&(16e3<=G?te(19,7500,600):B=6),7<=B&&(16e3<=G?te(18,6500,500):B=6),6<=B&&te(17,M[24],M[25]),5<=B&&te(16,M[22],M[23]),te(15,M[20],M[21]),te(14,M[18],M[19]),te(13,M[16],M[17]),te(12,M[12],M[13]),te(20,M[26],M[27]),te(22,M[30],M[31]),he(21,M[28],M[29]),he(23,M[32],M[33]),ie(1,M[26],M[27],P),ie(2,M[30],M[31],m),ie(3,M[12],M[13],v),ie(4,M[16],M[17],k),ie(5,M[18],M[19],y),ie(6,M[20],M[21],F),ie(7,M[16],M[40],g),ie(8,M[18],M[41],b),ie(9,M[20],M[42],S),ie(10,M[22],M[43],O),ie(11,M[24],M[44],I),0=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("Klatt",{setInterpreter:O,primitiveSynthesizeFrameIntoStartingAt:a,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,P=11;function v(e){return"number"==typeof e?j.classSmallInteger():e.sqClass}function _(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function x(e,t){return 0|Math.floor(e/t)}function V(e,t){return e-x(e,t)*t|0}function p(e,t){return 31>>t}var m=0,j=null,s="LargeIntegers v1.5 (e)",g=1,k=2;function L(e,t,i){var r,s,n,a;if(t<1||i<1)return j.primitiveFail();if(s=e,!((e=Math.min(i,o(s.bytes,_(s))))>3),r=1+(e-1>>3),t=V(t-1,8),e=7-V(e-1,8),i==r)return n=p(255,t)&d(255,e),0!=(S(s,i)&n);if(0!==d(S(s,i),t))return 1;for(a=1+i;a<=r-1;a++)if(0!==S(s,a))return 1;return 0!=(255&p(S(s,r),e))}}function u(e,t){var i=j.instantiateClassindexableSize(v(e),t),r=_(e),r=r>>=16,t+=16),e<256||(e>>>=8,t+=8),e<16||(e>>>=4,t+=4),e<4||(e>>>=2,t+=2),e<2||(e>>>=1,++t),t+e}function y(e){for(var t=e,e=t<0?j.classLargeNegativeInteger():j.classLargePositiveInteger(),i=c(t),e=j.instantiateClassindexableSize(e,i),r=e.bytes,s=1;s<=i;s++)r[s-1]=h(t,s);return e}function M(e,t){var i,r,s=_(e);return 0===(r=o(e.bytes,s))?0:(r=r+t+7>>3,i=j.instantiateClassindexableSize(v(e),r),function(e,t,i,r,s){for(var n,a,o,u=e>>3,l=V(e,8),c=u-1,h=0;h<=c;h++)r[h]=0;if(0===l)return b(r,u,s-1,t,0);for(o=8-l,c=i-1,h=n=0;h<=c;h++)a=t[h],r[h+u]=255&(n|p(a,l)),n=d(a,o);0!==n&&(r[s-1]=n)}(t,e.bytes,s,i.bytes,r),i)}function N(e,t,i){var r,i=o(e.bytes,i),s=i+7>>3,i=i-t;return i<=0?j.instantiateClassindexableSize(v(e),0):(i=7+i>>3,r=j.instantiateClassindexableSize(v(e),i),function(e,t,i,r,s){var n,a,o,u,l,c,h=e>>3,f=V(e,8);if(0===f)return b(r,0,s-1,t,h);for(u=8-f,a=d(t[h],f),l=i-1,n=c=1+h;n<=l;n++)o=t[n],r[n-c]=255&(a|p(o,u)),a=d(o,f);0!==a&&(r[s-1]=a)}(t,e.bytes,s,r.bytes,i),r)}function i(e,t){var i,r,s,n=_(e),a=_(t),o=v(e),t=n<=a?(r=e,i=n,s=t,a):(r=t,i=a,s=e,n),a=j.instantiateClassindexableSize(o,t),e=function(e,t,i,r,s){for(var n=0,a=t-1,o=0;o<=a;o++)n=(n>>>8)+e[o]+i[o],s[o]=255&n;for(a=r-1,o=t;o<=a;o++)n=(n>>>8)+i[o],s[o]=255&n;return n>>>8}(r.bytes,i,s.bytes,t,a.bytes);return 0>>8,c=255&v,f=d<3?0:y[d-3];;){if(!((g>>8),c=k[m-1]*(255&u),o=y[p-1]-l-(255&c),y[p-1]=255&o,l=h+(c>>>8)-(o>>=8),++p;if(0>>8)+y[p-1]+k[m-1],y[p-1]=255&l,++p;F[O-P]=u}e=N(e,t,T(n)-1),r=j.instantiateClassindexableSize(j.classArray(),2),j.stObjectatput(r,1,s),j.stObjectatput(r,2,e)}return r}function T(e){return("number"==typeof e?c:_)(e)}function R(e,t,i,r){var s=_(e),n=_(t),a=_(i);if(!(s<=a))return j.primitiveFail();if(!(n<=a))return j.primitiveFail();if(!(0<=r&&r<=255))return j.primitiveFail();for(var o,u,l,c=j.instantiateClassindexableSize(j.classLargePositiveInteger(),a),h=e.bytes,e=s,f=t.bytes,p=n,d=i.bytes,s=a,m=r,v=c.bytes,g=e-1,k=p-1,b=s-1,y=0,S=0;S<=g;S++){for(l=v[0]+h[S]*f[0],l+=(u=l*m&255)*d[0],o=1;o<=k;o++)l=(l>>>8)+v[o]+h[S]*f[o]+u*d[o],v[o-1]=255&l;for(o=p;o<=b;o++)l=(l>>>8)+v[o]+u*d[o],v[o-1]=255&l;v[b]=255&(l=(l>>>8)+y),y=l>>>8}for(S=e;S<=b;S++){for(l=v[0],l+=(u=l*m&255)*d[0],o=1;o<=b;o++)l=(l>>>8)+v[o]+u*d[o],v[o-1]=255&l;v[b]=255&(l=(l>>>8)+y),y=l>>>8}if(0!==y||1!==F(d,v,s))for(S=l=0;S<=b;S++)l=l+v[S]-d[S],v[S]=255&l,l>>=8;return C(c)}function f(e,t,i){var r,s,n,a,o,u,l,c,h,f,p,d=_(e),m=_(t),t=d<=m?(n=e,s=d,r=t,m):(n=t,s=m,r=e,d),m=i?j.classLargeNegativeInteger():j.classLargePositiveInteger(),e=j.instantiateClassindexableSize(m,t+s),v=n.bytes,d=s,g=r.bytes,i=t,k=e.bytes;if(!(1===d&&0===v[0]||1===i&&0===g[0]))for(p=d-1,h=i-1,c=0;c<=p;c++)if(0!==(u=v[c])){for(f=c,o=l=0;o<=h;o++)l=(a=g[o]*u+l+k[f])>>>8,k[f]=255&a,++f;k[f]=l}return w(e)}function S(e,t){return t>_(e)?0:E(e,t)}function O(e,t){var i,r,s,n,a=v(e)===j.classLargeNegativeInteger(),o=_(e),u=_(t);if(o===u){for(;1>=8;for(m=c;m<=f-1;m++)d+=h[m],p[m]=255&d,d>>=8;return(u?A:C)(a)}function D(){return s}function I(e){var t,i;if("number"==typeof e)return 1;if(0!==(i=T(e))&&0!==E(e,i)){if(4h(1073741823,4);if(!(E(e,4)e?1:te?1:t=P}function E(e,t){return e.bytes[t-1]}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("LargeIntegers",{primDigitAddWith:G,primDigitBitShiftMagnitude:Q,primGetModuleName:ue,primDigitBitLogicWithOp:Z,primCheckIfCModuleExists:U,primDigitCompare:ee,primDigitMultiplyNegative:se,primDigitBitShift:Y,primNormalizePositive:fe,primDigitSubtractWith:oe,_primDigitBitShift:K,primDigitMultiplyWithNegative:ne,primDigitSubtract:ae,primDigitDivNegative:ie,primNormalizeNegative:he,primDigitBitOr:J,primMontgomeryTimesModulo:le,primDigitBitAnd:X,primDigitDivWithNegative:re,setInterpreter:pe,primNormalize:ce,primDigitBitXor:$,primDigitCompareWith:te,primDigitAdd:H,getModuleName:D,primAsLargeInteger:z,primAnyBitFromTo:W}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function h(e){return"number"==typeof e?p.classSmallInteger():e.sqClass}function f(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}var p=null,d=0,m=0,v=0,g=0,e="Matrix2x3Plugin 3 November 2014 (e)";function r(){return e}function k(e){return p.failed()?null:p.isWords(e)&&6===f(e)?e.wordsAsFloat32Array():(p.primitiveFail(),null)}function b(e){var t,i;if(!p.failed())return h(e)===p.classPoint()&&((t="number"==typeof(i=p.fetchPointerofObject(0,e)))||i.isFloat)&&(d=t?i:p.floatValueOf(i),(t="number"==typeof(i=p.fetchPointerofObject(1,e)))||i.isFloat)?void(m=t?i:p.floatValueOf(i)):p.primitiveFail()}function y(e){var t,i=d-e[2],r=m-e[5],s=e[0]*e[4]-e[1]*e[3];if(0==s)return p.primitiveFail();t=i*e[4]-e[1]*r,r=e[0]*r-i*e[3],v=t*(s=1/s),g=r*s}function S(e){v=d*e[0]+m*e[1]+e[2],g=d*e[3]+m*e[4]+e[5]}function n(e){return-1073741824<=e&&v<=1073741823}function s(e){var t,i,r,s,n,a,o,u=k(t=p.stackObjectValue(0)),l=k(p.stackObjectValue(1)),c=k(p.stackObjectValue(2));if(p.failed())return null;i=l,u=u,r=c[0]*l[0]+c[1]*l[3],s=c[0]*l[1]+c[1]*l[4],n=c[0]*l[2]+c[1]*l[5]+c[2],a=c[3]*l[0]+c[4]*l[3],o=c[3]*l[1]+c[4]*l[4],i=c[3]*l[2]+c[4]*l[5]+c[5],u[0]=r,u[1]=s,u[2]=n,u[3]=a,u[4]=o,u[5]=i,p.popthenPush(e+1,t)}function a(e){var t;if(b(p.stackObjectValue(0)),t=k(p.stackObjectValue(1)),p.failed())return null;y(t),p.failed()||O(e)}function o(e){var t,i,r,s,n,a,o,u=p.stackObjectValue(0),l=p.stackObjectValue(1),c=k(p.stackObjectValue(2));return p.failed()?null:h(l)!==h(u)||!p.isPointers(l)||2!==f(l)?p.primitiveFail():(b(p.fetchPointerofObject(0,l)),p.failed()||(a=d,o=m,y(c),s=i=v,n=r=g,b(p.fetchPointerofObject(1,l)),p.failed())?null:(l=d,t=m,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=l,m=o,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=a,m=t,y(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),p.failed()||(u=I(u,s,n,i,r)),void(p.failed()||p.popthenPush(e+1,u))))}function u(e){var t=k(p.stackObjectValue(0));if(p.failed())return null;p.pop(1),p.pushBool(1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5])}function l(e){var t=k(p.stackObjectValue(0));if(p.failed())return null;p.pop(1),p.pushBool(1===t[0]&&0===t[1]&&0===t[3]&&1===t[4])}function c(e){var t;if(b(p.stackObjectValue(0)),t=k(p.stackObjectValue(1)),p.failed())return null;S(t),O(e)}function F(e){var t,i,r,s,n,a,o,u=p.stackObjectValue(0),l=p.stackObjectValue(1),c=k(p.stackObjectValue(2));return p.failed()?null:h(l)!==h(u)||!p.isPointers(l)||2!==f(l)?p.primitiveFail():(b(p.fetchPointerofObject(0,l)),p.failed()||(a=d,o=m,S(c),s=i=v,n=r=g,b(p.fetchPointerofObject(1,l)),p.failed())?null:(l=d,t=m,S(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=l,m=o,S(c),s=Math.min(s,v),i=Math.max(i,v),n=Math.min(n,g),r=Math.max(r,g),d=a,m=t,S(c),s=Math.min(s,v),i=Math.max(i,v),u=I(u,s,Math.min(n,g),i,Math.max(r,g)),void(p.failed()||p.popthenPush(e+1,u))))}function O(e){return g+=.5,n(v+=.5)&&n(g)?void p.popthenPush(e+1,p.makePointwithxValueyValue(0|v,0|g)):p.primitiveFail()}function I(e,t,i,r,s){var t=t+.5;return n(t)&&n(r=r+.5)&&n(i=i+.5)&&n(s=s+.5)?(p.pushRemappableOop(e),e=p.makePointwithxValueyValue(0|t,0|i),p.pushRemappableOop(e),t=p.makePointwithxValueyValue(0|r,0|s),e=p.popRemappableOop(),i=p.popRemappableOop(),p.storePointerofObjectwithValue(0,i,e),p.storePointerofObjectwithValue(1,i,t),i):p.primitiveFail()}function w(e){return!1!=((p=e).majorVersion()==t)&&p.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("Matrix2x3Plugin",{primitiveInvertPoint:a,primitiveInvertRectInto:o,primitiveIsIdentity:u,primitiveComposeMatrix:s,setInterpreter:w,primitiveTransformRectInto:F,primitiveIsPureTranslation:l,getModuleName:r,primitiveTransformPoint:c}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function r(e,t){return e-(0|Math.floor(e/t))*t|0}var d=null,e="MiscPrimitivePlugin 3 November 2014 (e)";function h(e,t,i){for(var r,s,n=0;n<=3;n++)t[i+n-1]=255&(r=e,31<(s=8*(3-n))?0:r>>>s);return i+4}function f(e,t,i){return e<=223?(t[i-1]=e,i+1):e<=7935?(t[i-1]=224+(e>>8),t[i]=r(e,256),i+2):(t[i-1]=255,h(e,t,i+1))}function s(){return e}function n(e){d.stackValue(3);var t,i,r,s,n,a=d.stackBytes(2),o=d.stackBytes(1),u=d.stackBytes(0);if(!d.failed()){for(s=a.length,n=o.length,r=1;r<=Math.min(s,n);r++)if((t=u[a[r-1]])!==(i=u[o[r-1]]))return t>>8&255)==(n=255&u)&&(u>>>16&255)==n&&(u>>>24&255)==n,r=s;r>>2))return d.primitiveFail(),null;if(1==(i=3&t))for(r=f[n-1],++n,r=(r|=r<<8)|r<<16,a=1;a<=l;a++)h[o-1]=r,++o;if(2==i){for(r=0,a=1;a<=4;a++)r=r<<8|f[n-1],++n;for(a=1;a<=l;a++)h[o-1]=r,++o}if(3==i)for(u=1;u<=l;u++){for(r=0,a=1;a<=4;a++)r=r<<8|f[n-1],++n;h[o-1]=r,++o}}if(d.failed())return null;d.pop(e)}function l(e){d.stackValue(3);var t,i,r=d.stackBytes(2),s=d.stackBytes(1),n=d.stackIntegerValue(0);if(!d.failed())if(256!==s.length)d.failed()||d.popthenPush(e+1,0);else{for(t=n,i=r.length;t<=i&&0===s[r[t-1]];)++t;i>>14)+101*r&16383)&268435455;d.failed()||d.popthenPush(e+1,i)}return null}function v(e){d.stackValue(4);var t,i=d.stackBytes(3),r=d.stackIntegerValue(2),s=d.stackIntegerValue(1),n=d.stackBytes(0);if(d.failed())return null;for(t=r;t<=s;t++)i[t-1]=n[i[t-1]];if(d.failed())return null;d.pop(e)}function g(e){return!1!=((d=e).majorVersion()==t)&&d.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("MiscPrimitivePlugin",{primitiveConvert8BitSigned:o,primitiveCompareString:n,primitiveTranslateStringWithTable:v,primitiveStringHash:m,primitiveCompressToByteArray:a,primitiveFindSubstring:c,primitiveIndexOfAsciiInString:p,setInterpreter:g,primitiveDecompressFromByteArray:u,getModuleName:s,primitiveFindFirstInString:l}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function x(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function V(e,t){return 0|Math.floor(e/t)}function j(e,t){return e-V(e,t)*t|0}var q=null,e="ScratchPlugin 3 November 2014 (e)";function d(e,t,i,r,s){var n,a=V(i,60),i=j(i,60),o=(1e3-r)*s,u=(1e3-V(r*i,60))*s,r=(1e3-V(r*(60-i),60))*s,i=V(1e3*s,3922);o=V(o,3922),u=V(u,3922),r=V(r,3922),0===a&&(n=(i<<16)+(r<<8)+o),1===a&&(n=(u<<16)+(i<<8)+o),2===a&&(n=(o<<16)+(i<<8)+r),3===a&&(n=(o<<16)+(u<<8)+i),4===a&&(n=(r<<16)+(o<<8)+i),e[t]=n=0===(n=5===a?(i<<16)+(o<<8)+u:n)?1:n}function B(e){return q.success(q.isWordsOrBytes(e)),q.failed()?0:e.wordsAsFloat64Array()}function M(e){return q.success(q.isWords(e)),q.failed()?0:e.words}function r(){return e}function m(e,t,i,r,s){r=s-r;return 0==r?0:(s=e===s?V(60*(t-i),r):t===s?120+V(60*(i-e),r):240+V(60*(e-t),r))<0?s+360:s}function l(e,t,i){var r;return 0===e?t:0===t?e:0===(r=((r=1024-i)*(e>>>16&255)+i*(t>>>16&255)>>10<<16)+(r*(e>>>8&255)+i*(t>>>8&255)>>10<<8)+(r*(255&e)+i*(255&t)>>10))?1:r}function y(e,t,i,r,s){var n,a,o,u=t>>>10;return u<-1||r<=u||(o=i>>>10)<-1||s<=o?0:(t=1023&t,-1===u&&(t=u=0),i=1023&i,-1===o&&(i=o=0),a=16777215&e[n=o*r+u],0<(t=u===r-1?0:t)&&(a=l(a,16777215&e[n+1],t)),0===(i=o===s-1?0:i)?a:(s=16777215&e[n=(o+1)*r+u],0>>16&255,r+=o>>>8&255,e+=255&o,++n);a=0===n?0:(V(u,n)<<16)+(V(r,n)<<8)+V(e,n),m[c*p+l]=a}return q.pop(3),0}function n(){var e,t,i,r,s,n=q.stackValue(2),a=q.stackValue(1),o=q.stackIntegerValue(0),u=M(n),l=x(n),c=M(a);if(q.success(x(a)===l),q.failed())return null;for(t=0;t<=l-1;t++)0!=(s=16777215&u[t])&&(e=m(i=r=s>>>16&255,e=s>>>8&255,s=255&s,r=s<(r=e=r>>1),q.failed())return null;for(i=a.wordsAsInt16Array(),e=o.wordsAsInt16Array(),u&&s++,t=1;t<=r;t++)e[n++]=i[s],s+=2;return q.pop(3),0}function c(){var e,t,i,r,s,n,a,o,u,l,c=q.stackValue(3),h=q.stackValue(2),f=q.stackIntegerValue(1),p=q.stackIntegerValue(0),d=M(c),m=M(h),c=x(c);if(q.success(x(h)===c),q.failed())return null;for(V(c,f),e=f>>1,t=(r=V(c,f))>>1,n=p/100,u=0;u<=f-1;u++)for(l=0;l<=r-1;l++)o=(u-e)/e,i=(l-t)/t,o=(s=Math.pow(Math.sqrt(o*o+i*i),n))<=1?(i=Math.atan2(i,o),a=1024*(e+s*Math.cos(i)*e)|0,1024*(t+s*Math.sin(i)*t)|0):(a=1024*u,1024*l),s=y(d,a,o,f,r),m[l*f+u]=s;return q.pop(4),0}function h(){var e,t,i,r,s,n,a,o,u=M(q.stackValue(11)),l=q.stackIntegerValue(10),c=q.stackIntegerValue(9),h=M(q.stackValue(8)),f=q.stackIntegerValue(7),p=q.stackIntegerValue(6),d=q.stackIntegerValue(5),m=q.stackIntegerValue(4),v=q.stackIntegerValue(3),g=q.stackIntegerValue(2),k=q.stackIntegerValue(1),b=q.stackIntegerValue(0);if(q.success(0<=d&&0<=m),q.success(d+2*k<=l),q.success(m+2*b<=c),q.success(0<=v&&0<=g),q.success(v+k<=f),q.success(g+b<=p),q.failed())return null;for(o=0;o<=b-1;o++)for(n=l*(m+2*o)+d,t=f*(g+o)+v,a=0;a<=k-1;a++)s=16711680&(r=u[n]),i=65280&r,e=255&r,s+=16711680&(r=u[n+1]),e+=255&r,i=(i+=65280&r)+(65280&(r=u[n+l])),e+=255&r,s=(s+=16711680&r)+(16711680&(r=u[n+l+1])),h[t]=s>>>2&16711680|(i+=65280&r)>>>2&65280|(e+=255&r)>>>2,n+=2,++t;return q.pop(12),0}function f(){var e,t,i,r,s,n,a=M(q.stackValue(11)),o=q.stackIntegerValue(10),u=q.stackIntegerValue(9),l=M(q.stackValue(8)),c=q.stackIntegerValue(7),h=q.stackIntegerValue(6),f=q.stackIntegerValue(5),p=q.stackIntegerValue(4),d=q.stackIntegerValue(3),m=q.stackIntegerValue(2),v=q.stackIntegerValue(1),g=q.stackIntegerValue(0);if(q.success(0<=f&&0<=p),q.success(f+2*v<=o),q.success(p+2*g<=u),q.success(0<=d&&0<=m),q.success(d+v<=c),q.success(m+g<=h),q.failed())return null;for(n=0;n<=g-1;n++)for(r=o*(p+2*n)+f,e=c*(m+n)+d,s=0;s<=v-1;s++)t=a[r],i=a[r+o+1],l[e]=(65280&t)+(65280&i)>>>1&65280|(255&t)+(255&i)>>>1|(16711680&t)+(16711680&i)>>>1&16711680,r+=2,++e;return q.pop(12),0}function p(){var e,t,i,r,s,n,a,o,u=q.stackValue(2),l=q.stackValue(1),c=q.stackIntegerValue(0),h=M(u),f=x(u),p=M(l);if(q.success(x(l)===f),q.failed())return null;for(i=0;i<=f-1;i++)0!=(n=16777215&h[i])&&(r=s=a=n>>>16&255,(e=255&n)<(s=(n=n>>>8&255)>>16&255,(e=255&n)<(s=(n=n>>>8&255)>>10)*y+(t>>>10)],u=t>>>10>>10>>10>>16&255)+d*(u>>>16&255)+m*(l>>>16&255)+v*(c>>>16&255))>>>20&255)<<16)|((h=p*(o>>>8&255)+d*(u>>>8&255)+m*(l>>>8&255)+v*(c>>>8&255))>>>20&255)<<8|(h=p*(255&o)+d*(255&u)+m*(255&l)+v*(255&c))>>>20&255)&&(s=1),r[a*O+n]=s,t+=g;i+=k}return q.pop(6),0}function b(){var e,t,i,r,s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b,y=q.stackValue(5),S=q.stackValue(4),F=q.stackIntegerValue(3),O=M(y),I=M(S),y=x(y),w=q.stackIntegerValue(2),A=q.stackValue(1),C=q.stackValue(0),P=B(A),_=B(C);if(q.success(x(S)===y),q.failed())return null;for(u=V(y,F),e=j(Math.random(),w)-1,d=0;d<=e/2-1;d++)for(k=j(Math.random(),F),b=j(Math.random(),u),f=j(Math.random(),8),a=-4;a<=4;a++)for(o=-4;o<=4;o++)(i=a*a+o*o)<25&&0>1)<(t=(n=V(d,v))>>1)?(u=t/(a=e),1):(u=1,(a=t)=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ScratchPlugin",{primitiveCondenseSound:a,getModuleName:r,primitiveFisheye:c,primitiveWaterRipples1:b,primitiveHalfSizeDiagonal:f,primitiveScale:k,primitiveDoubleSize:o,setInterpreter:F,primitiveWhirl:S,primitiveBlur:s,primitiveBrightnessShift:n,primitiveHalfSizeAverage:h,primitiveSaturationShift:g,primitiveHueShift:p,primitiveInterpolate:v,primitiveExtractChannel:u}):self.setTimeout(e,100)}()}(),registerSocketPlugin(),registerSpeechPlugin(),registerSqueakSSL(),!function(){var t=1,i=11;function I(e,t){return e-(0|Math.floor(e/t))*t|0}var x=511,V=512,S=32768,F=536870912,j=null,e="SoundGenerationPlugin 3 November 2014 (e)";function r(){return e}function s(){var e,t,i,r,s,n,a,o,u=j.stackValue(3),l=j.stackInt16Array(2),c=j.stackIntegerValue(1),h=j.stackIntegerValue(0),f=j.fetchInt32ArrayofObject(7,u),p=j.fetchInt32ArrayofObject(8,u),d=j.fetchIntegerofObject(9,u),m=j.fetchIntegerofObject(10,u),v=j.fetchIntegerofObject(11,u),g=j.fetchInt16ArrayofObject(12,u),k=j.fetchInt16ArrayofObject(13,u);if(j.failed())return null;for(n=c;n<=c+h-1;n++){for(e=t=0,o=1;o<=d;o++)(i=v-f[o-1])<1&&(i+=m),e+=(a=p[o-1])*g[i-1],t+=a*k[i-1];(s=32767<(s=l[(r=2*n-1)-1]+(e>>15))?32767:s)<-32767&&(s=-32767),l[r-1]=s,g[v-1]=s,(s=32767<(s=l[++r-1]+(t>>15))?32767:s)<-32767&&(s=-32767),l[r-1]=s,k[v-1]=s,v=I(v,m)+1}if(j.failed())return null;j.storeIntegerofObjectwithValue(11,u,v),j.pop(3)}function n(){var e,t,i,r,s,n,a,o=j.stackValue(5),u=j.stackIntegerValue(4),l=j.stackInt16Array(3),c=j.stackIntegerValue(2),h=j.stackIntegerValue(1),f=j.stackIntegerValue(0),p=j.fetchIntegerofObject(3,o),d=j.fetchIntegerofObject(4,o),m=j.fetchIntegerofObject(5,o),v=j.fetchIntegerofObject(7,o),g=j.fetchInt16ArrayofObject(8,o),k=j.fetchIntegerofObject(9,o),b=j.fetchIntegerofObject(10,o),y=j.fetchIntegerofObject(11,o),S=j.fetchIntegerofObject(14,o),F=j.fetchIntegerofObject(15,o),O=j.fetchIntegerofObject(16,o);if(j.failed())return null;for(e=0!==S&&0!==O,i=c+u-1,a=c;a<=i;a++)n=p*g[b>>15]>>15,e?(r=S*g[F>>15],(F=I(F+O,k))<0&&(F+=k),(b=I(b+y+r,k))<0&&(b+=k)):b=I(b+y,k),0>15))?32767:s)<-32767&&(s=-32767),l[t-1]=s),0>15))?32767:s)<-32767&&(s=-32767),l[t-1]=s),0!==d&&(p+=d,0>15,t=g*k>>15,i=2*m-1,s=m+p-1,h=m;h<=s;h++){if((o=(c=A<(c=(P+=_)>>9)&&F>9:c)+1)>w){if(w>9)}u=n=O[c-1]*(V-(a=P&x))+O[o-1]*a>>9,r&&(u=I[c-1]*(V-a)+I[o-1]*a>>9),0>15))?32767:l)<-32767&&(l=-32767),d[i-1]=l),++i,0>15))?32767:l)<-32767&&(l=-32767),d[i-1]=l),++i,0!==b&&(k+=b,(0>15,t=g*k>>15)}if(S-=p,j.failed())return null;j.storeIntegerofObjectwithValue(3,f,k),j.storeIntegerofObjectwithValue(4,f,b),j.storeIntegerofObjectwithValue(7,f,S),j.storeIntegerofObjectwithValue(19,f,P),j.pop(5)}function o(){var e,t,i,r,s,n,a,o=j.stackValue(5),u=j.stackIntegerValue(4),l=j.stackInt16Array(3),c=j.stackIntegerValue(2),h=j.stackIntegerValue(1),f=j.stackIntegerValue(0),p=j.fetchIntegerofObject(3,o),d=j.fetchIntegerofObject(4,o),m=j.fetchIntegerofObject(5,o),v=j.fetchIntegerofObject(7,o),g=j.fetchInt16ArrayofObject(8,o),k=j.fetchIntegerofObject(9,o),b=j.fetchIntegerofObject(10,o),y=j.fetchIntegerofObject(11,o);if(j.failed())return null;for(t=c+u-1,n=s=k,a=c;a<=t;a++)y<=(s=n+b)&&(s=S+(s-y)),r=g[(n>>15)-1]+g[(s>>15)-1]>>1,r=(g[(n>>15)-1]=r)*p>>15,n=s,0>15))?32767:i)<-32767&&(i=-32767),l[e-1]=i),0>15))?32767:i)<-32767&&(i=-32767),l[e-1]=i),0!==d&&(p+=d,0>>16);n<=g&&i<=t;)s=v[n-1]*f>>15,0>15))?32767:r)<-32767&&(r=-32767),u[e-1]=r),0>15))?32767:r)<-32767&&(r=-32767),u[e-1]=r),0!==p&&(f+=p,0>>16,k-=s<<16),n=b+(k>>>16),++i;if(m-=o,j.failed())return null;j.storeIntegerofObjectwithValue(3,a,f),j.storeIntegerofObjectwithValue(4,a,p),j.storeIntegerofObjectwithValue(7,a,m),j.storeIntegerofObjectwithValue(11,a,k),j.storeIntegerofObjectwithValue(12,a,b),j.pop(5)}function l(e){return!1!=((j=e).majorVersion()==t)&&j.minorVersion()>=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SoundGenerationPlugin",{primitiveMixFMSound:n,primitiveMixSampledSound:u,setInterpreter:l,getModuleName:r,primitiveApplyReverb:s,primitiveMixPluckedSound:o,primitiveMixLoopedSampledSound:a}):self.setTimeout(e,100)}()}(),!function(){var t=1,i=11;function b(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function y(e,t){return 0|Math.floor(e/t)}var S=null,e="StarSqueakPlugin 3 November 2014 (e)";function F(e){return S.success(S.isWords(e)),S.failed()?0:e.words}function r(){return e}function s(){var e,t,i,r,s,n,a,o,u,l,c,h=S.stackValue(4),f=S.stackValue(3),p=S.stackIntegerValue(2),d=S.stackIntegerValue(1),m=S.stackIntegerValue(0),v=F(h),g=F(f);if(S.success(b(h)===b(f)),S.success(b(h)===p*d),S.failed())return null;for(e=(2*m+1)*(2*m+1),l=0;l<=d-1;l++)for((n=l-m)<0&&(n=0),d<=(i=l+m)&&(i=d-1),o=0;o<=p-1;o++){for((s=o-m)<0&&(s=0),p<=(t=o+m)&&(t=p-1),a=0,c=n;c<=i;c++)for(r=c*p,u=s;u<=t;u++)a+=v[r+u];g[l*p+o]=y(a,e)}S.pop(5)}function n(){var e,t=S.stackValue(1),i=S.stackIntegerValue(0),r=F(t),s=b(t);if(S.failed())return null;for(e=0;e<=s-1;e++)r[e]=r[e]*i>>>10;S.pop(2)}function a(){var e,t,i,r,s,n,a,o,u,l,c=S.stackValue(6),h=S.stackValue(5),f=S.stackIntegerValue(4),p=S.stackIntegerValue(3),d=S.stackIntegerValue(2),m=S.stackIntegerValue(1),v=S.stackIntegerValue(0),g=F(c),k=F(h);if(S.success(b(h)===f*p),S.success(b(h)===b(c)*d*d),S.failed())return null;for((r=0)<(4&m)&&(r+=65536),0<(2&m)&&(r+=256),0<(1&m)&&++r,n=-1,o=0;o<=y(p,d)-1;o++)for(a=0;a<=y(f,d)-1;a++)for(u=g[++n],i=(u=255<(u=(l=v)<0?l<-31?0:u>>>0-l:31=i}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("StarSqueakPlugin",{primitiveDiffuseFromToWidthHeightDelta:s,primitiveEvaporateRate:n,setInterpreter:o,primitiveMapFromToWidthHeightPatchSizeRgbFlagsShift:a,getModuleName:r}):self.setTimeout(e,100)}()}(),!function(){var t=1,o=11;function i(e){return"number"==typeof e?O.classSmallInteger():e.sqClass}function y(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function S(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function u(e,t){return e-(0|Math.floor(e/t))*t|0}function n(e,t){return 31>>16),h=65535&(l=re(n+1,a,o,t,i)),(c=l>>>16)<=a&&F<=a){for(r=function(e,t){V[P]=e-F,b[P]=t,e=$[e-F],_[e]++,e=t<257?w[t-1]:w[256+(t-1>>>7)];return X[e]++,++j,++P===x||0==(4095&P)&&fe()}(a,n-o),u=1;u<=a-1;u++)E(++n);s=!1,++n}else f=g[n],V[P]=f,b[P]=0,_[f]++,r=++P===x||0==(4095&P)&&fe(),++n<=e&&!r&&(E(n),s=!0,o=h,a=c);if(r)return v=n,!0}v=n}return!1}function ie(e){for(var t=i(e);!t.isNil&&7<=t.classInstSize();)t=t.superclass();return!t.isNil&&(a=t.classInstSize(),1)}function re(e,t,i,r,s){var n,a,o,u,l,c=t<<16|i;if(f<=t)return c;if(!(0<(i=e-(l=A[pe(e+F-1)]))&&i>2t))return O.primitiveFail();for(d|=n(t,m),m+=e;8<=m&&q>>=8,m-=8}function ne(){var e,t,i,r;return 3!==O.methodArgumentCount()?O.primitiveFail():(t=O.stackIntegerValue(0),e=O.stackIntegerValue(1),r=O.stackIntegerValue(2),i=O.stackObjectValue(3),O.failed()?null:function(e){var t;if(O.isPointers(e)&&15<=y(e)&&(t=O.fetchPointerofObject(0,e),O.isBytes(t))){if(0===a){if(!ie(e))return;if(y(e)=x))||(b=t.words,t=O.fetchPointerofObject(a+7,e),!O.isWords(t))||y(t)!==D||(_=t.words,t=O.fetchPointerofObject(a+8,e),!O.isWords(t))||y(t)!==c||(X=t.words,P=O.fetchIntegerofObject(a+9,e),j=O.fetchIntegerofObject(a+10,e),O.failed()))):void 0}}(i)?(r=te(r,e,t),O.failed()||(O.storeIntegerofObjectwithValue(a+2,i,s),O.storeIntegerofObjectwithValue(a+3,i,v),O.storeIntegerofObjectwithValue(a+9,i,P),O.storeIntegerofObjectwithValue(a+10,i,j)),void(O.failed()||(O.pop(4),O.pushBool(r)))):O.primitiveFail())}function ae(){var e,t,i,r,s,n;if(2!==O.methodArgumentCount())return O.primitiveFail();if(e=O.stackIntegerValue(0),r=O.stackObjectValue(1),O.failed())return null;if(!O.isWords(r))return O.primitiveFail();for(n=y(r),s=r.wordsAsInt32Array(),i=0;i<=n-1;i++)t=s[i],s[i]=e<=t?t-e:0;O.pop(2)}function oe(){var e,t;if(2!==O.methodArgumentCount())return O.primitiveFail();if(e=O.stackValue(0),!O.isWords(e))return O.primitiveFail();if(k=e.words,G=y(e),e=O.stackValue(1),!O.isWords(e))return O.primitiveFail();if(Y=e.words,Q=y(e),t=O.stackValue(2),!O.isPointers(t))return O.primitiveFail();if(0===r){if(!function(e){for(var t=i(e);!t.isNil&&13<=t.classInstSize();)t=t.superclass();return!t.isNil&&(r=t.classInstSize(),1)}(t))return O.primitiveFail();if(y(t)>>16)-1)&&(s+=R(i)),c=de(k,G),e=65535&c,0<(i=c>>>16)&&(e+=R(i)),n<=B+s)return d=o,m=a,N=u;for(l=(t=B)-e,r=1;r<=s;r++)g[t+r]=g[l+r];B+=s}}(),void(O.failed()||(O.storeIntegerofObjectwithValue(2,t,B+1),O.storeIntegerofObjectwithValue(r+0,t,T),O.storeIntegerofObjectwithValue(r+1,t,d),O.storeIntegerofObjectwithValue(r+2,t,m),O.storeIntegerofObjectwithValue(r+4,t,N+1),O.pop(2)))):O.primitiveFail()))}function ue(){var e,t,i,r,s,n,a,o;if(4!==O.methodArgumentCount())return O.primitiveFail();if(i=O.stackObjectValue(0),o=O.stackIntegerValue(1),a=O.stackIntegerValue(2),e=O.positive32BitValueOf(O.stackValue(3)),O.failed())return 0;if(!(O.isBytes(i)&&a<=o&&0>>16&65535,r=--a;r<=o;r++)s=u(s+t[r],65521),n=u(n+s,65521);O.popthenPush(5,O.positive32BitIntegerFor((n<<16)+s))}function le(){var e,t,i,r,s,n;if(4!==O.methodArgumentCount())return O.primitiveFail();if(t=O.stackObjectValue(0),n=O.stackIntegerValue(1),s=O.stackIntegerValue(2),i=O.positive32BitValueOf(O.stackValue(3)),O.failed())return 0;if(!(O.isBytes(t)&&s<=n&&0>>8;O.popthenPush(5,O.positive32BitIntegerFor(i))}function ce(){var e,t,i,r,s;return 4!==O.methodArgumentCount()?O.primitiveFail():(t=O.stackObjectValue(0),i=O.stackObjectValue(1),e=O.stackObjectValue(2),s=O.stackObjectValue(3),r=O.stackObjectValue(4),O.failed()?null:function(e){var t;if(0===a){if(!ie(e))return;if(y(e)=a+3&&(t=O.fetchPointerofObject(0,e),O.isBytes(t)?(g=t.bytes,I=S(t),q=O.fetchIntegerofObject(1,e),B=O.fetchIntegerofObject(2,e),d=O.fetchIntegerofObject(a+0,e),m=O.fetchIntegerofObject(a+1,e),!O.failed()):O.primitiveFail())}(r)&&O.isPointers(t)&&2<=y(t)&&O.isPointers(i)&&2<=y(i)&&O.isPointers(s)&&3<=y(s)&&O.isPointers(e)&&3<=y(e)?(s=function(e,t,i,r){var s,n,a,o,u,l,c,h,f,p,d,m,v,g,k,b;if(k=O.fetchPointerofObject(0,e),m=O.fetchIntegerofObject(1,e),d=O.fetchIntegerofObject(2,e),!(m<=d&&O.isBytes(k)&&d<=S(k)))return O.primitiveFail();if(f=k.bytes,k=O.fetchPointerofObject(0,t),!(O.isWords(k)&&d<=y(k)&&O.fetchIntegerofObject(1,t)===m&&O.fetchIntegerofObject(2,t)===d))return O.primitiveFail();if(a=k.words,k=O.fetchPointerofObject(0,i),!O.isWords(k))return O.primitiveFail();if(p=y(k),v=k.words,k=O.fetchPointerofObject(1,i),!O.isWords(k)||p!==y(k))return O.primitiveFail();if(g=k.words,k=O.fetchPointerofObject(0,r),!O.isWords(k))return O.primitiveFail();if(u=y(k),o=k.words,k=O.fetchPointerofObject(1,r),!O.isWords(k)||u!==y(k))return O.primitiveFail();l=k.words,L(0,0),b=0;for(;m>>7)])=o}function fe(){var e;return P===x||0==(4095&P)&&!(10*j<=P||(e=P-j)<=j)&&4*e<=j}function pe(e){return e=g[e],32767&(s<<5^e)}function de(e,t){var i,r,s=e[0]>>>24;if(16>>24&255))return O.primitiveFail(),0}return 0}function R(e){for(var t,i,r,s;m>>s,m-=e,t}!function e(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("ZipPlugin",{primitiveZipSendBlock:ce,primitiveUpdateAdler32:ue,primitiveUpdateGZipCrc32:le,primitiveDeflateUpdateHashTable:ae,setInterpreter:he,getModuleName:se,primitiveDeflateBlock:ne,primitiveInflateDecompressBlock:oe}):self.setTimeout(e,100)}()}();var LZString$1={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_f:String.fromCharCode,compressToBase64:function(e){if(null==e)return"";var t,i,r,s,n,a,o,u="",l=0;for(e=LZString$1.compress(e);l<2*e.length;)l%2==0?(t=e.charCodeAt(l/2)>>8,i=255&e.charCodeAt(l/2),r=l/2+1>8:NaN):(t=255&e.charCodeAt((l-1)/2),(l+1)/2>8,r=255&e.charCodeAt((l+1)/2)):i=r=NaN),l+=3,s=t>>2,n=(3&t)<<4|i>>4,a=(15&i)<<2|r>>6,o=63&r,isNaN(i)?a=o=64:isNaN(r)&&(o=64),u=u+LZString$1._keyStr.charAt(s)+LZString$1._keyStr.charAt(n)+LZString$1._keyStr.charAt(a)+LZString$1._keyStr.charAt(o);return u},decompressFromBase64:function(e){if(null==e)return"";var t,i,r,s,n,a,o="",u=0,l=0,c=LZString$1._f;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,r=(15&n)<<4|(n=LZString$1._keyStr.indexOf(e.charAt(l++)))>>2,s=(3&n)<<6|(a=LZString$1._keyStr.indexOf(e.charAt(l++))),u%2==0?(t=i<<8,64!=n&&(o+=c(t|r)),64!=a&&(t=s<<8)):(o+=c(t|i),64!=n&&(t=r<<8),64!=a&&(o+=c(t|s))),u+=3;return LZString$1.decompress(o)},compressToUTF16:function(e){if(null==e)return"";var t,i,r,s="",n=0,a=LZString$1._f;for(e=LZString$1.compress(e),t=0;t>1)),r=(1&i)<<14;break;case 1:s+=a(r+(i>>2)+32),r=(3&i)<<13;break;case 2:s+=a(r+(i>>3)+32),r=(7&i)<<12;break;case 3:s+=a(r+(i>>4)+32),r=(15&i)<<11;break;case 4:s+=a(r+(i>>5)+32),r=(31&i)<<10;break;case 5:s+=a(r+(i>>6)+32),r=(63&i)<<9;break;case 6:s+=a(r+(i>>7)+32),r=(127&i)<<8;break;case 7:s+=a(r+(i>>8)+32),r=(255&i)<<7;break;case 8:s+=a(r+(i>>9)+32),r=(511&i)<<6;break;case 9:s+=a(r+(i>>10)+32),r=(1023&i)<<5;break;case 10:s+=a(r+(i>>11)+32),r=(2047&i)<<4;break;case 11:s+=a(r+(i>>12)+32),r=(4095&i)<<3;break;case 12:s+=a(r+(i>>13)+32),r=(8191&i)<<2;break;case 13:s+=a(r+(i>>14)+32),r=(16383&i)<<1;break;case 14:s+=a(r+(i>>15)+32,32+(32767&i)),n=0}return s+a(r+32)},decompressFromUTF16:function(e){if(null==e)return"";for(var t,i,r="",s=0,n=0,a=LZString$1._f;n>14),t=(16383&i)<<2;break;case 2:r+=a(t|i>>13),t=(8191&i)<<3;break;case 3:r+=a(t|i>>12),t=(4095&i)<<4;break;case 4:r+=a(t|i>>11),t=(2047&i)<<5;break;case 5:r+=a(t|i>>10),t=(1023&i)<<6;break;case 6:r+=a(t|i>>9),t=(511&i)<<7;break;case 7:r+=a(t|i>>8),t=(255&i)<<8;break;case 8:r+=a(t|i>>7),t=(127&i)<<9;break;case 9:r+=a(t|i>>6),t=(63&i)<<10;break;case 10:r+=a(t|i>>5),t=(31&i)<<11;break;case 11:r+=a(t|i>>4),t=(15&i)<<12;break;case 12:r+=a(t|i>>3),t=(7&i)<<13;break;case 13:r+=a(t|i>>2),t=(3&i)<<14;break;case 14:r+=a(t|i>>1),t=(1&i)<<15;break;case 15:r+=a(t|i),s=0}n++}return LZString$1.decompress(r)},compress:function(e){if(null==e)return"";for(var t,i,r,s,n={},a={},o="",u=2,l=3,c=2,h="",f=0,p=0,d=LZString$1._f,m=0;m>=1}else{for(i=1,t=0;t>=1}0==--u&&(u=Math.pow(2,c),c++),delete a[o]}else for(i=n[o],t=0;t>=1;0==--u&&(u=Math.pow(2,c),c++),n[s]=l++,o=String(r)}if(""!==o){if(Object.prototype.hasOwnProperty.call(a,o)){if(o.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--u&&(u=Math.pow(2,c),c++),delete a[o]}else for(i=n[o],t=0;t>=1;0==--u&&(u=Math.pow(2,c),c++)}for(i=2,t=0;t>=1;for(;;){if(f<<=1,15==p){h+=d(f);break}p++}return h},decompress:function(e){if(null==e)return"";if(""==e)return null;for(var t,i,r,s,n,a,o=[],u=4,l=4,c=3,h="",f="",p=LZString$1._f,d={string:e,val:e.charCodeAt(0),position:32768,index:1},m=0;m<3;m+=1)o[m]=m;for(i=0,s=Math.pow(2,2),n=1;n!=s;)r=d.val&d.position,d.position>>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0d.string.length)return"";for(i=0,s=Math.pow(2,c),n=1;n!=s;)r=d.val&d.position,d.position>>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>=1,0==d.position&&(d.position=32768,d.val=d.string.charCodeAt(d.index++)),i|=(0>4,n=1>6:64,a=2>2)+p.charAt(s)+p.charAt(n)+p.charAt(a));return o.join("")},i.decode=function(e){var t,i,r,s,n,a,o,u=0,l=0,c=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;for(e.charAt(e.length-1)===p.charAt(64)&&c--,e.charAt(e.length-2)===p.charAt(64)&&c--,o=new(f.uint8array?Uint8Array:Array)(c);u>2,i=(3&n)<<6|(a=p.indexOf(e.charAt(u++))),o[l++]=r<<2|s>>4,64!==n&&(o[l++]=t),64!==a&&(o[l++]=i);return o}},{"./support":27,"./utils":29}],2:[function(e,t,i){var r=e("./external"),s=e("./stream/DataWorker"),n=e("./stream/DataLengthProbe"),a=e("./stream/Crc32Probe"),n=e("./stream/DataLengthProbe");function o(e,t,i,r,s){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=r,this.compressedContent=s}o.prototype={getContentWorker:function(){var e=new s(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new n("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new s(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,i){return e.pipe(new a).pipe(new n("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new n("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(e,t,i){var r=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(e,t,i){var d=e("./utils");var m=function(){for(var e=[],t=0;t<256;t++){for(var i=t,r=0;r<8;r++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t){if(void 0===e||!e.length)return 0;if("string"!==d.getTypeOf(e)){var i=0|t,r=e,s=e.length,n=0,a=m,o=n+s;i^=-1;for(var u=n;u>>8^a[255&(i^r[u])];return-1^i}var l=0|t,c=e,s=e.length,n=0,h=m,f=n+s;l^=-1;for(var p=n;p>>8^h[255&(l^c.charCodeAt(p))];return-1^l}},{"./utils":29}],5:[function(e,t,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,t,i){e=e("es6-promise").Promise;t.exports={Promise:e}},{"es6-promise":37}],7:[function(e,t,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=e("pako"),n=e("./utils"),a=e("./stream/GenericWorker"),o=r?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=new s[e]({raw:!0,level:t.level||-1}),this.meta={};var i=this;this._pako.onData=function(e){i.push({data:e,meta:i.meta})}}i.magic="\b\0",n.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,this._pako.push(n.transformTo(o,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},i.compressWorker=function(e){return new u("Deflate",e)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(e,t,i){function k(e,t){for(var i="",r=0;r>>=8;return i}function r(e,t,i,r,s,n){var a=e.file,o=e.compression,u=n!==y.utf8encode,l=b.transformTo("string",n(a.name)),c=b.transformTo("string",y.utf8encode(a.name)),h=a.comment,n=b.transformTo("string",n(h)),f=b.transformTo("string",y.utf8encode(h)),p=c.length!==a.name.length,h=f.length!==h.length,d="",m=a.dir,v=a.date,g={crc32:0,compressedSize:0,uncompressedSize:0},i=(t&&!i||(g.crc32=e.crc32,g.compressedSize=e.compressedSize,g.uncompressedSize=e.uncompressedSize),0),e=(t&&(i|=8),u||!p&&!h||(i|=2048),0),t=0,v=(m&&(e|=16),"UNIX"===s?(t=798,e|=(u=a.unixPermissions,s=m,(65535&(u?u:s?16893:33204))<<16)):(t=20,e|=63&(a.dosPermissions||0)),m=v.getUTCHours(),m<<=6,m=(m=(m|v.getUTCMinutes())<<5)|v.getUTCSeconds()/2,u=v.getUTCFullYear()-1980,u=(u=((u<<=4)|v.getUTCMonth()+1)<<5)|v.getUTCDate(),p&&(s=k(1,1)+k(S(l),4)+c,d+="up"+k(s.length,2)+s),h&&(a=k(1,1)+k(S(n),4)+f,d+="uc"+k(a.length,2)+a),""),v=(v=(v=(v=(v=(v=(v=(v=(v=(v+="\n\0")+k(i,2))+o.magic)+k(m,2))+k(u,2))+k(g.crc32,4))+k(g.compressedSize,4))+k(g.uncompressedSize,4))+k(l.length,2))+k(d.length,2);return{fileRecord:F.LOCAL_FILE_HEADER+v+l+d,dirRecord:F.CENTRAL_FILE_HEADER+k(t,2)+v+k(n.length,2)+"\0\0\0\0"+k(e,4)+k(r,4)+l+d+n}}var b=e("../utils"),s=e("../stream/GenericWorker"),y=e("../utf8"),S=e("../crc32"),F=e("../signature");function n(e,t,i,r){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}b.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-r-1))/i:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name,this.streamFiles&&!e.file.dir?(e=r(e,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t=r(e,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),this.streamFiles&&!e.file.dir)this.push({data:(e=e,F.DATA_DESCRIPTOR+k(e.crc32,4)+k(e.compressedSize,4)+k(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""}(e))&&n.call(this,s,!0),"string"===r&&!1===i.binary&&!1===i.base64);i.binary=!s;(t instanceof c&&0===t.uncompressedSize||i.dir||!t||0===t.length)&&(i.base64=!1,i.binary=!0,t="",i.compression="STORE");r=null,r=t instanceof c||t instanceof o?t:p.isNode&&p.isStream(t)?new d(e,t):a.prepareContent(e,t,i.binary,i.optimizedBinaryString,i.base64),s=new h(e,r,i);this.files[e]=s},v=function(e){return"/"!==e.slice(-1)&&(e+="/"),e};function g(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,i,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],i=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(i,r)},filter:function(i){var r=[];return this.forEach(function(e,t){i(e,t)&&r.push(t)}),r},file:function(e,t,i){var r,s;return 1===arguments.length?g(e)?(r=e,this.filter(function(e,t){return!t.dir&&r.test(e)})):(s=this.files[this.root+e])&&!s.dir?s:null:(e=this.root+e,m.call(this,e,t,i),this)},folder:function(i){var e,t;return i?g(i)?this.filter(function(e,t){return t.dir&&i.test(e)}):(e=this.root+i,e=n.call(this,e),(t=this.clone()).root=e.name,t):this},remove:function(i){i=this.root+i;var e=this.files[i];if(e||("/"!==i.slice(-1)&&(i+="/"),e=this.files[i]),e&&!e.dir)delete this.files[i];else for(var t=this.filter(function(e,t){return t.name.slice(0,i.length)===i}),r=0;r=this.index;t--)i=(i<<8)+this.byteAt(t);return this.index+=e,i},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=s},{"../utils":29}],16:[function(e,t,i){var r=e("./Uint8ArrayReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=s},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(e,t,i){var r=e("./DataReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},s.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},s.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},s.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=s},{"../utils":29,"./DataReader":15}],18:[function(e,t,i){var r=e("./ArrayReader");function s(e){r.call(this,e)}e("../utils").inherits(s,r),s.prototype.readData=function(e){var t;return this.checkOffset(e),0===e?new Uint8Array(0):(t=this.data.subarray(this.zero+this.index,this.zero+this.index+e),this.index+=e,t)},t.exports=s},{"../utils":29,"./ArrayReader":14}],19:[function(e,t,i){var r=e("../utils"),s=e("../support"),n=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||s.uint8array?"nodebuffer"===t?new o(e):s.uint8array?new u(r.transformTo("uint8array",e)):new n(r.transformTo("array",e)):new a(e)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(e,t,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],21:[function(e,t,i){var r=e("./GenericWorker"),s=e("../utils");function n(e){r.call(this,"ConvertWorker to "+e),this.destType=e}s.inherits(n,r),n.prototype.processChunk=function(e){this.push({data:s.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":29,"./GenericWorker":25}],22:[function(e,t,i){var r=e("./GenericWorker"),s=e("../crc32");function n(){r.call(this,"Crc32Probe")}e("../utils").inherits(n,r),n.prototype.processChunk=function(e){this.streamInfo.crc32=s(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(e,t,i){var r=e("../utils"),s=e("./GenericWorker");function n(e){s.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(n,s),n.prototype.processChunk=function(e){var t;e&&(t=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=t+e.data.length),s.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":29,"./GenericWorker":25}],24:[function(e,t,i){var r=e("../utils"),s=e("./GenericWorker");function n(e){s.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(n,s),n.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished)||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0)},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":29,"./GenericWorker":25}],25:[function(e,t,i){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i "+e:e}},t.exports=r},{}],26:[function(a,o,e){!function(u){var l=a("../utils"),s=a("./ConvertWorker"),n=a("./GenericWorker"),c=a("../base64"),t=a("../nodejs/NodejsStreamOutputAdapter"),i=a("../external");function r(e,o){return new i.Promise(function(t,i){var r=[],s=e._internalType,n=e._outputType,a=e._mimeType;e.on("data",function(e,t){r.push(e),o&&o(t)}).on("error",function(e){r=[],i(e)}).on("end",function(){try{var e=function(e,t,i){switch(e){case"blob":return l.newBlob(l.transformTo("arraybuffer",t),i);case"base64":return c.encode(t);default:return l.transformTo(e,t)}}(n,function(e,t){for(var i=0,r=null,s=0,n=0;n>>6:(i<65536?t[s++]=224|i>>>12:(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63),t[s++]=128|i>>>6&63),t[s++]=128|63&i);return t},s.utf8decode=function(e){if(l.nodebuffer)return u.transformTo("nodebuffer",e).toString("utf-8");for(var t,i,r=e=u.transformTo(l.uint8array?"uint8array":"array",e),s=r.length,n=new Array(2*s),a=0,o=0;o>10&1023,n[a++]=56320|1023&t)}return n.length!==a&&(n.subarray?n=n.subarray(0,a):n.length=a),u.applyFromCharCode(n)},u.inherits(n,i),n.prototype.processChunk=function(e){var t=u.transformTo(l.uint8array?"uint8array":"array",e.data),i=(this.leftOver&&this.leftOver.length&&(l.uint8array?(i=t,(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)):t=this.leftOver.concat(t),this.leftOver=null),function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+h[e[i]]>t?i:t}(t)),r=t;i!==t.length&&(l.uint8array?(r=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(r=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:s.utf8decode(r),meta:e.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=n,u.inherits(a,i),a.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=a},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(e,t,o){var u=e("./support"),l=e("./base64"),i=e("./nodejsUtils"),r=e("asap"),c=e("./external");function s(e){return e}function h(e,t){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){var t;this.extraFields[1]&&(t=r(this.extraFields[1].value),this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS)&&(this.diskNumberStart=t.readInt(4))},readExtraFields:function(e){var t,i,r,s=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index>>6:(i<65536?t[s++]=224|i>>>12:(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63),t[s++]=128|i>>>6&63),t[s++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new u.Buf8(e.length),i=0,r=t.length;i>10&1023,n[a++]=56320|1023&i)}return c(n,a)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+l[e[i]]>t?i:t}},{"./common":41}],43:[function(e,t,i){t.exports=function(e,t,i,r){for(var s=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,r){var s=o,n=r+i;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,N,t){var o,h=e("../utils/common"),u=e("./trees"),f=e("./adler32"),p=e("./crc32"),T=e("./messages"),l=0,c=4,d=0,m=-2,E=-1,L=4,R=2,v=8,D=9,i=286,W=30,z=19,U=2*i+1,K=15,g=3,k=258,b=k+g+1,y=42,S=113,F=1,O=2,I=3,w=4;function A(e,t){return e.msg=T[t],t}function C(e){return(e<<1)-(4e.avail_out?e.avail_out:i)&&(h.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending)&&(t.pending_out=0)}function x(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,_(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function j(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function n(e,t){var i,r,s=e.max_chain_length,n=e.strstart,a=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,l=e.window,c=e.w_mask,h=e.prev,f=e.strstart+k,p=l[n+a-1],d=l[n+a];e.prev_length>=e.good_match&&(s>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(i=t)+a]===d&&l[i+a-1]===p&&l[i]===l[n]&&l[++i]===l[n+1]){for(n+=2,i++;l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&nu&&0!=--s);return a<=e.lookahead?a:e.lookahead}function q(e){var t,i,r,s,n,a,o,u,l,c=e.w_size;do{if(u=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-b)){for(h.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=i=e.hash_size;r=e.head[--t],e.head[t]=c<=r?r-c:0,--i;);for(t=i=c;r=e.prev[--t],e.prev[t]=c<=r?r-c:0,--i;);u+=c}if(0===e.strm.avail_in)break;if(n=e.strm,a=e.window,o=e.strstart+e.lookahead,u=u,l=void 0,l=n.avail_in,i=0===(l=u=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(r=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(s=e.strstart+e.lookahead-g,r=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=s&&(e.ins_h=(e.ins_h<>1,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=n,o.method=i,M(e)}o=[new a(0,0,0,0,function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===l)return F;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,x(e,!1),0===e.strm.avail_out))return F;if(e.strstart-e.block_start>=e.w_size-b&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),F)}),new a(4,4,8,4,r),new a(4,5,16,8,r),new a(4,6,32,32,r),new a(4,4,16,16,s),new a(8,16,32,32,s),new a(8,16,128,128,s),new a(8,32,128,256,s),new a(32,128,258,1024,s),new a(32,258,258,4096,s)],t.deflateInit=function(e,t){return G(e,t,v,15,8,0)},t.deflateInit2=G,t.deflateReset=M,t.deflateResetKeep=B,t.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?m:(e.state.gzhead=t,d)},t.deflate=function(e,t){var i,r,s,n;if(!e||!e.state||5>8&255),V(r,r.gzhead.time>>16&255),V(r,r.gzhead.time>>24&255),V(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),V(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(V(r,255&r.gzhead.extra.length),V(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=p(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(V(r,0),V(r,0),V(r,0),V(r,0),V(r,0),V(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),V(r,3),r.status=S)):(a=v+(r.w_bits-8<<4)<<8,a|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=S,j(r,a),0!==r.strstart&&(j(r,e.adler>>>16),j(r,65535&e.adler)),e.adler=1)),69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending!==r.pending_buf_size));)V(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending===r.pending_buf_size)){n=1;break}}while(n=r.gzindexs&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),_(e),s=r.pending,r.pending===r.pending_buf_size)){n=1;break}}while(n=r.gzindexs&&(e.adler=p(e.adler,r.pending_buf,r.pending-s,s)),0===n&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&_(e),r.pending+2<=r.pending_buf_size&&(V(r,255&e.adler),V(r,e.adler>>8&255),e.adler=0,r.status=S)):r.status=S),0!==r.pending){if(_(e),0===e.avail_out)return r.last_flush=-1,d}else if(0===e.avail_in&&C(t)<=C(i)&&t!==c)return A(e,-5);if(666===r.status&&0!==e.avail_in)return A(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==l&&666!==r.status){var a=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===l)return F;break}if(e.match_length=0,i=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?F:O}(r,t):3===r.strategy?function(e,t){for(var i,r,s,n,a=e.window;;){if(e.lookahead<=k){if(q(e),e.lookahead<=k&&t===l)return F;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(i=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(x(e,!1),0===e.strm.avail_out))return F}return e.insert=0,t===c?(x(e,!0),0===e.strm.avail_out?I:w):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?F:O}(r,t):o[r.level].func(r,t);if(a!==I&&a!==w||(r.status=666),a===F||a===I)return 0===e.avail_out&&(r.last_flush=-1),d;if(a===O&&(1===t?u._tr_align(r):5!==t&&(u._tr_stored_block(r,0,0,!1),3===t)&&(P(r.head),0===r.lookahead)&&(r.strstart=0,r.block_start=0,r.insert=0),_(e),0===e.avail_out))return r.last_flush=-1,d}return t!==c||!(r.wrap<=0)&&(2===r.wrap?(V(r,255&e.adler),V(r,e.adler>>8&255),V(r,e.adler>>16&255),V(r,e.adler>>24&255),V(r,255&e.total_in),V(r,e.total_in>>8&255),V(r,e.total_in>>16&255),V(r,e.total_in>>24&255)):(j(r,e.adler>>>16),j(r,65535&e.adler)),_(e),0=i.w_size&&(0===n&&(P(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new h.Buf8(i.w_size),h.arraySet(u,t,l-i.w_size,i.w_size,0),t=u,l=i.w_size),u=e.avail_in,a=e.next_in,o=e.input,e.avail_in=l,e.next_in=0,e.input=t,q(i);i.lookahead>=g;){for(r=i.strstart,s=i.lookahead-(g-1);i.ins_h=(i.ins_h<>>=r=i>>>24,F-=r,0===(r=i>>>16&255))p[f++]=65535&i;else{if(!(16&r)){if(0==(64&r)){i=O[(65535&i)+(S&(1<>>=r,F-=r),F<15&&(S+=c[l++]<>>=r=i>>>24,F-=r,!(16&(r=i>>>16&255))){if(0==(64&r)){i=I[(65535&i)+(S&(1<>>=r,F-=r,(r=f-d)>3)<<3))-1,e.next_in=l-=s,e.next_out=f,e.avail_in=l>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new V.Buf16(320),this.work=new V.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=R,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new V.Buf32(r),t.distcode=t.distdyn=new V.Buf32(s),t.sane=1,t.back=-1,E):L}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):L}function u(e,t){var i,r;return!e||!e.state||(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(V.arraySet(e.window,t,i-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(r<(s=e.wsize-e.wnext)&&(s=r),V.arraySet(e.window,t,i-r,s,e.wnext),(r-=s)?(V.arraySet(e.window,t,i-r,r,0),e.wnext=r,e.whave=e.wsize):(e.wnext+=s,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,i.check=q(i.check,C,2,0),c=l=0,i.mode=2;else if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31)e.msg="incorrect header check",i.mode=30;else if(8!=(15&l))e.msg="unknown compression method",i.mode=30;else{if(c-=4,F=8+(15&(l>>>=4)),0===i.wbits)i.wbits=F;else if(F>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(C[0]=255&l,C[1]=l>>>8&255,i.check=q(i.check,C,2,0)),c=l=0,i.mode=3;case 3:for(;c<32;){if(0===o)break e;o--,l+=r[n++]<>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,i.check=q(i.check,C,4,0)),c=l=0,i.mode=4;case 4:for(;c<16;){if(0===o)break e;o--,l+=r[n++]<>8),512&i.flags&&(C[0]=255&l,C[1]=l>>>8&255,i.check=q(i.check,C,2,0)),c=l=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===o)break e;o--,l+=r[n++]<>>8&255,i.check=q(i.check,C,2,0)),c=l=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((p=o<(p=i.length)?o:p)&&(i.head&&(F=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),V.arraySet(i.head.extra,r,n,p,F)),512&i.flags&&(i.check=q(i.check,r,p,n)),o-=p,n+=p,i.length-=p),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===o)break e;for(p=0;F=r[n+p++],i.head&&F&&i.length<65536&&(i.head.name+=String.fromCharCode(F)),F&&p>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===o)break e;o--,l+=r[n++]<>>=7&c,c-=7&c,i.mode=27;else{for(;c<3;){if(0===o)break e;o--,l+=r[n++]<>>=1)){case 0:i.mode=14;break;case 1:_=x=void 0;var _,x=i;if(U){for(W=new V.Buf32(512),z=new V.Buf32(32),_=0;_<144;)x.lens[_++]=8;for(;_<256;)x.lens[_++]=9;for(;_<280;)x.lens[_++]=7;for(;_<288;)x.lens[_++]=8;for(M(N,x.lens,0,288,W,0,x.work,{bits:9}),_=0;_<32;)x.lens[_++]=5;M(T,x.lens,0,32,z,0,x.work,{bits:5}),U=!1}if(x.lencode=W,x.lenbits=9,x.distcode=z,x.distbits=5,i.mode=20,6!==t)break;l>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}l>>>=2,c-=2}break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,l+=r[n++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&l,c=l=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(p=i.length){if(0===(p=u<(p=o>>=5,c-=5,i.ndist=1+(31&l),l>>>=5,c-=5,i.ncode=4+(15&l),l>>>=4,c-=4,286>>=3,c-=3}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,I={bits:i.lenbits},O=M(0,i.lens,0,19,i.lencode,0,i.work,I),i.lenbits=I.bits,O){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=v,c-=v,i.lens[i.have++]=k;else{if(16===k){for(w=v+2;c>>=v,c-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}F=i.lens[i.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===k){for(w=v+3;c>>=v)),l>>>=3,c=c-v-3}else{for(w=v+7;c>>=v)),l>>>=7,c=c-v-7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;p--;)i.lens[i.have++]=F}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,I={bits:i.lenbits},O=M(N,i.lens,0,i.nlen,i.lencode,0,i.work,I),i.lenbits=I.bits,O){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,I={bits:i.distbits},O=M(T,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,I),i.distbits=I.bits,O){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=o&&258<=u){e.next_out=a,e.avail_out=u,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=c,B(e,f),a=e.next_out,s=e.output,u=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;g=(A=i.lencode[l&(1<>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>b)])>>>16&255,k=65535&A,!(b+(v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=b,c-=b,i.back+=b}if(l>>>=v,c-=v,i.back+=v,i.length=k,0===g){i.mode=26;break}if(32&g){i.back=-1,i.mode=12;break}if(64&g){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&g,i.mode=22;case 22:if(i.extra){for(w=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;g=(A=i.distcode[l&(1<>>16&255,k=65535&A,!((v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>b)])>>>16&255,k=65535&A,!(b+(v=A>>>24)<=c);){if(0===o)break e;o--,l+=r[n++]<>>=b,c-=b,i.back+=b}if(l>>>=v,c-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=30;break}i.offset=k,i.extra=15&g,i.mode=24;case 24:if(i.extra){for(w=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===u)break e;if(i.offset>(p=f-u)){if((p=i.offset-p)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}d=p>i.wnext?(p-=i.wnext,i.wsize-p):i.wnext-p,p>i.length&&(p=i.length),m=i.window}else m=s,d=a-i.offset,p=i.length;for(u-=p=up?(m=j[q+a[b]],P[_+a[b]]):(m=96,0),u=1<<(d=k-I),y=l=1<>I)+(l-=u)]=d<<24|m<<16|v|0,0!==l;);for(u=1<>=1;if(C=0!==u?(C&u-1)+u:0,b++,0==--x[k]){if(k===S)break;k=t[i+a[b]]}if(F>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function M(e,t,i){e.bi_valid>r-i?(e.bi_buf|=t<>r-e.bi_valid,e.bi_valid+=i-r):(e.bi_buf|=t<>>=1,i<<=1,0<--t;);return i>>>1}function W(e,t,i){for(var r,s=new Array(A+1),n=0,a=1;a<=A;a++)s[a]=n=n+i[a-1]<<1;for(r=0;r<=t;r++){var o=e[2*r+1];0!==o&&(e[2*r]=D(s[o]++,o))}}function z(e){for(var t=0;t>1;1<=i;i--)T(e,n,i);for(s=u;i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,n,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,n[2*s]=n[2*i]+n[2*r],e.depth[s]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,n[2*i+1]=n[2*r+1]=s,e.heap[1]=s++,T(e,n,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,h,f,p,d,m=e,v=t.dyn_tree,g=t.max_code,k=t.stat_desc.static_tree,b=t.stat_desc.has_stree,y=t.stat_desc.extra_bits,S=t.stat_desc.extra_base,F=t.stat_desc.max_length,O=0,I=0;I<=A;I++)m.bl_count[I]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c>=7;a>>=1)if(1&t&&0!==e.dyn_ltree[2*i])return c;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(i=32;i>>3,(n=e.static_len+3+7>>>3)<=s&&(s=n)):s=n=i+5,i+4<=s&&-1!==t)J(e,t,i,r);else if(4===e.strategy||n===s)M(e,2+(r?1:0),3),H(e,I,C);else{M(e,4+(r?1:0),3);var o,u=e,t=e.l_desc.max_code+1,i=e.d_desc.max_code+1,l=a+1;for(M(u,t-257,5),M(u,i-1,5),M(u,l-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(_[i]+p+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},e._tr_align=function(e){M(e,2,3),N(e,g,I),16===(e=e).bi_valid?(s(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,i){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[10])(10)}),!function(o){var u,l,c,h,f,p,d,t,m,v,r,e;void 0===o||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)||(e=o.document,u=function(){return o.URL||o.webkitURL||o},l=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in l,h=/constructor/i.test(o.HTMLElement)||o.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),p=o.setImmediate||o.setTimeout,d=function(e){p(function(){throw e},0)},t=4e4,m=function(e){setTimeout(function(){"string"==typeof e?u().revokeObjectURL(e):e.remove()},t)},v=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},e=(r=function(e,i,t){t||(e=v(e));var r,s,n=this,t="application/octet-stream"===e.type,a=function(){for(var e=n,t="writestart progress write writeend".split(" "),i=void 0,r=(t=[].concat(t)).length;r--;){var s=e["on"+t[r]];if("function"==typeof s)try{s.call(e,i||e)}catch(e){d(e)}}};n.readyState=n.INIT,c?(r=u().createObjectURL(e),p(function(){var e,t;l.href=r,l.download=i,e=l,t=new MouseEvent("click"),e.dispatchEvent(t),a(),m(r),n.readyState=n.DONE},0)):(f||t&&h)&&o.FileReader?((s=new FileReader).onloadend=function(){var e=f?s.result:s.result.replace(/^data:[^;]*;/,"data:attachment/file;");o.open(e,"_blank")||(o.location.href=e),n.readyState=n.DONE,a()},s.readAsDataURL(e),n.readyState=n.INIT):(r=r||u().createObjectURL(e),!t&&o.open(r,"_blank")||(o.location.href=r),n.readyState=n.DONE,a(),m(r))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob)||(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,o.FileSaver_saveAs=function(e,t,i){return new r(e,t||e.name||"download",i)})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0),!function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node,COMMON_JS=(NODE_JS&&(root=global),!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports),AMD="function"==typeof define&&define.amd,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");(t=NODE_JS?nodeWrap(t):t).create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=e[s]<>2]|=t<>2]|=(192|t>>6)<>2]|=(224|t>>12)<>2]|=(240|t>>18)<>2]|=(128|t>>12&63)<>2]|=(128|t>>6&63)<>2]|=(128|63&t)<>2]|=EXTRA[3&t],this.block=e[16],56<=t&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash())},Sha1.prototype.hash=function(){for(var e,t=this.h0,i=this.h1,r=this.h2,s=this.h3,n=this.h4,a=this.blocks,o=16;o<80;++o)e=a[o-3]^a[o-8]^a[o-14]^a[o-16],a[o]=e<<1|e>>>31;for(o=0;o<20;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i&r|~i&s)+n+1518500249+a[o]<<0)<<5|n>>>27)+(t&(i=i<<30|i>>>2)|~t&r)+s+1518500249+a[o+1]<<0)<<5|s>>>27)+(n&(t=t<<30|t>>>2)|~n&i)+r+1518500249+a[o+2]<<0)<<5|r>>>27)+(s&(n=n<<30|n>>>2)|~s&t)+i+1518500249+a[o+3]<<0)<<5|i>>>27)+(r&(s=s<<30|s>>>2)|~r&n)+t+1518500249+a[o+4]<<0,r=r<<30|r>>>2;for(;o<40;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i^r^s)+n+1859775393+a[o]<<0)<<5|n>>>27)+(t^(i=i<<30|i>>>2)^r)+s+1859775393+a[o+1]<<0)<<5|s>>>27)+(n^(t=t<<30|t>>>2)^i)+r+1859775393+a[o+2]<<0)<<5|r>>>27)+(s^(n=n<<30|n>>>2)^t)+i+1859775393+a[o+3]<<0)<<5|i>>>27)+(r^(s=s<<30|s>>>2)^n)+t+1859775393+a[o+4]<<0,r=r<<30|r>>>2;for(;o<60;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i&r|i&s|r&s)+n-1894007588+a[o]<<0)<<5|n>>>27)+(t&(i=i<<30|i>>>2)|t&r|i&r)+s-1894007588+a[o+1]<<0)<<5|s>>>27)+(n&(t=t<<30|t>>>2)|n&i|t&i)+r-1894007588+a[o+2]<<0)<<5|r>>>27)+(s&(n=n<<30|n>>>2)|s&t|n&t)+i-1894007588+a[o+3]<<0)<<5|i>>>27)+(r&(s=s<<30|s>>>2)|r&n|s&n)+t-1894007588+a[o+4]<<0,r=r<<30|r>>>2;for(;o<80;o+=5)t=(e=(i=(e=(r=(e=(s=(e=(n=(e=t<<5|t>>>27)+(i^r^s)+n-899497514+a[o]<<0)<<5|n>>>27)+(t^(i=i<<30|i>>>2)^r)+s-899497514+a[o+1]<<0)<<5|s>>>27)+(n^(t=t<<30|t>>>2)^i)+r-899497514+a[o+2]<<0)<<5|r>>>27)+(s^(n=n<<30|n>>>2)^t)+i-899497514+a[o+3]<<0)<<5|i>>>27)+(r^(s=s<<30|s>>>2)^n)+t-899497514+a[o+4]<<0,r=r<<30|r>>>2;this.h0=this.h0+t<<0,this.h1=this.h1+i<<0,this.h2=this.h2+r<<0,this.h3=this.h3+s<<0,this.h4=this.h4+n<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&define(function(){return exports}))}(),Object.extend(Squeak,{vmPath:"/",platformSubtype:"Browser",osVersion:navigator.userAgent,windowSystem:"HTML"}),window.SqueakJS={};var canUseMouseOffset=navigator.userAgent.match("AppleWebKit/");function updateMousePos(e,t,i){var r=canUseMouseOffset?e.offsetX:e.layerX,e=canUseMouseOffset?e.offsetY:e.layerY,r=(i.cursorCanvas&&(i.cursorCanvas.style.left=r+t.offsetLeft+i.cursorOffsetX+"px",i.cursorCanvas.style.top=e+t.offsetTop+i.cursorOffsetY+"px"),r*t.width/t.offsetWidth|0),e=e*t.height/t.offsetHeight|0;i.mouseX=Math.max(0,Math.min(i.width,r)),i.mouseY=Math.max(0,Math.min(i.height,e))}function recordMouseEvent(e,t,i,r,s){if(updateMousePos(t,i,r),r.vm){var n=r.buttons&Squeak.Mouse_All;switch(e){case"mousedown":switch(t.button||0){case 0:n=Squeak.Mouse_Red;break;case 1:n=Squeak.Mouse_Yellow;break;case 2:n=Squeak.Mouse_Blue}n===Squeak.Mouse_Red&&(t.altKey||t.metaKey)&&(n=Squeak.Mouse_Yellow),s.swapButtons&&(n==Squeak.Mouse_Yellow?n=Squeak.Mouse_Blue:n==Squeak.Mouse_Blue&&(n=Squeak.Mouse_Yellow));break;case"mousemove":break;case"mouseup":n=0}r.buttons=n|recordModifiers(t,r),r.eventQueue&&(r.eventQueue.push([Squeak.EventTypeMouse,t.timeStamp,r.mouseX,r.mouseY,r.buttons&Squeak.Mouse_All,r.buttons>>3]),r.signalInputEvent)&&r.signalInputEvent(),r.idle=0,"mouseup"==e?r.runFor&&r.runFor(100):r.runNow&&r.runNow()}}for(var MacRomanToUnicode=[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],UnicodeToMacRoman={},i=0;i>3<<8|r,i.eventQueue?(i.eventQueue.push([Squeak.EventTypeKeyboard,t,r,Squeak.EventKeyChar,i.buttons>>3,e]),i.signalInputEvent&&i.signalInputEvent(),i.keys[0]=s):s===i.vm.interruptKeycode?i.vm.interruptPending=!0:i.keys.push(s),i.idle=0,i.runNow)&&i.runNow()}function recordDragDropEvent(e,t,i,r){r.vm&&r.eventQueue&&(updateMousePos(t,i,r),r.eventQueue.push([Squeak.EventTypeDragDropFiles,t.timeStamp,e,r.mouseX,r.mouseY,r.buttons>>3,r.droppedFiles.length]),r.signalInputEvent)&&r.signalInputEvent()}function fakeCmdOrCtrlKey(e,t,i){i.buttons&=~Squeak.Keyboard_All,i.buttons|=Squeak.Keyboard_Cmd|Squeak.Keyboard_Ctrl,i.keys=[],recordKeyboardEvent(e,t,i)}function makeSqueakEvent(e,t,i){t[0]=e[0],t[1]=e[1]-i&Squeak.MillisecondClockMask;for(var r=2;rl.width&&(i.font="bold 24px sans-serif"),i.textAlign="center",i.textBaseline="middle",i.fillText(e,l.width/2,l.height/2)},h.showProgress=function(e,t){var i=h.context,r=l.width/3|0,s=.5*l.width-r/2,n=.5*l.height+48;i.fillStyle=(t=t||{}).background||"#000",i.fillRect(s,n,r,24),i.lineWidth=2,i.strokeStyle=t.color||"#F90",i.strokeRect(s,n,r,24),i.fillStyle=t.color||"#F90",i.fillRect(s,n,r*e,24)},h.executeClipboardPaste=function(e,t){if(!h.vm)return!0;try{h.clipboardString=e,fakeCmdOrCtrlKey("v".charCodeAt(0),t,h)}catch(e){console.error("paste error "+e)}},h.executeClipboardCopy=function(e,t){if(!h.vm)return!0;h.clipboardStringChanged=!1,fakeCmdOrCtrlKey((e||"c").charCodeAt(0),t,h);for(var i=Date.now();!h.clipboardStringChanged&&Date.now()-i<500;)h.vm.interpret(20);if(h.clipboardStringChanged)try{return h.clipboardString}catch(e){console.error("copy error "+e)}},l.onmousedown=function(e){return o(),recordMouseEvent("mousedown",e,l,h,c),e.preventDefault(),!1},l.onmouseup=function(e){recordMouseEvent("mouseup",e,l,h,c),o(),e.preventDefault()},l.onmousemove=function(e){recordMouseEvent("mousemove",e,l,h,c),e.preventDefault()},l.oncontextmenu=function(){return!1},{state:"idle",button:0,x:0,y:0,dist:0,down:{}});function u(e){if(e.touches.length)for(var t=f.x=f.y=0;t',e.setAttribute("style","position:fixed;right:0;bottom:0;background-color:rgba(128,128,128,0.5);border-radius:5px"),l.parentElement.appendChild(e),e.onmousedown=function(e){l.contentEditable=!0,l.setAttribute("autocomplete","off"),l.setAttribute("autocorrect","off"),l.setAttribute("autocapitalize","off"),l.setAttribute("spellcheck","off"),l.focus(),e.preventDefault()},e.ontouchstart=e.onmousedown),document.ondragover=function(e){e.preventDefault(),t(e)?(e.dataTransfer.dropEffect="copy",recordDragDropEvent(Squeak.EventDragMove,e,l,h)):e.dataTransfer.dropEffect="none"},document.ondragenter=function(e){t(e)&&recordDragDropEvent(Squeak.EventDragEnter,e,l,h)},document.ondragleave=function(e){t(e)&&recordDragDropEvent(Squeak.EventDragLeave,e,l,h)},document.ondrop=function(r){var s,n,a,o;return r.preventDefault(),t(r)&&(s=[].slice.call(r.dataTransfer.files),n=[],o=null,h.droppedFiles=[],s.forEach(function(t){var i=c.root+t.name,e=(h.droppedFiles.push(i),new FileReader);e.onload=function(){var e=this.result;Squeak.filePut(i,e),n.push(i),a||!/.*image$/.test(i)||h.vm&&!confirm("Run "+t.name+" now?\n(cancel to use as file)")||(a=e,o=i),n.length==s.length&&(a?h.vm?(h.quitFlag=!0,c.onQuit=function(e,t,i){i.onQuit=null,SqueakJS.appName=o.replace(/.*\//,"").replace(/\.image$/,""),SqueakJS.runImage(a,o,t,i)}):(SqueakJS.appName=o.replace(/.*\//,"").replace(/\.image$/,""),SqueakJS.runImage(a,o,h,c)):recordDragDropEvent(Squeak.EventDragDrop,r,l,h))},e.readAsArrayBuffer(t)})),!1},m(),window.onresize=m,h}function setupSpinner(t,e){e=e.spinner;return e?(e.onmousedown=function(e){confirm(SqueakJS.appName+" is busy. Interrupt?")&&(t.interruptPending=!0)},e.style):null}var spinnerAngle=0,becameBusy=0,loop;function updateSpinner(e,t,i,r){r=i.lastTick-r.lastTick<500;!(0===t)||r?(e.display="none",becameBusy=0):0===becameBusy?becameBusy=i.lastTick:1e3