"use strict";window.module=function(t){if(""===t)return window;var i=t.split("."),r=i.pop(),s=module(i.join(".")),e=s[r];return e||(s[r]=e={loaded:!1,pending:[],requires:function(t){return{toRun:function(r){function i(){r(),e.loaded=!0,e.pending.forEach(function(e){e()})}t&&!module(t).loaded?module(t).pending.push(i):i()}}}}),e},Object.extend=function(i){for(var e=1;e>3]),e.signalInputEvent&&e.signalInputEvent()),e.idle=0,"mouseup"==r?e.runFor&&e.runFor(100):e.runNow&&e.runNow()}}function r(t,s,e,i){if(e.vm){var r=e.buttons>>3<<8|t;r===e.vm.interruptKeycode?e.vm.interruptPending=!0:i?(i.push([Squeak.EventTypeKeyboard,s,t,Squeak.EventKeyChar,e.buttons>>3,t]),e.signalInputEvent&&e.signalInputEvent()):e.keys.push(r),e.idle=0,e.runNow&&e.runNow()}}function s(r,t,s,e,i){e.vm&&i&&(l(t,s,e),i.push([Squeak.EventTypeDragDropFiles,t.timeStamp,r,e.mouseX,e.mouseY,e.buttons>>3,e.droppedFiles.length]),e.signalInputEvent&&e.signalInputEvent())}function f(t,i,e,s){e.buttons&=~Squeak.Keyboard_All,e.buttons|=Squeak.Keyboard_Cmd|Squeak.Keyboard_Ctrl,e.keys=[],r(t,i,e,s)}function d(e,i,r){i[0]=e[0],i[1]=e[1]-r&Squeak.MillisecondClockMask;for(var t=2;t=3?(a.classList.add("pixelated"),t.cursorCanvas.classList.add("pixelated")):(a.classList.remove("pixelated"),t.cursorCanvas.classList.remove("pixelated")))}function F(e){i.dist=m(e.touches[0],e.touches[1]),i.down.x=i.x,i.down.y=i.y,i.down.dist=i.dist,i.down.left=a.offsetLeft,i.down.top=a.offsetTop,i.down.width=a.offsetWidth,i.down.height=a.offsetHeight,i.orig||(i.orig={left:i.down.left,top:i.down.top,right:i.down.left+i.down.width,bottom:i.down.top+i.down.height,width:i.down.width,height:i.down.height})}function S(e){if(!(e.touches.length<2)){i.dist=m(e.touches[0],e.touches[1]);var a=i.orig.width/i.down.width,u=i.dist/i.down.dist,t=Math.min(Math.max(u,.95*a),a*g),r=i.down.width*t,o=i.orig.height*r/i.orig.width,s=i.down.left-(i.down.x-i.down.left)*(t-1)+(i.x-i.down.x),n=i.down.top-(i.down.y-i.down.top)*(t-1)+(i.y-i.down.y);s=Math.max(Math.min(s,i.orig.left+20),i.orig.right-r-20),n=Math.max(Math.min(n,i.orig.top+20),i.orig.bottom-o-20),b(s,n,r,o)}}function y(){var t=a.offsetLeft,r=a.offsetTop,e=a.offsetWidth,s=a.offsetHeight;e=Math.min(Math.max(e,i.orig.width),i.orig.width*g),s=i.orig.height*e/i.orig.width,t=Math.max(Math.min(t,i.orig.left),i.orig.right-e),r=Math.max(Math.min(r,i.orig.top),i.orig.bottom-s),b(t,r,e,s)}function h(t){for(var e=0;e10||k(i.down.x,i.down.y,i.x,i.y)>10;s?i.state="zooming":(i.state="mousing",i.button=r.button=2,e("mousemove",r,a,t,u,o),e("mousedown",r,a,t,u,o))}},200)}},a.ontouchmove=function(r){r.preventDefault();var s=p(r);switch(i.state){case"got1stFinger":i.state="mousing",i.button=s.button=0,e("mousemove",s,a,t,u,o),e("mousedown",s,a,t,u,o);break;case"mousing":return void e("mousemove",s,a,t,u,o);case"got2ndFinger":return void(r.touches.length>1&&(i.dist=m(r.touches[0],r.touches[1])));case"zooming":return void S(r)}},a.ontouchend=function(s){s.preventDefault(),l();for(var r=p(s),n=0;n0)break;return i.state="idle",void e("mouseup",r,a,t,u,o);case"got1stFinger":return i.state="idle",i.button=r.button=0,e("mousemove",r,a,t,u,o),e("mousedown",r,a,t,u,o),void e("mouseup",r,a,t,u,o);case"got2ndFinger":i.state="mousing",i.button=r.button=2,e("mousemove",r,a,t,u,o),e("mousedown",r,a,t,u,o);break;case"zooming":if(s.touches.length>0)break;return i.state="idle",void y(s)}},a.ontouchcancel=function(e){a.ontouchend(e)},t.cursorCanvas.style.display="block",t.cursorCanvas.style.position="absolute",t.cursorCanvas.style.cursor="none",t.cursorCanvas.style.background="transparent",t.cursorCanvas.style.pointerEvents="none",a.parentElement.appendChild(t.cursorCanvas),a.style.cursor="none",document.onkeypress=function(e){return t.vm?/[CXVR]/.test(String.fromCharCode(e.charCode+64))?!0:(n(e,t),r(e.charCode,e.timeStamp,t,u),void e.preventDefault()):!0},document.onkeydown=function(e){if(l(),!t.vm)return!0;n(e,t);var s={8:8,9:9,13:13,27:27,33:11,34:12,35:4,36:1,37:28,38:30,39:29,40:31,45:5,46:127}[e.keyCode];if(s)return r(s,e.timeStamp,t,u),e.preventDefault();if(e.metaKey||e.altKey&&!e.ctrlKey){var i=e.key;if(!i&&e.keyIdentifier&&"U+"==e.keyIdentifier.slice(0,2)&&(i=String.fromCharCode(parseInt(e.keyIdentifier.slice(2),16))),i&&1==i.length){if(/[CXVR]/i.test(i))return!0;var a=i.charCodeAt(0);return/[A-Z]/.test(i)&&!e.shiftKey&&(a+=32),r(a,e.timeStamp,t,u),e.preventDefault()}}},document.onkeyup=function(e){return t.vm?void n(e,t):!0},document.oncopy=function(e,r){var i=t.executeClipboardCopy(r,e.timeStamp);"string"==typeof i&&e.clipboardData.setData("Text",i),e.preventDefault()},document.oncut=function(e){return t.vm?void document.oncopy(e,"x"):!0},document.onpaste=function(e){var i=e.clipboardData.getData("Text");t.executeClipboardPaste(i,e.timeStamp),e.preventDefault()},document.ondragover=function(e){e.preventDefault(),h(e)?(e.dataTransfer.dropEffect="copy",s(Squeak.EventDragMove,e,a,t,u)):e.dataTransfer.dropEffect="none"},document.ondragenter=function(e){h(e)&&s(Squeak.EventDragEnter,e,a,t,u)},document.ondragleave=function(e){h(e)&&s(Squeak.EventDragLeave,e,a,t,u)},document.ondrop=function(e){if(e.preventDefault(),!h(e))return!1;var i,n=[].slice.call(e.dataTransfer.files),l=[],r=null;return t.droppedFiles=[],n.forEach(function(c){t.droppedFiles.push(c.name);var f=new FileReader;f.onload=function(){var f=this.result;Squeak.filePut(c.name,f),l.push(c.name),i||!/.*image$/.test(c.name)||t.vm&&!confirm("Run "+c.name+" now?\n(cancel to use as file)")||(i=f,r=c.name),l.length==n.length&&(i?(SqueakJS.appName=r.slice(0,-6),SqueakJS.runImage(i,r,t,o)):s(Squeak.EventDragDrop,e,a,t,u))},f.readAsArrayBuffer(c)}),!1},window.onresize=function(){if(!i.orig){var g=window.innerWidth,v=window.innerHeight;if(setTimeout(function(){g==window.innerWidth&&v==window.innerHeight&&t.resizeDone()},300),!(o.header&&o.footer||o.fullscreen))return t.width=a.width,void(t.height=a.height);var p=o.fullscreen||t.fullscreen,k=0,h=p?0:o.header.offsetTop+o.header.offsetHeight,e=window.innerWidth,r=p?window.innerHeight:Math.max(100,o.footer.offsetTop-h),n=0,u=0;if(o.fixedWidth){t.width=o.fixedWidth,t.height=o.fixedHeight;var l=t.width/t.height,d=e/r;d>l?n=e-Math.floor(r*l):u=r-Math.floor(e/l)}else t.width=e,t.height=r;if(a.style.left=k+Math.floor(n/2)+"px",a.style.top=h+Math.floor(u/2)+"px",a.style.width=e-n+"px",a.style.height=r-u+"px",a.width!=t.width||a.height!=t.height){var m=o.fixedWidth||!t.resizeTodo,f=m&&t.context.getImageData(0,0,a.width,a.height);a.width=t.width,a.height=t.height,f&&t.context.putImageData(f,0,0)}if(o.fixedWidth){var s=t.cursorCanvas,c=a.offsetWidth/a.width;s.style.width=s.width*c+"px",s.style.height=s.height*c+"px"}}},window.onresize(),t}function g(t,i){var e=i.spinner;return e?(e.onmousedown=function(){confirm(SqueakJS.appName+" is busy. Interrupt?")&&(t.interruptPending=!0)},e.style):null}function k(e,r,t,s){var n=0===r,o=t.lastTick-s.lastTick<500;!n||o?(e.display="none",i=0):0===i?i=t.lastTick:t.lastTick-i>1e3&&(e.display="block",a=(a+30)%360,e.webkitTransform=e.transform="rotate("+a+"deg)")}function h(e){var a=window.location.hash.slice(1),r=a&&a.split("&");if(r)for(var s=0;s1&&(t=decodeURIComponent(n.slice(1).join("=")),t.match(/^(true|false|null|[0-9"[{].*)$/)))try{t=JSON.parse(t)}catch(u){"["===t[0]&&(t=t.slice(1,-1).split(","))}e[o]=t}var i=Squeak.splitFilePath(e.root||"/").fullname;Squeak.dirCreate(i,!0),/\/$/.test(i)||(i+="/"),e.root=i,e.url&&e.files&&!e.image&&(e.image=e.url+"/"+e.files[0])}function p(e){if(e.templates){if(e.templates.constructor===Array){var i={};e.templates.forEach(function(e){i[e]=e}),e.templates=i}for(var t in e.templates)Squeak.fetchTemplateDir("/"==t[0]?t:e.root+t,e.templates[t])}}var t=window.localStorage;try{if(t["squeak-foo:"]="bar","bar"!==t["squeak-foo:"])throw Error();delete t["squeak-foo:"]}catch(b){t={}}var o,u=navigator.userAgent.match("AppleWebKit/"),a=0,i=0;SqueakJS.runImage=function(s,r,e,i){window.onbeforeunload=function(t){var e=SqueakJS.appName+" is still running";return t.returnValue=e,e},window.clearTimeout(o),e.reset(),e.clear(),e.showBanner("Loading "+SqueakJS.appName),e.showProgress(0);var n=this;window.setTimeout(function(){var a=new Squeak.Image(r);a.readFromBuffer(s,function(){function u(){try{e.quitFlag?n.onQuit(s,e,i):s.interpret(50,function(t){"sleep"==t&&(t=200),l&&k(l,t,s,e),o=window.setTimeout(u,t)})}catch(t){console.error(t),alert(t)}}e.quitFlag=!1;var s=new Squeak.Interpreter(a,e);SqueakJS.vm=s,t.squeakImageName=r,c(i),e.clear(),e.showBanner("Starting "+SqueakJS.appName);var l=g(s,i);e.runNow=function(){window.clearTimeout(o),u()},e.runFor=function(t){var i=Date.now()+t;do e.runNow();while(Date.now()0){for(var a=0;aSqueakDBFake.bigFileThreshold)SqueakDBFake.bigFiles[t]||console.log("File "+t+" ("+i.byteLength+" bytes) too large, storing in memory only"),SqueakDBFake.bigFiles[t]=i;else{var s=Squeak.bytesAsString(new Uint8Array(i));if("object"==typeof LZString){var n=LZString.compressToUTF16(s);e["squeak-file.lz:"+t]=n,delete e["squeak-file:"+t]}else e["squeak-file:"+t]=s}var r={};return setTimeout(function(){r.onsuccess&&r.onsuccess()},0),r},"delete":function(t){delete e["squeak-file:"+t],delete e["squeak-file.lz:"+t],delete SqueakDBFake.bigFiles[t];var i={};return setTimeout(function(){i.onsuccess&&i.onsuccess()},0),i},openCursor:function(){var e={};return setTimeout(function(){e.onsuccess&&e.onsuccess({target:e})},0),e}}),SqueakDBFake},fileGet:function(r,i,t){t||(t=function(e){console.log(e)});var e=this.splitFilePath(r);return e.basename?window.SqueakDBFake&&SqueakDBFake.bigFiles[e.fullname]?i(SqueakDBFake.bigFiles[e.fullname]):void this.dbTransaction("readonly","get "+r,function(s){var r=s.get(e.fullname);r.onerror=function(e){t(e.target.error.name)},r.onsuccess=function(){return void 0!==this.result?i(this.result):void Squeak.fetchTemplateFile(e.fullname,function(e){i(e)},function(){if("undefined"==typeof indexedDB)return t("file not found: "+e.fullname);var r=Squeak.dbFake().get(e.fullname);r.onerror=function(){t("file not found: "+e.fullname)},r.onsuccess=function(){i(this.result)}})}}):t("Invalid path: "+r)},filePut:function(n,s,a){var t=this.splitFilePath(n);if(!t.basename)return null;var r=this.dirList(t.dirname);if(!r)return null;var i=r[t.basename],o=this.totalSeconds();if(i){if(i[3])return null}else i=[t.basename,o,0,!1,0],r[t.basename]=i;return i[2]=o,i[4]=s.byteLength||s.length||0,e["squeak:"+t.dirname]=JSON.stringify(r),this.dbTransaction("readwrite","put "+n,function(e){e.put(s,t.fullname)},function(){a&&a()}),i},fileDelete:function(r,n){var t=this.splitFilePath(r);if(!t.basename)return!1;var i=this.dirList(t.dirname);if(!i)return!1;var s=i[t.basename];return!s||s[3]?!1:(delete i[t.basename],e["squeak:"+t.dirname]=JSON.stringify(i),n?!0:(this.dbTransaction("readwrite","delete "+r,function(e){e.delete(t.fullname)}),!0))},fileRename:function(o,u){var t=this.splitFilePath(o);if(!t.basename)return!1;var i=this.splitFilePath(u);if(!i.basename)return!1;var r=this.dirList(t.dirname);if(!r)return!1;var s=r[t.basename];if(!s||s[3])return!1;var a=t.dirname==i.dirname,n=a?r:this.dirList(i.dirname);return n?n[i.basename]?!1:(delete r[t.basename],s[0]=i.basename,n[i.basename]=s,e["squeak:"+i.dirname]=JSON.stringify(n),a||(e["squeak:"+t.dirname]=JSON.stringify(r)),this.fileGet(t.fullname,function(e){this.dbTransaction("readwrite","rename "+t.fullname+" to "+i.fullname,function(r){r.delete(t.fullname),r.put(e,i.fullname)})}.bind(this),function(e){console.log("File rename failed: "+e)}.bind(this)),!0):!1},fileExists:function(r){var e=this.splitFilePath(r);if(!e.basename)return!1;var t=this.dirList(e.dirname);if(!t)return!1;var i=t[e.basename];return!i||i[3]?!1:!0},dirCreate:function(s,n){var t=this.splitFilePath(s);if(!t.basename)return!1;n&&!e["squeak:"+t.dirname]&&Squeak.dirCreate(t.dirname,!0);var i=this.dirList(t.dirname);if(!i)return!1;if(i[t.basename])return!1;var r=this.totalSeconds(),a=[t.basename,r,r,!0,0];return i[t.basename]=a,e["squeak:"+t.fullname]=JSON.stringify({}),e["squeak:"+t.dirname]=JSON.stringify(i),!0},dirDelete:function(s){var t=this.splitFilePath(s);if(!t.basename)return!1;var i=this.dirList(t.dirname);if(!i)return!1;if(!i[t.basename])return!1;var r=this.dirList(t.fullname);if(!r)return!1;for(var n in r)return!1;return delete i[t.basename],e["squeak:"+t.dirname]=JSON.stringify(i),delete e["squeak:"+t.fullname],!0},dirList:function(a,o){function n(r,e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];r[i[0]]=i}}var t=this.splitFilePath(a),i=e["squeak:"+t.fullname],r=o&&e["squeak-template:"+t.fullname];if(i||r){var s={};return r&&n(s,JSON.parse(r).entries),i&&n(s,JSON.parse(i)),s}return"/"==t.fullname?{}:null},splitFilePath:function(e){"/"!==e[0]&&(e="/"+e),e=e.replace(/\/\//gi,"/");var t=e.match(/(.*)\/(.*)/),i=t[1].length?t[1]:"/",r=t[2].length?t[2]:null;return{fullname:e,dirname:i,basename:r}},flushFile:function(e){if(e.modified){var t=e.contents.buffer;t.byteLength!==e.size&&(t=new ArrayBuffer(e.size),new Uint8Array(t).set(e.contents.subarray(0,e.size))),Squeak.filePut(e.name,t),e.modified=!1}},flushAllFiles:function(){if("undefined"!=typeof SqueakFiles)for(var e in SqueakFiles)this.flushFile(SqueakFiles[e])},closeAllFiles:function(){Squeak.flushAllFiles(),delete window.SqueakFiles},fetchTemplateDir:function(t,r){function s(i){var t=Squeak.splitFilePath(i);"/"!==t.dirname&&s(t.dirname);var i=JSON.parse(e["squeak-template:"+t.dirname]||'{"entries": {}}');if(!i.entries[t.basename]){var r=Squeak.totalSeconds();i.entries[t.basename]=[t.basename,r,r,!0,0],e["squeak-template:"+t.dirname]=JSON.stringify(i)}}function n(i,s){var r=JSON.parse(e["squeak-template:"+i]);for(var n in r.entries){var t=r.entries[n];t[3]&&Squeak.fetchTemplateDir(i+"/"+t[0],s+"/"+t[0])}}if(t=Squeak.splitFilePath(t).fullname,e["squeak-template:"+t])n(t,r);else{var a=r+"/sqindex.json",i=new XMLHttpRequest;i.open("GET",a,!0),i.onload=function(){if(200==i.status){console.log("adding template "+t),s(t);var a=JSON.parse(i.response),o={url:r,entries:{}};for(var l in a){var u=a[l];o.entries[u[0]]=u}e["squeak-template:"+t]=JSON.stringify(o),n(t,r)}else i.onerror(i.statusText)},i.onerror=function(){console.log("cannot load template index "+a)},i.send()}},fetchTemplateFile:function(t,a,s){t=Squeak.splitFilePath(t);var n=e["squeak-template:"+t.dirname];if(!n)return s();var i=JSON.parse(n).url;if(!i)return s();i+="/"+t.basename;var r=new XMLHttpRequest;r.open("get",i,!0),r.responseType="arraybuffer",r.timeout=3e4,r.onreadystatechange=function(){if(this.readyState==this.DONE)if(200==this.status){var e=this.response;console.log("Got "+e.byteLength+" bytes from "+i),Squeak.dirCreate(t.dirname,!0),Squeak.filePut(t.fullname,e),a(e)}else alert("Download failed ("+this.status+") "+i),s()},console.log("Fetching "+i),r.send()}},"audio",{startAudioOut:function(){if(!this.audioOutContext){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext;this.audioOutContext=e&&new e }return this.audioOutContext},startAudioIn:function(e,t){return this.audioInContext?(this.audioInSource.disconnect(),e(this.audioInContext,this.audioInSource)):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia?void navigator.getUserMedia({audio:!0,toString:function(){return"audio"}},function(i){var t=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext;this.audioInContext=t&&new t,this.audioInSource=this.audioInContext.createMediaStreamSource(i),e(this.audioInContext,this.audioInSource)},function(){t("cannot access microphone")}):t("test: audio input not supported"))},stopAudio:function(){this.audioInSource&&this.audioInSource.disconnect()}},"time",{Epoch:Date.UTC(1901,0,1)+6e4*(new Date).getTimezoneOffset(),EpochUTC:Date.UTC(1901,0,1),totalSeconds:function(){return Math.floor((Date.now()-Squeak.Epoch)/1e3)}},"utils",{bytesAsString:function(t){for(var i=[],e=0;ev;)c.installFromImage(i,q,M,l,N),c=c.nextObject,v++;return b&&b(v/a.oldSpaceCount),!0}return a.specialObjectsArray=g,a.decorateKnownObjects(),a.fixCompiledMethods(),a.fixCompactOops(),!1}function w(){O()?window.setTimeout(w,0):d&&d()}console.log("squeak: reading "+this.name+" ("+k.byteLength+" bytes)"),this.startupTime=Date.now();for(var j=new DataView(k),l=!1,s=0,e=function(){var e=j.getUint32(s,l);return s+=4,e},_=function(t,r){if(5>r){for(var i=[];i.length=0)break;if(l||(m+=512),m>512)throw Error("bad image version")}this.version=o;var N=[6505,68003].indexOf(o)>=0;if(this.hasClosures=[6504,6505,68002,68003].indexOf(o)>=0,o>=68e3)throw Error("64 bit images not supported yet");var A=e(),P=e(),p=e(),S=e();this.lastHash=e();e(),e(),e();s+=A-36;for(var n,i={},y=m+A;y+P>s;){var h=0,u=0,r=e();switch(r&Squeak.HeaderTypeMask){case Squeak.HeaderTypeSizeAndClass:h=r>>2,u=e(),r=e();break;case Squeak.HeaderTypeClass:u=r-Squeak.HeaderTypeClass,r=e(),h=r>>2&63;break;case Squeak.HeaderTypeShort:h=r>>2&63,u=r>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}h--;var I=s-4-y,F=r>>8&15,x=r>>17&4095,C=_(h,F),t=new Squeak.Object;t.initFromImage(I,u,F,x,C),32>u&&(t.hash|=268435456),n&&(n.nextObject=t),this.oldSpaceCount++,n=t,i[p+I]=t}this.firstOldObject=i[p+4],this.lastOldObject=t,this.oldSpaceBytes=P;var V=i[i[S].bits[Squeak.splOb_CompactClasses]].bits,f=null;for(t=this.firstOldObject,n=null;t;)n=f,f=t.renameFromImage(i,V),n&&(n.nextObject=f),i[p+t.oop]=f,t=t.nextObject;this.firstOldObject=i[p+4],this.lastOldObject=f;var g=i[S],q=i[g.bits[Squeak.splOb_CompactClasses]].bits,M=i[g.bits[Squeak.splOb_ClassFloat]],c=this.firstOldObject,v=0,a=this;if(b)window.setTimeout(w,0);else{for(;O(););d&&d()}},decorateKnownObjects:function(){var e=this.specialObjectsArray.pointers;e[Squeak.splOb_NilObject].isNil=!0,e[Squeak.splOb_TrueObject].isTrue=!0,e[Squeak.splOb_FalseObject].isFalse=!0,e[Squeak.splOb_ClassFloat].isFloatClass=!0,this.compactClasses=this.specialObjectsArray.pointers[Squeak.splOb_CompactClasses].pointers;for(var t=0;t268435455,s=!!e.sqClass.isCompact;if(i!==s){var r=0===e.snapshotSize().header;i!==r&&(t+=r?-4:4)}e.hash&=268435455,e.oop+=t,e=e.nextObject}this.oldSpaceBytes+=t},fixCompiledMethods:function(){if(!(this.version>=6502))for(var e=this.firstOldObject,t=this.specialObjectsArray.pointers[Squeak.splOb_ClassCompiledMethod];e;)e.format>=12&&(e.sqClass=t),e=e.nextObject}},"garbage collection",{partialGC:function(){return this.totalMemory-this.oldSpaceBytes},fullGC:function(t){this.vm.addMessage("fullGC: "+t);var i=Date.now(),e=this.markReachableObjects();return this.removeUnmarkedOldObjects(),this.appendToOldObjects(e),this.finalizeWeakReferences(),this.allocationCount+=this.newSpaceCount,this.newSpaceCount=0,this.hasNewInstances={},this.gcCount++,this.gcMilliseconds+=Date.now()-i,e.length>0?e[0]:null},markReachableObjects:function(){this.vm.storeContextRegisters();for(var r=[this.specialObjectsArray,this.vm.activeContext],n=[];r.length>0;){var e=r.pop();if(!e.mark){e.nextObject||e===this.lastOldObject||n.push(e),e.mark=!0,e.sqClass.mark||r.push(e.sqClass);var i=e.pointers;if(i){var s=i.length;if(this.vm.isContext(e)){s=e.contextSizeWithStack();for(var t=s;tt;t++)"object"!=typeof i[t]||i[t].mark||r.push(i[t])}}}return n.sort(function(e,t){return t.oop-e.oop})},removeUnmarkedOldObjects:function(){var s=0,i=0,e=this.firstOldObject;for(e.mark=!1;;){var t=e.nextObject;if(!t)return this.lastOldObject=e,this.oldSpaceBytes-=i,void(this.oldSpaceCount-=s);if(t.mark)e=t,e.mark=!1,e.oop-=i;else{var r=t;e.nextObject=r.nextObject,r.oop=-++this.newSpaceCount,i+=r.totalBytes(),s++}}},appendToOldObjects:function(e){for(var i=this.lastOldObject,r=0;r=2)){var r=e.pointers[Squeak.WeakFinalizerItem_list];if(r.sqClass==this.vm.specialObjects[Squeak.splOb_ClassWeakFinalizer]){var a=r.pointers[Squeak.WeakFinalizationList_first];e.pointers[Squeak.WeakFinalizerItem_next]=a,r.pointers[Squeak.WeakFinalizationList_first]=e}}}e=e.nextObject}this.vm.pendingFinalizationSignals>0&&this.vm.forceInterruptCheck()}},"creating",{registerObject:function(e){return e.oop=-++this.newSpaceCount,this.lastHash=13849+27181*this.lastHash&4294967295,4095&this.lastHash},instantiateClass:function(e,i,r){var t=new(e.classInstProto()),s=this.registerObject(t);return t.initInstanceOf(e,i,s,r),this.hasNewInstances[e.oop]=!0,t},clone:function(t){var e=new(t.sqClass.classInstProto()),i=this.registerObject(e);return e.initAsClone(t,i),this.hasNewInstances[e.sqClass.oop]=!0,e}},"operations",{bulkBecome:function(s,i,c,l){if(!s)return!i;var a=s.length;if(a!==i.length)return!1;this.newSpaceCount>0?this.fullGC("become"):this.vm.storeContextRegisters();for(var r={},e=0;a>e;e++){var t=s[e];if(!t.sqClass)return!1;if(r[t.oop])return!1;r[t.oop]=i[e]}if(c)for(var e=0;a>e;e++){var t=i[e];if(!t.sqClass)return!1;if(r[t.oop])return!1;r[t.oop]=s[e]}if(l)for(var e=0;a>e;e++){if(!i[e].sqClass)return!1;var f=s[e].hash;s[e].hash=i[e].hash,i[e].hash=f}for(var t=this.firstOldObject;t;){var n=r[t.sqClass.oop];n&&(t.sqClass=n);var o=t.pointers;if(o)for(var u=0;u0&&this.fullGC("nextObject")},someInstanceOf:function(t){for(var e=this.firstOldObject;;){if(e.sqClass===t)return e;if(e=e.nextObject||this.nextObjectWithGCFor(t),!e)return null}},nextInstanceAfter:function(e){for(var t=e.sqClass;;){if(e=e.nextObject||this.nextObjectWithGCFor(t),!e)return null;if(e.sqClass===t)return e}},nextObjectWithGCFor:function(e){return 0!==this.newSpaceCount&&this.hasNewInstances[e.oop]?this.fullGC("instance of "+e.className()):null},writeToBuffer:function(){var s=64,i=new DataView(new ArrayBuffer(s+this.oldSpaceBytes)),t=0,e=function(e){i.setUint32(t,e),t+=4};for(e(this.formatVersion()),e(s),e(this.oldSpaceBytes),e(this.firstOldObject.addr()),e(this.objectToOop(this.specialObjectsArray)),e(this.lastHash),e(52429400);s>t;)e(0);for(var r=this.firstOldObject,n=0;r;)t=r.writeTo(i,t,this),r=r.nextObject,n++;if(t!==i.byteLength)throw Error("wrong image size");if(n!==this.oldSpaceCount)throw Error("wrong object count");return i.buffer},objectToOop:function(e){if("number"==typeof e)return e<<1|1;if(e.oop<0)throw Error("temporary oop");return e.oop},bytesLeft:function(){return this.totalMemory-this.oldSpaceBytes},formatVersion:function(){return this.hasClosures?6504:6502},segmentVersion:function(){var e=this.specialObjectsArray.pointers[Squeak.splOb_SelectorDoesNotUnderstand],t=new Uint32Array(e.bytes.buffer,0,1);return this.formatVersion()|4278190080&t[0]},loadImageSegment:function(b,p){var f=new DataView(b.words.buffer),h=!1,A=!1,i=0,r=function(){var e=f.getUint32(i,h);return i+=4,e},g=function(e,s){if(5>s){for(var t=[];t.length>2,a=r(),e=r();break;case Squeak.HeaderTypeClass:a=e-Squeak.HeaderTypeClass,e=r(),n=e>>2&63;break;case Squeak.HeaderTypeShort:n=e>>2&63,a=e>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}n--;var m=i,d=e>>8&15,F=e>>17&4095,k=g(n,d),o=new Squeak.Object;o.initFromImage(m,a,d,F,k),l.push(o),s[m]=o}for(var t=0;t>1&63)+(i>>10&192)-1;this.format=i>>7&15,this.format<8?6!=this.format?r+e>0&&(this.pointers=this.fillArray(r+e,n)):e>0&&(t.isFloatClass?(this.isFloat=!0,this.float=0):this.words=new Uint32Array(e)):e>0&&(this.bytes=new Uint8Array(e))},initAsClone:function(e,t){this.sqClass=e.sqClass,this.hash=t,this.format=e.format,e.isFloat?(this.isFloat=e.isFloat,this.float=e.float):(e.pointers&&(this.pointers=e.pointers.slice(0)),e.words&&(this.words=new Uint32Array(e.words)),e.bytes&&(this.bytes=new Uint8Array(e.bytes)))},initFromImage:function(e,t,i,r,s){this.oop=e,this.sqClass=t,this.format=i,this.hash=r,this.bits=s},classNameFromImage:function(t){var e=t[this.bits[Squeak.Class_name]];if(e&&e.format>=8&&e.format<12){var i=e.decodeBytes(e.bits.length,e.bits,0,3&e.format);return Squeak.bytesAsString(i)}return"Class"},renameFromImage:function(t,s){var i=this.sqClass<32?t[s[this.sqClass-1]]:t[this.sqClass],r=i.instProto||i.classInstProto(i.classNameFromImage(t));if(!r)return this;var e=new r;return e.oop=this.oop,e.sqClass=this.sqClass,e.format=this.format,e.hash=this.hash,e.bits=this.bits,e},installFromImage:function(i,o,u,t,n){var r=this.sqClass;this.sqClass=r>0&&32>r?i[o[r-1]]:i[r];var e=this.bits.length;if(this.format<5){if(e>0){var a=this.bits;this.pointers=this.decodePointers(e,a,i)}}else if(this.format>=12){var l=this.decodeWords(1,this.bits,t)[0],s=l>>10&255,a=this.decodeWords(s+1,this.bits,t);this.pointers=this.decodePointers(s+1,a,i),this.bytes=this.decodeBytes(e-(s+1),this.bits,s+1,3&this.format)}else if(this.format>=8)e>0&&(this.bytes=this.decodeBytes(e,this.bits,0,3&this.format));else if(this.sqClass==u){if(this.isFloat=!0,this.float=this.decodeFloat(this.bits,t,n),1.3797216632888e-310==this.float)if(/noFloatDecodeWorkaround/.test(window.location.hash));else if(this.constructor.prototype.decodeFloat=this.decodeFloatDeoptimized,this.float=this.decodeFloat(this.bits,t,n),1.3797216632888e-310==this.float)throw Error("Cannot deoptimize decodeFloat")}else e>0&&(this.words=this.decodeWords(e,this.bits,t));delete this.bits,this.mark=!1},decodePointers:function(i,s,n){for(var r=new Array(i),e=0;i>e;e++){var t=s[e];r[e]=1===(1&t)?t>>1:n[t]||42424242}return r},decodeWords:function(t,i,s){for(var n=new DataView(i.buffer,i.byteOffset),r=new Uint32Array(t),e=0;t>e;e++)r[e]=n.getUint32(4*e,s);return r},decodeBytes:function(r,e,s,n){var t=4*r-n,a=new Uint8Array(e.buffer,e.byteOffset+4*s,t),i=new Uint8Array(t);return i.set(a),i},decodeFloat:function(i,r,s){var e=new DataView(i.buffer,i.byteOffset);if(!r)return e.getFloat64(0,!1);if(s)return e.getFloat64(0,!0);var n=new ArrayBuffer(8),t=new DataView(n);return t.setUint32(0,e.getUint32(4)),t.setUint32(4,e.getUint32(0)),t.getFloat64(0,!0)},decodeFloatDeoptimized:function(i,r,s){var e=new DataView(i.buffer,i.byteOffset);if(!r)return e.getFloat64(0,!1);if(s)return e.getFloat64(0,!0);var n=new ArrayBuffer(8),t=new DataView(n);return function(){t.setUint32(0,e.getUint32(4)),t.setUint32(4,e.getUint32(0))}(),t.getFloat64(0,!0)},fillArray:function(i,r){for(var t=[],e=0;i>e;e++)t[e]=r;return t}},"printing",{toString:function(){return this.sqInstName()},bytesAsString:function(){return this.bytes?Squeak.bytesAsString(this.bytes):""},bytesAsNumberString:function(n){if(!this.bytes)return"";for(var r="0123456789ABCDEF",i=[],t=0,e=this.bytes.length-1;e>=0;e--)i.push(r[this.bytes[e]>>4]),i.push(r[15&this.bytes[e]]),t=256*t+this.bytes[e];var s=n?"-":"",a=t>=9007199254740992?"≈":"";return s+"16r"+i.join("")+" ("+a+s+t+"L)"},assnKeyAsString:function(){return this.pointers[Squeak.Assn_key].bytesAsString()},slotNameAt:function(e){var t=this.instSize();return t>=e?this.sqClass.allInstVarNames()[e-1]:(e-t).toString()},sqInstName:function(){if(this.isNil)return"nil";if(this.isTrue)return"true";if(this.isFalse)return"false";if(this.isFloat){var t=this.float.toString();return/\./.test(t)||(t+=".0"),t}var e=this.sqClass.className();if(/ /.test(e))return"the "+e;switch(e){case"String":case"ByteString":return"'"+this.bytesAsString()+"'";case"Symbol":case"ByteSymbol":return"#"+this.bytesAsString();case"Point":return this.pointers.join("@");case"Rectangle":return this.pointers.join(" corner: ");case"Association":case"ReadOnlyVariableBinding":return this.pointers.join("->");case"LargePositiveInteger":return this.bytesAsNumberString(!1);case"LargeNegativeInteger":return this.bytesAsNumberString(!0);case"Character":return"$"+String.fromCharCode(this.pointers[0])+" ("+this.pointers[0].toString()+")"}return/^[aeiou]/i.test(e)?"an "+e:"a "+e}},"accessing",{isWords:function(){return 6===this.format},isBytes:function(){var e=this.format;return e>=8&&11>=e},isWordsOrBytes:function(){var e=this.format;return 6==e||e>=8&&11>=e},isPointers:function(){return this.format<=4},isMethod:function(){return this.format>=12},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(){return this.format>4||2==this.format?0:this.format<2?this.pointersSize():this.sqClass.classInstSize()},floatData:function(){var t=new ArrayBuffer(8),e=new DataView(t);return e.setFloat64(0,this.float,!1),e},wordsAsFloat32Array:function(){return this.float32Array||this.words&&(this.float32Array=new Float32Array(this.words.buffer))},wordsAsFloat64Array:function(){return this.float64Array||this.words&&(this.float64Array=new Float64Array(this.words.buffer))},wordsAsInt32Array:function(){return this.int32Array||this.words&&(this.int32Array=new Int32Array(this.words.buffer))},wordsAsInt16Array:function(){return this.int16Array||this.words&&(this.int16Array=new Int16Array(this.words.buffer))},wordsAsUint16Array:function(){return this.uint16Array||this.words&&(this.uint16Array=new Uint16Array(this.words.buffer))},wordsAsUint8Array:function(){return this.uint8Array||this.words&&(this.uint8Array=new Uint8Array(this.words.buffer))},wordsOrBytes:function(){return this.words?this.words:this.uint32Array?this.uint32Array:this.bytes?this.uint32Array=new Uint32Array(this.bytes.buffer,0,this.bytes.length>>2):null},setAddr:function(t){var e=this.snapshotSize();return this.oop=t+4*e.header,t+4*(e.header+e.body)},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;this.bytes&&(e+=this.bytes.length+3>>2),e++;var t=e>63?2:this.sqClass.isCompact?0:1;return{header:t,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(t,e,n){this.bytes&&(this.format|=3&-this.bytes.length);var a=e,r=this.snapshotSize(),s=(15&this.format)<<8|(4095&this.hash)<<17;switch(r.header){case 2:t.setUint32(e,r.body<<2|Squeak.HeaderTypeSizeAndClass),e+=4,t.setUint32(e,this.sqClass.oop|Squeak.HeaderTypeSizeAndClass),e+=4,t.setUint32(e,s|Squeak.HeaderTypeSizeAndClass),e+=4;break;case 1:t.setUint32(e,this.sqClass.oop|Squeak.HeaderTypeClass),e+=4,t.setUint32(e,s|r.body<<2|Squeak.HeaderTypeClass),e+=4;break;case 0:var o=n.compactClasses.indexOf(this.sqClass)+1;t.setUint32(e,s|o<<12|r.body<<2|Squeak.HeaderTypeShort),e+=4}if(this.isFloat)t.setFloat64(e,this.float),e+=8;else if(this.words)for(var i=0;i>10&192)+(e>>1&63)-1},isWeak:function(){var e=this.pointers[Squeak.Class_format];return 4==(e>>7&15)},instVarNames:function(){var e=this.pointers.length>12?4:this.pointers.length>9?3:4;return(this.pointers[e].pointers||[]).map(function(e){return e.bytesAsString()})},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_";var e=this.pointers[Squeak.Class_name];if(e&&e.bytes)return e.bytesAsString();for(var t=5;6>=t;t++){var i=this.pointers[t];if(i&&i.pointers&&(e=i.pointers[Squeak.Class_name],e&&e.bytes))return e.bytesAsString()+" class"}return"_SOMECLASS_"},classInstProto:function(i){if(this.instProto)return this.instProto;var t=Squeak.Object;try{i||(i=this.className());var e=i.replace(/[^A-Za-z0-9]/g,"_");e="UndefinedObject"===e?"nil":"True"===e?"true_":"False"===e?"false_":(/^[AEIOU]/.test(e)?"an":"a")+e,t=new Function("return function "+e+"() {};")(),t.prototype=Squeak.Object.prototype}catch(r){}return Object.defineProperty(this,"instProto",{value:t}),t}},"as method",{methodHeader:function(){return this.pointers[0]},methodNumLits:function(){return this.pointers.length-1},methodNumArgs:function(){return this.methodHeader()>>24&15},methodPrimitiveIndex:function(){var e=805306879&this.methodHeader();return e>511?(511&e)+(e>>19):e},methodClassForSuper:function(){var e=this.pointers[this.methodNumLits()];return e.pointers[Squeak.Assn_value]},methodNeedsLargeFrame:function(){return(131072&this.methodHeader())>0},methodAddPointers:function(e){this.pointers=e},methodTempCount:function(){return this.methodHeader()>>18&63},methodGetLiteral:function(e){return this.pointers[1+e]},methodGetSelector:function(e){return this.pointers[1+e]},methodSetLiteral:function(e,t){this.pointers[1+e]=t}},"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){if(e&&e.activeContext===this)return e.sp+1;var t=this.pointers[Squeak.Context_stackPointer];return Squeak.Context_tempFrameStart+("number"==typeof t?t:0)}}),Object.subclass("Squeak.Interpreter","initialization",{initialize:function(e,t){console.log("squeak: initializing interpreter "+Squeak.vmVersion),this.Squeak=Squeak,this.image=e,this.image.vm=this,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.globals=this.findGlobals(),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.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;et)return console.warn("Slow machine detected (loaded "+(1e3*t|0)+" objects/sec), using interpreter only");try{console.log("squeak: initializing JIT compiler"),this.compiler=new Squeak.Compiler(this)}catch(e){console.warn("Compiler "+e)}},hackImage:function(){[].forEach(function(e){var t=this.findMethod(e.method);t&&(t.pointers[0]|=e.primitive,console.warn("Hacking "+e.method))},this)}},"interpreting",{interpretOne:function(r){if(this.method.compiled){if(r){if(!this.compiler.enableSingleStepping(this.method))return this.method.compiled=null,this.interpretOne(r);this.breakNow()}return void(this.byteCodeCount+=this.method.compiled(this))}var e,t,i=this.Squeak;if(this.byteCodeCount++,e=this.nextByte(),128>e)switch(e){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&e]);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[i.Context_tempFrameStart+(15&e)]);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&e));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&e).pointers[i.Assn_value]);case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:return void(this.receiver.pointers[7&e]=this.pop());case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:return void(this.homeContext.pointers[i.Context_tempFrameStart+(7&e)]=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[i.BlockContext_caller]);case 126:return void this.nono();case 127:return void this.nono()}else switch(e){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 t=this.nextByte(),void this.send(this.method.methodGetSelector(31&t),t>>5,!1);case 132:return void this.doubleExtendedDoAnything(this.nextByte());case 133:return t=this.nextByte(),void this.send(this.method.methodGetSelector(31&t),t>>5,!0);case 134:return t=this.nextByte(),void this.send(this.method.methodGetSelector(63&t),t>>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.nono();case 140:return t=this.nextByte(),void this.push(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[t]);case 141:return t=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[t]=this.top());case 142:return t=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[t]=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+=(7&e)+1);case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.jumpIfFalse((7&e)+1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:return t=this.nextByte(),this.pc+=256*((7&e)-4)+t,void(4>(7&e)&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 168:case 169:case 170:case 171:return void this.jumpIfTrue(256*(3&e)+this.nextByte());case 172:case 173:case 174:case 175:return void this.jumpIfFalse(256*(3&e)+this.nextByte());case 176:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 177:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 178:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 180:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 181:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 182:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 183:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 184:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&e));case 185:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&e));case 186:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&e));case 187:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&e));case 188:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&e));case 189:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&e));case 190:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&e));case 191:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&e));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&e)||this.sendSpecial((15&e)+16));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&e),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&e),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&e),2,!1)}throw Error("not a bytecode: "+e)},interpret:function(i,e){if(this.frozen)return"frozen";for(this.isIdle=!1,this.breakOutOfInterpreter=!1,this.breakOutTick=this.primHandler.millisecondClockValue()+(i||500);this.breakOutOfInterpreter===!1;)this.method.compiled?this.byteCodeCount+=this.method.compiled(this):this.interpretOne();if("function"==typeof this.breakOutOfInterpreter)return this.breakOutOfInterpreter(e);var t="break"==this.breakOutOfInterpreter?"break":this.isIdle?this.nextWakeupTick?Math.max(1,this.nextWakeupTick-this.primHandler.millisecondClockValue()):"sleep":0;return e&&e(t),t},goIdle:function(){var e=0!==this.nextWakeupTick;this.forceInterruptCheck(),this.checkForInterrupts(); var t=0!==this.nextWakeupTick;this.isIdle=t||!e,this.breakOut()},freeze:function(t){var e;this.frozen=!0,this.breakOutOfInterpreter=function(t){if(!t)throw Error("need function to restart interpreter");return e=t,"frozen"}.bind(this);var i=function(){if(this.frozen=!1,!e)throw Error("no continue function");e(0)}.bind(this);return t&&window.setTimeout(function(){t(i)},0),i},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.methodBytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e=this.primHandler.millisecondClockValue();if(e-100&&(e-this.lastTick=this.nextWakeupTick){this.nextWakeupTick=0;var t=this.specialObjects[Squeak.splOb_TheTimerSemaphore];t.isNil||this.primHandler.synchronousSignal(t)}if(this.pendingFinalizationSignals>0){var t=this.specialObjects[Squeak.splOb_TheFinalizationSemaphore];this.pendingFinalizationSignals=0,t.isNil||this.primHandler.synchronousSignal(t)}this.primHandler.semaphoresToSignal.length>0&&this.primHandler.signalExternalSemaphores(),!this.method.compiled&&this.compiler&&this.compiler.compile(this.method),e>=this.breakOutTick&&this.breakOut()},extendedPush:function(t){var e=63&t;switch(t>>6){case 0:this.push(this.receiver.pointers[e]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+e]);break;case 2:this.push(this.method.methodGetLiteral(e));break;case 3:this.push(this.method.methodGetLiteral(e).pointers[Squeak.Assn_value])}},extendedStore:function(t){var e=63&t;switch(t>>6){case 0:this.receiver.pointers[e]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+e]=this.top();break;case 2:this.nono();break;case 3:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(t){var e=63&t;switch(t>>6){case 0:this.receiver.pointers[e]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+e]=this.pop();break;case 2:this.nono();break;case 3:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(t){var e=this.nextByte();switch(t>>5){case 0:this.send(this.method.methodGetSelector(e),31&t,!1);break;case 1:this.send(this.method.methodGetSelector(e),31&t,!0);break;case 2:this.push(this.receiver.pointers[e]);break;case 3:this.push(this.method.methodGetLiteral(e));break;case 4:this.push(this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]);break;case 5:this.receiver.pointers[e]=this.top();break;case 6:this.receiver.pointers[e]=this.pop();break;case 7:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(t){var e=this.pop();return e.isTrue?void(this.pc+=t):void(e.isFalse||(this.push(e),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1)))},jumpIfFalse:function(t){var e=this.pop();return e.isFalse?void(this.pc+=t):void(e.isTrue||(this.push(e),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1)))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)}},"closures",{pushNewArray:function(i){var s=i>127,e=127&i,r=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e);if(s){for(var t=0;e>t;t++)r.pointers[t]=this.stackValue(e-t-1);this.popN(e)}this.push(r)},pushClosureCopy:function(){var r=this.nextByte(),s=15&r,e=r>>4,n=this.nextByte(),a=256*n+this.nextByte(),o=this.encodeSqueakPC(this.pc,this.method),i=this.newClosure(s,o,e);if(i.pointers[Squeak.Closure_outerContext]=this.activeContext,this.reclaimableContextCount=0,e>0){for(var t=0;e>t;t++)i.pointers[Squeak.Closure_firstCopiedValue+t]=this.stackValue(e-t-1);this.popN(e)}this.pc+=a,this.push(i)},newClosure:function(t,i,r){var e=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassBlockClosure],r);return e.pointers[Squeak.Closure_startpc]=i,e.pointers[Squeak.Closure_numArgs]=t,e}},"sending",{send:function(i,r,n){var s=this.stackValue(r),e=this.getClass(s);n&&(e=this.method.methodClassForSuper(),e=e.pointers[Squeak.Class_superclass]);var t=this.findSelectorInClass(i,r,e);t.primIndex&&(this.verifyAtSelector=i,this.verifyAtClass=e),this.executeNewMethod(s,t.method,t.argCount,t.primIndex,t.mClass,i)},sendAsPrimitiveFailure:function(e,t,i){this.executeNewMethod(e,t,i,0)},findSelectorInClass:function(r,s,i){var e=this.findMethodCacheEntry(r,i);if(e.method)return e;for(var a,t=i;!t.isNil;){if(a=t.pointers[Squeak.Class_mdict],a.isNil){var u=this.specialObjects[Squeak.splOb_SelectorCannotInterpret],l=this.createActualMessage(r,s,i);return this.popNandPush(s,l),this.findSelectorInClass(u,1,t.superclass())}var n=this.lookupSelectorInDict(a,r);if(!n.isNil)return this.currentSelector=r,this.currentLookupClass=i,e.method=n,e.primIndex=n.isMethod()?n.methodPrimitiveIndex():248,e.argCount=s,e.mClass=t,e;t=t.superclass()}var o=this.specialObjects[Squeak.splOb_SelectorDoesNotUnderstand];if(r===o)throw Error("Recursive not understood error encountered");var c=this.createActualMessage(r,s,i);return this.popNandPush(s,c),this.findSelectorInClass(o,1,i)},lookupSelectorInDict:function(t,i){for(var r=t.pointersSize(),a=r-Squeak.MethodDict_selectorStart-1,e=(a&i.hash)+Squeak.MethodDict_selectorStart,s=!1;;){var n=t.pointers[e];if(n===i){var o=t.pointers[Squeak.MethodDict_array];return o.pointers[e-Squeak.MethodDict_selectorStart]}if(n.isNil)return this.nilObj;if(++e===r){if(s)return this.nilObj;e=Squeak.MethodDict_selectorStart,s=!0}}},executeNewMethod:function(o,e,i,n,r,s){if(this.sendCount++,e===this.breakOnMethod&&this.breakNow("executing method "+this.printMethod(e,r,s)),this.logSends&&console.log(this.sendCount+" "+this.printMethod(e,r,s)),this.breakOnContextChanged&&(this.breakOnContextChanged=!1,this.breakNow()),!(n>0&&this.tryPrimitive(n,i,e))){var t=this.allocateOrRecycleContext(e.methodNeedsLargeFrame()),a=e.methodTempCount(),u=0,l=Squeak.Context_tempFrameStart+a-1;if(t.pointers[Squeak.Context_method]=e,t.pointers[Squeak.BlockContext_initialIP]=this.nilObj,t.pointers[Squeak.Context_sender]=this.activeContext,this.arrayCopy(this.activeContext.pointers,this.sp-i,t.pointers,Squeak.Context_tempFrameStart-1,i+1),this.arrayFill(t.pointers,Squeak.Context_tempFrameStart+i,Squeak.Context_tempFrameStart+a,this.nilObj),this.popN(i+1),this.reclaimableContextCount++,this.storeContextRegisters(),this.activeContext=t,this.homeContext=t,this.method=e,this.methodBytes=e.bytes,this.pc=u,this.sp=l,this.storeContextRegisters(),this.receiver=t.pointers[Squeak.Context_receiver],this.receiver!==o)throw Error("receivers don't match");!e.compiled&&this.compiler&&this.compiler.compile(e,r,s),this.interruptCheckCounter--<=0&&this.checkForInterrupts()}},doReturn:function(i,t){if(!t){var r=this.homeContext;if(this.hasClosures)for(var s;!(s=r.pointers[Squeak.Context_closure]).isNil;)r=s.pointers[Squeak.Closure_outerContext];t=r.pointers[Squeak.Context_sender]}if(t.isNil||t.pointers[Squeak.Context_instructionPointer].isNil)return this.cannotReturn(i);for(var e=this.activeContext.pointers[Squeak.Context_sender];e!==t;){if(e.isNil)return this.cannotReturn(i);if(this.isUnwindMarked(e))return this.aboutToReturnThrough(i,e);e=e.pointers[Squeak.Context_sender]}var n;for(e=this.activeContext;e!==t;)this.breakOnContextReturned===e&&(this.breakOnContextReturned=null,this.breakNow()),n=e.pointers[Squeak.Context_sender],e.pointers[Squeak.Context_sender]=this.nilObj,e.pointers[Squeak.Context_instructionPointer]=this.nilObj,this.reclaimableContextCount>0&&(this.reclaimableContextCount--,this.recycleIfPossible(e)),e=n;this.activeContext=e,this.fetchContextRegisters(this.activeContext),this.push(i),this.breakOnContextChanged&&(this.breakOnContextChanged=!1,this.breakNow())},aboutToReturnThrough:function(e,t){this.push(this.exportThisContext()),this.push(e),this.push(t);var i=this.specialObjects[Squeak.splOb_SelectorAboutToReturn];this.send(i,2)},cannotReturn:function(e){this.push(this.exportThisContext()),this.push(e);var t=this.specialObjects[Squeak.splOb_SelectorCannotReturn];this.send(t,1)},tryPrimitive:function(e,t,i){if(e>255&&520>e){if(e>=264)return this.popNandPush(1,this.top().pointers[e-264]),!0;switch(e){case 256:return!0;case 257:return this.popNandPush(1,this.trueObj),!0;case 258:return this.popNandPush(1,this.falseObj),!0;case 259:return this.popNandPush(1,this.nilObj),!0}return this.popNandPush(1,e-261),!0}var r=this.primHandler.doPrimitive(e,t,i);return r},createActualMessage:function(r,t,s){var e=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassMessage],0),i=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],t);return this.arrayCopy(this.activeContext.pointers,this.sp-t+1,i.pointers,0,t),e.pointers[Squeak.Message_selector]=r,e.pointers[Squeak.Message_arguments]=i,e.pointers.length>Squeak.Message_lookupClass&&(e.pointers[Squeak.Message_lookupClass]=s),e},primitivePerform:function(t){var r=this.stackValue(t-1),s=this.stackValue(t),i=t-1,n=this.sp-i,a=this.activeContext.pointers;this.arrayCopy(a,n+1,a,n,i),this.sp--;var e=this.findSelectorInClass(r,i,this.getClass(s));return this.executeNewMethod(s,e.method,e.argCount,e.primIndex,e.mClass,r),!0},primitivePerformWithArgs:function(e,a){var r=this.stackValue(e),o=this.stackValue(e-1),s=this.stackValue(e-2);if(s.sqClass!==this.specialObjects[Squeak.splOb_ClassArray])return!1;var u=a?this.stackValue(e-3):this.getClass(r);if(a)for(var t=this.getClass(r);t!==u;)if(t=t.pointers[Squeak.Class_superclass],t.isNil)return!1;var n=s.pointersSize(),l=this.activeContext.pointers;this.arrayCopy(s.pointers,0,l,this.sp-1,n),this.sp+=n-e;var i=this.findSelectorInClass(o,n,u);return this.executeNewMethod(r,i.method,i.argCount,i.primIndex,i.mClass,o),!0},primitiveInvokeObjectAsMethod:function(e,r){for(var i=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e),t=0;e>t;t++)i.pointers[e-t-1]=this.pop();var s=this.pop(),n=this.currentSelector,a=this.specialObjects[Squeak.splOb_SelectorRunWithIn];return this.push(r),this.push(n),this.push(i),this.push(s),this.send(a,3,!1),!0},findMethodCacheEntry:function(t,r){var e;this.methodCacheRandomish=this.methodCacheRandomish+1&3;for(var s=(t.hash^r.hash)&this.methodCacheMask,i=s,n=0;4>n;n++){if(e=this.methodCache[i],e.selector===t&&e.lkupClass===r)return e;n===this.methodCacheRandomish&&(s=i),i=i+t.hash&this.methodCacheMask}return e=this.methodCache[s],e.lkupClass=r,e.selector=t,e.method=null,e},flushMethodCache:function(){for(var e=0;e=0;r--)t=256*t+i[r];if(e.sqClass===this.specialObjects[Squeak.splOb_ClassLargePositiveInteger])return t;if(e.sqClass===this.specialObjects[Squeak.splOb_ClassLargeNegativeInteger])return-t}return this.success=!1,0},pop2AndPushIntResult:function(e){return this.success&&this.canBeSmallInt(e)?(this.popNandPush(2,e),!0):!1},pop2AndPushNumResult:function(e){if(this.success){if(this.resultIsFloat)return this.popNandPush(2,this.primHandler.makeFloat(e)),!0;if(e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return this.popNandPush(2,e),!0;if(e>=-4294967295&&4294967295>=e){var r=0>e,t=r?-e:e,n=r?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,s=this.instantiateClass(this.specialObjects[n],4),i=s.bytes;return i[0]=255&t,i[1]=t>>8&255,i[2]=t>>16&255,i[3]=t>>24&255,this.popNandPush(2,s),!0}}return!1},pop2AndPushBoolResult:function(e){return this.success?(this.popNandPush(2,e?this.trueObj:this.falseObj),!0):!1}},"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(t,e){if(0===e)return Squeak.NonSmallInt;var i=t/e|0;return i*e===t?i:Squeak.NonSmallInt},div:function(t,e){return 0===e?Squeak.NonSmallInt:Math.floor(t/e)},mod:function(t,e){return 0===e?Squeak.NonSmallInt:t-Math.floor(t/e)*e},safeShift:function(t,e){if(0>e)return-31>e?0>t?-1:0:t>>-e;if(e>31)return 0==t?0:Squeak.NonSmallInt;var i=t<>e===t?i:Squeak.NonSmallInt}},"utils",{isContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]?!0:e.sqClass===this.specialObjects[Squeak.splOb_ClassBlockContext]?!0:!1},isMethodContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]},isMethod:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassCompiledMethod]},instantiateClass:function(e,t){return this.image.instantiateClass(e,t,this.nilObj)},arrayFill:function(t,i,r,s){for(var e=i;r>e;e++)t[e]=s},arrayCopy:function(t,i,r,s,n){if(t===r&&s>i)for(var e=n-1;e>=0;e--)r[s+e]=t[i+e];else for(var e=0;n>e;e++)r[s+e]=t[i+e]}},"debugging",{addMessage:function(e){return this.messages[e]?++this.messages[e]:this.messages[e]=1},warnOnce:function(e){1==this.addMessage(e)&&console.warn(e)},printMethod:function(e,t,r){if(r)return t.className()+">>"+r.bytesAsString();e||(e=this.activeContext.contextMethod());var i;if(this.allMethodsDo(function(t,r,s){return r===e?i=t.className()+">>"+s.bytesAsString():void 0}),i)return i;if(t){var s=t.pointers[Squeak.Context_receiver];return"("+s+")>>?"}return"?>>?"},allInstancesOf:function(t,i){"string"==typeof t&&(t=this.globalNamed(t));for(var r=[],e=this.image.someInstanceOf(t);e;)i?i(e):r.push(e),e=this.image.nextInstanceAfter(e);return r},globalNamed:function(e){return this.allGlobalsDo(function(t,i){return t.bytesAsString()===e?i:void 0})},allGlobalsDo:function(s){for(var i=this.globals,e=0;e=9)for(var a=[t,t.sqClass],s=0;s0;)t.push(e),e=e.pointers[Squeak.Context_sender];var a=200;t.length>i+a&&(e.isNil||t.push("..."),t=t.slice(0,i).concat(["..."]).concat(t.slice(-a)));for(var r=[],o=t.length;o-->0;){var e=t[o];if(e.pointers){var s="",n=e.pointers[Squeak.Context_method];"number"==typeof n?(n=e.pointers[Squeak.BlockContext_home].pointers[Squeak.Context_method],s="[] in "):e.pointers[Squeak.Context_closure].isNil||(s="[] in "),r.push(s+this.printMethod(n,e)+"\n")}else r.push("...\n")}return r.join("")},findMethod:function(e){var t,r=e.split(">>")[0],i=e.split(">>")[1];return this.allMethodsDo(function(s,n,e){return i.length==e.bytesSize()&&i==e.bytesAsString()&&r==s.className()?t=n:void 0}),t},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},printActiveContext:function(){for(var t=this.activeContext,n="number"==typeof t.pointers[Squeak.BlockContext_argumentCount],l=t.pointers[Squeak.Context_closure],d=!n&&!l.isNil,o=n?t.pointers[Squeak.BlockContext_home]:t,p=d?l.pointers[Squeak.Closure_numArgs]:o.pointers[Squeak.Context_method].methodTempCount(),a=this.decodeSqueakSP(0),v=o.contextSizeWithStack(this)-1,c=a+1,k=c+p-1,s="",e=a;v>=e;e++){var i=o.pointers[e],f=i.sqInstName?i.sqInstName():i.toString(),r="";e==a?r="=rcvr":k>=e&&(r="=tmp"+(e-c)),s+="\nctx["+e+"]"+r+": "+f}if(n){s+="\n";for(var m=t.pointers[3],u=this.decodeSqueakSP(1),h=u+m,e=u;e<=this.sp;e++){var i=t.pointers[e],f=i.sqInstName?i.sqInstName():i.toString(),r="";h>=e&&(r="=arg"+(e-u)),s+="\nblk["+e+"]"+r+": "+f}}return s},printAllProcesses:function(){for(var a=this.specialObjects[Squeak.splOb_SchedulerAssociation],s=a.pointers[Squeak.Assn_value],o=s.pointers[Squeak.ProcSched_activeProcess],i="Active: "+this.printProcess(o,!0),n=s.pointers[Squeak.ProcSched_processLists].pointers,r=n.length-1;r>=0;r--)for(var e=n[r].pointers[Squeak.LinkedList_firstLink];!e.isNil;)i+="\nRunnable: "+this.printProcess(e),e=e.pointers[Squeak.Link_nextLink];for(var u=this.specialObjects[Squeak.splOb_ClassSemaphore],t=this.image.someInstanceOf(u);t;){for(var e=t.pointers[Squeak.LinkedList_firstLink];!e.isNil;)i+="\nWaiting: "+this.printProcess(e),e=e.pointers[Squeak.Link_nextLink];t=this.image.nextInstanceAfter(t)}return i},printProcess:function(e,t){var i=e.pointers[Squeak.Proc_suspendedContext],r=e.pointers[Squeak.Proc_priority],s=this.printStack(t?null:i);return e.toString()+" at priority "+r+"\n"+s},printByteCodes:function(e,t,i,r){e||(e=this.method);var s=new Squeak.InstructionPrinter(e,this);return s.printInstructions(t,i,r)},willSendOrReturn:function(){var e=this.method.bytes[this.pc];if(e>=120&&125>=e)return!0;if(131>e||200==e)return!1;if(e>=176)return!0;if(134>=e){var t;if(132===e){if(this.method.bytes[this.pc+1]>>5>1)return!1;t=this.method.bytes[this.pc+2]}else t=this.method.bytes[this.pc+1]&(134===e?63:31);var i=this.method.pointers[t+1];if("blockCopy:"!=i.bytesAsString())return!0}return!1}}),Object.subclass("Squeak.Primitives","initialization",{initialize:function(e,t){this.vm=e,this.display=t,this.display.vm=this.vm,this.oldPrims=!this.vm.image.hasClosures,this.allowAccessBeyondSP=this.oldPrims,this.deferDisplayUpdates=!1,this.semaphoresToSignal=[],this.initDisplay(),this.initAtCache(),this.initModules()},initModules:function(){this.loadedModules={},this.builtinModules={JavaScriptPlugin:this.findPluginFunctions("js_","",!0),FilePlugin:this.findPluginFunctions("","primitive(Disable)?(File|Directory)"),DropPlugin:this.findPluginFunctions("","primitiveDropRequest"),SoundPlugin:this.findPluginFunctions("snd_"),JPEGReadWriter2Plugin:this.findPluginFunctions("jpeg2_"),SecurityPlugin:{primitiveDisableImageWrite:this.fakePrimitive.bind(this,"SecurityPlugin.primitiveDisableImageWrite",0)}},this.patchModules={ScratchPlugin:this.findPluginFunctions("scratch_")},this.interpreterProxy=new Squeak.InterpreterProxy(this.vm)},findPluginFunctions:function(t,i,n){i=i||"(initialise|shutdown|prim)";var r={},a=new RegExp("^"+t+i,"i");for(var e in this)if(a.test(e)&&"function"==typeof this[e]){var s=e;t&&(s=e[t.length].toLowerCase()+e.slice(t.length+1)),r[s]=n?e:this[e].bind(this)}return r},initDisplay:function(){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]}},"dispatch",{quickSendOther:function(t,e){switch(this.success=!0,e){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.pop2andPushBoolIfOK(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(t,e,i){if(this.success=!0,128>t)switch(t){case 1:return this.popNandPushIntIfOK(2,this.stackInteger(1)+this.stackInteger(0));case 2:return this.popNandPushIntIfOK(2,this.stackInteger(1)-this.stackInteger(0));case 3:return this.pop2andPushBoolIfOK(this.stackInteger(1)this.stackInteger(0));case 5:return this.pop2andPushBoolIfOK(this.stackInteger(1)<=this.stackInteger(0));case 6:return this.pop2andPushBoolIfOK(this.stackInteger(1)>=this.stackInteger(0));case 7:return this.pop2andPushBoolIfOK(this.stackInteger(1)===this.stackInteger(0));case 8:return this.pop2andPushBoolIfOK(this.stackInteger(1)!==this.stackInteger(0));case 9:return this.popNandPushIntIfOK(2,this.stackInteger(1)*this.stackInteger(0));case 10:return this.popNandPushIntIfOK(2,this.vm.quickDivide(this.stackInteger(1),this.stackInteger(0)));case 11:return this.popNandPushIntIfOK(2,this.vm.mod(this.stackInteger(1),this.stackInteger(0)));case 12:return this.popNandPushIntIfOK(2,this.vm.div(this.stackInteger(1),this.stackInteger(0)));case 13:return this.popNandPushIntIfOK(2,this.stackInteger(1)/this.stackInteger(0)|0);case 14:return this.popNandPushIfOK(2,this.doBitAnd());case 15:return this.popNandPushIfOK(2,this.doBitOr());case 16:return this.popNandPushIfOK(2,this.doBitXor());case 17:return this.popNandPushIfOK(2,this.doBitShift());case 18:return this.primitiveMakePoint(e,!1);case 19:return!1;case 20:return!1;case 21:return!1;case 22:return!1;case 23:return this.primitiveLessThanLargeIntegers();case 24:return this.primitiveGreaterThanLargeIntegers();case 25:return this.primitiveLessOrEqualLargeIntegers();case 26:return this.primitiveGreaterOrEqualLargeIntegers();case 27:return this.primitiveEqualLargeIntegers();case 28:return this.primitiveNotEqualLargeIntegers();case 29:return!1;case 30:return!1;case 31:return!1;case 32:return!1;case 33:return!1;case 34:return!1;case 35:return!1;case 36:return!1;case 37:return!1;case 38:return this.popNandPushIfOK(2,this.objectAt(!1,!1,!1));case 39:return this.popNandPushIfOK(3,this.objectAtPut(!1,!1,!1));case 40:return this.popNandPushFloatIfOK(1,this.stackInteger(0));case 41:return this.popNandPushFloatIfOK(2,this.stackFloat(1)+this.stackFloat(0));case 42:return this.popNandPushFloatIfOK(2,this.stackFloat(1)-this.stackFloat(0));case 43:return this.pop2andPushBoolIfOK(this.stackFloat(1)this.stackFloat(0));case 45:return this.pop2andPushBoolIfOK(this.stackFloat(1)<=this.stackFloat(0));case 46:return this.pop2andPushBoolIfOK(this.stackFloat(1)>=this.stackFloat(0));case 47:return this.pop2andPushBoolIfOK(this.stackFloat(1)===this.stackFloat(0));case 48:return this.pop2andPushBoolIfOK(this.stackFloat(1)!==this.stackFloat(0));case 49:return this.popNandPushFloatIfOK(2,this.stackFloat(1)*this.stackFloat(0));case 50:return this.popNandPushFloatIfOK(2,this.safeFDiv(this.stackFloat(1),this.stackFloat(0)));case 51:return this.popNandPushIfOK(1,this.floatAsSmallInt(this.stackFloat(0)));case 52:return!1;case 53:return this.popNandPushIntIfOK(1,this.frexp_exponent(this.stackFloat(0))-1);case 54:return this.popNandPushFloatIfOK(2,this.ldexp(this.stackFloat(1),this.stackFloat(0)));case 55:return this.popNandPushFloatIfOK(1,Math.sqrt(this.stackFloat(0)));case 56:return this.popNandPushFloatIfOK(1,Math.sin(this.stackFloat(0)));case 57:return this.popNandPushFloatIfOK(1,Math.atan(this.stackFloat(0)));case 58:return this.popNandPushFloatIfOK(1,Math.log(this.stackFloat(0)));case 59:return this.popNandPushFloatIfOK(1,Math.exp(this.stackFloat(0)));case 60:return this.popNandPushIfOK(2,this.objectAt(!1,!1,!1));case 61:return this.popNandPushIfOK(3,this.objectAtPut(!1,!1,!1));case 62:return this.popNandPushIfOK(1,this.objectSize(!1));case 63:return this.popNandPushIfOK(2,this.objectAt(!1,!0,!1));case 64:return this.popNandPushIfOK(3,this.objectAtPut(!1,!0,!1));case 65:return!1;case 66:return!1;case 67:return!1;case 68:return this.popNandPushIfOK(2,this.objectAt(!1,!1,!0));case 69:return this.popNandPushIfOK(3,this.objectAtPut(!1,!1,!0));case 70:return this.popNandPushIfOK(1,this.instantiateClass(this.stackNonInteger(0),0));case 71:return this.popNandPushIfOK(2,this.instantiateClass(this.stackNonInteger(1),this.stackPos32BitInt(0)));case 72:return this.primitiveArrayBecome(e,!1);case 73:return this.popNandPushIfOK(2,this.objectAt(!1,!1,!0));case 74:return this.popNandPushIfOK(3,this.objectAtPut(!1,!1,!0));case 75:return this.popNandPushIfOK(1,this.stackNonInteger(0).hash);case 76:return this.primitiveStoreStackp(e);case 77:return this.popNandPushIfOK(1,this.someInstanceOf(this.stackNonInteger(0)));case 78:return this.popNandPushIfOK(1,this.nextInstanceAfter(this.stackNonInteger(0)));case 79:return this.primitiveNewMethod(e);case 80:return this.popNandPushIfOK(2,this.doBlockCopy());case 81:return this.primitiveBlockValue(e);case 82:return this.primitiveBlockValueWithArgs(e);case 83:return this.vm.primitivePerform(e);case 84:return this.vm.primitivePerformWithArgs(e,!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(e);case 91:return this.primitiveTestDisplayDepth(e);case 93:return this.primitiveInputSemaphore(e);case 94:return this.primitiveGetNextEvent(e);case 95:return this.primitiveInputWord(e);case 96:return this.namedPrimitive("BitBltPlugin","primitiveCopyBits",e);case 97:return this.primitiveSnapshot(e);case 99:return this.primitiveLoadImageSegment(e);case 100:return this.vm.primitivePerformWithArgs(e,!0);case 101:return this.primitiveBeCursor(e);case 102:return this.primitiveBeDisplay(e);case 103:return!1;case 104:return!1;case 105:return this.popNandPushIfOK(5,this.doStringReplace()); case 106:return this.primitiveScreenSize(e);case 107:return this.primitiveMouseButtons(e);case 108:return this.primitiveKeyboardNext(e);case 109:return this.primitiveKeyboardPeek(e);case 110:return this.pop2andPushBoolIfOK(this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(e);case 114:return this.primitiveExitToDebugger(e);case 115:return this.primitiveChangeClass(e);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(e,i);case 118:return this.primitiveDoPrimitiveWithArgs(e);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return!1;case 121:return this.primitiveImageName(e);case 122:return this.primitiveReverseDisplay(e);case 124:return this.popNandPushIfOK(2,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(2,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(e);case 127:return this.primitiveShowDisplayRect(e)}else if(256>t)switch(t){case 128:return this.primitiveArrayBecome(e,!0);case 129:return this.popNandPushIfOK(1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(e);case 131:return this.popNandPushIfOK(1,this.vm.image.partialGC());case 132:return this.pop2andPushBoolIfOK(this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return!0;case 134:return this.popNandPushIfOK(2,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(e);case 137:return this.popNandPushIfOK(1,this.secondClock());case 138:return this.popNandPushIfOK(1,this.someObject());case 139:return this.popNandPushIfOK(1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(e);case 141:return this.primitiveClipboardText(e);case 142:return this.popNandPushIfOK(1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(e);case 145:return this.primitiveConstantFill(e);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",e);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",e);case 148:return this.popNandPushIfOK(1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(e);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(e);case 151:if(this.oldPrims)return this.primitiveFileClose(e);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(e);case 153:if(this.oldPrims)return this.primitiveFileOpen(e);case 154:if(this.oldPrims)return this.primitiveFileRead(e);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(e);case 156:if(this.oldPrims)return this.primitiveFileDelete(e);case 157:if(this.oldPrims)return this.primitiveFileSize(e);case 158:if(this.oldPrims)return this.primitiveFileWrite(e);case 159:if(this.oldPrims)return this.primitiveFileRename(e);case 160:if(this.oldPrims)return this.primitiveDirectoryCreate(e);case 161:if(this.oldPrims)return this.primitiveDirectoryDelimitor(e);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(e);case 163:if(this.oldPrims)return this.primitiveDirectoryDelete(e);break;case 165:case 166:return this.primitiveIntegerAtAndPut(e);case 167:return!1;case 168:return this.primitiveCopyObject(e);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(e):this.primitiveNotIdentical(e);case 170:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStart",e);case 171:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",e);case 172:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStop",e);case 173:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",e);case 174:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",e);case 175:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundPlaySilence",e);case 176:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primWaveTableSoundmixSampleCountintostartingAtpan",e);case 177:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primFMSoundmixSampleCountintostartingAtpan",e);case 178:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primPluckedSoundmixSampleCountintostartingAtpan",e);case 179:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primSampledSoundmixSampleCountintostartingAtpan",e);case 180:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primitiveMixFMSound",e);case 181:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primitiveMixPluckedSound",e);case 182:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol",e);case 183:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primitiveApplyReverb",e);case 184:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primitiveMixLoopedSampledSound",e);case 185:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primitiveMixSampledSound",e);break;case 188:if(!this.oldPrims)return this.primitiveExecuteMethodArgsArray(e);break;case 189:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundInsertSamples",e);case 190:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartRecording",e);case 191:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStopRecording",e);case 192:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundGetRecordingSampleRate",e);case 193:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundRecordSamples",e);case 194:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundSetRecordLevel",e);break;case 195:return!1;case 196:return!1;case 197:return!1;case 198:return!1;case 199:return!1;case 200:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveInitializeNetwork",e):this.primitiveClosureCopyWithCopiedValues(e);case 201:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartNameLookup",e):this.primitiveClosureValue(e);case 202:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverNameLookupResult",e):this.primitiveClosureValue(e);case 203:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartAddressLookup",e):this.primitiveClosureValue(e);case 204:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAddressLookupResult",e):this.primitiveClosureValue(e);case 205:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAbortLookup",e):this.primitiveClosureValue(e);case 206:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverLocalAddress",e):this.primitiveClosureValueWithArgs(e);case 207:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveResolverStatus",e);case 208:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveResolverError",e);case 209:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCreate",e);break;case 210:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketDestroy",e):this.popNandPushIfOK(2,this.objectAt(!1,!1,!1));case 211:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketConnectionStatus",e):this.popNandPushIfOK(3,this.objectAtPut(!1,!1,!1));case 212:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketError",e):this.popNandPushIfOK(1,this.objectSize(!1));case 213:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalAddress",e);case 214:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalPort",e);case 215:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemoteAddress",e);case 216:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemotePort",e);case 217:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketConnectToPort",e);case 218:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketListenOnPort",e);case 219:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCloseConnection",e);case 220:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAbortConnection",e);break;case 221:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataBufCount",e):this.primitiveClosureValueNoContextSwitch(e);case 222:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataAvailable",e):this.primitiveClosureValueNoContextSwitch(e);case 223:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDataBufCount",e);case 224:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDone",e);break;case 230:return this.primitiveRelinquishProcessorForMicroseconds(e);case 231:return this.primitiveForceDisplayUpdate(e);case 233:return this.primitiveSetFullScreen(e);case 234:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveDecompressFromByteArray",e);case 235:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompareString",e);case 236:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveConvert8BitSigned",e);case 237:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompressToByteArray",e);case 238:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortOpen",e);case 239:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortClose",e);break;case 240:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortWrite",e):this.popNandPushIfOK(1,this.microsecondClockUTC());case 241:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortRead",e):this.popNandPushIfOK(1,this.microsecondClockLocal());case 243:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveTranslateStringWithTable",e);case 244:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindFirstInString",e);case 245:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveIndexOfAsciiInString",e);case 246:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindSubstring",e);break;case 248:return this.vm.primitiveInvokeObjectAsMethod(e,i);case 249:return this.primitiveArrayBecome(e,!1);case 254:return this.primitiveVMParameter(e)}else switch(t){case 521:return this.namedPrimitive("MIDIPlugin","primitiveMIDIClosePort",e);case 522:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetClock",e);case 523:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortCount",e);case 524:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortDirectionality",e);case 525:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortName",e);case 526:return this.namedPrimitive("MIDIPlugin","primitiveMIDIOpenPort",e);case 527:return this.namedPrimitive("MIDIPlugin","primitiveMIDIParameterGetOrSet",e);case 528:return this.namedPrimitive("MIDIPlugin","primitiveMIDIRead",e);case 529:return this.namedPrimitive("MIDIPlugin","primitiveMIDIWrite",e);case 550:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeMono",e);case 551:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeStereo",e);case 552:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeMono",e);case 553:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeStereo",e);case 571:return this.primitiveUnloadModule(e);case 572:return this.primitiveListBuiltinModule(e);case 573:return this.primitiveListLoadedModule(e)}return console.error("primitive "+t+" not implemented yet"),!1},namedPrimitive:function(e,r,s){var t=""===e?this:this.loadedModules[e];void 0===t&&(t=this.loadModule(e),this.loadedModules[e]=t);var i=!1;if(t){this.interpreterProxy.argCount=s;var n=t[r];"function"==typeof n?i=t[r](s):"string"==typeof n?i=this[n](s):this.vm.warnOnce("missing primitive: "+e+"."+r)}else this.vm.warnOnce("missing module: "+e+" ("+r+")");return i===!0||i===!1?i:this.success},doNamedPrimitive:function(i,e){if(e.pointersSize()<2)return!1;var t=e.pointers[1];if(4!==t.pointersSize())return!1;this.primMethod=e;var r=t.pointers[0].bytesAsString(),s=t.pointers[1].bytesAsString();return this.namedPrimitive(r,s,i)},fakePrimitive:function(i,e,t){return this.vm.warnOnce("faking primitive: "+i),void 0===e?this.vm.popN(t):this.vm.popNandPush(t+1,this.makeStObject(e)),!0}},"modules",{loadModule:function(e){var t=Squeak.externalModules[e]||this.builtinModules[e];if(!t)return null;if(this.patchModules[e]&&this.patchModule(t,e),t.setInterpreter&&!t.setInterpreter(this.interpreterProxy))return console.log("Wrong interpreter proxy version: "+e),null;var i=t.initialiseModule;return"function"==typeof i?t.initialiseModule():"string"==typeof i&&this[i](),this.interpreterProxy.failed()?(console.log("Module initialization failed: "+e),null):(console.log("Loaded module: "+e),t)},patchModule:function(i,r){var e=this.patchModules[r];for(var t in e)i[t]=e[t]},unloadModule:function(t){var e=this.loadedModules[t];if(!t||!e||e===this)return null;delete this.loadedModules[t];var i=e.unloadModule;return"function"==typeof i?e.unloadModule(this):"string"==typeof i&&this[i](this),console.log("Unloaded module: "+t),e},loadFunctionFrom:function(r,t){var e=""===t?this:this.loadedModules[t];if(void 0===e&&(e=this.loadModule(t),this.loadedModules[t]=e),!e)return null;var i=e[r];return"function"==typeof i?i.bind(e):"string"==typeof i?this[i].bind(this):(this.vm.warnOnce("missing primitive: "+t+"."+r),null)},primitiveUnloadModule:function(t){var e=this.stackNonInteger(0).bytesAsString();return e?(this.unloadModule(e),this.popNIfOK(t)):!1},primitiveListBuiltinModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var i=Object.keys(this.builtinModules);return this.popNandPushIfOK(e+1,this.makeStObject(i[t]))},primitiveListLoadedModule:function(r){var s=this.stackInteger(0)-1;if(!this.success)return!1;var t=[];for(var i in this.loadedModules){var e=this.loadedModules[i];if(e){var n=e.getModuleName?e.getModuleName():i;t.push(n)}}return this.popNandPushIfOK(r+1,this.makeStObject(t[s]))}},"stack access",{popNIfOK:function(e){return this.success?(this.vm.popN(e),!0):!1},pop2andPushBoolIfOK:function(e){return this.vm.success=this.success,this.vm.pop2AndPushBoolResult(e)},popNandPushIfOK:function(t,e){return this.success&&null!=e?(this.vm.popNandPush(t,e),!0):!1},popNandPushIntIfOK:function(t,e){return this.success&&this.vm.canBeSmallInt(e)?this.popNandPushIfOK(t,e):!1},popNandPushFloatIfOK:function(e,t){return this.success?this.popNandPushIfOK(e,this.makeFloat(t)):!1},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(e>=0&&e<=Squeak.MaxSmallInt)return e;for(var r=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],i=this.vm.instantiateClass(r,4),s=i.bytes,t=0;4>t;t++)s[t]=e>>>8*t&255;return i},pos64BitIntFor:function(e){if(4294967295>=e)return this.pos32BitIntFor(e);for(var i=0xffffffffff>=e?5:0xffffffffffff>=e?6:72057594037927940>=e?7:8,s=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],r=this.vm.instantiateClass(s,i),n=r.bytes,t=0;i>t;t++)n[t]=255&e,e/=256;return r},stackSigned32BitInt:function(s){var e=this.vm.stackValue(s);if("number"==typeof e)return e;if(4!==e.bytesSize())return this.success=!1,0;for(var n=e.bytes,t=0,i=0,r=1;4>i;i++,r*=256)t+=n[i]*r;return this.isA(e,Squeak.splOb_ClassLargePositiveInteger)?t:this.isA(e,Squeak.splOb_ClassLargeNegativeInteger)?-t:(this.success=!1,0)},signed32BitIntegerFor:function(e){if(e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return e;for(var i=0>e,s=i?-e:e,n=i?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,r=this.vm.instantiateClass(this.vm.specialObjects[n],4),a=r.bytes,t=0;4>t;t++)a[t]=s>>>8*t&255;return r},stackFloat:function(e){return this.checkFloat(this.vm.stackValue(e))},stackBoolean:function(e){return this.checkBoolean(this.vm.stackValue(e))},stackSigned53BitInt:function(n){var e=this.vm.stackValue(n);if("number"==typeof e)return e;var r=e.bytesSize();if(7>=r){for(var a=e.bytes,t=0,i=0,s=1;r>i;i++,s*=256)t+=a[i]*s;if(9007199254740992>t){if(this.isA(e,Squeak.splOb_ClassLargePositiveInteger))return t;if(this.isA(e,Squeak.splOb_ClassLargeNegativeInteger))return-t}}return this.success=!1,0}},"numbers",{doBitAnd:function(){var e=this.stackPos32BitInt(1),t=this.stackPos32BitInt(0);return this.success?this.pos32BitIntFor(e&t):0},doBitOr:function(){var e=this.stackPos32BitInt(1),t=this.stackPos32BitInt(0);return this.success?this.pos32BitIntFor(e|t):0},doBitXor:function(){var e=this.stackPos32BitInt(1),t=this.stackPos32BitInt(0);return this.success?this.pos32BitIntFor(e^t):0},doBitShift:function(){var e=this.stackPos32BitInt(1),t=this.stackInteger(0);if(!this.success)return 0;var i=this.vm.safeShift(e,t);return i>0?this.pos32BitIntFor(this.vm.safeShift(e,t)):(this.success=!1,0)},safeFDiv:function(t,e){return 0===e?(this.success=!1,1):t/e},floatAsSmallInt:function(e){var t=e>=0?Math.floor(e):Math.ceil(e);return this.ensureSmallInt(t)},frexp_exponent:function(t){if(0==t)return 0;var e=new DataView(new ArrayBuffer(8));e.setFloat64(0,t);var i=e.getUint32(0)>>>20&2047;0===i&&(e.setFloat64(0,t*Math.pow(2,64)),i=(e.getUint32(0)>>>20&2047)-64);var r=i-1022;return r},ldexp:function(t,e){return e>1023?t*Math.pow(2,1023)*Math.pow(2,e-1023):-1074>e?t*Math.pow(2,-1074)*Math.pow(2,e+1074):t*Math.pow(2,e)},primitiveLessThanLargeIntegers:function(){return this.pop2andPushBoolIfOK(this.stackSigned53BitInt(1)this.stackSigned53BitInt(0))},primitiveLessOrEqualLargeIntegers:function(){return this.pop2andPushBoolIfOK(this.stackSigned53BitInt(1)<=this.stackSigned53BitInt(0))},primitiveGreaterOrEqualLargeIntegers:function(){return this.pop2andPushBoolIfOK(this.stackSigned53BitInt(1)>=this.stackSigned53BitInt(0))},primitiveEqualLargeIntegers:function(){return this.pop2andPushBoolIfOK(this.stackSigned53BitInt(1)===this.stackSigned53BitInt(0))},primitiveNotEqualLargeIntegers:function(){return this.pop2andPushBoolIfOK(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 e>=0?e:(this.success=!1,0);if(!this.isA(e,Squeak.splOb_ClassLargePositiveInteger)||4!==e.bytesSize())return this.success=!1,0;for(var s=e.bytes,i=0,t=0,r=1;4>t;t++,r*=256)i+=s[t]*r;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?!0:e.isFalse?!1:this.success=!1},indexableSize:function(e){if("number"==typeof e)return-1;var t=e.format;return 2>t?-1:3===t&&this.vm.isContext(e)&&!this.allowAccessBeyondSP?e.pointers[Squeak.Context_stackPointer]:6>t?e.pointersSize()-e.instSize():8>t?e.wordsSize():12>t?e.bytesSize():e.bytesSize()+4*e.pointersSize()},isA:function(e,t){return e.sqClass===this.vm.specialObjects[t]},isKindOf:function(t,i){for(var e=t.sqClass,r=this.vm.specialObjects[i];!e.isNil;){if(e===r)return!0;e=e.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=this.vm.specialObjects[Squeak.splOb_CharacterTable];return t.pointers[e]},makeFloat:function(t){var i=this.vm.specialObjects[Squeak.splOb_ClassFloat],e=this.vm.instantiateClass(i,2);return e.float=t,e},makeLargeIfNeeded:function(e){return this.vm.canBeSmallInt(e)?e:this.makeLargeInt(e)},makeLargeInt:function(e){if(0>e)throw Error("negative large ints not implemented yet");if(e>4294967295)throw Error("large large ints not implemented yet");return this.pos32BitIntFor(e)},makePointWithXandY:function(t,i){var r=this.vm.specialObjects[Squeak.splOb_ClassPoint],e=this.vm.instantiateClass(r,0);return e.pointers[Squeak.Point_x]=t,e.pointers[Squeak.Point_y]=i,e},makeStArray:function(t,r){for(var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t.length),e=0;e=0:!1},asUint8Array:function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if("string"==typeof e){for(var i=new Uint8Array(e.length),t=0;tt||t>i.size)return this.success=!1,e;if(r)return e.pointers[t-1];if(e.format<6)return e.pointers[t-1+i.ivarOffset];if(e.format<8)return this.pos32BitIntFor(e.words[t-1]);if(e.format<12)return i.convertChars?this.charFromInt(255&e.bytes[t-1]):255&e.bytes[t-1];var n=4*e.pointersSize();return 0>t-1-n?(this.success=!1,e):255&e.bytes[t-1-n]},objectAtPut:function(c,n,u){var e=this.stackNonInteger(2),i=this.stackPos32BitInt(1);if(!this.success)return e;var s;if(c){if(s=this.atPutCache[e.hash&this.atCacheMask],s.array!==e)return this.success=!1,e}else{if(e.isFloat){var l=this.stackPos32BitInt(0);if(!this.success||1!=i&&2!=i)this.success=!1;else{var o=e.floatData();o.setUint32(1==i?0:4,l,!1),e.float=o.getFloat64(0)}return this.vm.stackValue(0)}s=this.makeAtCacheInfo(this.atPutCache,this.vm.specialSelectors[34],e,n,u)}if(1>i||i>s.size)return this.success=!1,e;var t=this.vm.stackValue(0);if(u)return e.pointers[i-1]=t;if(e.format<6)return e.pointers[i-1+s.ivarOffset]=t;var r;if(e.format<8)return r=this.stackPos32BitInt(0),this.success&&(e.words[i-1]=r),t;if(n){if(t.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,t;if(r=t.pointers[0],"number"!=typeof r)return this.success=!1,t}else{if("number"!=typeof t)return this.success=!1,t;r=t}if(0>r||r>255)return this.success=!1,t;if(e.format<8)return e.bytes[i-1]=r;var a=4*e.pointersSize();return 0>i-1-a?(this.success=!1,e):(e.bytes[i-1-a]=r,t)},objectSize:function(i){var e=this.vm.stackValue(0),t=-1;return i?e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]?t=e.pointersSize():e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassString]&&(t=e.bytesSize()):t=this.indexableSize(e),-1===t?(this.success=!1,-1):this.pos32BitIntFor(t)},initAtCache:function(){this.atCacheSize=32,this.atCacheMask=this.atCacheSize-1,this.atCache=[],this.atPutCache=[],this.nonCachedInfo={};for(var e=0;ethis.vm.image.bytesLeft()?(console.warn("squeak: out of memory"),this.success=!1,null):this.vm.instantiateClass(t,e)},someObject:function(){return this.vm.image.firstOldObject},nextObject:function(e){return this.vm.image.objectAfter(e)||0},someInstanceOf:function(t){var e=this.vm.image.someInstanceOf(t);return e?e:(this.success=!1,0)},nextInstanceAfter:function(t){var e=this.vm.image.nextInstanceAfter(t);return e?e:(this.success=!1,0)},primitiveFullGC:function(){this.vm.image.fullGC("primitive");var e=this.vm.image.bytesLeft();return this.popNandPushIfOK(1,this.makeLargeIfNeeded(e))},primitiveMakePoint:function(i,r){var e=this.vm.stackValue(1),t=this.vm.stackValue(0);return r&&(this.checkFloat(e),this.checkFloat(t),!this.success)?!1:(this.vm.popNandPush(1+i,this.makePointWithXandY(e,t)),!0)},primitiveStoreStackp:function(r){var e=this.stackNonInteger(1),t=this.stackInteger(0);if(!this.success||0>t||this.vm.decodeSqueakSP(t)>=e.pointers.length)return!1;for(var i=e.pointers[Squeak.Context_stackPointer];t>i;)e.pointers[this.vm.decodeSqueakSP(++i)]=this.vm.nilObj;return e.pointers[Squeak.Context_stackPointer]=t,this.vm.popN(r),!0},primitiveChangeClass:function(i){if(1!==i)return!1;var e=this.stackNonInteger(1),t=this.stackNonInteger(0);return this.success?e.format!==t.format||e.sqClass.isCompact!==t.sqClass.isCompact||e.sqClass.classInstSize()!==t.sqClass.classInstSize()?!1:(e.sqClass=t.sqClass,this.popNIfOK(1)):!1},primitiveDoPrimitiveWithArgs:function(){var t=this.stackNonInteger(0),r=this.stackInteger(1);if(!this.success)return!1;var e=t.pointersSize(),s=this.vm.activeContext.pointersSize();if(this.vm.sp+e>=s)return!1;this.vm.popN(2);for(var i=0;e>i;i++)this.vm.push(t.pointers[i]);return this.vm.tryPrimitive(r,e)?!0:(this.vm.popN(e),this.vm.push(r),this.vm.push(t),!1)},primitiveShortAtAndPut:function(t){var s=this.stackNonInteger(t),i=this.stackInteger(t-1)-1,r=s.wordsAsInt16Array();if(!this.success||!r||0>i||i>=r.length)return!1;var e;if(2>t)e=r[i];else{if(e=this.stackInteger(0),-32768>e||e>32767)return!1;r[i]=e}return this.popNandPushIfOK(t+1,e),!0},primitiveIntegerAtAndPut:function(e){var s=this.stackNonInteger(e),t=this.stackInteger(e-1)-1,i=s.wordsAsInt32Array();if(!this.success||!i||0>t||t>=i.length)return!1;var r;if(2>e)r=this.signed32BitIntegerFor(i[t]);else{if(r=this.stackSigned32BitInt(0),!this.success)return!1;i[t]=r}return this.popNandPushIfOK(e+1,r),!0},primitiveConstantFill:function(s){var e=this.stackNonInteger(1),r=this.stackPos32BitInt(0);if(!this.success||!e.isWordsOrBytes())return!1;var t=e.words||e.bytes;if(t){if(t===e.bytes&&r>255)return!1;for(var i=0;i>9&255,e=this.vm.instantiateClass(this.vm.stackValue(2),s);e.pointers=[t];for(var i=0;n>i;i++)e.pointers.push(this.vm.nilObj);return this.vm.popNandPush(1+r,e),this.vm.breakOnNewMethod&&(this.vm.breakOnMethod=e),!0},primitiveExecuteMethodArgsArray:function(r){var e=this.stackNonInteger(0),s=this.stackNonInteger(1),n=this.vm.stackValue(2);if(!this.success||!this.vm.isMethod(e)||r>4)return!1;var t=e.methodNumArgs();if(t!==s.pointersSize())return!1;this.vm.popNandPush(r+1,n);for(var i=0;t>i;i++)this.vm.push(s.pointers[i]);return this.vm.executeNewMethod(n,e,t,e.methodPrimitiveIndex(),null,null),!0},primitiveArrayBecome:function(e,t){var i=this.stackNonInteger(e),r=this.stackNonInteger(e-1),s=e>1?this.stackBoolean(e-2):!0;return this.success?(this.success=this.vm.image.bulkBecome(i.pointers,r.pointers,t,s),this.popNIfOK(e)):!1},doStringReplace:function(){var e=this.stackNonInteger(4),i=this.stackInteger(3)-1,s=this.stackInteger(2)-i,a=this.stackNonInteger(1),r=this.stackInteger(0)-1;if(!this.success)return e;var o=a.format,u=e.format;if(8>u){if(u!=o)return this.success=!1,e;if((12&u)!=(12&o))return this.success=!1,e}if(4>o){var n=a.pointersSize(),l=a.instSize();if(r+=l,0>r||r+s>n)return this.success=!1,e;n=e.pointersSize();var c=e.instSize();if(i+=c,0>i||i+s>n)return this.success=!1,e;for(var t=0;s>t;t++)e.pointers[i+t]=a.pointers[r+t];return e}if(8>o){var n=a.wordsSize();if(0>r||r+s>n)return this.success=!1,e;if(n=e.wordsSize(),0>i||i+s>n)return this.success=!1,e;for(var t=0;s>t;t++)e.words[i+t]=a.words[r+t];return e}var n=a.bytesSize();if(0>r||r+s>n)return this.success=!1,e;if(n=e.bytesSize(),0>i||i+s>n)return this.success=!1,e;for(var t=0;s>t;t++)e.bytes[i+t]=a.bytes[r+t];return e},primitiveCopyObject:function(s){var e=this.stackNonInteger(1),i=this.stackNonInteger(0),r=e.pointersSize();if(!this.success||e.isWordsOrBytes()||e.sqClass!==i.sqClass||r!==i.pointersSize())return!1;for(var t=0;r>t;t++)i.pointers[t]=e.pointers[t];return this.vm.pop(s),!0},primitiveLoadImageSegment:function(r){var e=this.stackNonInteger(1),t=this.stackNonInteger(0);if(!e.words||!t.pointers)return!1;var i=this.vm.image.loadImageSegment(e,t);return i?this.popNandPushIfOK(r+1,i):!1}},"blocks/closures",{doBlockCopy:function(){var i=this.vm.stackValue(1),s=this.stackInteger(0),e=i;if(this.vm.isContext(e)||(this.success=!1),!this.success)return i;"number"==typeof e.pointers[Squeak.Context_method]&&(e=e.pointers[Squeak.BlockContext_home]);var n=e.pointersSize()-e.instSize(),t=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassBlockContext],n),r=this.vm.encodeSqueakPC(this.vm.pc+2,this.vm.method);return t.pointers[Squeak.BlockContext_initialIP]=r,t.pointers[Squeak.Context_instructionPointer]=r,t.pointers[Squeak.Context_stackPointer]=0,t.pointers[Squeak.BlockContext_argumentCount]=s,t.pointers[Squeak.BlockContext_home]=e,t.pointers[Squeak.Context_sender]=this.vm.nilObj,t},primitiveBlockValue:function(t){var i=this.vm.stackValue(t);if(!this.isA(i,Squeak.splOb_ClassBlockContext))return!1;var e=i,r=e.pointers[Squeak.BlockContext_argumentCount];if("number"!=typeof r)return!1;if(r!=t)return!1;if(!e.pointers[Squeak.BlockContext_caller].isNil)return!1;this.vm.arrayCopy(this.vm.activeContext.pointers,this.vm.sp-t+1,e.pointers,Squeak.Context_tempFrameStart,t);var s=e.pointers[Squeak.BlockContext_initialIP];return e.pointers[Squeak.Context_instructionPointer]=s,e.pointers[Squeak.Context_stackPointer]=t,e.pointers[Squeak.BlockContext_caller]=this.vm.activeContext,this.vm.popN(t+1),this.vm.newActiveContext(e),!0},primitiveBlockValueWithArgs:function(r){var e=this.vm.stackValue(1),i=this.vm.stackValue(0);if(!this.isA(e,Squeak.splOb_ClassBlockContext))return!1;if(!this.isA(i,Squeak.splOb_ClassArray))return!1;var t=e.pointers[Squeak.BlockContext_argumentCount]; if("number"!=typeof t)return!1;if(t!=i.pointersSize())return!1;if(!e.pointers[Squeak.BlockContext_caller].isNil)return!1;this.vm.arrayCopy(i.pointers,0,e.pointers,Squeak.Context_tempFrameStart,t);var s=e.pointers[Squeak.BlockContext_initialIP];return e.pointers[Squeak.Context_instructionPointer]=s,e.pointers[Squeak.Context_stackPointer]=t,e.pointers[Squeak.BlockContext_caller]=this.vm.activeContext,this.vm.popN(r+1),this.vm.newActiveContext(e),!0},primitiveClosureCopyWithCopiedValues:function(){return this.vm.breakNow("primitiveClosureCopyWithCopiedValues"),!1},primitiveClosureValue:function(e){var t=this.vm.stackValue(e),i=t.pointers[Squeak.Closure_numArgs];return e!==i?!1:this.activateNewClosureMethod(t,e)},primitiveClosureValueWithArgs:function(s){var i=this.vm.top(),e=i.pointersSize(),r=this.vm.stackValue(s),n=r.pointers[Squeak.Closure_numArgs];if(e!==n)return!1;this.vm.pop();for(var t=0;e>t;t++)this.vm.push(i.pointers[t]);return this.activateNewClosureMethod(r,e)},primitiveClosureValueNoContextSwitch:function(e){return this.primitiveClosureValue(e)},activateNewClosureMethod:function(i,r){var s=i.pointers[Squeak.Closure_outerContext],o=s.pointers[Squeak.Context_method],e=this.vm.allocateOrRecycleContext(o.methodNeedsLargeFrame()),n=i.pointers.length-Squeak.Closure_firstCopiedValue;e.pointers[Squeak.Context_sender]=this.vm.activeContext,e.pointers[Squeak.Context_instructionPointer]=i.pointers[Squeak.Closure_startpc],e.pointers[Squeak.Context_stackPointer]=r+n,e.pointers[Squeak.Context_method]=s.pointers[Squeak.Context_method],e.pointers[Squeak.Context_closure]=i,e.pointers[Squeak.Context_receiver]=s.pointers[Squeak.Context_receiver];for(var a=Squeak.Context_tempFrameStart,t=0;r>t;t++)e.pointers[a++]=this.vm.stackValue(r-t-1);for(var t=0;n>t;t++)e.pointers[a++]=i.pointers[Squeak.Closure_firstCopiedValue+t];return this.vm.popN(r+1),this.vm.newActiveContext(e),!0}},"scheduling",{primitiveResume:function(){return this.resume(this.vm.top()),!0},primitiveSuspend:function(){var e=this.getScheduler().pointers[Squeak.ProcSched_activeProcess];return this.vm.top()!==e?!1:(this.vm.popNandPush(1,this.vm.nilObj),this.transferTo(this.pickTopProcess()),!0)},getScheduler:function(){var e=this.vm.specialObjects[Squeak.splOb_SchedulerAssociation];return e.pointers[Squeak.Assn_value]},resume:function(e){var t=this.getScheduler().pointers[Squeak.ProcSched_activeProcess],i=t.pointers[Squeak.Proc_priority],r=e.pointers[Squeak.Proc_priority];r>i?(this.putToSleep(t),this.transferTo(e)):this.putToSleep(e)},putToSleep:function(e){var t=e.pointers[Squeak.Proc_priority],i=this.getScheduler().pointers[Squeak.ProcSched_processLists],r=i.pointers[t-1];this.linkProcessToList(e,r)},transferTo:function(e){var t=this.getScheduler(),i=t.pointers[Squeak.ProcSched_activeProcess];t.pointers[Squeak.ProcSched_activeProcess]=e,i.pointers[Squeak.Proc_suspendedContext]=this.vm.activeContext,this.vm.newActiveContext(e.pointers[Squeak.Proc_suspendedContext]),e.pointers[Squeak.Proc_suspendedContext]=this.vm.nilObj,this.vm.reclaimableContextCount=0,this.vm.breakOnContextChanged&&(this.vm.breakOnContextChanged=!1,this.vm.breakNow())},pickTopProcess:function(){var e,t=this.getScheduler().pointers[Squeak.ProcSched_processLists],i=t.pointersSize()-1;do{if(0>i)throw Error("scheduler could not find a runnable process");e=t.pointers[i--]}while(this.isEmptyList(e));return this.removeFirstLinkOfList(e)},linkProcessToList:function(t,e){if(this.isEmptyList(e))e.pointers[Squeak.LinkedList_firstLink]=t;else{var i=e.pointers[Squeak.LinkedList_lastLink];i.pointers[Squeak.Link_nextLink]=t}e.pointers[Squeak.LinkedList_lastLink]=t,t.pointers[Squeak.Proc_myList]=e},isEmptyList:function(e){return e.pointers[Squeak.LinkedList_firstLink].isNil},removeFirstLinkOfList:function(e){var t=e.pointers[Squeak.LinkedList_firstLink],i=e.pointers[Squeak.LinkedList_lastLink];if(t===i)e.pointers[Squeak.LinkedList_firstLink]=this.vm.nilObj,e.pointers[Squeak.LinkedList_lastLink]=this.vm.nilObj;else{var r=t.pointers[Squeak.Link_nextLink];e.pointers[Squeak.LinkedList_firstLink]=r}return t.pointers[Squeak.Link_nextLink]=this.vm.nilObj,t},registerSemaphore:function(t){var e=this.vm.top();return this.vm.specialObjects[t]=this.isA(e,Squeak.splOb_ClassSemaphore)?e:this.vm.nilObj,this.vm.stackValue(1)},primitiveWait:function(){var e=this.vm.top();if(!this.isA(e,Squeak.splOb_ClassSemaphore))return!1;var t=e.pointers[Squeak.Semaphore_excessSignals];if(t>0)e.pointers[Squeak.Semaphore_excessSignals]=t-1;else{var i=this.getScheduler().pointers[Squeak.ProcSched_activeProcess];this.linkProcessToList(i,e),this.transferTo(this.pickTopProcess())}return!0},primitiveSignal:function(){var e=this.vm.top();return this.isA(e,Squeak.splOb_ClassSemaphore)?(this.synchronousSignal(e),!0):!1},synchronousSignal:function(e){this.isEmptyList(e)?e.pointers[Squeak.Semaphore_excessSignals]++:this.resume(this.removeFirstLinkOfList(e))},primitiveSignalAtMilliseconds:function(t){{var i=this.stackInteger(0),e=this.stackNonInteger(1);this.stackNonInteger(2)}return this.success?(this.isA(e,Squeak.splOb_ClassSemaphore)?(this.vm.specialObjects[Squeak.splOb_TheTimerSemaphore]=e,this.vm.nextWakeupTick=i):(this.vm.specialObjects[Squeak.splOb_TheTimerSemaphore]=this.vm.nilObj,this.vm.nextWakeupTick=0),this.vm.popN(t),!0):!1},signalSemaphoreWithIndex:function(e){this.semaphoresToSignal.push(e)},signalExternalSemaphores:function(){for(var t=this.vm.specialObjects[Squeak.splOb_ExternalObjectsArray].pointers,i=this.vm.specialObjects[Squeak.splOb_ClassSemaphore];this.semaphoresToSignal.length;){var r=this.semaphoresToSignal.shift(),e=t[r-1];e.sqClass==i&&this.synchronousSignal(e)}}},"vm functions",{primitiveGetAttribute:function(t){var i=this.stackInteger(0);if(!this.success)return!1;var e;switch(i){case 0:e=this.filenameToSqueak(Squeak.vmPath+Squeak.vmFile);break;case 1:e=this.display.documentName||null;break;case 2:e=this.display.documentName||null;break;case 1001:e=Squeak.platformName;break;case 1002:e=Squeak.osVersion;break;case 1003:e=Squeak.platformSubtype;break;case 1004:e=Squeak.vmVersion;break;case 1005:e=Squeak.windowSystem;break;case 1006:e=Squeak.vmBuild;break;case 1007:e=Squeak.vmVersion;break;case 1009:e=Squeak.vmVersion;break;default:return!1}return this.vm.popNandPush(t+1,this.makeStObject(e)),!0},setLowSpaceThreshold:function(){var e=this.stackInteger(0);return this.success&&(this.vm.lowSpaceThreshold=e),this.vm.stackValue(1)},primitiveVMParameter:function(r){var t=41;switch(r){case 0:for(var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t),e=0;t>e;e++)i.pointers[e]=this.makeStObject(this.vmParameterAt(e+1));return this.popNandPushIfOK(1,i);case 1:var s=this.stackInteger(0);return this.popNandPushIfOK(2,this.makeStObject(this.vmParameterAt(s)));case 2:return this.popNandPushIfOK(3,0)}return!1},vmParameterAt:function(e){switch(e){case 1:return this.vm.image.oldSpaceBytes;case 2:return this.vm.image.oldSpaceBytes;case 3:return this.vm.image.totalMemory;case 4:return this.vm.image.allocationCount+this.vm.image.newSpaceCount;case 7:return this.vm.image.gcCount;case 8:return this.vm.image.gcMilliseconds;case 9:return 1;case 10:return 0;case 11:return this.vm.image.gcTenured;case 40:return 4;case 41:return this.vm.image.formatVersion()}return null},primitiveImageName:function(e){return 0==e?this.popNandPushIfOK(1,this.makeStString(this.filenameToSqueak(this.vm.image.name))):(this.vm.image.name=this.filenameFromSqueak(this.vm.top().bytesAsString()),window.localStorage.squeakImageName=this.vm.image.name,!0)},primitiveSnapshot:function(){this.vm.popNandPush(1,this.vm.trueObj),this.vm.storeContextRegisters();var e=this.getScheduler().pointers[Squeak.ProcSched_activeProcess];e.pointers[Squeak.Proc_suspendedContext]=this.vm.activeContext,this.vm.image.fullGC("snapshot");var t=this.vm.image.writeToBuffer();return Squeak.flushAllFiles(),Squeak.filePut(this.vm.image.name,t),this.vm.popNandPush(1,this.vm.falseObj),!0},primitiveQuit:function(){return Squeak.flushAllFiles(),this.display.quitFlag=!0,this.vm.breakNow("quit"),!0},primitiveExitToDebugger:function(){return this.vm.breakNow("debugger primitive"),!0},primitiveSetGCBiasToGrow:function(e){return this.fakePrimitive(".primitiveSetGCBiasToGrow",0,e)},primitiveSetGCBiasToGrowGCLimit:function(e){return this.fakePrimitive(".primitiveSetGCBiasToGrowGCLimit",0,e)}},"display",{primitiveBeCursor:function(r){if(this.display.cursorCanvas){var e=this.loadForm(this.stackNonInteger(r),!0),a=1===r?this.loadForm(this.stackNonInteger(0)):null;if(!this.success||!e)return!1;var t=this.display.cursorCanvas,s=t.getContext("2d"),n={left:0,top:0,right:e.width,bottom:e.height};t.width=e.width,t.height=e.height,1===e.depth?a?(e=this.cursorMergeMask(e,a),this.showForm(s,e,n,[0,4278190335,4294967295,4278190080])):this.showForm(s,e,n,[0,4278190080]):this.showForm(s,e,n,!0);var o=this.display.context.canvas,i=o.offsetWidth/o.width;t.style.width=(t.width*i|0)+"px",t.style.height=(t.height*i|0)+"px",this.display.cursorOffsetX=e.offsetX*i|0,this.display.cursorOffsetY=e.offsetY*i|0}return this.vm.popN(r),!0},cursorMergeMask:function(t,a){for(var n=new Uint32Array(16),e=0;16>e;e++){for(var o=t.bits[e],u=a.bits[e],r=2147483648,s=0,i=0;16>i;i++)s=s|(u&r)>>i|(o&r)>>i+1,r>>>=1;n[e]=s}return{obj:t.obj,bits:n,depth:2,width:16,height:16,offsetX:t.offsetX,offsetY:t.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(){if(this.reverseDisplay=!this.reverseDisplay,this.redrawDisplay(),this.display.cursorCanvas){for(var t=this.display.cursorCanvas,r=t.getContext("2d"),s=r.getImageData(0,0,t.width,t.height),i=new Uint32Array(s.data.buffer),e=0;ee.left&&(e.left=t.left),t.righte.top&&(e.top=t.top),t.bottomv;v++){var a=this.indexedColors[v],y=(4278255360&a)+((16711680&a)>>16)+((255&a)<<16);i[v]=y}this.swappedColors=i}this.reverseDisplay&&(d?i=d.map(function(e){return 16777215^e}):(this.reversedColors||(this.reversedColors=i.map(function(e){return 16777215^e})),i=this.reversedColors));for(var O=(1<t;t++){for(var p=e.pitch*r+(o/e.pixPerWord|0),l=S,m=e.bits[p],b=s.width*t,u=0;h>u;u++)k[b++]=i[m>>>l&O],(l-=e.depth)<0&&(l=32-e.depth,m=e.bits[++p]);r++}break;case 16:for(var S=o%2?0:16,t=0;f>t;t++){for(var p=e.pitch*r+(o/2|0),l=S,m=e.bits[p],b=s.width*t,u=0;h>u;u++){var g=m>>>l;k[b++]=((31744&g)>>7)+((992&g)<<6)+((31&g)<<19)+4278190080,(l-=16)<0&&(l=16,m=e.bits[++p])}r++}break;case 32:for(var I=d?0:4278190080,t=0;f>t;t++){for(var p=e.pitch*r+o,b=s.width*t,u=0;h>u;u++){var a=e.bits[p++],y=4278255360&a|(16711680&a)>>16|(255&a)<<16|I;k[b++]=y}r++}break;default:throw Error("depth not implemented")}s.data!==c&&s.data.set(c),F.putImageData(s,n.left,n.top)}},primitiveDeferDisplayUpdates:function(e){var t=this.stackBoolean(0);return this.success?(this.deferDisplayUpdates=t,this.vm.popN(e),!0):!1},primitiveForceDisplayUpdate:function(e){return this.vm.breakOut(),this.vm.popN(e),!0},primitiveScreenSize:function(t){var e=this.display,i=e.width||e.context.canvas.width,r=e.height||e.context.canvas.height;return this.popNandPushIfOK(t+1,this.makePointWithXandY(i,r))},primitiveSetFullScreen:function(t){var e=this.stackBoolean(0);if(!this.success)return!1;if(this.display.fullscreen!=e)if(this.display.fullscreenRequest){var i=this.vm.freeze();this.display.fullscreenRequest(e,function(){i()})}else this.display.fullscreen=e,this.vm.breakOut();return this.vm.popN(t),!0},primitiveTestDisplayDepth:function(){var e=[1,2,4,8,16,32];return this.pop2andPushBoolIfOK(e.indexOf(this.stackInteger(0))>=0)},loadForm:function(t,r){if(t.isNil)return null;var e={obj:t,bits:t.pointers[Squeak.Form_bits].wordsOrBytes(),depth:t.pointers[Squeak.Form_depth],width:t.pointers[Squeak.Form_width],height:t.pointers[Squeak.Form_height]};if(r){var i=t.pointers[Squeak.Form_offset];e.offsetX=i.pointers?i.pointers[Squeak.Point_x]:0,e.offsetY=i.pointers?i.pointers[Squeak.Point_y]:0}return 0===e.width||0===e.height?e:e.width>0&&e.height>0?(e.msb=e.depth>0,e.msb||(e.depth=-e.depth),e.depth>0?(e.pixPerWord=32/e.depth,e.pitch=(e.width+(e.pixPerWord-1))/e.pixPerWord|0,e.bits.length!==e.pitch*e.height?null:e):null):null},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(i){var e=Squeak.startAudioOut();if(e){var t=e.createOscillator();t.connect(e.destination),t.frequency.value=880,t.noteOn(0),t.noteOff(e.currentTime+.2)}else this.vm.warnOnce("could not initialize audio");return this.popNIfOK(i)}},"input",{primitiveClipboardText:function(e){if(0===e){if("string"!=typeof this.display.clipboardString)return!1;this.vm.popNandPush(1,this.makeStString(this.display.clipboardString))}else if(1===e){var t=this.vm.top();t.bytes&&(this.display.clipboardString=t.bytesAsString(),this.display.clipboardStringChanged=!0),this.vm.pop()}return!0},primitiveKeyboardNext:function(e){return this.popNandPushIfOK(e+1,this.ensureSmallInt(this.display.keys.shift()))},primitiveKeyboardPeek:function(e){var t=this.display.keys.length;return this.popNandPushIfOK(e+1,t?this.ensureSmallInt(this.display.keys[0]||0):this.vm.nilObj)},primitiveMouseButtons:function(e){return this.popNandPushIfOK(e+1,this.ensureSmallInt(this.display.buttons)),this.vm.breakOut(),this.display.idle++>20&&this.vm.goIdle(),!0},primitiveMousePoint:function(e){var t=this.ensureSmallInt(this.display.mouseX),i=this.ensureSmallInt(this.display.mouseY);return this.popNandPushIfOK(e+1,this.makePointWithXandY(t,i))},primitiveInputSemaphore:function(){var e=this.stackInteger(0);return this.success?(this.inputEventSemaIndex=e,this.display.signalInputEvent=function(){this.signalSemaphoreWithIndex(this.inputEventSemaIndex)}.bind(this),!0):!1},primitiveInputWord:function(){return this.popNandPushIfOK(1,0)},primitiveGetNextEvent:function(){this.display.idle++;var e=this.stackNonInteger(0);return this.display.getNextEvent?(this.display.getNextEvent(e.pointers,this.vm.startupTime),!0):!1}},"time",{primitiveRelinquishProcessorForMicroseconds:function(e){return this.vm.pop(e),this.vm.goIdle(),!0},millisecondClockValue:function(){return Date.now()-this.vm.startupTime&Squeak.MillisecondClockMask},millisecondClockValueSet:function(e){this.vm.startupTime=Date.now()-e},secondClock:function(){return this.pos32BitIntFor(Squeak.totalSeconds())},microsecondClockUTC:function(){var e=Date.now()-Squeak.EpochUTC;return this.pos64BitIntFor(1e3*e)},microsecondClockLocal:function(){var e=Date.now()-Squeak.Epoch;return this.pos64BitIntFor(1e3*e)}},"FilePlugin",{primitiveDirectoryCreate:function(t){var i=this.stackNonInteger(0);if(!this.success)return!1;var e=this.filenameFromSqueak(i.bytesAsString());if(this.success=Squeak.dirCreate(e),!this.success){var r=Squeak.splitFilePath(e);console.log("Directory not created: "+r.fullname)}return this.popNIfOK(t)},primitiveDirectoryDelete:function(e){var t=this.stackNonInteger(0);if(!this.success)return!1;var i=this.filenameFromSqueak(t.bytesAsString());return this.success=Squeak.dirDelete(i),this.popNIfOK(e)},primitiveDirectoryDelimitor:function(){var e=this.emulateMac?":":"/";return this.popNandPushIfOK(1,this.charFromInt(e.charCodeAt(0)))},primitiveDirectoryEntry:function(){return this.vm.warnOnce("Not yet implemented: primitiveDirectoryEntry"),!1},primitiveDirectoryLookup:function(n){var i=this.stackInteger(0),a=this.stackNonInteger(1);if(!this.success)return!1;var r=a.bytesAsString(),s=this.filenameFromSqueak(r),t=Squeak.dirList(s,!0);if(!t){var o=Squeak.splitFilePath(s);return console.log("Directory not found: "+o.fullname),!1}var u=Object.keys(t).sort(),e=t[u[i-1]];return"/"===r&&(1===i?(e||(e=[0,0,0,0,0]),e[0]="SqueakJS",e[3]=!0):e=null),this.popNandPushIfOK(n+1,this.makeStObject(e)),!0},primitiveDirectorySetMacTypeAndCreator:function(e){return this.popNIfOK(e)},primitiveFileAtEnd:function(t){var e=this.stackNonInteger(0);return this.success&&e.file?(this.popNandPushIfOK(t+1,this.makeStObject(e.filePos>=e.file.size)),!0):!1},primitiveFileClose:function(t){var e=this.stackNonInteger(0);return this.success&&e.file?(this.fileClose(e.file),this.vm.breakOut(),e.file=null,this.popNIfOK(t)):!1},primitiveFileDelete:function(e){var t=this.stackNonInteger(0);if(!this.success)return!1;var i=this.filenameFromSqueak(t.bytesAsString());return this.success=Squeak.fileDelete(i),this.popNIfOK(e)},primitiveFileFlush:function(t){var e=this.stackNonInteger(0);return this.success&&e.file?(Squeak.flushFile(e.file),this.vm.breakOut(),this.popNIfOK(t)):!1},primitiveFileGetPosition:function(t){var e=this.stackNonInteger(0);return this.success&&e.file?(this.popNandPushIfOK(t+1,this.makeLargeIfNeeded(e.filePos)),!0):!1},primitiveFileOpen:function(r){var i=this.stackBoolean(0),s=this.stackNonInteger(1);if(!this.success)return!1;var n=this.filenameFromSqueak(s.bytesAsString()),t=this.fileOpen(n,i);if(!t)return!1;var e=this.makeStArray([t.name]);return e.file=t,e.fileWrite=i,e.filePos=0,this.popNandPushIfOK(r+1,e),!0},primitiveFileRead:function(i){var e=this.stackInteger(0),r=this.stackInteger(1)-1,s=this.stackNonInteger(2),t=this.stackNonInteger(3);return this.success&&t.file?e?s.bytes?0>r||r+e>s.bytes.length?!1:this.fileContentsDo(t.file,function(n){if(!n.contents)return this.popNandPushIfOK(i+1,0);var o=n.contents,u=s.bytes;e=Math.min(e,n.size-t.filePos);for(var a=0;e>a;a++)u[r+a]=o[t.filePos++];this.popNandPushIfOK(i+1,e)}.bind(this)):(console.log("File reading into non-bytes object not implemented yet"),!1):this.popNandPushIfOK(i+1,0):!1},primitiveFileRename:function(e){var t=this.stackNonInteger(1),i=this.stackNonInteger(0);if(!this.success)return!1;var r=this.filenameFromSqueak(t.bytesAsString()),s=this.filenameFromSqueak(i.bytesAsString());return this.success=Squeak.fileRename(r,s),this.vm.breakOut(),this.popNIfOK(e)},primitiveFileSetPosition:function(t){var i=this.stackPos32BitInt(0),e=this.stackNonInteger(1);return this.success&&e.file?(e.filePos=i,this.popNIfOK(t)):!1},primitiveFileSize:function(t){var e=this.stackNonInteger(0);return this.success&&e.file?(this.popNandPushIfOK(t+1,this.makeLargeIfNeeded(e.file.size)),!0):!1},primitiveFileStdioHandles:function(){return this.vm.warnOnce("Not yet implemented: primitiveFileStdioHandles"),!1},primitiveFileTruncate:function(){return console.warn("Not yet implemented: primitiveFileTruncate"),!1},primitiveDisableFileAccess:function(e){return this.fakePrimitive("FilePlugin.primitiveDisableFileAccess",0,e)},primitiveFileWrite:function(s){var t=this.stackInteger(0),i=this.stackInteger(1)-1,n=this.stackNonInteger(2),e=this.stackNonInteger(3);if(!this.success||!e.file||!e.fileWrite)return!1;if(!t)return this.popNandPushIfOK(s+1,0);var r=n.bytes||n.wordsAsUint8Array();return r?0>i||i+t>r.length?!1:this.fileContentsDo(e.file,function(n){var u=r,a=n.contents||[];if(e.filePos+t>a.length){var l=0===a.length?e.filePos+t:Math.max(e.filePos+t,a.length+1e4);n.contents=new Uint8Array(l),n.contents.set(a),a=n.contents}for(var o=0;t>o;o++)a[e.filePos++]=u[i+o];e.filePos>n.size&&(n.size=e.filePos),n.modified=!0,this.popNandPushIfOK(s+1,t)}.bind(this)):!1},fileOpen:function(n,a){"undefined"==typeof SqueakFiles&&(window.SqueakFiles={});var e=Squeak.splitFilePath(n);if(!e.basename)return null;var s=Squeak.dirList(e.dirname,!0);if(!s)return null;var i=s[e.basename],r=null;if(i){var t=SqueakFiles[e.fullname];if(t)return++t.refCount,t}else{if(!a)return console.log("File not found: "+e.fullname),null;if(r=new Uint8Array,i=Squeak.filePut(e.fullname,r.buffer),!i)return console.log("Cannot create file: "+e.fullname),null}var t={name:e.fullname,size:i[4],contents:r,modified:!1,refCount:1};return SqueakFiles[t.name]=t,t},fileClose:function(e){Squeak.flushFile(e),0==--e.refCount&&delete SqueakFiles[e.name]},fileContentsDo:function(e,t){if(e.contents)t(e);else{if(e.contents===!1)return!1;this.vm.freeze(function(i){Squeak.fileGet(e.name,function(r){e.contents=this.asUint8Array(r),i(),t(e)}.bind(this),function(r){console.log("File get failed: "+r),e.contents=!1,i(),t(e)}.bind(this))}.bind(this))}return!0}},"DropPlugin",{primitiveDropRequestFileHandle:function(n){var t=this.stackInteger(0),i=this.display.droppedFiles||[];if(1>t||t>i.length)return!1;var r=i[t-1],s=this.fileOpen(r,!1);if(!s)return!1;var e=this.makeStArray([r]);return e.file=s,e.fileWrite=!1,e.filePos=0,this.popNandPushIfOK(n+1,e),!0},primitiveDropRequestFileName:function(i){var e=this.stackInteger(0),t=this.display.droppedFiles||[];if(1>e||e>t.length)return!1;var r=this.makeStString(this.filenameToSqueak(t[e-1]));return this.popNandPushIfOK(i,r)}},"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=e>3?this.stackInteger(e-4):0;return this.success?(this.audioContext=Squeak.startAudioOut(),this.audioContext?(this.audioSema=s,this.audioNextTimeSlot=0,this.audioBuffersReady=[],this.audioBuffersUnused=[this.audioContext.createBuffer(r?2:1,t,i),this.audioContext.createBuffer(r?2:1,t,i)],console.log("sound: started"),this.popNIfOK(e)):(this.vm.warnOnce("could not initialize audio"),!1)):!1},snd_playNextBuffer:function(){if(this.audioContext&&0!==this.audioBuffersReady.length){var e=this.audioContext.createBufferSource();e.buffer=this.audioBuffersReady.shift(),e.connect(this.audioContext.destination),this.audioNextTimeSlot0&&console.warn("sound "+this.audioContext.currentTime.toFixed(3)+": buffer underrun by "+(this.audioContext.currentTime-this.audioNextTimeSlot).toFixed(3)+" s"),this.audioNextTimeSlot=this.audioContext.currentTime),e.start(this.audioNextTimeSlot),this.audioNextTimeSlot+=e.buffer.duration,window.setTimeout(function(){this.audioContext&&(this.audioBuffersUnused.push(e.buffer),this.audioSema&&this.signalSemaphoreWithIndex(this.audioSema),this.vm.forceInterruptCheck())}.bind(this),1e3*(this.audioNextTimeSlot-this.audioContext.currentTime)),this.snd_playNextBuffer()}},snd_primitiveSoundAvailableSpace:function(i){if(!this.audioContext)return console.log("sound: no audio context"),!1;var e=0;if(this.audioBuffersUnused.length>0){var t=this.audioBuffersUnused[0];e=t.length*t.numberOfChannels*2}return this.popNandPushIfOK(i+1,e)},snd_primitiveSoundPlaySamples:function(a){if(!this.audioContext||0===this.audioBuffersUnused.length)return console.log("sound: play but no free buffers"),!1;var o=this.stackInteger(2),r=this.stackNonInteger(1).wordsAsInt16Array(),u=this.stackInteger(0)-1;if(!this.success||!r)return!1;for(var t=this.audioBuffersUnused.shift(),s=t.numberOfChannels,e=0;s>e;e++)for(var l=t.getChannelData(e),n=u+e,i=0;o>i;i++)l[i]=r[n]/32768,n+=s;return this.audioBuffersReady.push(t),this.snd_playNextBuffer(),this.popNIfOK(a)},snd_primitiveSoundPlaySilence:function(s){if(!this.audioContext||0===this.audioBuffersUnused.length)return console.log("sound: play but no free buffers"),!1;for(var e=this.audioBuffersUnused.shift(),n=e.numberOfChannels,r=e.length,t=0;n>t;t++)for(var a=e.getChannelData(t),i=0;r>i;i++)a[i]=0;return this.audioBuffersReady.push(e),this.snd_playNextBuffer(),this.popNandPushIfOK(s+1,r)},snd_primitiveSoundStop:function(e){return this.audioContext&&(this.audioContext=null,this.audioBuffersReady=null,this.audioBuffersUnused=null,this.audioNextTimeSlot=0,this.audioSema=0,console.log("sound: stopped")),this.popNIfOK(e)},snd_primitiveSoundStartRecording:function(t){if(3!==t)return!1;var s=this.stackNonInteger(3),n=this.stackInteger(2),i=this.stackBoolean(1),a=this.stackInteger(0);if(!this.success)return!1;var o=this.primMethod,r=this.vm.freeze(),e=this;return Squeak.startAudioIn(function(s,u){for(console.log("sound: recording started"),e.audioInContext=s,e.audioInSource=u,e.audioInSema=a,e.audioInBuffers=[],e.audioInBufferIndex=0,e.audioInOverSample=1;n*e.audioInOverSample5&&this.audioInBuffers.shift(),this.audioInBuffers.push(e),this.audioInSema&&this.signalSemaphoreWithIndex(this.audioInSema),this.vm.forceInterruptCheck())},snd_primitiveSoundGetRecordingSampleRate:function(t){if(!this.audioInContext)return!1;var e=this.audioInContext.sampleRate/this.audioInOverSample|0;return console.log("sound: actual recording rate "+e+"x"+this.audioInOverSample),this.popNandPushIfOK(t+1,e)},snd_primitiveSoundRecordSamples:function(p){var n=this.stackNonInteger(1).wordsAsInt16Array(),i=this.stackInteger(0)-1;if(!this.success)return!1;for(var c=0;ir;r++)for(var h=e.getChannelData(r),s=this.audioInBufferIndex,f=i+r,l=0;a>l;l++)n[f]=32768*h[s]&65535,f+=u,s+=o;c+=a*t,i+=a*t,ss;s++)for(var n=0;u>n;n+=2){var t=s*a+n,d=i[4*t+0]>>3,l=i[4*t+1]>>3,c=i[4*t+2]>>3,f=i[4*t+4]>>3,h=i[4*t+5]>>3,p=i[4*t+6]>>3,e=d<<10|l<<5|c;0===e&&(e=1),e=e<<16|f<<10|h<<5|p,0===(65535&e)&&(e=1|e),o[t>>1]=e}},jpeg2_ditherPixelsToForm16:function(h,y){for(var F=h.width>>1,g=h.height,n=h.data,b=[2,0,14,12,1,3,13,15],S=[10,8,6,4,9,11,5,7],a=0;g>a;a++)for(var o=0;F>o;o++){var t,i,e,s=a*g+2*o<<2,v=n[s+0],d=n[s+1],m=n[s+2],p=n[s+4],f=n[s+5],c=n[s+6],k=(3&a)<<1|1&o,l=b[k],u=S[k];t=496*v>>8,i=15&t,e=t>>4,v=i>l?e+1:e,t=496*d>>8,i=15&t,e=t>>4,d=i>l?e+1:e,t=496*m>>8,i=15&t,e=t>>4,m=i>l?e+1:e,t=496*p>>8,i=15&t,e=t>>4,p=i>u?e+1:e,t=496*f>>8,i=15&t,e=t>>4,f=i>u?e+1:e,t=496*c>>8,i=15&t,e=t>>4,c=i>u?e+1:e;var r=v<<10|d<<5|m;0===r&&(r=1),r=r<<16|p<<10|f<<5|c,0===(65535&r)&&(r=1|r),y[s>>3]=r}}},"ScratchPluginAdditions",{scratch_primitiveOpenURL:function(s){var t=this.stackNonInteger(0).bytesAsString();if(""==t)return!1;if(/^\/SqueakJS\//.test(t)){t=t.slice(10);var i=Squeak.splitFilePath(t),r=e["squeak-template:"+i.dirname];r&&(t=JSON.parse(r).url+"/"+i.basename)}return window.open(t,"_blank"),this.popNIfOK(s)},scratch_primitiveGetFolderPath:function(t){var i=this.stackInteger(0);if(!this.success)return!1;var e;switch(i){case 1:e="/"}return e?(this.vm.popNandPush(t+1,this.makeStString(this.filenameToSqueak(e))),!0):!1}},"JavaScriptPlugin",{js_primitiveDoUnderstand:function(l){var s=this.stackNonInteger(1),t=this.js_objectOrGlobal(s),o=this.stackNonInteger(0).pointers,u=o[0].bytesAsString(),e=o[1].pointers||[],a=!("jsObject"in s),r=null;try{this.js_activeCallback="Callbacks must be asynchronous";var i=u.match(/([^:]*)/)[0];if(a||"new"!==i){if(!(i in t))return this.js_setError("Property not found: "+i);var n=t[i];if("function"==typeof n&&(!a||e.length>0))r=n.apply(t,this.js_fromStArray(e));else if(0==e.length)r=n;else{if(1!=e.length)return this.js_setError("Property "+i+" is not a function");t[i]=this.js_fromStObject(e[0])}}else if(0===e.length)r=new t;else{var c=[null].concat(this.js_fromStArray(e));r=new(Function.prototype.bind.apply(t,c))}}catch(f){return this.js_setError(f.message)}finally{this.js_activeCallback=null}var h=this.makeStObject(r,s.sqClass);return this.popNandPushIfOK(l+1,h)},js_primitiveAsString:function(e){var t=this.js_objectOrGlobal(this.stackNonInteger(0));return this.popNandPushIfOK(e+1,this.makeStString(String(t)))},js_primitiveTypeof:function(e){var t=this.js_objectOrGlobal(this.stackNonInteger(0));return this.popNandPushIfOK(e+1,this.makeStString(typeof t))},js_primitiveAt:function(i){var e,t=this.stackNonInteger(1),r=this.vm.stackValue(0); try{var s=this.js_objectOrGlobal(t),n=this.js_fromStObject(r),a=s[n];e=this.makeStObject(a,t.sqClass)}catch(o){return this.js_setError(o.message)}return this.popNandPushIfOK(i+1,e)},js_primitiveAtPut:function(t){var i=this.stackNonInteger(2),r=this.vm.stackValue(1),e=this.vm.stackValue(0);try{var s=this.js_objectOrGlobal(i),n=this.js_fromStObject(r),a=this.js_fromStObject(e);s[n]=a}catch(o){return this.js_setError(o.message)}return this.popNandPushIfOK(t+1,e)},js_primitiveSqueakAsJSObject:function(e){var t=this.stackNonInteger(1),i=this.vm.stackValue(0);return this.success&&(t.jsObject=i),this.popNIfOK(e)},js_primitiveInitCallbacks:function(e){return this.js_callbackSema=this.stackInteger(0),this.js_activeCallback=null,this.popNIfOK(e)},js_primitiveGetActiveCallbackBlock:function(t){var e=this.js_activeCallback;return e?this.popNandPushIfOK(t,e.block):this.js_setError("No active callback")},js_primitiveGetActiveCallbackArgs:function(r){var n=this.stackNonInteger(r),e=this.js_activeCallback;if(!e)return this.js_setError("No active callback");try{var t=e.block.pointers[Squeak.BlockContext_argumentCount],s=[];"number"!=typeof t&&(t=e.block.pointers[Squeak.Closure_numArgs]);for(var i=0;t>i;i++)s.push(e.args[i]);return this.popNandPushIfOK(r,this.makeStArray(s,n))}catch(a){return this.js_setError(a.message)}},js_primitiveReturnFromCallback:function(e){return 1!==e?!1:this.js_activeCallback?(this.js_activeCallback.result=this.vm.pop(),this.vm.breakOut(),!0):this.js_setError("No active callback")},js_primitiveGetError:function(e){var t=this.makeStObject(this.js_error);return this.js_error=null,this.popNandPushIfOK(e+1,t)},js_setError:function(e){return this.js_error=String(e),!1},js_fromStObject:function(e){if("number"==typeof e)return e;if(e.jsObject)return e.jsObject;if(e.isFloat)return e.float;if(e.isNil)return null;if(e.isTrue)return!0;if(e.isFalse)return!1;if(e.bytes||e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassString])return e.bytesAsString();if(e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray])return this.js_fromStArray(e.pointers||[],!0);if(e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassBlockContext]||e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassBlockClosure])return this.js_fromStBlock(e);throw Error("asJSArgument needed for "+e)},js_fromStArray:function(e,r){if(e.length>0&&r&&this.isAssociation(e[0]))return this.js_fromStDict(e);for(var i=[],t=0;t=-1073741824&&1073741823>=e},isArray:function(e){return e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]},isMemberOf:function(r,t){var i=r.sqClass.pointers[Squeak.Class_name].bytes;if(t.length!==i.length)return!1;for(var e=0;et||t>=e.pointers.length?this.successFlag=!1:void(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]},nilObject:function(){return this.vm.nilObj},falseObject:function(){return this.vm.falseObj},trueObject:function(){return this.vm.trueObj}},"vm functions",{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(s,e,t,i,r){if(i>e&&r>t){var n={left:e,top:t,right:i,bottom:r};this.vm.primHandler.displayDirty(s,n)}},ioLoadFunctionFrom:function(e,t){return this.vm.primHandler.loadFunctionFrom(e,t)}}),Object.subclass("Squeak.InstructionPrinter","initialization",{initialize:function(e,t){this.method=e,this.vm=t}},"printing",{printInstructions:function(e,t,i){for(this.indent=e,this.highlight=t,this.highlightPC=i,this.innerIndents={},this.result="",this.scanner=new Squeak.InstructionStream(this.method,this.vm),this.oldPC=this.scanner.pc,this.endPC=0,this.done=!1;!this.done;)this.scanner.interpretNextInstructionFor(this);return this.result},print:function(t){this.oldPC===this.highlightPC?this.highlight&&(this.result+=this.highlight):this.indent&&(this.result+=this.indent),this.result+=this.oldPC;for(var e=0;ethis.oldPC&&(this.result+=" "),this.result+=(this.method.bytes[e]+256).toString(16).substr(-2).toUpperCase();this.result+="> "+t+"\n",this.oldPC=this.scanner.pc}},"decoding",{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(t,e){this.print((t?"jumpIfTrue: ":"jumpIfFalse: ")+(this.scanner.pc+e)),this.scanner.pc+e>this.endPC&&(this.endPC=this.scanner.pc+e)},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},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){var t=e.sqInstName?e.sqInstName():e.toString();this.print("pushConst: "+t)},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,i,t){this.print((t?"superSend: #":"send: #")+(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(r,s,n){var i=this.scanner.pc,e=i+n;this.print("closure("+i+"-"+(e-1)+"): "+r+" copied, "+s+" args");for(var t=i;e>t;t++)this.innerIndents[t]=(this.innerIndents[t]||0)+1;e>this.endPC&&(this.endPC=e)}}),Object.subclass("Squeak.InstructionStream","initialization",{initialize:function(t,e){this.vm=e,this.method=t,this.pc=0,this.specialConstants=[e.trueObj,e.falseObj,e.nilObj,-1,0,1,2]}},"decoding",{interpretNextInstructionFor:function(t){var r=this.method,s=r.bytes[this.pc++],i=s/16|0,e=s%16;if(0===i)return t.pushReceiverVariable(e);if(1===i)return t.pushTemporaryVariable(e);if(2===i)return t.pushConstant(r.methodGetLiteral(e));if(3===i)return t.pushConstant(r.methodGetLiteral(e+16));if(4===i)return t.pushLiteralVariable(r.methodGetLiteral(e));if(5===i)return t.pushLiteralVariable(r.methodGetLiteral(e+16));if(6===i)return 8>e?t.popIntoReceiverVariable(e):t.popIntoTemporaryVariable(e-8);if(7===i){if(0===e)return t.pushReceiver();if(8>e)return t.pushConstant(this.specialConstants[e-1]);if(8===e)return t.methodReturnReceiver();if(12>e)return t.methodReturnConstant(this.specialConstants[e-9]);if(12===e)return t.methodReturnTop();if(13===e)return t.blockReturnTop();if(e>13)throw Error("unusedBytecode")}return 8===i?this.interpretExtension(e,r,t):9===i?8>e?t.jump(e+1):t.jumpIf(!1,e-8+1):10===i?(s=this.method.bytes[this.pc++],8>e?t.jump(256*(e-4)+s):t.jumpIf(12>e,256*(3&e)+s)):11===i?t.send(this.vm.specialSelectors[2*e],this.vm.specialSelectors[2*e+1],!1):12===i?t.send(this.vm.specialSelectors[2*(e+16)],this.vm.specialSelectors[2*(e+16)+1],!1):i>12?t.send(r.methodGetLiteral(e),i-13,!1):void 0},interpretExtension:function(r,o,e){if(6>=r){var i=this.method.bytes[this.pc++];if(2>=r){var t=i/64|0,n=i%64;if(0===r){if(0===t)return e.pushReceiverVariable(n);if(1===t)return e.pushTemporaryVariable(n);if(2===t)return e.pushConstant(this.method.methodGetLiteral(n));if(3===t)return e.pushLiteralVariable(this.method.methodGetLiteral(n))}if(1===r){if(0===t)return e.storeIntoReceiverVariable(n);if(1===t)return e.storeIntoTemporaryVariable(n);if(2===t)throw Error("illegalStore");if(3===t)return e.storeIntoLiteralVariable(this.method.methodGetLiteral(n))}if(2===r){if(0===t)return e.popIntoReceiverVariable(n);if(1===t)return e.popIntoTemporaryVariable(n);if(2===t)throw Error("illegalStore");if(3===t)return e.popIntoLiteralVariable(this.method.methodGetLiteral(n))}}if(3===r)return e.send(this.method.methodGetLiteral(i%32),i/32|0,!1);if(4===r){var s=this.method.bytes[this.pc++],t=i/32|0;if(0===t)return e.send(this.method.methodGetLiteral(s),i%32,!1);if(1===t)return e.send(this.method.methodGetLiteral(s),i%32,!0);if(2===t)return e.pushReceiverVariable(s);if(3===t)return e.pushConstant(this.method.methodGetLiteral(s));if(4===t)return e.pushLiteralVariable(this.method.methodGetLiteral(s));if(5===t)return e.storeIntoReceiverVariable(s);if(6===t)return e.popIntoReceiverVariable(s);if(7===t)return e.storeIntoLiteralVariable(this.method.methodGetLiteral(s))}if(5===r)return e.send(this.method.methodGetLiteral(31&i),i>>5,!0);if(6===r)return e.send(this.method.methodGetLiteral(63&i),i>>6,!1)}if(7===r)return e.doPop();if(8===r)return e.doDup();if(9===r)return e.pushActiveContext();var i=this.method.bytes[this.pc++];if(10===r)return 128>i?e.pushNewArray(i):e.popIntoNewArray(i-128);if(11===r)throw Error("unusedBytecode");var s=this.method.bytes[this.pc++];if(12===r)return e.pushRemoteTemp(i,s);if(13===r)return e.storeIntoRemoteTemp(i,s);if(14===r)return e.popIntoRemoteTemp(i,s);var a=this.method.bytes[this.pc++];return e.pushClosureCopy(i>>4,15&i,256*s+a)}})}),module("users.bert.SqueakJS.jit").requires("users.bert.SqueakJS.vm").toRun(function(){Object.subclass("Squeak.Compiler","initialization",{initialize:function(e){this.vm=e,this.comments=!!Squeak.Compiler.comments,this.specialSelectors=["+","-","<",">","<=",">=","=","~=","*","/","\\","@","bitShift:","//","bitAnd:","bitOr:","at:","at:put:","size","next","nextPut:","atEnd","==","class","blockCopy:","value","value:","do:","new","new:","x","y"]}},"accessing",{compile:function(e,t,i){if(e.isHot){this.singleStep=!1,this.debug=this.comments;var r=t&&t.className(),s=i&&i.bytesAsString();e.compiled=this.generate(e,r,s)}else e.isHot=!0},enableSingleStepping:function(e,i,r){if(!e.compiled||!e.compiled.canSingleStep){this.singleStep=!0,this.debug=!0;var t=this.vm.printMethod(e,i,r).split(">>");e.compiled=this.generate(e,t[0],t[1]),e.compiled.canSingleStep=!0}return!0},functionNameFor:function(t,e){if(!t||!e)return"Squeak_DOIT";if(!/[^a-zA-Z0-9:_]/.test(e))return(t+"_"+e).replace(/[: ]/g,"_");var i=e.replace(/./g,function(e){var t={"|":"OR","~":"NOT","<":"LT","=":"EQ",">":"GT","&":"AND","@":"AT","*":"TIMES","+":"PLUS","\\":"MOD","-":"MINUS",",":"COMMA","/":"DIV","?":"IF"}[e];return t||"OPERATOR"});return t.replace(/[ ]/,"_")+"__"+i+"__"}},"generating",{generate:function(t,r,s){for(this.method=t,this.pc=0,this.endPC=0,this.prevPC=0,this.source=[],this.sourceLabels={},this.needsLabel={0:!0},this.needsBreak=!1,r&&s&&this.source.push("// ",r,">>",s,"\n"),this.source.push("var context = vm.activeContext,\n"," stack = context.pointers,\n"," rcvr = vm.receiver,\n"," inst = rcvr.pointers,\n"," temp = vm.homeContext.pointers,\n"," lit = vm.method.pointers,\n"," bytecodes = 0 - vm.pc;\n","while (true) switch (vm.pc) {\n"),this.done=!1;!this.done;){var e=t.bytes[this.pc++],i=0;switch(248&e){case 0:case 8:this.generatePush("inst[",15&e,"]");break;case 16:case 24:this.generatePush("temp[",6+(15&e),"]");break;case 32:case 40:case 48:case 56:this.generatePush("lit[",1+(31&e),"]");break;case 64:case 72:case 80:case 88:this.generatePush("lit[",1+(31&e),"].pointers[1]");break;case 96:this.generatePopInto("inst[",7&e,"]");break;case 104:this.generatePopInto("temp[",6+(7&e),"]");break;case 112:switch(e){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(e){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(e);break;case 144:this.generateJump((7&e)+1);break;case 152:this.generateJumpIf(!1,(7&e)+1);break;case 160:i=t.bytes[this.pc++],this.generateJump(256*((7&e)-4)+i);break;case 168:i=t.bytes[this.pc++],this.generateJumpIf(172>e,256*(3&e)+i);break;case 176:case 184:this.generateNumericOp(e);break;case 192:case 200:this.generateQuickPrim(e);break;case 208:case 216:this.generateSend("lit[",1+(15&e),"]",0,!1);break;case 224:case 232:this.generateSend("lit[",1+(15&e),"]",1,!1);break;case 240:case 248:this.generateSend("lit[",1+(15&e),"]",2,!1)}}var n=this.functionNameFor(r,s);return this.singleStep?(this.debug&&this.source.push("// all valid PCs have a label;\n"),this.source.push("default: throw Error('invalid PC'); }"),new Function("return function "+n+"(vm, singleStep) {\n"+this.source.join("")+"\n}")()):(this.debug&&this.source.push("// fall back to single-stepping\n"),this.source.push("default: bytecodes += vm.pc; vm.interpretOne(true); return bytecodes;}"),this.deleteUnneededLabels(),new Function("return function "+n+"(vm) {\n"+this.source.join("")+"\n}")())},generateExtended:function(i){var e,t;switch(i){case 128:switch(e=this.method.bytes[this.pc++],e>>6){case 0:return void this.generatePush("inst[",63&e,"]");case 1:return void this.generatePush("temp[",6+(63&e),"]");case 2:return void this.generatePush("lit[",1+(63&e),"]");case 3:return void this.generatePush("lit[",1+(63&e),"].pointers[1]")}case 129:switch(e=this.method.bytes[this.pc++],e>>6){case 0:return void this.generateStoreInto("inst[",63&e,"]");case 1:return void this.generateStoreInto("temp[",6+(63&e),"]");case 2:throw Error("illegal store into literal");case 3:return void this.generateStoreInto("lit[",1+(63&e),"].pointers[1]")}return;case 130:switch(e=this.method.bytes[this.pc++],e>>6){case 0:return void this.generatePopInto("inst[",63&e,"]");case 1:return void this.generatePopInto("temp[",6+(63&e),"]");case 2:throw Error("illegal pop into literal");case 3:return void this.generatePopInto("lit[",1+(63&e),"].pointers[1]")}case 131:return e=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&e),"]",e>>5,!1);case 132:switch(e=this.method.bytes[this.pc++],t=this.method.bytes[this.pc++],e>>5){case 0:return void this.generateSend("lit[",1+t,"]",31&e,!1);case 1:return void this.generateSend("lit[",1+t,"]",31&e,!0);case 2:return void this.generatePush("inst[",t,"]");case 3:return void this.generatePush("lit[",1+t,"]");case 4:return void this.generatePush("lit[",1+t,"].pointers[1]");case 5:return void this.generateStoreInto("inst[",t,"]");case 6:return void this.generatePopInto("inst[",t,"]");case 7:return void this.generateStoreInto("lit[",1+t,"].pointers[1]")}case 133:return e=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&e),"]",e>>5,!0);case 134:return e=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(63&e),"]",e>>6,!1);case 135:return void this.generateInstruction("pop","vm.sp--");case 136:return void this.generateInstruction("dup","var dup = stack[vm.sp]; stack[++vm.sp] = dup");case 137:return void this.generateInstruction("thisContext","stack[++vm.sp] = vm.exportThisContext()");case 138:e=this.method.bytes[this.pc++];var r=e>127,s=127&e;return void this.generateClosureTemps(s,r);case 139:throw Error("unusedBytecode");case 140:return e=this.method.bytes[this.pc++],t=this.method.bytes[this.pc++],void this.generatePush("temp[",6+t,"].pointers[",e,"]");case 141:return e=this.method.bytes[this.pc++],t=this.method.bytes[this.pc++],void this.generateStoreInto("temp[",6+t,"].pointers[",e,"]");case 142:return e=this.method.bytes[this.pc++],t=this.method.bytes[this.pc++],void this.generatePopInto("temp[",6+t,"].pointers[",e,"]");case 143:e=this.method.bytes[this.pc++],t=this.method.bytes[this.pc++];var n=this.method.bytes[this.pc++],a=15&e,o=e>>4,u=t<<8|n;return void this.generateClosureCopy(a,o,u)}},generatePush:function(i,e,r,t,s){this.debug&&this.generateDebugCode("push"),this.generateLabel(),this.source.push("stack[++vm.sp] = ",i),void 0!==e&&(this.source.push(e,r),void 0!==t&&this.source.push(t,s)),this.source.push(";\n")},generateStoreInto:function(i,e,r,t,s){this.debug&&this.generateDebugCode("store into"),this.generateLabel(),this.source.push(i),void 0!==e&&(this.source.push(e,r),void 0!==t&&this.source.push(t,s)),this.source.push(" = stack[vm.sp];\n")},generatePopInto:function(i,e,r,t,s){this.debug&&this.generateDebugCode("pop into"),this.generateLabel(),this.source.push(i),void 0!==e&&(this.source.push(e,r),void 0!==t&&this.source.push(t,s)),this.source.push(" = stack[vm.sp--];\n")},generateReturn:function(e){this.debug&&this.generateDebugCode("return"),this.generateLabel(),this.source.push("vm.pc = ",this.pc,"; vm.doReturn(",e,"); return bytecodes + ",this.pc,";\n"),this.needsBreak=!1,this.done=this.pc>this.endPC},generateBlockReturn:function(){this.debug&&this.generateDebugCode("block return"),this.generateLabel(),this.source.push("vm.pc = ",this.pc,"; vm.doReturn(stack[vm.sp--], context.pointers[0]); return bytecodes + ",this.pc,";\n"),this.needsBreak=!1},generateJump:function(t){var e=this.pc+t;this.debug&&this.generateDebugCode("jump to "+e),this.generateLabel(),this.source.push("vm.pc = ",e,"; "),0>t?this.source.push("bytecodes += ",-t,"; "):this.source.push("bytecodes -= ",t,"; "),0>t&&this.source.push("\nif (vm.interruptCheckCounter-- <= 0) {\n"," vm.checkForInterrupts();\n"," if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",e,";\n","}\n"),this.singleStep&&this.source.push("\nif (vm.breakOutOfInterpreter) return bytecodes + ",e,";\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[e]=!0,e>this.endPC&&(this.endPC=e) },generateJumpIf:function(t,i){var e=this.pc+i;this.debug&&this.generateDebugCode("jump if "+t+" to "+e),this.generateLabel(),this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",t,"Obj) {vm.pc = ",e,"; bytecodes -= ",i,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return bytecodes + ",e,"; else "),this.source.push("continue}\n","else if (cond !== vm.",!t,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return bytecodes + ",this.pc,"}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[e]=!0,e>this.endPC&&(this.endPC=e)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick prim "+this.specialSelectors[(15&e)+16]),this.generateLabel(),e){case 194:return 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 bytecodes + ",this.pc,"; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return 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 void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",(15&e)+16,"); return bytecodes + ",this.pc,"}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",(15&e)+16,"); return bytecodes + ",this.pc,";\n"),void(this.needsLabel[this.pc]=!0)}this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",(15&e)+16,");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,";\n","if (vm.pc !== ",this.pc,") throw Error('Huh?');\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("numeric op "+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return 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 bytecodes + ",this.pc,"}\n");case 177:return 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 bytecodes + ",this.pc,"}\n");case 178:return 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 bytecodes + ",this.pc,"}\n");case 179:return 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 bytecodes + ",this.pc,"}\n");case 180:return 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 bytecodes + ",this.pc,"}\n");case 181:return 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 bytecodes + ",this.pc,"}\n");case 182:return 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 bytecodes + ",this.pc,"}\n");case 183:return 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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\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 bytecodes + ",this.pc,"}\n")}},generateSend:function(e,t,i,r,s){this.debug&&this.generateDebugCode("send "+("lit["===e?this.method.pointers[t].bytesAsString():"...")),this.generateLabel(),this.source.push("vm.pc = ",this.pc,"; vm.send(",e,t,i,", ",r,", ",s,"); ","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,";\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateClosureTemps:function(e,i){if(this.debug&&this.generateDebugCode("closure temps"),this.generateLabel(),this.source.push("var array = vm.instantiateClass(vm.specialObjects[7], ",e,");\n"),i){for(var t=0;e>t;t++)this.source.push("array.pointers[",t,"] = stack[vm.sp - ",e-t-1,"];\n");this.source.push("stack[vm.sp -= ",e-1,"] = array;\n")}else this.source.push("stack[++vm.sp] = array;\n")},generateClosureCopy:function(s,e,n){var i=this.pc,t=i+n;if(this.debug&&this.generateDebugCode("push closure("+i+"-"+(t-1)+"): "+e+" copied, "+s+" args"),this.generateLabel(),this.source.push("var closure = vm.instantiateClass(vm.specialObjects[36], ",e,");\n","closure.pointers[0] = context; vm.reclaimableContextCount = 0;\n","closure.pointers[1] = ",i+4*this.method.pointers.length+1,";\n","closure.pointers[2] = ",s,";\n"),e>0){for(var r=0;e>r;r++)this.source.push("closure.pointers[",r+3,"] = stack[vm.sp - ",e-r-1,"];\n");this.source.push("stack[vm.sp -= ",e-1,"] = closure;\n")}else this.source.push("stack[++vm.sp] = closure;\n");this.source.push("vm.pc = ",t,";\n"),this.source.push("bytecodes -= ",n,";\n"),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return bytecodes + ",t,";\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[i]=!0,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateLabel:function(){this.sourceLabels[this.prevPC]=this.source.length,this.source.push("case ",this.prevPC,":\n"),this.prevPC=this.pc},generateDebugCode:function(i){this.needsBreak&&(this.source.push("if (vm.breakOutOfInterpreter) return bytecodes + (vm.pc = ",this.prevPC,");\n"),this.needsLabel[this.prevPC]=!0);for(var t=[],e=this.prevPC;e ",i,"\n"),this.needsBreak=this.singleStep},generateInstruction:function(e,t){this.debug&&this.generateDebugCode(e),this.generateLabel(),this.source.push(t,";\n")},deleteUnneededLabels:function(){for(var t in this.sourceLabels)if(!this.needsLabel[t])for(var e=0;3>e;e++)this.source[this.sourceLabels[t]+e]=""}})}),module("users.bert.SqueakJS.plugins.ADPCMCodecPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function u(t,e){return e>31?0:t<31?0:t>>>e}function k(){return g}function v(r,n){var i,e,t;for(e=n-r,0>e&&(e=0-e),i=63,t=1;62>=t;t++)63===i&&s[t-1]>=e&&(i=t);return i}function n(o){var e,s,n;for(s=0,e=o;;){if(n=e-i,!(n>0))return s+=l(t,0-n),i-=e,t&=l(255,8-i),s;s+=u(t,n),e-=i,t=a[++r-1],i=8}}function o(c,f){var o,s,n,e;for(s=f,n=c;;){if(o=8-i,e=o-n,!(0>e))return t+=u(s,e),i+=n,self;t+=l(s,0-e),a[++r-1]=t,i=0,t=0,s&=u(1,0-e)-1,n-=o}}function m(){var o,F,f,h,p,c,d,S,O,b,k,g,l,y,u,m,v;if(o=e.stackValue(1),F=e.stackIntegerValue(0),u=e.fetchIntegerofObject(0,o),l=e.fetchIntegerofObject(1,o),O=e.fetchIntegerofObject(2,o),k=e.fetchIntegerofObject(3,o),b=e.fetchIntegerofObject(4,o),g=e.fetchIntegerofObject(5,o),t=e.fetchIntegerofObject(6,o),i=e.fetchIntegerofObject(7,o),r=e.fetchIntegerofObject(8,o),a=e.fetchBytesofObject(9,o),v=e.fetchInt16ArrayofObject(10,o),m=e.fetchIntegerofObject(12,o),S=e.fetchIntegerofObject(13,o),s=e.fetchInt16ArrayofObject(14,o),y=e.fetchInt16ArrayofObject(15,o),e.failed())return null;for(p=1;F>=p;p++)if(1===(p&g))u=n(16),u>32767&&(u-=65536),l=n(6),v[++m-1]=u;else{for(h=n(S),d=s[l],c=0,f=b;f>0;)(h&f)>0&&(c+=d),d>>>=1,f>>>=1;c+=d,(h&O)>0?u-=c:u+=c,u>32767?u=32767:-32768>u&&(u=-32768),l+=y[h&k],0>l?l=0:l>88&&(l=88),v[++m-1]=u}return e.failed()?null:(e.storeIntegerofObjectwithValue(0,o,u),e.storeIntegerofObjectwithValue(1,o,l),e.storeIntegerofObjectwithValue(6,o,t),e.storeIntegerofObjectwithValue(7,o,i),e.storeIntegerofObjectwithValue(8,o,r),e.storeIntegerofObjectwithValue(12,o,m),void e.pop(1))}function d(){var o,x,m,g,b,F,c,f,d,k,u,l,S,y,P,I,V,O,j,p,A,v,w,h,C;if(o=e.stackValue(1),x=e.stackIntegerValue(0),v=e.fetchInt16ArrayofObject(0,o),p=e.fetchInt16ArrayofObject(1,o),I=e.fetchIntegerofObject(2,o),O=e.fetchIntegerofObject(3,o),V=e.fetchIntegerofObject(4,o),j=e.fetchIntegerofObject(5,o),t=e.fetchIntegerofObject(6,o),i=e.fetchIntegerofObject(7,o),r=e.fetchIntegerofObject(8,o),a=e.fetchBytesofObject(9,o),C=e.fetchInt16ArrayofObject(10,o),w=e.fetchInt16ArrayofObject(11,o),h=e.fetchIntegerofObject(12,o),P=e.fetchIntegerofObject(13,o),s=e.fetchInt16ArrayofObject(14,o),A=e.fetchInt16ArrayofObject(15,o),e.failed())return null;for(u=v[0],l=v[1],c=p[0],f=p[1],F=1;x>=F;F++)if(1===(F&j))u=n(16),c=n(6),l=n(16),f=n(6),u>32767&&(u-=65536),l>32767&&(l-=65536),C[++h-1]=u,w[h-1]=l;else{for(g=n(P),b=n(P),S=s[c],y=s[f],d=k=0,m=V;m>0;)(g&m)>0&&(d+=S),(b&m)>0&&(k+=y),S>>>=1,y>>>=1,m>>>=1;d+=S,k+=y,(g&I)>0?u-=d:u+=d,(b&I)>0?l-=k:l+=k,u>32767?u=32767:-32768>u&&(u=-32768),l>32767?l=32767:-32768>l&&(l=-32768),c+=A[g&O],0>c?c=0:c>88&&(c=88),f+=A[b&O],0>f?f=0:f>88&&(f=88),C[++h-1]=u,w[h-1]=l}return v[0]=u,v[1]=l,p[0]=c,p[1]=f,e.failed()?null:(e.storeIntegerofObjectwithValue(6,o,t),e.storeIntegerofObjectwithValue(7,o,i),e.storeIntegerofObjectwithValue(8,o,r),e.storeIntegerofObjectwithValue(12,o,h),void e.pop(1))}function p(){var n,y,k,g,f,d,F,p,m,c,I,P,S,O,l,A,u,h,b;if(n=e.stackValue(1),y=e.stackIntegerValue(0),u=e.fetchIntegerofObject(0,n),l=e.fetchIntegerofObject(1,n),P=e.fetchIntegerofObject(2,n),S=e.fetchIntegerofObject(4,n),O=e.fetchIntegerofObject(5,n),t=e.fetchIntegerofObject(6,n),i=e.fetchIntegerofObject(7,n),r=e.fetchIntegerofObject(8,n),a=e.fetchBytesofObject(9,n),b=e.fetchInt16ArrayofObject(10,n),h=e.fetchIntegerofObject(12,n),I=e.fetchIntegerofObject(13,n),s=e.fetchInt16ArrayofObject(14,n),A=e.fetchInt16ArrayofObject(15,n),e.failed())return null;for(c=s[0],d=1;y>=d;d++)if(1===(d&O))u=b[++h-1],(F=u)<0&&(F+=65536),o(16,F),y>d&&(l=v(u,b[h])),o(6,l);else{for(m=0,f=b[++h-1]-u,0>f&&(m=P,f=0-f),g=0,p=0,k=S;k>0;)f>=c&&(g+=k,p+=c,f-=c),c>>>=1,k>>>=1;p+=c,m>0?u-=p:u+=p,u>32767?u=32767:-32768>u&&(u=-32768),l+=A[g],0>l?l=0:l>88&&(l=88),c=s[l],o(I,m|g)}return i>0&&(a[++r-1]=t),e.failed()?null:(e.storeIntegerofObjectwithValue(0,n,u),e.storeIntegerofObjectwithValue(1,n,l),e.storeIntegerofObjectwithValue(6,n,t),e.storeIntegerofObjectwithValue(7,n,i),e.storeIntegerofObjectwithValue(8,n,r),e.storeIntegerofObjectwithValue(12,n,h),void e.pop(1))}function c(){var n,o;return n=e.stackValue(1),o=e.stackIntegerValue(0),t=e.fetchIntegerofObject(6,n),i=e.fetchIntegerofObject(7,n),r=e.fetchIntegerofObject(8,n),a=e.fetchIntegerofObject(9,n),s=e.fetchIntegerofObject(14,n),e.failed()?null:(success(!1),e.failed()?null:(e.storeIntegerofObjectwithValue(6,n,t),e.storeIntegerofObjectwithValue(7,n,i),e.storeIntegerofObjectwithValue(8,n,r),void e.pop(1)))}function b(i){var t;return e=i,t=e.majorVersion()==f,t===!1?!1:t=e.minorVersion()>=h}var f=1,h=11,i=0,r=0,t=0,a=null,e=null,g="ADPCMCodecPlugin 3 November 2014 (e)",s=null;Squeak.registerExternalModule("ADPCMCodecPlugin",{primitiveDecodeStereo:d,primitiveEncodeStereo:c,setInterpreter:b,primitiveEncodeMono:p,primitiveDecodeMono:m,getModuleName:k})}),module("users.bert.SqueakJS.plugins.B2DPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function nt(t){return"number"==typeof t?e.classSmallInteger():t.sqClass}function p(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function Gh(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function Ot(e,t){return 0|Math.floor(e/t)}function Kh(e,t){return e-Ot(e,t)*t|0}function M(t,e){return e>31?0:t<31?0:t>>>e}function x(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function nu(e,t){return new Float32Array(e.buffer,e.byteOffset+4*t)}function D(){return t[io]}function Qs(e){return t[io]=e}function tt(){return t[ro]}function Dh(e){return t[ro]=e}function Ni(i,t){var e;return e=i+P()-1&~(P()-1),e>t?t:e}function _h(e){return t[ff]=e}function _i(t,e){return e-1&~(P()-1)}function P(){return t[so]}function Vh(e){return t[so]=e}function mt(){return t[no]}function Hs(e){return t[no]=e}function g(){return t[ao]}function Os(e){return t[ao]=e}function Ql(i){var e,t;return e=65535&i,t=i>>>16&255,(e*e>>>16)+e*t*2+(t*t<<16)>>>8}function br(e,t){var i;return 0===e?0>t?0-t:t:0===t?0>e?0-e:e:(i=e*e+t*t,yc(i))}function bs(e){return ma(1)?(B[K()]=e,void fs(K()+1)):0}function vl(e,i,t,n){var r,s;z(e)[T]=z(e)[T]-256*t,r=et(e)[T],et(e)[T]=r+256*(i-t),s=et(e)[qt],et(e)[qt]=s+256*i,Fo(e,n-t)}function yu(e,t,i,n){var r,s;z(e)[T]=z(e)[T]+256*i,r=et(e)[T],et(e)[T]=r-256*(t-i),s=et(e)[qt],et(e)[qt]=s+256*t,Fo(e,n-i+t)}function xh(e,r,l){var n,i,a,t,s,u,o;u=nn(e),o=on(e),n=fr(e),a=wt(n),t=ln(e),s=qr(e),i=l-r,n>u&&(0>s?t-=i:(t+=i,G(e,r))),o+a===0&&(s>0?t-=Ht(e):(t+=Ht(e),G(e,r))),o+a>0&&(0>s?(t+=i,G(e,r)):t-=i),sr(e,t)}function w(){return t[oo]}function ot(e){return t[oo]=e}function W(){return t[uo]}function Ki(e){return t[uo]=e}function au(e){return X(e)}function ah(){var e;return bt(Gt)?(e=O,O=e+Gt,U(e,da),st(e,0),pt(e,Gt),e):0}function Hr(){return lu(6),E()}function pf(i,n){var s,t,r,e;if(r=ll+i,!bt(r))return 0;if(t=O,O=t+r,U(t,oc),st(t,0),pt(t,r),s=Ia(t),gr())for(e=0;i-1>=e;e++)s[e]=q(n[e]);else for(e=0;i-1>=e;e++)s[e]=n[e];return Qf(t,i),t}function ma(e){var i,t,r,s;if(!au(e))return!1;if(0!==W())for(r=W(),i=W()+e,t=1,s=W();s>=t;t++)b[--i]=b[--r];return b=x(b,e),!0}function sf(n,i,a){var t,r,e,s;if(r=Uc+i,!bt(r))return 0;if(t=O,O=t+r,a?U(t,dc):U(t,pc),st(t,0),pt(t,r),s=Pr(t),gr())for(e=0;i-1>=e;e++)s[e]=q(n[e]);else for(e=0;i-1>=e;e++)s[e]=n[e];return Mf(t,i),t}function ef(){var e;return bt(At)?(e=O,O=e+At,U(e,ba),st(e,0),pt(e,At),e):0}function bt(e){var i,t,r,s;if(!ma(e))return!1;if(0!==K())for(r=K(),i=K()+e,t=1,s=K();s>=t;t++)B[--i]=B[--r];return B=x(B,e),!0}function Sc(e){return X(e)}function An(){return lu(N())}function $u(){var e;return bt(Ir)?(e=O,O=e+Ir,U(e,kc),st(e,0),pt(e,Ir),e):0}function Qu(){var e;return bt(ni)?(e=O,O=e+ni,U(e,gc),st(e,0),pt(e,ni),e):0}function Yu(e){return 0===(Ru(e)&vs)}function sn(e,t,i){if(t>i){if(e>t)return t;if(i>e)return i}else{if(t>e)return t;if(e>i)return i}return e}function Nr(e){return n(e,qn)}function $s(e,t){return a(e,qn,t)}function Mr(e){return n(e,Mn)}function Yo(e,t){return a(e,Mn,t)}function Po(e){return n(e,Bn)}function Fo(e,t){return a(e,Bn,t)}function z(e){return x(Z,e+ml)}function Oh(e){return n(e,Ln)}function ru(e,t){return a(e,Ln,t)}function Lu(e){return n(e,Rn)}function Un(e,t){return a(e,Rn,t)}function Jc(e){return n(e,xn)}function Qf(e,t){return a(e,xn,t)}function fh(e){return n(e,Pn)}function mh(e,t){return a(e,Pn,t)}function du(e){return n(e,wn)}function Ll(e,t){return a(e,wn,t)}function Uh(e){return n(e,Cn)}function af(e,t){return a(e,Cn,t)}function zh(e){return n(e,Vn)}function Rh(e,t){return a(e,Vn,t)}function pu(e){return n(e,_n)}function Nh(e,t){return a(e,_n,t)}function Ui(r,h,u,f){var p,n,t,l,c,o,a,i,e;return t=fh(r),l=Uh(r),32===t?(e=0|h[l*f+u],0!==e&&0===(4278190080&e)&&(e=4278190080|e),ou(e)):(i=Pc()[t],e=h[l*f+s(u,i)],c=M(1,t)-1,i=32-t-(u&M(1,i)-1)*t,e=s(e,i)&c,16===t?0!==e&&(n=(31&e)<<3,n+=n>>>5,o=(e>>>5&31)<<3,o+=o>>>5,a=(e>>>10&31)<<3,a+=a>>>5,p=255,e=n+(o<<8)+(a<<16)+(p<<24)):e=0===Jc(r)?0:Ia(r)[e],ou(e))}function hu(e){return n(e,jn)}function Mh(e,t){return a(e,jn,t)}function Tt(e){return dt(E()-e+4)}function qi(e,t){return ht(E()-e+4,t)}function jt(e){return dt(E()-e+5)}function xi(e,t){return ht(E()-e+5,t)}function $t(e){return dt(E()-e+0)}function Zs(e,t){return ht(E()-e+0,t)}function Ct(e){return dt(E()-e+1)}function Ys(e,t){return ht(E()-e+1,t)}function Vi(e){return dt(E()-e+2)}function wi(e,t){return ht(E()-e+2,t)}function Pi(e){return dt(E()-e+3)}function Ai(e,t){return ht(E()-e+3,t)}function Xs(s,o,u){var t,e,n,i,a,r;for(n=p(s),t=s.wordsAsInt32Array(),i=0,e=0;n-1>=e;e++){if(a=Wt(e,t),r=Ii(e,t),!(r>=0&&o>=r))return!1;i+=a}return i===u}function Ch(i){var r,s,t,n;if(!e.isWords(i))return!1;for(n=p(i),s=i.wordsAsInt32Array(),t=0;n-1>=t;t++)if(r=s[t],!L(r))return!1;return!0}function Ph(i,a){var e,r,t,s,n;for(r=p(i),s=i.wordsAsInt32Array(),t=0,e=0;r-1>=e;e++)n=Wt(e,s),t+=n;return t===a}function Ah(i,r){var t;return e.isWords(i)?(t=p(i),t!==3*r&&t!==6*r?!1:!0):!1}function Ih(r,e,s,n,a,o,i){var t;return Ah(r,e)&&Ch(i)?(t=p(i),Xs(s,t,e)&&Xs(n,t,e)&&Xs(o,t,e)&&Ph(a,e)?!0:!1):!1}function yh(e){var t;return t=Ut(e)?os(e):0,Mr(e)+t=rt()&&Nr(e)-t>=rt()?0:void bs(e)}function Yf(e){return Iu(e)?Nf(e):Jf(e)?yh(e):void bs(e)}function Nf(e){var t;return t=Ut(e)?fr(e):0,xr(e)+t=rt()&&Nn(e)-t>=rt()?0:void bs(e)}function Rs(){var e=[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];return e}function Ls(){var e=[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];return e}function St(e,t){return 0>e?0:e>=t?t-1:e}function pr(){var e,t;for(e=s(Er(),g()),t=s(Gi(),g())+1,0>e&&(e=0),t>Ft()&&(t=Ft());t>e;)u[e]=0,++e;Kr(Ft()),zi(0)}function Ns(){return t[mo]}function Lt(e){return t[mo]=e}function Rt(){return t[vo]}function xs(e){return t[vo]=e}function Vs(){return t[ko]}function Ea(e){return t[ko]=e}function zt(){return t[go]}function As(e){return t[go]=e}function Is(){return t[bo]}function Aa(e){return t[bo]=e}function $i(){return nu(t,wf)}function Ia(e){return x(Z,e+sl)}function Sa(e,n){var f,o,u,s,t,l,a,c,i,m,h,p,d;return u=m=$t(e),s=h=Ct(e),l=p=Vi(e),a=d=Pi(e),f=Tt(e),o=jt(e),c=u+=(p-m)*n|0,i=s+=(d-h)*n|0,l+=(f-p)*n|0,a+=(o-d)*n|0,c+=(l-u)*n|0,i+=(a-s)*n|0,s=sn(s,h,i),a=sn(a,i,o),t=Hr(),r?0:(wi(e,u),Ai(e,s),qi(e,c),xi(e,i),Zs(t,c),Ys(t,i),wi(t,l),Ai(t,a),qi(t,f),xi(t,o),t)}function Fa(e){var l,c,s,n,t,o,a,u,i,p,d,f,h;return t=Hr(),r?0:(s=p=$t(e),n=d=Ct(e),o=f=Vi(e),a=h=Pi(e),l=Tt(e),c=jt(e),s+=f-p>>1,n+=h-d>>1,u=o+=l-f>>1,i=a+=c-h>>1,u+=s-o>>1,i+=n-a>>1,wi(e,s),Ai(e,n),qi(e,u),xi(e,i),Zs(t,u),Ys(t,i),wi(t,o),Ai(t,a),qi(t,l),xi(t,c),t)}function ya(i,r){var e,t,s;e=z(i)[T]>>8,t=et(i)[T]>>8,e>t&&(s=e,e=t,t=s),G(i,e),t-e>r?us(i,t-e):us(i,r)}function yc(e){return 32>e?Ec()[e]:Math.sqrt(e)+.5|0}function bc(e,t,i){return ji||kr()?ji(e,t,i):!1}function Yl(){var t,e;for(e=0,t=O;t>e;)$f(e)&&(Q(e)>=Rr()||Yf(e)),e+=Gu(e)}function y(){return t[Co]}function Jt(e){return t[Co]=e}function ks(){return t[Vo]}function Hn(e){return t[Vo]=e}function ms(){return t[jo]}function pl(e){return t[jo]=e}function hs(){return t[xo]}function Tu(e){return t[xo]=e}function ls(r){var e,t,i;return e=s(Er(),g()),eRt()&&(t=Rt()),i=s(r,g()),i=Vs()||t=Rt()?0:void bc(e,t,i)}function or(e){return U(e,J(e)|vs)}function lr(e){return U(e,J(e)&~vs)}function wu(e){return n(e,ua)}function as(e,t){return a(e,ua,t)}function ft(e){return n(e,ca)}function H(e,t){return a(e,ca,t)}function mu(e){return n(e,la)}function ns(e,t){return a(e,la,t)}function ss(){return nu(t,Rf)}function kh(e){return J(e)>>>1}function A(e){return n(e,Ca)}function G(e,t){return a(e,Ca,t)}function Q(e){return n(e,Va)}function hi(e,t){return a(e,Va,t)}function Jr(e){return n(e,ja)}function tr(e,t){return a(e,ja,t)}function pi(){}function fo(s,r){var e,i,t;for(e=Zi(),i=s,t=rs();r>t;){if(e=Zi(),0!==e&&cn(e,i,t))return!0;Xi(t),i=t,t=rs()}return e=Zi(),0!==e?cn(e,i,r):!1}function qf(){return cf(Di(),xt(),_t(),y())}function hf(l,f,h){var a,r,c,o,i,n,t,e;if(t=f,e=h,r=-1,1===P())for(;e>t;)i=0|l[++r],u[t]=i,++t;else for(c=D(),o=tt(),a=g();e>t;)n=s(t,a),i=0|l[++r],i=s(i&c,o),u[n]=u[n]+i,++t;e>Gi()&&zi(e),e>Ji()&&Oi(e)}function cf(e,c,g,b){var h,n,a,d,l,s,f,r,p,v,m,o,k,i,t;if(1!==P())return lf(e,c,g,b);if(h=wa(e),!h)return null;for(a=hu(e),n=du(e),m=1===pu(e),d=c-gt(e),l=b-ar(e),f=mr(e),p=Wr(e),s=d*f+l*Fr(e),r=d*p+l*_r(e),o=c,k=g;k>o;)m&&(s=yt(s,a<<16),r=yt(r,n<<16)),i=s>>16,t=r>>16,m||(i=St(i,a),t=St(t,n)),i>=0&&t>=0&&a>i&&n>t&&(v=Ui(e,h,i,t),u[o]=v),s+=f,r+=p,++o}function lf(i,b,S,C){var w,y,k,l,o,d,h,O,F,n,v,r,m,a,A,f,I,p,c,t,e;if(k=wa(i),!k)return null;for(o=hu(i),l=du(i),p=1===pu(i),O=b-gt(i),F=C-ar(i),v=mr(i),m=Wr(i),n=O*v+F*Fr(i),r=O*m+F*_r(i),w=P(),A=Ni(b,S),I=_i(b,S),y=g(),d=D(),h=tt(),c=b;A>c;)p&&(n=yt(n,o<<16),r=yt(r,l<<16)),t=n>>16,e=r>>16,p||(t=St(t,o),e=St(e,l)),t>=0&&e>=0&&o>t&&l>e&&(a=Ui(i,k,t,e),a=s(a&d,h),f=s(c,y),u[f]=u[f]+a),n+=v,r+=m,++c;for(d=4042322160|s(D(),g()),h=g();I>c;)p&&(n=yt(n,o<<16),r=yt(r,l<<16)),t=n>>16,e=r>>16,p||(t=St(t,o),e=St(e,l)),t>=0&&e>=0&&o>t&&l>e&&(a=Ui(i,k,t,e),a=s(a&d,h),f=s(c,y),u[f]=u[f]+a),n+=M(v,h),r+=M(m,h),c+=w;for(d=D(),h=tt();S>c;)p&&(n=yt(n,o<<16),r=yt(r,l<<16)),t=n>>16,e=r>>16,p||(t=St(t,o),e=St(e,l)),t>=0&&e>=0&&o>t&&l>e&&(a=Ui(i,k,t,e),a=s(a&d,h),f=s(c,y),u[f]=u[f]+a),n+=v,r+=m,++c}function bi(t,r,s){var e,i;if(1!==P())return nf(t,r,s);for(e=r,i=s;i>e+4;)u[e]=t,u[e+1]=t,u[e+2]=t,u[e+3]=t,e+=4;for(;i>e;)u[e]=t,++e}function nf(l,a,r){var f,n,h,o,t,c,i,e;if(o=Ni(a,r),c=_i(a,r),f=P(),n=g(),e=a,o>e)for(i=s(l&D(),tt());o>e;)t=s(e,n),u[t]=u[t]+i,++e;if(c>e)for(h=4042322160|s(D(),g()),i=s(l&h,g());c>e;)t=s(e,n),u[t]=u[t]+i,e+=f;if(r>e)for(i=s(l&D(),tt());r>e;)t=s(e,n),u[t]=u[t]+i,++e}function mr(e){return n(e,_a)}function rf(e,t){return a(e,_a,t)}function Fr(e){return n(e,Na)}function tf(e,t){return a(e,Na,t)}function Yc(){return Xc(Di(),xt(),_t(),y())}function Xc(i,c,f,h){var s,n,o,e,r,t,l,a;for(o=Pr(i),r=Li(i),n=mr(i),s=(c-gt(i))*n+(h-ar(i))*Fr(i),t=l=c,a=f;((e=s>>16)<0||e>=r)&&a>t;)++t,s+=n;if(t>l&&(0>e&&(e=0),e>=r&&(e=r-1),bi(o[e],l,t)),1===P())for(;(e=s>>16)=0&&a>t;)u[t]=o[e],++t,s+=n;else t=Hc(i,o,s,n,t,f);a>t&&(0>e&&(e=0),e>=r&&(e=r-1),bi(o[e],t,a))}function Hc(y,p,b,v,h,l){var k,c,o,a,r,d,n,m,e,f,i,t;for(k=P(),c=g(),f=Li(y),r=b,t=h,e=r>>16,d=Ni(h,l),m=_i(h,l),o=D(),a=tt();d>t&&f>e&&e>=0;){for(i=p[e],i=s(i&o,a);d>t&&r>>16===e;)n=s(t,c),u[n]=u[n]+i,++t,r+=v;e=r>>16}for(o=4042322160|s(D(),g()),a=g();m>t&&f>e&&e>=0;){for(i=p[e],i=s(i&o,a);m>t&&r>>16===e;)n=s(t,c),u[n]=u[n]+i,t+=k,r+=M(v,a);e=r>>16}for(o=D(),a=tt();l>t&&f>e&&e>=0;){for(i=p[e],i=s(i&o,a);l>t&&r>>16===e;)n=s(t,c),u[n]=u[n]+i,++t,r+=v;e=r>>16}return t}function rt(){return t[qo]}function zc(e){return t[qo]=e}function Rr(){return t[Mo]}function Tc(e){return t[Mo]=e}function Lr(){return t[Bo]}function Ic(e){return t[Bo]=e}function Qi(){return t[_o]}function el(e){return t[_o]=e}function Wr(e){return n(e,Wa)}function Uu(e,t){return a(e,Wa,t)}function _r(e){return n(e,Da)}function xu(e,t){return a(e,Da,t)}function gt(e){return n(e,Ta)}function Wh(e,t){return a(e,Ta,t)}function ar(e){return n(e,La)}function jh(e,t){return a(e,La,t)}function wh(f,l,a,m,d,h,p){var t,r,n,c,e,o,i,s;for(t=0|a[0],r=0|a[1],e=br(t>>16,r>>16),o=l[e],n=(e-1)*(e-1),i=h,s=p,s>gt(f)&&(s=gt(f));s>i;){for(;s>i&&j(t>>16,r>>16)>=n;)u[i]=o,++i,t+=m,r+=d;for(c=j(t>>16,r>>16);n>c;)--e,o=l[e],n=(e-1)*(e-1)}return a[0]=t,a[1]=r,i}function Sh(I,h,m,b,F,y,S){var O,d,c,a,r,n,v,l,k,o,p,t,e,i,f;if(r=0|m[0],n=0|m[1],O=P(),d=g(),t=br(r>>16,n>>16),o=(t-1)*(t-1),i=y,f=gt(I),f>S&&(f=S),v=Ni(y,f),k=_i(y,f),v>i)for(c=D(),a=tt(),e=h[t],e=s(e&c,a);v>i;){for(;v>i&&j(r>>16,n>>16)>=o;)l=s(i,d),u[l]=u[l]+e,++i,r+=b,n+=F;for(p=j(r>>16,n>>16);o>p;)--t,e=h[t],e=s(e&c,a),o=(t-1)*(t-1)}if(k>i)for(c=4042322160|s(D(),g()),a=g(),e=h[t],e=s(e&c,a);k>i;){for(;k>i&&j(r>>16,n>>16)>=o;)l=s(i,d),u[l]=u[l]+e,i+=O,r+=M(b,a),n+=M(F,a);for(p=j(r>>16,n>>16);o>p;)--t,e=h[t],e=s(e&c,a),o=(t-1)*(t-1)}if(f>i)for(c=D(),a=tt(),e=h[t],e=s(e&c,a);f>i;){for(;f>i&&j(r>>16,n>>16)>=o;)l=s(i,d),u[l]=u[l]+e,++i,r+=b,n+=F;for(p=j(r>>16,n>>16);o>p;)--t,e=h[t],e=s(e&c,a),o=(t-1)*(t-1)}return m[0]=r,m[1]=n,i}function Of(){return of(Di(),xt(),_t(),y())}function of(t,c,d,v){var n,p,h,l,o,f,a,m,s,u,e,r;for(s=Pr(t),u=Li(t),p=c-gt(t),h=v-ar(t),o=mr(t),a=Wr(t),l=p*o+h*Fr(t),f=p*a+h*_r(t),e=c,r=d,m=(u-1)*(u-1);j(l>>16,f>>16)>=m&&r>e;)++e,l+=o,f+=a;e>c&&bi(s[u-1],c,e),n=i(),n[0]=l,n[1]=f,ee&&(e=1===P()?Hu(t,s,n,o,a,e,r):zu(t,s,n,o,a,e,r)),d>e&&bi(s[u-1],e,d)}function Hu(k,h,s,v,m,d,p){var i,t,a,f,n,e,l,o,r,c;for(i=0|s[0],t=0|s[1],e=br(i>>16,t>>16),o=h[e],l=Li(k),f=(l-1)*(l-1),n=(e+1)*(e+1),a=j(i>>16,t>>16),r=d,c=p;c>r&&f>a;){for(;c>r&&j(i>>16,t>>16)<=n;)u[r]=o,++r,i+=v,t+=m;for(a=j(i>>16,t>>16);a>n;)++e,o=h[e],n=(e+1)*(e+1)}return s[0]=i,s[1]=t,r}function zu(A,p,b,S,y,F,d){var I,k,f,o,r,a,m,c,n,v,h,l,t,O,e,i;if(r=0|b[0],a=0|b[1],I=P(),k=g(),t=br(r>>16,a>>16),O=Li(A),h=(O-1)*(O-1),l=(t+1)*(t+1),n=j(r>>16,a>>16),i=F,m=Ni(F,d),v=_i(F,d),m>i&&h>n)for(f=D(),o=tt(),e=p[t],e=s(e&f,o);m>i&&h>n;){for(;m>i&&j(r>>16,a>>16)<=l;)c=s(i,k),u[c]=u[c]+e,++i,r+=S,a+=y;for(n=j(r>>16,a>>16);n>l;)++t,e=p[t],e=s(e&f,o),l=(t+1)*(t+1)}if(v>i&&h>n)for(f=4042322160|s(D(),g()),o=g(),e=p[t],e=s(e&f,o);v>i&&h>n;){for(;v>i&&j(r>>16,a>>16)<=l;)c=s(i,k),u[c]=u[c]+e,i+=I,r+=M(S,o),a+=M(y,o);for(n=j(r>>16,a>>16);n>l;)++t,e=p[t],e=s(e&f,o),l=(t+1)*(t+1)}if(d>i&&h>n)for(f=D(),o=tt(),e=p[t],e=s(e&f,o);d>i&&h>n;){for(;d>i&&j(r>>16,a>>16)<=l;)c=s(i,k),u[c]=u[c]+e,++i,r+=S,a+=y;for(n=j(r>>16,a>>16);n>l;)++t,e=p[t],e=s(e&f,o),l=(t+1)*(t+1)}return b[0]=r,b[1]=a,i}function vn(t,i){var e;return e=Et(t)-Et(i),0!==e?e>0:Kt(t)>>>0>>0}function cn(i,s,n){var r,t,e;if(0===i)return!1;if(t=sM(Ft(),g())?M(Ft(),g()):n,trt()&&(e=rt()),tGi()&&zi(e),e>Ji()&&Oi(e),t>=e)return!1;if(vr(i))bi(i,t,e);else{if(Ku(i),Ju(t),Xu(e),r=vh(i),1>=r)return!0;switch(r){case 0:case 1:pi();break;case 2:Yc();break;case 3:Of();break;case 4:case 5:qf()}}return!1}function vh(e){return(J(e)&ga)>>>8}function jr(){var e,t,i;for(i=y();Y()i)return!1;if(t=J(e),(t&rr)===Ss)return!0;if(!X(1))return!1;switch(t){case 0:case 1:case 2:case 3:pi();break;case 4:vf();break;case 5:yf();break;case 6:df();break;case 7:gf()}rn(e),yr(Y()+1)}return!1}function wr(){var t,i,s,e;for(i=e=rt();w()=rt())return!1;if(Xi(i),Ut(t)&&Xf(t),Yu(t)&&(Hf(t),r))return!1;ot(w()+1),w()=Lr()&&fo(i,e))}return e=V()?-1:e}function Ri(){return Nt()===Yt}function fu(){Fh(N())}function Mu(){return Eh}function ei(t,i){var e;return t===i?!0:(e=Q(t)-Q(i),0!==e?0>e:(e=A(t)-A(i),0>e))}function Y(){return t[No]}function yr(e){return t[No]=e}function K(){return t[Wo]}function fs(e){return t[Wo]=e}function Li(e){return n(e,Ra)}function Mf(e,t){return a(e,Ra,t)}function Pr(e){return x(Z,e+Gc)}function gr(){return 0!==tl()}function tl(){return t[Do]}function Cr(e){return t[Do]=e}function _f(){return 0!==Df()}function Df(){return t[To]}function Vr(e){return t[To]=e}function oa(n,a){var e,i,r,s,t;if(e=Tn(n,a),-1===e)return!1;if(0===e)return fu(),!0;if(ki(e,Kt(0)),yi(e,Et(0)),Xt(e,dr(0)),fu(),V()<=N())return!0;for(t=0,e=N();eFt()&&xs(Ft()),Ic(M(zt(),g())),el(M(Is(),g())),zc(M(Rt(),g())),Tc(M(Vs(),g())),fs(0),Ki(0),B=x(Z,O),b=x(Z,O),Yl(),r?null:0===K()?(Jt(Rr()),0):(Kc(),Jt(Q(B[0])),y()e);)b[e+1]=b[e],--e;b[t]=i,Ki(W()+1)}function Jf(e){return(J(e)&rr)===da}function $f(e){var t;return t=J(e),t>va?!1:0!==(J(e)&va)}function sh(e){return vr(e)||qu(e)}function vr(e){return 0!==(4278190080&e)}function L(e){return 0===e||vr(e)||Au(e)&&sh(e)}function Iu(e){return(J(e)&rr)===ba}function Au(e){return e>=0&&O>e}function qu(e){return 0!==(J(e)&ga)}function Ut(e){return 0!==(J(e)&vc)}function Nu(){return t[Lo]}function Du(e){return t[Lo]=e}function Di(){return t[Ro]}function Ku(e){return t[Ro]=e}function xt(){return t[Eo]}function Ju(e){return t[Eo]=e}function _t(){return t[Ko]}function Xu(e){return t[Ko]=e}function Nn(e){return n(e,Ka)}function hc(e,t){return a(e,Ka,t)}function xr(e){return n(e,za)}function Ac(e,t){return a(e,za,t)}function wc(e){return n(e,Ua)}function Cc(e,t){return a(e,Ua,t)}function jc(e){return n(e,Ja)}function _c(e,t){return a(e,Ja,t)}function Lc(e){return n(e,Ga)}function ea(e,t){return a(e,Ga,t)}function qr(e){return n(e,eo)}function $c(e,t){return a(e,eo,t)}function Ht(e){return n(e,to)}function mf(e,t){return a(e,to,t)}function kf(e,t){return a(e,uf,t)}function cr(n,a,o,l){var e,u,t,s,i;if(e=Hr(),r)return 0;for(Zs(e,n[0]),Ys(e,n[1]),wi(e,a[0]),Ai(e,a[1]),qi(e,o[0]),xi(e,o[1]),i=u=zf(e,l),t=e;u>=t;t+=6)if(s=Yr(t),s>i&&(i=s),r)return 0;return Ot(i,6)}function If(u,c,f,h,p){var t,s,n,a,o;if(I(i(),e.fetchPointerofObject(0,u)),e.failed())return null;for(s=i()[0],a=i()[1],t=1;c-1>=t;t++){if(I(i(),e.fetchPointerofObject(t,u)),e.failed())return null;if(n=i()[0],o=i()[1],i()[0]=s,i()[1]=a,l()[0]=n,l()[1]=o,at(2),ct(h,i(),l(),p,f,0),r)return null;s=n,a=o}}function Pf(n,k,p,a,o){var t,s,v,h,c,d,m,u,f;for(t=0;k-1>=t;t++){if(s=e.fetchPointerofObject(3*t,n),I(i(),s),s=e.fetchPointerofObject(3*t+1,n),I(l(),s),s=e.fetchPointerofObject(3*t+2,n),I(F(),s),e.failed())return null;if(at(3),h=i()[0],m=i()[1],c=l()[0],u=l()[1],d=F()[0],f=F()[1],h===m&&c===u||c===d&&u===f)ct(a,i(),F(),o,p,0);else{if(v=cr(i(),l(),F(),0!==a&&0!==o),r)return null;ur(a,o,p,0,v)}if(r)return null}}function Vf(r,s,n){var i,t;for(i=0;n-1>=i;i++){if(t=e.fetchPointerofObject(i,r),"number"!=typeof t&&!t.isFloat)return e.primitiveFail();s[i]="number"==typeof t?t:e.floatValueOf(t)}}function xf(e,t,r,s,i){jt(t)>=Ct(t)?(G(e,$t(t)),hi(e,Ct(t)-i),ru(e,Vi(t)),Un(e,Pi(t)-i),$s(e,Tt(t)),Yo(e,jt(t)-i)):(G(e,Tt(t)),hi(e,jt(t)-i),ru(e,Vi(t)),Un(e,Pi(t)-i),$s(e,$t(t)),Yo(e,Ct(t)-i)),tr(e,ks()),as(e,r),ns(e,s)}function pa(e){return Ti||kr()?Ti(e):!1}function Bf(s,u,b,g,k,v,m){var l,d,t,i,o,f,a,h,n,c;if(u.isNil)n=0,h=null;else{if(nt(u)!==e.classBitmap())return e.primitiveFail();n=p(u),h=u.wordsAsInt32Array()}return"number"==typeof s?e.primitiveFail():e.isPointers(s)?p(s)<5?e.primitiveFail():(l=e.fetchPointerofObject(0,s),nt(l)!==e.classBitmap()?e.primitiveFail():(d=p(l),a=e.fetchIntegerofObject(1,s),o=e.fetchIntegerofObject(2,s),t=e.fetchIntegerofObject(3,s),e.failed()?null:a>=0&&o>=0?32!==t&&8!==t&&16!==t&&1!==t&&2!==t&&4!==t?e.primitiveFail():0!==n&&n!==M(1,t)?e.primitiveFail():(c=Ot(32,t),f=Ot(a+(c-1),c),d!==f*o?e.primitiveFail():(i=pf(n,h),r?null:(Mh(i,a),Ll(i,o),mh(i,t),af(i,f),Rh(i,d),Nh(i,b),st(i,m),ho(i,g,k,v,a,o),i))):e.primitiveFail())):e.primitiveFail()}function wa(r){var s,t,n,i;return i=ir(r),i>p(Wi)?null:(n=e.fetchPointerofObject(i,Wi),t=e.fetchPointerofObject(0,n),s=p(t),s!==zh(r)?null:t.wordsAsInt32Array())}function Wf(i){var t,e;return e=$i(),Cr(0),(t=Ao(i,e,8))?(Cr(1),e[1]=256*e[1],e[3]=256*e[3],e[5]=256*e[5],e[7]=256*e[7],t):!1}function Ma(k,e,v,d,p,h,f){var t,m,a,u,n,s,c,o;return d!==p||0!==h&&0!==f?(t=6*k,v?(a=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+0],s=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+1],u=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+2],c=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+3],n=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+4],o=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+5]):(a=0|e[t+0],s=0|e[t+1],u=0|e[t+2],c=0|e[t+3],n=0|e[t+4],o=0|e[t+5]),a===u&&s===c||u===n&&c===o?a===n&&s===o?null:(i()[0]=a,i()[1]=s,l()[0]=n,l()[1]=o,at(2),ct(h,i(),l(),f,d,p)):(i()[0]=a,i()[1]=s,l()[0]=u,l()[1]=c,F()[0]=n,F()[1]=o,at(3),m=cr(i(),l(),F(),0!==h&&0!==f),r?null:void ur(h,f,d,p,m))):null}function Tf(F,v,b,g,k,m,d,y){var l,f,u,t,p,o,s,c,n,e,h,a,i;if(0===v)return 0;for(u=n=a=o=-1,f=c=h=p=1,t=e=i=s=0,l=1;v>=l;l++){if(--f<=0&&(++u,f=Wt(u,b),t=Ii(u,b),0!==t&&(t=d[t-1],t=q(t),r)))return null;if(--c<=0&&(++n,c=Wt(n,g),e=Ii(n,g),0!==e&&(e=d[e-1],e=q(e))),--h<=0&&(++a,h=Wt(a,k),i=Ii(a,k),0!==i&&(i=ci(i))),--p<=0&&(++o,p=Wt(o,m),s=Ii(o,m),0!==s&&(s=d[s-1])),Ma(l-1,F,y,t,e,i,s),r)return null}}function lo(i){var t;return t=Nu(),p(i)0?(c=a*m*65536/l|0,f=o*m*65536/l|0):(c=0,f=0),n=s*s+u*u,n>0?(h=s*d*65536/n|0,p=u*d*65536/n|0):(h=0,p=0),Wh(r,e[0]),jh(r,e[1]),rf(r,c),tf(r,f),Uu(r,h),xu(r,p)}function po(o){var r,u,l,s,c,n,t,i,a;if(!e.isArray(o))return!1;for(Wi=o,i=0;i<=p(Wi)-1;i++){if(t=e.fetchPointerofObject(i,Wi),"number"==typeof t)return!1;if(!e.isPointers(t))return!1;if(p(t)<5)return!1;if(r=e.fetchPointerofObject(0,t),nt(r)!==e.classBitmap())return!1;if(u=p(r),n=e.fetchIntegerofObject(1,t),s=e.fetchIntegerofObject(2,t),l=e.fetchIntegerofObject(3,t),e.failed())return!1;if(!(n>=0&&s>=0))return!1;if(a=Ot(32,l),c=Ot(n+(a-1),a),u!==c*s)return!1}return!0}function eh(i,n,a,o,u){var s,t;return nt(i)!==e.classBitmap()?e.primitiveFail():(t=p(i),s=sf(i.wordsAsInt32Array(),t,u),r?null:(ho(s,n,a,o,t,t),s))}function th(e,r,s,a,o,u){var t,i,n;r[1]<=s[1]?(t=r,i=s,n=1):(t=s,i=r,n=-1),G(e,t[0]),hi(e,t[1]-a),tr(e,ks()),as(e,o),ns(e,u),hc(e,i[0]),Ac(e,i[1]-a),kf(e,n)}function ih(t,s,f,h){var n,a,o,e,u,c;for(c=l()[0]-i()[0]>>1,o=l()[1]-i()[1]>>1,n=l()[0]+i()[0]>>1,a=l()[1]+i()[1]>>1,e=0;15>=e;e++){if(rh(e,c,o,n,a),at(3),u=cr(i(),l(),F(),0!==t&&0!==s),r)return null;if(ur(t,s,f,h,u),r)return null}}function rh(e,a,f,s,n){var h,t,u,c,r,o;h=Rs()[2*e+0]*a+s|0,c=Ls()[2*e+0]*f+n|0,i()[0]=h,i()[1]=c,u=Rs()[2*e+2]*a+s|0,o=Ls()[2*e+2]*f+n|0,F()[0]=u,F()[1]=o,t=Rs()[2*e+1]*a+s|0,r=Ls()[2*e+1]*f+n|0,t=2*t-(h+u>>1),r=2*r-(c+o>>1),l()[0]=t,l()[1]=r}function I(r,i){var t;return nt(i)!==e.classPoint()?e.primitiveFail():(t=e.fetchPointerofObject(0,i),"number"==typeof t||t.isFloat?(r[0]="number"==typeof t?t:0|e.floatValueOf(t),t=e.fetchPointerofObject(1,i),"number"==typeof t||t.isFloat?void(r[1]="number"==typeof t?t:0|e.floatValueOf(t)):e.primitiveFail()):e.primitiveFail())}function nh(e,c,p,h,f,u){var t,a,n,s,o;for(u?(a=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[0],s=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[1]):(a=0|e[0],s=0|e[1]),t=1;c-1>=t;t++){if(u?(n=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*t],o=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*t+1]):(n=0|e[2*t],o=0|e[2*t+1]),i()[0]=a,i()[1]=s,l()[0]=n,l()[1]=o,at(2),ct(h,i(),l(),f,p,0),r)return null;a=n,s=o}}function dh(e,t,r,s){ct(e,i(),l(),t,r,s),ct(e,l(),F(),t,r,s),ct(e,F(),Ci(),t,r,s),ct(e,Ci(),i(),t,r,s)}function So(){var r,t,s,i;return 2!==e.methodArgumentCount()?c:0!==(t=R(e.stackValue(2)))?t:(s=e.stackObjectValue(0),r=e.stackObjectValue(1),e.failed()?f:0!==(t=Bi(e.fetchPointerofObject(si,o)))?t:pa(e.fetchPointerofObject(pn,o))?po(e.fetchPointerofObject(dn,o))?p(r)=e;e++)if(Ma(e-1,t,o,s,0,n,a),r)return null}function Bi(t){return nt(t)!==e.classBitmap()?$n:(u=t.words,Zc(p(t)-1),0)}function Ao(t,r,i){return t.isNil?!1:"number"==typeof t?e.primitiveFail():p(t)!==i?e.primitiveFail():(e.isWords(t)?qh(t,r,i):Vf(t,r,i),!0)}function ur(t,a,o,u,l){var e,i,n,s;for(0===t||0===a?(s=!1,n=0):(s=!0,n=wt(t)),i=6*l;i>0;){if(e=s?$u():ah(),r)return 0;xf(e,i,o,u,n),s&&(bu(e,a),us(e,t),ku(e,t)),i-=6}vt()}function ct(t,n,a,s,o,u){var e,i;return 0===t||0===s?(e=ef(),i=0):(e=Qu(),i=wt(t)),r?0:(th(e,n,a,i,o,u),void(Ut(e)&&(ju(e,s),sr(e,t),Cu(e,t))))}function qh(i,r,s){var e,t;for(t=i.wordsAsFloat32Array(),e=0;s-1>=e;e++)r[e]=t[e]}function nr(i){return"number"==typeof i?Gl:e.isWords(i)?p(i)Qt()?kt:0)):Ul}function Lh(){return t[zo]}function vu(e){return t[zo]=e}function Su(e){0===strcmp(e,Si)&&(Ti=0,ji=0)}function Ou(t,i,r){var e;for(e=t;e>0&&A(b[e-1])>r;)b[e]=b[e-1],--e;b[e]=i}function X(e){return fi+O+K()+W()+e>$()?(It(Wc),!1):!0}function wo(){return 0!==Pu()}function Pu(){return t[Jo]}function Vt(e){return t[Jo]=e}function n(e,t){return Z[e+t]}function a(e,t,i){return Z[e+t]=i}function su(){return t[Ho]}function Wu(e){return t[Ho]=e}function Br(){return t[Xo]}function uu(e){return t[Xo]=e}function Ru(e){return n(e,Fs)}function ir(e){return n(e,fa)}function st(e,t){return a(e,fa,t)}function Gu(e){return n(e,ha)}function pt(e,t){return a(e,ha,t)}function J(e){return n(e,Fs)&mc}function U(e,t){return a(e,Fs,t)}function wt(e){return e>>1}function i(){return x(t,oh)}function l(){return x(t,uh)}function F(){return x(t,lh)}function Ci(){return x(t,ch)}function Dr(){Y()>=K()&&0===W()&&v(Yt),y()>=Rr()&&v(Yt)}function il(){var t;return 0!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=R(e.stackValue(0)))?e.primitiveFailFor(t):(v(Yt),void k(o))}function rl(){var t,i,s;return d&&(m=e.ioMicroMSecs()),1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(s=S(e.stackValue(1),ii))?e.primitiveFailFor(s):(i=e.stackObjectValue(0),e.failed()?e.primitiveFailFor(f):(t=lo(i))?X(1)?(ft(t)>0&&rn(t),r?e.primitiveFailFor(_):(v(lt),k(o),e.pop(1),void(d&&(h(Bs,1),h(Ks,e.ioMicroMSecs()-m))))):e.primitiveFailFor(kt):e.primitiveFailFor(gs))}function nl(){var a,u,t,n,s,h,p;return 5!==e.methodArgumentCount()?e.primitiveFailFor(c):(s=e.positive32BitValueOf(e.stackValue(0)),t=e.positive32BitValueOf(e.stackValue(1)),p=e.stackObjectValue(2),a=e.stackObjectValue(3),h=e.stackObjectValue(4),e.failed()?e.primitiveFailFor(f):0!==(u=S(e.stackValue(5),C))?e.primitiveFailFor(u):L(t)&&L(s)?(I(i(),h),I(l(),p),I(F(),a),e.failed()?e.primitiveFailFor(f):(at(3),n=cr(i(),l(),F(),!1),X(n*Gt),r||(t=q(t),s=q(s)),r||ur(0,0,t,s,n),r?(vt(),e.primitiveFailFor(_)):e.failed()?e.primitiveFailFor(ut):(k(o),void e.pop(5)))):e.primitiveFailFor(it))}function al(){var h,n,u,i,t,s,a,l,d;if(5!==e.methodArgumentCount())return e.primitiveFailFor(c);if(i=e.positive32BitValueOf(e.stackValue(0)),t=e.stackIntegerValue(1),n=e.positive32BitValueOf(e.stackValue(2)),s=e.stackIntegerValue(3),a=e.stackObjectValue(4),e.failed())return e.primitiveFailFor(f);if(0!==(h=S(e.stackValue(5),C)))return e.primitiveFailFor(h);if(u=p(a),e.isWords(a)){if(l=!1,u!==3*s&&u!==6*s)return e.primitiveFailFor(f)}else{if(!e.isArray(a))return e.primitiveFailFor(f);if(u!==3*s)return e.primitiveFailFor(f);l=!0}return d=0===t||0===i?At:ni,X(d*s)?L(i)&&L(n)?(i=q(i),n=q(n),r?e.primitiveFailFor(_):0!==i&&0!==t||0!==n?(0!==t&&(t=ci(t),1>t&&(t=1)),l?Pf(a,s,n,t,i):bh(a.wordsAsInt32Array(),s,n,t,i,3*s===u),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(Vt(1),k(o),void e.pop(5))):e.pop(5)):e.primitiveFailFor(it):e.primitiveFailFor(kt)}function ol(){var s,n,a,u,h,p,d,m,t;return 7!==e.methodArgumentCount()?e.primitiveFailFor(c):(t=e.stackIntegerValue(0),0>=t?e.primitiveFailFor(f):(p=e.stackObjectValue(1),n=e.stackObjectValue(2),d=e.stackObjectValue(3),m=e.booleanValueOf(e.stackValue(4)),s=e.stackObjectValue(5),h=e.stackObjectValue(6),e.failed()?e.primitiveFailFor(f):0!==(a=S(e.stackValue(7),C))?e.primitiveFailFor(a):(I(i(),d),I(l(),n),I(F(),p),e.failed()?e.primitiveFailFor(Fi):(u=Bf(h,s,m?1:0,i(),l(),F(),t-1),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(k(o),void e.popthenPush(8,e.positive32BitIntegerFor(u)))))))}function ul(){var h,s,n,a,u,t,i,d,l;return 7!==e.methodArgumentCount()?e.primitiveFailFor(c):(s=e.stackObjectValue(0),a=e.stackObjectValue(1),u=e.stackObjectValue(2),l=e.stackObjectValue(3),n=e.stackObjectValue(4),t=e.stackIntegerValue(5),i=e.stackObjectValue(6),e.failed()?e.primitiveFailFor(f):0!==(h=S(e.stackValue(7),C))?e.primitiveFailFor(h):Ih(i,t,n,l,u,a,s)?X(Math.max(Gt,At)*t)?(d=p(i)===3*t,Tf(i.wordsAsInt32Array(),t,n.wordsAsInt32Array(),l.wordsAsInt32Array(),u.wordsAsInt32Array(),a.wordsAsInt32Array(),s.wordsAsInt32Array(),d),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(Vt(1),k(o),void e.pop(7))):e.primitiveFailFor(kt):e.primitiveFailFor(Tl))}function cl(){var t,s,n,a,u,h,p;return 5!==e.methodArgumentCount()?e.primitiveFailFor(c):(a=e.booleanValueOf(e.stackValue(0)),u=e.stackValue(1),t=e.stackValue(2),h=e.stackValue(3),p=e.stackValue(4),e.failed()?e.primitiveFailFor(f):0!==(s=S(e.stackValue(5),C))?e.primitiveFailFor(s):(I(i(),h),I(l(),t),I(F(),u),e.failed()?e.primitiveFailFor(Fi):(n=eh(p,i(),l(),F(),a),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(k(o),void e.popthenPush(6,e.positive32BitIntegerFor(n))))))}function fl(){var n,a,t,s,u;return 4!==e.methodArgumentCount()?e.primitiveFailFor(c):(s=e.positive32BitValueOf(e.stackValue(0)),t=e.positive32BitValueOf(e.stackValue(1)),n=e.stackObjectValue(2),u=e.stackObjectValue(3),e.failed()?e.primitiveFailFor(f):0!==(a=S(e.stackValue(4),C))?e.primitiveFailFor(a):L(t)&&L(s)?(I(i(),u),I(l(),n),e.failed()?e.primitiveFailFor(Fi):(at(2),t=q(t),s=q(s),r?e.primitiveFailFor(_):(ct(0,i(),l(),0,t,s),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(k(o),void e.pop(4))))):e.primitiveFailFor(it))}function hl(){var t,s,a,u,n,h;return 5!==e.methodArgumentCount()?e.primitiveFailFor(c):(t=e.positive32BitValueOf(e.stackValue(0)),s=e.stackIntegerValue(1),n=e.positive32BitValueOf(e.stackValue(2)),a=e.stackObjectValue(3),h=e.stackObjectValue(4),e.failed()?e.primitiveFailFor(f):0!==(u=S(e.stackValue(5),C))?e.primitiveFailFor(u):L(t)&&L(n)?(n=q(n),t=q(t),r?e.primitiveFailFor(_):0===n&&(0===t||0>=s)?e.pop(5):X(16*Gt)?(s=s>0&&0!==t?ci(s):0,I(i(),h),I(l(),a),e.failed()?e.primitiveFailFor(Fi):(ih(s,t,0,n),r?(vt(),e.primitiveFailFor(_)):e.failed()?e.primitiveFailFor(ut):(Vt(1),k(o),void e.pop(5)))):e.primitiveFailFor(kt)):e.primitiveFailFor(it))}function dl(){var h,n,u,t,i,s,a,l,d;if(5!==e.methodArgumentCount())return e.primitiveFailFor(c);if(t=e.positive32BitValueOf(e.stackValue(0)),i=e.stackIntegerValue(1),n=e.positive32BitValueOf(e.stackValue(2)),s=e.stackIntegerValue(3),a=e.stackObjectValue(4),e.failed())return e.primitiveFailFor(f);if(0!==(h=S(e.stackValue(5),C)))return e.primitiveFailFor(h);if(u=p(a),e.isWords(a)){if(l=!1,u!==s&&2*s!==u)return e.primitiveFailFor(f)}else{if(!e.isArray(a))return e.primitiveFailFor(f);if(u!==s)return e.primitiveFailFor(f);l=!0}return d=0===i||0===t?At:ni,X(d*s)?L(t)&&L(n)?(t=q(t),n=q(n),r?e.primitiveFailFor(_):0!==t&&0!==i||0!==n?(0!==i&&(i=ci(i)),l?If(a,s,n,i,t):nh(a.wordsAsInt32Array(),s,n,i,t,s===u),r?e.primitiveFailFor(_):e.failed()?e.primitiveFailFor(ut):(Vt(1),k(o),void e.pop(5))):e.pop(5)):e.primitiveFailFor(it):e.primitiveFail()}function kl(){var t,s,a,u,n,h;return 5!==e.methodArgumentCount()?e.primitiveFailFor(c):(t=e.positive32BitValueOf(e.stackValue(0)),s=e.stackIntegerValue(1),n=e.positive32BitValueOf(e.stackValue(2)),a=e.stackObjectValue(3),h=e.stackObjectValue(4),e.failed()?e.primitiveFailFor(f):0!==(u=S(e.stackValue(5),C))?e.primitiveFailFor(u):L(t)&&L(n)?(t=q(t),n=q(n),r?e.primitiveFailFor(_):0!==n||0!==t&&0!==s?X(4*At)?(s=s>0&&0!==t?ci(s):0,I(i(),h),I(F(),a),e.failed()?e.primitiveFailFor(Fi):(l()[0]=F()[0],l()[1]=i()[1],Ci()[0]=i()[0],Ci()[1]=F()[1],at(4),dh(s,t,0,n),e.failed()?e.primitiveFailFor(ut):(Vt(1),k(o),void e.pop(5)))):e.primitiveFailFor(kt):e.pop(5)):e.primitiveFailFor(it))}function gl(){var t,i,r;return d&&(m=e.ioMicroMSecs()),1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(r=S(e.stackValue(1),ti))?e.primitiveFailFor(r):(i=e.stackObjectValue(0),e.failed()?e.primitiveFailFor(f):(t=lo(i))?(0===ft(t)?Dn():(Yn(),ot(w()+1)),v(Mt),k(o),e.pop(1),void(d&&(h(_s,1),h(zs,e.ioMicroMSecs()-m)))):e.primitiveFailFor(gs))}function bl(){var o,s,n,r,u,i,a,l;if(2!==e.methodArgumentCount())return e.primitiveFailFor(c);if(s=e.stackValue(0),o=e.stackValue(1),0!==(u=nr(o)))return e.primitiveFailFor(u);if(nt(o)!==nt(s))return e.primitiveFailFor($n);if(n=p(s)-p(o),0>n)return e.primitiveFailFor(Kl);for(a=t,r=s.wordsAsInt32Array(),i=0,l=$()-1;l>=i;i++)r[i]=a[i];for(r[Ms]=$()+n,r[Es]=Qt()+n,a=x(a,$()),r=x(r,$()+n),i=0,l=Qt()-$()-1;l>=i;i++)r[i]=a[i];return 0!==(u=nr(s))?e.primitiveFailFor(u):void e.pop(2)}function yl(){var t;return d&&(m=e.ioMicroMSecs()),0!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=S(e.stackValue(0),Zt))?e.primitiveFailFor(t):0!==(t=Bi(e.fetchPointerofObject(si,o)))?e.primitiveFailFor(t):pa(e.fetchPointerofObject(pn,o))?((y()&mt())===mt()&&(ls(y()),Dr()),Ri()||(ot(0),Jt(y()+1),v(Mt)),k(o),void(d&&(h(ai,1),h(mi,e.ioMicroMSecs()-m)))):e.primitiveFailFor(Qn)}function Fl(){var t,i;i=d,t=e.stackObjectValue(0),t=e.booleanValueOf(t),e.failed()||(d=t,e.pop(2),e.pushBool(i))}function Sl(){var t,i;return d&&(m=e.ioMicroMSecs()),0!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=R(e.stackValue(0)))?e.primitiveFailFor(t):(i=Ri(),k(o),e.pop(1),e.pushBool(i),void(d&&(h(Ws,1),h(Gs,e.ioMicroMSecs()-m))))}function Ol(){var t;return 0!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=R(e.stackValue(0)))?e.primitiveFailFor(t):(e.pop(1),void e.pushInteger(P()))}function Il(){var s,r,i;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(s=R(e.stackValue(1)))?e.primitiveFailFor(s):(r=e.stackObjectValue(0),!e.failed()&&e.isWords(r)&&p(r)>=4?(i=r.wordsAsInt32Array(),i[0]=i[0]+t[Sr],i[1]=i[1]+t[js],i[2]=i[2]+t[qs],i[3]=i[3]+t[co],void e.pop(1)):e.primitiveFailFor(f))}function Pl(){var r,i,t;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(r=R(e.stackValue(1)))?e.primitiveFailFor(r):(t=e.stackObjectValue(0),!e.failed()&&e.isPointers(t)&&p(t)>=2?(e.pushRemappableOop(t),i=e.makePointwithxValueyValue(zt(),Is()),e.storePointerofObjectwithValue(0,e.topRemappableOop(),i),i=e.makePointwithxValueyValue(Rt(),Vs()),t=e.popRemappableOop(),e.storePointerofObjectwithValue(1,t,i),void e.popthenPush(2,t)):e.primitiveFailFor(f))}function wl(){var s,r,i;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(s=R(e.stackValue(1)))?e.primitiveFailFor(s):(r=e.stackObjectValue(0),!e.failed()&&e.isWords(r)&&p(r)>=9?(i=r.wordsAsInt32Array(),i[0]=i[0]+t[Ds],i[1]=i[1]+t[Ws],i[2]=i[2]+t[li],i[3]=i[3]+t[Bs],i[4]=i[4]+t[ui],i[5]=i[5]+t[Ts],i[6]=i[6]+t[ai],i[7]=i[7]+t[oi],i[8]=i[8]+t[_s],void e.pop(1)):e.primitiveFailFor(f))}function Cl(){var t;return 0!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=R(e.stackValue(0)))?e.primitiveFailFor(t):(e.pop(1),void e.pushInteger(ks()))}function Vl(){var t;return 0!==e.methodArgumentCount()?e.primitiveFailFor(c):(o=e.stackValue(0),"number"==typeof o?e.primitiveFailFor(ta):e.isPointers(o)?p(o)=9?(i=r.wordsAsInt32Array(),i[0]=i[0]+t[Us],i[1]=i[1]+t[Gs],i[2]=i[2]+t[Ei],i[3]=i[3]+t[Ks],i[4]=i[4]+t[gi],i[5]=i[5]+t[Js],i[6]=i[6]+t[mi],i[7]=i[7]+t[vi],i[8]=i[8]+t[zs],void e.pop(1)):e.primitiveFailFor(f))}function Ml(){var r,i;return 1!==e.methodArgumentCount()?e.primitiveFail():(i=e.stackObjectValue(0),e.failed()?null:e.isWords(i)?(r=p(i))=256)return e.primitiveFail();n=t.bytes,i=!1;var s=t.bytesAsString();return s!==Si&&(Si=s,i=!0),i&&!kr()?e.primitiveFail():void e.pop(1)}function nc(){var r,t;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(r=S(e.stackValue(1),C))?e.primitiveFailFor(r):(t=e.stackObjectValue(0),!e.failed()&&e.isPointers(t)&&p(t)>=2?(I(i(),e.fetchPointerofObject(0,t)),I(l(),e.fetchPointerofObject(1,t)),e.failed()?e.primitiveFailFor(f):(As(i()[0]),Aa(i()[1]),xs(l()[0]),Ea(l()[1]),k(o),void e.pop(1))):e.primitiveFailFor(f))}function ac(){var t,i;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=S(e.stackValue(1),C))?e.primitiveFailFor(t):(i=e.stackObjectValue(0),e.failed()?e.primitiveFailFor(f):(Wf(i),e.failed()?e.primitiveFailFor(ut):(k(o),void e.pop(1))))}function uc(){var t,i;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(i=S(e.stackValue(1),C))?e.primitiveFailFor(i):(t=e.stackIntegerValue(0),e.failed()?e.primitiveFailFor(f):(Hn(t),k(o),void e.pop(1)))}function lc(){var t,i;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(t=S(e.stackValue(1),C))?e.primitiveFailFor(t):(i=e.stackObjectValue(0),e.failed()?e.primitiveFailFor(f):(Gf(i),e.failed()?e.primitiveFailFor(f):(k(o),void e.pop(1))))}function cc(){var r,t;return 1!==e.methodArgumentCount()?e.primitiveFailFor(c):0!==(r=S(e.stackValue(1),C))?e.primitiveFailFor(r):(t=e.stackValue(0),nt(t)!==e.classPoint()?e.primitiveFailFor(f):(I(i(),t),e.failed()?e.primitiveFailFor(f):(pl(i()[0]),Tu(i()[1]),k(o),void e.pop(1))))}function fc(){for(var t;!Ri();){if(d&&(m=e.ioMicroMSecs()),t=jr(),d&&(h(li,1),h(Ei,e.ioMicroMSecs()-m)),r)return v(lt);if(t)return v(ii),It(Cs);if(ot(0),vt(),Lt(1),d&&(m=e.ioMicroMSecs()),0!==Ns()&&0===(y()&mt())&&pr(),Lt(0),t=wr(),d&&(h(ui,1),h(gi,e.ioMicroMSecs()-m)),r)return v(Bt);if(t)return v(ri),It(ws);if(vt(),Oi(0),d&&(m=e.ioMicroMSecs()),(y()&mt())===mt()&&(ls(y()),Dr()),d&&(h(ai,1),h(mi,e.ioMicroMSecs()-m)),r)return v(Zt);if(Ri())return 0;if(ot(0),Jt(y()+1),d&&(m=e.ioMicroMSecs()),t=Ar(),d&&(h(oi,1),h(vi,e.ioMicroMSecs()-m)),r)return v(Mt);if(t)return v(ti),It(Ps)}}function Fn(){var i,t;if(t=Nt(),t===C){if(cu(),r)return 0;t=lt}if(t===lt){if(d&&(m=e.ioMicroMSecs()),i=jr(),d&&(h(li,1),h(Ei,e.ioMicroMSecs()-m)),r)return v(lt);if(i)return v(ii),It(Cs);ot(0),vt(),Lt(1),t=Bt}if(t===Bt){if(d&&(m=e.ioMicroMSecs()),0!==Ns()&&0===(y()&mt())&&pr(),Lt(0),i=wr(),d&&(h(ui,1),h(gi,e.ioMicroMSecs()-m)),r)return v(Bt);if(i)return v(ri),It(ws);t=Zt,vt(),Oi(0)}if(t===Zt){if(d&&(m=e.ioMicroMSecs()),(y()&mt())===mt()&&(ls(y()),Dr()),d&&(h(ai,1),h(mi,e.ioMicroMSecs()-m)),r)return v(Zt);if(Ri())return 0;t=Mt,ot(0),Jt(y()+1)}if(t===Mt){if(d&&(m=e.ioMicroMSecs()),i=Ar(),d&&(h(oi,1),h(vi,e.ioMicroMSecs()-m)),r)return v(Mt);if(i)return v(ti),It(Ps);v(lt)}}function R(t){var i;return e.failed()?jl:"number"==typeof t?ta:e.isPointers(t)?p(t)=h)return 0;if(u=s+r>>1,o=e[u],t=ei(c,o),t?(t=ei(o,l),t||(i=e[r],e[r]=e[u],e[u]=i,o=l)):(i=e[s],e[s]=e[u],e[u]=i,o=c),3>=h)return 0;for(n=s,a=r,f=!0;f;){for(t=!0;t;)n<=--a?(i=e[a],t=ei(o,i)):t=!1;for(t=!0;t;)++n<=a?(i=e[n],t=ei(i,o)):t=!1;f=a>=n,f&&(i=e[n],e[n]=e[a],e[a]=i)}Tr(e,s,a),Tr(e,n,r)}function Pc(){var e=[0,5,4,0,3,0,0,0,2,0,0,0,0,0,0,0,1];return e}function Dn(){var e;for(e=w(),Ki(W()-1);ee;)e+=t;for(;e>=t;)e-=t;return e}function Vc(){t[Us]=0,t[Gs]=0,t[Ei]=0,t[Ks]=0,t[gi]=0,t[Js]=0,t[mi]=0,t[vi]=0,t[zs]=0,t[Ds]=0,t[Ws]=0,t[li]=0,t[Bs]=0,t[ui]=0,t[Ts]=0,t[ai]=0,t[oi]=0,t[_s]=0,t[Sr]=0,t[js]=0,t[qs]=0,t[co]=0}function Yn(){var e,i,t;return 0===w()?null:(e=b[w()],t=A(e),i=b[w()-1],A(i)<=t?null:void Ou(w(),e,t))}function xc(){return Dt=gu(Mi)}function qc(){return Dt=Fu(Mi)}function Mc(){return Dt=Vu(Mi)}function Bc(){return Dt=ln(Mi)}function Zn(t){var e;t>=4&&(e=4),t>=2&&4>t&&(e=2),2>t&&(e=1),Vh(e),1===e&&(Os(0),Qs(4294967295),Hs(0)),2===e&&(Os(1),Qs(4244438268),Hs(1)),4===e&&(Os(2),Qs(4042322160),Hs(3)),Dh(2*g()),_h(g())}function Dc(i){var t;return e=i,t=e.majorVersion()==Bu,t===!1?!1:t=e.minorVersion()>=_u}function Wt(e,t){return(0|t[e])>>>16}function Ii(e,t){return 65535&(0|t[e])}function ra(e,t,i){return An()?(ki(0,e),yi(0,t),Xt(0,i),V()===N()?null:void(vn(0,V()-N())&&(ki(0,ts()),yi(0,Zr()),Xt(0,$r()),is(e),Qr(t),es(i)))):null}function Ec(){var e=[0,1,1,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6];return e}function Kc(){Tr(B,0,K()-1)}function Ji(){return t[Qo]}function Oi(e){return t[Qo]=e}function Gi(){return t[Zo]}function zi(e){return t[Zo]=e}function Ft(){return t[$o]}function Zc(e){return t[$o]=e}function Er(){return t[eu]}function Kr(e){return t[eu]=e}function j(e,t){return e*e+t*t}function Et(e){return dt(e+1)}function yi(e,t){return ht(e+1,t)}function N(){return 3}function dr(e){return dt(e+2)}function Xt(e,t){return ht(e+2,t)}function V(){return E()}function Kt(e){return dt(e)}function ki(e,t){return ht(e,t)}function Nt(){return t[tu]}function v(e){return t[tu]=e}function df(){return Oa(B[Y()],y())}function Oa(e,s){var r,b,f,h,p,d,u,g,y,k,v,a,o,m,n,i,t,c,l;return!Ut(e)&&s>=Mr(e)?H(e,0):(n=A(e),i=Q(e),c=Oh(e),l=Lu(e),b=Nr(e),f=Mr(e),r=f-i,g=2*(c-n),y=n+b-2*c,k=2*(l-i),v=i+f-2*l,a=2*r,2>a&&(a=2),o=Ot(16777216,a),m=Ql(o),d=g*o,h=y*m*2,d+=h>>1,u=k*o,p=v*m*2,u+=p>>1,H(e,r),t=z(e),t[T]=256*n,t[qt]=256*i,t[Yi]=d,t[ds]=u,t[ps]=h,t[Wn]=p,void((i=Q(e))!==s&&(xa(e,s),H(e,r-(s-i)))))}function vf(){return Pa(B[Y()],y())}function Pa(e,n){var r,t,s,l,a,c,i,o,u;if(!Ut(e)&&n>=xr(e))return H(e,0);if(r=Nn(e)-A(e),t=xr(e)-Q(e),r>=0?(o=1,i=r,s=0):(o=-1,i=0-r,s=1-t),0===t?(s=0,u=r,l=0):t>i?(u=0,l=i):(u=Ot(i,t)*o,l=Kh(i,t)),H(e,t),$c(e,o),mf(e,u),ea(e,s),_c(e,l),Cc(e,t),(c=Q(e))!==n){for(a=c;n-1>=a;a++)Gr(e,a);H(e,t-(n-c))}}function gf(){return bf(B[Y()],y())}function bf(e,u){var o,t,r,i,a,s,n,l,c;for(i=os(e),r=wt(i),o=Nr(e),s=Q(e),Oa(e,s),a=ft(e),t=0;5>=t;t++)et(e)[t]=z(e)[t];if(n=z(e)[Yi],0===n&&z(e)[ps],n=n>=0?1:-1,0>n?vl(e,i,r,o):yu(e,i,r,o),0===a&&(z(e)[T]=256*Po(e)),H(e,a+i),l=0,c=0-a-r,en(e,l),tn(e,c),l>=r&&0>c?lr(e):or(e),ya(e,i),s!==u){for(t=s;u-1>=t;t++)Ba(e,t);H(e,ft(e)-(u-s))}}function yf(){return Ff(B[Y()],y())}function Ff(e,n){var r,s,t,u,c,i,l,a,o;if(t=fr(e),s=wt(t),c=A(e),i=Q(e),Pa(e,i),u=ft(e),l=qr(e),G(e,c-s),H(e,u+t),l>0?sr(e,Ht(e)+t):(sr(e,t-Ht(e)),G(e,A(e)+Ht(e))),a=0,o=0-u-s,an(e,a),un(e,o),a>=s&&0>o?lr(e):or(e),i!==n){for(r=i;n-1>=r;r++)Qa(e,r);H(e,ft(e)-(n-i))}}function Sf(){return xa(b[w()],y())}function zr(e,a){var i,t,r,s,n;for(r=e[T],s=e[qt],i=e[Yi],t=e[ds],n=256*a;n>s&&t>=0;)r+=i+32768>>16,s+=t+32768>>16,i+=e[ps],t+=e[Wn];return e[T]=r,e[qt]=s,e[Yi]=i,e[ds]=t,r>>8}function xa(e,i){var t;t=zr(z(e),i),G(e,t)}function Af(){return Gr(b[w()],y())}function Gr(e){var t,i;i=A(e)+Ht(e),t=Lc(e)+jc(e),t>0&&(i+=qr(e),t-=wc(e)),ea(e,t),G(e,i)}function Cf(){Ba(b[w()],y())}function Ba(e,n){var i,r,s,t;r=os(e),i=wt(r),s=Bh(e)+1,t=Th(e)+1,en(e,s),tn(e,t),s>=i&&lr(e),t>=0&&or(e),0>t+i?zr(z(e),n):z(e)[T]=256*Po(e),zr(et(e),n),ya(e,r) }function jf(){return Qa(b[w()],y())}function Qa(e,o){var n,r,s,a,t,i;t=nn(e)+1,i=on(e)+1,an(e,t),un(e,i),s=fr(e),r=wt(s),t>=r&&lr(e),i>=0&&or(e),n=A(e),Gr(e,o),a=A(e),(s>=t||i+r>=0)&&xh(e,n,a)}function It(e){di(e),r=!0}function Ur(){return t[iu]}function di(e){return t[iu]=e}function er(i,t){return p(t)t&&(t=0-t),t>255?(h(js,1),Fa(e)):(a=$t(e),n=Tt(e),i=n-a,0>i&&(i=0-i),i>32*t?(h(qs,1),Fa(e)):e))}function Yr(e){var t,i,s;return s=Ef(e),s!==e?(t=Yr(e),r?0:(i=Yr(s),r?0:t>=i?t:i)):e}function zf(i,s){var r,e,t;return r=e=t=Uf(i),s&&(e=Oo(i)),e>t&&(t=e),i!==r&&s&&(e=Oo(r)),e>t&&(t=e),t}function Oo(e){var t,r,s,a,i,o,n;return o=$t(e),n=Vi(e),a=Tt(e),r=n-o,s=a-n,r*s>=0?e:(h(Sr,1),t=s-r,i=r,0>i&&(i=0-i),0>t&&(t=0-t),Sa(e,i/t))}function Uf(e){var t,r,s,a,i,o,n;return o=Ct(e),n=Pi(e),a=jt(e),r=n-o,s=a-n,r*s>=0?e:(h(Sr,1),t=s-r,i=r,0>i&&(i=0-i),0>t&&(t=0-t),Sa(e,i/t))}function Io(e,t,i){var r;0===V()?An()&&(is(e),Qr(t),es(i)):(r=oa(e,t),r||ra(e,t,i))}function Hf(t){var i,e;return X(2*N())?(i=Jr(t)<<1,e=wu(t),0!==e&&Io(e,i,999999999),e=mu(t),0!==e&&Io(e,i,999999999),void Xi(A(t))):null}function Xf(e){var s,t,i,a,r,n;switch(n=kh(e),Mi=e,n){case 0:case 1:pi();break;case 2:Bc();break;case 3:qc()}switch(a=Dt,n){case 0:case 1:pi();break;case 2:Mc();break;case 3:xc()}return t=Dt,0===t?null:X(N())?(s=(Jr(e)<<1)+1,r=A(e)+a,i=Tn(t,s),-1===i?ra(t,s,r):dr(i)>>8&255,s=n>>>16&255,e=n>>>24&255,gr()&&(t=$i(),a=(e*t[6]+t[7])/e,s=(s*t[0]+t[1])*a|0,r=(r*t[2]+t[3])*a|0,i=(i*t[4]+t[5])*a|0,e=e*a|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),e=Math.max(e,0),e=Math.min(e,255)),1>e?0:(255>e&&wo()&&It(Nc),i+(r<<8)+(s<<16)+(e<<24))):n}function Pt(e){_f()?hh(e,e):(e[0]=(e[0]+ms())*P(),e[1]=(e[1]+hs())*P())}function hh(e,t){ph(0|e[0],0|e[1],t)}function ph(t,i,r){var e,s,n;e=ss(),s=(e[0]*t+e[1]*i+e[2])*P()|0,n=(e[3]*t+e[4]*i+e[5])*P()|0,r[0]=s,r[1]=n}function at(e){e>0&&Pt(i()),e>1&&Pt(l()),e>2&&Pt(F()),e>3&&Pt(Ci())}function ci(s){var e,t,r,n;return 0===s?0:(i()[0]=0,i()[1]=0,l()[0]=256*s,l()[1]=0,F()[0]=0,F()[1]=256*s,at(3),e=l()[0]-i()[0],t=l()[1]-i()[1],r=(0|Math.sqrt(e*e+t*t))+128>>8,e=F()[0]-i()[0],t=F()[1]-i()[1],n=(0|Math.sqrt(e*e+t*t))+128>>8,r>n&&(r=n),0===r?1:r)}function ou(n){var e,i,r,s,t;return gr()?(i=255&n,r=n>>>8&255,s=n>>>16&255,e=n>>>24&255,t=$i(),s=s*t[0]+t[1]|0,r=r*t[2]+t[3]|0,i=i*t[4]+t[5]|0,e=e*t[6]+t[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),e=Math.max(e,0),e=Math.min(e,255),16>e?0:i+(r<<8)+(s<<16)+(e<<24)):n}function Qt(){return t[Es]}function gh(e){return t[Es]=e}function vt(){hr(Qt())}function Fh(e){hr($()+e)}function lu(e){return Sc(e)?(hr($()-e),!0):!1}function E(){return Qt()-$()}function dt(e){return t[$()+e]}function ht(e,i){return t[$()+e]=i}function $(){return t[Ms]}function hr(e){return t[Ms]=e}function Bh(e){return n(e,En)}function en(e,t){return a(e,En,t)}function Th(e){return n(e,Kn)}function tn(e,t){return a(e,Kn,t)}function os(e){return n(e,zn)}function ku(e,t){return a(e,zn,t)}function gu(e){return n(e,Gn)}function bu(e,t){return a(e,Gn,t)}function et(e){return x(Z,e+Al)}function Fu(e){return n(e,Jn)}function us(e,t){return a(e,Jn,t)}function nn(e){return n(e,Ha)}function an(e,t){return a(e,Ha,t)}function on(e){return n(e,Xa)}function un(e,t){return a(e,Xa,t)}function fr(e){return n(e,Ya)}function Cu(e,t){return a(e,Ya,t)}function Vu(e){return n(e,Za)}function ju(e,t){return a(e,Za,t)}function ln(e){return n(e,$a)}function sr(e,t){return a(e,$a,t)}function fn(e){t=e.wordsAsInt32Array()}var Bu=1,_u=11,hn=12,pn=2,dn=3,si=1,mn=0,cs=6,Eu=0,kn=4,gn=1,bn=2,yn=3,Or=6,Sn=0,On=2,In=1,Zu=3,Gt=16,Pn=12,wn=11,Cn=14,Vn=13,jn=10,sl=18,xn=15,qn=14,Mn=15,Bn=21,ll=18,_n=16,ps=4,Wn=5,Yi=2,ds=3,ml=10,T=0,qt=1,Ln=12,Rn=13,En=18,Kn=19,zn=20,Gn=16,Ir=28,Al=22,Jn=17,Hi=10,Xn=4,vs=65536,jl=100,Fi=121,Qn=122,$n=114,gs=112,ta=101,ia=102,_=104,sa=103,Tl=120,ut=119,na=113,aa=123,Kl=115,zl=108,Gl=105,Ul=106,Jl=110,Hl=107,Xl=109,kt=111,Zl=118,it=117,ys=116,ua=8,la=9,ca=7,fa=2,ha=1,Fs=0,da=6,oc=1024,Ss=2,va=255,ka=256,ga=65280,ba=4,pc=512,dc=768,mc=65535,vc=1,kc=7,gc=5,rr=254,lt=1,Zt=5,Yt=8,Bt=3,C=0,Mt=6,ti=7,ii=2,ri=4,Ca=4,Va=5,ja=6,Ps=6,qa=2,ws=5,Cs=4,Nc=3,Wc=1,_a=6,Na=7,Wa=8,Da=9,Ta=4,La=5,Ra=10,Gc=12,Uc=12,At=16,Ka=14,za=15,Ga=13,Ua=15,Ja=14,Ha=18,Xa=19,Ya=20,Za=16,ni=21,$a=17,eo=10,to=12,uf=11,io=51,ro=50,ff=53,so=48,no=52,ao=49,oo=13,uo=14,js=109,co=111,Sr=108,qs=110,Ms=10,mo=69,vo=43,ko=45,go=42,bo=44,wf=24,Bs=97,_s=107,ai=103,Ws=93,Ds=91,Ts=101,oi=105,ui=99,li=95,Co=88,Vo=113,jo=46,xo=47,Rf=18,qo=37,Mo=39,Bo=36,_o=38,No=11,Wo=12,Do=17,To=16,fi=128,Lo=65,Ro=66,Eo=67,Ko=68,zo=0,Go=1097753705,Uo=256,Jo=63,Ho=8,Xo=9,oh=80,uh=82,lh=84,ch=86,Es=1,Zo=34,Qo=35,$o=33,eu=32,tu=2,iu=64,Ks=96,zs=106,mi=102,Gs=92,Us=90,Js=100,vi=104,gi=98,Ei=94,f=3,c=5,b=null,Si="BitBltPlugin",ji=null,Dt=0,Mi=0,d=0,o=0,r=0,Wi=0,m=0,B=null,e=null,Ti=null,Eh="B2DPlugin 14 November 2014 (e)",Z=null,O=0,u=null,t=null;Squeak.registerExternalModule("B2DPlugin",{primitiveMergeFillFrom:_l,primitiveCopyBuffer:bl,primitiveAddRect:kl,primitiveAddGradientFill:cl,primitiveSetClipRect:nc,initialiseModule:kr,primitiveSetBitBltPlugin:sc,primitiveRegisterExternalEdge:$l,primitiveGetClipRect:Pl,primitiveAddBezier:nl,primitiveInitializeProcessing:Bl,primitiveRenderImage:tc,primitiveGetOffset:xl,primitiveSetDepth:uc,primitiveAddBezierShape:al,primitiveSetEdgeTransform:lc,getModuleName:Mu,primitiveGetTimes:ql,primitiveNextActiveEdgeEntry:Dl,primitiveAddBitmapFill:ol,primitiveGetDepth:Cl,primitiveAbortProcessing:il,primitiveNextGlobalEdgeEntry:El,primitiveGetFailureReason:Vl,primitiveDisplaySpanBuffer:yl,moduleUnloaded:Su,primitiveGetCounts:wl,primitiveChangedActiveEdgeEntry:gl,primitiveRenderScanline:ic,primitiveGetBezierStats:Il,primitiveFinishedProcessing:Sl,setInterpreter:Dc,primitiveNeedsFlush:Nl,primitiveAddLine:fl,primitiveSetOffset:cc,primitiveNextFillEntry:Rl,primitiveInitializeBuffer:Ml,primitiveDoProfileStats:Fl,primitiveAddActiveEdgeEntry:rl,primitiveSetAALevel:rc,primitiveNeedsFlushPut:Wl,primitiveAddCompressedShape:ul,primitiveSetColorTransform:ac,primitiveAddOval:hl,primitiveRegisterExternalFill:ec,primitiveAddPolygon:dl,primitiveGetAALevel:Ol})}),module("users.bert.SqueakJS.plugins.BitBltPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function Ni(t){return"number"==typeof t?e.classSmallInteger():t.sqClass}function E(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function Xt(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function v(e,t){return 0|Math.floor(e/t)}function ws(e,t){return e-v(e,t)*t|0}function i(t,e){return e>31?0:t<31?0:t>>>e}function z(t,e){return 0>e?-31>e?0:t>>>0-e:e>31?0:t<t){for(e=r^i,s=j[t];0!==e;)0!==(e&s)&&++$,e=u(e,t);return i}return 16===t?(e=ht(r,i,5,3),$=$+(31&e)+(e>>>5&31)+(e>>>10&31),e=ht(r>>>16,i>>>16,5,3),$=$+(31&e)+(e>>>5&31)+(e>>>10&31)):(e=ht(r,i,8,3),$=$+(255&e)+(e>>>8&255)+(e>>>16&255)),i}function As(a,i){var n,e,s,r;if((C&(Y|ct))!==(Y|ct))return i;if(16>t){for(n=j[t]&ut,r=i,s=1;c>=s;s++)e=r&n,Lt(e,Mt(e)+1),r=u(r,t);return i}return 16===t?(e=mt(65535&i,5,R),Lt(e,Mt(e)+1),e=mt(i>>>16,5,R),Lt(e,Mt(e)+1)):(e=mt(i,8,R),Lt(e,Mt(e)+1)),i}function Is(e,t){return e+t}function Os(r,s){var n,t,i,a,e;return e=r>>>24,0===e?s:255===e?r:(n=255-e,t=(16711935&r)*e+(16711935&s)*n+16711935,i=(16711935&(r>>>8|16711680))*e+(s>>>8&16711935)*n+16711935,t=t+(t-65537>>>8&16711935)>>>8&16711935,i=i+(i-65537>>>8&16711935)>>>8&16711935,a=t|i<<8)}function Ss(e,t){return _i(e,t,!1)}function _i(l,a,A){var b,e,y,s,f,n,p,F,k,g,S,o,r,O,I,m,h;if(16>t)return a;if(g=255-bt,n=a,1===c)A&&0===l||(o=(16711935&l)*bt+(16711935&a)*g+16711935,r=(l>>>8&16711935)*bt+(a>>>8&16711935)*g+16711935,o=o+(o-65537>>>8&16711935)>>>8&16711935,r=r+(r-65537>>>8&16711935)>>>8&16711935,n=o|r<<8);else for(e=j[t],O=5,b=31,h=d,m=a,f=l,s=1;c>=s;s++){if(F=f&e,!(0===(h&e)||A&&0===F)){for(S=m&e,y=0,k=1;3>=k;k++)p=(k-1)*O,I=v((u(F,p)&b)*bt+(u(S,p)&b)*g+254,255)&b,y|=i(I,p);n=n&~i(e,16*(s-1))|i(y,16*(s-1))}h=u(h,t),f=u(f,t),m=u(m,t)}return n}function xt(i,s){var r,e,t;return r=255-(i>>>24),e=((16711935&s)*r>>>8&16711935)+(16711935&i),t=((s>>>8&16711935)*r>>>8&16711935)+(i>>>8&16711935),e=16711935&e|255*(16777472&e)>>>8,t=(16711935&t)<<8|255*(16777472&t),t|e}function Fs(e,t){return 0===e?t:_i(e,t,!0)}function ys(){var I,k,t,e,b,O,c,v,l,S,y,n,d,g;for(S=h+1,y=m,d=a,t=16*(1&r),q&&(t=16-t),F=i(65535,16-t);0!==--S;){for(b=y*P+4*p,c=d*M+4*(r>>1),I=4*(3&d),g=(3&p)-1,O=o+1,l=F,t=65535===l?16:0;0!==--O;)k=Vi[I+(g=g+1&3)],e=f[b>>>2],v=e>>>24,255===v?(e=di(e,k),e=0===e?i(1,t):i(e,t),Ut(c,e,l)):0!==v&&(n=s[c>>>2],n&=~l,n=u(n,t),n=(31744&n)<<9|(992&n)<<6|((31&n)<<3|4278190080),e=xt(e,n),e=di(e,k),e=0===e?i(1,t):i(e,t),Ut(c,e,l)),b+=4,q?0===t&&(c+=4):0!==t&&(c+=4),t=16^t,l=~l;++y,++d}}function bs(){var i,t,n,e,l,v,c,u,d;for(v=h+1,c=m,d=a;0!==--v;){for(t=c*P+4*p,e=d*M+4*r,n=o+1;0!==--n;)if(i=f[t>>>2],l=i>>>24,255===l){for(s[e>>>2]=i,t+=4,e+=4;0!==--n&&(i=f[t>>>2])>>>24===255;)s[e>>>2]=i,t+=4,e+=4;++n}else if(0===l){for(t+=4,e+=4;0!==--n&&(i=f[t>>>2])>>>24===0;)t+=4,e+=4;++n}else u=s[e>>>2],u=xt(i,u),s[e>>>2]=u,t+=4,e+=4;++c,++d}}function gs(){var e,n,b,O,S,d,t,I,g,l,y,k,c,v;for(S=Ii(),I=C&~St,y=h+1,k=m,v=a,F=8*(3&r),q&&(F=24-F),L=w^i(255,F),t=0===(1&r)?0:522133279,0===(1&a)&&(t=522133279^t);0!==--y;){for(t=522133279^t,b=k*P+4*p,d=v*M+4*(r>>2),O=o+1,e=F,l=L;0!==--O;)n=(f[b>>>2]&~t)+t,g=n>>>24,g>31&&(224>g&&(c=s[d>>>2],c&=~l,c=u(c,e),c=S[c],n=xt(n,c)),n=Dt(n,I),n=i(n,e),Ut(d,n,l)),b+=4,q?0===e?(d+=4,e=24,l=16777215):(e-=8,l=l>>>8|4278190080):24===e?(d+=4,e=0,l=4294967040):(e+=8,l=l<<8|255),t=522133279^t;++k,++v}}function ks(e,t){return e&t}function vs(e,t){return e&~t}function ms(e,t){return~e&t}function ds(e,t){return~e&~t}function ps(t,e){return~e}function hs(e,t){return~e|t}function fs(e,t){return~e|~t}function cs(e){return~e}function ls(e,t){return~e^t}function us(e,t){return e|t}function os(e,t){return e|~t}function as(e,t){return e^t}function ns(){var e;T===K&&a>=m&&(a>m?(dt=-1,m=m+h-1,a=a+h-1):a===m&&r>p&&(J=-1,p=p+o-1,r=r+o-1,B>1&&(e=F,F=L,L=e)),l=a*M+4*v(r,c),Pt=M*dt-4*B*J)}function ss(){return 0}function vi(){return _>=N?(p=Ft,r=_,o=Z):(p=Ft+(N-_),o=Z-(N-_),r=N),r+o>N+Vt&&(o-=r+o-(N+Vt)),D>=x?(m=Yt,a=D,h=Ot):(m=Yt+x-D,h=Ot-(x-D),a=x),a+h>x+jt&&(h-=a+h-(x+jt)),W?null:(0>p&&(r-=p,o+=p,p=0),p+o>it&&(o-=p+o-it),0>m&&(a-=m,h+=m,m=0),void(m+h>rt&&(h-=m+h-rt)))}function qt(){return vi(),0>=o||0>=h?(y=A=S=O=0,null):Di()?(is(),void Ai()):e.primitiveFail()}function rs(e,t,i){_=e,D=i,Ft=e,Z=t-e,qt(),gt()}function is(){var t;if(ts(),e.failed())return e.primitiveFail();if(t=nr())return null;if(30===k||31===k){if(1!==e.methodArgumentCount())return e.primitiveFail();if(bt=e.stackIntegerValue(0),!(!e.failed()&&bt>=0&&255>=bt))return e.primitiveFail()}$=0,Nr(),(22===k||32===k)&&(y=A=S=O=0),J>0?(y=r,A=r+o):(y=r-o+1,A=r+1),dt>0?(S=a,O=a+h):(S=a-h+1,O=a+1)}function ts(){var t,i;if(41===k)if(yi=255,$t=16777215,pt=null,U=null,e.methodArgumentCount()>=2){if(yi=e.stackIntegerValue(e.methodArgumentCount()-2),e.failed())return e.primitiveFail();if($t=e.stackIntegerValue(e.methodArgumentCount()-1),e.failed())return e.primitiveFail();4===e.methodArgumentCount()&&(i=e.stackObjectValue(1),e.isBytes(i)&&(pt=i.bytes),t=e.stackObjectValue(0),e.isBytes(t)&&(U=t.bytes))}else{if(1!==e.methodArgumentCount())return e.primitiveFail();if($t=e.stackIntegerValue(0),e.failed())return e.primitiveFail()}}function es(){var b,g,p,m,v,S,e,c,r,o,O,A,t,y;for(S=n[k+1],e=4*J,-32===V?V=v=p=0:0>V?(v=V+32,p=i(w,0-V)):0===V?(v=0,p=w):(v=V-32,p=u(w,V)),y=~p,At?(m=w,Bt=0):m=Gt(0),O=a,A=1;h>=A;A++){if(Bt>1&&(m=Gt(O),O+=dt),Kt?(o=f[I>>>2],I+=e):o=0,d=F,t=f[I>>>2],I+=e,g=z(o&y,v)|z(t&p,V),o=t,c=s[l>>>2],b=S(g&m,c),c=d&b|c&~d,s[l>>>2]=c,l+=e,d=w,3===k)if(0===V&&m===w)if(-1===J)for(r=2;B-1>=r;r++)t=f[I>>>2],I+=e,s[l>>>2]=t,l+=e;else for(r=2;B-1>=r;r++)s[l>>>2]=o,l+=e,o=f[I>>>2],I+=e;else for(r=2;B-1>=r;r++)t=f[I>>>2],I+=e,g=z(o&y,v)|z(t&p,V),o=t,s[l>>>2]=g&m,l+=e;else for(r=2;B-1>=r;r++)t=f[I>>>2],I+=e,g=z(o&y,v)|z(t&p,V),o=t,b=S(g&m,s[l>>>2]),s[l>>>2]=b,l+=e;B>1&&(d=L,t=f[I>>>2],I+=e,g=z(o&y,v)|z(t&p,V),c=s[l>>>2],b=S(g&m,c),c=d&b|c&~d,s[l>>>2]=c,l+=e),I+=Jt,l+=Pt}}function $r(){var t,r,o,e,i,u;for(o=n[k+1],u=1;h>=u;u++){if(r=At?w:Gt(a+u-1),d=F,e=s[l>>>2],t=o(r,e),e=d&t|e&~d,s[l>>>2]=e,l+=4,d=w,3===k)for(e=r,i=2;B-1>=i;i++)s[l>>>2]=e,l+=4;else for(i=2;B-1>=i;i++)e=s[l>>>2],t=o(r,e),s[l>>>2]=t,l+=4;B>1&&(d=L,e=s[l>>>2],t=o(r,e),e=d&t|e&~d,s[l>>>2]=e,l+=4),l+=Pt}}function Oi(){var K,y,W,E,T,x,M,e,b,V,i,S,_,O,D,A,f,R,u,N;for(V=n[k+1],et=v(32,g),E=j[g],D=j[t],K=C&~St,I=m*P+4*v(p,et),N=et-(p&et-1),T=N>o?0:v(o-N,et)+1,Jt=P-4*T,b=c-(r&c-1),R=(r+o-1&c-1)+1,b>o&&(b=o),f=(p&et-1)*g,i=(r&c-1)*t,y=g,A=t,W=0,tt&&(f=32-g-f,y=0-y),q&&(i=32-t-i,A=0-A,W=32-t),S=1;h>=S;S++){_=At?w:Gt(a+S-1),Wt=f,G=i,d=F,u=b,M=B;do x=_r(u,K,E,D,y,A),G=W,d===w?(O=V(x&_,s[l>>>2]),s[l>>>2]=d&O):(e=s[l>>>2],O=V(x&_,e&d),e=d&O|e&~d,s[l>>>2]=e),l+=4,2===M?(d=L,u=R):(d=w,u=c);while(0!==--M);I+=Jt,l+=Pt}}function Ii(){var e=[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];return e}function wt(e,t,i){return t>e?v(t-e+qi,i+1)+1:t===e?0:0-(v(e-t+qi,i+1)+1)}function ni(){var n,e,s;s=c-1,e=c-(r&s),F=q?u(w,32-e*t):i(w,32-e*t),n=(r+o-1&s)+1,L=q?i(w,32-n*t):u(w,32-n*t),e>o?(F&=L,L=0,B=1):B=v(o-e+s,c)+1,J=dt=1,l=a*M+4*v(r,c),Pt=M*dt-4*B*J}function Qt(t,e){return e}function di(t,i){var e;return e=i<<8,(Zt[e+(t>>>16&255)]<<10)+(Zt[e+(t>>>8&255)]<<5)+Zt[e+(255&t)]}function Qr(l,c){var u,i,f,a,t,r,o,n,s,h;if(f=l>0?1:0===l?0:-1,h=c>0?1:0===c?0:-1,a=Math.abs(c),o=Math.abs(l),r=i=9999,t=s=-9999,o>a){for(u=o>>1,n=1;o>=n;n++)if(_+=f,(u-=a)<0&&(D+=h,u+=o),o>n){if(qt(),e.failed())return null;A>y&&O>S&&(r=Math.min(r,y),t=Math.max(t,A),i=Math.min(i,S),s=Math.max(s,O),(t-r)*(s-i)>4e3&&(y=r,A=t,S=i,O=s,gt(),r=i=9999,t=s=-9999))}}else for(u=a>>1,n=1;a>=n;n++)if(D+=h,(u-=o)<0&&(_+=f,u+=a),a>n){if(qt(),e.failed())return null;A>y&&O>S&&(r=Math.min(r,y),t=Math.max(t,A),i=Math.min(i,S),s=Math.max(s,O),(t-r)*(s-i)>4e3&&(y=r,A=t,S=i,O=s,gt(),r=i=9999,t=s=-9999))}y=r,A=t,S=i,O=s,e.storeIntegerofObjectwithValue(pi,b,_),e.storeIntegerofObjectwithValue(Ci,b,D)}function Ut(t,i,r){var e;e=s[t>>>2],e&=r,e|=i,s[t>>>2]=e}function Zr(r,s){var e,i,t,n;return e=255&r,i=ai[7&e],t=li[e>>>3],n=i>s?t+1:t,e=r>>>8&255,i=ai[7&e],t=li[e>>>3],n|=i>s?t+1<<5:t<<5,e=r>>>16&255,i=ai[7&e],t=li[e>>>3],n|=i>s?t+1<<10:t<<10}function H(r,s){var t,i;return i=e.fetchPointerofObject(r,s),"number"==typeof i?i:(t=e.floatValueOf(i),t>=-2147483648&&2147483647>=t?0|t:(e.primitiveFail(),0))}function Q(r,s,n){var i,t;return t=e.fetchPointerofObject(r,s),"number"==typeof t?t:t.isNil?n:(i=e.floatValueOf(t),i>=-2147483648&&2147483647>=i?0|i:(e.primitiveFail(),0))}function Xr(i,e){return 32!==t?e:0===e?0:0!==(4278190080&e)?e:e|4278190080&i}function Hr(){return Yr}function Gt(e){return oi[ws(e,Bt)]}function xi(e){return e.isNil?!0:0===k?!0:5===k?!0:10===k?!0:15===k?!0:!1}function Jr(){n[1]=ss,n[2]=ks,n[3]=vs,n[4]=ur,n[5]=ms,n[6]=Qt,n[7]=as,n[8]=us,n[9]=ds,n[10]=ls,n[11]=ps,n[12]=os,n[13]=cs,n[14]=hs,n[15]=fs,n[16]=Qt,n[17]=Qt,n[18]=Qt,n[19]=Is,n[20]=or,n[21]=Or,n[22]=fr,n[23]=Ps,n[24]=As,n[25]=Os,n[26]=qr,n[27]=Mr,n[28]=mr,n[29]=dr,n[30]=pr,n[31]=Ss,n[32]=Fs,n[33]=gr,n[34]=ar,n[35]=xt,n[36]=xt,n[37]=xt,n[38]=hr,n[39]=xr,n[40]=Ti,n[41]=Xr,n[42]=br}function Ur(){var e,t,i;for(t=0;255>=t;t++)for(e=0;15>=e;e++)i=Zr(t,e),Zt[(e<<8)+t]=i}function Gr(){return Jr(),Ur(),!0}function zr(e,t){return e&&t?0===e[Et]&&0===e[Tt]&&0===e[_t]&&0===e[ei]&&16711680===t[Et]&&65280===t[Tt]&&255===t[_t]&&4278190080===t[ei]?!0:!1:!0}function Kr(){var i;if(s=e.fetchPointerofObject(st,K),ft=e.fetchIntegerofObject(hi,K),vt=e.fetchIntegerofObject(ti,K),!(ft>=0&&vt>=0))return!1;if(t=e.fetchIntegerofObject(mi,K),q=t>0,0>t&&(t=0-t),"number"==typeof s){if(!Ar(s))return!1;c=v(32,t),s=M=0}else{if(c=v(32,t),M=4*v(ft+(c-1),c),i=Xt(s),!e.isWordsOrBytes(s)||i!==M*vt)return!1;s=s.wordsOrBytes()}return!0}function Ht(e){return wi(e,!1)}function wi(i,r){var t;if(b=i,Fi=r,k=e.fetchIntegerofObject(Ki,b),e.failed()||0>k||k>Hi-2)return!1;if(k>=16&&17>=k)return!1;if(T=e.fetchPointerofObject(Ei,b),W=xi(T),lt=e.fetchPointerofObject(Gi,b),At=xi(lt),K=e.fetchPointerofObject(Ui,i),!(e.isPointers(K)&&E(K)>=4))return!1;if(t=Kr(),!t)return!1;if(_=Q(pi,b,0),D=Q(Ci,b,0),Z=Q(Li,b,ft),Ot=Q(zi,b,vt),e.failed())return!1;if(W)Ft=Yt=0;else{if(!(e.isPointers(T)&&E(T)>=4))return!1;if(t=Er(),!t)return!1;if(t=Rr(),!t)return!1;0===(C&St)&&ji(),Ft=Q(Ri,b,0),Yt=Q(Br,b,0)}return(t=Lr())?(N=Q(Yi,b,0),x=Q(Xi,b,0),Vt=Q(Zi,b,ft),jt=Q(Qi,b,vt),e.failed()?!1:(0>N&&(Vt+=N,N=0),0>x&&(jt+=x,x=0),N+Vt>ft&&(Vt=ft-N),x+jt>vt&&(jt=vt-x),!0)):!1}function Er(){var t;if(f=e.fetchPointerofObject(st,T),it=H(hi,T),rt=H(ti,T),!(it>=0&&rt>=0))return!1;if(g=e.fetchIntegerofObject(mi,T),tt=g>0,0>g&&(g=0-g),"number"==typeof f){if(!Ir(f))return!1;et=v(32,g),f=P=0}else{if(et=v(32,g),P=4*v(it+(et-1),et),t=Xt(f),!e.isWordsOrBytes(f)||t!==P*rt)return!1;f=f.wordsOrBytes()}return!0}function Rr(){var r,t,i,s;if(C=ut=R=0,nt=null,ot=null,X=null,t=e.fetchPointerofObject(Ji,b),t.isNil)return!0;if(C=Y,s=!1,e.isWords(t))i=E(t),X=t.words,s=!0;else{if(!(e.isPointers(t)&&E(t)>=3))return!1;if(nt=Bi(e.fetchPointerofObject(0,t)),ot=Bi(e.fetchPointerofObject(1,t)),r=e.fetchPointerofObject(2,t),r.isNil)i=0;else{if(!e.isWords(r))return!1;i=E(r),X=r.words}C|=St}return 0!==(i&i-1)?!1:(ut=i-1,R=0,512===i&&(R=3),4096===i&&(R=4),32768===i&&(R=5),0===i?(X=null,ut=0):C|=ct,s&&ji(),zr(nt,ot)?(ot=null,nt=null):C|=Si,!0)}function Bi(t){return t.isNil?null:"number"==typeof t?(e.primitiveFail(),null):e.isWords(t)&&4===E(t)?t.words:(e.primitiveFail(),null)}function Lr(){var t;if(At)return oi=null,!0;if(e.isPointers(lt)&&E(lt)>=4)t=e.fetchPointerofObject(st,lt),Bt=e.fetchIntegerofObject(ti,lt),e.isWords(t)||(At=!0);else{if(e.isPointers(lt)||!e.isWords(lt))return!1;t=lt,Bt=E(t)}return oi=t.wordsOrBytes(),!0}function Rt(){return yt=e.ioLoadFunctionFrom("ioGetSurfaceFormat","SurfacePlugin"),It=e.ioLoadFunctionFrom("ioLockSurface","SurfacePlugin"),Nt=e.ioLoadFunctionFrom("ioUnlockSurface","SurfacePlugin"),!!yt&&!!It&&!!Nt}function Tr(e){return wi(e,!0)}function Di(){var n,t,u,i,c,d,l;if(Ct=!1,0===s){if(!It&&!Rt())return null;if(i=It,n=e.fetchIntegerofObject(st,K),0===f&&!W&&(t=e.fetchIntegerofObject(st,T),t===n))return Fi?(l=Math.min(p,r),c=Math.max(p,r)+o,u=Math.min(m,a),d=Math.max(m,a)+h,f=i(t,function(e){P=e},l,u,c-l,d-u)):f=i(t,function(e){P=e},0,0,it,rt),s=f,M=P,Ct=!0,0!==s;s=i(n,function(e){M=e},r,a,o,h),Ct=!0}if(0===f&&!W){if(t=e.fetchIntegerofObject(st,T),!It&&!Rt())return null;i=It,f=Fi?i(t,function(e){P=e},0,0,it,rt):i(t,function(e){P=e},p,m,o,h),Ct=!0}return 0!==s&&(0!==f||W)}function Dt(i,t){var e;return e=i,0!==(t&Y)&&(0!==(t&Si)&&(e=vr(i,t),0===e&&0!==i&&(e=1)),0!==(t&ct)&&(e=X[e&ut])),e}function Dr(e){0===strcmp(e,"SurfacePlugin")&&(yt=It=Nt=0)}function Pi(n,a,s,o){var t,r,e;for(e=j[s],t=0,r=1;o>=r;r++)(n&e)===e&&(t|=a&e),e=i(e,s);return t}function gi(r,s,o,l,n){var e,a,i,t;return t=r&n,e=s&n,i=(r^t)+(s^e),a=t&e|(t|e)&i,i^t^e|u(a,o-1)*l}function ri(n,a,s,o){var t,r,e;for(e=j[s],t=0,r=1;o>=r;r++)t|=Math.max(a&e,n&e),e=i(e,s);return t}function kt(n,a,s,o){var t,r,e;for(e=j[s],t=0,r=1;o>=r;r++)t|=Math.min(a&e,n&e),e=i(e,s);return t}function si(a,o,e,l){var n,r,s,t;return t=j[e],n=i(t,e),r=u(((a&t)+1)*((o&t)+1)-1&n,e),1===l?r:(s=((u(a,e)&t)+1)*((u(o,e)&t)+1)-1&n,r|=s,2===l?r:(s=((u(a,2*e)&t)+1)*((u(o,2*e)&t)+1)-1&n,r|=i(s,e),3===l?r:(s=((u(a,3*e)&t)+1)*((u(o,3*e)&t)+1)-1&n,r|=i(s,2*e))))}function Wr(l,c,e,f){var t,o,r,s,a,n;for(n=j[e],o=0,s=1;f>=s;s++)r=u(l&n,(s-1)*e),t=u(c&n,(s-1)*e),32!==e&&(16===e?(r=4278190080|ui(r),t=4278190080|ui(t)):(r=4278190080|mt(r,e,32),t=4278190080|mt(t,e,32))),a=ii(r,t),32!==e&&(a=mt(a,32,e)),o|=i(a,(s-1)*e),n=i(n,e);return o}function ht(o,u,a,l){var t,s,r,n,e;for(e=j[a],s=0,n=1;l>=n;n++)r=o&e,t=u&e,s|=t>r?t-r:r-t,e=i(e,a);return s}function Nr(){ni(),W?$r():(ns(),g!==t||0!==C||tt!==q?Oi():(lr(),es()))}function _r(m,l,d,p,h,c){var s,e,r,t,n,o,a;if(r=f[I>>>2],a=0,e=Wt,t=G,o=m,l===(Y|ct)){do s=u(r,e)&d,n=X[s&ut],a|=i(n&p,t),t+=c,0!==(4294967264&(e+=h))&&(tt?e+=32:e-=32,r=f[(I+=4)>>>2]);while(0!==--o)}else do s=u(r,e)&d,n=Dt(s,l),a|=i(n&p,t),t+=c,0!==(4294967264&(e+=h))&&(tt?e+=32:e-=32,r=f[(I+=4)>>>2]);while(0!==--o);return Wt=e,a}function fi(t,i){var a,r,s,e,n;return 0>t||0>i||(e=t>>>14)>=it||(n=i>>>14)>=rt?0:(s=n*P+4*u(e,bi),r=f[s>>>2],Wt=Mi[e&ki],a=u(r,Wt)&Wi)}function Ti(u,s){var r,n,a,o,e;if(32===t)return u===s?0:s;for(n=t,e=j[n],a=0,o=1;c>=o;o++)r=s&e,(u&e)===r&&(r=0),a|=r,e=i(e,n);return a}function Mr(e,i){return Pi(~e,i,t,c)}function qr(e,i){return 0===e?i:e|Pi(~e,i,t,c)}function xr(l,s){var n,e,r,a,o;if(1===c)return s;if(n=0,r=i(1,t)-1,a=i(r,(c-1)*t),e=32-t,n|=i(s&r,e)|u(s&a,e),2>=c)return n;for(o=2;c>>1>=o;o++)r=i(r,t),a=u(a,t),e-=2*t,n|=i(s&r,e)|u(s&a,e);return n}function jr(){var t;return t=e.stackValue(e.methodArgumentCount()),Ht(t)?(qt(),e.failed()?null:(gt(),e.failed()?null:(e.pop(e.methodArgumentCount()),22===k||32===k?(e.pop(1),e.pushInteger($)):void 0))):e.primitiveFail()}function Vr(){var c,F,u,d,n,v,b,i,l,I,P,m,w,p;if(6!==e.methodArgumentCount())return e.primitiveFail();if(P=e.stackIntegerValue(0),n=e.stackObjectValue(1),l=e.stackObjectValue(2),Ni(n)!==e.classArray()||Ni(l)!==e.classArray())return e.primitiveFail();if(256!==E(l))return e.primitiveFail();if(e.failed())return null;if(v=E(n)-2,u=e.stackIntegerValue(3),m=e.stackIntegerValue(4),p=e.stackObjectValue(5),!e.isBytes(p))return e.primitiveFail();if(!(m>0&&u>0&&u<=Xt(p)))return e.primitiveFail();if(d=e.stackObjectValue(6),!Ht(d))return e.primitiveFail();if(30===k||31===k)return e.primitiveFail();for(b=0!==s&&0!==f&&W===!1&&T!==K&&(0!==C||tt!==q||g!==t),I=_,F=p.bytes,c=m;u>=c;c++){if(w=F[c-1],i=e.fetchIntegerofObject(w,l),0>i||i>v)return e.primitiveFail();if(Ft=e.fetchIntegerofObject(i,n),Z=e.fetchIntegerofObject(i+1,n)-Ft,e.failed())return null;if(vi(),o>0&&h>0&&(b?(ni(),Oi(),y=r,A=r+o,S=a,O=a+h):qt()),e.failed())return null;_=_+Z+P}y=I,gt(),e.storeIntegerofObjectwithValue(pi,d,_),e.pop(6)}function Cr(){var t,i,r;return i=e.stackValue(2),r=e.stackIntegerValue(1),t=e.stackIntegerValue(0),Ht(i)?(e.failed()||(Qr(r,t),gt()),void(e.failed()||e.pop(2))):e.primitiveFail()}function wr(){var p,t,h,r,a,s,d,l,c,f,n,o,i;return n=e.stackIntegerValue(1),o=e.stackIntegerValue(0),t=e.stackValue(2),e.failed()?null:0>n||0>o?(i=0,e.failed()?null:(e.popthenPush(3,i),null)):(t=e.stackValue(e.methodArgumentCount()),e.isPointers(t)&&E(t)>=4?(a=e.fetchPointerofObject(st,t),e.isWordsOrBytes(a)?(Z=e.fetchIntegerofObject(hi,t),Ot=e.fetchIntegerofObject(ti,t),r=e.fetchIntegerofObject(mi,t),e.failed()?null:n>=Z||o>=Ot?(i=0,e.failed()?null:(e.popthenPush(3,i),null)):0>r?(e.primitiveFail(),null):(s=v(32,r),l=v(Z+(s-1),s),c=Xt(a),c!==l*Ot*4?(e.primitiveFail(),null):(d=e.fetchLong32ofObject(o*l+v(n,s),a),f=u(4294967295,32-r),h=32-((n&s-1)+1)*r,p=u(d,h)&f,i=e.positive32BitIntegerFor(p),e.failed()?null:(e.popthenPush(3,i),null)))):(e.primitiveFail(),null)):(e.primitiveFail(),null))}function Pr(){var t;return t=e.stackValue(e.methodArgumentCount()),Tr(t)?(sr(),e.failed()?null:(gt(),e.failed()?null:void e.pop(e.methodArgumentCount()))):e.primitiveFail()}function Ar(e){return yt||Rt()?yt(e,function(e,i,r,s){ft=e,vt=i,t=r,q=s}):!1}function Ir(e){return yt||Rt()?yt(e,function(e,t,i,r){it=e,rt=t,g=i,tt=r}):!1}function Or(s,n){var r,e;return 16>t?(e=i(1,t)-1,r=i(v(4294967295,e),t-1),gi(s,n,t,e,r)):16===t?(e=31,r=1108361744,gi(2147450879&s,2147450879&n,5,e,r)):(e=255,r=2155905152,gi(s,n,8,e,r))}function Sr(){var y,S,e,t,k,O,c,I,l,b,g,n,d,v;for(b=h+1,g=m,d=a,e=16*(1&r),q&&(e=16-e),F=i(65535,16-e);0!==--b;){for(k=g*P+4*p,c=d*M+4*(r>>1),y=4*(3&d),v=(3&p)-1,O=o+1,l=F,e=65535===l?16:0;0!==--O;)S=Vi[y+(v=v+1&3)],t=f[k>>>2],I=16777215&t,0!==I&&(n=s[c>>>2],n&=~l,n=u(n,e),n=(31744&n)<<9|(992&n)<<6|((31&n)<<3|4278190080),t=ii(t,n),t=di(t,S),t=0===t?i(1,e):i(t,e),Ut(c,t,l)),k+=4,q?0===e&&(c+=4):0!==e&&(c+=4),e=16^e,l=~l;++g,++d}}function Fr(){var i,e,n,t,d,v,l,u,c;for(v=h+1,l=m,c=a;0!==--v;){for(e=l*P+4*p,t=c*M+4*r,n=o+1;0!==--n;)if(i=f[e>>>2],d=16777215&i,0===d){for(e+=4,t+=4;0!==--n&&0===(16777215&(i=f[e>>>2]));)e+=4,t+=4;++n}else u=s[t>>>2],u=ii(i,u),s[t>>>2]=u,e+=4,t+=4;++l,++c}}function ii(v,d){var n,s,c,t,p,f,l,r,a,o,u,h,i,m,e;return i=v,0===i?d:(s=$t,a=255&yi,h=255&i,i>>>=8,c=255&i,i>>>=8,l=255&i,i>>>=8,f=255&i,255!==a&&(f=f*a>>>8,l=l*a>>>8,c=c*a>>>8,h=h*a>>>8),r=d,t=255&r,e=255&s,U&&(t=U[t],e=U[e]),u=(t*(255-h)>>>8)+(e*h>>>8),u>255&&(u=255),pt&&(u=pt[u]),r>>>=8,s>>>=8,t=255&r,e=255&s,U&&(t=U[t],e=U[e]),n=(t*(255-c)>>>8)+(e*c>>>8),n>255&&(n=255),pt&&(n=pt[n]),r>>>=8,s>>>=8,t=255&r,e=255&s,U&&(t=U[t],e=U[e]),o=(t*(255-l)>>>8)+(e*l>>>8),o>255&&(o=255),pt&&(o=pt[o]),r>>>=8,s>>>=8,p=((255&r)*(255-f)>>>8)+f,p>255&&(p=255),m=(((p<<8)+o<<8)+n<<8)+u)}function yr(){var t,e,b,I,O,k,n,A,d,l,S,g,c,y;for(O=Ii(),A=C&~St,S=h+1,g=m,y=a,F=8*(3&r),q&&(F=24-F),L=w^i(255,F),n=0===(1&r)?0:522133279,0===(1&a)&&(n=522133279^n);0!==--S;){for(n=522133279^n,b=g*P+4*p,k=y*M+4*(r>>2),I=o+1,t=F,l=L;0!==--I;)e=(f[b>>>2]&~n)+n,d=16777215&e,d=v((d>>>16)+(d>>>8&255)+(255&d),3),d>31&&(d>224&&(e=4294967295),c=s[k>>>2],c&=~l,c=u(c,t),c=O[c],e=ii(e,c),e=Dt(e,A),e=i(e,t),Ut(k,e,l)),b+=4,q?0===t?(k+=4,t=24,l=16777215):(t-=8,l=l>>>8|4278190080):32===t?(k+=4,t=0,l=4294967040):(t+=8,l=l<<8|255),n=522133279^n;++g,++y}}function br(e,i){var r;return r=e,0===r?i:Wr(e,i,t,c)}function gr(m,p){var f,i,e,n,s,r,o,h,a,l;for(s=j[t],16===t?(i=5,r=31):(i=8,r=255),a=d,o=p,n=m,h=1;c>=h;h++)(a&s)>0&&(l=o&s,f=n&s,16>t?e=f===l?0:1:(e=ht(f,l,i,3),e=(e&r)+(u(e,i)&r)+(u(u(e,i),i)&r)),$+=e),a=u(a,t),n=u(n,t),o=u(o,t);return p}function ui(e){return(31&e)<<3|(992&e)<<6|(31744&e)<<9}function kr(e){return e}function mt(s,o,n){var r,a,t,e;return(r=n-o)>0?(e=i(1,o)-1,t=i(s,r),e=i(e,r),a=t&e,e=i(e,n),t=i(t,r),a+(t&e)+(i(t,r)&i(e,n))):0===r?5===o?32767&s:8===o?16777215&s:s:0===s?s:(r=o-n,e=i(1,n)-1,t=u(s,r),a=t&e,e=i(e,n),t=u(t,r),a=a+(t&e)+(u(t,r)&i(e,n)),0===a?1:a)}function vr(e){var t;return t=z(e&ot[0],nt[0]),t|=z(e&ot[1],nt[1]),t|=z(e&ot[2],nt[2]),t|z(e&ot[3],nt[3])}function mr(e,i){return 16>t?ri(e,i,t,c):16===t?ri(e,i,5,3)+(ri(e>>>16,i>>>16,5,3)<<16):ri(e,i,8,4)}function dr(e,i){return 16>t?kt(e,i,t,c):16===t?kt(e,i,5,3)+(kt(e>>>16,i>>>16,5,3)<<16):kt(e,i,8,4)}function pr(r,i){var e;return e=~r,16>t?kt(e,i,t,c):16===t?kt(e,i,5,3)+(kt(e>>>16,i>>>16,5,3)<<16):kt(e,i,8,4)}function hr(e,i){return 16>t?si(e,i,t,c):16===t?si(e,i,5,3)+(si(e>>>16,i>>>16,5,3)<<16):si(e,i,8,4)}function fr(e,i){return 16>t?ht(e,i,t,c):16===t?ht(e,i,5,3)+(ht(e>>>16,i>>>16,5,3)<<16):ht(e,i,8,4)}function cr(i){var t;return e=i,t=e.majorVersion()==er,t===!1?!1:t=e.minorVersion()>=$i}function ji(){var i,e;if(i=e=0,8>=g)return null;if(16===g&&(i=5),32===g&&(i=8),0===R){if(8>=t)return null;16===t&&(e=5),32===t&&(e=8)}else e=R;ci(i,e)}function ci(s,a){var e,t,n=[0,0,0,0],r=[0,0,0,0];return e=a-s,0===e?0:(0>=e?(t=i(1,a)-1,r[Et]=i(t,2*s-e),r[Tt]=i(t,s-e),r[_t]=i(t,0-e),r[ei]=0):(t=i(1,s)-1,r[Et]=i(t,2*s),r[Tt]=i(t,s),r[_t]=t),n[Et]=3*e,n[Tt]=2*e,n[_t]=e,n[ei]=0,nt=n,ot=r,void(C|=Y|Si))}function gt(){e.showDisplayBitsLeftTopRightBottom(K,y,S,A,O)}function lr(){var e,i,s,n;n=c-1,i=p&n,e=r&n,J>0?(s=Math.min(o,c-e),Kt=i+s>n):(s=Math.min(o,e+1),Kt=0>i-s+1),V=tt?(i-e)*t:(e-i)*t,Kt&&(0>V?V+=32:V-=32),I=m*P+4*v(p,v(32,g)),Jt=P*dt-4*B*J,Kt&&(Jt-=4*J)}function ur(e){return e}function or(e,t){return e-t}function ar(l,s){var n,a,e,o,i,r;if((C&(Y|ct))!==(Y|ct))return s;for(n=j[t],e=s,i=d,o=1;c>=o;o++)0!==(i&n)&&(r=e&n,a=16>t?r:16===t?mt(r,5,R):mt(r,8,R),Lt(a,Mt(a)+1)),i=u(i,t),e=u(e,t);return s}function Mt(e){return X[e&ut]}function Lt(e,t){return X[e&ut]=t}function nr(){return W?!1:34!==k&&41!==k?!1:32!==g?!1:T===K?!1:41===k?32===t?(Fr(),y=r,A=r+o,S=a,O=a+h,!0):16===t?(Sr(),y=r,A=r+o,S=a,O=a+h,!0):8===t?(yr(),y=r,A=r+o,S=a,O=a+h,!0):!1:8>t?!1:8===t&&0===(C&Y)?!1:(32===t&&bs(),16===t&&ys(),8===t&&gs(),y=r,A=r+o,S=a,O=a+h,!0) }function Ai(){var t,i,r,n;if(Ct){if(!Nt&&!Rt())return null;r=Nt,n=!1,t=e.fetchPointerofObject(st,K),"number"==typeof t&&(t=t,r(t,y,S,A-y,O-S),s=M=0,n=!0),W||(i=e.fetchPointerofObject(st,T),"number"==typeof i&&(i=i,n&&i===t||r(i,0,0,0,0),f=P=0)),Ct=!1}}function sr(){var t;return t=W,W=!0,vi(),W=t,W||0>=o||0>=h?(y=A=S=O=0,null):Di()?(ni(),rr(),J>0?(y=r,A=r+o):(y=r-o+1,A=r+1),dt>0?(S=a,O=a+h):(S=a-h+1,O=a+1),void Ai()):e.primitiveFail()}function rr(){var st,et,f,tt,u,z,W,Y,it,K,y,J,V,$,Q,O,U,A,P,j,I,S,rt,T,v,M;if(it=n[k+1],!(E(b)>=at+12))return e.primitiveFail();if(u=Ot-1,0>=u&&(u=1),I=H(at,b),f=H(at+3,b),v=wt(I,f,u),0>v&&(I=f-u*v),O=H(at+1,b),f=H(at+4,b),S=wt(O,f,u),0>S&&(O=f-u*S),A=H(at+9,b),f=H(at+6,b),K=wt(A,f,u),0>K&&(A=f-u*K),y=H(at+10,b),f=H(at+7,b),z=wt(y,f,u),0>z&&(y=f-u*z),e.failed())return!1;if(2===e.methodArgumentCount())if(M=e.stackIntegerValue(1),P=e.stackValue(0),P.isNil){if(16>g)return e.primitiveFail()}else{if(E(P)=u&&(u=1),Y=c-(r&c-1),rt=(r+o-1&c-1)+1,Y>o&&(Y=o),x>D&&(I+=(x-D)*v,O+=(x-D)*S,A+=(x-D)*K,y+=(x-D)*z),Cs(),M>1&&0===(C&St)&&(X?ci(8,R):16===t&&ci(8,5)),st=C&~St,q?(U=0-t,et=32-t):(U=t,et=0),J=1;h>=J;J++){j=wt(I,A,u),p=j>=0?I:A-u*j,V=wt(O,y,u),m=V>=0?O:y-u*V,G=q?32-((r&c-1)+1)*t:(r&c-1)*t,N>_&&(p+=(N-_)*j,m+=(N-_)*V),$=At?w:Gt(a+J-1),d=F,T=Y,f=B;do tt=1===M?tr(T,j,V,v,S,U,st):ir(T,j,V,v,S,P,M,U),G=et,d===w?(Q=it(tt&$,s[l>>>2]),s[l>>>2]=d&Q):(W=s[l>>>2],Q=it(tt&$,W&d),W=d&Q|W&~d,s[l>>>2]=W),l+=4,2===f?(d=L,T=rt):(d=w,T=c);while(0!==--f);I+=v,O+=S,A+=K,y+=z,l+=Pt}}function Cs(){var e,t;for(zt=0,t=g;1!==t;)++zt,t>>>=1;for(Wi=j[g],bi=5-zt,ki=i(1,bi)-1,e=0;ki>=e;e++)Mi[e]=tt?32-i(e+1,zt):i(e,zt)}function ir(_,c,f,x,A,B,s,M){var P,y,S,q,l,w,I,V,h,e,b,o,F,u,O,n,a,r,d;V=j[t],y=0,2===s?(S=c>>1,l=f>>1,I=x>>1,h=A>>1):(S=v(c,s),l=v(f,s),I=v(x,s),h=v(A,s)),w=_;do{O=p,b=m,n=a=u=o=0,r=0,q=s;do{d=O,F=b,P=s;do e=fi(d,F),(25!==k||0!==e)&&(++r,e=16>g?B[e]:16===g?ui(e):kr(e),o+=255&e,u+=e>>>8&255,a+=e>>>16&255,n+=e>>>24),d+=S,F+=l;while(0!==--P);O+=I,b+=h}while(0!==--q);0===r||25===k&&s*s>>1>r?e=0:(4===r?(a>>>=2,u>>>=2,o>>>=2,n>>>=2):(a=v(a,r),u=v(u,r),o=v(o,r),n=v(n,r)),e=(n<<24)+(a<<16)+(u<<8)+o,0===e&&a+u+o+n>0&&(e=1),e=Dt(e,C)),y|=i(e&V,G),G+=M,p+=c,m+=f}while(0!==--w);return y}function tr(f,u,c,d,h,o,l){var s,a,r,n,e;if(n=j[t],e=0,a=f,l===(Y|ct)){do s=fi(p,m),r=X[s&ut],e|=i(r&n,G),G+=o,p+=u,m+=c;while(0!==--a)}else do s=fi(p,m),r=Dt(s,l),e|=i(r&n,G),G+=o,p+=u,m+=c;while(0!==--a);return e}var er=1,$i=11,w=4294967295,ei=3,Qi=13,Zi=12,Yi=10,Xi=11,Ji=14,Ui=0,pi=4,Ci=5,Gi=2,zi=7,Ki=3,Ei=1,Ri=8,Br=9,at=15,Li=6,_t=2,Si=2,ct=4,St=8,Y=1,qi=16384,st=0,mi=3,ti=2,hi=1,Tt=1,Hi=43,Et=0,O=0,y=0,A=0,S=0,h=0,o=0,b=0,$=0,jt=0,Vt=0,N=0,x=0,R=0,C=0,X=null,ut=0,ot=null,nt=null,k=0,yi=0,$t=0,s=0,Pt=0,t=0,K=0,vt=0,l=0,q=0,d=0,c=0,M=0,ft=0,_=0,D=0,Zt=new Array(4096),Vi=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5],ai=[0,2,4,6,8,12,14,16],li=[0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],G=0,r=0,a=0,pt=null,J=0,oi=0,lt=0,Bt=0,Ct=0,Ot=0,e=null,Fi=0,It=null,F=0,L=0,j=[0,1,3,0,15,31,0,0,255,0,0,0,0,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1],Yr="BitBltPlugin 3 November 2014 (e)",B=0,At=0,W=0,n=new Array(43),Kt=0,yt=null,V=0,bt=0,f=0,Jt=0,g=0,T=0,rt=0,I=0,tt=0,et=0,P=0,it=0,Ft=0,Yt=0,Wt=0,p=0,m=0,U=null,Nt=null,dt=0,ki=0,bi=0,Mi=new Array(32),Wi=0,zt=0,Z=0;Squeak.registerExternalModule("BitBltPlugin",{primitiveCopyBits:jr,copyBits:qt,moduleUnloaded:Dr,primitiveDrawLoop:Cr,primitiveDisplayString:Vr,initialiseModule:Gr,loadBitBltFrom:Ht,setInterpreter:cr,primitiveWarpBits:Pr,getModuleName:Hr,primitivePixelValueAt:wr,copyBitsFromtoat:rs})}),module("users.bert.SqueakJS.plugins.FFTPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function s(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 v(t,e){return e>31?0:t<=6),e.failed()?!1:(l=e.fetchIntegerofObject(0,h),r=e.fetchIntegerofObject(1,h),o=e.fetchPointerofObject(2,h),p=s(o),n=c(o),o=e.fetchPointerofObject(3,h),m=s(o),u=P(o),o=e.fetchPointerofObject(4,h),a=s(o),t=c(o),o=e.fetchPointerofObject(5,h),f=s(o),i=c(o),e.success(v(1,l)===r&&(r>>2)+1===p&&r===a&&r===f&&a===f),e.failed()===!1)}function o(){var r,s,l,n,o;for(n=0,l=m;l>n;){if(r=u[n]-1,s=u[n+1]-1,!(a>r&&a>s))return e.success(!1);o=t[r],t[r]=t[s],t[s]=o,o=i[r],i[r]=i[s],i[s]=o,n+=2}}function O(){var t;return t=e.stackObjectValue(0),h(t)?(o(),void(e.failed()&&o())):null}function S(){var t;return t=e.stackObjectValue(0),h(t)?void d():null}function y(){var t,i;return t=e.booleanValueOf(e.stackValue(0)),i=e.stackObjectValue(1),h(i)?(w(t),void(e.failed()||e.pop(1))):null}function d(){var e,s;if(1>=r)return null;for(s=1/r,e=0;r-1>=e;e++)t[e]=t[e]*s,i[e]=i[e]*s}function g(i){var t;return e=i,t=e.majorVersion()==F,t===!1?!1:t=e.minorVersion()>=I}function w(t){return o(),e.failed()?(o(),null):(C(t),void(t||d()))}function C(O){var F,S,m,u,s,y,a,e,c,d,k,h,g,f,o;for(S=r>>1,m=r>>2,h=1;l>=h;h++)for(d=v(1,h),k=d>>1,F=b(r,d),c=1;k>=c;c++)for(o=(c-1)*F,m>o?(f=n[p-o-1],a=n[o]):(f=0-n[o-m],a=n[S-o]),O||(a=0-a),u=c;r>=u;)e=u+k-1,s=u-1,g=t[e]*f-i[e]*a,y=t[e]*a+i[e]*f,t[e]=t[s]-g,i[e]=i[s]-y,t[s]=t[s]+g,i[s]=i[s]+y,u+=d}var F=1,I=11,r=0,i=null,f=0,e=null,k="FFTPlugin 3 November 2014 (e)",l=0,u=null,m=0,t=null,a=0,n=null,p=0;Squeak.registerExternalModule("FFTPlugin",{primitiveFFTTransformData:y,setInterpreter:g,primitiveFFTPermuteData:O,primitiveFFTScaleData:S,getModuleName:A})}),module("users.bert.SqueakJS.plugins.FloatArrayPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function t(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function f(){return F}function i(){var r,o,i,n,s,a;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(s)),e.failed())return null;if(n=t(r),e.success(n===t(s)),e.failed())return null;for(a=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)a[i]=a[i]+o[i];e.pop(1)}function r(){var i,n,r,s,a;if(a=e.stackFloatValue(0),r=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.failed())return null;for(n=t(r),s=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)s[i]=s[i]+a;e.pop(1)}function s(){var s,n,i,r;return i=e.stackIntegerValue(0),r=e.stackObjectValue(1),e.failed()?null:(e.success(e.isWords(r)),e.success(i>0&&i<=t(r)),e.failed()?null:(s=r.wordsAsFloat32Array(),n=s[i-1],e.pop(2),void e.pushFloat(n)))}function n(){var n,a,r,s,i;return i=e.stackValue(0),a="number"==typeof i?i:e.floatValueOf(i),r=e.stackIntegerValue(1),s=e.stackObjectValue(2),e.failed()?null:(e.success(e.isWords(s)),e.success(r>0&&r<=t(s)),e.failed()?null:(n=s.wordsAsFloat32Array(),n[r-1]=a,void(e.failed()||e.popthenPush(3,i))))}function a(){var r,a,i,s,n,o;if(r=e.stackObjectValue(0),n=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.failed())return null;if(s=t(r),e.success(s===t(n)),e.failed())return null;for(o=n.wordsAsFloat32Array(),a=r.wordsAsFloat32Array(),i=0;s-1>=i;i++)if(0===a[i])return e.primitiveFail();for(i=0;s-1>=i;i++)o[i]=o[i]/a[i];e.pop(1)}function o(){var i,a,o,r,s,n;if(n=e.stackFloatValue(0),r=e.stackObjectValue(1),e.failed())return null;if(0===n)return e.primitiveFail();if(e.success(e.isWords(r)),e.failed())return null;for(o=t(r),s=r.wordsAsFloat32Array(),a=1/n,i=0;o-1>=i;i++)s[i]=s[i]*a;e.pop(1)}function u(){var r,o,i,n,s,u,a;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(s)),e.failed())return null;if(n=t(r),e.success(n===t(s)),e.failed())return null;for(u=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),a=0,i=0;n-1>=i;i++)a+=u[i]*o[i];e.pop(2),e.pushFloat(a)}function l(){var r,a,i,n,s,o;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(s)),e.failed())return null;if(e.pop(2),n=t(r),n!==t(s))return e.pushBool(!1);for(o=s.wordsAsFloat32Array(),a=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)if(o[i]!==a[i])return e.pushBool(!1);return e.pushBool(!0)}function c(){var i,n,r,a,s;if(r=e.stackObjectValue(0),e.failed())return null;if(e.success(e.isWords(r)),e.failed())return null;for(n=t(r),a=r.wordsAsInt32Array(),s=0,i=0;n-1>=i;i++)s+=a[i];return e.pop(1),e.pushInteger(536870911&s)}function S(){var i,a,s,n,r;if(s=e.stackObjectValue(0),e.failed())return null;if(e.success(e.isWords(s)),e.failed())return null;for(a=t(s),e.success(!0),n=s.wordsAsFloat32Array(),r=0,i=0;a-1>=i;i++)r+=n[i]*n[i];r=Math.sqrt(r),e.popthenPush(1,e.floatObjectOf(r))}function h(){var r,o,i,n,s,a;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(s)),e.failed())return null;if(n=t(r),e.success(n===t(s)),e.failed())return null;for(a=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)a[i]=a[i]*o[i];e.pop(1)}function p(){var i,n,r,s,a;if(a=e.stackFloatValue(0),r=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.failed())return null;for(n=t(r),s=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)s[i]=s[i]*a;e.pop(1)}function d(){var i,r,a,n,s;if(n=e.stackObjectValue(0),e.failed())return null;if(e.success(e.isWords(n)),e.failed())return null;for(a=t(n),e.success(!0),s=n.wordsAsFloat32Array(),r=0,i=0;a-1>=i;i++)r+=s[i]*s[i];if(e.success(r>0),e.failed())return null;for(r=Math.sqrt(r),i=0;a-1>=i;i++)s[i]=s[i]/r}function m(){var r,o,i,n,s,a;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(s)),e.failed())return null;if(n=t(r),e.success(n===t(s)),e.failed())return null;for(a=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)a[i]=a[i]-o[i];e.pop(1)}function v(){var i,n,r,s,a;if(a=e.stackFloatValue(0),r=e.stackObjectValue(1),e.failed())return null;if(e.success(e.isWords(r)),e.failed())return null;for(n=t(r),s=r.wordsAsFloat32Array(),i=0;n-1>=i;i++)s[i]=s[i]-a;e.pop(1)}function k(){var i,n,r,a,s;if(r=e.stackObjectValue(0),e.failed())return null;if(e.success(e.isWords(r)),e.failed())return null;for(n=t(r),a=r.wordsAsFloat32Array(),s=0,i=0;n-1>=i;i++)s+=a[i];e.popthenPush(1,e.floatObjectOf(s))}function g(i){var t;return e=i,t=e.majorVersion()==b,t===!1?!1:t=e.minorVersion()>=y}var b=1,y=11,e=null,F="FloatArrayPlugin 3 November 2014 (e)";Squeak.registerExternalModule("FloatArrayPlugin",{primitiveMulFloatArray:h,primitiveEqual:l,primitiveAtPut:n,primitiveAt:s,primitiveNormalize:d,primitiveSubFloatArray:m,primitiveDivFloatArray:a,primitiveAddScalar:r,primitiveDotProduct:u,primitiveSubScalar:v,setInterpreter:g,primitiveSum:k,getModuleName:f,primitiveHashArray:c,primitiveMulScalar:p,primitiveLength:S,primitiveAddFloatArray:i,primitiveDivScalar:o})}),module("users.bert.SqueakJS.plugins.GeniePlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function t(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function i(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function r(i,r){var s,n,e,a,o,t;return s=i[0],a=i[1],n=r[0],o=r[1],e=n-s,t=o-a,e*e+t*t}function d(t,i){var e;return e=Math.abs(i-t),e>180&&(e=360-e),e*e>>>6}function u(){return n}function a(){return 2}function o(){return 0}function s(e){console.log(n+": "+e)}function l(){var Z,H,K,o,A,V,C,O,Q,h,J,D,g,y,U,f,F,b,z,Y,u,l,_,I,n,a,p,S,X,E,m,v,$,B,c,k,w,P,T,L,R,x,W,j,G,M,N,q,et;if(w=e.stackValue(11),P=e.stackValue(10),T=e.stackValue(9),L=e.stackValue(8),R=e.stackValue(7),x=e.stackValue(6),W=e.stackValue(5),j=e.stackValue(4),G=e.stackIntegerValue(3),M=e.stackValue(2),N=e.stackValue(1),q=e.stackValue(0),e.failed())return null;if(e.failed())return s("failed 1"),null;if(e.success(e.isWords(w)&&e.isWords(P)&&e.isWords(T)&&e.isWords(L)&&e.isWords(R)&&e.isWords(x)&&e.isWords(W)&&e.isWords(j)&&e.isWords(M)&&e.isWords(N)&&e.isWords(q)),e.failed())return s("failed 2"),null;if(e.success(e.isMemberOf(w,"PointArray")&&e.isMemberOf(P,"PointArray")),e.failed())return s("failed 3"),null;if(g=w.wordsAsInt32Array(),b=P.wordsAsInt32Array(),Y=T.wordsAsInt32Array(),Q=L.wordsAsInt32Array(),U=R.wordsAsInt32Array(),J=x.wordsAsInt32Array(),$=W.wordsAsInt32Array(),Z=j.wordsAsInt32Array(),l=M.wordsAsInt32Array(),c=N.wordsAsInt32Array(),u=q.wordsAsInt32Array(),z=t(P)>>>1,S=t(T)>>>1,h=t(L)>>>1,H=t(x),D=t(M),e.success(D===t(N)&&D===t(q)&&D>h),e.failed())return s("failed 4"),null;if(e.success(t(R)>=S-1&&t(w)>>>1>=S&&H>=h-1&&z>=h&&t(W)>=S-1&&t(j)>=h-1),e.failed())return s("failed 5"),null;if(K=1&G,E=G>>>1,_=1<<29,f=K?0:E*E>>>10,l[0]=0,c[0]=0,u[0]=2,a=0-f,y=h,!(z>=y-1&&H>=y-1))return e.primitiveFail(),null;for(n=1;y>=n;n++)o=n-1,a=a+(J[o]+r(i(b,o<<1),g)>>>7)+f,c[n]=a,l[n]=a*n,u[n]=n+1;for(a=c[0]-f,p=1;S>=p;p++){for(A=p-1,I=A<<1,v=l[0],a=a+(U[A]+r(i(g,I),b)>>>7)+f,c[0]=a,l[0]=a*p,u[0]=p+1,y=h,n=1;y>=n;n++)o=n-1,V=o<<1,m=l[n],k=l[o],F=U[A]+r(i(g,I),i(b,n<<1))>>>7,0===(a=c[n])?m+=F:(m=m+a+F*u[n],F+=a),O=J[o]+r(i(b,V),i(g,p<<1))>>>7,0===(a=c[o])?k+=O:(k=k+a+O*u[o],O+=a),K?v=_:(X=(r(i(Q,V),i(Y,I))+r(i(b,V),i(g,I)))*(16+d(Z[o],$[A]))>>>11,v+=X),m>=v&&k>=v?(C=v,a=0,B=1):k>=m?(C=m,a=F+f,B=u[n]+1):(C=k,a=O+f,B=u[o]+1),v=l[n],l[n]=Math.min(C,_),c[n]=Math.min(a,_),u[n]=B;a=c[0]}return et=C,e.failed()?null:(e.popthenPush(13,et),null)}function c(){var t;return t=1e3*a()+o(),e.failed()?null:(e.popthenPush(1,t),null)}function f(i){var t;return e=i,t=e.majorVersion()==h,t===!1?!1:t=e.minorVersion()>=p}var h=1,p=11,e=null,n="GeniePlugin v2.0 14 November 2014 (e)";Squeak.registerExternalModule("GeniePlugin",{primVersionNO:c,setInterpreter:f,primSameClassAbsoluteStrokeDistanceMyPoints_otherPoints_myVectors_otherVectors_mySquaredLengths_otherSquaredLengths_myAngles_otherAngles_maxSizeAndReferenceFlag_rowBase_rowInsertRemove_rowInsertRemoveCount:l,getModuleName:u})}),module("users.bert.SqueakJS.plugins.JPEGReaderPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function s(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function ut(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function v(e,t){return 0|Math.floor(e/t)}function V(t,e){return e>31?0:t<31?0:t>>>e}function ht(e){return P(u,e)&&C(rt,e)}function P(i,t){return"number"==typeof t?!1:e.isPointers(t)?s(t)bt)return!1;for(r=0;a-1>=r;r++){if(i=e.fetchPointerofObject(r,t),"number"==typeof i)return!1;if(!e.isWords(i))return!1;if(s(i)!==d)return!1;o[r]=i.wordsAsInt32Array()}return!e.failed()}function qt(){var t,e;for(i[n]=0,i[o]=0,t=0;I-1>=t;t++)e=q(),e+=p[A],e=Math.min(e,r),p[A]=e&h,e&=r-h,e=Math.max(e,1),O[t]=4278190080+(e<<16)+(e<<8)+e}function xt(){var e,l,c,t,d,s,m;for(i[n]=0,i[o]=0,u[n]=0,u[o]=0,a[n]=0,a[o]=0,d=0;I-1>=d;d++)m=q(),l=St(),l-=f,c=Ft(),c-=f,s=m+(ot*c>>16)+p[E],s=Math.min(s,r),s=Math.max(s,0),p[E]=s&h,s&=r-h,s=Math.max(s,1),t=m-(ct*l>>16)-(lt*c>>16)+p[A],t=Math.min(t,r),t=Math.max(t,0),p[A]=t&h,t&=r-h,t=Math.max(t,1),e=m+(at*l>>16)+p[M],e=Math.min(e,r),e=Math.max(e,0),p[M]=e&h,e&=r-h,e=Math.max(e,1),O[d]=4278190080+(s<<16)+(t<<8)+e}function Vt(e){return P(a,e)&&C(J,e)}function Ct(a,o){var r,t,s,i,n;if(t=et(W,N),0>t)return e.primitiveFail();for(0!==t&&(r=w(t),t=z(r,t)),t=o[k]=o[k]+t,a[0]=t,s=1;d-1>=s;s++)a[s]=0;for(i=1;d>i;){if(t=et(B,x),0>t)return e.primitiveFail();if(n=t>>>4,t=15&t,0!==t){if(i+=n,r=w(t),t=z(r,t),0>i||i>=d)return e.primitiveFail();a[It[i]]=t}else{if(15!==n)return null;i+=n}++i}}function wt(){for(var e;16>=l;){if(!(F>c))return l;if(e=j[c],++c,255===e){if(!(F>c&&0===j[c]))return--c,l;++c}m=m<<8|e,l+=8}return l}function w(e){var t;return e>l&&(wt(),e>l)?-1:(l-=e,t=ft(m,l),m&=V(1,l)-1,t)}function Pt(){return jt}function At(c,v){var O,A,e,I,S,a,o,k,b,g,y,n,s,i,p,h,u,m,F,l=new Array(64);for(e=0;t-1>=e;e++){for(O=-1,S=1;t-1>=S;S++)-1===O&&0!==c[S*t+e]&&(O=S);if(-1===O)for(A=c[e]*v[0]<<2,I=0;t-1>=I;I++)l[I*t+e]=A;else h=c[2*t+e]*v[2*t+e],u=c[6*t+e]*v[6*t+e],p=(h+u)*R,n=p+u*(0-X),s=p+h*K,h=c[e]*v[e],u=c[4*t+e]*v[4*t+e],a=h+u<<13,o=h-u<<13,k=a+s,y=a-s,b=o+n,g=o-n,a=c[7*t+e]*v[7*t+e],o=c[5*t+e]*v[5*t+e],n=c[3*t+e]*v[3*t+e],s=c[t+e]*v[t+e],p=a+s,h=o+n,u=a+n,m=o+s,F=(u+m)*G,a*=D,o*=Z,n*=$,s*=st,p*=0-T,h*=0-Q,u*=0-Y,m*=0-L,u+=F,m+=F,a=a+p+u,o=o+h+m,n=n+h+u,s=s+p+m,l[e]=k+s>>11,l[7*t+e]=k-s>>11,l[1*t+e]=b+n>>11,l[6*t+e]=b-n>>11,l[2*t+e]=g+o>>11,l[5*t+e]=g-o>>11,l[3*t+e]=y+a>>11,l[4*t+e]=y-a>>11}for(e=0;d-t>=e;e+=t)h=l[e+2],u=l[e+6],p=(h+u)*R,n=p+u*(0-X),s=p+h*K,a=l[e]+l[e+4]<<13,o=l[e]-l[e+4]<<13,k=a+s,y=a-s,b=o+n,g=o-n,a=l[e+7],o=l[e+5],n=l[e+3],s=l[e+1],p=a+s,h=o+n,u=a+n,m=o+s,F=(u+m)*G,a*=D,o*=Z,n*=$,s*=st,p*=0-T,h*=0-Q,u*=0-Y,m*=0-L,u+=F,m+=F,a=a+p+u,o=o+h+m,n=n+h+u,s=s+p+m,i=(k+s>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e]=i,i=(k-s>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+7]=i,i=(b+n>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+1]=i,i=(b-n>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+6]=i,i=(g+o>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+2]=i,i=(g-o>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+5]=i,i=(y+a>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+3]=i,i=(y-a>>18)+f,i=Math.min(i,r),i=Math.max(i,0),c[e+4]=i}function et(n,a){var i,e,r,s,t;if(e=n[0]>>>24,e>it)return-1;for(s=2;;){if(i=w(e),0>i)return-1;if(r=s+i-1,r>=a)return-1;if(t=n[r],0===(1056964608&t))return t;if(s=65535&t,e=t>>>24&255,e>it)return-1}return-1}function Ot(t){var i,r;return s(t)<5?!1:e.isPointers(t)?(i=e.fetchPointerofObject(0,t),"number"==typeof i?!1:e.isBytes(i)?(j=i.bytes,r=ut(i),c=e.fetchIntegerofObject(1,t),F=e.fetchIntegerofObject(2,t),m=e.fetchIntegerofObject(3,t),l=e.fetchIntegerofObject(4,t),e.failed()?!1:F>r?!1:0>c||c>=F?!1:!0):!1):!1}function St(){var a,i,e,t,l,c,r,s;return e=i=u[n],t=u[o],r=u[b],s=u[S],0!==r&&0!==s&&(e=v(e,r),t=v(t,s)),a=(t>>>3)*u[y]+(e>>>3),c=((7&t)<<3)+(7&e),l=rt[a][c],++i,i<8*u[g]?u[n]=i:(u[n]=0,u[o]++),l}function Ft(){var u,i,e,t,l,c,r,s;return e=i=a[n],t=a[o],r=a[b],s=a[S],0!==r&&0!==s&&(e=v(e,r),t=v(t,s)),u=(t>>>3)*a[y]+(e>>>3),c=((7&t)<<3)+(7&e),l=J[u][c],++i,i<8*a[g]?a[n]=i:(a[n]=0,a[o]++),l}function q(){var u,r,e,t,l,c,s,a;return e=r=i[n],t=i[o],s=i[b],a=i[S],0!==s&&0!==a&&(e=v(e,s),t=v(t,a)),u=(t>>>3)*i[y]+(e>>>3),c=((7&t)<<3)+(7&e),l=_[u][c],++r,r<8*i[g]?i[n]=r:(i[n]=0,i[o]++),l}function yt(){var t;return H(),4!==e.methodArgumentCount()?e.primitiveFail():(h=e.stackIntegerValue(0),t=e.stackObjectValue(1),e.failed()?null:e.isWords(t)&&3===s(t)?(p=t.wordsAsInt32Array(),t=e.stackObjectValue(2),e.failed()?null:e.isWords(t)?(I=s(t),O=t.wordsAsInt32Array(),t=e.stackObjectValue(3),e.failed()?null:tt(t)?(qt(),void e.pop(4)):e.primitiveFail()):e.primitiveFail()):e.primitiveFail())}function Mt(){var t;return H(),4!==e.methodArgumentCount()?e.primitiveFail():(h=e.stackIntegerValue(0),t=e.stackObjectValue(1),e.failed()?null:e.isWords(t)&&3===s(t)?(p=t.wordsAsInt32Array(),t=e.stackObjectValue(2),e.failed()?null:e.isWords(t)?(I=s(t),O=t.wordsAsInt32Array(),t=e.stackObjectValue(3),e.failed()?null:e.isPointers(t)&&3===s(t)&&tt(e.fetchPointerofObject(0,t))&&ht(e.fetchPointerofObject(1,t))&&Vt(e.fetchPointerofObject(2,t))?(xt(),void e.pop(4)):e.primitiveFail()):e.primitiveFail()):e.primitiveFail())}function gt(){var n,t,r;return 5!==e.methodArgumentCount()?e.primitiveFail():(r=e.stackObjectValue(0),e.failed()?null:Ot(r)?(t=e.stackObjectValue(1),e.failed()?null:e.isWords(t)?(x=s(t),B=t.wordsAsInt32Array(),t=e.stackObjectValue(2),e.failed()?null:e.isWords(t)?(N=s(t),W=t.wordsAsInt32Array(),r=e.stackObjectValue(3),e.failed()?null:P(i,r)?(t=e.stackObjectValue(4),e.failed()?null:e.isWords(t)?s(t)!==d?e.primitiveFail():(n=t.wordsAsInt32Array(),e.failed()?null:(Ct(n,i),e.failed()?null:(mt(e.stackValue(0)),e.storeIntegerofObjectwithValue(k,e.stackValue(3),i[k]),void e.pop(5)))):e.primitiveFail()):e.primitiveFail()):e.primitiveFail()):e.primitiveFail()):e.primitiveFail())}function kt(){var i,t,r;return 2!==e.methodArgumentCount()?e.primitiveFail():(t=e.stackObjectValue(0),e.failed()?null:e.isWords(t)&&s(t)===d?(r=t.wordsAsInt32Array(),t=e.stackObjectValue(1),e.failed()?null:e.isWords(t)&&s(t)===d?(i=t.wordsAsInt32Array(),At(i,r),void e.pop(2)):e.primitiveFail()):e.primitiveFail())}function z(e,t){return e=pt}function H(){}function mt(t){e.storeIntegerofObjectwithValue(1,t,c),e.storeIntegerofObjectwithValue(3,t,m),e.storeIntegerofObjectwithValue(4,t,l)}function tt(e){return P(i,e)&&C(_,e)}var dt=1,pt=11,y=5,M=2,n=0,o=1,t=8,d=64,D=2446,ct=22554,L=3196,R=4433,lt=46802,K=6270,T=7373,G=9633,ot=91881,st=12299,at=116130,X=15137,Y=16069,Z=16819,Q=20995,$=25172,A=1,b=2,nt=4,g=8,it=16,bt=128,r=255,U=11,k=10,E=0,f=127,S=3,B=null,x=0,rt=new Array(128),u=new Array(11),J=new Array(128),a=new Array(11),W=null,N=0,h=0,e=null,O=null,I=0,It=[0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63],m=0,l=0,j=null,c=0,F=0,jt="JPEGReaderPlugin 3 November 2014 (e)",p=null,_=new Array(128),i=new Array(11);Squeak.registerExternalModule("JPEGReaderPlugin",{setInterpreter:vt,primitiveIdctInt:kt,primitiveColorConvertMCU:Mt,primitiveColorConvertGrayscaleMCU:yt,primitiveDecodeMCU:gt,getModuleName:Pt})}),module("users.bert.SqueakJS.plugins.KedamaPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function t(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function a(e,t){return 0|Math.floor(e/t)}function h(e,t){return e-a(e,t)*t|0}function rt(t,e){return 0>e?-31>e?0:t>>>0-e:e>31?0:t<=0?90:270:(r=i/t,e=Math.atan(r),t>=0?i>=0?e/.0174532925199433:360+e/.0174532925199433:180+e/.0174532925199433)}function o(i){var e,r,t;return e=90-i,t=e/360|0,0>e&&--t,r=.0174532925199433*(e-360*t)}function it(){var d,v,o,p,h,n,a,i,r,b,k,l,c,m,s,f,g,u;if(l=e.stackValue(0),o=e.stackValue(1),u=e.stackValue(2),s=e.stackValue(3),h=e.stackIntegerValue(4),a=e.stackIntegerValue(5),n=e.stackValue(6),e.failed())return null;if(!e.isWords(n))return e.primitiveFail(),null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isBytes(l))return e.primitiveFail(),null;if(h*a!==t(n))return e.primitiveFail(),null;if(r=t(s),t(u)!==r)return e.primitiveFail(),null;if(t(o)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;for(m=s.wordsAsFloat32Array(),g=u.wordsAsFloat32Array(),v=o.words,k=l.bytes,p=n.words,i=0;r-1>=i;i++)c=0|m[i],f=0|g[i],b=k[i],0!==b&&c>=0&&f>=0&&a>c&&h>f&&(d=f*a+c,p[d]=v[i]);return e.failed()?null:void e.pop(7)}function tt(){var i,o,s,r,u,n,a;if(n=e.stackValue(0),s=e.stackValue(1),e.failed())return null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(a=t(s),t(n)!==a)return e.primitiveFail(),null;for(o=s.wordsAsFloat32Array(),u=n.wordsAsFloat32Array(),r=0;a-1>=r;r++)i=o[r],i/=.0174532925199433,i=90-i,i>0||(i+=360),u[r]=i;return e.failed()?null:void e.pop(2)}function $(){return et}function Q(){var i,n,r,s;return r=e.stackValue(0),s=e.stackIntegerValue(1),e.failed()?null:e.isWords(r)?t(r)e?0-e:e,s=a(i,l),n=h(i,l),i=r*n-d*s,u=65535&i,t=u*(o+1)>>>16,0>e?0-t:t}function m(){var t;return t=e.stackIntegerValue(0),e.failed()?null:(i=65536&t,void e.pop(1))}function x(){var i,c,u,n,a,l,r,f,o,h,p,s;if(s=e.stackIntegerValue(0),p=e.stackIntegerValue(1),o=e.stackValue(2),n=e.stackValue(3),e.failed())return null;if(a=t(n),h=t(o),a!==h)return e.primitiveFail(),null;if(-32>s)return e.primitiveFail(),null;if(s>8)return e.primitiveFail(),null;for(c=n.words,f=o.words,l=4278190080,r=0;a-1>=r;r++)u=c[r],i=rt(u,s),i>255&&(i=255),0>i&&(i=0),f[r]=i<<24&l|p;e.pop(4)}function V(){var r,l,s,n,a,c,i,v,o,f,h,p,d,m,u;if(m=e.stackValue(0),u=e.stackIntegerValue(1),o=e.stackValue(2),n=e.stackValue(3),e.failed())return null;if(p=m.words,h=p[0],e.failed())return null;if(d=Math.log(h),a=t(n),f=t(o),a!==f)return e.primitiveFail(),null;for(l=n.words,v=o.words,c=4278190080,i=0;a-1>=i;i++)s=l[i],r=0===s?0:255/d*Math.log(s)|0,r>255&&(r=255),v[i]=r<<24&c|u;e.pop(4)}function v(){var u,i,f,n,a,o,h,s,r,p,d,l,m,v,c;if(u=e.stackIntegerValue(0),r=e.stackIntegerValue(1),c=e.stackValue(2),l=e.stackValue(3),s=e.stackValue(4),a=e.stackValue(5),!e.isWords(c))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(a))return e.primitiveFail(),null;if(o=t(s),t(l)!==o)return e.primitiveFail(),null;if(t(c)!==o)return e.primitiveFail(),null;if(t(a)!==u*r)return e.primitiveFail(),null;for(d=l.wordsAsFloat32Array(),v=c.wordsAsFloat32Array(),h=s.words,f=a.words,i=0;u*r-1>=i;i++)f[i]=0;for(i=0;o-1>=i;i++)p=d[i],m=v[i],n=r*m+p,n>=0&&u*r>n&&(f[n]=h[i]);return e.failed()?null:void e.pop(6)}function W(){var u,i,a,l,o,r,s,c,n,f;return a=e.stackIntegerValue(0),r=e.stackIntegerValue(1),f=e.stackFloatValue(2),c=e.stackFloatValue(3),i=e.stackValue(4),e.failed()?null:e.isWords(i)?t(i)!==a*r?(e.primitiveFail(),null):(s=0|c,n=0|f,u=i.words,s>=0&&r>s&&n>=0&&a>n?(l=n*r+s,o=u[l]):o=0,e.failed()?null:(e.pop(6),void e.pushInteger(o))):(e.primitiveFail(),null)}function k(){var f,r,o,l,i,u,s,n,c,a,h;return o=e.stackIntegerValue(0),s=e.stackIntegerValue(1),u=e.stackIntegerValue(2),h=e.stackFloatValue(3),c=e.stackFloatValue(4),r=e.stackValue(5),e.failed()?null:e.isWords(r)?t(r)!==o*s?(e.primitiveFail(),null):(n=0|c,a=0|h,i=u,i>1073741823&&(i=1073741823),0>i&&(i=0),f=r.words,n>=0&&s>n&&a>=0&&o>a&&(l=a*s+n,f[l]=i),e.failed()?null:void e.pop(6)):(e.primitiveFail(),null)}function g(){var v,f,d,n,a,p,u,i,c,l,h,o,s,m,r;if(u=e.stackValue(0),f=e.stackIntegerValue(1),a=e.stackIntegerValue(2),n=e.stackValue(3),r=e.stackValue(4),o=e.stackValue(5),e.failed())return null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(r))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(f*a!==t(n))return e.primitiveFail(),null;if(c=t(o),t(r)!==c)return e.primitiveFail(),null;if(t(u)!==c)return e.primitiveFail(),null;for(h=o.wordsAsFloat32Array(),m=r.wordsAsFloat32Array(),p=u.words,v=n.words,i=0;c-1>=i;i++)l=0|h[i],s=0|m[i],l>=0&&s>=0&&a>l&&f>s&&(d=s*a+l,p[i]=v[d]);return e.failed()?null:void e.pop(6)}function b(){var v,p,b,l,r,o,i,y,F,S,d,m,c,k,g,f,u,h,a;return v=e.stackIntegerValue(0),k=e.stackIntegerValue(1),m=e.stackIntegerValue(2),F=e.stackIntegerValue(3),p=e.stackFloatValue(4),b=e.stackFloatValue(5),g=e.stackFloatValue(6),o=e.stackValue(7),a=e.stackValue(8),u=e.stackValue(9),y=e.stackIntegerValue(10),e.failed()?null:e.isWords(u)&&e.isWords(a)&&e.isWords(o)?(c=t(u),t(a)!==c?(e.primitiveFail(),null):t(o)!==c?(e.primitiveFail(),null):(f=u.wordsAsFloat32Array(),h=a.wordsAsFloat32Array(),r=o.wordsAsFloat32Array(),l=g,i=y-1,S=f[i]+l*Math.cos(r[i]),d=h[i]-l*Math.sin(r[i]),n(i,f,r,S,b,F,m),s(i,h,r,d,p,k,v),e.failed()?null:void e.pop(11))):(e.primitiveFail(),null)}function y(){var b,p,k,o,u,i,v,r,c,h,s,d,f,m,l,a,g,n;if(s=e.stackValue(0),p=e.stackIntegerValue(1),u=e.stackIntegerValue(2),o=e.stackValue(3),n=e.stackValue(4),l=e.stackValue(5),e.failed())return null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(!e.isWords(o))return e.primitiveFail(),null;if(p*u!==t(o))return e.primitiveFail(),null;if(c=t(l),t(n)!==c)return e.primitiveFail(),null;if(r="number"==typeof s,r&&(v=s),!r){if(!e.isMemberOf(s,"WordArray"))return e.primitiveFail(),null;if(t(s)!==c)return e.primitiveFail(),null}for(m=l.wordsAsFloat32Array(),g=n.wordsAsFloat32Array(),r||(d=s.words),b=o.words,r&&(h=v),i=0;c-1>=i;i++)f=0|m[i],a=0|g[i],f>=0&&a>=0&&u>f&&p>a&&(k=a*u+f,r||(h=d[i]),b[k]=h);return e.failed()?null:void e.pop(6)}function F(){var y,O,v,p,o,c,i,a,F,S,I,m,u,k,g,b,r,h,l,d,f;if(y=e.stackIntegerValue(0),k=e.stackIntegerValue(1),m=e.stackIntegerValue(2),F=e.stackIntegerValue(3),O=e.stackFloatValue(4),v=e.stackFloatValue(5),r=e.stackValue(6),c=e.stackValue(7),f=e.stackValue(8),l=e.stackValue(9),e.failed())return null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(f))return e.primitiveFail(),null;if(!e.isWords(c))return e.primitiveFail(),null;if(r.isFloat)a=!1;else{if(!e.isWords(r))return e.primitiveFail(),null;a=!0}if(u=t(l),t(f)!==u)return e.primitiveFail(),null;if(t(c)!==u)return e.primitiveFail(),null;if(a&&t(r)!==u)return e.primitiveFail(),null;for(h=l.wordsAsFloat32Array(),d=f.wordsAsFloat32Array(),o=c.wordsAsFloat32Array(),a?b=r.wordsAsFloat32Array():g=e.floatValueOf(r),i=0;u-1>=i;i++)p=a?b[i]:g,S=h[i]+p*Math.cos(o[i]),I=d[i]-p*Math.sin(o[i]),n(i,h,o,S,v,F,m),s(i,d,o,I,O,k,y);return e.failed()?null:void e.pop(10)}function S(){var m,f,I,O,u,d,l,S,F,y,o,A,v,k,g,b,h,r,i,s,a,n;if(o=e.stackIntegerValue(0),u=e.stackIntegerValue(1),s=e.stackIntegerValue(2),f=e.stackValue(3),k=e.stackFloatValue(4),b=e.stackFloatValue(5),g=e.stackFloatValue(6),e.failed())return null;if(!e.isWords(f))return e.primitiveFail(),null;if(t(f)!==u*s)return e.primitiveFail(),null;for(m=f.words,r=g,i=b,r=Math.max(r,0),i=Math.max(i,0),r=Math.min(r,s-1),i=Math.min(i,u-1),A=Math.max(r-o,0),I=Math.min(r+o,s-1),v=Math.max(i-o,0),O=Math.min(i+o,u-1),d=m[i*s+r],l=-1,n=v;O>=n;n++)for(y=n*s,a=A;I>=a;a++)h=m[y+a],h>d&&(l=a,S=n,d=h);return F=-1===l?p(k):c(l-r,S-i)+90|0,e.failed()?null:(e.pop(8),void e.pushFloat(F))}function O(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]+f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]+h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]+f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]+h[i];e.pop(4),e.push(r)}function I(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]+h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]+u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]+h; else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]+u;e.pop(4),e.push(r)}function A(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]/f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]/h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/h[i];e.pop(4),e.push(r)}function P(){var n,l,h,o,i,p,f,d,u,s,r,c,m;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(u=t(s),e.success(u===t(r)),e.failed())return null;if(f="number"==typeof n,d=e.isMemberOf(s,"WordArray"),f&&d){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(d)if(f)for(c=s.words,p=n,m=r.words,i=0;u-1>=i;i++)m[i]=a(c[i],p);else for(c=s.words,l=e.floatValueOf(n),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=c[i]/l;else if(f)for(h=s.wordsAsFloat32Array(),p=n,o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/p;else for(h=s.wordsAsFloat32Array(),l=e.floatValueOf(n),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/l;e.pop(4),e.push(r)}function w(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]*f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]*h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*h[i];e.pop(4),e.push(r)}function C(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]*h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]*u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*u;e.pop(4),e.push(r)}function st(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]-f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]-h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]-f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]-h[i];e.pop(4),e.push(r)}function j(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]-h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]-u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]-h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]-u;e.pop(4),e.push(r)}function p(i){var e,t;return t=i/.0174532925199433,e=90-t,e>0||(e+=360),e}function q(){var a,o,i,r,s,u,l,n;if(a=e.stackFloatValue(0),i=e.stackValue(1),n=e.stackIntegerValue(2),r=e.stackIntegerValue(3),u=e.stackIntegerValue(4),e.failed())return null;if(!e.isWords(i))return e.primitiveFail(),null;if(l=t(i),!(l>=n&&r>=1&&n>=r))return e.primitiveFail(),null;if(o=i.wordsAsFloat32Array(),e.failed())return null;for(s=r;n>=s;s++)o[s-1]=f(u)*a;e.pop(5)}function M(){var a,i,r,o,s,u,l,n;if(a=e.stackFloatValue(0),s=e.stackValue(1),n=e.stackIntegerValue(2),i=e.stackIntegerValue(3),u=e.stackIntegerValue(4),e.failed())return null;if(!e.isWords(s))return e.primitiveFail(),null;if(l=t(s),!(l>=n&&i>=1&&n>=i))return e.primitiveFail(),null;if(o=s.words,e.failed())return null;for(r=i;n>=r;r++)o[r-1]=f(u)*a|0;e.pop(5)}function B(){var t,i;return t=e.stackIntegerValue(0),e.failed()?null:(i=f(t),e.failed()?null:(e.pop(2),void e.pushInteger(i)))}function _(){var i,r,t,s,n,a,o;return r=e.stackFloatValue(0),i=e.stackFloatValue(1),n=e.stackFloatValue(2),s=e.stackFloatValue(3),e.failed()?null:(a=s-i,o=n-r,t=c(a,o),t+=90,t>360&&(t-=360),e.failed()?null:(e.pop(5),void e.pushFloat(t)))}function N(){var r,s,n,a,o,t,i;return s=e.stackFloatValue(0),r=e.stackFloatValue(1),o=e.stackFloatValue(2),a=e.stackFloatValue(3),e.failed()?null:(t=r-a,i=s-o,n=Math.sqrt(t*t+i*i),e.failed()?null:(e.pop(5),void e.pushFloat(n)))}function n(r,o,s,u,i,n,a){var t,e;e=u,0>e&&(1===n&&(e+=i),2===n&&(e=0),3===n&&(e=0-e,t=s[r],s[r]=3.141592653589793>t?3.141592653589793-t:9.42477796076938-t)),e>=i&&(1===a&&(e-=i),2===a&&(e=i-1e-6),3===a&&(e=i-1e-6-(e-i),t=s[r],s[r]=3.141592653589793>t?3.141592653589793-t:9.42477796076938-t)),o[r]=e}function s(i,a,r,o,t,s,n){var e;e=o,0>e&&(1===s&&(e+=t),2===s&&(e=0),3===s&&(e=0-e,r[i]=6.283185307179586-r[i])),e>=t&&(1===n&&(e-=t),2===n&&(e=t-1e-6),3===n&&(e=t-1e-6-(e-t),r[i]=6.283185307179586-r[i])),a[i]=e}function T(){var i,l,n,s,a,c,r,u;if(r=e.stackValue(0),n=e.stackValue(1),e.failed())return null;if(!e.isWords(n))return e.primitiveFail(),null;if(u=t(n),r.isFloat)a=!1;else{if(!e.isWords(r))return e.primitiveFail(),null;if(t(r)!==u)return e.primitiveFail(),null;a=!0}for(l=n.wordsAsFloat32Array(),a?c=r.wordsAsFloat32Array():(i=e.floatValueOf(r),i=o(i)),s=0;u-1>=s;s++)a&&(i=c[s],i=o(i)),l[s]=i;return e.failed()?null:void e.pop(2)}function L(i){var t;return e=i,t=e.majorVersion()==Y,t===!1?!1:t=e.minorVersion()>=Z}function R(){var s,n,i,r;return s=e.stackFloatValue(0),i=e.stackValue(1),r=e.stackIntegerValue(2),e.failed()?null:e.isWords(i)?t(i)=r;r++)l=s?p[r]:h,n(r,m,c,l,f,d,v);return e.failed()?null:void e.pop(6)}function U(){var v,c,d,u,r,n,l,a,f,h,p,i,m,o;if(v=e.stackIntegerValue(0),f=e.stackIntegerValue(1),c=e.stackFloatValue(2),i=e.stackValue(3),u=e.stackValue(4),o=e.stackValue(5),e.failed())return null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(i.isFloat)n=!1;else{if(!e.isWords(i))return e.primitiveFail(),null;n=!0}if(a=t(o),t(u)!==a)return e.primitiveFail(),null;if(n&&t(i)!==a)return e.primitiveFail(),null;for(m=o.wordsAsFloat32Array(),d=u.wordsAsFloat32Array(),n?p=i.wordsAsFloat32Array():h=e.floatValueOf(i),r=0;a-1>=r;r++)l=n?p[r]:h,s(r,m,d,l,c,f,v);return e.failed()?null:void e.pop(6)}function J(){var i,n,k,a,d,s,p,h,u,y,o,r,m,v,f,g,b,l;if(o=e.stackValue(0),l=e.stackValue(1),f=e.stackValue(2),s=e.stackValue(3),a=e.stackValue(4),e.failed())return null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(f))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(r=t(o),0>r)return e.primitiveFail(),null;if(t(f)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;if(a.isFloat){if(!s.isFloat)return e.primitiveFail(),null;n=!1}else{if(s.isFloat)return e.primitiveFail(),null;n=!0}if(n){if(t(a)!==r)return e.primitiveFail(),null;if(t(s)!==r)return e.primitiveFail(),null}for(y=o.wordsAsFloat32Array(),v=f.wordsAsFloat32Array(),b=l.wordsAsFloat32Array(),n&&(k=a.wordsAsFloat32Array(),d=s.wordsAsFloat32Array()),n||(p=e.floatValueOf(a),h=e.floatValueOf(s)),i=0;r-1>=i;i++)n&&(p=k[i],h=d[i]),m=p-v[i],g=h-b[i],u=c(m,g),u+=90,u>360&&(u-=360),y[i]=u;return e.failed()?null:(e.pop(6),void e.push(o))}function H(){var i,n,v,a,d,s,f,c,g,o,r,h,m,u,p,k,l;if(o=e.stackValue(0),l=e.stackValue(1),u=e.stackValue(2),s=e.stackValue(3),a=e.stackValue(4),e.failed())return null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(r=t(o),0>r)return e.primitiveFail(),null;if(t(u)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;if(a.isFloat){if(!s.isFloat)return e.primitiveFail(),null;n=!1}else{if(s.isFloat)return e.primitiveFail(),null;n=!0}if(n){if(t(a)!==r)return e.primitiveFail(),null;if(t(s)!==r)return e.primitiveFail(),null}for(g=o.wordsAsFloat32Array(),m=u.wordsAsFloat32Array(),k=l.wordsAsFloat32Array(),n&&(v=a.wordsAsFloat32Array(),d=s.wordsAsFloat32Array()),n||(f=e.floatValueOf(a),c=e.floatValueOf(s)),i=0;r-1>=i;i++)n&&(f=v[i],c=d[i]),h=f-m[i],p=c-k[i],g[i]=Math.sqrt(h*h+p*p);return e.failed()?null:(e.pop(6),void e.push(o))}function X(){var b,v,h,p,g,o,u,k,r,n,i,s,d,m,f,l,a,c;if(c=e.stackIntegerValue(0),l=e.stackIntegerValue(1),u=e.stackIntegerValue(2),r=e.stackIntegerValue(3),h=e.stackValue(4),n=e.stackValue(5),e.failed())return null;if(d=t(n),g=t(h),r*u!==d)return e.primitiveFail(),null;if(d*l*c!==g)return e.primitiveFail(),null;for(k=n.words,v=h.words,i=0,s=0,p=0,f=0;u-1>=f;f++){for(a=0;c-1>=a;a++){for(m=0;r-1>=m;m++)for(b=k[i],++i,o=0;l-1>=o;o++)v[p]=b,++p;i=s}s+=r,i=s}e.pop(6)}var Y=1,Z=11,e=null,i=0,et="KedamaPlugin 3 November 2014 (e)",r=0,u=0,l=0,d=0;Squeak.registerExternalModule("KedamaPlugin",{makeMaskLog:V,vectorGetDistanceTo:H,getScalarHeading:Q,shutdownModule:E,primitiveAddScalar:I,primSetPixelsAtXY:y,turtleScalarSetX:K,primPixelAtXY:W,primUpHill:S,primScalarForward:b,primitiveDivArrays:A,getModuleName:$,primitiveSubArrays:st,scalarGetAngleTo:_,randomRange:B,setInterpreter:L,kedamaSetRandomSeed:m,drawTurtlesInArray:it,turtleScalarSetY:z,randomIntoIntegerArray:M,getHeadingArrayInto:tt,makeTurtlesMap:v,setHeadingArrayFrom:T,turtlesSetX:G,setScalarHeading:R,makeMask:x,primitiveDivScalar:P,primitiveSubScalar:j,primPixelsAtXY:g,vectorGetAngleTo:J,primitiveMulArrays:w,primPixelAtXYPut:k,zoomBitmap:X,initialiseModule:D,primitiveAddArrays:O,scalarGetDistanceTo:N,turtlesSetY:U,randomIntoFloatArray:q,primTurtlesForward:F,primitiveMulScalar:C})}),module("users.bert.SqueakJS.plugins.KedamaPlugin2").requires("users.bert.SqueakJS.vm").toRun(function(){function t(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function s(e,t){return 0|Math.floor(e/t)}function a(e,t){return e-s(e,t)*t|0}function Pt(t,e){return 0>e?-31>e?0:t>>>0-e:e>31?0:t<=0?90:270:(r=i/t,e=Math.atan(r),t>=0?i>=0?e/.0174532925199433:360+e/.0174532925199433:180+e/.0174532925199433)}function l(i){var e,r,t;return e=90-i,t=e/360|0,0>e&&--t,r=.0174532925199433*(e-360*t)}function At(){var d,v,o,p,h,n,a,i,r,b,k,l,c,m,s,f,g,u;if(l=e.stackValue(0),o=e.stackValue(1),u=e.stackValue(2),s=e.stackValue(3),h=e.stackIntegerValue(4),a=e.stackIntegerValue(5),n=e.stackValue(6),e.failed())return null;if(!e.isWords(n))return e.primitiveFail(),null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isBytes(l))return e.primitiveFail(),null;if(h*a!==t(n))return e.primitiveFail(),null;if(r=t(s),t(u)!==r)return e.primitiveFail(),null;if(t(o)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;for(m=s.wordsAsFloat32Array(),g=u.wordsAsFloat32Array(),v=o.words,k=l.bytes,p=n.words,i=0;r-1>=i;i++)c=0|m[i],f=0|g[i],b=k[i],0!==b&&c>=0&&f>=0&&a>c&&h>f&&(d=f*a+c,p[d]=v[i]);return e.failed()?null:void e.pop(7)}function It(){var i,o,s,r,u,n,a;if(n=e.stackValue(0),s=e.stackValue(1),e.failed())return null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(a=t(s),t(n)!==a)return e.primitiveFail(),null;for(o=s.wordsAsFloat32Array(),u=n.wordsAsFloat32Array(),r=0;a-1>=r;r++)i=o[r],i/=.0174532925199433,i=90-i,i>0||(i+=360),u[r]=i;return e.failed()?null:void e.pop(2)}function St(){return Ot}function Ft(){var i,n,r,s;return r=e.stackValue(0),s=e.stackIntegerValue(1),e.failed()?null:e.isWords(r)?t(r)e?0-e:e,r=s(i,h),n=a(i,h),i=o*n-d*r,l=65535&i,t=l*(u+1)>>>16,0>e?0-t:t}function at(){var t;return t=e.stackIntegerValue(0),e.failed()?null:(i=65536&t,void e.pop(1))}function et(){var i,c,u,n,a,l,r,f,o,h,p,s;if(s=e.stackIntegerValue(0),p=e.stackIntegerValue(1),o=e.stackValue(2),n=e.stackValue(3),e.failed())return null;if(a=t(n),h=t(o),a!==h)return e.primitiveFail(),null;if(-32>s)return e.primitiveFail(),null;if(s>8)return e.primitiveFail(),null;for(c=n.words,f=o.words,l=4278190080,r=0;a-1>=r;r++)u=c[r],i=Pt(u,s),i>255&&(i=255),0>i&&(i=0),f[r]=i<<24&l|p;e.pop(4)}function R(){var r,l,s,n,a,c,i,v,o,f,h,p,d,m,u;if(m=e.stackValue(0),u=e.stackIntegerValue(1),o=e.stackValue(2),n=e.stackValue(3),e.failed())return null;if(p=m.words,h=p[0],e.failed())return null;if(d=Math.log(h),a=t(n),f=t(o),a!==f)return e.primitiveFail(),null;for(l=n.words,v=o.words,c=4278190080,i=0;a-1>=i;i++)s=l[i],r=0===s?0:255/d*Math.log(s)|0,r>255&&(r=255),v[i]=r<<24&c|u;e.pop(4)}function v(){var u,i,f,n,a,o,h,s,r,p,d,l,m,v,c;if(u=e.stackIntegerValue(0),r=e.stackIntegerValue(1),c=e.stackValue(2),l=e.stackValue(3),s=e.stackValue(4),a=e.stackValue(5),!e.isWords(c))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(s))return e.primitiveFail(),null;if(!e.isWords(a))return e.primitiveFail(),null;if(o=t(s),t(l)!==o)return e.primitiveFail(),null;if(t(c)!==o)return e.primitiveFail(),null;if(t(a)!==u*r)return e.primitiveFail(),null;for(d=l.wordsAsFloat32Array(),v=c.wordsAsFloat32Array(),h=s.words,f=a.words,i=0;u*r-1>=i;i++)f[i]=0;for(i=0;o-1>=i;i++)p=d[i],m=v[i],n=r*m+p,n>=0&&u*r>n&&(f[n]=h[i]);return e.failed()?null:void e.pop(6)}function H(){var u,i,a,l,o,r,s,c,n,f;return a=e.stackIntegerValue(0),r=e.stackIntegerValue(1),f=e.stackFloatValue(2),c=e.stackFloatValue(3),i=e.stackValue(4),e.failed()?null:e.isWords(i)?t(i)!==a*r?(e.primitiveFail(),null):(s=0|c,n=0|f,u=i.words,s>=0&&r>s&&n>=0&&a>n?(l=n*r+s,o=u[l]):o=0,e.failed()?null:(e.pop(6),void e.pushInteger(o))):(e.primitiveFail(),null)}function k(){var f,r,o,l,i,u,s,n,c,a,h;return o=e.stackIntegerValue(0),s=e.stackIntegerValue(1),u=e.stackIntegerValue(2),h=e.stackFloatValue(3),c=e.stackFloatValue(4),r=e.stackValue(5),e.failed()?null:e.isWords(r)?t(r)!==o*s?(e.primitiveFail(),null):(n=0|c,a=0|h,i=u,i>1073741823&&(i=1073741823),0>i&&(i=0),f=r.words,n>=0&&s>n&&a>=0&&o>a&&(l=a*s+n,f[l]=i),e.failed()?null:void e.pop(6)):(e.primitiveFail(),null)}function g(){var v,f,d,n,a,p,u,i,c,l,h,o,s,m,r;if(u=e.stackValue(0),f=e.stackIntegerValue(1),a=e.stackIntegerValue(2),n=e.stackValue(3),r=e.stackValue(4),o=e.stackValue(5),e.failed())return null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(r))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(f*a!==t(n))return e.primitiveFail(),null;if(c=t(o),t(r)!==c)return e.primitiveFail(),null;if(t(u)!==c)return e.primitiveFail(),null;for(h=o.wordsAsFloat32Array(),m=r.wordsAsFloat32Array(),p=u.words,v=n.words,i=0;c-1>=i;i++)l=0|h[i],s=0|m[i],l>=0&&s>=0&&a>l&&f>s&&(d=s*a+l,p[i]=v[d]);return e.failed()?null:void e.pop(6)}function b(){var v,p,b,l,s,o,i,y,F,S,d,m,c,k,g,f,u,h,a;return v=e.stackIntegerValue(0),k=e.stackIntegerValue(1),m=e.stackIntegerValue(2),F=e.stackIntegerValue(3),p=e.stackFloatValue(4),b=e.stackFloatValue(5),g=e.stackFloatValue(6),o=e.stackValue(7),a=e.stackValue(8),u=e.stackValue(9),y=e.stackIntegerValue(10),e.failed()?null:e.isWords(u)&&e.isWords(a)&&e.isWords(o)?(c=t(u),t(a)!==c?(e.primitiveFail(),null):t(o)!==c?(e.primitiveFail(),null):(f=u.wordsAsFloat32Array(),h=a.wordsAsFloat32Array(),s=o.wordsAsFloat32Array(),l=g,i=y-1,S=f[i]+l*Math.cos(s[i]),d=h[i]-l*Math.sin(s[i]),n(i,f,s,S,b,F,m),r(i,h,s,d,p,k,v),e.failed()?null:void e.pop(11))):(e.primitiveFail(),null)}function y(){var n,d,f,h,a,S,F,i,I,k,m,b,p,s,v,r,g,c,y,u,o,O,l;if(r=e.stackValue(0),d=e.stackIntegerValue(1),a=e.stackIntegerValue(2),h=e.stackValue(3),l=e.stackValue(4),u=e.stackValue(5),p=e.stackValue(6),e.failed())return null;if(!e.isBytes(p))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(h))return e.primitiveFail(),null;if(d*a!==t(h))return e.primitiveFail(),null;if(s=t(u),t(p)!==s)return e.primitiveFail(),null;if(t(l)!==s)return e.primitiveFail(),null;if(b=p.bytes,y=u.wordsAsFloat32Array(),O=l.wordsAsFloat32Array(),k="number"==typeof r)I=r,v=I;else{if(t(r)!==s)return e.primitiveFail(),null;m=e.isMemberOf(r,"WordArray"),m?g=r.words:S=r.wordsAsFloat32Array()}for(n=h.words,i=0;s-1>=i;i++)1===b[i]&&(c=0|y[i],o=0|O[i],c>=0&&o>=0&&a>c&&d>o&&(f=o*a+c,k?n[f]=v:m?n[f]=g[i]:(F=S[i],n[f]=F)));return e.failed()?null:void e.pop(7)}function F(){var g,A,v,d,o,h,i,u,S,O,I,P,l,k,s,b,y,F,a,p,c,m,f;if(g=e.stackIntegerValue(0),b=e.stackIntegerValue(1),k=e.stackIntegerValue(2),S=e.stackIntegerValue(3),A=e.stackFloatValue(4),v=e.stackFloatValue(5),a=e.stackValue(6),h=e.stackValue(7),f=e.stackValue(8),c=e.stackValue(9),l=e.stackValue(10),e.failed())return null;if(!e.isBytes(l))return e.primitiveFail(),null;if(!e.isWords(c))return e.primitiveFail(),null;if(!e.isWords(f))return e.primitiveFail(),null;if(!e.isWords(h))return e.primitiveFail(),null;if(a.isFloat)u=!1;else{if(!e.isWords(a))return e.primitiveFail(),null;u=!0}if(s=t(c),t(f)!==s)return e.primitiveFail(),null;if(t(h)!==s)return e.primitiveFail(),null;if(t(l)!==s)return e.primitiveFail(),null;if(u&&t(a)!==s)return e.primitiveFail(),null;for(P=l.bytes,p=c.wordsAsFloat32Array(),m=f.wordsAsFloat32Array(),o=h.wordsAsFloat32Array(),u?F=a.wordsAsFloat32Array():y=e.floatValueOf(a),i=0;s-1>=i;i++)1===P[i]&&(d=u?F[i]:y,O=p[i]+d*Math.cos(o[i]),I=m[i]-d*Math.sin(o[i]),n(i,p,o,O,v,S,k),r(i,m,o,I,A,b,g));return e.failed()?null:void e.pop(11)}function S(){var m,f,I,O,u,d,l,S,F,y,o,A,v,k,g,b,h,r,i,s,a,n;if(o=e.stackIntegerValue(0),u=e.stackIntegerValue(1),s=e.stackIntegerValue(2),f=e.stackValue(3),k=e.stackFloatValue(4),b=e.stackFloatValue(5),g=e.stackFloatValue(6),e.failed())return null;if(!e.isWords(f))return e.primitiveFail(),null;if(t(f)!==u*s)return e.primitiveFail(),null;for(m=f.words,r=g,i=b,r=Math.max(r,0),i=Math.max(i,0),r=Math.min(r,s-1),i=Math.min(i,u-1),A=Math.max(r-o,0),I=Math.min(r+o,s-1),v=Math.max(i-o,0),O=Math.min(i+o,u-1),d=m[i*s+r],l=-1,n=v;O>=n;n++)for(y=n*s,a=A;I>=a;a++)h=m[y+a],h>d&&(l=a,S=n,d=h);return F=-1===l?p(k):c(l-r,S-i)+90|0,e.failed()?null:(e.pop(8),void e.pushFloat(F))}function O(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]+f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]+h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]+f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]+h[i];e.pop(4),e.push(r)}function I(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]+h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]+u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]+h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]+u;e.pop(4),e.push(r)}function A(){var i,n,a,o,l,r,u,s;if(r=e.stackObjectValue(0),s=e.stackValue(1),e.failed())return null;if(e.success(e.isBytes(s)),e.success(e.isBytes(r)),e.failed())return null;if(a=t(s),o=t(r),e.failed())return null;for(n=a,a>o&&(n=o),l=r.bytes,u=s.bytes,i=0;n-1>=i;i++)u[i]=u[i]+l[i]===2;e.pop(1)}function P(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]/f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]/h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/h[i];e.pop(4),e.push(r)}function w(){var a,l,h,o,i,p,f,d,u,n,r,c,m;if(r=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(u=t(n),e.success(u===t(r)),e.failed())return null;if(f="number"==typeof a,d=e.isMemberOf(n,"WordArray"),f&&d){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(d)if(f)for(c=n.words,p=a,m=r.words,i=0;u-1>=i;i++)m[i]=s(c[i],p);else for(c=n.words,l=e.floatValueOf(a),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=c[i]/l;else if(f)for(h=n.wordsAsFloat32Array(),p=a,o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/p;else for(h=n.wordsAsFloat32Array(),l=e.floatValueOf(a),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/l;e.pop(4),e.push(r)}function C(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]===f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]===u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]===f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]===u[i];e.pop(4),e.push(a)}function V(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]===f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]===u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]===f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]===u;e.pop(4),e.push(s)}function j(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]>=f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]>=u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]>=f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]>=u[i];e.pop(4),e.push(a)}function x(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]>=f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]>=u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]>=f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]>=u;e.pop(4),e.push(s)}function q(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]>f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]>u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]>f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]>u[i];e.pop(4),e.push(a)}function M(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]>f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]>u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]>f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]>u;e.pop(4),e.push(s)}function B(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]<=f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]<=u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]<=f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]<=u[i];e.pop(4),e.push(a)}function _(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]<=f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]<=u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]<=f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]<=u;e.pop(4),e.push(s)}function N(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]=i;i++)s[i]=c[i]=i;i++)s[i]=l[i]=i;i++)s[i]=l[i]=i;i++)r[i]=c[i]=i;i++)r[i]=c[i]=i;i++)r[i]=l[i]=i;i++)r[i]=l[i]=i;i++)d[i]=u[i]*f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]*h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*h[i];e.pop(4),e.push(r)}function T(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]*h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]*u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*u;e.pop(4),e.push(r)}function L(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]!==f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]!==u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]!==f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]!==u[i];e.pop(4),e.push(a)}function wt(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]!==f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]!==u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]!==f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]!==u;e.pop(4),e.push(s)}function E(){var i,n,s,r;if(r=e.stackValue(0),e.failed())return null;if(e.success(e.isBytes(r)),e.failed())return null;if(n=t(r),e.failed())return null;for(s=r.bytes,i=0;n-1>=i;i++)s[i]=0===s[i]?1:0}function K(){var i,n,a,o,l,r,u,s;if(r=e.stackObjectValue(0),s=e.stackValue(1),e.failed())return null;if(e.success(e.isBytes(s)),e.success(e.isBytes(r)),e.failed())return null;if(a=t(s),o=t(r),e.failed())return null;for(n=a,a>o&&(n=o),l=r.bytes,u=s.bytes,i=0;n-1>=i;i++)u[i]=u[i]+l[i]>0;e.pop(1)}function z(){var i,o,n,a,u,r,l,s;if(r=e.stackValue(0),a=e.stackObjectValue(1),e.failed())return null;if(u=e.isIntegerValue(r)?r:e.booleanValueOf(r),s=e.fetchPointerofObject(1,a),n=e.fetchPointerofObject(0,a),e.failed())return null;if(!e.isBytes(n))return e.primitiveFail(),null;if(!e.isBytes(s))return e.primitiveFail(),null;for(l=s.bytes,o=n.bytes,i=0;i<=t(s)-1;i++)1===o[i]&&(l[i]=u);e.pop(1)}function G(){var i,o,n,a,r,u,s;if(r=e.stackIntegerValue(0),a=e.stackObjectValue(1),e.failed())return null;if(r=4278190080|r,s=e.fetchPointerofObject(1,a),n=e.fetchPointerofObject(0,a),e.failed())return null;if(!e.isBytes(n))return e.primitiveFail(),null;if(!e.isWords(s))return e.primitiveFail(),null;for(u=s.words,o=n.bytes,i=0;i<=t(s)-1;i++)1===o[i]&&(u[i]=r);e.pop(1)}function U(){var i,a,s,n,o,u,r;if(o=e.stackFloatValue(0),n=e.stackObjectValue(1),e.failed())return null;if(r=e.fetchPointerofObject(1,n),s=e.fetchPointerofObject(0,n),e.failed())return null;if(!e.isBytes(s))return e.primitiveFail(),null;if(!e.isWords(r))return e.primitiveFail(),null;for(u=r.wordsAsFloat32Array(),a=s.bytes,i=0;i<=t(r)-1;i++)1===a[i]&&(u[i]=o);e.pop(1)}function J(){var i,a,s,n,o,u,r;if(o=e.stackValue(0),n=e.stackObjectValue(1),e.failed())return null;if(r=e.fetchPointerofObject(1,n),s=e.fetchPointerofObject(0,n),e.failed())return null;if(!e.isBytes(s))return e.primitiveFail(),null;if(!e.isPointers(r))return e.primitiveFail(),null;for(u=r.wordsAsInt32Array(),a=s.bytes,i=0;i<=t(r)-1;i++)1===a[i]&&(u[i]=o);e.pop(1)}function m(){var r,d,a,h,l,o,n,m,c,i,s,p,u,f;if(n=e.stackIntegerValue(0),o=e.stackObjectValue(1),s=e.stackIntegerValue(2),i=e.stackIntegerValue(3),l=e.stackObjectValue(4),e.failed())return null;if(u=e.fetchPointerofObject(1,l),a=e.fetchPointerofObject(0,l),e.failed())return null;if(!e.isBytes(a))return e.primitiveFail(),null;if(!e.isBytes(u)||!e.isBytes(o))return e.primitiveFail(),null;if(p=u.bytes,d=a.bytes,m=o.bytes,f=t(u),h=t(a),c=t(o),i>s)return e.primitiveFail(),null;if(1>i)return e.primitiveFail(),null;if(i>f)return e.primitiveFail(),null;if(i>h)return e.primitiveFail(),null;if(s>f)return e.primitiveFail(),null;if(s>h)return e.primitiveFail(),null;if(1>n)return e.primitiveFail(),null;if(n>c)return e.primitiveFail(),null;if(s-i+1>c-n+1)return e.primitiveFail(),null;for(r=i-1;s-1>=r;r++)1===d[r]&&(p[r]=m[n+r-i]);e.pop(4)}function X(){var d,f,y,i,u,m,g,l,k,s,o,p,v,r,a,c,h,n,b;if(o=e.stackIntegerValue(0),s=e.stackObjectValue(1),a=e.stackIntegerValue(2),r=e.stackIntegerValue(3),k=e.stackObjectValue(4),e.failed())return null;if(n=e.fetchPointerofObject(1,k),m=e.fetchPointerofObject(0,k),e.failed())return null;if(!e.isBytes(m))return e.primitiveFail(),null;if(!(e.isWords(n)&&e.isWords(s)||e.isPointers(n)&&e.isPointers(s)))return e.primitiveFail(),null;if(u=m.bytes,b=t(n),g=t(m),v=t(s),r>a)return e.primitiveFail(),null;if(1>r)return e.primitiveFail(),null;if(r>b)return e.primitiveFail(),null;if(r>g)return e.primitiveFail(),null;if(a>b)return e.primitiveFail(),null;if(a>g)return e.primitiveFail(),null;if(1>o)return e.primitiveFail(),null;if(o>v)return e.primitiveFail(),null;if(a-r+1>v-o+1)return e.primitiveFail(),null;if(c=e.isMemberOf(n,"KedamaFloatArray"),l=e.isMemberOf(s,"KedamaFloatArray"),c&&l)for(f=n.wordsAsFloat32Array(),d=s.wordsAsFloat32Array(),i=r-1;a-1>=i;i++)1===u[i]&&(f[i]=d[o+i-r]);if(c&&!l)for(f=n.wordsAsFloat32Array(),p=s.words,i=r-1;a-1>=i;i++)1===u[i]&&(f[i]=p[o+i-r]);if(!c&&l)for(h=n.words,d=s.wordsAsFloat32Array(),i=r-1;a-1>=i;i++)1===u[i]&&(y=d[o+i-r]>>>0,h[i]=y);if(!c&&!l)for(h=n.words,p=s.words,i=r-1;a-1>=i;i++)1===u[i]&&(h[i]=p[o+i-r]);e.pop(4)}function Y(){var n,l,f,r,v,m,c,i,d,b,u,o,s,h,p,y,g,k,F;if(s=e.stackObjectValue(0),n=e.stackObjectValue(1),o=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isWords(o)),e.success(e.isWords(s)),e.failed())return null;if(u=t(n),e.success(u===t(o)),e.success(u===t(s)),e.failed())return null;if(d=e.isMemberOf(n,"WordArray"),b=e.isMemberOf(o,"WordArray"),d&&b){if(!e.isMemberOf(s,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(s,"KedamaFloatArray"))return e.primitiveFail(),null;if(b)if(d)for(k=o.words,g=n.words,F=s.words,i=0;u-1>=i;i++)p=k[i],h=g[i],y=a(p,h),F[i]=y;else for(k=o.words,v=n.wordsAsFloat32Array(),c=s.wordsAsFloat32Array(),i=0;u-1>=i;i++)p=k[i],l=v[i],r=p/l,r=Math.floor(r),c[i]=p-r*l;else if(d)for(m=o.wordsAsFloat32Array(),g=n.words,c=s.wordsAsFloat32Array(),i=0;u-1>=i;i++)f=m[i],h=g[i],r=f/h,r=Math.floor(r),c[i]=f-r*h;else for(m=o.wordsAsFloat32Array(),v=n.wordsAsFloat32Array(),c=s.wordsAsFloat32Array(),i=0;u-1>=i;i++)f=m[i],l=v[i],r=f/l,r=Math.floor(r),c[i]=f-r*l;e.pop(4),e.push(s)}function Z(){var o,c,u,r,d,l,i,h,p,k,f,n,s,v,m,g;if(s=e.stackObjectValue(0),o=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isWords(s)),e.failed())return null;if(f=t(n),e.success(f===t(s)),e.failed())return null;if(p="number"==typeof o,k=e.isMemberOf(n,"WordArray"),p&&k){if(!e.isMemberOf(s,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(s,"KedamaFloatArray"))return e.primitiveFail(),null;if(k)if(p)for(m=n.words,h=o,g=s.words,i=0;f-1>=i;i++)g[i]=a(m[i],h);else for(m=n.words,c=e.floatValueOf(o),l=s.wordsAsFloat32Array(),i=0;f-1>=i;i++)v=m[i],r=v/c,r=Math.floor(r),l[i]=v-r*c;else if(p)for(d=n.wordsAsFloat32Array(),h=o,l=s.wordsAsFloat32Array(),i=0;f-1>=i;i++)u=d[i],r=u/h,r=Math.floor(r),l[i]=u-r*h;else for(d=n.wordsAsFloat32Array(),c=e.floatValueOf(o),l=s.wordsAsFloat32Array(),i=0;f-1>=i;i++)u=d[i],r=u/c,r=Math.floor(r),l[i]=u-r*c;e.pop(4),e.push(s)}function Q(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]-f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]-h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]-f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]-h[i];e.pop(4),e.push(r)}function $(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]-h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]-u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]-h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]-u;e.pop(4),e.push(r)}function p(i){var e,t;return t=i/.0174532925199433,e=90-t,e>0||(e+=360),e}function tt(){var a,o,i,r,s,u,l,n;if(a=e.stackFloatValue(0),i=e.stackValue(1),n=e.stackIntegerValue(2),r=e.stackIntegerValue(3),u=e.stackIntegerValue(4),e.failed())return null;if(!e.isWords(i))return e.primitiveFail(),null;if(l=t(i),!(l>=n&&r>=1&&n>=r))return e.primitiveFail(),null;if(o=i.wordsAsFloat32Array(),e.failed())return null;for(s=r;n>=s;s++)o[s-1]=f(u)*a;e.pop(5)}function it(){var a,i,r,o,s,u,l,n;if(a=e.stackFloatValue(0),s=e.stackValue(1),n=e.stackIntegerValue(2),i=e.stackIntegerValue(3),u=e.stackIntegerValue(4),e.failed())return null;if(!e.isWords(s))return e.primitiveFail(),null;if(l=t(s),!(l>=n&&i>=1&&n>=i))return e.primitiveFail(),null;if(o=s.words,e.failed())return null;for(r=i;n>=r;r++)o[r-1]=f(u)*a|0;e.pop(5)}function rt(){var t,i;return t=e.stackIntegerValue(0),e.failed()?null:(i=f(t),e.failed()?null:(e.pop(2),void e.pushInteger(i)))}function st(){var i,r,t,s,n,a,o;return r=e.stackFloatValue(0),i=e.stackFloatValue(1),n=e.stackFloatValue(2),s=e.stackFloatValue(3),e.failed()?null:(a=s-i,o=n-r,t=c(a,o),t+=90,t>360&&(t-=360),e.failed()?null:(e.pop(5),void e.pushFloat(t)))}function nt(){var r,s,n,a,o,t,i;return s=e.stackFloatValue(0),r=e.stackFloatValue(1),o=e.stackFloatValue(2),a=e.stackFloatValue(3),e.failed()?null:(t=r-a,i=s-o,n=Math.sqrt(t*t+i*i),e.failed()?null:(e.pop(5),void e.pushFloat(n)))}function n(r,o,s,u,i,n,a){var t,e;e=u,0>e&&(1===n&&(e+=i),2===n&&(e=0),3===n&&(e=0-e,t=s[r],s[r]=3.141592653589793>t?3.141592653589793-t:9.42477796076938-t)),e>=i&&(1===a&&(e-=i),2===a&&(e=i-1e-6),3===a&&(e=i-1e-6-(e-i),t=s[r],s[r]=3.141592653589793>t?3.141592653589793-t:9.42477796076938-t)),o[r]=e}function r(i,a,r,o,t,s,n){var e;e=o,0>e&&(1===s&&(e+=t),2===s&&(e=0),3===s&&(e=0-e,r[i]=6.283185307179586-r[i])),e>=t&&(1===n&&(e-=t),2===n&&(e=t-1e-6),3===n&&(e=t-1e-6-(e-t),r[i]=6.283185307179586-r[i])),a[i]=e}function ut(){var i,c,n,r,a,f,o,h,s,u;if(s=e.stackValue(0),n=e.stackValue(1),o=e.stackValue(2),e.failed())return null;if(!e.isBytes(o))return e.primitiveFail(),null;if(!e.isWords(n))return e.primitiveFail(),null;if(u=t(n),s.isFloat)a=!1;else{if(!e.isWords(s))return e.primitiveFail(),null;if(t(s)!==u)return e.primitiveFail(),null;a=!0}for(f=o.bytes,c=n.wordsAsFloat32Array(),a?h=s.wordsAsFloat32Array():(i=e.floatValueOf(s),i=l(i)),r=0;u-1>=r;r++)1===f[r]&&(a&&(i=h[r],i=l(i)),c[r]=i);return e.failed()?null:void e.pop(3)}function lt(i){var t;return e=i,t=e.majorVersion()==bt,t===!1?!1:t=e.minorVersion()>=yt}function ct(){var s,n,i,r;return s=e.stackFloatValue(0),i=e.stackValue(1),r=e.stackIntegerValue(2),e.failed()?null:e.isWords(i)?t(i)=r;r++)1===m[r]&&(k=s?c?g[r]:v[r]:f,n(r,b,h,k,y,d,p));return e.failed()?null:void e.pop(7)}function mt(){var y,h,k,u,s,n,c,p,m,o,a,d,f,v,i,g,b,l;if(y=e.stackIntegerValue(0),d=e.stackIntegerValue(1),h=e.stackFloatValue(2),i=e.stackValue(3),u=e.stackValue(4),l=e.stackValue(5),o=e.stackValue(6),e.failed())return null;if(!e.isBytes(o))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(i.isFloat)n=!1;else{if(!e.isWords(i))return e.primitiveFail(),null;n=!0,c=e.isMemberOf(i,"WordArray")}if(a=t(l),t(o)!==a)return e.primitiveFail(),null;if(t(u)!==a)return e.primitiveFail(),null;if(n&&t(i)!==a)return e.primitiveFail(),null;for(m=o.bytes,b=l.wordsAsFloat32Array(),k=u.wordsAsFloat32Array(),n?c?g=i.words:v=i.wordsAsFloat32Array():f=e.floatValueOf(i),s=0;a-1>=s;s++)1===m[s]&&(p=n?c?g[s]:v[s]:f,r(s,b,k,p,h,d,y));return e.failed()?null:void e.pop(7)}function vt(){var i,n,k,a,d,s,p,h,u,y,o,r,m,v,f,g,b,l;if(o=e.stackValue(0),l=e.stackValue(1),f=e.stackValue(2),s=e.stackValue(3),a=e.stackValue(4),e.failed())return null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(f))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(r=t(o),0>r)return e.primitiveFail(),null;if(t(f)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;if(a.isFloat){if(!s.isFloat)return e.primitiveFail(),null;n=!1}else{if(s.isFloat)return e.primitiveFail(),null;n=!0}if(n){if(t(a)!==r)return e.primitiveFail(),null;if(t(s)!==r)return e.primitiveFail(),null}for(y=o.wordsAsFloat32Array(),v=f.wordsAsFloat32Array(),b=l.wordsAsFloat32Array(),n&&(k=a.wordsAsFloat32Array(),d=s.wordsAsFloat32Array()),n||(p=e.floatValueOf(a),h=e.floatValueOf(s)),i=0;r-1>=i;i++)n&&(p=k[i],h=d[i]),m=p-v[i],g=h-b[i],u=c(m,g),u+=90,u>360&&(u-=360),y[i]=u;return e.failed()?null:(e.pop(6),void e.push(o))}function kt(){var i,n,v,a,d,s,f,c,g,o,r,h,m,u,p,k,l;if(o=e.stackValue(0),l=e.stackValue(1),u=e.stackValue(2),s=e.stackValue(3),a=e.stackValue(4),e.failed())return null;if(!e.isWords(o))return e.primitiveFail(),null;if(!e.isWords(u))return e.primitiveFail(),null;if(!e.isWords(l))return e.primitiveFail(),null;if(r=t(o),0>r)return e.primitiveFail(),null;if(t(u)!==r)return e.primitiveFail(),null;if(t(l)!==r)return e.primitiveFail(),null;if(a.isFloat){if(!s.isFloat)return e.primitiveFail(),null;n=!1}else{if(s.isFloat)return e.primitiveFail(),null;n=!0}if(n){if(t(a)!==r)return e.primitiveFail(),null;if(t(s)!==r)return e.primitiveFail(),null}for(g=o.wordsAsFloat32Array(),m=u.wordsAsFloat32Array(),k=l.wordsAsFloat32Array(),n&&(v=a.wordsAsFloat32Array(),d=s.wordsAsFloat32Array()),n||(f=e.floatValueOf(a),c=e.floatValueOf(s)),i=0;r-1>=i;i++)n&&(f=v[i],c=d[i]),h=f-m[i],p=c-k[i],g[i]=Math.sqrt(h*h+p*p);return e.failed()?null:(e.pop(6),void e.push(o))}function gt(){var b,v,h,p,g,o,u,k,r,n,i,s,d,m,f,l,a,c;if(c=e.stackIntegerValue(0),l=e.stackIntegerValue(1),u=e.stackIntegerValue(2),r=e.stackIntegerValue(3),h=e.stackValue(4),n=e.stackValue(5),e.failed())return null;if(d=t(n),g=t(h),r*u!==d)return e.primitiveFail(),null;if(d*l*c!==g)return e.primitiveFail(),null;for(k=n.words,v=h.words,i=0,s=0,p=0,f=0;u-1>=f;f++){for(a=0;c-1>=a;a++){for(m=0;r-1>=m;m++)for(b=k[i],++i,o=0;l-1>=o;o++)v[p]=b,++p;i=s}s+=r,i=s}e.pop(6)}var bt=1,yt=11,e=null,i=0,Ot="KedamaPlugin2 13 November 2014 (e)",o=0,u=0,h=0,d=0;Squeak.registerExternalModule("KedamaPlugin2",{primitiveAddArrays:O,getModuleName:St,primitiveMulArrays:D,drawTurtlesInArray:At,primitiveGTScalar:M,setScalarHeading:ct,primitiveSubScalar:$,turtleScalarSetY:pt,vectorGetAngleTo:vt,primitiveRemArrays:Y,primitiveLTArrays:N,primitiveAddScalar:I,primPixelsAtXY:g,primitiveMulScalar:T,primSetPixelsAtXY:y,setHeadingArrayFrom:ut,primPixelAtXYPut:k,makeMaskLog:R,primitiveLTScalar:W,scalarGetAngleTo:st,primitiveOrByteArray:K,primitiveLEArrays:B,primitiveRemScalar:Z,getHeadingArrayInto:It,turtlesSetX:dt,primitivePredicateReplaceBytes:m,primitiveDivArrays:P,makeMask:et,primitiveLEScalar:_,kedamaSetRandomSeed:at,randomIntoIntegerArray:it,setInterpreter:lt,primitivePredicateAtAllPutColor:G,makeTurtlesMap:v,randomIntoFloatArray:tt,primUpHill:S,shutdownModule:ft,primitiveDivScalar:w,primitiveGEArrays:j,primitiveNotByteArray:E,randomRange:rt,initialiseModule:ot,getScalarHeading:Ft,primPixelAtXY:H,primitivePredicateAtAllPutNumber:U,primitiveEQArrays:C,primitiveNEArrays:L,primScalarForward:b,vectorGetDistanceTo:kt,turtlesSetY:mt,turtleScalarSetX:ht,primTurtlesForward:F,primitiveGEScalar:x,primitiveAndByteArray:A,primitivePredicateReplaceWords:X,primitiveGTArrays:q,primitivePredicateAtAllPutObject:J,primitiveEQScalar:V,primitivePredicateAtAllPutBoolean:z,zoomBitmap:gt,primitiveNEScalar:wt,scalarGetDistanceTo:nt,primitiveSubArrays:Q})}),module("users.bert.SqueakJS.plugins.Klatt").requires("users.bert.SqueakJS.vm").toRun(function(){function Pt(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function Lt(e,t){return 0|Math.floor(e/t)}function _(e,t){return e-Lt(e,t)*t|0}function Ni(){0!==_(v,2)&&(r*=1-t[B],r>0&&(r=0))}function _i(){var i,r,s,n,e;e=I/f,i=Math.sin(2*h*12.7*e),r=Math.sin(2*h*7.1*e),s=Math.sin(2*h*4.7*e),n=2*t[Dt]*t[g]/100*(i+r+s),l+=n}function Bi(){0===_(v,2)?l+=t[B]*t[g]*(1-t[w]):l-=t[B]*t[g]*(1-t[w])}function Mi(){l+=(O()-32767)*t[Nt]/32768*t[g]}function qi(){r+=(O()-32767)*t[fi]/32768*r,r>0&&(r=0)}function L(n,a,o){var e,r,t,i,s;r=(0-h)/f*o,s=Math.exp(r),i=0-s*s,r=2*h/f*a,t=s*Math.cos(r)*2,e=1-t-i,e=1/e,t=(0-t)*e,i=(0-i)*e,j(n,e),E(n,t),z(n,i)}function At(e,t){var i,r;return i=x(e)*t+R(e)*(r=X(e))+K(e)*St(e),It(e,r),yt(e,t),i}function xi(t){var e;return n>0?(e=At(Y,t),e=i(Q,e),e=At(G,e),e=i(J,e),n>=8&&(e=i($,e)),n>=7&&(e=i(et,e)),n>=6&&(e=i(it,e)),n>=5&&(e=i(at,e)),n>=4&&(e=i(ft,e)),n>=3&&(e=i(dt,e)),n>=2&&(e=i(bt,e)),n>=1&&(e=i(Vt,e)),e):0}function xt(t){return e.success(e.isWords(t)),e.failed()?0:t.wordsAsFloat32Array()}function ji(t){return e.success(e.isWords(t)),e.failed()?0:t.wordsAsInt16Array()}function Vi(){return Si}function Ci(){var e;return 0===a?0:(b>p?(e=F*r+S*d,d=r,r=e):(e=V*r-C,r=e),p>=a&&(p=0,Oi()),++p,e)}function s(e){return 32.767*Math.pow(2,(e-87)/6)}function wi(t){var i;return e.success(22===Pt(t)),e.failed()?!1:(i=e.fetchPointerofObject(0,t),u=xt(i),l=e.fetchFloatofObject(2,t),a=e.fetchIntegerofObject(3,t),p=e.fetchIntegerofObject(4,t),b=e.fetchIntegerofObject(5,t),m=e.fetchIntegerofObject(6,t),F=e.fetchFloatofObject(7,t),S=e.fetchFloatofObject(8,t),r=e.fetchFloatofObject(9,t),d=e.fetchFloatofObject(10,t),V=e.fetchFloatofObject(11,t),C=e.fetchFloatofObject(12,t),A=e.fetchFloatofObject(13,t),T=e.fetchFloatofObject(14,t),y=e.fetchFloatofObject(15,t),v=e.fetchIntegerofObject(16,t),I=e.fetchIntegerofObject(17,t),P=e.fetchIntegerofObject(18,t),n=e.fetchIntegerofObject(19,t),M=e.fetchIntegerofObject(20,t),f=e.fetchIntegerofObject(21,t),e.failed()===!1)}function O(){return P=1309*P+13849&65535}function Pi(){var i,e,t,s;for(e=0,t=r,s=d,i=1;b>=i;i++)e=F*t+S*s,s=t,t=e;0!==e&&(r=r/e*1e4)}function Ai(e){return i(gt,e)-i(pt,e)+i(ct,e)-i(rt,e)+i(tt,e)}function Ii(e){return i(Ft,e)+i(vt,e)+i(ht,e)+i(ut,e)+i(Z,e)+i(U,e)}function Oi(){t[g]>0?(mi(),v=_(v+1,65535)):(a=1,m=a)}function Fi(){var i,r,s,t,n;return i=xt(e.stackValue(2)),r=ji(s=e.stackValue(1)),n=e.stackIntegerValue(0),e.failed()?null:(t=e.stackObjectValue(3),wi(t)?(e.success(2*Pt(s)>=M),e.failed()?null:(vi(i,r,n),bi(t)?void e.pop(3):null)):null)}function k(e,i,r,s,n){var t;return t=Math.exp(e*i),t*((n*(e*e+1)+e)*s-r)+1}function c(i,a,o){var n,e,r,s,t;e=(0-h)/f*o,t=Math.exp(e),s=0-t*t,e=2*h/f*a,r=t*Math.cos(e)*2,n=1-r-s,j(i,n),E(i,r),z(i,s)}function o(e,t,i,r){c(e,t,i),j(e,x(e)*r)}function i(e,r){var t,i;return t=x(e)*r+R(e)*(i=X(e))+K(e)*St(e),It(e,i),yt(e,t),t}function x(e){return u[5*e-5]}function j(e,t){u[5*e-5]=t}function R(e){return u[5*e-4]}function E(e,t){u[5*e-4]=t}function K(e){return u[5*e-3]}function z(e,t){u[5*e-3]=t}function X(e){return u[5*e-2]}function yt(e,t){u[5*e-2]=t}function St(e){return u[5*e-1]}function It(e,t){u[5*e-1]=t}function yi(O,b,y){var v,u,n,l,e,c,t,i,m,f,k,g,o,s,p;o=a*O|0,f=o/a,m=y,t=b,0>=t?u=1:(c=(1-f)/t,u=1-c/(Math.exp(c)-1)),e=h*(m+1),v=Math.cos(e),g=Math.sin(e),k=t/f*e*u,p=di(e,v,g,k),s=e/o,i=Math.exp(p*s),F=2*Math.cos(s)*i,S=0-i*i,d=0,r=i*Math.sin(s),n=Math.exp(-1/(t*a)),l=Math.pow(n,a-o),V=n,C=(1-n)*l/(1-l),Pi()}function bi(O){var c,s,n,o,u,t,f,h,k,g,i;return e.pushRemappableOop(O),e.pushRemappableOop(e.floatObjectOf(l)),e.pushRemappableOop(e.floatObjectOf(F)),e.pushRemappableOop(e.floatObjectOf(S)),e.pushRemappableOop(e.floatObjectOf(r)),e.pushRemappableOop(e.floatObjectOf(d)),e.pushRemappableOop(e.floatObjectOf(V)),e.pushRemappableOop(e.floatObjectOf(C)),e.pushRemappableOop(e.floatObjectOf(A)),e.pushRemappableOop(e.floatObjectOf(T)),f=e.floatObjectOf(y),k=e.popRemappableOop(),u=e.popRemappableOop(),o=e.popRemappableOop(),n=e.popRemappableOop(),i=e.popRemappableOop(),g=e.popRemappableOop(),s=e.popRemappableOop(),c=e.popRemappableOop(),h=e.popRemappableOop(),t=e.popRemappableOop(),e.failed()?!1:(e.storePointerofObjectwithValue(2,t,h),e.storeIntegerofObjectwithValue(3,t,a),e.storeIntegerofObjectwithValue(4,t,p),e.storeIntegerofObjectwithValue(5,t,b),e.storeIntegerofObjectwithValue(6,t,m),e.storePointerofObjectwithValue(7,t,c),e.storePointerofObjectwithValue(8,t,s),e.storePointerofObjectwithValue(9,t,g),e.storePointerofObjectwithValue(10,t,i),e.storePointerofObjectwithValue(11,t,n),e.storePointerofObjectwithValue(12,t,o),e.storePointerofObjectwithValue(13,t,u),e.storePointerofObjectwithValue(14,t,k),e.storePointerofObjectwithValue(15,t,f),e.storeIntegerofObjectwithValue(16,t,v),e.storeIntegerofObjectwithValue(17,t,I),e.storeIntegerofObjectwithValue(18,t,P),e.failed()===!1)}function gi(k){var h,r,a,u,l,e,p,d,m,v,i;t=k,v=.6*s(t[Qt]),i=.6*s(t[Yt]),h=.4*s(t[li]),a=.15*s(t[oi]),l=.06*s(t[ni]),p=.04*s(t[ri]),r=.15*s(t[Mt]),u=.06*s(t[ai]),e=.04*s(t[si]),d=.022*s(t[ei]),m=.03*s(t[$t]),n>=8&&(f>=16e3?c($,7500,600):n=6),n>=7&&(f>=16e3?c(et,6500,500):n=6),n>=6&&c(it,t[Ct],t[zt]),n>=5&&c(at,t[wt],t[Ut]),c(ft,t[D],t[lt]),c(dt,t[W],t[ot]),c(bt,t[N],t[nt]),c(Vt,t[Ot],t[st]),c(Q,t[jt],t[mt]),c(J,t[qt],t[kt]),L(Y,t[Wt],t[Et]),L(G,t[ui],t[Rt]),o(Z,t[jt],t[mt],v),o(U,t[qt],t[kt],i),o(Ft,t[Ot],t[st],h),o(vt,t[N],t[nt],a),o(ht,t[W],t[ot],l),o(ut,t[D],t[lt],p),o(gt,t[N],t[Xt],r),o(pt,t[W],t[Ht],u),o(ct,t[D],t[Jt],e),o(rt,t[wt],t[Gt],d),o(tt,t[Ct],t[Kt],m)}function ki(i){var t;return e=i,t=e.majorVersion()==pi,t===!1?!1:t=e.minorVersion()>=ci}function vi(N,_,B){var P,x,F,V,C,w,d,g,h,r,e,c,v,u,n,j,k,a,S;for(gi(N),l>0?(S=s(t[q]-7),v=s(t[q]),k=.1*s(t[hi])):S=v=k=0,C=.25*s(t[Bt]),x=.05*s(t[Zt]),V=.05*s(t[Wi]),d=t[_t]-3,0>=d&&(d=57),P=s(d),o(H,0,f,P),r=y,h=B,j=M+B-1;j>=h;)r=(O()-32768)/4,r+=.75*y,y=r,p>m&&(r=.5*r),w=C*r,a=Ci(),T=a,b>p&&(a+=k*(O()-32768)/4),g=S*a,c=v*a,F=x*r,g+=F,c+=F,e=xi(g),u=c,e+=Ii(u),u=w+c-A,A=c,e=Ai(u)-e,e=V*u-e,e=i(H,e),n=e*P|0,-32768>n&&(n=-32768),n>32767&&(n=32767),_[h-1]=n,++h,++I}function mi(){l=t[g],_i(),Mi(),Bi(),0>l&&(l=0),a=f/l|0,m=a,t[q]>0&&(m>>=1),b=a*t[w]|0,yi(t[w],t[ti],t[ii]),qi(),Ni()}function di(s,n,a,o){var r,i,l,u,t,e,c;if(u=k(0,s,n,a,o),u>0)for(t=0,e=1,r=u,i=k(e,s,n,a,o);i>0;)t=e,r=i,e=2*e,i=k(e,s,n,a,o);else for(t=-1,e=0,r=k(t,s,n,a,o),i=u;0>r;)e=t,i=r,t=2*t,r=k(t,s,n,a,o);for(;e-t>Tt;)c=(e+t)/2,l=k(c,s,n,a,o),l>0?(t=c,r=l):(e=c,i=l);return(e+t)/2}var pi=1,ci=11,li=46,Mt=34,oi=47,ai=35,ni=48,si=36,ri=49,ei=37,$t=38,Qt=45,Zt=9,Yt=50,st=13,nt=17,Xt=40,ot=19,Ht=41,lt=21,Jt=42,Ut=23,Gt=43,zt=25,Kt=44,mt=27,Et=29,kt=31,Rt=33,Wi=39,B=4,Tt=1e-4,g=0,Ot=12,N=16,W=18,D=20,wt=22,Ct=24,Dt=1,jt=26,Wt=28,Bt=10,qt=30,ui=32,_t=51,Nt=2,h=3.141592653589793,Vt=12,Ft=3,bt=13,gt=7,vt=4,dt=14,pt=8,ht=5,ft=15,ct=9,ut=6,at=16,rt=10,it=17,tt=11,et=18,$=19,ti=7,ii=8,Q=20,Z=1,Y=21,w=6,H=24,J=22,U=2,G=23,fi=3,hi=11,q=5,F=0,S=0,V=0,C=0,n=0,t=null,A=0,e=null,Si="Klatt 3 November 2014 (e)",y=0,m=0,b=0,p=0,v=0,l=0,u=null,I=0,M=0,f=0,P=0,a=0,T=0,r=0,d=0;Squeak.registerExternalModule("Klatt",{setInterpreter:ki,primitiveSynthesizeFrameIntoStartingAt:Fi,getModuleName:Vi})}),module("users.bert.SqueakJS.plugins.LargeIntegers").requires("users.bert.SqueakJS.vm").toRun(function(){function n(t){return"number"==typeof t?e.classSmallInteger():t.sqClass}function i(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function O(e,t){return 0|Math.floor(e/t)}function c(e,t){return e-O(e,t)*t|0}function m(t,e){return e>31?0:t<31?0:t>>>e}function Ft(v,o,p){var a,h,t,l,f,i,n,d,s;if(1>o||1>p)return e.primitiveFail();if(t=v,n=Math.min(p,St(t)),o>n)return!1;if(i=(o-1>>3)+1,a=(n-1>>3)+1,f=c(o-1,8),l=7-c(n-1,8),i===a)return d=m(255,f)&u(255,l),h=r(t,i),0!==(h&d);if(0!==u(r(t,i),f))return!0;for(s=i+1;a-1>=s;s++)if(0!==r(t,s))return!0;return 0!==(255&m(r(t,a),l))?!0:!1}function v(t,r){var s,o,a;return a=e.instantiateClassindexableSize(n(t),r),s=i(t),o=r>s?s:r,q(t.bytes,a.bytes,o),a}function A(i,s){var n,r,t;return"number"==typeof i?(r=i,n=0>r?e.classLargeNegativeInteger():e.classLargePositiveInteger(),t=e.instantiateClassindexableSize(n,s),bt(r,t)):t=v(i,s),t}function bt(t,s){var i,e,r;for(i=s.bytes,e=1,r=b(t);r>=e;e++)i[e-1]=o(t,e)}function gt(a,r,s,o,n){var e,i,t;for(t=0,i=r-1,e=0;i>=e;e++)t=(t>>>8)+a[e]+s[e],n[e]=255&t;for(i=o-1,e=r;i>=e;e++)t=(t>>>8)+s[e],n[e]=255&t;return t>>>8}function V(r,s,n){var t,i,e;for(e=n-1;e>=0;){if((i=s[e])!==(t=r[e]))return t>i?1:-1;--e}return 0}function q(i,r,s){var t,e;for(t=s-1,e=0;t>=e;e++)r[e]=i[e];return 0}function mt(d,k,o,A,I,y){var m,a,n,f,t,s,S,g,b,r,p,i,e,u,F,h,l,v;for(u=k-1,F=y,l=d[u-1],f=1===u?0:d[u-2],p=1;F>=p;p++){if(i=A+1-p,o[i-1]===l)a=255;else for(h=o[i-1],h=(h<<8)+o[i-2],v=c(h,l),a=O(h,l),g=a*f,s=g>>>8,t=255&g,S=3>i?0:o[i-3];;){if(s>v||v===s&&t>S?(--a,f>t?(--s,t=t+256-f):t-=f,b=s>=l):b=!1,!b)break;s-=l}for(r=i-u,n=0,e=1;k>=e;e++)s=d[e-1]*(a>>>8),t=d[e-1]*(255&a),m=o[r-1]-n-(255&t),o[r-1]=255&m,m>>=8,n=s+(t>>>8)-m,++r;if(n>0)for(--a,r=i-u,n=0,e=1;k>=e;e++)n=(n>>>8)+o[r-1]+d[e-1],o[r-1]=255&n,++r;I[y-p]=a}return 0}function g(i,r){var t,e;for(e=r;0===(t=i[e-1]);)if(0===--e)return 0;return I(t)+8*(e-1)}function b(e){return 256>e&&e>-256?1:65536>e&&e>-65536?2:16777216>e&&e>-16777216?3:4}function E(h,o,p,r,l){var n,t,a,e,i,f,s;for(n=h>>3,i=c(h,8),s=n-1,e=0;s>=e;e++)r[e]=0;if(0===i)return F(r,n,l-1,o,0);for(f=8-i,t=0,s=p-1,e=0;s>=e;e++)a=o[e],r[e+n]=255&(t|m(a,i)),t=u(a,f);return 0!==t&&(r[l-1]=t),0}function R(m,u,d,l,s,c,f,r){var t,i,o,n,h,p,a,e;for(p=u-1,h=l-1,n=c-1,o=0,i=0;p>=i;i++){for(e=r[0]+m[i]*d[0],a=e*f&255,e+=a*s[0],t=1;h>=t;t++)e=(e>>>8)+r[t]+m[i]*d[t]+a*s[t],r[t-1]=255&e;for(t=l;n>=t;t++)e=(e>>>8)+r[t]+a*s[t],r[t-1]=255&e;e=(e>>>8)+o,r[n]=255&e,o=e>>>8}for(i=u;n>=i;i++){for(e=r[0],a=e*f&255,e+=a*s[0],t=1;n>=t;t++)e=(e>>>8)+r[t]+a*s[t],r[t-1]=255&e;e=(e>>>8)+o,r[n]=255&e,o=e>>>8}if(0!==o||1!==V(s,r,c))for(e=0,i=0;n>=i;i++)e=e+r[i]-s[i],r[i]=255&e,e>>=8}function L(l,a,f,u,n){var e,r,o,s,t,c,i,h;if(1===a&&0===l[0])return 0;if(1===u&&0===f[0])return 0;for(h=a-1,c=u-1,t=0;h>=t;t++)if(0!==(o=l[t])){for(i=t,s=0,r=0;c>=r;r++)e=f[r],e=e*o+s+n[i],s=e>>>8,n[i]=255&e,++i;n[i]=s}return 0}function o(i,t){return 1>t&&e.primitiveFail(),t>4?0:0>i?255&u(0-i,8*(t-1)):255&u(i,8*(t-1))}function T(a,o,n,s,u,r){var t,i;if(i=n-1,a===w){for(t=0;i>=t;t++)r[t]=o[t]&s[t];for(i=u-1,t=n;i>=t;t++)r[t]=0;return 0}if(a===S){for(t=0;i>=t;t++)r[t]=o[t]|s[t];for(i=u-1,t=n;i>=t;t++)r[t]=s[t];return 0}if(a===P){for(t=0;i>=t;t++)r[t]=o[t]^s[t];for(i=u-1,t=n;i>=t;t++)r[t]=s[t];return 0}return e.primitiveFail()}function F(t,e,i,r,s){return function(){for(var a=i-e+1,n=0;a>n;n++)t[n+e]=r[n+s];return 0}()}function D(p,a,d,o,l){var t,r,i,s,e,f,h,n; if(r=p>>3,e=c(p,8),0===e)return F(o,0,l-1,a,r);for(f=8-e,i=u(a[r],e),n=r+1,h=d-1,t=n;h>=t;t++)s=a[t],o[t-n]=255&(i|m(s,f)),i=u(s,e);return 0!==i&&(o[l-1]=i),0}function it(n,i,r,a,s){var e,t;for(t=0,e=0;i-1>=e;e++)t=t+r[e]-n[e],s[e]=255&t,t>>=8;for(e=i;a-1>=e;e++)t+=r[e],s[e]=255&t,t>>=8}function I(i){var e,t;return e=i,t=0,65536>e||(e>>>=16,t+=16),256>e||(e>>>=8,t+=8),16>e||(e>>>=4,t+=4),4>e||(e>>>=2,t+=2),2>e||(e>>>=1,++t),t+e}function t(u){var r,s,n,t,a,i;for(i=u,a=0>i?e.classLargeNegativeInteger():e.classLargePositiveInteger(),r=b(i),s=e.instantiateClassindexableSize(a,r),n=s.bytes,t=1;r>=t;t++)n[t-1]=o(i,t);return s}function h(t,o){var r,s,a,u;return s=i(t),0===(u=g(t.bytes,s))?0:(r=u+o+7>>3,a=e.instantiateClassindexableSize(n(t),r),E(o,t.bytes,s,a.bytes,r),a)}function d(t,o,l){var i,u,r,s,a;return a=g(t.bytes,l),u=a+7>>3,s=a-o,0>=s?e.instantiateClassindexableSize(n(t),0):(r=s+7>>3,i=e.instantiateClassindexableSize(n(t),r),D(o,t.bytes,u,i.bytes,r),i)}function C(s,l){var r,h,p,u,d,c,t,a,o,f;return a=i(s),o=i(l),d=n(s),o>=a?(u=s,h=a,f=l,t=o):(u=l,h=o,f=s,t=a),r=e.instantiateClassindexableSize(d,t),p=gt(u.bytes,h,f.bytes,t,r.bytes),p>0&&(c=e.instantiateClassindexableSize(d,t+1),q(r.bytes,c.bytes,t),r=c,r.bytes[t]=p),r}function p(s,a,v){var p,h,o,r,u,d,c,f,m;if("number"==typeof s){if(0>s)return e.primitiveFail();o=t(s)}else{if(n(s)===e.classLargeNegativeInteger())return e.primitiveFail();o=s}if("number"==typeof a){if(0>a)return e.primitiveFail();r=t(a)}else{if(n(a)===e.classLargeNegativeInteger())return e.primitiveFail();r=a}return c=i(o),f=i(r),f>c?(p=c,h=o,u=f,d=r):(p=f,h=r,u=c,d=o),m=e.instantiateClassindexableSize(e.classLargePositiveInteger(),u),T(v,h.bytes,p,d.bytes,u,m.bytes),e.failed()?0:l(m)}function j(r,s){var t,e;return e=i(r),t=i(s),t!==e?t>e?-1:1:V(r.bytes,s.bytes,e)}function x(m,c,k){var v,r,t,n,o,l,f,p,u;return u=i(m),p=i(c),v=k?e.classLargeNegativeInteger():e.classLargePositiveInteger(),f=u-p+1,0>=f?(r=e.instantiateClassindexableSize(e.classArray(),2),e.stObjectatput(r,1,0),e.stObjectatput(r,2,m),r):(l=8-I(s(c,p)),n=h(c,l),n=A(n,a(n)+1),t=h(m,l),a(t)===u&&(t=A(t,u+1)),o=e.instantiateClassindexableSize(v,f),mt(n.bytes,a(n),t.bytes,a(t),o.bytes,a(o)),t=d(t,l,a(n)-1),r=e.instantiateClassindexableSize(e.classArray(),2),e.stObjectatput(r,1,o),e.stObjectatput(r,2,t),r)}function a(e){return"number"==typeof e?b(e):i(e)}function W(o,u,c,r){var s,t,n,a;return n=i(o),a=i(u),t=i(c),t>=n&&t>=a&&r>=0&&255>=r?(s=e.instantiateClassindexableSize(e.classLargePositiveInteger(),t),R(o.bytes,n,u.bytes,a,c.bytes,t,r,s.bytes),l(s)):e.primitiveFail()}function B(c,a,p){var u,h,t,o,n,l,s,r;return r=i(c),s=i(a),s>=r?(o=c,t=r,u=a,n=s):(o=a,t=s,u=c,n=r),h=p?e.classLargeNegativeInteger():e.classLargePositiveInteger(),l=e.instantiateClassindexableSize(h,n+t),L(o.bytes,t,u.bytes,n,l.bytes),f(l)}function r(e,t){return t>i(e)?0:s(e,t)}function M(a,o){var m,d,u,h,v,c,p,t,s,f;if(p=n(a)===e.classLargeNegativeInteger(),t=i(a),s=i(o),t===s){for(;t>1&&r(a,t)===r(o,t);)--t;s=t}return s>t||t===s&&r(a,t)t)return!0;if(t>u)return!1;if(n(i)===e.classLargePositiveInteger())return c=1073741823,s(i,t)>o(c,t);if(l=-1073741824,s(i,t)=r;r++)if(s(i,r)!==o(l,r))return!0;return!1}function f(t){return n(t)===e.classLargePositiveInteger()?l(t):y(t)}function y(t){var i,e,n,u,c,l;for(e=c=a(t);0!==e&&0===s(t,e);)--e;if(0===e)return 0;if(n=4,n>=e){if(u=-1073741824,n>e||r(t,n)=1;i+=-1)l=256*l-s(t,i);return l}for(i=1;n>=i;i++)if(r(t,i)!==o(u,i))return c>e?v(t,e):t;return u}return c>e?v(t,e):t}function l(t){var i,e,n,u,l;for(e=l=a(t);0!==e&&0===s(t,e);)--e;if(0===e)return 0;if(n=4,n>=e&&r(t,n)<=o(1073741823,n)){for(u=0,i=e;i>=1;i+=-1)u=256*u+s(t,i);return u}return l>e?v(t,e):t}function K(){var i,r,s,n,a;return s=e.stackIntegerValue(1),n=e.stackIntegerValue(0),e.success(e.isKindOfInteger(e.stackValue(2))),i=e.stackValue(2),e.failed()?null:(r="number"==typeof i?t(i):i,a=Ft(r,s,n)?e.trueObject():e.falseObject(),e.failed()?null:(e.popthenPush(3,a),null))}function z(){var i,r;return e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.failed()?null:"number"==typeof i?(r=t(i),e.failed()?null:(e.popthenPush(2,r),null)):e.failed()?null:(e.popthenPush(2,i),null)}function G(){var t;return t=e.trueObject(),e.failed()?null:(e.popthenPush(1,t),null)}function U(){var o,r,s,n,a;return e.success(e.isKindOfInteger(e.stackValue(1))),s=e.stackValue(1),n=e.stackIntegerValue(0),e.failed()?null:(r="number"==typeof s?t(s):s,n>=0?(a=h(r,n),e.failed()?null:(e.popthenPush(3,a),null)):(o=0-n,a=f(d(r,o,i(r))),e.failed()?null:(e.popthenPush(3,a),null)))}function J(){var s,i,n,r,a;return e.success(e.isKindOfInteger(e.stackValue(0))),r=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,a=C(s,n),e.failed()?null:(e.popthenPush(2,a),null))}function H(){var s,n,i,r,a;return e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),e.success(e.isKindOfInteger(e.stackValue(0))),r=e.stackValue(0),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,a=C(s,n),e.failed()?null:(e.popthenPush(3,a),null))}function X(){var t,i,r;return e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),t=e.stackValue(1),e.failed()?null:(r=p(t,i,w),e.failed()?null:(e.popthenPush(2,r),null))}function Y(){var t,i,r,s;return e.success(e.isKindOfInteger(e.stackValue(2))),t=e.stackValue(2),e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),r=e.stackIntegerValue(0),e.failed()?null:(s=p(t,i,r),e.failed()?null:(e.popthenPush(4,s),null))}function Z(){var t,i,r;return e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),t=e.stackValue(1),e.failed()?null:(r=p(t,i,S),e.failed()?null:(e.popthenPush(2,r),null))}function Q(){var r,o,s,n,a;return n=e.stackIntegerValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),s=e.stackValue(1),e.failed()?null:(r="number"==typeof s?t(s):s,n>=0?(a=h(r,n),e.failed()?null:(e.popthenPush(2,a),null)):(o=0-n,a=f(d(r,o,i(r))),e.failed()?null:(e.popthenPush(2,a),null)))}function $(){var r,o,s,n,a;return n=e.stackIntegerValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),s=e.stackValue(1),e.failed()?null:(r="number"==typeof s?t(s):s,n>=0?(a=h(r,n),e.failed()?null:(e.popthenPush(2,a),null)):(o=0-n,a=f(d(r,o,i(r))),e.failed()?null:(e.popthenPush(2,a),null)))}function et(){var t,i,r;return e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),t=e.stackValue(1),e.failed()?null:(r=p(t,i,P),e.failed()?null:(e.popthenPush(2,r),null))}function tt(){var s,r,n,i,t;return e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),r=e.stackValue(1),e.failed()?null:"number"==typeof r?"number"==typeof i?(s=r)>(n=i)?(t=1,e.failed()?null:(e.popthenPush(2,t),null)):n>s?(t=-1,e.failed()?null:(e.popthenPush(2,t),null)):(t=0,e.failed()?null:(e.popthenPush(2,t),null)):(t=-1,e.failed()?null:(e.popthenPush(2,t),null)):"number"==typeof i?(t=1,e.failed()?null:(e.popthenPush(2,t),null)):(t=j(r,i),e.failed()?null:(e.popthenPush(2,t),null))}function N(){var s,n,r,i,t;return e.success(e.isKindOfInteger(e.stackValue(1))),r=e.stackValue(1),e.success(e.isKindOfInteger(e.stackValue(0))),i=e.stackValue(0),e.failed()?null:"number"==typeof r?"number"==typeof i?(s=r)>(n=i)?(t=1,e.failed()?null:(e.popthenPush(3,t),null)):n>s?(t=-1,e.failed()?null:(e.popthenPush(3,t),null)):(t=0,e.failed()?null:(e.popthenPush(3,t),null)):(t=-1,e.failed()?null:(e.popthenPush(3,t),null)):"number"==typeof i?(t=1,e.failed()?null:(e.popthenPush(3,t),null)):(t=j(r,i),e.failed()?null:(e.popthenPush(3,t),null))}function rt(){var n,r,s,i,a,o;if(e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),a=e.booleanValueOf(e.stackValue(0)),e.success(e.isKindOfInteger(e.stackValue(2))),r=e.stackValue(2),e.failed())return null;if(!_(r))return e.primitiveFail(),null;if(!_(i))return e.primitiveFail(),null;if(n="number"==typeof r?t(r):r,"number"==typeof i){if(0===i)return e.primitiveFail(),null;s=t(i)}else s=i;return o=x(n,s,a),e.failed()?null:(e.popthenPush(3,o),null)}function st(){var n,s,r,i,a,o;if(e.success(e.isKindOfInteger(e.stackValue(2))),r=e.stackValue(2),e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),a=e.booleanValueOf(e.stackValue(0)),e.failed())return null;if(n="number"==typeof r?t(r):r,"number"==typeof i){if(0===i)return e.primitiveFail(),null;s=t(i)}else s=i;return o=x(n,s,a),e.failed()?null:(e.popthenPush(4,o),null)}function nt(){var s,i,n,r,a,o;return e.success(e.isKindOfInteger(e.stackValue(1))),r=e.stackValue(1),a=e.booleanValueOf(e.stackValue(0)),e.success(e.isKindOfInteger(e.stackValue(2))),i=e.stackValue(2),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,o=B(s,n,a),e.failed()?null:(e.popthenPush(3,o),null))}function at(){var s,n,i,r,a,o;return e.success(e.isKindOfInteger(e.stackValue(2))),i=e.stackValue(2),e.success(e.isKindOfInteger(e.stackValue(1))),r=e.stackValue(1),a=e.booleanValueOf(e.stackValue(0)),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,o=B(s,n,a),e.failed()?null:(e.popthenPush(4,o),null))}function ot(){var s,i,n,r,a;return e.success(e.isKindOfInteger(e.stackValue(0))),r=e.stackValue(0),e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,a=M(s,n),e.failed()?null:(e.popthenPush(2,a),null))}function ut(){var s,n,i,r,a;return e.success(e.isKindOfInteger(e.stackValue(1))),i=e.stackValue(1),e.success(e.isKindOfInteger(e.stackValue(0))),r=e.stackValue(0),e.failed()?null:(s="number"==typeof i?t(i):i,n="number"==typeof r?t(r):r,a=M(s,n),e.failed()?null:(e.popthenPush(3,a),null))}function lt(){var s,i,t,r;for(i=strlen(k()),r=e.instantiateClassindexableSize(e.classString(),i),s=r.bytes,t=0;i-1>=t;t++)s[t]=k()[t];return e.failed()?null:(e.popthenPush(1,r),null)}function ct(){var n,a,i,o,r,s,u,l;return e.success(e.isKindOfInteger(e.stackValue(2))),r=e.stackValue(2),e.success(e.isKindOfInteger(e.stackValue(1))),s=e.stackValue(1),u=e.stackIntegerValue(0),e.success(e.isKindOfInteger(e.stackValue(3))),i=e.stackValue(3),e.failed()?null:(n="number"==typeof i?t(i):i,a="number"==typeof r?t(r):r,o="number"==typeof s?t(s):s,l=W(n,a,o,u),e.failed()?null:(e.popthenPush(4,l),null))}function ft(){var t,i;return e.success(e.isKindOfInteger(e.stackValue(0))),t=e.stackValue(0),e.failed()?null:"number"==typeof t?e.failed()?null:(e.popthenPush(2,t),null):(i=f(t),e.failed()?null:(e.popthenPush(2,i),null))}function ht(){var t,i;return e.success(e.stackValue(0).sqClass===e.classLargeNegativeInteger()),t=e.stackValue(0),e.failed()?null:(i=y(t),e.failed()?null:(e.popthenPush(1,i),null))}function pt(){var t,i;return e.success(e.stackValue(0).sqClass===e.classLargePositiveInteger()),t=e.stackValue(0),e.failed()?null:(i=l(t),e.failed()?null:(e.popthenPush(1,i),null))}function dt(i){var t;return e=i,t=e.majorVersion()==vt,t===!1?!1:t=e.minorVersion()>=kt}function s(e,t){var i;return(i=e.bytes)[t-1]}var vt=1,kt=11,w=0,e=null,yt="LargeIntegers v1.5 (e)",S=1,P=2;Squeak.registerExternalModule("LargeIntegers",{primDigitAddWith:H,primDigitBitShiftMagnitude:$,primGetModuleName:lt,primDigitBitLogicWithOp:Y,primCheckIfCModuleExists:G,primDigitCompare:tt,primDigitMultiplyNegative:nt,primDigitBitShift:Q,primNormalizePositive:pt,primDigitSubtractWith:ut,_primDigitBitShift:U,primDigitMultiplyWithNegative:at,primDigitSubtract:ot,primDigitDivNegative:rt,primNormalizeNegative:ht,primDigitBitOr:Z,primMontgomeryTimesModulo:ct,primDigitBitAnd:X,primDigitDivWithNegative:st,setInterpreter:dt,primNormalize:ft,primDigitBitXor:et,primDigitCompareWith:N,primDigitAdd:J,getModuleName:k,primAsLargeInteger:z,primAnyBitFromTo:K})}),module("users.bert.SqueakJS.plugins.Matrix2x3Plugin").requires("users.bert.SqueakJS.vm").toRun(function(){function u(t){return"number"==typeof t?e.classSmallInteger():t.sqClass}function f(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function v(){return A}function n(t){return e.failed()?null:e.isWords(t)&&6===f(t)?t.wordsAsFloat32Array():(e.primitiveFail(),null)}function a(n){var i,t;return e.failed()?null:u(n)!==e.classPoint()?e.primitiveFail():(t=e.fetchPointerofObject(0,n),i="number"==typeof t,i||t.isFloat?(s=i?t:e.floatValueOf(t),t=e.fetchPointerofObject(1,n),i="number"==typeof t,i||t.isFloat?void(r=i?t:e.floatValueOf(t)):e.primitiveFail()):e.primitiveFail())}function k(e,t,i){var r,s,n,a,o,u;r=e[0]*t[0]+e[1]*t[3],s=e[0]*t[1]+e[1]*t[4],n=e[0]*t[2]+e[1]*t[5]+e[2],a=e[3]*t[0]+e[4]*t[3],o=e[3]*t[1]+e[4]*t[4],u=e[3]*t[2]+e[4]*t[5]+e[5],i[0]=r,i[1]=s,i[2]=n,i[3]=a,i[4]=o,i[5]=u}function l(n){var a,l,c,o,u;return o=s-n[2],u=r-n[5],a=n[0]*n[4]-n[1]*n[3],0===a?e.primitiveFail():(a=1/a,l=o*n[4]-n[1]*u,c=n[0]*u-o*n[3],t=l*a,void(i=c*a))}function c(e){t=s*e[0]+r*e[1]+e[2],i=s*e[3]+r*e[4]+e[5]}function o(e){return e>=-1073741824&&1073741823>=t}function F(){var t,i,r,s;return r=n(s=e.stackObjectValue(0)),i=n(e.stackObjectValue(1)),t=n(e.stackObjectValue(2)),e.failed()?null:(k(t,i,r),void e.popthenPush(3,s))}function S(){var t;return a(e.stackObjectValue(0)),t=n(e.stackObjectValue(1)),e.failed()?null:(l(t),void(e.failed()||p(2)))}function O(){var F,g,k,v,d,o,p,c,b,y,m;return k=e.stackObjectValue(0),m=e.stackObjectValue(1),v=n(e.stackObjectValue(2)),e.failed()?null:u(m)!==u(k)?e.primitiveFail():e.isPointers(m)?2!==f(m)?e.primitiveFail():(a(e.fetchPointerofObject(0,m)),e.failed()?null:(b=s,y=r,l(v),p=d=t,c=o=i,a(e.fetchPointerofObject(1,m)),e.failed()?null:(F=s,g=r,l(v),p=Math.min(p,t),d=Math.max(d,t),c=Math.min(c,i),o=Math.max(o,i),s=F,r=y,l(v),p=Math.min(p,t),d=Math.max(d,t),c=Math.min(c,i),o=Math.max(o,i),s=b,r=g,l(v),p=Math.min(p,t),d=Math.max(d,t),c=Math.min(c,i),o=Math.max(o,i),e.failed()||(k=h(k,p,c,d,o)),void(e.failed()||e.popthenPush(3,k))))):e.primitiveFail()}function I(){var t;return t=n(e.stackObjectValue(0)),e.failed()?null:(e.pop(1),void e.pushBool(1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5]))}function P(){var t;return t=n(e.stackObjectValue(0)),e.failed()?null:(e.pop(1),void e.pushBool(1===t[0]&&0===t[1]&&0===t[3]&&1===t[4]))}function d(){var t;return a(e.stackObjectValue(0)),t=n(e.stackObjectValue(1)),e.failed()?null:(c(t),void p(2))}function m(){var F,g,k,v,d,o,p,l,b,y,m;return k=e.stackObjectValue(0),m=e.stackObjectValue(1),v=n(e.stackObjectValue(2)),e.failed()?null:u(m)!==u(k)?e.primitiveFail():e.isPointers(m)?2!==f(m)?e.primitiveFail():(a(e.fetchPointerofObject(0,m)),e.failed()?null:(b=s,y=r,c(v),p=d=t,l=o=i,a(e.fetchPointerofObject(1,m)),e.failed()?null:(F=s,g=r,c(v),p=Math.min(p,t),d=Math.max(d,t),l=Math.min(l,i),o=Math.max(o,i),s=F,r=y,c(v),p=Math.min(p,t),d=Math.max(d,t),l=Math.min(l,i),o=Math.max(o,i),s=b,r=g,c(v),p=Math.min(p,t),d=Math.max(d,t),l=Math.min(l,i),o=Math.max(o,i),k=h(k,p,l,d,o),void(e.failed()||e.popthenPush(3,k))))):e.primitiveFail()}function p(r){return t+=.5,i+=.5,o(t)&&o(i)?void e.popthenPush(r,e.makePointwithxValueyValue(0|t,0|i)):e.primitiveFail()}function h(p,l,h,f,c){var u,r,a,n,s,i,t;return n=l+.5,o(n)?(r=f+.5,o(r)?(s=h+.5,o(s)?(a=c+.5,o(a)?(e.pushRemappableOop(p),i=e.makePointwithxValueyValue(0|n,0|s),e.pushRemappableOop(i),u=e.makePointwithxValueyValue(0|r,0|a),i=e.popRemappableOop(),t=e.popRemappableOop(),e.storePointerofObjectwithValue(0,t,i),e.storePointerofObjectwithValue(1,t,u),t):e.primitiveFail()):e.primitiveFail()):e.primitiveFail()):e.primitiveFail()}function g(i){var t;return e=i,t=e.majorVersion()==b,t===!1?!1:t=e.minorVersion()>=y}var b=1,y=11,e=null,s=0,r=0,t=0,i=0,A="Matrix2x3Plugin 3 November 2014 (e)";Squeak.registerExternalModule("Matrix2x3Plugin",{primitiveInvertPoint:S,primitiveInvertRectInto:O,primitiveIsIdentity:I,primitiveComposeMatrix:F,setInterpreter:g,primitiveTransformRectInto:m,primitiveIsPureTranslation:P,getModuleName:v,primitiveTransformPoint:d})}),module("users.bert.SqueakJS.plugins.MiscPrimitivePlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function g(e,t){return 0|Math.floor(e/t)}function c(e,t){return e-g(e,t)*t|0}function s(t,e){return e>31?0:t>>>e}function i(i,r,t){var e;for(e=0;3>=e;e++)r[t+e-1]=255&s(i,8*(3-e));return t+4}function t(t,r,e){return 223>=t?(r[e-1]=t,e+1):7935>=t?(r[e-1]=(t>>8)+224,r[e]=c(t,256),e+2):(r[e-1]=255,i(t,r,e+1))}function n(){return b}function a(){var l,s,n,a,o,u,t,i,r;if(l=e.stackValue(3),s=e.stackBytes(2),n=e.stackBytes(1),a=e.stackBytes(0),e.failed())return null;for(i=s.length,r=n.length,t=1;t<=Math.min(i,r);t++)if(o=a[s[t-1]],u=a[n[t-1]],o!==u)return u>o?e.failed()?null:(e.popthenPush(4,1),null):e.failed()?null:(e.popthenPush(4,3),null);return i===r?e.failed()?null:(e.popthenPush(4,2),null):r>i?e.failed()?null:(e.popthenPush(4,1),null):e.failed()?null:(e.popthenPush(4,3),null)}function o(){var p,u,a,h,r,s,n,l,f,c,o;if(p=e.stackValue(2),u=e.stackInt32Array(1),a=e.stackBytes(0),e.failed())return null;for(c=u.length,r=t(c,a,1),n=1;c>=n;){for(o=u[n-1],l=255&o,h=(o>>>8&255)===l&&(o>>>16&255)===l&&(o>>>24&255)===l,s=n;c>s&&o===u[s];)++s;if(s>n)h?(r=t(4*(s-n+1)+1,a,r),a[r-1]=l,++r):(r=t(4*(s-n+1)+2,a,r),r=i(o,a,r)),n=s+1;else if(h)r=t(5,a,r),a[r-1]=l,++r,++n;else{for(;c>s&&u[s-1]!==u[s];)++s;for(s===c&&++s,r=t(4*(s-n)+3,a,r),f=n;s-1>=f;f++)r=i(u[f-1],a,r);n=s}}return e.failed()?null:(e.popthenPush(3,r-1),null)}function u(){var a,r,s,t,n,i;if(a=e.stackValue(2),r=e.stackBytes(1),s=e.stackUint16Array(0),e.failed())return null;for(n=r.length,t=1;n>=t;t++)i=r[t-1],s[t-1]=i>127?i-256<<8:i<<8;return e.failed()?null:void e.pop(2)}function l(){var d,o,a,h,s,l,i,f,r,t,n,c,u,p;if(d=e.stackValue(3),o=e.stackInt32Array(2),a=e.stackBytes(1),h=e.stackIntegerValue(0),e.failed())return null;for(r=h,f=a.length,n=1,p=o.length+1;f>=r;){if(s=a[r-1],++r,!(223>=s))if(254>=s)s=256*(s-224)+a[r-1],++r;else for(s=0,t=1;4>=t;t++)s=(s<<8)+a[r-1],++r;if(u=s>>>2,n+u>p)return e.primitiveFail(),null;if(l=3&s,1===l)for(i=a[r-1],++r,i|=i<<8,i|=i<<16,t=1;u>=t;t++)o[n-1]=i,++n;if(2===l){for(i=0,t=1;4>=t;t++)i=i<<8|a[r-1],++r;for(t=1;u>=t;t++)o[n-1]=i,++n}if(3===l)for(c=1;u>=c;c++){for(i=0,t=1;4>=t;t++)i=i<<8|a[r-1],++r;o[n-1]=i,++n}}return e.failed()?null:void e.pop(3)}function r(){var a,i,r,n,t,s;if(a=e.stackValue(3),i=e.stackBytes(2),r=e.stackBytes(1),n=e.stackIntegerValue(0),e.failed())return null;if(256!==r.length)return e.failed()?null:(e.popthenPush(4,0),null);for(t=n,s=i.length;s>=t&&0===r[i[t-1]];)++t;return t>s?e.failed()?null:(e.popthenPush(4,0),null):e.failed()?null:(e.popthenPush(4,t),null)}function f(){var o,t,s,a,n,i,r;if(o=e.stackValue(4),t=e.stackBytes(3),s=e.stackBytes(2),a=e.stackIntegerValue(1),n=e.stackBytes(0),e.failed())return null;if(0===t.length)return e.failed()?null:(e.popthenPush(5,0),null);for(r=a;r<=s.length-t.length+1;r++)for(i=1;n[s[r+i-1-1]]===n[t[i-1]];){if(i===t.length)return e.failed()?null:(e.popthenPush(5,r),null);++i}return e.failed()?null:(e.popthenPush(5,0),null)}function h(){var a,r,i,s,t,n;if(a=e.stackValue(3),r=e.stackIntegerValue(2),i=e.stackBytes(1),s=e.stackIntegerValue(0),e.failed())return null;for(n=i.length,t=s;n>=t;t++)if(i[t-1]===r)return e.failed()?null:(e.popthenPush(4,t),null);return e.failed()?null:(e.popthenPush(4,0),null)}function p(){var o,r,n,a,t,s,i;if(o=e.stackValue(2),r=e.stackBytes(1),n=e.stackIntegerValue(0),e.failed())return null;for(a=r.length,t=268435455&n,i=1;a>=i;i++)t+=r[i-1],s=16383&t,t=9741*s+16384*(9741*(t>>>14)+101*s&16383)&268435455;return e.failed()?null:(e.popthenPush(3,t),null)}function d(){var a,i,r,s,n,t;if(a=e.stackValue(4),i=e.stackBytes(3),r=e.stackIntegerValue(2),s=e.stackIntegerValue(1),n=e.stackBytes(0),e.failed())return null;for(t=r;s>=t;t++)i[t-1]=n[i[t-1]];return e.failed()?null:void e.pop(4)}function m(i){var t;return e=i,t=e.majorVersion()==v,t===!1?!1:t=e.minorVersion()>=k}var v=1,k=11,e=null,b="MiscPrimitivePlugin 3 November 2014 (e)";Squeak.registerExternalModule("MiscPrimitivePlugin",{primitiveConvert8BitSigned:u,primitiveCompareString:a,primitiveTranslateStringWithTable:d,primitiveStringHash:p,primitiveCompressToByteArray:o,primitiveFindSubstring:f,primitiveIndexOfAsciiInString:h,setInterpreter:m,primitiveDecompressFromByteArray:l,getModuleName:n,primitiveFindFirstInString:r})}),module("users.bert.SqueakJS.plugins.ScratchPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function r(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function t(e,t){return 0|Math.floor(e/t)}function s(e,i){return e-t(e,i)*i|0}function n(p,h,f,c,u){var l,r,i,e,a,o,n;return r=t(f,60),l=s(f,60),e=(1e3-c)*u,a=(1e3-t(c*l,60))*u,o=(1e3-t(c*(60-l),60))*u,n=t(1e3*u,3922),e=t(e,3922),a=t(a,3922),o=t(o,3922),0===r&&(i=(n<<16)+(o<<8)+e),1===r&&(i=(a<<16)+(n<<8)+e),2===r&&(i=(e<<16)+(n<<8)+o),3===r&&(i=(e<<16)+(a<<8)+n),4===r&&(i=(o<<16)+(e<<8)+n),5===r&&(i=(n<<16)+(e<<8)+a),0===i&&(i=1),p[h]=i,0}function l(t){return e.success(e.isWordsOrBytes(t)),e.failed()?0:t.wordsAsFloat64Array()}function i(t){return e.success(e.isWords(t)),e.failed()?0:t.words}function d(){return w}function a(r,s,a,o,n){var i,e;return e=n-o,0===e?0:(i=r===n?t(60*(s-a),e):s===n?120+t(60*(a-r),e):240+t(60*(r-s),e),0>i?i+360:i)}function o(e,t,i){var n,r,a,o,s;return 0===e?t:0===t?e:(r=1024-i,o=r*(e>>>16&255)+i*(t>>>16&255)>>10,a=r*(e>>>8&255)+i*(t>>>8&255)>>10,n=r*(255&e)+i*(255&t)>>10,s=(o<<16)+(a<<8)+n,0===s&&(s=1),s)}function u(l,c,h,u,f){var a,r,n,t,i,e,s;return t=c>>>10,-1>t||t>=u?0:(e=h>>>10,-1>e||e>=f?0:(i=1023&c,-1===t&&(t=0,i=0),t===u-1&&(i=0),s=1023&h,-1===e&&(e=0,s=0),e===f-1&&(s=0),r=e*u+t,n=16777215&l[r],i>0&&(n=o(n,16777215&l[r+1],i)),0===s?n:(r=(e+1)*u+t,a=16777215&l[r],i>0&&(a=o(a,16777215&l[r+1],i)),o(n,a,s))))}function c(){var f,c,l,h,b,g,m,s,y,p,k,u,v,d,o,a,n;if(m=e.stackValue(2),p=e.stackValue(1),o=e.stackIntegerValue(0),g=i(m),y=i(p),d=r(m),e.success(r(p)===d),e.failed())return null;for(b=t(d,o),n=1;b-2>=n;n++)for(a=1;o-2>=a;a++){for(s=v=h=f=0,l=-1;1>=l;l++)for(c=-1;1>=c;c++)u=16777215&g[(n+l)*o+(a+c)],0!==u&&(v+=u>>>16&255,h+=u>>>8&255,f+=255&u,++s);k=0===s?0:(t(v,s)<<16)+(t(h,s)<<8)+t(f,s),y[n*o+a]=k}return e.pop(3),0}function f(){var l,u,c,g,f,F,v,s,o,k,p,h,d,b,y,m;if(v=e.stackValue(2),p=e.stackValue(1),y=e.stackIntegerValue(0),F=i(v),m=r(v),k=i(p),e.success(r(p)===m),e.failed())return null;for(f=0;m-1>=f;f++)h=16777215&F[f],0!==h&&(d=h>>>16&255,c=h>>>8&255,l=255&h,s=o=d,c>s&&(s=c),l>s&&(s=l),o>c&&(o=c),o>l&&(o=l),g=a(d,c,l,o,s),b=0===s?0:t(1e3*(s-o),s),u=t(1e3*s,255),u+=10*y,u>1e3&&(u=1e3),0>u&&(u=0),n(k,f,g,b,u));return e.pop(3),0}function h(){var l,p,n,c,o,u,s,f,a,h,i,d=0,m=0;if(a=e.stackValue(2),n=e.stackValue(1),c=e.stackIntegerValue(0),e.success(e.isWords(a)),e.success(e.isWords(n)),l=t(2*r(a),c),h=2*r(n),e.success(h>=l),e.failed())return null;for(f=a.wordsAsInt16Array(),p=n.wordsAsInt16Array(),o=1;l>=o;o++){for(s=0,u=1;c>=u;u++)i=f[d++],0>i&&(i=0-i),i>s&&(s=i);p[m++]=s}return e.pop(3),0}function p(){var v,l,f,s,m,c,h,u,o,p,d,a,n,r,t;if(h=e.stackValue(7),u=e.stackIntegerValue(6),c=e.stackIntegerValue(5),d=e.stackValue(4),a=e.stackIntegerValue(3),p=e.stackIntegerValue(2),l=e.stackIntegerValue(1),f=e.stackIntegerValue(0),m=i(h),o=i(d),e.success(a>l+2*u),e.success(p>f+2*c),e.failed())return null;for(t=0;c-1>=t;t++)for(v=(f+2*t)*a+l,r=0;u-1>=r;r++)n=m[r+t*u],s=v+2*r,o[s]=n,o[s+1]=n,o[s+a]=n,o[s+a+1]=n;return e.pop(8),0}function C(){var o,t,s,u,l,i,n,a=0,c=0;if(i=e.stackValue(2),t=e.stackValue(1),u=e.booleanValueOf(e.stackValue(0)),e.success(e.isWords(i)),e.success(e.isWords(t)),n=r(i),e.success(r(t)>=n>>1),e.failed())return null;for(l=i.wordsAsInt16Array(),o=t.wordsAsInt16Array(),u&&a++,s=1;n>=s;s++)o[c++]=l[a],a+=2;return e.pop(3),0}function m(){var v,c,a,f,h,o,O,m,S,k,I,F,d,y,b,g,p,s,l,n;if(m=e.stackValue(3),k=e.stackValue(2),s=e.stackIntegerValue(1),F=e.stackIntegerValue(0),O=i(m),S=i(k),p=r(m),e.success(r(k)===p),e.failed())return null;for(o=t(p,s),c=s>>1,a=o>>1,o=t(p,s),c=s>>1,a=o>>1,y=F/100,l=0;s-1>=l;l++)for(n=0;o-1>=n;n++)f=(l-c)/c,h=(n-a)/a,d=Math.pow(Math.sqrt(f*f+h*h),y),1>=d?(v=Math.atan2(h,f),b=1024*(c+d*Math.cos(v)*c)|0,g=1024*(a+d*Math.sin(v)*a)|0):(b=1024*l,g=1024*n),I=u(O,b,g,s,o),S[n*s+l]=I;return e.pop(4),0}function v(){var s,f,k,c,h,p,u,l,y,o,F,b,v,t,n,r,d,m,g,a;if(l=i(e.stackValue(11)),o=e.stackIntegerValue(10),y=e.stackIntegerValue(9),F=i(e.stackValue(8)),v=e.stackIntegerValue(7),b=e.stackIntegerValue(6),d=e.stackIntegerValue(5),m=e.stackIntegerValue(4),h=e.stackIntegerValue(3),p=e.stackIntegerValue(2),c=e.stackIntegerValue(1),f=e.stackIntegerValue(0),e.success(d>=0&&m>=0),e.success(o>=d+2*c),e.success(y>=m+2*f),e.success(h>=0&&p>=0),e.success(v>=h+c),e.success(b>=p+f),e.failed())return null;for(a=0;f-1>=a;a++)for(r=o*(m+2*a)+d,k=v*(p+a)+h,g=0;c-1>=g;g++)t=l[r],n=16711680&t,u=65280&t,s=255&t,t=l[r+1],n+=16711680&t,u+=65280&t,s+=255&t,t=l[r+o],n+=16711680&t,u+=65280&t,s+=255&t,t=l[r+o+1],n+=16711680&t,u+=65280&t,s+=255&t,F[k]=n>>>2&16711680|(u>>>2&65280|s>>>2),r+=2,++k;return e.pop(12),0}function k(){var F,r,d,s,n,a,y,m,b,u,S,g,p,f,h,k,c,l,o,v,t;if(m=i(e.stackValue(11)),u=e.stackIntegerValue(10),b=e.stackIntegerValue(9),S=i(e.stackValue(8)),p=e.stackIntegerValue(7),g=e.stackIntegerValue(6),l=e.stackIntegerValue(5),o=e.stackIntegerValue(4),n=e.stackIntegerValue(3),a=e.stackIntegerValue(2),s=e.stackIntegerValue(1),r=e.stackIntegerValue(0),e.success(l>=0&&o>=0),e.success(u>=l+2*s),e.success(b>=o+2*r),e.success(n>=0&&a>=0),e.success(p>=n+s),e.success(g>=a+r),e.failed())return null;for(t=0;r-1>=t;t++)for(c=u*(o+2*t)+l,d=p*(a+t)+n,v=0;s-1>=v;v++)f=m[c],h=m[c+u+1],k=(16711680&f)+(16711680&h)>>>1&16711680,y=(65280&f)+(65280&h)>>>1&65280,F=(255&f)+(255&h)>>>1,S[d]=k|(y|F),c+=2,++d;return e.pop(12),0}function g(){var f,p,l,m,h,S,k,o,u,y,v,d,b,c,F,g;if(k=e.stackValue(2),v=e.stackValue(1),F=e.stackIntegerValue(0),S=i(k),g=r(k),y=i(v),e.success(r(v)===g),e.failed())return null;for(h=0;g-1>=h;h++)d=16777215&S[h],0!==d&&(b=d>>>16&255,l=d>>>8&255,f=255&d,o=u=b,l>o&&(o=l),f>o&&(o=f),u>l&&(u=l),u>f&&(u=f),p=t(1e3*o,255),c=0===o?0:t(1e3*(o-u),o),110>p&&(p=110,c=1e3),90>c&&(c=90),m=110===p||90===c?0:a(b,l,f,u,o),m=s(m+F+36e7,360),n(y,h,m,c,p));return e.pop(3),0}function b(){var a,s,o,l,n,c,f;return s=e.stackValue(3),n=e.stackIntegerValue(2),c=e.stackIntegerValue(1),f=e.stackIntegerValue(0),a=i(s),l=r(s),e.failed()?null:(o=u(a,c,f,n,t(l,n)),e.pop(5),e.pushInteger(o),0)}function y(){var l,g,c,b,f,F,v,s,u,k,p,h,d,o,y,m;if(v=e.stackValue(2),p=e.stackValue(1),y=e.stackIntegerValue(0),F=i(v),m=r(v),k=i(p),e.success(r(p)===m),e.failed())return null;for(f=0;m-1>=f;f++)h=16777215&F[f],2>h||(d=h>>>16&255,c=h>>>8&255,l=255&h,s=u=d,c>s&&(s=c),l>s&&(s=l),u>c&&(u=c),u>l&&(u=l),g=t(1e3*s,255),o=0===s?0:t(1e3*(s-u),s),o>0&&(b=a(d,c,l,u,s),o+=10*y,o>1e3&&(o=1e3),0>o&&(o=0),n(k,f,b,o,g)));return e.pop(3),0}function F(){var m,y,A,h,o,c,P,F,I,f,d,O,S,n,u,a,l,s,p,b,g,k,v,w,C;if(A=e.stackValue(5),h=e.stackIntegerValue(4),y=e.stackIntegerValue(3),I=e.stackValue(2),d=e.stackIntegerValue(1),F=e.stackIntegerValue(0),e.success(r(A)===h*y),e.success(r(I)===d*F),m=i(A),P=i(I),e.failed())return null;for(o=c=0,w=t(1024*h,d),C=t(1024*y,F),S=0;F-1>=S;S++){for(o=0,O=0;d-1>=O;O++)b=(1024-(1023&o))*(1024-(1023&c)),g=(1023&o)*(1024-(1023&c)),k=(1024-(1023&o))*(1023&c),v=(1023&o)*(1023&c),s=(c>>>10)*h+(o>>>10),n=m[s],u=h-1>o>>>10?m[s+1]:n,y-1>c>>>10&&(s+=h),a=m[s],l=h-1>o>>>10?m[s+1]:a,p=0,0===n&&(n=u,p+=b),0===u&&(u=n,p+=g),0===a&&(a=l,p+=k),0===l&&(l=a,p+=v),0===n&&(n=a,u=l),0===a&&(a=n,l=u),f=0,5e5>p&&(s=b*(n>>>16&255)+g*(u>>>16&255)+k*(a>>>16&255)+v*(l>>>16&255),f=(s>>>20&255)<<16,s=b*(n>>>8&255)+g*(u>>>8&255)+k*(a>>>8&255)+v*(l>>>8&255),f|=(s>>>20&255)<<8,s=b*(255&n)+g*(255&u)+k*(255&a)+v*(255&l),f|=s>>>20&255,0===f&&(f=1)),P[S*d+O]=f,o+=w;c+=C}return e.pop(6),0}function S(){var N,a,x,B,u,D,F,P,y,v,S,k,A,g,b,p,f,I,j,c,O,M,V,w,W,m,q,C,d,_,o,h,n,T,L;if(j=e.stackValue(5),V=e.stackValue(4),n=e.stackIntegerValue(3),I=i(j),M=i(V),x=r(j),q=e.stackIntegerValue(2),N=e.stackValue(1),B=e.stackValue(0),a=l(N),u=l(B),e.success(r(V)===x),e.failed())return null;for(p=t(x,n),d=Math.random(),D=s(d,q)-1,C=0;D/2-1>=C;C++)for(d=Math.random(),T=s(d,n),d=Math.random(),L=s(d,p),d=Math.random(),W=s(d,8),g=-4;4>=g;g++)for(b=-4;4>=b;b++)P=g*g+b*b,25>P&&P>0&&(y=T+g|0,S=L+b|0,y>0&&S>0&&p>S&&n>y&&(a[S*n+y]=W*(1-P/25)));for(A=1;n-2>=A;A++)for(F=1;p-2>=F;F++)o=F*n+A,a[o]=(u[o+1]+u[o-1]+u[o+n]+u[o-n]+u[o-1-n]/2+u[o-1+n]/2+u[o+1-n]/2+u[o+1+n]/2)/4-a[o],a[o]=.9*a[o];for(m=0;n*p>=m;m++)_=u[m],u[m]=a[m],a[m]=_;for(c=0;p-1>=c;c++)for(f=0;n-1>=f;f++)f>1&&n-1>f&&c>1&&p-1>c?(h=c*n+f,v=64*(a[h]-a[h-1]+(a[h+1]-a[h])),k=(a[h]-a[h-n]+(a[h+n]-a[h]))/64,2>v&&(v=-2),v>2&&(v=2),2>k&&(k=-2),k>2&&(k=2),O=(c+k)*n+(f+v)|0,w=n*p>O&&O>=0?I[O]:I[f+c*n]):w=I[f+c*n],M[f+c*n]=w;return e.pop(6),0}function O(){var S,n,s,O,k,C,c,f,y,m,w,v,V,g,A,h,I,d,p,F,b,P,a,l,o;if(v=e.stackValue(3),g=e.stackValue(2),a=e.stackIntegerValue(1),C=e.stackIntegerValue(0),w=i(v),V=i(g),b=r(v),e.success(r(g)===b),e.failed())return null;for(m=t(b,a),n=a>>1,s=m>>1,s>n?(h=n,d=s/n,p=1):(h=s,d=1,p=n>s?n/s:1),P=-3.141592653589793*C/180,I=h*h,l=0;a-1>=l;l++)for(o=0;m-1>=o;o++)c=d*(l-n),f=p*(o-s),k=c*c+f*f,I>k&&(y=1-Math.sqrt(k)/h,S=P*y*y,F=Math.sin(S),O=Math.cos(S),A=u(w,1024*((O*c-F*f)/d+n)|0,1024*((F*c+O*f)/p+s)|0,a,m),V[a*o+l]=A);return e.pop(4),0}function I(i){var t;return e=i,t=e.majorVersion()==A,t===!1?!1:t=e.minorVersion()>=P}var A=1,P=11,e=null,w="ScratchPlugin 3 November 2014 (e)";Squeak.registerExternalModule("ScratchPlugin",{primitiveCondenseSound:h,getModuleName:d,primitiveFisheye:m,primitiveWaterRipples1:S,primitiveHalfSizeDiagonal:k,primitiveScale:F,primitiveDoubleSize:p,setInterpreter:I,primitiveWhirl:O,primitiveBlur:c,primitiveBrightnessShift:f,primitiveHalfSizeAverage:v,primitiveSaturationShift:y,primitiveHueShift:g,primitiveInterpolate:b,primitiveExtractChannel:C})}),module("users.bert.SqueakJS.plugins.SoundGenerationPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function u(e,t){return 0|Math.floor(e/t)}function t(e,t){return e-u(e,t)*t|0}function h(){return v}function m(){var r,o,d,k,m,f,u,n,i,l,h,a,s,c,v,p,g,b,y;if(r=e.stackValue(3),o=e.stackInt16Array(2),d=e.stackIntegerValue(1),k=e.stackIntegerValue(0),b=e.fetchInt32ArrayofObject(7,r),y=e.fetchInt32ArrayofObject(8,r),g=e.fetchIntegerofObject(9,r),c=e.fetchIntegerofObject(10,r),s=e.fetchIntegerofObject(11,r),v=e.fetchInt16ArrayofObject(12,r),p=e.fetchInt16ArrayofObject(13,r),e.failed())return null;for(l=d;d+k-1>=l;l++){for(m=f=0,a=1;g>=a;a++)u=s-b[a-1],1>u&&(u+=c),h=y[a-1],m+=h*v[u-1],f+=h*p[u-1];n=2*l-1,i=o[n-1]+(m>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[n-1]=i,v[s-1]=i,++n,i=o[n-1]+(f>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[n-1]=i,p[s-1]=i,s=t(s,c)+1}return e.failed()?null:(e.storeIntegerofObjectwithValue(11,r,s),void e.pop(3))}function s(){var i,k,c,S,y,b,A,l,O,I,r,p,f,d,m,s,v,o,g,a,n,h,u,F;if(i=e.stackValue(5),k=e.stackIntegerValue(4),c=e.stackInt16Array(3),S=e.stackIntegerValue(2),y=e.stackIntegerValue(1),b=e.stackIntegerValue(0),a=e.fetchIntegerofObject(3,i),n=e.fetchIntegerofObject(4,i),h=e.fetchIntegerofObject(5,i),d=e.fetchIntegerofObject(7,i),F=e.fetchInt16ArrayofObject(8,i),u=e.fetchIntegerofObject(9,i),s=e.fetchIntegerofObject(10,i),v=e.fetchIntegerofObject(11,i),m=e.fetchIntegerofObject(14,i),o=e.fetchIntegerofObject(15,i),g=e.fetchIntegerofObject(16,i),e.failed())return null;for(A=0!==m&&0!==g,O=S+k-1,f=S;O>=f;f++)p=a*F[s>>15]>>15,A?(I=m*F[o>>15],o=t(o+g,u),0>o&&(o+=u),s=t(s+v+I,u),0>s&&(s+=u)):s=t(s+v,u),y>0&&(l=2*f-1,r=c[l-1]+(p*y>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[l-1]=r),b>0&&(l=2*f,r=c[l-1]+(p*b>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[l-1]=r),0!==n&&(a+=n,(n>0&&a>=h||0>n&&h>=a)&&(a=h,n=0)); return d-=k,e.failed()?null:(e.storeIntegerofObjectwithValue(3,i,a),e.storeIntegerofObjectwithValue(4,i,n),e.storeIntegerofObjectwithValue(7,i,d),e.storeIntegerofObjectwithValue(10,i,s),e.storeIntegerofObjectwithValue(15,i,o),void e.pop(5))}function n(){var t,I,c,b,m,k,F,S,u,x,q,j,h,v,O,r,n,P,l,A,p,V,w,y,o,C,g,s,a,d;if(t=e.stackValue(5),I=e.stackIntegerValue(4),c=e.stackInt16Array(3),b=e.stackIntegerValue(2),m=e.stackIntegerValue(1),k=e.stackIntegerValue(0),s=e.fetchIntegerofObject(3,t),a=e.fetchIntegerofObject(4,t),d=e.fetchIntegerofObject(5,t),l=e.fetchIntegerofObject(7,t),w=e.fetchIntegerofObject(8,t),p=e.fetchInt16ArrayofObject(10,t),y=e.fetchInt16ArrayofObject(11,t),A=e.fetchIntegerofObject(16,t),V=e.fetchIntegerofObject(17,t),g=e.fetchIntegerofObject(18,t),o=e.fetchIntegerofObject(19,t),C=e.fetchIntegerofObject(20,t),e.failed())return null;for(x=p!==y,F=m*s>>15,S=k*s>>15,u=2*b-1,q=b+I-1,P=b;q>=P;P++){if(n=(o+=C)>>9,n>V&&l>w&&(n=(o-=g)>>9),(v=n+1)>A){if(n>A)return l=0,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,s),e.storeIntegerofObjectwithValue(4,t,a),e.storeIntegerofObjectwithValue(7,t,l),e.storeIntegerofObjectwithValue(19,t,o),e.popthenPush(6,null),null);v=0===g?n:(o-g>>9)+1}h=o&f,O=j=p[n-1]*(i-h)+p[v-1]*h>>9,x&&(O=y[n-1]*(i-h)+y[v-1]*h>>9),m>0&&(r=c[u-1]+(F*j>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[u-1]=r),++u,k>0&&(r=c[u-1]+(S*O>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[u-1]=r),++u,0!==a&&(s+=a,(a>0&&s>=d||0>a&&d>=s)&&(s=d,a=0),F=m*s>>15,S=k*s>>15)}return l-=I,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,s),e.storeIntegerofObjectwithValue(4,t,a),e.storeIntegerofObjectwithValue(7,t,l),e.storeIntegerofObjectwithValue(19,t,o),void e.pop(5))}function a(){var t,m,u,F,d,y,b,a,S,i,k,r,o,l,v,f,h,O,g,n,s,c;if(t=e.stackValue(5),m=e.stackIntegerValue(4),u=e.stackInt16Array(3),F=e.stackIntegerValue(2),d=e.stackIntegerValue(1),y=e.stackIntegerValue(0),n=e.fetchIntegerofObject(3,t),s=e.fetchIntegerofObject(4,t),c=e.fetchIntegerofObject(5,t),v=e.fetchIntegerofObject(7,t),f=e.fetchInt16ArrayofObject(8,t),h=e.fetchIntegerofObject(9,t),O=e.fetchIntegerofObject(10,t),g=e.fetchIntegerofObject(11,t),e.failed())return null;for(S=F+m-1,o=r=h,l=F;S>=l;l++)r=o+O,r>=g&&(r=p+(r-g)),b=f[(o>>15)-1]+f[(r>>15)-1]>>1,f[(o>>15)-1]=b,k=b*n>>15,o=r,d>0&&(a=2*l-1,i=u[a-1]+(k*d>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),u[a-1]=i),y>0&&(a=2*l,i=u[a-1]+(k*y>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),u[a-1]=i),0!==s&&(n+=s,(s>0&&n>=c||0>s&&c>=n)&&(n=c,s=0));return h=r,v-=m,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,n),e.storeIntegerofObjectwithValue(4,t,s),e.storeIntegerofObjectwithValue(7,t,v),e.storeIntegerofObjectwithValue(9,t,h),void e.pop(5))}function o(){var t,h,o,v,k,b,a,S,l,g,i,p,c,m,u,F,O,y,r,n,s,f;if(t=e.stackValue(5),h=e.stackIntegerValue(4),o=e.stackInt16Array(3),v=e.stackIntegerValue(2),k=e.stackIntegerValue(1),b=e.stackIntegerValue(0),n=e.fetchIntegerofObject(3,t),s=e.fetchIntegerofObject(4,t),f=e.fetchIntegerofObject(5,t),m=e.fetchIntegerofObject(7,t),F=e.fetchInt16ArrayofObject(8,t),O=e.fetchIntegerofObject(10,t),r=e.fetchIntegerofObject(11,t),u=e.fetchIntegerofObject(12,t),y=e.fetchIntegerofObject(13,t),e.failed())return null;for(S=v+h-1,l=v,c=u+(r>>>16);O>=c&&S>=l;)p=F[c-1]*n>>15,k>0&&(a=2*l-1,i=o[a-1]+(p*k>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[a-1]=i),b>0&&(a=2*l,i=o[a-1]+(p*b>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[a-1]=i),0!==s&&(n+=s,(s>0&&n>=f||0>s&&f>=n)&&(n=f,s=0)),r+=y,r>=d&&(g=r>>>16,u+=g,r-=g<<16),c=u+(r>>>16),++l;return m-=h,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,n),e.storeIntegerofObjectwithValue(4,t,s),e.storeIntegerofObjectwithValue(7,t,m),e.storeIntegerofObjectwithValue(11,t,r),e.storeIntegerofObjectwithValue(12,t,u),void e.pop(5))}function r(i){var t;return e=i,t=e.majorVersion()==l,t===!1?!1:t=e.minorVersion()>=c}var l=1,c=11,f=511,i=512,p=32768,d=536870912,e=null,v="SoundGenerationPlugin 3 November 2014 (e)";Squeak.registerExternalModule("SoundGenerationPlugin",{primitiveMixFMSound:s,primitiveMixSampledSound:o,setInterpreter:r,getModuleName:h,primitiveApplyReverb:m,primitiveMixPluckedSound:a,primitiveMixLoopedSampledSound:n})}),module("users.bert.SqueakJS.plugins.StarSqueakPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function t(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function r(e,t){return 0|Math.floor(e/t)}function a(t,e){return 0>e?-31>e?0:t>>>0-e:e>31?0:t<=a;a++)for(m=a-n,0>m&&(m=0),p=a+n,p>=u&&(p=u-1),o=0;s-1>=o;o++){for(d=o-n,0>d&&(d=0),h=o+n,h>=s&&(h=s-1),v=0,c=m;p>=c;c++)for(b=c*s,f=d;h>=f;f++)v+=g[b+f];y[a*s+o]=r(v,F)}e.pop(5)}function h(){var r,s,n,a,o;if(n=e.stackValue(1),a=e.stackIntegerValue(0),s=i(n),o=t(n),e.failed())return null;for(r=0;o-1>=r;r++)s[r]=s[r]*a>>>10;e.pop(2)}function o(){var S,d,c,k,u,v,s,g,p,o,l,b,y,F,m,n,f,h;if(m=e.stackValue(6),c=e.stackValue(5),n=e.stackIntegerValue(4),k=e.stackIntegerValue(3),s=e.stackIntegerValue(2),p=e.stackIntegerValue(1),b=e.stackIntegerValue(0),y=i(m),S=i(c),e.success(t(c)===n*k),e.success(t(c)===t(m)*s*s),e.failed())return null;for(o=0,(4&p)>0&&(o+=65536),(2&p)>0&&(o+=256),(1&p)>0&&++o,F=-1,h=0;h<=r(k,s)-1;h++)for(f=0;f<=r(n,s)-1;f++)for(u=a(y[++F],b),u>255&&(u=255),g=0>=u?1:u*o,v=(h*n+f)*s,l=v;v+(s-1)*n>=l;l+=n)for(d=l;l+s-1>=d;d++)S[d]=g;e.pop(7)}function u(i){var t;return e=i,t=e.majorVersion()==l,t===!1?!1:t=e.minorVersion()>=c}var l=1,c=11,e=null,f="StarSqueakPlugin 3 November 2014 (e)";Squeak.registerExternalModule("StarSqueakPlugin",{primitiveDiffuseFromToWidthHeightDelta:n,primitiveEvaporateRate:h,setInterpreter:u,primitiveMapFromToWidthHeightPatchSizeRgbFlagsShift:o,getModuleName:s})}),module("users.bert.SqueakJS.plugins.ZipPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function M(t){return"number"==typeof t?e.classSmallInteger():t.sqClass}function i(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function k(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function Pt(e,t){return 0|Math.floor(e/t)}function J(e,t){return e-Pt(e,t)*t|0}function F(t,e){return e>31?0:t<31?0:t>>>e}function St(t,i,s){var e;if(r[t+s]!==r[i+s])return 0;if(r[t+s-1]!==r[i+s-1])return 0;if(r[t]!==r[i])return 0;if(r[t+1]!==r[i+1])return 1;for(e=2;V>e&&r[t+e]===r[i+e];)++e;return e}function yt(l,h,p){var s,a,e,t,o,f,i,u,d;if(m>l)return!1;if(n>=v)return!0;for(a=!1,e=m;l>=e;){if(a||(i=R(e,c-1,e,h,p),j(e),o=65535&i,t=i>>>16),i=R(e+1,t,o,h,p),d=65535&i,u=i>>>16,t>=u&&t>=c){for(s=vt(t,e-o),f=1;t-1>=f;f++)j(++e);a=!1,++e}else s=kt(r[e]),++e,l>=e&&!s&&(j(e),a=!0,o=d,t=u);if(s)return m=e,!0}return m=e,!1}function bt(t){var e;for(e=M(t);!e.isNil&&e.classInstSize()>=13;)e=e.superclass();return e.isNil?!1:(s=e.classInstSize(),!0)}function z(i){var e;for(e=M(i);!e.isNil&&e.classInstSize()>=7;)e=e.superclass();return e.isNil?!1:(t=e.classInstSize(),!0)}function kt(e){return w[n]=e,I[n]=0,A[e]++,++n,n===v||0===(4095&n)&&W()}function vt(t,e){var i,r;return w[n]=t-c,I[n]=e,r=G[t-c],A[r]++,i=257>e?b[e-1]:b[256+(e-1>>>7)],q[i]++,++n,++h,n===v||0===(4095&n)&&W()}function R(e,n,p,h,f){var s,u,a,r,o,i,t;if(t=n<<16|p,n>=V)return t;if(i=y[B(e+c-1)],a=e-i,!(a>0&&S>a))return t;for(u=h,o=e>S?e-S:0,s=n;;){if(r=St(e,i,s),e+r>l&&(r=l-e),r===c&&e-i>S>>2&&(r=c-1),r>s){if(t=r<<16|i,s=r,s>=V)return t;if(s>f)return t}if(!(--u>0))return t;if(i=C[i&_],o>=i)return t}}function ht(){return At}function j(e){var t;d=B(e+c-1),t=y[d],y[d]=e,C[e&_]=t}function ft(a){var s;if(!(e.isPointers(a)&&i(a)>=15))return!1;if(s=e.fetchPointerofObject(0,a),!e.isBytes(s))return!1;if(0===t){if(!z(a))return!1;if(i(a)=v?(I=s.words,s=e.fetchPointerofObject(t+7,a),e.isWords(s)&&i(s)===nt?(A=s.words,s=e.fetchPointerofObject(t+8,a),e.isWords(s)&&i(s)===st?(q=s.words,n=e.fetchIntegerofObject(t+9,a),h=e.fetchIntegerofObject(t+10,a),!e.failed()):!1):!1):!1):!1):!1):!1}function ut(s){var n;if(0===t){if(!z(s))return!1;if(i(s)=t+3?(n=e.fetchPointerofObject(0,s),e.isBytes(n)?(r=n.bytes,p=k(n),l=e.fetchIntegerofObject(1,s),u=e.fetchIntegerofObject(2,s),o=e.fetchIntegerofObject(t+1,s),a=e.fetchIntegerofObject(t+2,s),!e.failed()):e.primitiveFail()):!1}function g(i,t){if(!(t>=0&&F(1,i)>t))return e.primitiveFail();for(o|=F(t,a),a+=i;a>=8&&p>l;)r[l]=255&o,++l,o>>>=8,a-=8}function at(){var r,s,a,i,o;return 3!==e.methodArgumentCount()?e.primitiveFail():(s=e.stackIntegerValue(0),r=e.stackIntegerValue(1),a=e.stackIntegerValue(2),i=e.stackObjectValue(3),e.failed()?null:ft(i)?(o=yt(a,r,s),e.failed()||(e.storeIntegerofObjectwithValue(t+2,i,d),e.storeIntegerofObjectwithValue(t+3,i,m),e.storeIntegerofObjectwithValue(t+9,i,n),e.storeIntegerofObjectwithValue(t+10,i,h)),void(e.failed()||(e.pop(4),e.pushBool(o)))):e.primitiveFail())}function it(){var s,n,t,r,a,o;if(2!==e.methodArgumentCount())return e.primitiveFail();if(s=e.stackIntegerValue(0),r=e.stackObjectValue(1),e.failed())return null;if(!e.isWords(r))return e.primitiveFail();for(o=i(r),a=r.wordsAsInt32Array(),t=0;o-1>=t;t++)n=a[t],a[t]=n>=s?n-s:0;e.pop(2)}function tt(){var n,t;if(2!==e.methodArgumentCount())return e.primitiveFail();if(n=e.stackValue(0),!e.isWords(n))return e.primitiveFail();if(D=n.words,T=i(n),n=e.stackValue(1),!e.isWords(n))return e.primitiveFail();if(E=n.words,K=i(n),t=e.stackValue(2),!e.isPointers(t))return e.primitiveFail();if(0===s){if(!bt(t))return e.primitiveFail();if(i(t)=r&&r>0))return e.primitiveFail();if(c=k(n),!(c>=s))return e.primitiveFail();for(l=n.bytes,--r,--s,i=65535&t,o=t>>>16&65535,a=r;s>=a;a++)u=l[a],i=J(i+u,65521),o=J(o+i,65521);t=(o<<16)+i,e.popthenPush(5,e.positive32BitIntegerFor(t))}function $(){var a,s,t,n,o,i,r;if(4!==e.methodArgumentCount())return e.primitiveFail();if(s=e.stackObjectValue(0),r=e.stackIntegerValue(1),i=e.stackIntegerValue(2),t=e.positive32BitValueOf(e.stackValue(3)),e.failed())return 0;if(!(e.isBytes(s)&&r>=i&&i>0))return e.primitiveFail();if(o=k(s),!(o>=r))return e.primitiveFail();for(a=s.bytes,--i,--r,n=i;r>=n;n++)t=wt[255&(t^a[n])]^t>>>8;e.popthenPush(5,e.positive32BitIntegerFor(t))}function Q(){var r,n,u,c,t,f;return 4!==e.methodArgumentCount()?e.primitiveFail():(n=e.stackObjectValue(0),c=e.stackObjectValue(1),r=e.stackObjectValue(2),u=e.stackObjectValue(3),t=e.stackObjectValue(4),e.failed()?null:ut(t)&&e.isPointers(n)&&i(n)>=2&&e.isPointers(c)&&i(c)>=2&&e.isPointers(u)&&i(u)>=3&&e.isPointers(r)&&i(r)>=3?(f=X(u,r,c,n),e.failed()||(e.storeIntegerofObjectwithValue(1,t,l),e.storeIntegerofObjectwithValue(s+1,t,o),e.storeIntegerofObjectwithValue(s+2,t,a)),void(e.failed()||(e.pop(5),e.pushInteger(f)))):e.primitiveFail())}function X(h,d,P,O){var r,n,w,A,F,S,o,a,I,m,u,s,y,v,t,f;if(t=e.fetchPointerofObject(0,h),s=e.fetchIntegerofObject(1,h),u=e.fetchIntegerofObject(2,h),!(u>=s&&e.isBytes(t)&&u<=k(t)))return e.primitiveFail();if(I=t.bytes,t=e.fetchPointerofObject(0,d),!(e.isWords(t)&&u<=i(t)&&e.fetchIntegerofObject(1,d)===s&&e.fetchIntegerofObject(2,d)===u))return e.primitiveFail();if(w=t.words,t=e.fetchPointerofObject(0,P),!e.isWords(t))return e.primitiveFail();if(m=i(t),y=t.words,t=e.fetchPointerofObject(1,P),!e.isWords(t)||m!==i(t))return e.primitiveFail();if(v=t.words,t=e.fetchPointerofObject(0,O),!e.isWords(t))return e.primitiveFail();if(F=i(t),A=t.words,t=e.fetchPointerofObject(1,O),!e.isWords(t)||F!==i(t))return e.primitiveFail();for(S=t.words,g(0,0),f=0;u>s&&p>l+4;)if(a=I[s],n=w[s],++s,0===n){if(++f,!(m>a))return e.primitiveFail();g(y[a],v[a])}else{if(f=f+a+c,!(256>a))return e.primitiveFail();if(r=G[a],!(m>r))return e.primitiveFail();if(g(y[r],v[r]),o=ct[r-257],0!==o&&(a-=Z[r-257],g(o,a)),--n,!(32768>n))return e.primitiveFail();if(r=256>n?b[n]:b[256+(n>>>7)],!(F>r))return e.primitiveFail();g(A[r],S[r]),o=lt[r],0!==o&&(n-=Y[r],g(o,n))}return e.failed()?null:(e.storeIntegerofObjectwithValue(1,h,s),e.storeIntegerofObjectwithValue(1,d,s),f)}function H(i){var t;return e=i,t=e.majorVersion()==rt,t===!1?!1:t=e.minorVersion()>=ot}function W(){var e;return n===v?!0:0!==(4095&n)?!1:n>=10*h?!1:(e=n-h,h>=e?!1:h>=4*e)}function pt(e){return(d<<5^e)&dt}function B(e){return pt(r[e])}function L(n,o){var a,t,r,s,i;if(t=n[0]>>>24,t>N)return e.primitiveFail(),0;for(s=2;;){if(a=x(t),r=s+a-1,r>=o)return e.primitiveFail(),0;if(i=n[r],0===(1056964608&i))return i;if(s=65535&i,t=i>>>24&255,t>N)return e.primitiveFail(),0}return 0}function It(){var n,c,t,i,s,l,h,d,m,v,e;for(l=p-1;l>u&&P>=f;)if(d=o,h=a,m=f,e=L(E,K),256>e)r[++u]=e;else{if(256===e)return O&=Ft,0;if(t=(e>>>16)-1,s=65535&e,t>0&&(s+=x(t)),e=L(D,T),t=e>>>16,n=65535&e,t>0&&(n+=x(t)),u+s>=l)return o=d,a=h,f=m,0;for(c=u,v=u-n,i=1;s>=i;i++)r[c+i]=r[v+i];u+=s}}function x(e){for(var t,i;e>a;)i=U[++f],o+=F(i,a),a+=8;return t=o&F(1,e)-1,o=Ot(o,e),a-=e,t}var rt=1,ot=11,dt=32767,gt=32768,S=32768,st=30,nt=286,V=258,c=3,_=32767,mt=32768,N=16,Ft=1,e=null,At="ZipPlugin 3 November 2014 (e)",s=0,t=0,Y=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Z=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],o=0,a=0,m=0,r=null,p=0,wt=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],D=null,T=0,b=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29],q=null,I=null,lt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ct=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],y=null,C=null,d=0,E=null,K=0,n=0,A=null,v=0,w=null,h=0,G=[257,258,259,260,261,262,263,264,265,265,266,266,267,267,268,268,269,269,269,269,270,270,270,270,271,271,271,271,272,272,272,272,273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284],l=0,u=0,U=null,P=0,f=0,O=0;Squeak.registerExternalModule("ZipPlugin",{primitiveZipSendBlock:Q,primitiveUpdateAdler32:et,primitiveUpdateGZipCrc32:$,primitiveDeflateUpdateHashTable:it,setInterpreter:H,getModuleName:ht,primitiveDeflateBlock:at,primitiveInflateDecompressBlock:tt})});var LZString={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_f:String.fromCharCode,compressToBase64:function(e){if(null==e)return"";var s,i,r,u,l,a,n,o="",t=0;for(e=LZString.compress(e);t<2*e.length;)t%2==0?(s=e.charCodeAt(t/2)>>8,i=255&e.charCodeAt(t/2),r=t/2+1>8:0/0):(s=255&e.charCodeAt((t-1)/2),(t+1)/2>8,r=255&e.charCodeAt((t+1)/2)):i=r=0/0),t+=3,u=s>>2,l=(3&s)<<4|i>>4,a=(15&i)<<2|r>>6,n=63&r,isNaN(i)?a=n=64:isNaN(r)&&(n=64),o=o+LZString._keyStr.charAt(u)+LZString._keyStr.charAt(l)+LZString._keyStr.charAt(a)+LZString._keyStr.charAt(n);return o},decompressFromBase64:function(e){if(null==e)return"";var t,a,o,u,h,c,r,s,n="",f=0,i=0,l=LZString._f;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,o=(15&c)<<4|r>>2,u=(3&r)<<6|s,f%2==0?(t=a<<8,64!=r&&(n+=l(t|o)),64!=s&&(t=u<<8)):(n+=l(t|a),64!=r&&(t=o<<8),64!=s&&(n+=l(t|u))),f+=3;return LZString.decompress(n)},compressToUTF16:function(s){if(null==s)return"";var n,e,t,i="",a=0,r=LZString._f;for(s=LZString.compress(s),n=0;n>1)+32),t=(1&e)<<14;break;case 1:i+=r(t+(e>>2)+32),t=(3&e)<<13;break;case 2:i+=r(t+(e>>3)+32),t=(7&e)<<12;break;case 3:i+=r(t+(e>>4)+32),t=(15&e)<<11;break;case 4:i+=r(t+(e>>5)+32),t=(31&e)<<10;break;case 5:i+=r(t+(e>>6)+32),t=(63&e)<<9;break;case 6:i+=r(t+(e>>7)+32),t=(127&e)<<8;break;case 7:i+=r(t+(e>>8)+32),t=(255&e)<<7;break;case 8:i+=r(t+(e>>9)+32),t=(511&e)<<6;break;case 9:i+=r(t+(e>>10)+32),t=(1023&e)<<5;break;case 10:i+=r(t+(e>>11)+32),t=(2047&e)<<4;break;case 11:i+=r(t+(e>>12)+32),t=(4095&e)<<3;break;case 12:i+=r(t+(e>>13)+32),t=(8191&e)<<2;break;case 13:i+=r(t+(e>>14)+32),t=(16383&e)<<1;break;case 14:i+=r(t+(e>>15)+32,(32767&e)+32),a=0}return i+r(t+32)},decompressFromUTF16:function(s){if(null==s)return"";for(var t,e,i="",a=0,n=0,r=LZString._f;n>14),t=(16383&e)<<2;break;case 2:i+=r(t|e>>13),t=(8191&e)<<3;break;case 3:i+=r(t|e>>12),t=(4095&e)<<4;break;case 4:i+=r(t|e>>11),t=(2047&e)<<5;break;case 5:i+=r(t|e>>10),t=(1023&e)<<6;break;case 6:i+=r(t|e>>9),t=(511&e)<<7;break;case 7:i+=r(t|e>>8),t=(255&e)<<8;break;case 8:i+=r(t|e>>7),t=(127&e)<<9;break;case 9:i+=r(t|e>>6),t=(63&e)<<10;break;case 10:i+=r(t|e>>5),t=(31&e)<<11;break;case 11:i+=r(t|e>>4),t=(15&e)<<12;break;case 12:i+=r(t|e>>3),t=(7&e)<<13;break;case 13:i+=r(t|e>>2),t=(3&e)<<14;break;case 14:i+=r(t|e>>1),t=(1&e)<<15;break;case 15:i+=r(t|e),a=0}n++}return LZString.decompress(i)},compress:function(d){if(null==d)return"";var i,r,p,c={},f={},l="",h="",s="",o=2,m=3,n=2,a="",e=0,t=0,u=LZString._f;for(p=0;pi;i++)e<<=1,15==t?(t=0,a+=u(e),e=0):t++;for(r=s.charCodeAt(0),i=0;8>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1}else{for(r=1,i=0;n>i;i++)e=e<<1|r,15==t?(t=0,a+=u(e),e=0):t++,r=0;for(r=s.charCodeAt(0),i=0;16>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1}o--,0==o&&(o=Math.pow(2,n),n++),delete f[s]}else for(r=c[s],i=0;n>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1;o--,0==o&&(o=Math.pow(2,n),n++),c[h]=m++,s=String(l)}if(""!==s){if(Object.prototype.hasOwnProperty.call(f,s)){if(s.charCodeAt(0)<256){for(i=0;n>i;i++)e<<=1,15==t?(t=0,a+=u(e),e=0):t++;for(r=s.charCodeAt(0),i=0;8>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1}else{for(r=1,i=0;n>i;i++)e=e<<1|r,15==t?(t=0,a+=u(e),e=0):t++,r=0;for(r=s.charCodeAt(0),i=0;16>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1}o--,0==o&&(o=Math.pow(2,n),n++),delete f[s]}else for(r=c[s],i=0;n>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1;o--,0==o&&(o=Math.pow(2,n),n++)}for(r=2,i=0;n>i;i++)e=e<<1|1&r,15==t?(t=0,a+=u(e),e=0):t++,r>>=1;for(;;){if(e<<=1,15==t){a+=u(e);break}t++}return a},decompress:function(d){if(null==d)return"";if(""==d)return null;var v,f,l,i,s,r,t,n,a=[],o=4,u=4,h=3,c="",m="",p=LZString._f,e={string:d,val:d.charCodeAt(0),position:32768,index:1};for(f=0;3>f;f+=1)a[f]=f;for(i=0,r=Math.pow(2,2),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;switch(v=i){case 0:for(i=0,r=Math.pow(2,8),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;n=p(i);break;case 1:for(i=0,r=Math.pow(2,16),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;n=p(i);break;case 2:return""}for(a[3]=n,l=m=n;;){if(e.index>e.string.length)return"";for(i=0,r=Math.pow(2,h),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;switch(n=i){case 0:for(i=0,r=Math.pow(2,8),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;a[u++]=p(i),n=u-1,o--;break;case 1:for(i=0,r=Math.pow(2,16),t=1;t!=r;)s=e.val&e.position,e.position>>=1,0==e.position&&(e.position=32768,e.val=e.string.charCodeAt(e.index++)),i|=(s>0?1:0)*t,t<<=1;a[u++]=p(i),n=u-1,o--;break;case 2:return m}if(0==o&&(o=Math.pow(2,h),h++),a[n])c=a[n];else{if(n!==u)return null;c=l+l.charAt(0)}m+=c,a[u++]=l+c.charAt(0),o--,l=c,0==o&&(o=Math.pow(2,h),h++)}}};"undefined"!=typeof module&&null!=module&&(module.exports=LZString); //# sourceMappingURL=squeak.min.js.map