diff --git a/armory2d/d3d11/krom.js b/armory2d/d3d11/krom.js index e538e68..086aac4 100644 --- a/armory2d/d3d11/krom.js +++ b/armory2d/d3d11/krom.js @@ -1 +1 @@ -!function(e,n){"use strict";e.kha=e.kha||{},e.kha.input=e.kha.input||{};function i(){return g.__string_rec(this,"")}var t,x={},f=f||{};function r(e,t){var i=Object.create(e);for(var n in t)i[n]=t[n];return t.toString!==Object.prototype.toString&&(i.toString=t.toString),i}function it(){}(x.HxOverrides=it).__name__=!0,it.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;case 10:var n=e.split("-");return new Date(n[0],n[1]-1,n[2],0,0,0);case 19:var r=e.split(" "),s=r[0].split("-"),a=r[1].split(":");return new Date(s[0],s[1]-1,s[2],a[0],a[1],a[2]);default:throw new ft("Invalid date format : "+e)}},it.cca=function(e,t){var i=e.charCodeAt(t);if(i==i)return i},it.substr=function(e,t,i){if(null==i)i=e.length;else if(i<0){if(0!=t)return"";i=e.length+i}return e.substr(t,i)},it.remove=function(e,t){var i=e.indexOf(t);return-1!=i&&(e.splice(i,1),!0)},it.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.curb.get_primary().get_width()&&(e=b.get_primary().get_width()),t>b.get_primary().get_height()-30&&(t=b.get_primary().get_height()-30)),pt.start(new K("Armory2D",e,t,null,new P(null,null,null,null,null,2)),nt.initialized)},nt.initialized=function(e){nt.prefs={path:"",scaleFactor:1,keyMap:{selectMouseButton:"Left",grabKey:71,rotateKey:82,sizeKey:83,slowMovement:16,gridInvert:17,gridInvertRelative:18}};var t=Krom.getArgCount();if(4r&&this.ui.inputXthis.get_toolbarw()&&(this.selectedFrame=(this.ui.inputX-this.get_toolbarw())/11/this.ui.ops.scaleFactor|0)}X.update(this.ui,this.cui,this.canvas),Ii.show&&Ii.update(),this.updateFiles()}},updateCanvas:function(){if(!(ot.showFiles||this.ui.inputX>pt.windowWidth()-ot.get_uiw())){if(X.selectElement(this.canvas),!X.isManipulating&&(this.ui.inputDownR&&(ot.coffX+=0|this.ui.inputDX,ot.coffY+=0|this.ui.inputDY),0!=this.ui.inputWheelDelta)){var e=this.zoom;this.zoom+=-this.ui.inputWheelDelta/10,this.zoom<.4?this.zoom=.4:1n||this.ui.inputYs)&&(ot.showFiles=!1)}},renderFiles:function(e){var t=pt.windowWidth(),i=pt.windowHeight(),n=t/2-ot.modalW/2,r=i/2-ot.modalH/2;e.begin(!1),e.set_color(-14671840),e.fillRect(n,r,ot.modalW,ot.modalH),e.end();var s=t/2-ot.modalRectW/2|0,a=t/2+ot.modalRectW/2|0,o=i/2-ot.modalRectH/2|0,l=i/2+ot.modalRectH/2|0;if(o+=ot.modalHeaderH,this.uimodal.begin(e),this.uimodal.window(At.global.nest(63,null),s,o,ot.modalRectW,ot.modalRectH-100)){var u=At.global.nest(64,null);u.text=this.uimodal.textInput(u),ot.path=Bi.fileBrowser(this.uimodal,u,ot.foldersOnly)}this.uimodal.end(!1),e.begin(!1),this.uimodal.beginRegion(e,a-100,l-30,100),this.uimodal.button("OK")&&(ot.showFiles=!1,ot.filesDone(ot.path)),this.uimodal.endRegion(!1),this.uimodal.beginRegion(e,a-200,l-30,100),this.uimodal.button("Cancel")&&(ot.showFiles=!1),this.uimodal.endRegion(),e.end()},scaled:function(e){return e*this.cui.ops.scaleFactor|0},__class__:ot,__properties__:{get_toolbarw:"get_toolbarw"}};var X=function(){};(x["arm2d.ElementController"]=X).__name__=!0,X.__properties__={get_handleSize:"get_handleSize"},X.get_handleSize=function(){return 8*X.ui.ops.scaleFactor|0},X.initialize=function(e,t){X.ui=e,X.cui=t},X.selectElement=function(e){if(null!=X.ui){var t=nt.prefs.keyMap.selectMouseButton;if("Left"==t&&X.ui.inputStarted&&X.ui.inputDown||"Right"==t&&X.ui.inputStartedR&&X.ui.inputDownR){var i=ot.selectedElem;ot.selectedElem=null;var n=e.elements.slice();n.reverse();for(var r=0;r_&&u.x<_+(8*X.ui.ops.scaleFactor|0)||g)&&(u.y>f&&u.yi.x+s+o-(8*X.ui.ops.scaleFactor|0)?X.dragRight=!0:u.xi.y+a+l-(8*X.ui.ops.scaleFactor|0)?X.dragBottom=!0:u.y=n.length);)if(n[r].parent==s){it.remove(n,t),n.splice(r,0,t);break}},ht.removeElem=function(e,t){if(null!=t.children)for(var i=0,n=t.children;it&&o.xi&&o.y=this.length)throw new ft("Invalid object");if(103==this.buf.charCodeAt(this.pos))break;var t=this.unserialize();if("string"!=typeof t)throw new ft("Invalid object key");var i=this.unserialize();e[t]=i}this.pos++},unserializeEnum:function(e,t){if(58!=this.buf.charCodeAt(this.pos++))throw new ft("Invalid enum format");var i=this.readDigits();if(0==i)return T.createEnum(e,t);for(var n=[];0=this.scache.length)throw new ft("Invalid string reference");return this.scache[u];case 97:this.buf;var h=[];for(this.cache.push(h);;){var c=this.buf.charCodeAt(this.pos);if(104==c){this.pos++;break}if(117==c){this.pos++;var A=this.readDigits();h[h.length+A-1]=null}else h.push(this.unserialize())}return h;case 98:var d=new ie;this.cache.push(d);for(this.buf;104!=this.buf.charCodeAt(this.pos);){var _=this.unserialize(),f=this.unserialize();null!=Di[_]?d.setReserved(_,f):d.h[_]=f}return this.pos++,d;case 99:var g=this.unserialize(),p=this.resolver.resolveClass(g);if(null==p)throw new ft("Class not found "+g);var m=Object.create(p.prototype);return this.cache.push(m),this.unserializeObject(m),m;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:var v=this.unserialize(),w=this.resolver.resolveEnum(v);if(null==w)throw new ft("Enum not found "+v);this.pos++;var b=this.readDigits(),y=w.__constructs__.slice()[b];if(null==y)throw new ft("Unknown enum index "+v+"@"+b);var x=this.unserializeEnum(w,y);return this.cache.push(x),x;case 107:return NaN;case 108:var T=new ee;this.cache.push(T);for(this.buf;104!=this.buf.charCodeAt(this.pos);)T.add(this.unserialize());return this.pos++,T;case 109:return-1/0;case 110:return null;case 111:var S={};return this.cache.push(S),this.unserializeObject(S),S;case 112:return 1/0;case 113:var E=new $;this.cache.push(E);this.buf;for(var B=this.buf.charCodeAt(this.pos++);58==B;){var k=this.readDigits(),I=this.unserialize();E.h[k]=I,B=this.buf.charCodeAt(this.pos++)}if(104!=B)throw new ft("Invalid IntMap format");return E;case 114:var C=this.readDigits();if(C<0||C>=this.cache.length)throw new ft("Invalid reference");return this.cache[C];case 115:var L=this.readDigits(),N=this.buf;if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>2)+(2<=M?M-1:0))),V=0;P>4;var H=F[N.charCodeAt(P++)];O.b[V++]=U<<4|H>>2;var W=F[N.charCodeAt(P++)];O.b[V++]=H<<6|W}if(2<=M){var G=F[N.charCodeAt(P++)],z=F[N.charCodeAt(P++)];if(O.b[V++]=G<<2|z>>4,3==M){var X=F[N.charCodeAt(P++)];O.b[V++]=z<<4|X>>2}}return this.pos+=L,this.cache.push(O),O;case 116:return!0;case 118:var Y;return 48<=this.buf.charCodeAt(this.pos)&&this.buf.charCodeAt(this.pos)<=57&&48<=this.buf.charCodeAt(this.pos+1)&&this.buf.charCodeAt(this.pos+1)<=57&&48<=this.buf.charCodeAt(this.pos+2)&&this.buf.charCodeAt(this.pos+2)<=57&&48<=this.buf.charCodeAt(this.pos+3)&&this.buf.charCodeAt(this.pos+3)<=57&&45==this.buf.charCodeAt(this.pos+4)?(Y=it.strDate(it.substr(this.buf,this.pos,19)),this.pos+=19):Y=new Date(this.readFloat()),this.cache.push(Y),Y;case 119:var K=this.unserialize(),Q=this.resolver.resolveEnum(K);if(null==Q)throw new ft("Enum not found "+K);var q=this.unserializeEnum(Q,this.unserialize());return this.cache.push(q),q;case 120:throw ft.wrap(this.unserialize());case 121:var j=this.readDigits();if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>8}return new he(i.buffer)}for(var o=[],l=0;l>6):(u<=65535?o.push(224|u>>12):(o.push(240|u>>18),o.push(128|u>>12&63)),o.push(128|u>>6&63)),o.push(128|63&u))}return new he(new Uint8Array(o).buffer)},he.ofData=function(e){var t=e.hxBytes;return null!=t?t:new he(e)},he.prototype={length:null,b:null,data:null,blit:function(e,t,i,n){if(e<0||i<0||n<0||e+n>this.length||i+n>t.length)throw new ft(d.OutsideBounds);0==i&&n==t.b.byteLength?this.b.set(t.b,e):this.b.set(t.b.subarray(i,i+n),e)},sub:function(e,t){if(e<0||t<0||e+t>this.length)throw new ft(d.OutsideBounds);return new he(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getDouble:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat64(e,!0)},getFloat:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat32(e,!0)},setDouble:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat64(e,t,!0)},setFloat:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat32(e,t,!0)},getUInt16:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getUint16(e,!0)},getInt32:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getInt32(e,!0)},setInt32:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setInt32(e,t,!0)},getString:function(e,t,i){if(e<0||t<0||e+t>this.length)throw new ft(d.OutsideBounds);null==i&&(i=A.UTF8);var n="",r=this.b,s=e,a=e+t;switch(i._hx_index){case 0:for(;se.length)throw new ft(d.OutsideBounds);if(this.pos+i>this.size&&this.grow(i),0!=this.size){var n=new Uint8Array(e.b.buffer,e.b.byteOffset+t,i);this.u8.set(n,this.pos),this.pos+=i}},grow:function(e){for(var t=this.pos+e,i=0==this.size?16:this.size;i>1;var n=new ArrayBuffer(i),r=new Uint8Array(n);0e.length)throw new ft(d.OutsideBounds);try{for(;0e.length)throw new ft(d.OutsideBounds);this.b=e.b,this.pos=t,this.len=i,this.totlen=i}(x["haxe.io.BytesInput"]=ce).__name__=!0,ce.__super__=h,ce.prototype=r(h.prototype,{b:null,pos:null,len:null,totlen:null,set_position:function(e){return e<0?e=0:e>this.totlen&&(e=this.totlen),this.len=this.totlen-e,this.pos=e},readByte:function(){if(0==this.len)throw new ft(new m);return this.len--,this.b[this.pos++]},readBytes:function(e,t,i){if(t<0||i<0||t+i>e.length)throw new ft(d.OutsideBounds);if(0==this.len&&0e.length)throw new ft(d.OutsideBounds);for(var n=e.b,r=i;0>>24),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)):(this.writeByte(255&e),this.writeByte(e>>8&255),this.writeByte(e>>16&255),this.writeByte(e>>>24))},__class__:c};function Ae(){this.b=new u}(x["haxe.io.BytesOutput"]=Ae).__name__=!0,Ae.__super__=c,Ae.prototype=r(c.prototype,{b:null,writeByte:function(e){this.b.addByte(e)},writeBytes:function(e,t,i){return this.b.addBytes(e,t,i),i},getBytes:function(){return this.b.getBytes()},__class__:Ae});var A=f["haxe.io.Encoding"]={__ename__:!0,__constructs__:["UTF8","RawNative"],UTF8:{_hx_index:0,__enum__:"haxe.io.Encoding",toString:i},RawNative:{_hx_index:1,__enum__:"haxe.io.Encoding",toString:i}},m=function(){};(x["haxe.io.Eof"]=m).__name__=!0,m.prototype={toString:function(){return"Eof"},__class__:m};var d=f["haxe.io.Error"]={__ename__:!0,__constructs__:["Blocked","Overflow","OutsideBounds","Custom"],Blocked:{_hx_index:0,__enum__:"haxe.io.Error",toString:i},Overflow:{_hx_index:1,__enum__:"haxe.io.Error",toString:i},OutsideBounds:{_hx_index:2,__enum__:"haxe.io.Error",toString:i},Custom:((t=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:i}}).__params__=["e"],t)},_=function(){};(x["haxe.io.FPHelper"]=_).__name__=!0,_.floatToI32=function(e){return _.helper.setFloat32(0,e,!0),_.helper.getInt32(0,!0)};var _t=function(e){switch(e){case".":case"..":return this.dir=e,void(this.file="")}var t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t";var e=typeof r;switch("function"==e&&(r.__name__||r.__ename__)&&(e="object"),e){case"function":return"";case"object":if(r.__enum__){var t=f[r.__enum__],i=t.__constructs__[r._hx_index],a=t[i];return a.__params__?(s+="\t",i+"("+function(){for(var e=[],t=0,i=a.__params__;t>>16},C.get_Gb=function(e){return(65280&e)>>>8},C.get_Bb=function(e){return 255&e},C.get_Ab=function(e){return e>>>24},C.set_Rb=function(e,t){return e=e>>>24<<24|t<<16|(65280&e)>>>8<<8|255&e,t},C.set_Gb=function(e,t){return e=e>>>24<<24|(16711680&e)>>>16<<16|t<<8|255&e,t},C.set_Bb=function(e,t){return e=e>>>24<<24|(16711680&e)>>>16<<16|(65280&e)>>>8<<8|t,t},C.set_Ab=function(e,t){return e=t<<24|(16711680&e)>>>16<<16|(65280&e)>>>8<<8|255&e,t},C.get_R=function(e){return.00392156862745098*((16711680&e)>>>16)},C.get_G=function(e){return.00392156862745098*((65280&e)>>>8)},C.get_B=function(e){return.00392156862745098*(255&e)},C.get_A=function(e){return.00392156862745098*(e>>>24)},C.set_R=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(255*t|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|.00392156862745098*(255&e)*255|0,t},C.set_G=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(255*t|0)<<8|.00392156862745098*(255&e)*255|0,t},C.set_B=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|255*t|0,t},C.set_A=function(e,t){return e=(255*t|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|.00392156862745098*(255&e)*255|0,t};var b=function(e,t){this.num=e,this.isPrimary=t};(x["kha.Display"]=b).__name__=!0,b.__properties__={get_all:"get_all",get_primary:"get_primary"},b.init=function(){for(var e=0,t=Krom.displayCount();e=this.chars.length)return null;var r=1/this.width,s=1/this.height,a=this.chars[t];if(null==a)return null;var o=Math.round(i+a.xoff),l=Math.round(n+a.yoff);return e.x0=o,e.y0=l,e.x1=o+a.x1-a.x0,e.y1=l+a.y1-a.y0,e.s0=a.x0*r,e.t0=a.y0*s,e.s1=a.x1*r,e.t1=a.y1*s,e.xadvance=a.xadvance,e},getCharWidth:function(e){if(0==this.chars.length)return 0;var t=V.charBlocks[0];if(e=this.chars.length?this.chars[0].xadvance:this.chars[e-t].xadvance},getHeight:function(){return this.mySize},stringWidth:function(e){for(var t=0,i=0,n=e.length;i=e)n.next=n.start;else if(0=e&&G.timeTasksScratchpad.push(n)}for(var r=0,s=G.timeTasksScratchpad;rG.lastTime&&(G.startTime-=e-G.lastTime,G.current=e,G.lastTime=e,G.executeTimeTasks(e))},G.executeFrame=function(){var e=G.realTime()-G.startTime-G.lastTime,t=G.current;if(0<=e){if(null==xi.the())if(e>G.maxframetime)G.startTime+=e-G.maxframetime,t+=e=G.maxframetime;else if(G.vsync){for(var i=G.onedifhz;i=G.activeTimeTask.start+G.activeTimeTask.next)?G.insertSorted(G.timeTasks,G.activeTimeTask):G.archiveTimeTask(G.activeTimeTask,e):(G.activeTimeTask.active=!1,G.archiveTimeTask(G.activeTimeTask,e));G.activeTimeTask=null},G.archiveTimeTask=function(e,t){},G.time=function(){return G.current},G.realTime=function(){return pt.get_time()},G.resetTime=function(){var e=pt.get_time(),t=e-G.startTime;G.startTime=e;for(var i=0,n=G.timeTasks;it.next)return void e.splice(r,0,t)}e.push(t)},G.sortFrameTasks=function(){G.frame_tasks_sorted||(G.frameTasks.sort(function(e,t){return e.priority>t.priority?1:e.priority=this.getLength()},unload:function(){},__class__:q,__properties__:{set_position:"set_position",get_position:"get_position"}};var j=function(e){this.num=e,j.windows.push(this)};(x["kha.Window"]=j).__name__=!0,j.__properties__={get_all:"get_all"},j.create=function(e,t){return null},j.destroy=function(e){},j.get=function(e){return j.windows[e]},j.get_all=function(){return j.windows},j.prototype={num:null,windowTitle:null,resize:function(e,t){},move:function(e,t){},changeWindowFeatures:function(e){},changeFramebuffer:function(e){},get_x:function(){return 0},set_x:function(e){return 0},get_y:function(){return 0},set_y:function(e){return 0},get_width:function(){return Krom.windowWidth(this.num)},set_width:function(e){return 800},get_height:function(){return Krom.windowHeight(this.num)},set_height:function(e){return 600},get_mode:function(){return 0},set_mode:function(e){return 0},get_visible:function(){return!0},set_visible:function(e){return!0},get_title:function(){return this.windowTitle},set_title:function(e){return Krom.setWindowTitle(this.num,e),this.windowTitle=e,this.windowTitle},notifyOnResize:function(e){},get_vSynced:function(){return!0},__class__:j,__properties__:{get_vSynced:"get_vSynced",set_title:"set_title",get_title:"get_title",set_visible:"set_visible",get_visible:"get_visible",set_mode:"set_mode",get_mode:"get_mode",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}};var Z={};(x["kha._WindowOptions.WindowFeatures_Impl_"]=Z).__name__=!0,Z._new=function(e){return e};var ne=function(e,t,i,n,r,s,a,o,l){null==l&&(l=0),null==a&&(a=!0),null==s&&(s=-1),null==r&&(r=600),null==n&&(n=800),null==i&&(i=-1),null==t&&(t=-1),this.mode=0,this.windowFeatures=7,this.visible=!0,this.display=-1,this.height=600,this.width=800,this.y=-1,this.x=-1,this.title=null,this.title=e,this.x=t,this.y=i,this.width=n,this.height=r,this.display=s,this.visible=a,this.windowFeatures=null==o?7:o,this.mode=l};(x["kha.WindowOptions"]=ne).__name__=!0,ne.prototype={title:null,x:null,y:null,width:null,height:null,display:null,visible:null,windowFeatures:null,mode:null,__class__:ne};var re={};(x["kha.arrays._Float32Array.Float32Array_Impl_"]=re).__name__=!0,re.__properties__={get_length:"get_length",get_buffer:"get_buffer"},re._new=function(e){return new Float32Array(e)},re.get_buffer=function(e){return e.buffer},re.get_length=function(e){return e.length},re.set=function(e,t,i){return e[t]=i},re.get=function(e,t){return e[t]},re.data=function(e){return e},re.subarray=function(e,t,i){return e.subarray(t,i)};var se={};(x["kha.arrays._Int16Array.Int16Array_Impl_"]=se).__name__=!0,se.__properties__={get_length:"get_length"},se._new=function(e){return new Int16Array(e)},se.get_length=function(e){return e.length},se.set=function(e,t,i){return e[t]=i},se.get=function(e,t){return e[t]},se.data=function(e){return e},se.arrayRead=function(e,t){return e[t]},se.arrayWrite=function(e,t,i){return e[t]=i},se.subarray=function(e,t,i){return e.subarray(t,i)};var ae={};(x["kha.arrays._Int32Array.Int32Array_Impl_"]=ae).__name__=!0,ae.__properties__={get_length:"get_length"},ae._new=function(e){return new Int32Array(e)},ae.get_length=function(e){return e.length},ae.set=function(e,t,i){return e[t]=i},ae.get=function(e,t){return e[t]},ae.data=function(e){return e},ae.arrayRead=function(e,t){return e[t]},ae.arrayWrite=function(e,t,i){return e[t]=i},ae.subarray=function(e,t,i){return e.subarray(t,i)};var oe={};(x["kha.arrays._Uint32Array.Uint32Array_Impl_"]=oe).__name__=!0,oe.__properties__={get_length:"get_length"},oe._new=function(e){return new Uint32Array(e)},oe.get_length=function(e){return e.length},oe.set=function(e,t,i){return e[t]=i},oe.get=function(e,t){return e[t]},oe.data=function(e){return e},oe.arrayRead=function(e,t){return e[t]},oe.arrayWrite=function(e,t,i){return e[t]=i},oe.subarray=function(e,t,i){return e.subarray(t,i)};function le(){}(x["kha.audio1.AudioChannel"]=le).__name__=!0,le.__isInterface__=!0,le.prototype={play:null,pause:null,stop:null,length:null,get_length:null,get_position:null,set_position:null,get_volume:null,set_volume:null,finished:null,get_finished:null,__class__:le,__properties__:{get_finished:"get_finished",set_volume:"set_volume",get_volume:"get_volume",set_position:"set_position",get_position:"get_position",get_length:"get_length"}};function ue(e){this.value=e}(x["kha.internal.IntBox"]=ue).__name__=!0,ue.prototype={value:null,__class__:ue};var de=function(){};(x["kha.audio2.Audio"]=de).__name__=!0,de._init=function(){de.buffer=new ge(8192,2,44100),de.samplesPerSecond=44100},de._callCallback=function(e){if(null!=de.buffer)if(null!=de.audioCallback)de.intBox.value=e,de.audioCallback(de.intBox,de.buffer);else for(var t=0,i=e;t=de.buffer.size&&(de.buffer.writeLocation=0)}},de._readSample=function(){if(null==de.buffer)return 0;var e=de.buffer.data[de.buffer.readLocation];return de.buffer.readLocation+=1,de.buffer.readLocation>=de.buffer.size&&(de.buffer.readLocation=0),e},de.play=function(e,t){return null==t&&(t=!1),null},de.stream=function(e,t){return null==t&&(t=!1),null};var _e=function(){};(x["kha.audio2.Audio1"]=_e).__name__=!0,_e._init=function(){var e=new Array(32);_e.soundChannels=e;var t=new Array(32);_e.streamChannels=t;var i=new Array(32);_e.internalSoundChannels=i;var n=new Array(32);_e.internalStreamChannels=n;var r=new Float32Array(512);_e.sampleCache1=r;var s=new Float32Array(512);_e.sampleCache2=s,_e.lastAllocationCount=0,de.audioCallback=_e.mix},_e.max=function(e,t){return t=t.size&&(t.writeLocation=0)}return _e.lastAllocationCount=0,void(de.disableGcInteractions=!1)}var s=new Float32Array(2*i);_e.sampleCache1=s;var a=new Float32Array(2*i);_e.sampleCache2=a,_e.lastAllocationCount=0}else 100<_e.lastAllocationCount?de.disableGcInteractions=!0:_e.lastAllocationCount+=1;for(var o=0,l=i;o=t.size&&(t.writeLocation=0)}},_e.play=function(e,t){null==t&&(t=!1);var i=null;(i=de.samplesPerSecond!=e.sampleRate?new pe(t,e.sampleRate):new fe(t)).data=e.uncompressedData;for(var n=!1,r=0;r<32;){var s=r++;if(null==_e.soundChannels[s]||_e.soundChannels[s].get_finished()){_e.soundChannels[s]=i,n=!0;break}}return n?i:null},_e._playAgain=function(e){for(var t=0;t<32;){var i=t++;_e.soundChannels[i]==e&&(_e.soundChannels[i]=null)}for(var n=0;n<32;){var r=n++;if(null==_e.soundChannels[r]||_e.soundChannels[r].get_finished()||_e.soundChannels[r]==e){_e.soundChannels[r]=e;break}}},_e.stream=function(e,t){null==t&&(t=!1);var i=de.stream(e,t);if(null!=i)return i;for(var n=new me(e.compressedData,t),r=!1,s=0;s<32;){var a=s++;if(null==_e.streamChannels[a]||_e.streamChannels[a].get_finished()){_e.streamChannels[a]=n,r=!0;break}}return r?n:null};var fe=function(e){this.looping=!1,this.stopped=!1,this.paused=!1,this.myPosition=0,this.myVolume=1,this.data=null,this.looping=e};(x["kha.audio2.AudioChannel"]=fe).__name__=!0,fe.__interfaces__=[le],fe.max=function(e,t){return t=this.data.length&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s=(C%2==0?C:C+1)&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s>>24]};function we(){}(x["kha.audio2.ogg.tools.MathTools"]=we).__name__=!0,we.ilog=function(e){var t=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];return e<16384?e<16?t[e]:e<512?5+t[e>>5]:10+t[e>>10]:e<16777216?e<524288?15+t[e>>15]:20+t[e>>20]:e<536870912?25+t[e>>25]:e<-2147483648?30+t[e>>30]:0};function be(){}(x["kha.audio2.ogg.tools.Mdct"]=be).__name__=!0,be.inverseTransform=function(e,t,i,n,r,s){for(var a=t>>1,o=t>>2,l=t>>3,u=new Array(a),h=a-2,c=0,A=0,d=a;A!=d;)u[h+1]=e[A]*i[c]-e[A+2]*i[c+1],u[h]=e[A]*i[c+1]+e[A+2]*i[c],h-=2,c+=2,A+=4;for(A=a-3;0<=h;)u[h+1]=-e[A+2]*i[c]- -e[A]*i[c+1],u[h]=-e[A+2]*i[c+1]+-e[A]*i[c],h-=2,c+=2,A-=4;for(var _=e,f=u,g=a-8,p=o,m=0,v=o,w=0;0<=g;){var b=f[p+1]-f[m+1],y=f[p]-f[m];_[v+1]=f[p+1]+f[m+1],_[v]=f[p]+f[m],_[w+1]=b*i[g+4]-y*i[g+5],_[w]=y*i[g+4]+b*i[g+5],b=f[p+3]-f[m+3],y=f[p+2]-f[m+2],_[v+3]=f[p+3]+f[m+3],_[v+2]=f[p+2]+f[m+2],_[w+3]=b*i[g]-y*i[g+1],_[w+2]=y*i[g]+b*i[g+1],g-=8,v+=4,w+=4,p+=4,m+=4}for(var x=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],T=(t<16384?t<16?x[t]:t<512?5+x[t>>5]:10+x[t>>10]:t<16777216?t<524288?15+x[t>>15]:20+x[t>>20]:t<536870912?25+x[t>>25]:t<-2147483648?30+x[t>>30]:0)-1,S=a-1-0*o,E=S,B=S-(t>>3),k=0,I=1+(t>>4>>2);0<--I;){var C=_[E]-_[B],L=_[E+-1]-_[B+-1];_[E]=_[E]+_[B];var N=E+-1;_[N]=_[N]+_[B+-1],_[B]=C*i[k]-L*i[k+1],_[B+-1]=L*i[k]+C*i[k+1],k+=8,C=_[E+-2]-_[B+-2],L=_[E+-3]-_[B+-3];var F=E+-2;_[F]=_[F]+_[B+-2];var P=E+-3;_[P]=_[P]+_[B+-3],_[B+-2]=C*i[k]-L*i[k+1],_[B+-3]=L*i[k]+C*i[k+1],k+=8,C=_[E+-4]-_[B+-4],L=_[E+-5]-_[B+-5];var M=E+-4;_[M]=_[M]+_[B+-4];var R=E+-5;_[R]=_[R]+_[B+-5],_[B+-4]=C*i[k]-L*i[k+1],_[B+-5]=L*i[k]+C*i[k+1],k+=8,C=_[E+-6]-_[B+-6],L=_[E+-7]-_[B+-7];var O=E+-6;_[O]=_[O]+_[B+-6];var V=E+-7;_[V]=_[V]+_[B+-7],_[B+-6]=C*i[k]-L*i[k+1],_[B+-7]=L*i[k]+C*i[k+1],k+=8,E-=8,B-=8}for(var D=a-1-o,U=D,H=D-(t>>3),W=0,G=1+(t>>4>>2);0<--G;){var z=_[U]-_[H],X=_[U+-1]-_[H+-1];_[U]=_[U]+_[H];var Y=U+-1;_[Y]=_[Y]+_[H+-1],_[H]=z*i[W]-X*i[W+1],_[H+-1]=X*i[W]+z*i[W+1],W+=8,z=_[U+-2]-_[H+-2],X=_[U+-3]-_[H+-3];var K=U+-2;_[K]=_[K]+_[H+-2];var Q=U+-3;_[Q]=_[Q]+_[H+-3],_[H+-2]=z*i[W]-X*i[W+1],_[H+-3]=X*i[W]+z*i[W+1],W+=8,z=_[U+-4]-_[H+-4],X=_[U+-5]-_[H+-5];var q=U+-4;_[q]=_[q]+_[H+-4];var j=U+-5;_[j]=_[j]+_[H+-5],_[H+-4]=z*i[W]-X*i[W+1],_[H+-5]=X*i[W]+z*i[W+1],W+=8,z=_[U+-6]-_[H+-6],X=_[U+-7]-_[H+-7];var Z=U+-6;_[Z]=_[Z]+_[H+-6];var J=U+-7;_[J]=_[J]+_[H+-7],_[H+-6]=z*i[W]-X*i[W+1],_[H+-7]=X*i[W]+z*i[W+1],W+=8,U-=8,H-=8}for(var $=a-1-0*l,ee=0,te=$,ie=$-(t>>4),ne=1+(t>>5>>2);0<--ne;){var re=_[te]-_[ie],se=_[te+-1]-_[ie+-1];_[te]=_[te]+_[ie];var ae=te+-1;_[ae]=_[ae]+_[ie+-1],_[ie]=re*i[ee]-se*i[ee+1],_[ie+-1]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-2]-_[ie+-2],se=_[te+-3]-_[ie+-3];var oe=te+-2;_[oe]=_[oe]+_[ie+-2];var le=te+-3;_[le]=_[le]+_[ie+-3],_[ie+-2]=re*i[ee]-se*i[ee+1],_[ie+-3]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-4]-_[ie+-4],se=_[te+-5]-_[ie+-5];var ue=te+-4;_[ue]=_[ue]+_[ie+-4];var he=te+-5;_[he]=_[he]+_[ie+-5],_[ie+-4]=re*i[ee]-se*i[ee+1],_[ie+-5]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-6]-_[ie+-6],se=_[te+-7]-_[ie+-7];var ce=te+-6;_[ce]=_[ce]+_[ie+-6];var Ae=te+-7;_[Ae]=_[Ae]+_[ie+-7],_[ie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[We+1],We+=16,Ye=_[Ge+-6]-_[ze+-6],Ke=_[Ge+-7]-_[ze+-7];var $e=Ge+-6;_[$e]=_[$e]+_[ze+-6];var et=Ge+-7;_[et]=_[et]+_[ze+-7],_[ze+-6]=Ye*i[We]-Ke*i[We+1],_[ze+-7]=Ke*i[We]+Ye*i[We+1],Ge-=8,ze-=8,We+=16}for(var tt=2,it=T-3>>1;tt>2+nt,st=rt>>1,at=0,ot=1<<1+nt;at>4+nt>>2);0<--dt;){var _t=_[ct]-_[At],ft=_[ct+-1]-_[At+-1];_[ct]=_[ct]+_[At];var gt=ct+-1;_[gt]=_[gt]+_[At+-1],_[At]=_t*i[ht]-ft*i[ht+1],_[At+-1]=ft*i[ht]+_t*i[ht+1],ht+=ut,_t=_[ct+-2]-_[At+-2],ft=_[ct+-3]-_[At+-3];var pt=ct+-2;_[pt]=_[pt]+_[At+-2];var mt=ct+-3;_[mt]=_[mt]+_[At+-3],_[At+-2]=_t*i[ht]-ft*i[ht+1],_[At+-3]=ft*i[ht]+_t*i[ht+1],ht+=ut,_t=_[ct+-4]-_[At+-4],ft=_[ct+-5]-_[At+-5];var vt=ct+-4;_[vt]=_[vt]+_[At+-4];var wt=ct+-5;_[wt]=_[wt]+_[At+-5],_[At+-4]=_t*i[ht]-ft*i[ht+1],_[At+-5]=ft*i[ht]+_t*i[ht+1],ht+=ut,_t=_[ct+-6]-_[At+-6],ft=_[ct+-7]-_[At+-7];var bt=ct+-6;_[bt]=_[bt]+_[At+-6];var yt=ct+-7;_[yt]=_[yt]+_[At+-7],_[At+-6]=_t*i[ht]-ft*i[ht+1],_[At+-7]=ft*i[ht]+_t*i[ht+1],ct-=8,At-=8,ht+=ut}for(var xt=T-3>>1,Tt=T-6;xt>2+St,Bt=1<<3+St,kt=Et>>1,It=1<<1+St,Ct=0,Lt=a-1,Nt=1+(t>>6+St);0<--Nt;){for(var Ft=i[Ct],Pt=i[Ct+1],Mt=i[Ct+Bt],Rt=i[Ct+Bt+1],Ot=i[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[o+1],o+=8,u=t[s+-4]-t[a+-4],h=t[s+-5]-t[a+-5];var _=s+-4;t[_]=t[_]+t[a+-4];var f=s+-5;t[f]=t[f]+t[a+-5],t[a+-4]=u*r[o]-h*r[o+1],t[a+-5]=h*r[o]+u*r[o+1],o+=8,u=t[s+-6]-t[a+-6],h=t[s+-7]-t[a+-7];var g=s+-6;t[g]=t[g]+t[a+-6];var p=s+-7;t[p]=t[p]+t[a+-7],t[a+-6]=u*r[o]-h*r[o+1],t[a+-7]=h*r[o]+u*r[o+1],o+=8,s-=8,a-=8}},be.step3InnerRLoop=function(e,t,i,n,r,s){for(var a=0,o=i,l=i+n,u=1+(e>>2);0<--u;){var h=t[o]-t[l],c=t[o+-1]-t[l+-1];t[o]=t[o]+t[l];var A=o+-1;t[A]=t[A]+t[l+-1],t[l]=h*r[a]-c*r[a+1],t[l+-1]=c*r[a]+h*r[a+1],a+=s,h=t[o+-2]-t[l+-2],c=t[o+-3]-t[l+-3];var d=o+-2;t[d]=t[d]+t[l+-2];var _=o+-3;t[_]=t[_]+t[l+-3],t[l+-2]=h*r[a]-c*r[a+1],t[l+-3]=c*r[a]+h*r[a+1],a+=s,h=t[o+-4]-t[l+-4],c=t[o+-5]-t[l+-5];var f=o+-4;t[f]=t[f]+t[l+-4];var g=o+-5;t[g]=t[g]+t[l+-5],t[l+-4]=h*r[a]-c*r[a+1],t[l+-5]=c*r[a]+h*r[a+1],a+=s,h=t[o+-6]-t[l+-6],c=t[o+-7]-t[l+-7];var p=o+-6;t[p]=t[p]+t[l+-6];var m=o+-7;t[m]=t[m]+t[l+-7],t[l+-6]=h*r[a]-c*r[a+1],t[l+-7]=c*r[a]+h*r[a+1],o-=8,l-=8,a+=s}},be.step3InnerSLoop=function(e,t,i,n,r,s,a,o){for(var l=r[s],u=r[s+1],h=r[s+a],c=r[s+a+1],A=r[s+2*a],d=r[s+2*a+1],_=r[s+3*a],f=r[s+3*a+1],g=i,p=i+n,m=e+1;0<--m;){var v=t[g]-t[p],w=t[g+-1]-t[p+-1];t[g]=t[g]+t[p],t[g+-1]=t[g+-1]+t[p+-1],t[p]=v*l-w*u,t[p+-1]=w*l+v*u,v=t[g+-2]-t[p+-2],w=t[g+-3]-t[p+-3],t[g+-2]=t[g+-2]+t[p+-2],t[g+-3]=t[g+-3]+t[p+-3],t[p+-2]=v*h-w*c,t[p+-3]=w*h+v*c,v=t[g+-4]-t[p+-4],w=t[g+-5]-t[p+-5],t[g+-4]=t[g+-4]+t[p+-4],t[g+-5]=t[g+-5]+t[p+-5],t[p+-4]=v*A-w*d,t[p+-5]=w*A+v*d,v=t[g+-6]-t[p+-6],w=t[g+-7]-t[p+-7],t[g+-6]=t[g+-6]+t[p+-6],t[g+-7]=t[g+-7]+t[p+-7],t[p+-6]=v*_-w*f,t[p+-7]=w*_+v*f,g-=o,p-=o}},be.iter54=function(e,t){var i=e[t],n=e[t+-4],r=i-n,s=i+n,a=(i=e[t+-2])+(n=e[t+-6]),o=i-n;e[t]=s+a,e[t+-2]=s-a;var l=e[t+-3]-e[t+-7];e[t+-4]=r+l,e[t+-6]=r-l;var u=(i=e[t+-1])-(n=e[t+-5]),h=i+n,c=e[t+-3]+e[t+-7];e[t+-1]=h+c,e[t+-3]=h-c,e[t+-5]=u-o,e[t+-7]=u+o},be.step3InnerSLoopLd654=function(e,t,i,n,r){for(var s=n[r>>3],a=i,o=i-16*e;o=this.segments.length&&(this.nextSeg=-1),this.bytesInSeg=e},startPacket:function(){for(;-1==this.nextSeg;)if(this.page.start(this),0!=(1&this.page.flag))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:193,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"startPacket"}));this.lastSeg=!1,this.validBits=0,this.bytesInSeg=0},maybeStartPacket:function(){if(-1==this.nextSeg){var t,i=!1;try{this.inputPosition+=1,t=this.input.readByte()}catch(e){var n=e instanceof ft?e.val:e;if(!(n instanceof m))throw e;i=!0,t=0}if(i)return!1;if(!!(!!(79!=t||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:218,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"maybeStartPacket"}));this.page.startWithoutCapturePattern(this)}return this.startPacket(),!0},readBits:function(e){if(this.validBits<0)return 0;if(this.validBits>>e,this.validBits-=e,t}var i=this.acc&(1<>>e,this.validBits-=e,i},readPacketRaw:function(){return 0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1},readPacket:function(){var e;return e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,e},flushPacket:function(){for(;0!=this.bytesInSeg||!this.lastSeg&&0!=this.next();)this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()},vorbisValidate:function(){var e,t,i,n,r,s,a=new he(new ArrayBuffer(6));if(e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[0]=e,t=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[1]=t,i=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[2]=i,n=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[3]=n,r=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[4]=r,s=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[5]=s,"vorbis"!=a.toString())throw new ft(new Xe(Ye.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}))},firstPageValidate:function(){if(1!=this.segments.length)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"segmentCount",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:308,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}));if(30!=this.segments[0])throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:311,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}))},startFirstDecode:function(){this.firstAudioPageOffset=this.inputPosition,this.firstDecode=!0},capturePattern:function(){if(this.inputPosition+=1,!!(!!(79!=this.input.readByte()||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:324,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"capturePattern"}))},skip:function(e){this.inputPosition+=e;for(var t=new Array(e),i=0,n=e;i>>n,this.validBits-=n,t=this.validBits<0?(this.validBits=0,-1):i}else t=this.decodeScalarRaw(e);return e.sparse&&(t=e.sortedValues[t]),t},decodeRaw:function(e){this.validBits<10&&this.prepHuffman();var t=e.fastHuffman[1023&this.acc];if(0<=t){var i=e.codewordLengths[t];return this.acc=this.acc>>>i,this.validBits-=i,this.validBits<0?(this.validBits=0,-1):t}return this.decodeScalarRaw(e)},isLastByte:function(){return 0==this.bytesInSeg&&this.lastSeg},finishDecodePacket:function(e,t,i){var n=i.left.start,r=!1,s=t>>1;if(this.firstDecode)this.currentLoc=-s,this.discardSamplesDeferred=t-i.right.end,r=!0,this.firstDecode=!1;else if(0!=this.discardSamplesDeferred)i.left.start+=this.discardSamplesDeferred,n=i.left.start,this.discardSamplesDeferred=0;else;if(this.lastSegWhich==this.endSegWithKnownLoc){if(r&&0!=(4&this.page.flag)){var a=this.knownLocForPacket-(t-i.right.end);if(a>>24]}var l=0;try{for(var u=0,h=n[26];u>>24],l+=c}for(var A=0,d=l;A>>24]}}catch(e){var f=e instanceof ft?e.val:e;if(f instanceof m){return Te.NotFound}throw e}if(s==r){var g=this.inputPosition;return e(this.inputPosition=i-1),Te.Found(g,0!=(4&n[5]))}}}}catch(e){var p=e instanceof ft?e.val:e;if(p instanceof m){return Te.NotFound}throw e}},analyzePage:function(e,t){var i=new Ue,n=new Array(255);i.pageStart=this.inputPosition,this.inputPosition+=27;for(var r=new Array(27),s=0;s<27;){r[s++]=this.input.readByte()}var a=r,o=a[26];this.inputPosition+=o;for(var l=new Array(o),u=0,h=o;u>=1;var y=p-1,x=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(p<=(b&=(1<<(y<16384?y<16?x[y]:y<512?5+x[y>>5]:10+x[y>>10]:y<16777216?y<524288?15+x[y>>15]:20+x[y>>20]:y<536870912?25+x[y>>25]:y<-2147483648?30+x[y>>30]:0))-1))return e(this.inputPosition=i.pageStart),null;n[f++]=t.modes[b].blockflag;var T=c[w]-1;this.inputPosition+=T;for(var S=new Array(T),E=0,B=T;E>1:N+=(t.blocksize1-t.blocksize0>>2)+(t.blocksize0>>1):N+=t.blocksize0>>1,--F;return i.firstDecodedSample=i.lastDecodedSample-N,e(this.inputPosition=i.pageStart),i},decodeScalarRaw:function(e){this.prepHuffman();var t=e.codewordLengths,i=e.codewords,n=e.sortedCodewords;if(8>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16,a=0,o=e.sortedEntries;1>1);Me.gte(s,n[l])?(a=l,o-=o>>1):o>>=1}e.sparse||(a=e.sortedValues[a]);var u=t[a];return this.validBits>=u?(this.acc=this.acc>>>u,this.validBits-=u,a):(this.validBits=0,-1)}for(var h=0,c=e.entries;h=d?(this.acc=this.acc>>>d,this.validBits-=d,A):(this.validBits=0,-1)}return this.error=new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:847,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"decodeScalarRaw"}),this.validBits=0,-1},__class__:xe};var Te=f["kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult"]={__ename__:!0,__constructs__:["Found","NotFound"],Found:((t=function(e,t){return{_hx_index:0,end:e,last:t,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}}).__params__=["end","last"],t),NotFound:{_hx_index:1,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}},Se=function(e,t){this.header=e,this.decodeState=t,this.totalSample=null,this.currentSample=0,this.previousLength=0;var i=new Array(e.channel);this.channelBuffers=i;var n=new Array(e.channel);this.previousWindow=n;var r=new Array(e.channel);this.finalY=r;for(var s=0,a=e.channel;sthis.totalSample-this.currentSample&&(c=this.totalSample-this.currentSample);for(var A=0;hthis.totalSample-this.currentSample&&(e=this.totalSample-this.currentSample);t=r.lastDecodedSample&&(i=r.lastDecodedSample-1),i>>1);h=8<=s?c:Me.gt(c,h)?h+(c-h>>>1):c+(h-c>>>1)}++s,e(this.decodeState.inputPosition=h);var A=this.decodeState.findPage(e,t);switch(A._hx_index){case 0:A.last,A.end;break;case 1:throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:249,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}))}var d=this.decodeState.analyzePage(e,this.header);if(null==d)throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:255,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}));d.afterPreviousPageStart=h,d.pageStart!=r.pageStart?i>1,n=t>>2,r=t>>3,s=this.a,a=new Array(i);s[e]=a;var o=this.b,l=new Array(i);o[e]=l;var u=this.c,h=new Array(n);u[e]=h;var c=this.window,A=new Array(i);c[e]=A;var d=this.bitReverseData,_=new Array(r);d[e]=_,Ee.computeTwiddleFactors(t,this.a[e],this.b[e],this.c[e]),Ee.computeWindow(t,this.window[e]),Ee.computeBitReverse(t,this.bitReverseData[e])},inverseMdct:function(e,t,i){for(var n=i?1:0,r=this.a[n],s=this.b[n],a=this.c[n],o=this.bitReverseData[n],l=t>>1,u=t>>2,h=t>>3,c=new Array(l),A=l-2,d=0,_=0,f=l;_!=f;)c[A+1]=e[_]*r[d]-e[_+2]*r[d+1],c[A]=e[_]*r[d+1]+e[_+2]*r[d],A-=2,d+=2,_+=4;for(_=l-3;0<=A;)c[A+1]=-e[_+2]*r[d]- -e[_]*r[d+1],c[A]=-e[_+2]*r[d+1]+-e[_]*r[d],A-=2,d+=2,_-=4;for(var g=e,p=c,m=l-8,v=u,w=0,b=u,y=0;0<=m;){var x=p[v+1]-p[w+1],T=p[v]-p[w];g[b+1]=p[v+1]+p[w+1],g[b]=p[v]+p[w],g[y+1]=x*r[m+4]-T*r[m+5],g[y]=T*r[m+4]+x*r[m+5],x=p[v+3]-p[w+3],T=p[v+2]-p[w+2],g[b+3]=p[v+3]+p[w+3],g[b+2]=p[v+2]+p[w+2],g[y+3]=x*r[m]-T*r[m+1],g[y+2]=T*r[m]+x*r[m+1],m-=8,b+=4,y+=4,v+=4,w+=4}for(var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],E=(t<16384?t<16?S[t]:t<512?5+S[t>>5]:10+S[t>>10]:t<16777216?t<524288?15+S[t>>15]:20+S[t>>20]:t<536870912?25+S[t>>25]:t<-2147483648?30+S[t>>30]:0)-1,B=l-1-0*u,k=B,I=B-(t>>3),C=0,L=1+(t>>4>>2);0<--L;){var N=g[k]-g[I],F=g[k+-1]-g[I+-1];g[k]=g[k]+g[I];var P=k+-1;g[P]=g[P]+g[I+-1],g[I]=N*r[C]-F*r[C+1],g[I+-1]=F*r[C]+N*r[C+1],C+=8,N=g[k+-2]-g[I+-2],F=g[k+-3]-g[I+-3];var M=k+-2;g[M]=g[M]+g[I+-2];var R=k+-3;g[R]=g[R]+g[I+-3],g[I+-2]=N*r[C]-F*r[C+1],g[I+-3]=F*r[C]+N*r[C+1],C+=8,N=g[k+-4]-g[I+-4],F=g[k+-5]-g[I+-5];var O=k+-4;g[O]=g[O]+g[I+-4];var V=k+-5;g[V]=g[V]+g[I+-5],g[I+-4]=N*r[C]-F*r[C+1],g[I+-5]=F*r[C]+N*r[C+1],C+=8,N=g[k+-6]-g[I+-6],F=g[k+-7]-g[I+-7];var D=k+-6;g[D]=g[D]+g[I+-6];var U=k+-7;g[U]=g[U]+g[I+-7],g[I+-6]=N*r[C]-F*r[C+1],g[I+-7]=F*r[C]+N*r[C+1],C+=8,k-=8,I-=8}for(var H=l-1-u,W=H,G=H-(t>>3),z=0,X=1+(t>>4>>2);0<--X;){var Y=g[W]-g[G],K=g[W+-1]-g[G+-1];g[W]=g[W]+g[G];var Q=W+-1;g[Q]=g[Q]+g[G+-1],g[G]=Y*r[z]-K*r[z+1],g[G+-1]=K*r[z]+Y*r[z+1],z+=8,Y=g[W+-2]-g[G+-2],K=g[W+-3]-g[G+-3];var q=W+-2;g[q]=g[q]+g[G+-2];var j=W+-3;g[j]=g[j]+g[G+-3],g[G+-2]=Y*r[z]-K*r[z+1],g[G+-3]=K*r[z]+Y*r[z+1],z+=8,Y=g[W+-4]-g[G+-4],K=g[W+-5]-g[G+-5];var Z=W+-4;g[Z]=g[Z]+g[G+-4];var J=W+-5;g[J]=g[J]+g[G+-5],g[G+-4]=Y*r[z]-K*r[z+1],g[G+-5]=K*r[z]+Y*r[z+1],z+=8,Y=g[W+-6]-g[G+-6],K=g[W+-7]-g[G+-7];var $=W+-6;g[$]=g[$]+g[G+-6];var ee=W+-7;g[ee]=g[ee]+g[G+-7],g[G+-6]=Y*r[z]-K*r[z+1],g[G+-7]=K*r[z]+Y*r[z+1],z+=8,W-=8,G-=8}for(var te=l-1-0*h,ie=0,ne=te,re=te-(t>>4),se=1+(t>>5>>2);0<--se;){var ae=g[ne]-g[re],oe=g[ne+-1]-g[re+-1];g[ne]=g[ne]+g[re];var le=ne+-1;g[le]=g[le]+g[re+-1],g[re]=ae*r[ie]-oe*r[ie+1],g[re+-1]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-2]-g[re+-2],oe=g[ne+-3]-g[re+-3];var ue=ne+-2;g[ue]=g[ue]+g[re+-2];var he=ne+-3;g[he]=g[he]+g[re+-3],g[re+-2]=ae*r[ie]-oe*r[ie+1],g[re+-3]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-4]-g[re+-4],oe=g[ne+-5]-g[re+-5];var ce=ne+-4;g[ce]=g[ce]+g[re+-4];var Ae=ne+-5;g[Ae]=g[Ae]+g[re+-5],g[re+-4]=ae*r[ie]-oe*r[ie+1],g[re+-5]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-6]-g[re+-6],oe=g[ne+-7]-g[re+-7];var de=ne+-6;g[de]=g[de]+g[re+-6];var _e=ne+-7;g[_e]=g[_e]+g[re+-7],g[re+-6]=ae*r[ie]-oe*r[ie+1],g[re+-7]=oe*r[ie]+ae*r[ie+1],ne-=8,re-=8,ie+=16}for(var fe=l-1-h,ge=0,pe=fe,me=fe-(t>>4),ve=1+(t>>5>>2);0<--ve;){var we=g[pe]-g[me],be=g[pe+-1]-g[me+-1];g[pe]=g[pe]+g[me];var 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1]+g[zt+-1],g[zt]=Yt*Mt-Kt*Rt,g[zt+-1]=Kt*Mt+Yt*Rt,Yt=g[Gt+-2]-g[zt+-2],Kt=g[Gt+-3]-g[zt+-3],g[Gt+-2]=g[Gt+-2]+g[zt+-2],g[Gt+-3]=g[Gt+-3]+g[zt+-3],g[zt+-2]=Yt*Ot-Kt*Vt,g[zt+-3]=Kt*Ot+Yt*Vt,Yt=g[Gt+-4]-g[zt+-4],Kt=g[Gt+-5]-g[zt+-5],g[Gt+-4]=g[Gt+-4]+g[zt+-4],g[Gt+-5]=g[Gt+-5]+g[zt+-5],g[zt+-4]=Yt*Dt-Kt*Ut,g[zt+-5]=Kt*Dt+Yt*Ut,Yt=g[Gt+-6]-g[zt+-6],Kt=g[Gt+-7]-g[zt+-7],g[Gt+-6]=g[Gt+-6]+g[zt+-6],g[Gt+-7]=g[Gt+-7]+g[zt+-7],g[zt+-6]=Yt*Ht-Kt*Wt,g[zt+-7]=Kt*Ht+Yt*Wt,Gt-=kt,zt-=kt}Nt+=4*It,Ft-=8}for(var Qt=l-1,qt=r[t>>3],jt=Qt,Zt=Qt-16*(t>>5);Zt>5]:10+n[i>>10]:i<16777216?i<524288?15+n[i>>15]:20+n[i>>20]:i<536870912?25+n[i>>25]:i<-2147483648?30+n[i>>30]:0);if(-1==r||r>=this.header.modes.length)throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:519,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"decodeInitial"}));var s,a,o,l=this.header.modes[r];l.blockflag?(s=this.header.blocksize1,a=this.decodeState.readBits(1),o=this.decodeState.readBits(1)):(a=o=0,s=this.header.blocksize0);var u=s>>1;return{mode:r,left:l.blockflag&&0==a?{start:s-this.header.blocksize0>>2,end:s+this.header.blocksize0>>2}:{start:0,end:u},right:l.blockflag&&0==o?{start:3*s-this.header.blocksize0>>2,end:3*s+this.header.blocksize0>>2}:{start:u,end:s}}},decodePacketRest:function(e){for(var t=this.header.modes[e.mode],i=new Array(256),n=new Array(256),r=t.blockflag?this.header.blocksize1:this.header.blocksize0,s=this.header.mapping[t.mapping],a=r>>1,o=[256,128,86,64],l=this.header.codebooks,u=0,h=this.header.channel;u>5]:10+v[p>>10]:p<16777216?p<524288?15+v[p>>15]:20+v[p>>20]:p<536870912?25+v[p>>25]:p<-2147483648?30+v[p>>30]:0)-1);var w=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];f[1]=this.decodeState.readBits((p<16384?p<16?w[p]:p<512?5+w[p>>5]:10+w[p>>10]:p<16777216?p<524288?15+w[p>>15]:20+w[p>>20]:p<536870912?25+w[p>>25]:p<-2147483648?30+w[p>>30]:0)-1);for(var b=0,y=_.partitions;b>>F,C.validBits-=F,L=C.validBits<0?(C.validBits=0,-1):N}else L=C.decodeScalarRaw(I);I.sparse&&(L=I.sortedValues[L]),k=L}for(var P=_.subclassBooks[T],M=0,R=S;M>=E;var V,D=m++;if(0<=O){var U=this.decodeState,H=l[O];U.validBits<10&&U.prepHuffman();var W,G=H.fastHuffman[1023&U.acc];if(0<=G){var z=H.codewordLengths[G];U.acc=U.acc>>>z,U.validBits-=z,W=U.validBits<0?(U.validBits=0,-1):G}else W=U.decodeScalarRaw(H);H.sparse&&(W=H.sortedValues[W]),V=W}else V=0;f[D]=V}}if(-1==this.decodeState.validBits){i[c]=!0;continue}g[0]=g[1]=!0;for(var X=_.neighbors,Y=_.xlist,K=2,Q=_.values;K>1):ne+(re>>1)):(g[q]=!1,f[q]=ne)}for(var oe=0,le=_.values;oe>1;0<=--Ee;)for(var ke=this.channelBuffers[s.chan[Ee].magnitude],Ie=this.channelBuffers[s.chan[Ee].angle],Ce=0,Le=Be;Cei&&e[l]e[t]&&(n=e[s=l])}return{low:r,high:s}},Ee.floatUnpack=function(e){var t=Me.toFloat(2097151&e),i=(2145386496&e)>>>21;return(0!=(-2147483648&e)?-t:t)*Math.pow(2,i-788)},Ee.bitReverse=function(e){return(e=(-16711936&(e=(-252645136&(e=(-858993460&(e=(-1431655766&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8)>>>16|e<<16},Ee.pointCompare=function(e,t){return e.xt.x?1:0},Ee.uintAsc=function(e,t){return Me.gt(t,e)?-1:e==t?0:1},Ee.lookup1Values=function(e,t){var i=0|Math.exp(Math.log(e)/t);return(0|Math.pow(i+1,t))<=e&&++i,i},Ee.computeWindow=function(e,t){for(var i=e>>1,n=0,r=i;n>5]:10+i[e>>10]:e<16777216?e<524288?15+i[e>>15]:20+i[e>>20]:e<536870912?25+i[e>>25]:e<-2147483648?30+i[e>>30]:0)-1,r=0,s=e>>3;r>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8,t[a]=(o>>>16|o<<16)>>>32-n+3<<2}},Ee.computeTwiddleFactors=function(e,t,i,n){for(var r=e>>3,s=0,a=0,o=e>>2;a>5]:10+A[c>>10]:c<16777216?c<524288?15+A[c>>15]:20+A[c>>20]:c<536870912?25+A[c>>25]:c<-2147483648?30+A[c>>30]:0);if(u+d>t.entries)throw new ft(new Xe(Ye.INVALID_SETUP,"codebook entrys",{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"read"}));for(var _=0,f=d;_=t.entries>>2&&(t.codewordLengths=a,t.sparse=!1),t.sparse)o=l;else{for(var v=0,w=0,b=t.entries;w>>21,L=0!=(-2147483648&k)?-I:I;t.minimumValue=L*Math.pow(2,C-788);var N=e.readBits(32),F=Me.toFloat(2097151&N),P=(2145386496&N)>>>21,M=0!=(-2147483648&N)?-F:F;t.deltaValue=M*Math.pow(2,P-788),t.valueBits=e.readBits(4)+1,t.sequenceP=0!=e.readBits(1),1==t.lookupType?t.lookupValues=Ee.lookup1Values(t.entries,t.dimensions):t.lookupValues=t.entries*t.dimensions;for(var R=new Array(t.lookupValues),O=0,V=t.lookupValues;O>>1|(1431655765&h)<<1))>>>2|(858993459&h)<<2))>>>4|(252645135&h)<<4))>>>8|(16711935&h)<<8)>>>16|h<<16,A=s++;if(this.sparse?(this.codewords[A]=c,this.codewordLengths[A]=e[o],i[A]=o):this.codewords[o]=c,l!=e[o])for(var d=e[o];l>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,this.sortedCodewords[r]=s>>>16|s<<16}else for(var a=0,o=0,l=this.entries;o>>1|(1431655765&c)<<1))>>>2|(858993459&c)<<2))>>>4|(252645135&c)<<4))>>>8|(16711935&c)<<8,this.sortedCodewords[a++]=c>>>16|c<<16}}this.sortedCodewords[this.sortedEntries]=-1,this.sortedCodewords.sort(Ee.uintAsc);for(var A=0,d=this.sparse?this.sortedEntries:this.entries;A>>1|(1431655765&g)<<1))>>>2|(858993459&g)<<2))>>>4|(252645135&g)<<4))>>>8|(16711935&g)<<8)>>>16|g<<16,m=0,v=this.sortedEntries;1>1);Me.gte(p,this.sortedCodewords[w])?(m=w,v-=v>>1):v>>=1}this.sparse?(this.sortedValues[m]=t[_],this.codewordLengths[m]=f):this.sortedValues[m]=_}}},computeAcceleratedHuffman:function(){var e=new Array(1024);this.fastHuffman=e,this.fastHuffman[0]=-1;for(var t=0;t<1024;){var i=t++;this.fastHuffman[i]=-1}for(var n=0,r=this.sparse?this.sortedEntries:this.entries;n>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8)>>>16|o<<16}else a=this.codewords[s];for(;a<1024;)this.fastHuffman[a]=s,a+=1<>>a,e.validBits-=a,r=e.validBits<0?(e.validBits=0,-1):s}else r=e.decodeScalarRaw(this);this.sparse&&(r=this.sortedValues[r]);var o=r,l=this.lookupValues,u=this.sequenceP,h=this.multiplicands,c=this.minimumValue;if(o<0)return!1;if(n>this.dimensions&&(n=this.dimensions),1==this.lookupType){for(var A=1,d=0,_=0,f=n;_>>o,e.validBits-=o,s=e.validBits<0?(e.validBits=0,-1):a}else s=e.decodeScalarRaw(this);this.sparse&&(s=this.sortedValues[s]);var l=s,u=0;if(l<0)return!1;n>this.dimensions&&(n=this.dimensions);var h=this.lookupValues,c=this.sequenceP,A=this.multiplicands;if(1==this.lookupType){for(var d=1,_=0,f=n;_>>n,e.validBits-=n,t=e.validBits<0?(e.validBits=0,-1):i}else t=e.decodeScalarRaw(this);return this.sparse&&(t=this.sortedValues[t]),t},decodeDeinterleaveRepeat:function(e,t,i,n,r,s,a){var o=this.dimensions;if(0==this.lookupType)throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:488,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}));for(var l=this.multiplicands,u=this.sequenceP,h=this.lookupValues;0>>_,e.validBits-=_,A=e.validBits<0?(e.validBits=0,-1):d}else A=e.decodeScalarRaw(this);this.sparse&&(A=this.sortedValues[A]);var f=A;if(f<0){if(0==e.bytesInSeg&&e.lastSeg)return null;throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:503,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}))}if(s*iu&&(u=l.partitionClassList[d])}var _=new Array(u+1);l.classDimensions=_;var f=new Array(u+1);l.classMasterbooks=f;var g=new Array(u+1);l.classSubclasses=g;var p=new Array(u+1);l.subclassBooks=p;for(var m=0,v=u+1;m=t.length))throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:64,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}));var b=1<=t.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}))}}l.floor1Multiplier=e.readBits(2)+1,l.rangebits=e.readBits(4);var B=new Array(250);l.xlist=B,l.xlist[0]=0,l.xlist[1]=1<Y&&X[J]X[z]&&(K=X[q=J])}var $=Q,ee=q,te=l.neighbors,ie=new Array(l.values);te[z]=ie,l.neighbors[z][0]=$,l.neighbors[z][1]=ee}return i},Ie.prototype={floor0:null,floor1:null,type:null,__class__:Ie};var Ce=function(){};(x["kha.audio2.ogg.vorbis.data.Floor0"]=Ce).__name__=!0,Ce.prototype={order:null,rate:null,barkMapSize:null,amplitudeBits:null,amplitudeOffset:null,numberOfBooks:null,bookList:null,__class__:Ce};var Le=function(){};(x["kha.audio2.ogg.vorbis.data.Floor1"]=Le).__name__=!0,Le.prototype={partitions:null,partitionClassList:null,classDimensions:null,classSubclasses:null,classMasterbooks:null,subclassBooks:null,xlist:null,sortedOrder:null,neighbors:null,floor1Multiplier:null,rangebits:null,values:null,__class__:Le};var Ne=function(){};(x["kha.audio2.ogg.vorbis.data.Header"]=Ne).__name__=!0,Ne.read=function(e){var t=e.page;if(t.start(e),0==(2&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"not firstPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(4&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"lastPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(1&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"continuedPacket",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(e.firstPageValidate(),e.inputPosition+=1,1!=e.input.readByte())throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:57,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var i,n,r,s,a,o,l=new he(new ArrayBuffer(6));if(i=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[0]=i,n=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[1]=n,r=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[2]=r,s=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[3]=s,a=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[4]=a,o=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[5]=o,"vorbis"!=l.toString())throw new ft(new Xe(Ye.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}));e.inputPosition+=4;var u=e.input.readInt32();if(0!=u)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"vorbis version : "+u,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:66,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var h=new Ne;if(e.inputPosition+=1,h.channel=e.input.readByte(),0==h.channel)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"no channel",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(16>4;if(h.blocksize0=1<=h.floorConfig.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:191,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(ee.submapResidue[ne]>=h.residueConfig.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:194,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}var re=e.readBits(6)+1,se=new Array(re);h.modes=se;for(var ae=0,oe=re;ae=h.mapping.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:205,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}for(;0!=e.bytesInSeg||!e.lastSeg&&0!=e.next();)e.bytesInSeg--,e.inputPosition+=1,e.input.readByte();return h},Ne.prototype={maximumBitRate:null,nominalBitRate:null,minimumBitRate:null,sampleRate:null,channel:null,blocksize0:null,blocksize1:null,codebooks:null,floorConfig:null,residueConfig:null,mapping:null,modes:null,comment:null,vendor:null,__class__:Ne};var Fe=function(){};(x["kha.audio2.ogg.vorbis.data.IntPoint"]=Fe).__name__=!0,Fe.prototype={x:null,y:null,__class__:Fe};var Pe=function(){};(x["kha.audio2.ogg.vorbis.data.Mapping"]=Pe).__name__=!0,Pe.read=function(e,t){var i=new Pe,n=e.readBits(16);if(0!=n)throw new ft(new Xe(Ye.INVALID_SETUP,"mapping type "+n,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:22,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));var r=new Array(t);i.chan=r;for(var s=0,a=t;s>5]:10+A[c>>10]:c<16777216?c<524288?15+A[c>>15]:20+A[c>>20]:c<536870912?25+A[c>>25]:c<-2147483648?30+A[c>>30]:0);var d=t-1,_=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(i.chan[h].angle=e.readBits(d<16384?d<16?_[d]:d<512?5+_[d>>5]:10+_[d>>10]:d<16777216?d<524288?15+_[d>>15]:20+_[d>>20]:d<536870912?25+_[d>>25]:d<-2147483648?30+_[d>>30]:0),i.chan[h].magnitude>=t)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].angle>=t)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].magnitude==i.chan[h].angle)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}}else i.couplingSteps=0;if(0!=e.readBits(2))throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:61,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(1=i.submaps)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}else for(var m=0,v=t;m>1,o=this.chan[t].mux,l=e[this.submapFloor[o]];if(0==l.type)throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:94,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"doFloor"}));for(var u=l.floor1,h=0,c=r[0]*u.floor1Multiplier,A=1,d=u.values;A=t.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Residue.hx",lineNumber:55,className:"kha.audio2.ogg.vorbis.data.Residue",methodName:"read"}))}else i.residueBooks[d][p]=-1}}var m=t[i.classbook].entries,v=t[i.classbook].dimensions,w=new Array(m);i.classdata=w;for(var b=0,y=m;b>>k,e.validBits-=k,E=e.validBits<0?(e.validBits=0,-1):B}else E=e.decodeScalarRaw(S);S.sparse&&(E=S.sortedValues[E]);var I=E;if(-1==I)return;for(var C=l;0<=--C;)A[T*c+C+b]=I%this.classifications,I=I/this.classifications|0}}for(var L=0,N=l;L>>1;if(0==X){var j=o[this.classbook];e.validBits<10&&e.prepHuffman();var Z,J=j.fastHuffman[1023&e.acc];if(0<=J){var $=j.codewordLengths[J];e.acc=e.acc>>>$,e.validBits-=$,Z=e.validBits<0?(e.validBits=0,-1):J}else Z=e.decodeScalarRaw(j);j.sparse&&(Z=j.sortedValues[Z]);var ee=Z;if(-1==ee)return;for(var te=l;0<=--te;)A[te+Y]=ee%this.classifications,ee=ee/this.classifications|0}for(var ie=0,ne=l;ie>>1;++Y}}else if(1==n)for(;Y>>de,e.validBits-=de,ce=e.validBits<0?(e.validBits=0,-1):Ae}else ce=e.decodeScalarRaw(he);he.sparse&&(ce=he.sortedValues[ce]);var _e=ce;if(-1==_e)return;for(var fe=l;0<=--fe;)A[fe+Y]=_e%this.classifications,_e=_e/this.classifications|0}for(var ge=0,pe=l;ge>>Be,e.validBits-=Be,Se=e.validBits<0?(e.validBits=0,-1):Ee}else Se=e.decodeScalarRaw(Te);Te.sparse&&(Se=Te.sortedValues[Se]);var ke=Se;if(-1==ke)return;for(var Ie=l;0<=--Ie;)A[Ie+Y]=ke%this.classifications,ke=ke/this.classifications|0}for(var Ce=0,Le=l;Ce>1,b=n+8;null==b&&(b=0);var y=i.readU8(b),x=(i.readU8(b+1)|y<<8)>>1,T=n+10;null==T&&(T=0);var S=i.readU8(T),E=i.readU8(T+1)|S<<8,B=n+12;null==B&&(B=0);var k=i.readU8(B),I=(i.readU8(B+1)|k<<8)>>1,C=n+14,L=C;if(65535>=1);null==P&&(P=0);var M=i.readU8(P);(i.readU8(P+1)|M<<8)>1,O=C+2*R;null==O&&(O=0);var V=i.readU8(O);if((i.readU8(O+1)|V<<8)>1),re=n+16+12*ne;null==re&&(re=0);var se=re;null==se&&(se=0);var ae=i.readU8(se),oe=i.readU8(se+1),le=i.readU8(se+2),ue=i.readU8(se+3)|le<<8|oe<<16|ae<<24,he=n+16+12*ne+4;null==he&&(he=0);var ce=he;null==ce&&(ce=0);var Ae=i.readU8(ce),de=i.readU8(ce+1),_e=i.readU8(ce+2),fe=i.readU8(ce+3);if(t=e.numGlyphs)return-1;if(2<=e.indexToLocFormat)return-1;if(0==e.indexToLocFormat){var r=e.glyf,s=e.data,a=e.loca+2*t;null==a&&(a=0);var o=s.readU8(a);i=r+2*(s.readU8(a+1)|o<<8);var l=e.glyf,u=e.data,h=e.loca+2*t+2;null==h&&(h=0);var c=u.readU8(h);n=l+2*(u.readU8(h+1)|c<<8)}else{var A=e.glyf,d=e.data,_=e.loca+4*t;null==_&&(_=0);var f=_;null==f&&(f=0);var g=d.readU8(f),p=d.readU8(f+1),m=d.readU8(f+2);i=A+(d.readU8(f+3)|m<<8|p<<16|g<<24);var v=e.glyf,w=e.data,b=e.loca+4*t+4;null==b&&(b=0);var y=b;null==y&&(y=0);var x=w.readU8(y),T=w.readU8(y+1),S=w.readU8(y+2);n=v+(w.readU8(y+3)|S<<8|T<<16|x<<24)}return i==n?-1:i},It.stbtt_GetGlyphBox=function(e,t,i){var n=It.stbtt__GetGlyfOffset(e,t);if(n<0)return!1;var r=e.data,s=n+2;null==s&&(s=0);var a=r.readU8(s),o=r.readU8(s+1)|a<<8;i.x0=0!=(32768&o)?o-65536:o;var l=e.data,u=n+4;null==u&&(u=0);var h=l.readU8(u),c=l.readU8(u+1)|h<<8;i.y0=0!=(32768&c)?c-65536:c;var A=e.data,d=n+6;null==d&&(d=0);var _=A.readU8(d),f=A.readU8(d+1)|_<<8;i.x1=0!=(32768&f)?f-65536:f;var g=e.data,p=n+8;null==p&&(p=0);var m=g.readU8(p),v=g.readU8(p+1)|m<<8;return i.y1=0!=(32768&v)?v-65536:v,!0},It.stbtt_GetCodepointBox=function(e,t,i){return It.stbtt_GetGlyphBox(e,It.stbtt_FindGlyphIndex(e,t),i)},It.stbtt_IsGlyphEmpty=function(e,t){var i=It.stbtt__GetGlyfOffset(e,t);if(i<0)return!0;var n=e.data,r=i;null==r&&(r=0);var s=n.readU8(r),a=n.readU8(r+1)|s<<8;return 0==(0!=(32768&a)?a-65536:a)},It.stbtt__close_shape=function(e,t,i,n,r,s,a,o,l,u){return n?(i&&It.stbtt_setvertex(e[t++],3,l+a>>1,u+o>>1,l,u),It.stbtt_setvertex(e[t++],3,r,s,a,o)):i?It.stbtt_setvertex(e[t++],3,r,s,l,u):It.stbtt_setvertex(e[t++],2,r,s,0,0),t},It.copyVertices=function(e,t,i,n){for(var r=0,s=n;r>1,Q=O+n[h+j+1].y>>1):(q=n[h+j+1].x,Q=n[h+j+1].y,++j)):(q=C,Q=O),It.stbtt_setvertex(n[r++],1,q,Q,0,0),_=!1;var Z=g+2*A;null==Z&&(Z=0);var J=i.readU8(Z);d=1+(i.readU8(Z+1)|J<<8),++A}else _=0==(1&c)?(_&&It.stbtt_setvertex(n[r++],3,K+C>>1,Y+O>>1,K,Y),K=C,Y=O,!0):(_?It.stbtt_setvertex(n[r++],3,C,O,K,Y):It.stbtt_setvertex(n[r++],2,C,O,0,0),!1);++j}r=It.stbtt__close_shape(n,r,_,f,q,Q,X,z,K,Y)}else if(-1==u){var $=1,ee=s+10;for(r=0,n=null;0!=$;){var te,ie,ne=null,re=1,se=0,ae=0,oe=1,le=0,ue=0,he=ee;null==he&&(he=0);var ce=i.readU8(he),Ae=i.readU8(he+1)|ce<<8,de=0!=(32768&Ae)?Ae-65536:Ae,_e=ee+=2;null==_e&&(_e=0);var fe=i.readU8(_e),ge=i.readU8(_e+1)|fe<<8,pe=0!=(32768&ge)?ge-65536:ge;if(ee+=2,0==(2&de))throw new ft("Error");if(0!=(1&de)){var me=ee;null==me&&(me=0);var ve=i.readU8(me),we=i.readU8(me+1)|ve<<8;le=0!=(32768&we)?we-65536:we;var be=ee+=2;null==be&&(be=0);var ye=i.readU8(be),xe=i.readU8(be+1)|ye<<8;ue=0!=(32768&xe)?xe-65536:xe,ee+=2}else{var Te=ee;null==Te&&(Te=0);var Se=i.readU8(Te);le=128<=Se?Se-256:Se;var Ee=++ee;null==Ee&&(Ee=0);var Be=i.readU8(Ee);ue=128<=Be?Be-256:Be,++ee}if(0!=(8&de)){var ke=ee;null==ke&&(ke=0);var Ie=i.readU8(ke),Ce=i.readU8(ke+1)|Ie<<8;re=oe=(0!=(32768&Ce)?Ce-65536:Ce)/16384,ee+=2,se=ae=0}else if(0!=(64&de)){var Le=ee;null==Le&&(Le=0);var Ne=i.readU8(Le),Fe=i.readU8(Le+1)|Ne<<8;re=(0!=(32768&Fe)?Fe-65536:Fe)/16384,se=ae=0;var Pe=ee+=2;null==Pe&&(Pe=0);var Me=i.readU8(Pe),Re=i.readU8(Pe+1)|Me<<8;oe=(0!=(32768&Re)?Re-65536:Re)/16384,ee+=2}else if(0!=(128&de)){var Oe=ee;null==Oe&&(Oe=0);var Ve=i.readU8(Oe),De=i.readU8(Oe+1)|Ve<<8;re=(0!=(32768&De)?De-65536:De)/16384;var Ue=ee+=2;null==Ue&&(Ue=0);var He=i.readU8(Ue),We=i.readU8(Ue+1)|He<<8;se=(0!=(32768&We)?We-65536:We)/16384;var Ge=ee+=2;null==Ge&&(Ge=0);var ze=i.readU8(Ge),Xe=i.readU8(Ge+1)|ze<<8;ae=(0!=(32768&Xe)?Xe-65536:Xe)/16384;var Ye=ee+=2;null==Ye&&(Ye=0);var Ke=i.readU8(Ye),Qe=i.readU8(Ye+1)|Ke<<8;oe=(0!=(32768&Qe)?Qe-65536:Qe)/16384,ee+=2}var qe=Math.sqrt(re*re+se*se),je=Math.sqrt(ae*ae+oe*oe);if(0<(te=null==(ie=It.stbtt_GetGlyphShape(e,pe))?0:ie.length)){for(var Ze=0,Je=te;Ze>1);null==g&&(g=0);var p=g;null==p&&(p=0);var m=a.readU8(p),v=a.readU8(p+1),w=a.readU8(p+2);if(f<(n=a.readU8(p+3)|w<<8|v<<16|m<<24))_=r-1;else{if(!(nn.ey||on.ey&&(a+=(a-r)*(n.ey-o)/(o-s),o=n.ey),r==i){if(!(a<=i+1))throw new ft("Error")}else if(r==i+1){if(!(i<=a))throw new ft("Error")}else if(r<=i){if(!(a<=i))throw new ft("Error")}else if(i+1<=r){if(!(i+1<=a))throw new ft("Error")}else if(!(i<=a&&a<=i+1))throw new ft("Error");if(r<=i&&a<=i){var l=t+i;e[l]=e[l]+n.direction*(o-s)}else if(!(i+1<=r&&i+1<=a)){if(!(i<=r&&r<=i+1&&i<=a&&a<=i+1))throw new ft("Error");var u=t+i;e[u]=e[u]+n.direction*(o-s)*(1-(r-i+(a-i))/2)}}}},It.stbtt__fill_active_edges_new=function(e,t,i,n,r,s){for(var a=s+1;null!=r;){if(!(r.ey>=s))throw new ft("Error");if(0==r.fdx){var o=r.fx;o=s))throw new ft("Error");if(h=r.sy>s?(l=A+d*(r.sy-s),r.sy):(l=A,s),c=r.ey=d))throw new ft("Error");y.next=l,l=y}++h}null!=l&&It.stbtt__fill_active_edges_new(a,c,o+1,e.w,l,d);for(var x=0,T=0,S=e.w;T>1,s=It.STBTT__COMPARE(e[t],e[t+r]),a=It.STBTT__COMPARE(e[t+r],e[t+i-1]);if(s!=a){var o=It.STBTT__COMPARE(e[t],e[t+i-1])==a?0:i-1;n=e[t+o],e[t+o]=e[t+r],e[t+r]=n}n=e[t],e[t]=e[t+r],e[t+r]=n;for(var l=1,u=i-1;;){for(;It.STBTT__COMPARE(e[t+l],e[t]);)++l;for(;It.STBTT__COMPARE(e[t],e[t+u]);)--u;if(u<=l)break;n=e[t+l],e[t+l]=e[t+u],e[t+u]=n,++l,--u}ux[T+B].y:x[T+c].y>>16),d=.00392156862745098*((65280&h)>>>8),_=.00392156862745098*(255&h),f=.00392156862745098*(h>>>24)*u,g=9*Rt.bufferIndex*4;Rt.rectVertices[5+g]=A,Rt.rectVertices[6+g]=d,Rt.rectVertices[7+g]=_,Rt.rectVertices[8+g]=f,Rt.rectVertices[14+g]=A,Rt.rectVertices[15+g]=d,Rt.rectVertices[16+g]=_,Rt.rectVertices[17+g]=f,Rt.rectVertices[23+g]=A,Rt.rectVertices[24+g]=d,Rt.rectVertices[25+g]=_,Rt.rectVertices[26+g]=f,Rt.rectVertices[32+g]=A,Rt.rectVertices[33+g]=d,Rt.rectVertices[34+g]=_,Rt.rectVertices[35+g]=f;var p=c.get_width()/c.get_realWidth(),m=c.get_height()/c.get_realHeight(),v=9*Rt.bufferIndex*4;Rt.rectVertices[3+v]=0,Rt.rectVertices[4+v]=m,Rt.rectVertices[12+v]=0,Rt.rectVertices[13+v]=0,Rt.rectVertices[21+v]=p,Rt.rectVertices[22+v]=0,Rt.rectVertices[30+v]=p,Rt.rectVertices[31+v]=m;var w=9*Rt.bufferIndex*4;Rt.rectVertices[w]=t,Rt.rectVertices[1+w]=i,Rt.rectVertices[2+w]=-5,Rt.rectVertices[9+w]=n,Rt.rectVertices[10+w]=r,Rt.rectVertices[11+w]=-5,Rt.rectVertices[18+w]=s,Rt.rectVertices[19+w]=a,Rt.rectVertices[20+w]=-5,Rt.rectVertices[27+w]=o,Rt.rectVertices[28+w]=l,Rt.rectVertices[29+w]=-5,++Rt.bufferIndex,Rt.lastTexture=c},drawImage2:function(e,t,i,n,r,s,a,o,l,u,h,c,A,d,_){var f=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&f!=Rt.lastTexture)&&this.drawBuffer();var g=t/f.get_realWidth(),p=i/f.get_realHeight(),m=(t+n)/f.get_realWidth(),v=(i+r)/f.get_realHeight(),w=9*Rt.bufferIndex*4;Rt.rectVertices[3+w]=g,Rt.rectVertices[4+w]=v,Rt.rectVertices[12+w]=g,Rt.rectVertices[13+w]=p,Rt.rectVertices[21+w]=m,Rt.rectVertices[22+w]=p,Rt.rectVertices[30+w]=m,Rt.rectVertices[31+w]=v;var b=.00392156862745098*((16711680&_)>>>16),y=.00392156862745098*((65280&_)>>>8),x=.00392156862745098*(255&_),T=.00392156862745098*(_>>>24)*d,S=9*Rt.bufferIndex*4;Rt.rectVertices[5+S]=b,Rt.rectVertices[6+S]=y,Rt.rectVertices[7+S]=x,Rt.rectVertices[8+S]=T,Rt.rectVertices[14+S]=b,Rt.rectVertices[15+S]=y,Rt.rectVertices[16+S]=x,Rt.rectVertices[17+S]=T,Rt.rectVertices[23+S]=b,Rt.rectVertices[24+S]=y,Rt.rectVertices[25+S]=x,Rt.rectVertices[26+S]=T,Rt.rectVertices[32+S]=b,Rt.rectVertices[33+S]=y,Rt.rectVertices[34+S]=x,Rt.rectVertices[35+S]=T;var E=9*Rt.bufferIndex*4;Rt.rectVertices[E]=s,Rt.rectVertices[1+E]=a,Rt.rectVertices[2+E]=-5,Rt.rectVertices[9+E]=o,Rt.rectVertices[10+E]=l,Rt.rectVertices[11+E]=-5,Rt.rectVertices[18+E]=u,Rt.rectVertices[19+E]=h,Rt.rectVertices[20+E]=-5,Rt.rectVertices[27+E]=c,Rt.rectVertices[28+E]=A,Rt.rectVertices[29+E]=-5,++Rt.bufferIndex,Rt.lastTexture=f},drawImageScale:function(e,t,i,n,r,s,a,o,l,u,h){var c=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&c!=Rt.lastTexture)&&this.drawBuffer();var A=t/c.get_realWidth(),d=i/c.get_realHeight(),_=(t+n)/c.get_realWidth(),f=(i+r)/c.get_realHeight(),g=9*Rt.bufferIndex*4;Rt.rectVertices[3+g]=A,Rt.rectVertices[4+g]=f,Rt.rectVertices[12+g]=A,Rt.rectVertices[13+g]=d,Rt.rectVertices[21+g]=_,Rt.rectVertices[22+g]=d,Rt.rectVertices[30+g]=_,Rt.rectVertices[31+g]=f;var p=.00392156862745098*((16711680&h)>>>16),m=.00392156862745098*((65280&h)>>>8),v=.00392156862745098*(255&h),w=9*Rt.bufferIndex*4;Rt.rectVertices[5+w]=p,Rt.rectVertices[6+w]=m,Rt.rectVertices[7+w]=v,Rt.rectVertices[8+w]=u,Rt.rectVertices[14+w]=p,Rt.rectVertices[15+w]=m,Rt.rectVertices[16+w]=v,Rt.rectVertices[17+w]=u,Rt.rectVertices[23+w]=p,Rt.rectVertices[24+w]=m,Rt.rectVertices[25+w]=v,Rt.rectVertices[26+w]=u,Rt.rectVertices[32+w]=p,Rt.rectVertices[33+w]=m,Rt.rectVertices[34+w]=v,Rt.rectVertices[35+w]=u;var b=9*Rt.bufferIndex*4;Rt.rectVertices[b]=s,Rt.rectVertices[1+b]=l,Rt.rectVertices[2+b]=-5,Rt.rectVertices[9+b]=s,Rt.rectVertices[10+b]=a,Rt.rectVertices[11+b]=-5,Rt.rectVertices[18+b]=o,Rt.rectVertices[19+b]=a,Rt.rectVertices[20+b]=-5,Rt.rectVertices[27+b]=o,Rt.rectVertices[28+b]=l,Rt.rectVertices[29+b]=-5,++Rt.bufferIndex,Rt.lastTexture=c},end:function(){0>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.rectVertices[3+i]=r,Ot.rectVertices[4+i]=s,Ot.rectVertices[5+i]=a,Ot.rectVertices[6+i]=n,Ot.rectVertices[10+i]=r,Ot.rectVertices[11+i]=s,Ot.rectVertices[12+i]=a,Ot.rectVertices[13+i]=n,Ot.rectVertices[17+i]=r,Ot.rectVertices[18+i]=s,Ot.rectVertices[19+i]=a,Ot.rectVertices[20+i]=n,Ot.rectVertices[24+i]=r,Ot.rectVertices[25+i]=s,Ot.rectVertices[26+i]=a,Ot.rectVertices[27+i]=n},setTriVertices:function(e,t,i,n,r,s){var a=7*Ot.triangleBufferIndex*3;Ot.triangleVertices[a]=e,Ot.triangleVertices[1+a]=t,Ot.triangleVertices[2+a]=-5,Ot.triangleVertices[7+a]=i,Ot.triangleVertices[8+a]=n,Ot.triangleVertices[9+a]=-5,Ot.triangleVertices[14+a]=r,Ot.triangleVertices[15+a]=s,Ot.triangleVertices[16+a]=-5},setTriColors:function(e,t){var i=7*Ot.triangleBufferIndex*3,n=e*(.00392156862745098*(t>>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.triangleVertices[3+i]=r,Ot.triangleVertices[4+i]=s,Ot.triangleVertices[5+i]=a,Ot.triangleVertices[6+i]=n,Ot.triangleVertices[10+i]=r,Ot.triangleVertices[11+i]=s,Ot.triangleVertices[12+i]=a,Ot.triangleVertices[13+i]=n,Ot.triangleVertices[17+i]=r,Ot.triangleVertices[18+i]=s,Ot.triangleVertices[19+i]=a,Ot.triangleVertices[20+i]=n},drawBuffer:function(e){e||0>>24));Vt.rectVertices[5+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[6+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[7+i]=.00392156862745098*(255&t),Vt.rectVertices[8+i]=n,Vt.rectVertices[14+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[15+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[16+i]=.00392156862745098*(255&t),Vt.rectVertices[17+i]=n,Vt.rectVertices[23+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[24+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[25+i]=.00392156862745098*(255&t),Vt.rectVertices[26+i]=n,Vt.rectVertices[32+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[33+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[34+i]=.00392156862745098*(255&t),Vt.rectVertices[35+i]=n},drawBuffer:function(){Vt.rectVertexBuffer.unlock(4*Vt.bufferIndex),this.g.setVertexBuffer(Vt.rectVertexBuffer),this.g.setIndexBuffer(Vt.indexBuffer),this.g.setPipeline(this.myPipeline.pipeline),this.g.setTexture(this.myPipeline.textureLocation,Vt.lastTexture),this.g.setMatrix(this.myPipeline.projectionLocation,this.projectionMatrix),this.g.setTextureParameters(this.myPipeline.textureLocation,2,2,this.bilinear?1:0,this.bilinear?1:0,0),this.g.drawIndexedVertices(0,2*Vt.bufferIndex*3),this.g.setTexture(this.myPipeline.textureLocation,null),Vt.bufferIndex=0,Vt.rectVertices=Vt.rectVertexBuffer.lock()},setBilinearFilter:function(e){this.end(),this.bilinear=e},setFont:function(e){this.font=g.__cast(e,D)},bakedQuadCache:null,drawString:function(e,t,i,n,r,s){var a=this.font._get(this.fontSize),o=a.getTexture();null!=Vt.lastTexture&&o!=Vt.lastTexture&&this.drawBuffer(),Vt.lastTexture=o;for(var l=n,u=r,h=0,c=e.length;h>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e},Dt.createImageVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createImagePipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_image_frag,t.vertexShader=z.painter_image_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createColoredVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("vertexColor",3),e},Dt.createColoredPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_colored_frag,t.vertexShader=z.painter_colored_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createTextVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createTextPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_text_frag,t.vertexShader=z.painter_text_vert,t.inputLayout=[e],t.blendSource=3,t.blendDestination=5,t.alphaBlendSource=3,t.alphaBlendDestination=5,t},Dt.__super__=Qe,Dt.prototype=r(Qe.prototype,{myColor:null,myFont:null,projectionMatrix:null,imagePainter:null,coloredPainter:null,textPainter:null,canvas:null,g:null,setProjection:function(){var e=this.canvas.get_width(),t=this.canvas.get_height();if(this.canvas instanceof F){var i=this.projectionMatrix,n=2/e,r=-e/e,s=2/(0-t),a=-t/(0-t);i._00=n,i._10=0,i._20=0,i._30=r,i._01=0,i._11=s,i._21=0,i._31=a,i._02=0,i._12=0,i._22=-.002000200020002,i._32=-1.0002000200020003,i._03=0,i._13=0,i._23=0,i._33=1}else if(R.get_nonPow2Supported()||(e=Dt.upperPowerOfTwo(e),t=Dt.upperPowerOfTwo(t)),R.renderTargetsInvertedY()){var o=this.projectionMatrix,l=2/e,u=-e/e,h=2/t,c=-t/t;o._00=l,o._10=0,o._20=0,o._30=u,o._01=0,o._11=h,o._21=0,o._31=c,o._02=0,o._12=0,o._22=-.002000200020002,o._32=-1.0002000200020003,o._03=0,o._13=0,o._23=0,o._33=1}else{var A=this.projectionMatrix,d=2/e,_=-e/e,f=2/(0-t),g=-t/(0-t);A._00=d,A._10=0,A._20=0,A._30=_,A._01=0,A._11=f,A._21=0,A._31=g,A._02=0,A._12=0,A._22=-.002000200020002,A._32=-1.0002000200020003,A._03=0,A._13=0,A._23=0,A._33=1}this.imagePainter.setProjection(this.projectionMatrix),this.coloredPainter.setProjection(this.projectionMatrix),this.textPainter.setProjection(this.projectionMatrix)},drawImage:function(e,t,i){var n=this.coloredPainter;0>>16),G=.00392156862745098*((65280&U)>>>8),z=.00392156862745098*(255&U),X=.00392156862745098*(U>>>24)*D,Y=9*Rt.bufferIndex*4;Rt.rectVertices[5+Y]=W,Rt.rectVertices[6+Y]=G,Rt.rectVertices[7+Y]=z,Rt.rectVertices[8+Y]=X,Rt.rectVertices[14+Y]=W,Rt.rectVertices[15+Y]=G,Rt.rectVertices[16+Y]=z,Rt.rectVertices[17+Y]=X,Rt.rectVertices[23+Y]=W,Rt.rectVertices[24+Y]=G,Rt.rectVertices[25+Y]=z,Rt.rectVertices[26+Y]=X,Rt.rectVertices[32+Y]=W,Rt.rectVertices[33+Y]=G,Rt.rectVertices[34+Y]=z,Rt.rectVertices[35+Y]=X;var K=H.get_width()/H.get_realWidth(),Q=H.get_height()/H.get_realHeight(),q=9*Rt.bufferIndex*4;Rt.rectVertices[3+q]=0,Rt.rectVertices[4+q]=Q,Rt.rectVertices[12+q]=0,Rt.rectVertices[13+q]=0,Rt.rectVertices[21+q]=K,Rt.rectVertices[22+q]=0,Rt.rectVertices[30+q]=K,Rt.rectVertices[31+q]=Q;var j=9*Rt.bufferIndex*4;Rt.rectVertices[j]=A,Rt.rectVertices[1+j]=d,Rt.rectVertices[2+j]=-5,Rt.rectVertices[9+j]=w,Rt.rectVertices[10+j]=b,Rt.rectVertices[11+j]=-5,Rt.rectVertices[18+j]=k,Rt.rectVertices[19+j]=I,Rt.rectVertices[20+j]=-5,Rt.rectVertices[27+j]=R,Rt.rectVertices[28+j]=O,Rt.rectVertices[29+j]=-5,++Rt.bufferIndex,Rt.lastTexture=H},drawScaledSubImage:function(e,t,i,n,r,s,a,o,l){var u=this.coloredPainter;0>>16),J=.00392156862745098*((65280&z)>>>8),$=.00392156862745098*(255&z),ee=.00392156862745098*(z>>>24)*G,te=9*Rt.bufferIndex*4;Rt.rectVertices[5+te]=Z,Rt.rectVertices[6+te]=J,Rt.rectVertices[7+te]=$,Rt.rectVertices[8+te]=ee,Rt.rectVertices[14+te]=Z,Rt.rectVertices[15+te]=J,Rt.rectVertices[16+te]=$,Rt.rectVertices[17+te]=ee,Rt.rectVertices[23+te]=Z,Rt.rectVertices[24+te]=J,Rt.rectVertices[25+te]=$,Rt.rectVertices[26+te]=ee,Rt.rectVertices[32+te]=Z,Rt.rectVertices[33+te]=J,Rt.rectVertices[34+te]=$,Rt.rectVertices[35+te]=ee;var ie=9*Rt.bufferIndex*4;Rt.rectVertices[ie]=g,Rt.rectVertices[1+ie]=p,Rt.rectVertices[2+ie]=-5,Rt.rectVertices[9+ie]=T,Rt.rectVertices[10+ie]=S,Rt.rectVertices[11+ie]=-5,Rt.rectVertices[18+ie]=N,Rt.rectVertices[19+ie]=F,Rt.rectVertices[20+ie]=-5,Rt.rectVertices[27+ie]=U,Rt.rectVertices[28+ie]=H,Rt.rectVertices[29+ie]=-5,++Rt.bufferIndex,Rt.lastTexture=X},get_color:function(){return this.myColor},set_color:function(e){return this.myColor=e},drawRect:function(e,t,i,n,r){null==r&&(r=1),this.imagePainter.end(),this.textPainter.end();var s=this.transformations[this.transformationIndex],a=e-r/2,o=t+r/2;null==o&&(o=0),null==a&&(a=0);var l=s._02*a+s._12*o+s._22,u=(s._00*a+s._10*o+s._20)/l,h=(s._01*a+s._11*o+s._21)/l;null==h&&(h=0),null==u&&(u=0);var c=u,A=h,d=this.transformations[this.transformationIndex],_=e-r/2,f=t-r/2;null==f&&(f=0),null==_&&(_=0);var g=d._02*_+d._12*f+d._22,p=(d._00*_+d._10*f+d._20)/g,m=(d._01*_+d._11*f+d._21)/g;null==m&&(m=0),null==p&&(p=0);var v=p,w=m,b=this.transformations[this.transformationIndex],y=e+i+r/2,x=t-r/2;null==x&&(x=0),null==y&&(y=0);var T=b._02*y+b._12*x+b._22,S=(b._00*y+b._10*x+b._20)/T,E=(b._01*y+b._11*x+b._21)/T;null==E&&(E=0),null==S&&(S=0);var B=S,k=E,I=this.transformations[this.transformationIndex],C=e+i+r/2,L=t+r/2;null==L&&(L=0),null==C&&(C=0);var N=I._02*C+I._12*L+I._22,F=(I._00*C+I._10*L+I._20)/N,P=(I._01*C+I._11*L+I._21)/N;null==P&&(P=0),null==F&&(F=0);var M=F,R=P;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var O=this.transformations[this.transformationIndex],V=e-r/2,D=t+n-r/2;null==D&&(D=0),null==V&&(V=0);var U=O._02*V+O._12*D+O._22,H=(O._00*V+O._10*D+O._20)/U,W=(O._01*V+O._11*D+O._21)/U;null==W&&(W=0),null==H&&(H=0),c=H,A=W;var G=this.transformations[this.transformationIndex],z=e-r/2,X=t+r/2;null==X&&(X=0),null==z&&(z=0);var Y=G._02*z+G._12*X+G._22,K=(G._00*z+G._10*X+G._20)/Y,Q=(G._01*z+G._11*X+G._21)/Y;null==Q&&(Q=0),null==K&&(K=0),v=K,w=Q;var q=this.transformations[this.transformationIndex],j=e+r/2,Z=t+r/2;null==Z&&(Z=0),null==j&&(j=0);var J=q._02*j+q._12*Z+q._22,$=(q._00*j+q._10*Z+q._20)/J,ee=(q._01*j+q._11*Z+q._21)/J;null==ee&&(ee=0),null==$&&($=0),B=$,k=ee;var te=this.transformations[this.transformationIndex],ie=e+r/2,ne=t+n-r/2;null==ne&&(ne=0),null==ie&&(ie=0);var re=te._02*ie+te._12*ne+te._22,se=(te._00*ie+te._10*ne+te._20)/re,ae=(te._01*ie+te._11*ne+te._21)/re;null==ae&&(ae=0),null==se&&(se=0),M=se,R=ae,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var oe=this.transformations[this.transformationIndex],le=e-r/2,ue=t+n+r/2;null==ue&&(ue=0),null==le&&(le=0);var he=oe._02*le+oe._12*ue+oe._22,ce=(oe._00*le+oe._10*ue+oe._20)/he,Ae=(oe._01*le+oe._11*ue+oe._21)/he;null==Ae&&(Ae=0),null==ce&&(ce=0),c=ce,A=Ae;var de=this.transformations[this.transformationIndex],_e=e-r/2,fe=t+n-r/2;null==fe&&(fe=0),null==_e&&(_e=0);var ge=de._02*_e+de._12*fe+de._22,pe=(de._00*_e+de._10*fe+de._20)/ge,me=(de._01*_e+de._11*fe+de._21)/ge;null==me&&(me=0),null==pe&&(pe=0),v=pe,w=me;var ve=this.transformations[this.transformationIndex],we=e+i+r/2,be=t+n-r/2;null==be&&(be=0),null==we&&(we=0);var ye=ve._02*we+ve._12*be+ve._22,xe=(ve._00*we+ve._10*be+ve._20)/ye,Te=(ve._01*we+ve._11*be+ve._21)/ye;null==Te&&(Te=0),null==xe&&(xe=0),B=xe,k=Te;var Se=this.transformations[this.transformationIndex],Ee=e+i+r/2,Be=t+n+r/2;null==Be&&(Be=0),null==Ee&&(Ee=0);var ke=Se._02*Ee+Se._12*Be+Se._22,Ie=(Se._00*Ee+Se._10*Be+Se._20)/ke,Ce=(Se._01*Ee+Se._11*Be+Se._21)/ke;null==Ce&&(Ce=0),null==Ie&&(Ie=0),M=Ie,R=Ce,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var Le=this.transformations[this.transformationIndex],Ne=e+i-r/2,Fe=t+n-r/2;null==Fe&&(Fe=0),null==Ne&&(Ne=0);var Pe=Le._02*Ne+Le._12*Fe+Le._22,Me=(Le._00*Ne+Le._10*Fe+Le._20)/Pe,Re=(Le._01*Ne+Le._11*Fe+Le._21)/Pe;null==Re&&(Re=0),null==Me&&(Me=0),c=Me,A=Re;var Oe=this.transformations[this.transformationIndex],Ve=e+i-r/2,De=t+r/2;null==De&&(De=0),null==Ve&&(Ve=0);var Ue=Oe._02*Ve+Oe._12*De+Oe._22,He=(Oe._00*Ve+Oe._10*De+Oe._20)/Ue,We=(Oe._01*Ve+Oe._11*De+Oe._21)/Ue;null==We&&(We=0),null==He&&(He=0),v=He,w=We;var Ge=this.transformations[this.transformationIndex],ze=e+i+r/2,Xe=t+r/2;null==Xe&&(Xe=0),null==ze&&(ze=0);var Ye=Ge._02*ze+Ge._12*Xe+Ge._22,Ke=(Ge._00*ze+Ge._10*Xe+Ge._20)/Ye,Qe=(Ge._01*ze+Ge._11*Xe+Ge._21)/Ye;null==Qe&&(Qe=0),null==Ke&&(Ke=0),B=Ke,k=Qe;var qe=this.transformations[this.transformationIndex],je=e+i+r/2,Ze=t+n-r/2;null==Ze&&(Ze=0),null==je&&(je=0);var Je=qe._02*je+qe._12*Ze+qe._22,$e=(qe._00*je+qe._10*Ze+qe._20)/Je,et=(qe._01*je+qe._11*Ze+qe._21)/Je;null==et&&(et=0),null==$e&&($e=0),M=$e,R=et,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R)},fillRect:function(e,t,i,n){this.imagePainter.end(),this.textPainter.end();var r=this.transformations[this.transformationIndex],s=e,a=t+n;null==a&&(a=0),null==s&&(s=0);var o=r._02*s+r._12*a+r._22,l=(r._00*s+r._10*a+r._20)/o,u=(r._01*s+r._11*a+r._21)/o;null==u&&(u=0),null==l&&(l=0);var h=l,c=u,A=this.transformations[this.transformationIndex],d=e,_=t;null==_&&(_=0),null==d&&(d=0);var f=A._02*d+A._12*_+A._22,g=(A._00*d+A._10*_+A._20)/f,p=(A._01*d+A._11*_+A._21)/f;null==p&&(p=0),null==g&&(g=0);var m=g,v=p,w=this.transformations[this.transformationIndex],b=e+i,y=t;null==y&&(y=0),null==b&&(b=0);var x=w._02*b+w._12*y+w._22,T=(w._00*b+w._10*y+w._20)/x,S=(w._01*b+w._11*y+w._21)/x;null==S&&(S=0),null==T&&(T=0);var E=T,B=S,k=this.transformations[this.transformationIndex],I=e+i,C=t+n;null==C&&(C=0),null==I&&(I=0);var L=k._02*I+k._12*C+k._22,N=(k._00*I+k._10*C+k._20)/L,F=(k._01*I+k._11*C+k._21)/L;null==F&&(F=0),null==N&&(N=0);var P=N,M=F;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),h,c,m,v,E,B,P,M)},drawString:function(e,t,i){this.imagePainter.end();var n=this.coloredPainter;0=Zt.instances.length?null:Zt.instances[e]},Zt.notifyOnConnect=function(e,t){null!=e&&Zt.connectListeners.push(e),null!=t&&Zt.disconnectListeners.push(t)},Zt.removeConnect=function(e,t){null!=e&&it.remove(Zt.connectListeners,e),null!=t&&it.remove(Zt.disconnectListeners,t)},Zt.sendConnectEvent=function(e){Zt.instances[e].connected=!0;for(var t=0,i=Zt.connectListeners;t>23&255,n=8388607&e;switch(i){case 0:return 0;case 255:return 0!=n?NaN:0>>t&1)){return!0}return!1},si.toText=function(e,t){for(var i="",n=0,r=t;n>>16)}),"R",0,1,!0),r=e.slider(t.nest(1,{value:.00392156862745098*((65280&t.color)>>>8)}),"G",0,1,!0),s=e.slider(t.nest(2,{value:.00392156862745098*(255&t.color)}),"B",0,1,!0),a=.00392156862745098*(t.color>>>24);i&&(a=e.slider(t.nest(3,{value:a}),"A",0,1,!0));var o=C.fromFloats(n,r,s,a);return e.text("",2,o),o},Bi.initPath=function(e,t){e.text="Windows"==t?"C:\\Users":"/"},Bi.fileBrowser=function(e,t,i){null==i&&(i=!1);var n="/",r="ls ",s=pt.get_systemId();"Windows"==s&&(r="dir /b ",i&&(r+="/ad "),n="\\",t.text=ut.replace(t.text,"\\\\","\\"),t.text=ut.replace(t.text,"\r","")),""==t.text&&Bi.initPath(t,s);var a=Krom.getFilesLocation()+n+Bi.dataPath+"dir.txt";t.text!=Bi.lastPath&&Krom.sysCommand(r+'"'+t.text+'" > "'+a+'"'),Bi.lastPath=t.text;var o=he.ofData(Krom.loadBlob(a)).toString().split("\n"),l=t.text.indexOf("/"),u=t.text.indexOf("\\"),h=-1l||-1u;t.changed=!1,h&&e.button("..",0)&&(t.changed=e.changed=!0,t.text=t.text.substring(0,t.text.lastIndexOf(n)),2==t.text.length&&":"==t.text.charAt(1)&&(t.text+=n));for(var c=0;c=i.length&&(t.position=0),t.changed=e.changed=!0):t.changed=!1;var r=e.getHover();return Bi.drawInlineRadio(e,i[t.position],r,n),e.endElement(),t.position},Bi.drawInlineRadio=function(e,t,i,n){null==n&&(n=1),i?(e.g.set_color(e.t.ACCENT_HOVER_COL),e.g.fillRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)):(e.g.set_color(e.t.ACCENT_COL),e.enabled||e.fadeColor(),e.g.drawRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)),e.g.set_color(e.t.TEXT_COL),e.drawString(e.g,t,e.t.TEXT_OFFSET*e.ops.scaleFactor,0,n)},Bi.colorWheel=function(e,t,i,n,r,s){null==s&&(s=!0),null==r&&(r=!1),null==i&&(i=!1),null==n&&(n=e._w),Bi.rgbToHsv(.00392156862745098*((16711680&t.color)>>>16),.00392156862745098*((65280&t.color)>>>8),.00392156862745098*(255&t.color),Bi.ar);var a=Bi.ar[0],o=Bi.ar[1],l=Bi.ar[2],u=.00392156862745098*(t.color>>>24),h=e._x,c=e._y;null!=e.currentWindow&&e.currentWindow.scrollEnabled||(n-=e.t.SCROLL_W*e.ops.scaleFactor|0,h+=(e.t.SCROLL_W*e.ops.scaleFactor|0)/2),e.image(e.ops.color_wheel,C.fromFloats(l,l,l));var A=h+n/2,d=c+(e._y-c)/2,_=.7*n,f=_/2,g=A,p=d+o*f,m=a*(2*Math.PI),v=Math.cos(m)*(g-A)-Math.sin(m)*(p-d)+A,w=Math.sin(m)*(g-A)+Math.cos(m)*(p-d)+d;g=v,p=w,e.g.set_color(-16777216),e.g.fillRect(g-3*e.ops.scaleFactor,p-3*e.ops.scaleFactor,6*e.ops.scaleFactor,6*e.ops.scaleFactor),e.g.set_color(-1),e.g.fillRect(g-2*e.ops.scaleFactor,p-2*e.ops.scaleFactor,4*e.ops.scaleFactor,4*e.ops.scaleFactor),r&&(i?e.row([.3333333333333333,.3333333333333333,.3333333333333333]):e.row([.5,.5]));var b=t.nest(0);if(b.value=Math.round(100*l)/100,l=e.slider(b,"Value",0,1,!0),b.changed?t.changed=e.changed=!0:t.changed=!1,i){var y=t.nest(1,{value:Math.round(100*u)/100});u=e.slider(y,"Alpha",0,1,!0),y.changed&&(t.changed=e.changed=!0)}var x=A+e._windowX,T=d+e._windowY;if(e.inputStarted&&e.getInputInRect(x-f,T-f,_,_)&&(Bi.wheelSelectedHande=t),e.inputReleased&&(Bi.wheelSelectedHande=null),e.inputDown&&Bi.wheelSelectedHande==t){var S=x-e.inputX,E=T-e.inputY;o=Math.min(Math.sqrt(S*S+E*E),f)/f;var B=Math.atan2(e.inputX-x,e.inputY-T);B<0&&(B=Math.PI+(Math.PI-Math.abs(B))),a=(B=2*Math.PI-B)/(2*Math.PI),t.changed=e.changed=!0}return Bi.hsvToRgb(a,o,l,Bi.ar),t.color=C.fromFloats(Bi.ar[0],Bi.ar[1],Bi.ar[2],u),s&&e.text("",2,t.color),t.color},Bi.keycodeToString=function(e){switch(e){case-1:return"None";case 0:return"Unknown";case 1:return"Back";case 3:return"Cancel";case 6:return"Help";case 8:return"Backspace";case 9:return"Tab";case 12:return"Clear";case 13:return"Return";case 16:return"Shift";case 17:return"Ctrl";case 18:return"Alt";case 19:return"Pause";case 20:return"CapsLock";case 21:return"Kana";case 22:return"Eisu";case 23:return"Junja";case 24:return"Final";case 25:return"Hanja";case 27:return"Esc";case 28:return"Convert";case 29:return"NonConvert";case 30:return"Accept";case 31:return"ModeChange";case 32:return"Space";case 33:return"PageUp";case 34:return"PageDown";case 35:return"End";case 36:return"Home";case 37:return"Left";case 38:return"Up";case 39:return"Right";case 40:return"Down";case 41:return"Select";case 42:return"Print";case 43:return"Execute";case 44:return"PrintScreen";case 45:return"Insert";case 46:return"Delete";case 58:return"Colon";case 59:return"Semicolon";case 60:return"LessThan";case 61:return"Equals";case 62:return"GreaterThan";case 63:return"QuestionMark";case 64:return"At";case 91:return"Win";case 93:return"ContextMenu";case 95:return"Sleep";case 96:return"Numpad0";case 97:return"Numpad1";case 98:return"Numpad2";case 99:return"Numpad3";case 100:return"Numpad4";case 101:return"Numpad5";case 102:return"Numpad6";case 103:return"Numpad7";case 104:return"Numpad8";case 105:return"Numpad9";case 106:return"Multiply";case 107:return"Add";case 108:return"Separator";case 109:return"Subtract";case 110:return"Decimal";case 111:return"Divide";case 112:return"F1";case 113:return"F2";case 114:return"F3";case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 124:return"F13";case 125:return"F14";case 126:return"F15";case 127:return"F16";case 128:return"F17";case 129:return"F18";case 130:return"F19";case 131:return"F20";case 132:return"F21";case 133:return"F22";case 134:return"F23";case 135:return"F24";case 144:return"NumLock";case 145:return"ScrollLock";case 146:return"WinOemFjJisho";case 147:return"WinOemFjMasshou";case 148:return"WinOemFjTouroku";case 149:return"WinOemFjLoya";case 150:return"WinOemFjRoya";case 160:return"Circumflex";case 161:return"Exclamation";case 162:return"DoubleQuote";case 163:return"Hash";case 164:return"Dollar";case 165:return"Percent";case 166:return"Ampersand";case 167:return"Underscore";case 168:return"OpenParen";case 169:return"CloseParen";case 170:return"Asterisk";case 171:return"Plus";case 172:return"Pipe";case 173:return"HyphenMinus";case 174:return"OpenCurlyBracket";case 175:return"CloseCurlyBracket";case 176:return"Tilde";case 181:return"VolumeMute";case 182:return"VolumeDown";case 183:return"VolumeUp";case 188:return"Comma";case 190:return"Period";case 191:return"Slash";case 192:return"BackQuote";case 219:return"OpenBracket";case 220:return"BackSlash";case 221:return"CloseBracket";case 222:return"Quote";case 224:return"Meta";case 225:return"AltGr";case 227:return"WinIcoHelp";case 228:return"WinIco00";case 230:return"WinIcoClear";case 233:return"WinOemReset";case 234:return"WinOemJump";case 235:return"WinOemPA1";case 236:return"WinOemPA2";case 237:return"WinOemPA3";case 238:return"WinOemWSCTRL";case 239:return"WinOemCUSEL";case 240:return"WinOemATTN";case 241:return"WinOemFinish";case 242:return"WinOemCopy";case 243:return"WinOemAuto";case 244:return"WinOemENLW";case 245:return"WinOemBackTab";case 246:return"ATTN";case 247:return"CRSEL";case 248:return"EXSEL";case 249:return"EREOF";case 250:return"Play";case 251:return"Zoom";case 253:return"PA1";case 254:return"WinOemClear"}return String.fromCodePoint(e)},Bi.dist=function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)},Bi.fract=function(e){return e-(0|e)},Bi.mix=function(e,t,i){return e*(1-i)+t*i},Bi.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},Bi.step=function(e,t){return tIi.modalX+Ii.modalW||Ii.ui.inputYIi.modalY+Ii.modalH)&&(Ii.show=!1)},Ii.showMessage=function(e,t,i){Ii.ui=e,Ii.init(),Ii.boxTitle=t,Ii.boxText=i,Ii.boxCommands=null},Ii.showCustom=function(e,t,i,n,r,s){null==s&&(s=160),null==r&&(r=400),null==n&&(n=-1),null==i&&(i=-1),Ii.ui=e,Ii.init(i,n,r,s),Ii.boxTitle="",Ii.boxText="",Ii.boxCommands=t},Ii.init=function(e,t,i,n){null==n&&(n=160),null==i&&(i=400),null==t&&(t=-1),null==e&&(e=-1);var r=pt.windowWidth(),s=pt.windowHeight();Ii.modalX=e,Ii.modalY=t,Ii.modalW=i*Ii.ui.ops.scaleFactor|0,Ii.modalH=n*Ii.ui.ops.scaleFactor|0,-1==e&&(Ii.modalX=r/2-Ii.modalW/2|0),-1==t&&(Ii.modalY=s/2-Ii.modalH/2|0),Ii.modalX=0|Math.max(0,Math.min(Ii.modalX,r-Ii.modalW)),Ii.modalY=0|Math.max(0,Math.min(Ii.modalY,s-Ii.modalH)),Ii.hwnd.dragX=0,Ii.hwnd.dragY=0,Ii.show=!0};var Ci=function(){};(x["zui.Themes"]=Ci).__name__=!0;var Li=function(e){this.restoreY=-1,this.restoreX=-1,this.checkSelectImage=null,this.elementsBaked=!1,this.tabScroll=0,this.tabHandle=null,this.tabNames=null,this.tooltipTime=0,this.tooltipWait=!1,this.tooltipShown=!1,this.tooltipY=0,this.tooltipX=0,this.tooltipInvertY=!1,this.tooltipImgMaxWidth=null,this.tooltipImg=null,this.tooltipText="",this.comboToSubmit=0,this.submitComboHandle=null,this.comboSelectedWindow=null,this.comboSelectedHandle=null,this.tabPressedHandle=null,this.tabPressed=!1,this.textToSubmit="",this.submitTextHandle=null,this.textSelectedHandle=null,this.windowHeader=0,this.dragHandle=null,this.scrollHandle=null,this.windowEnded=!0,this._windowY=0,this._windowX=0,this.imageScrollAlign=!0,this.scrollAlign=0,this.curRatio=-1,this.highlightAnchor=0,this.cursorY=0,this.cursorX=0,this.key=null,this.isReturnDown=!1,this.isEscapeDown=!1,this.isDeleteDown=!1,this.isBackspaceDown=!1,this.isAltDown=!1,this.isCtrlDown=!1,this.isShiftDown=!1,this.isKeyDown=!1,this.isKeyPressed=!1,this.inputWheelDelta=0,this.inputEnabled=!0,this.inputRegistered=!1,this.alwaysRedraw=!1,this.scrollEnabled=!0,this.imageInvertY=!1,this.changed=!1,this.isReleased=!1,this.isHovered=!1,this.isPushed=!1,this.isStarted=!1,this.enabled=!0,this.isTyping=!1,this.isScrolling=!1,null==e.theme&&(e.theme=Ci.dark),this.t=e.theme,null==e.khaWindowId&&(e.khaWindowId=0),null==e.scaleFactor&&(e.scaleFactor=1),null==e.autoNotifyInput&&(e.autoNotifyInput=!0),this.ops=e,this.setScale(e.scaleFactor),e.autoNotifyInput&&this.registerInput(),null==Li.copyReceiver&&(Li.copyReceiver=this,pt.notifyOnCutCopyPaste(Ni(this,this.onCut),Ni(this,this.onCopy),Ni(this,this.onPaste)),pt.notifyOnFrames(function(e){(Li.isCopy||Li.isPaste)&&1<++Li.copyFrame&&(Li.isCopy=Li.isCut=Li.isPaste=!1,Li.copyFrame=0)}));var t=Dt.createTextVertexStructure();this.rtTextPipeline=Dt.createTextPipeline(t),this.rtTextPipeline.alphaBlendSource=1,this.rtTextPipeline.compile()};function Ni(e,t){return null==t?null:(null==t.__id__&&(t.__id__=n.$haxeUID++),null==e.hx__closures__?e.hx__closures__={}:i=e.hx__closures__[t.__id__],null==i&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i);var i}(x["zui.Zui"]=Li).__name__=!0,Li.prototype={isScrolling:null,isTyping:null,enabled:null,isStarted:null,isPushed:null,isHovered:null,isReleased:null,changed:null,imageInvertY:null,scrollEnabled:null,alwaysRedraw:null,inputRegistered:null,inputEnabled:null,inputX:null,inputY:null,inputStartedX:null,inputStartedY:null,inputDX:null,inputDY:null,inputWheelDelta:null,inputStarted:null,inputStartedR:null,inputReleased:null,inputReleasedR:null,inputDown:null,inputDownR:null,isKeyPressed:null,isKeyDown:null,isShiftDown:null,isCtrlDown:null,isAltDown:null,isBackspaceDown:null,isDeleteDown:null,isEscapeDown:null,isReturnDown:null,key:null,char:null,cursorX:null,cursorY:null,highlightAnchor:null,ratios:null,curRatio:null,xBeforeSplit:null,wBeforeSplit:null,g:null,t:null,ops:null,globalG:null,rtTextPipeline:null,fontSize:null,fontOffsetY:null,arrowOffsetX:null,arrowOffsetY:null,titleOffsetX:null,buttonOffsetY:null,checkOffsetX:null,checkOffsetY:null,checkSelectOffsetX:null,checkSelectOffsetY:null,radioOffsetX:null,radioOffsetY:null,radioSelectOffsetX:null,radioSelectOffsetY:null,scrollAlign:null,imageScrollAlign:null,_x:null,_y:null,_w:null,_h:null,_windowX:null,_windowY:null,_windowW:null,_windowH:null,currentWindow:null,windowEnded:null,scrollHandle:null,dragHandle:null,windowHeader:null,textSelectedHandle:null,textSelectedCurrentText:null,submitTextHandle:null,textToSubmit:null,tabPressed:null,tabPressedHandle:null,comboSelectedHandle:null,comboSelectedWindow:null,comboSelectedAlign:null,comboSelectedTexts:null,comboSelectedLabel:null,comboSelectedX:null,comboSelectedY:null,comboSelectedW:null,submitComboHandle:null,comboToSubmit:null,tooltipText:null,tooltipImg:null,tooltipImgMaxWidth:null,tooltipInvertY:null,tooltipX:null,tooltipY:null,tooltipShown:null,tooltipWait:null,tooltipTime:null,tabNames:null,tabHandle:null,tabScroll:null,elementsBaked:null,checkSelectImage:null,setScale:function(e){this.ops.scaleFactor=e,this.fontSize=this.t.FONT_SIZE*this.ops.scaleFactor|0;var t=this.ops.font.height(this.fontSize);this.fontOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-t)/2,this.arrowOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.ARROW_SIZE*this.ops.scaleFactor)/2,this.arrowOffsetX=this.arrowOffsetY,this.titleOffsetX=(2*this.arrowOffsetX+this.t.ARROW_SIZE*this.ops.scaleFactor)/this.ops.scaleFactor,this.buttonOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.BUTTON_H*this.ops.scaleFactor)/2,this.checkOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.checkOffsetX=this.checkOffsetY,this.checkSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.checkSelectOffsetX=this.checkSelectOffsetY,this.radioOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.radioOffsetX=this.radioOffsetY,this.radioSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.radioSelectOffsetX=this.radioSelectOffsetY,this.elementsBaked=!1},bakeElements:function(){null!=this.checkSelectImage&&this.checkSelectImage.unload(),this.checkSelectImage=R.createRenderTarget(this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,null,0,1,this.ops.khaWindowId);var e=this.checkSelectImage.get_g2();e.begin(!0,0),e.set_color(this.t.ACCENT_SELECT_COL),e.drawLine(0,0,this.checkSelectImage.get_width(),this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.drawLine(this.checkSelectImage.get_width(),0,0,this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.end(),this.elementsBaked=!0},remove:function(){this.ops.autoNotifyInput&&this.unregisterInput()},registerInput:function(){ti.get().notifyWindowed(this.ops.khaWindowId,Ni(this,this.onMouseDown),Ni(this,this.onMouseUp),Ni(this,this.onMouseMove),Ni(this,this.onMouseWheel)),ei.get().notify(Ni(this,this.onKeyDown),Ni(this,this.onKeyUp),Ni(this,this.onKeyPress)),this.inputRegistered=!0},unregisterInput:function(){ti.get().removeWindowed(this.ops.khaWindowId,Ni(this,this.onMouseDown),Ni(this,this.onMouseUp),Ni(this,this.onMouseMove),Ni(this,this.onMouseWheel)),ei.get().remove(Ni(this,this.onKeyDown),Ni(this,this.onKeyUp),Ni(this,this.onKeyPress)),this.endInput(),this.inputX=this.inputY=0,this.inputRegistered=!1},begin:function(e){this.elementsBaked||this.bakeElements(),this.changed=!1,this.globalG=e,this._x=0,this._y=0,this._w=0,this._h=0},end:function(e){null==e&&(e=!0),this.windowEnded||this.endWindow(),this.drawCombo(),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},beginRegion:function(e,t,i,n){this.elementsBaked||(e.end(),this.bakeElements(),e.begin(!1)),this.changed=!1,this.globalG=e,this.g=e,this.currentWindow=null,this.tooltipText="",this.tooltipImg=null,this._windowX=0,this._windowY=0,this._windowW=n,this._x=t,this._y=i,this._w=n},endRegion:function(e){null==e&&(e=!0),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},endInput:function(){this.isKeyPressed=!1,this.inputStarted=!1,this.inputStartedR=!1,this.inputReleased=!1,this.inputReleasedR=!1,this.inputDX=0,this.inputDY=0,this.inputWheelDelta=0,Li.textToPaste="",Li.keyRepeat&&this.isKeyDown&&.05t.length?t.length:this.cursorX+1),this.isShiftDown&&(37==this.key||39==this.key||16==this.key)||this.isCtrlDown||(this.highlightAnchor=this.cursorX));""!=Li.textToPaste&&(t=it.substr(t,0,this.highlightAnchor)+Li.textToPaste+it.substr(t,this.cursorX,null),this.cursorX+=Li.textToPaste.length,this.highlightAnchor=this.cursorX,Li.textToPaste=""),this.highlightAnchor==this.cursorX?Li.textToCopy=t:this.highlightAnchorn&&(e.value=n),e.changed=this.changed=!0}var d=this.getHover();this.drawSlider(e.value,i,n,r,d),(this.getReleased()||this.tabPressed)&&l&&(e.text=e.value+"",this.startTextEdit(e),e.changed=this.changed=!0);var _=0==o?2:0;return this.textSelectedHandle==e&&this.updateTextEdit(_),this.submitTextHandle==e&&(this.submitTextEdit(),e.value=parseFloat(e.text),e.changed=this.changed=!0),this.g.set_color(this.t.LABEL_COL),this.drawString(this.g,t,null,0,o),a&&(this.g.set_color(this.t.TEXT_COL),this.textSelectedHandle!=e?this.drawString(this.g,e.value+"",null,0,_):this.drawString(this.g,this.textSelectedCurrentText,null,0,_)),this.endElement(),e.value},separator:function(e,t){null==t&&(t=!0),null==e&&(e=4),this.isVisible(this.t.ELEMENT_H*this.ops.scaleFactor)&&t&&(this.g.set_color(this.t.SEPARATOR_COL),this.g.fillRect(this._x,this._y,this._w,e*this.ops.scaleFactor)),this._y+=e*this.ops.scaleFactor},tooltip:function(e){this.tooltipText=e,this.tooltipY=this._y+this._windowY},tooltipImage:function(e,t){this.tooltipImg=e,this.tooltipImgMaxWidth=t,this.tooltipInvertY=this.imageInvertY,this.tooltipY=this._y+this._windowY},drawArrow:function(e){var t=this._x+this.arrowOffsetX,i=this._y+this.arrowOffsetY;this.g.set_color(this.t.TEXT_COL),e?this.g.fillTriangle(t,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor/2,i+this.t.ARROW_SIZE*this.ops.scaleFactor):this.g.fillTriangle(t,i,t,i+this.t.ARROW_SIZE*this.ops.scaleFactor,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i+this.t.ARROW_SIZE*this.ops.scaleFactor/2)},drawTree:function(e){var t=7*this.ops.scaleFactor,i=this._x+this.arrowOffsetX+1,n=this._y+this.arrowOffsetY+1;this.g.set_color(this.t.TEXT_COL),e?this.g.fillRect(i,n+t/2-1,t,t/8):(this.g.fillRect(i,n+t/2-1,t,t/8),this.g.fillRect(i+t/2-1,n,t/8,t))},drawCheck:function(e,t){var i=this._x+this.checkOffsetX,n=this._y+this.checkOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;if(0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e){this.g.set_color(-1),this.enabled||this.fadeColor();var u=this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0;this.g.drawScaledImage(this.checkSelectImage,i+this.checkSelectOffsetX,n+this.checkSelectOffsetY,u,u)}},drawRadio:function(e,t){var i=this._x+this.radioOffsetX,n=this._y+this.radioOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e&&(this.g.set_color(this.t.ACCENT_SELECT_COL),this.enabled||this.fadeColor(),this.g.fillRect(i+this.radioSelectOffsetX,n+this.radioSelectOffsetY,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor))},drawSlider:function(e,t,i,n,r){var s=this._x+this.buttonOffsetY,a=this._y+this.buttonOffsetY,o=this._w-2*this.buttonOffsetY;this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var l=this.g,u=this.t.FILL_ACCENT_BG,h=this.t.BUTTON_H*this.ops.scaleFactor,c=0;0==c&&(c=1),this.enabled||this.fadeColor(),u?l.fillRect(s,a-1,o,1+h):l.drawRect(s,a,o,h,c),this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var A=(e-t)/(i-t),d=8*this.ops.scaleFactor,_=n?s:s+(o-d)*A,f=n?o*A:d;f=Math.max(Math.min(f,o),0);var g=this.g,p=this.t.BUTTON_H*this.ops.scaleFactor,m=0;0==m&&(m=1),this.enabled||this.fadeColor(),g.fillRect(_,a-1,f,1+p)},drawCombo:function(){if(null!=this.comboSelectedHandle){var e=this.g;this.globalG.set_color(this.t.SEPARATOR_COL);var t=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor|0,i=(this.comboSelectedTexts.length+1)*t;this.globalG.begin(!1);var n=this.comboSelectedY-i-(this.t.ELEMENT_H*this.ops.scaleFactor|0),r=pt.windowHeight()-(this.comboSelectedY+i),s=r<0&&rthis.tooltipImgMaxWidth&&(e=this.tooltipImgMaxWidth);var t=this.tooltipImg.get_height()*(e/this.tooltipImg.get_width());this.tooltipX=Math.min(this.tooltipX,pt.windowWidth()-e-20),this.tooltipY=Math.min(this.tooltipY,pt.windowHeight()-t-20),this.globalG.set_color(-16777216),this.globalG.begin(!1),this.globalG.fillRect(this.tooltipX,this.tooltipY,e,t),this.globalG.set_color(-1),this.tooltipInvertY?this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY+t,e,-t):this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY,e,t),this.globalG.end()},drawString:function(e,t,i,n,r){null==r&&(r=0),null==n&&(n=0);var s=this._w/(this.fontSize/2|0)|0;t.length>s&&(t=t.substring(0,s)+".."),null==i&&(i=this.t.TEXT_OFFSET),i*=this.ops.scaleFactor,e.set_font(this.ops.font),e.set_fontSize(this.fontSize),1==r?i=this._w/2-this.ops.font.width(this.fontSize,t)/2:2==r&&(i=this._w-this.ops.font.width(this.fontSize,t)-this.t.TEXT_OFFSET*this.ops.scaleFactor),this.enabled||this.fadeColor(),e.set_pipeline(this.rtTextPipeline),e.drawString(t,this._x+i,this._y+this.fontOffsetY+n),e.set_pipeline(null)},endElement:function(e){null==e&&(e=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor),null==this.currentWindow||0==this.currentWindow.layout?-1==this.curRatio||null!=this.ratios&&this.curRatio==this.ratios.length-1?(this._y+=e,null!=this.ratios&&this.curRatio==this.ratios.length-1&&(this.curRatio=-1,this.ratios=null,this._x=this.xBeforeSplit,this._w=this.wBeforeSplit)):(this.curRatio++,this._x+=this._w,this._w=this.wBeforeSplit*this.ratios[this.curRatio]|0):this._x+=this._w+this.t.ELEMENT_OFFSET*this.ops.scaleFactor},row:function(e){this.ratios=e,this.curRatio=0,this.xBeforeSplit=this._x,this.wBeforeSplit=this._w,this._w=this._w*e[this.curRatio]|0},indent:function(){this._x+=this.t.TAB_W*this.ops.scaleFactor|0,this._w-=this.t.TAB_W*this.ops.scaleFactor|0},unindent:function(){this._x-=this.t.TAB_W*this.ops.scaleFactor|0,this._w+=this.t.TAB_W*this.ops.scaleFactor|0},fadeColor:function(){this.g.set_color(C.fromFloats(.00392156862745098*((16711680&this.g.get_color())>>>16),.00392156862745098*((65280&this.g.get_color())>>>8),.00392156862745098*(255&this.g.get_color()),.25))},fill:function(e,t,i,n,r){this.g.set_color(r),this.enabled||this.fadeColor(),this.g.fillRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor-1,i*this.ops.scaleFactor,n*this.ops.scaleFactor),this.g.set_color(-1)},rect:function(e,t,i,n,r,s){null==s&&(s=1),this.g.set_color(r),this.enabled||this.fadeColor(),this.g.drawRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor,i*this.ops.scaleFactor,n*this.ops.scaleFactor,s),this.g.set_color(-1)},drawRect:function(e,t,i,n,r,s,a){null==a&&(a=0),0==a&&(a=1),this.enabled||this.fadeColor(),t?e.fillRect(i,n-1,r,s+1):e.drawRect(i,n,r,s,a)},isVisible:function(e){if(null==this.currentWindow)return!0;var t=null!=this.tabNames?this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor:0;return this._y+e>t&&this._y=this._windowX+this._x&&this.inputStartedX=this._windowY+this._y)&&this.inputStartedY=this._windowX+this._x&&this.inputX=this._windowY+this._y&&this.inputY=e*r&&this.inputX<(e+i)*r&&this.inputY>=t*r)&&this.inputY<(t+n)*r},onMouseDown:function(e,t,i){0==e?this.inputStarted=!0:this.inputStartedR=!0,0==e?this.inputDown=!0:this.inputDownR=!0,this.setInputPosition(t,i),this.inputStartedX=t,this.inputStartedY=i},onMouseUp:function(e,t,i){0==e?this.isScrolling?(this.isScrolling=!1,this.scrollHandle=null,t==this.inputStartedX&&i==this.inputStartedY&&(this.inputReleased=!0)):this.inputReleased=!0:1==e&&(this.inputReleasedR=!0),0==e?this.inputDown=!1:this.inputDownR=!1,this.setInputPosition(t,i),this.deselectText()},onMouseMove:function(e,t,i,n){this.setInputPosition(e,t)},onMouseWheel:function(e){this.inputWheelDelta=e},setInputPosition:function(e,t){this.inputDX+=e-this.inputX,this.inputDY+=t-this.inputY,this.inputX=e,this.inputY=t},onKeyDown:function(e){switch(this.key=e,this.isKeyPressed=!0,this.isKeyDown=!0,Li.keyRepeatTime=G.time()+.4,e){case 8:this.isBackspaceDown=!0;break;case 13:this.isReturnDown=!0;break;case 16:this.isShiftDown=!0;break;case 17:this.isCtrlDown=!0;break;case 18:this.isAltDown=!0;break;case 27:this.isEscapeDown=!0;break;case 32:this.char=" ";break;case 46:this.isDeleteDown=!0}},onKeyUp:function(e){switch(this.isKeyDown=!1,e){case 8:this.isBackspaceDown=!1;break;case 13:this.isReturnDown=!1;break;case 16:this.isShiftDown=!1;break;case 17:this.isCtrlDown=!1;break;case 18:this.isAltDown=!1;break;case 27:this.isEscapeDown=!1;break;case 46:this.isDeleteDown=!1}},onKeyPress:function(e){this.char=e,this.isKeyPressed=!0},onCut:function(){return Li.isCut=!0,this.onCopy()},onCopy:function(){return Li.isCopy=!0,Li.textToCopy},onPaste:function(e){Li.isPaste=!0,Li.textToPaste=e},ELEMENT_W:function(){return this.t.ELEMENT_W*this.ops.scaleFactor},ELEMENT_H:function(){return this.t.ELEMENT_H*this.ops.scaleFactor},ELEMENT_OFFSET:function(){return this.t.ELEMENT_OFFSET*this.ops.scaleFactor},ARROW_SIZE:function(){return this.t.ARROW_SIZE*this.ops.scaleFactor},BUTTON_H:function(){return this.t.BUTTON_H*this.ops.scaleFactor},CHECK_SIZE:function(){return this.t.CHECK_SIZE*this.ops.scaleFactor},CHECK_SELECT_SIZE:function(){return this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor},FONT_SIZE:function(){return this.t.FONT_SIZE*this.ops.scaleFactor|0},SCROLL_W:function(){return this.t.SCROLL_W*this.ops.scaleFactor|0},TEXT_OFFSET:function(){return this.t.TEXT_OFFSET*this.ops.scaleFactor},TAB_W:function(){return this.t.TAB_W*this.ops.scaleFactor|0},SCALE:function(){return this.ops.scaleFactor},FLASH_SPEED:function(){return.5},TOOLTIP_DELAY:function(){return 1},resize:function(e,t,i,n){null==n&&(n=0),e.redraws=2,null!=e.texture&&e.texture.unload(),t<1&&(t=1),i<1&&(i=1),e.texture=R.createRenderTarget(t,i,0,0,1,n),e.texture.get_g2().set_imageScaleQuality(1)},__class__:Li},n.$haxeUID|=0,x.Math=Math,null==String.fromCodePoint&&(String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55232+(e>>10))+String.fromCharCode(56320+(1023&e))}),String.prototype.__class__=x.String=String,String.__name__=!0,x.Array=Array,Array.__name__=!0,Date.prototype.__class__=x.Date=Date,Date.__name__="Date";var Fi={},Pi={},Mi=Number,Ri=Boolean,Oi={},Vi={};te.count=0;var Di={};Object.defineProperty(ft.prototype,"message",{get:function(){return String(this.val)}}),g.__toStr={}.toString,null==ArrayBuffer.prototype.slice&&(ArrayBuffer.prototype.slice=v.sliceImpl),nt.cwd="",ot.defaultWindowW=240,ot.windowW=ot.defaultWindowW,ot.coffX=160,ot.coffY=40,ot.currentOperation="",ot.assetNames=[""],ot.showFiles=!1,ot.foldersOnly=!1,ot.gridSnapBounds=!1,ot.gridSnapPos=!0,ot.gridUseRelative=!0,ot.useRotationSteps=!1,ot.gridSize=20,ot.rotationSteps=.261799386,ot.modalW=625,ot.modalH=545,ot.modalHeaderH=66,ot.modalRectW=625,ot.modalRectH=545,ot.path="/",X.isManipulating=!1,X.transformStartedMouse=!1,X.drag=!1,X.dragLeft=!1,X.dragTop=!1,X.dragRight=!1,X.dragBottom=!1,X.grab=!1,X.grabX=!1,X.grabY=!1,X.rotate=!1,At.global=new At,dt.hwin=At.global.nest(0,null),J.DEFAULT_RESOLVER=new a,J.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:",_.helper=new DataView(new ArrayBuffer(8)),gt.images=new S,gt.sounds=new E,gt.blobs=new B,gt.fonts=new k,gt.videos=new I,C.Black=-16777216,C.White=-1,C.Red=-65536,C.Blue=-16776961,C.Green=-16711936,C.Magenta=-65281,C.Yellow=-256,C.Cyan=-16711681,C.Purple=-8388480,C.Pink=-16181,C.Orange=-23296,C.Transparent=0,C.invMaxChannelValue=.00392156862745098,b.displays=[],N.Default=new N(!1,!1,!1),G.timeWarpSaveTime=10,G.DIF_COUNT=3,G.maxframetime=.5,G.startTime=0,z.painter_colored_fragData0="s580:AAAARFhCQwKRAhCE2jyY1lWcLP2kpYQBAAAAsAEAAAUAAAA0AAAAjAAAAMAAAAD0AAAANAEAAFJERUZQAAAAAAAAAAAAAAAAAAAAHAAAAAAE::8AAQAAHAAAAE1pY3Jvc29mdCAoUikgSExTTCBTaGFkZXIgQ29tcGlsZXIgNi4zLjk2MDAuMTYzODQAq6tJU0dOLAAAAAEAAAAIAAAAIAAAAAAAAAAAAAAAAwAAAAAAAAAPDwAAVEVYQ09PUkQAq6urT1NHTiwAAAABAAAACAAAACAAAAAAAAAAAAAAAAMAAAAAAAAADwAAAFNWX1RhcmdldACrq1NIRFI4AAAAQAAAAA4AAABiEAAD8hAQAAAAAABlAAAD8iAQAAAAAAA2AAAF8iAQAAAAAABGHhAAAAAAAD4AAAFTVEFUdAAAAAIAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",z.painter_colored_vertData0="s1314:AnZlcnRleENvbG9yAAB2ZXJ0ZXhQb3NpdGlvbgABASRHbG9iYWxzAAABcHJvamVjdGlvbk1hdHJpeAAAAAAAQAAAAAQERFhCQ5A:MgyGPthJiwcRz4ddIcQBAAAAlAMAA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VEVYQ09PUkQAq6urT1NHTmgAAAADAAAACAAAAFAAAAAAAAAAAAAAAAMAAAAAAAAADwAAAFAAAAABAAAAAAAAAAMAAAABAAAAAwwAAFkAAAAAAAAAAQAAAAMAAAACAAAADwAAAFRFWENPT1JEAFNWX1Bvc2l0aW9uAKurq1NIRFKMAQAAQAABAGMAAABZAAAERo4gAAAAAAAEAAAAXwAAAzIQEAAAAAAAXwAAA:IQEAABAAAAXwAAA3IQEAACAAAAZQAAA:IgEAAAAAAAZQAAAzIgEAABAAAAZwAABPIgEAACAAAAAQAAAGgAAAICAAAANgAABfIgEAAAAAAARh4QAAEAAAA2AAAFMiAQAAEAAABGEBAAAAAAADYAAAVyABAAAAAAAEYSEAACAAAANgAABYIAEAAAAAAAAUAAAAAAgD8RAAAIEgAQAAEAAABGDhAAAAAAAEaOIAAAAAAAAgAAABEAAAgiABAAAQAAAEYOEAAAAAAARo4gAAAAAAADAAAAAAAABxIAEAABAAAAGgAQAAEAAAAKABAAAQAAADYAAAWCIBAAAgAAABoAEAABAAAAOAAAB0IgEAACAAAACgAQAAEAAAABQAAAAAAAPxEAAAgSIBAAAgAAAEYOEAAAAAAARo4gAAAAAAAAAAAAEQAACCIgEAACAAAARg4QAAAAAABGjiAAAAAAAAEAAAA%AAABU1RBVHQAAAAMAAAAAgAAAAAAAAAGAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",pt.renderListeners=[],pt.foregroundListeners=[],pt.resumeListeners=[],pt.pauseListeners=[],pt.backgroundListeners=[],pt.shutdownListeners=[],pt.dropFilesListeners=[],Q.maxGamepads=4,Q.mouseLockListeners=[],j.windows=[],Z.None=0,Z.FeatureResizable=1,Z.FeatureMinimizable=2,Z.FeatureMaximizable=4,Z.FeatureBorderless=8,Z.FeatureOnTop=16,de.disableGcInteractions=!1,de.intBox=new ue(0),_e.channelCount=32,_e.lastAllocationCount=0,ve.POLY=79764919,xe.INVALID_BITS=-1,Ee.EOP=-1,Ee.M__PI=3.141592653589793,Ee.DIVTAB_NUMER=32,Ee.DIVTAB_DENOM=64,Ee.INVERSE_DB_TABLE=[1.0649863e-7,1.1341951e-7,1.2079015e-7,1.2863978e-7,1.3699951e-7,1.4590251e-7,1.5538408e-7,1.6548181e-7,1.7623575e-7,1.8768855e-7,1.9988561e-7,2.128753e-7,2.2670913e-7,2.4144197e-7,2.5713223e-7,2.7384213e-7,2.9163793e-7,3.1059021e-7,3.3077411e-7,3.5226968e-7,3.7516214e-7,3.9954229e-7,4.255068e-7,4.5315863e-7,4.8260743e-7,5.1396998e-7,5.4737065e-7,5.8294187e-7,6.2082472e-7,6.6116941e-7,7.0413592e-7,7.4989464e-7,7.9862701e-7,8.505263e-7,9.0579828e-7,9.6466216e-7,10273513e-13,10941144e-13,11652161e-13,12409384e-13,13215816e-13,14074654e-13,14989305e-13,15963394e-13,17000785e-13,18105592e-13,19282195e-13,20535261e-13,21869758e-13,23290978e-13,24804557e-13,26416497e-13,2813319e-12,29961443e-13,31908506e-13,33982101e-13,36190449e-13,38542308e-13,41047004e-13,4371447e-12,46555282e-13,49580707e-13,5280274e-12,5623416e-12,59888572e-13,63780469e-13,67925283e-13,72339451e-13,77040476e-13,82047e-10,87378876e-13,93057248e-13,99104632e-13,10554501e-12,11240392e-12,11970856e-12,12748789e-12,13577278e-12,14459606e-12,15399272e-12,16400004e-12,17465768e-12,18600792e-12,19809576e-12,21096914e-12,22467911e-12,23928002e-12,25482978e-12,27139006e-12,28902651e-12,30780908e-12,32781225e-12,34911534e-12,37180282e-12,39596466e-12,42169667e-12,4491009e-11,47828601e-12,50936773e-12,54246931e-12,57772202e-12,61526565e-12,65524908e-12,69783085e-12,74317983e-12,79147585e-12,8429104e-11,89768747e-12,95602426e-12,.00010181521,.00010843174,.00011547824,.00012298267,.00013097477,.00013948625,.00014855085,.00015820453,.00016848555,.00017943469,.00019109536,.00020351382,.00021673929,.00023082423,.00024582449,.00026179955,.00027881276,.00029693158,.00031622787,.00033677814,.00035866388,.00038197188,.00040679456,.00043323036,.00046138411,.00049136745,.00052329927,.00055730621,.00059352311,.00063209358,.00067317058,716917e-9,.0007635063,.00081312324,.00086596457,.00092223983,.00098217216,.0010459992,.0011139742,.0011863665,.0012634633,.0013455702,.0014330129,.0015261382,.0016253153,.0017309374,.0018434235,.0019632195,.0020908006,.0022266726,.0023713743,.0025254795,.0026895994,.0028643847,.0030505286,.0032487691,.0034598925,.0036847358,.0039241906,.0041792066,.004450795,.0047400328,.0050480668,.0053761186,.0057254891,.0060975636,.0064938176,.0069158225,.0073652516,.0078438871,.0083536271,.0088964928,.009474637,.010090352,.01074608,.011444421,.012188144,.012980198,.013823725,.014722068,.015678791,.016697687,.017782797,.018938423,.020169149,.021479854,.022875735,.02436233,.025945531,.027631618,.029427276,.031339626,.033376252,.035545228,.037855157,.040315199,.042935108,.045725273,.048696758,.051861348,.055231591,.05882085,.062643361,.066714279,.071049749,.075666962,.080584227,.085821044,.091398179,.097337747,.1036633,.11039993,.11757434,.12521498,.13335215,.14201813,.15124727,.16107617,.1715438,.18269168,.19456402,.20720788,.22067342,.23501402,.25028656,.26655159,.28387361,.30232132,.32196786,.34289114,.36517414,.38890521,.41417847,.44109412,.4697589,.50028648,.53279791,.56742212,.6042964,.64356699,.68538959,.72993007,.77736504,.8278826,.88168307,.9389798,1],Be.NO_CODE=255,Be.delay=0,Ne.PACKET_ID=1,Ne.PACKET_COMMENT=3,Ne.PACKET_SETUP=5,De.CONTINUED_PACKET=1,De.FIRST_PAGE=2,De.LAST_PAGE=4,We.MAX_CHANNELS=16,We.PUSHDATA_CRC_COUNT=4,We.FAST_HUFFMAN_LENGTH=10,We.FAST_HUFFMAN_TABLE_SIZE=1024,We.FAST_HUFFMAN_TABLE_MASK=1023,Qe.fontGlyphs=function(){for(var e=[],t=32;t<256;){var i=t++;e.push(i)}return e}(),It.STBTT_vmove=1,It.STBTT_vline=2,It.STBTT_vcurve=3,It.STBTT_MACSTYLE_DONTCARE=0,It.STBTT_MACSTYLE_BOLD=1,It.STBTT_MACSTYLE_ITALIC=2,It.STBTT_MACSTYLE_UNDERSCORE=4,It.STBTT_MACSTYLE_NONE=8,It.STBTT_PLATFORM_ID_UNICODE=0,It.STBTT_PLATFORM_ID_MAC=1,It.STBTT_PLATFORM_ID_ISO=2,It.STBTT_PLATFORM_ID_MICROSOFT=3,It.STBTT_UNICODE_EID_UNICODE_1_0=0,It.STBTT_UNICODE_EID_UNICODE_1_1=1,It.STBTT_UNICODE_EID_ISO_10646=2,It.STBTT_UNICODE_EID_UNICODE_2_0_BMP=3,It.STBTT_UNICODE_EID_UNICODE_2_0_FULL=4,It.STBTT_MS_EID_SYMBOL=0,It.STBTT_MS_EID_UNICODE_BMP=1,It.STBTT_MS_EID_SHIFTJIS=2,It.STBTT_MS_EID_UNICODE_FULL=10,It.STBTT_MAC_EID_ROMAN=0,It.STBTT_MAC_EID_ARABIC=4,It.STBTT_MAC_EID_JAPANESE=1,It.STBTT_MAC_EID_HEBREW=5,It.STBTT_MAC_EID_CHINESE_TRAD=2,It.STBTT_MAC_EID_GREEK=6,It.STBTT_MAC_EID_KOREAN=3,It.STBTT_MAC_EID_RUSSIAN=7,It.STBTT_MS_LANG_ENGLISH=1033,It.STBTT_MS_LANG_ITALIAN=1040,It.STBTT_MS_LANG_CHINESE=2052,It.STBTT_MS_LANG_JAPANESE=1041,It.STBTT_MS_LANG_DUTCH=1043,It.STBTT_MS_LANG_KOREAN=1042,It.STBTT_MS_LANG_FRENCH=1036,It.STBTT_MS_LANG_RUSSIAN=1049,It.STBTT_MS_LANG_GERMAN=1031,It.STBTT_MS_LANG_SPANISH=1033,It.STBTT_MS_LANG_HEBREW=1037,It.STBTT_MS_LANG_SWEDISH=1053,It.STBTT_MAC_LANG_ENGLISH=0,It.STBTT_MAC_LANG_JAPANESE=11,It.STBTT_MAC_LANG_ARABIC=12,It.STBTT_MAC_LANG_KOREAN=23,It.STBTT_MAC_LANG_DUTCH=4,It.STBTT_MAC_LANG_RUSSIAN=32,It.STBTT_MAC_LANG_FRENCH=1,It.STBTT_MAC_LANG_SPANISH=6,It.STBTT_MAC_LANG_GERMAN=2,It.STBTT_MAC_LANG_SWEDISH=5,It.STBTT_MAC_LANG_HEBREW=10,It.STBTT_MAC_LANG_CHINESE_SIMPLIFIED=33,It.STBTT_MAC_LANG_ITALIAN=3,It.STBTT_MAC_LANG_CHINESE_TRAD=19,It.STBTT_MAX_OVERSAMPLE=8,It.STBTT_RASTERIZER_VERSION=2,Rt.bufferSize=1500,Rt.vertexSize=9,Ot.bufferSize=1e3,Ot.triangleBufferSize=1e3,Vt.bufferSize=1e3,Zt.__meta__={statics:{sendConnectEvent:{input:null},sendDisconnectEvent:{input:null}},fields:{sendAxisEvent:{input:null},sendButtonEvent:{input:null}}},Zt.instances=[],Zt.connectListeners=[],Zt.disconnectListeners=[],ei.__meta__={fields:{sendDownEvent:{input:null},sendUpEvent:{input:null},sendPressEvent:{input:null}}},ei.keyBehavior=$t.Default,ti.__meta__={fields:{sendLeaveEvent:{input:null},sendDownEvent:{input:null},sendUpEvent:{input:null},sendMoveEvent:{input:null},sendWheelEvent:{input:null}}},si.bufferSize=2e3,ai.mat=new Float32Array(16),li.width=3,li.height=3,ui.width=4,ui.height=4,di.width=3,di.height=3,_i.width=4,_i.height=4,vi.nextId=0,xi.START=0,xi.ENTITY_UPDATES=1,xi.CONTROLLER_UPDATES=2,xi.REMOTE_CALL=3,xi.PING=4,xi.SESSION_ERROR=5,xi.PLAYER_UPDATES=6,xi.RPC_SERVER=0,xi.RPC_ALL=1,Ti.nextId=0,Ti.objects=[],Ei.assetMap=new $,Ei.themes=[],Ei.events=[],Ei.screenW=-1,Ei.screenH=-1,Ei.locale="en",Ei.h=new At,Ei.elemId=-1,Ei.assetId=-1,Bi.dataPath="",Bi.lastPath="",Bi.kx=1,Bi.ky=.6666666666666666,Bi.kz=.3333333333333333,Bi.kw=3,Bi.ar=[0,0,0],Bi.Kx=0,Bi.Ky=-.3333333333333333,Bi.Kz=.6666666666666666,Bi.Kw=-1,Bi.e=1e-10,ki.i=0,Ii.show=!1,Ii.hwnd=new At,Ii.boxTitle="",Ii.boxText="",Ii.modalX=0,Ii.modalY=0,Ii.modalW=400,Ii.modalH=160,Ci.dark={NAME:"Default Dark",FONT_SIZE:13,ELEMENT_W:100,ELEMENT_H:24,ELEMENT_OFFSET:4,ARROW_SIZE:5,BUTTON_H:22,CHECK_SIZE:15,CHECK_SELECT_SIZE:8,SCROLL_W:6,TEXT_OFFSET:8,TAB_W:12,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-13421773,WINDOW_TINT_COL:-1,ACCENT_COL:-12303292,ACCENT_HOVER_COL:-11974327,ACCENT_SELECT_COL:-10461088,BUTTON_COL:-12171706,BUTTON_TEXT_COL:-1513499,BUTTON_HOVER_COL:-11974327,BUTTON_PRESSED_COL:-15000805,TEXT_COL:-1513499,LABEL_COL:-3618616,SEPARATOR_COL:-14211289,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-14540254},Ci.light={NAME:"Default Light",FONT_SIZE:26,ELEMENT_W:200,ELEMENT_H:48,ELEMENT_OFFSET:8,ARROW_SIZE:10,BUTTON_H:44,CHECK_SIZE:30,CHECK_SELECT_SIZE:16,SCROLL_W:12,TEXT_OFFSET:16,TAB_W:24,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-1052689,WINDOW_TINT_COL:-14540254,ACCENT_COL:-1118482,ACCENT_HOVER_COL:-4473925,ACCENT_SELECT_COL:-5592406,BUTTON_COL:-3355444,BUTTON_TEXT_COL:-14540254,BUTTON_HOVER_COL:-5000269,BUTTON_PRESSED_COL:-5131855,TEXT_COL:-6710887,LABEL_COL:-5592406,SEPARATOR_COL:-6710887,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-5592406},Li.alwaysRedrawWindow=!0,Li.keyRepeat=!0,Li.keyRepeatTime=0,Li.textToPaste="",Li.textToCopy="",Li.isCut=!1,Li.isCopy=!1,Li.isPaste=!1,Li.copyFrame=0,Li.comboFirst=!0,nt.main()}("undefined"!=typeof exports?exports:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this); \ No newline at end of file +!function(e,n){"use strict";e.kha=e.kha||{},e.kha.input=e.kha.input||{};function i(){return g.__string_rec(this,"")}var t,x={},f=f||{};function r(e,t){var i=Object.create(e);for(var n in t)i[n]=t[n];return t.toString!==Object.prototype.toString&&(i.toString=t.toString),i}function it(){}(x.HxOverrides=it).__name__=!0,it.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;case 10:var n=e.split("-");return new Date(n[0],n[1]-1,n[2],0,0,0);case 19:var r=e.split(" "),s=r[0].split("-"),a=r[1].split(":");return new Date(s[0],s[1]-1,s[2],a[0],a[1],a[2]);default:throw new ft("Invalid date format : "+e)}},it.cca=function(e,t){var i=e.charCodeAt(t);if(i==i)return i},it.substr=function(e,t,i){if(null==i)i=e.length;else if(i<0){if(0!=t)return"";i=e.length+i}return e.substr(t,i)},it.remove=function(e,t){var i=e.indexOf(t);return-1!=i&&(e.splice(i,1),!0)},it.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.curb.get_primary().get_width()&&(e=b.get_primary().get_width()),t>b.get_primary().get_height()-30&&(t=b.get_primary().get_height()-30)),pt.start(new K("Armory2D",e,t,null,new P(null,null,null,null,null,2)),nt.initialized)},nt.initialized=function(e){nt.prefs={path:"",scaleFactor:1,keyMap:{selectMouseButton:"Left",grabKey:71,rotateKey:82,sizeKey:83,slowMovement:16,gridInvert:17,gridInvertRelative:18}};var t=Krom.getArgCount();if(4r&&this.ui.inputXthis.get_toolbarw()&&(this.selectedFrame=(this.ui.inputX-this.get_toolbarw())/11/this.ui.ops.scaleFactor|0)}X.update(this.ui,this.cui,this.canvas),Ii.show&&Ii.update(),this.updateFiles()}},updateCanvas:function(){if(!(ot.showFiles||this.ui.inputX>pt.windowWidth()-ot.get_uiw())){if(X.selectElement(this.canvas),!X.isManipulating&&(this.ui.inputDownR&&(ot.coffX+=0|this.ui.inputDX,ot.coffY+=0|this.ui.inputDY),0!=this.ui.inputWheelDelta)){var e=this.zoom;this.zoom+=-this.ui.inputWheelDelta/10,this.zoom<.4?this.zoom=.4:1n||this.ui.inputYs)&&(ot.showFiles=!1)}},renderFiles:function(e){var t=pt.windowWidth(),i=pt.windowHeight(),n=t/2-ot.modalW/2,r=i/2-ot.modalH/2;e.begin(!1),e.set_color(-14671840),e.fillRect(n,r,ot.modalW,ot.modalH),e.end();var s=t/2-ot.modalRectW/2|0,a=t/2+ot.modalRectW/2|0,o=i/2-ot.modalRectH/2|0,l=i/2+ot.modalRectH/2|0;if(o+=ot.modalHeaderH,this.uimodal.begin(e),this.uimodal.window(At.global.nest(63,null),s,o,ot.modalRectW,ot.modalRectH-100)){var u=At.global.nest(64,null);u.text=this.uimodal.textInput(u),ot.path=Bi.fileBrowser(this.uimodal,u,ot.foldersOnly)}this.uimodal.end(!1),e.begin(!1),this.uimodal.beginRegion(e,a-100,l-30,100),this.uimodal.button("OK")&&(ot.showFiles=!1,ot.filesDone(ot.path)),this.uimodal.endRegion(!1),this.uimodal.beginRegion(e,a-200,l-30,100),this.uimodal.button("Cancel")&&(ot.showFiles=!1),this.uimodal.endRegion(),e.end()},scaled:function(e){return e*this.cui.ops.scaleFactor|0},__class__:ot,__properties__:{get_toolbarw:"get_toolbarw"}};var X=function(){};(x["arm2d.ElementController"]=X).__name__=!0,X.__properties__={get_handleSize:"get_handleSize"},X.get_handleSize=function(){return 8*X.ui.ops.scaleFactor|0},X.initialize=function(e,t){X.ui=e,X.cui=t},X.selectElement=function(e){if(null!=X.ui){var t=nt.prefs.keyMap.selectMouseButton;if("Left"==t&&X.ui.inputStarted&&X.ui.inputDown||"Right"==t&&X.ui.inputStartedR&&X.ui.inputDownR){var i=ot.selectedElem;ot.selectedElem=null;var n=e.elements.slice();n.reverse();for(var r=0;r_&&u.x<_+(8*X.ui.ops.scaleFactor|0)||g)&&(u.y>f&&u.yi.x+s+o-(8*X.ui.ops.scaleFactor|0)?X.dragRight=!0:u.xi.y+a+l-(8*X.ui.ops.scaleFactor|0)?X.dragBottom=!0:u.y=n.length);)if(n[r].parent==s){it.remove(n,t),n.splice(r,0,t);break}},ht.removeElem=function(e,t){if(null!=t.children)for(var i=0,n=t.children;it&&o.xi&&o.y=this.length)throw new ft("Invalid object");if(103==this.buf.charCodeAt(this.pos))break;var t=this.unserialize();if("string"!=typeof t)throw new ft("Invalid object key");var i=this.unserialize();e[t]=i}this.pos++},unserializeEnum:function(e,t){if(58!=this.buf.charCodeAt(this.pos++))throw new ft("Invalid enum format");var i=this.readDigits();if(0==i)return T.createEnum(e,t);for(var n=[];0=this.scache.length)throw new ft("Invalid string reference");return this.scache[u];case 97:this.buf;var h=[];for(this.cache.push(h);;){var c=this.buf.charCodeAt(this.pos);if(104==c){this.pos++;break}if(117==c){this.pos++;var A=this.readDigits();h[h.length+A-1]=null}else h.push(this.unserialize())}return h;case 98:var d=new ie;this.cache.push(d);for(this.buf;104!=this.buf.charCodeAt(this.pos);){var _=this.unserialize(),f=this.unserialize();null!=Di[_]?d.setReserved(_,f):d.h[_]=f}return this.pos++,d;case 99:var g=this.unserialize(),p=this.resolver.resolveClass(g);if(null==p)throw new ft("Class not found "+g);var m=Object.create(p.prototype);return this.cache.push(m),this.unserializeObject(m),m;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:var v=this.unserialize(),w=this.resolver.resolveEnum(v);if(null==w)throw new ft("Enum not found "+v);this.pos++;var b=this.readDigits(),y=w.__constructs__.slice()[b];if(null==y)throw new ft("Unknown enum index "+v+"@"+b);var x=this.unserializeEnum(w,y);return this.cache.push(x),x;case 107:return NaN;case 108:var T=new ee;this.cache.push(T);for(this.buf;104!=this.buf.charCodeAt(this.pos);)T.add(this.unserialize());return this.pos++,T;case 109:return-1/0;case 110:return null;case 111:var S={};return this.cache.push(S),this.unserializeObject(S),S;case 112:return 1/0;case 113:var E=new $;this.cache.push(E);this.buf;for(var B=this.buf.charCodeAt(this.pos++);58==B;){var k=this.readDigits(),I=this.unserialize();E.h[k]=I,B=this.buf.charCodeAt(this.pos++)}if(104!=B)throw new ft("Invalid IntMap format");return E;case 114:var C=this.readDigits();if(C<0||C>=this.cache.length)throw new ft("Invalid reference");return this.cache[C];case 115:var L=this.readDigits(),N=this.buf;if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>2)+(2<=M?M-1:0))),V=0;P>4;var H=F[N.charCodeAt(P++)];O.b[V++]=U<<4|H>>2;var W=F[N.charCodeAt(P++)];O.b[V++]=H<<6|W}if(2<=M){var G=F[N.charCodeAt(P++)],z=F[N.charCodeAt(P++)];if(O.b[V++]=G<<2|z>>4,3==M){var X=F[N.charCodeAt(P++)];O.b[V++]=z<<4|X>>2}}return this.pos+=L,this.cache.push(O),O;case 116:return!0;case 118:var Y;return 48<=this.buf.charCodeAt(this.pos)&&this.buf.charCodeAt(this.pos)<=57&&48<=this.buf.charCodeAt(this.pos+1)&&this.buf.charCodeAt(this.pos+1)<=57&&48<=this.buf.charCodeAt(this.pos+2)&&this.buf.charCodeAt(this.pos+2)<=57&&48<=this.buf.charCodeAt(this.pos+3)&&this.buf.charCodeAt(this.pos+3)<=57&&45==this.buf.charCodeAt(this.pos+4)?(Y=it.strDate(it.substr(this.buf,this.pos,19)),this.pos+=19):Y=new Date(this.readFloat()),this.cache.push(Y),Y;case 119:var K=this.unserialize(),Q=this.resolver.resolveEnum(K);if(null==Q)throw new ft("Enum not found "+K);var q=this.unserializeEnum(Q,this.unserialize());return this.cache.push(q),q;case 120:throw ft.wrap(this.unserialize());case 121:var j=this.readDigits();if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>8}return new he(i.buffer)}for(var o=[],l=0;l>6):(u<=65535?o.push(224|u>>12):(o.push(240|u>>18),o.push(128|u>>12&63)),o.push(128|u>>6&63)),o.push(128|63&u))}return new he(new Uint8Array(o).buffer)},he.ofData=function(e){var t=e.hxBytes;return null!=t?t:new he(e)},he.prototype={length:null,b:null,data:null,blit:function(e,t,i,n){if(e<0||i<0||n<0||e+n>this.length||i+n>t.length)throw new ft(d.OutsideBounds);0==i&&n==t.b.byteLength?this.b.set(t.b,e):this.b.set(t.b.subarray(i,i+n),e)},sub:function(e,t){if(e<0||t<0||e+t>this.length)throw new ft(d.OutsideBounds);return new he(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getDouble:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat64(e,!0)},getFloat:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat32(e,!0)},setDouble:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat64(e,t,!0)},setFloat:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat32(e,t,!0)},getUInt16:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getUint16(e,!0)},getInt32:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getInt32(e,!0)},setInt32:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setInt32(e,t,!0)},getString:function(e,t,i){if(e<0||t<0||e+t>this.length)throw new ft(d.OutsideBounds);null==i&&(i=A.UTF8);var n="",r=this.b,s=e,a=e+t;switch(i._hx_index){case 0:for(;se.length)throw new ft(d.OutsideBounds);if(this.pos+i>this.size&&this.grow(i),0!=this.size){var n=new Uint8Array(e.b.buffer,e.b.byteOffset+t,i);this.u8.set(n,this.pos),this.pos+=i}},grow:function(e){for(var t=this.pos+e,i=0==this.size?16:this.size;i>1;var n=new ArrayBuffer(i),r=new Uint8Array(n);0e.length)throw new ft(d.OutsideBounds);try{for(;0e.length)throw new ft(d.OutsideBounds);this.b=e.b,this.pos=t,this.len=i,this.totlen=i}(x["haxe.io.BytesInput"]=ce).__name__=!0,ce.__super__=h,ce.prototype=r(h.prototype,{b:null,pos:null,len:null,totlen:null,set_position:function(e){return e<0?e=0:e>this.totlen&&(e=this.totlen),this.len=this.totlen-e,this.pos=e},readByte:function(){if(0==this.len)throw new ft(new m);return this.len--,this.b[this.pos++]},readBytes:function(e,t,i){if(t<0||i<0||t+i>e.length)throw new ft(d.OutsideBounds);if(0==this.len&&0e.length)throw new ft(d.OutsideBounds);for(var n=e.b,r=i;0>>24),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)):(this.writeByte(255&e),this.writeByte(e>>8&255),this.writeByte(e>>16&255),this.writeByte(e>>>24))},__class__:c};function Ae(){this.b=new u}(x["haxe.io.BytesOutput"]=Ae).__name__=!0,Ae.__super__=c,Ae.prototype=r(c.prototype,{b:null,writeByte:function(e){this.b.addByte(e)},writeBytes:function(e,t,i){return this.b.addBytes(e,t,i),i},getBytes:function(){return this.b.getBytes()},__class__:Ae});var A=f["haxe.io.Encoding"]={__ename__:!0,__constructs__:["UTF8","RawNative"],UTF8:{_hx_index:0,__enum__:"haxe.io.Encoding",toString:i},RawNative:{_hx_index:1,__enum__:"haxe.io.Encoding",toString:i}},m=function(){};(x["haxe.io.Eof"]=m).__name__=!0,m.prototype={toString:function(){return"Eof"},__class__:m};var d=f["haxe.io.Error"]={__ename__:!0,__constructs__:["Blocked","Overflow","OutsideBounds","Custom"],Blocked:{_hx_index:0,__enum__:"haxe.io.Error",toString:i},Overflow:{_hx_index:1,__enum__:"haxe.io.Error",toString:i},OutsideBounds:{_hx_index:2,__enum__:"haxe.io.Error",toString:i},Custom:((t=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:i}}).__params__=["e"],t)},_=function(){};(x["haxe.io.FPHelper"]=_).__name__=!0,_.floatToI32=function(e){return _.helper.setFloat32(0,e,!0),_.helper.getInt32(0,!0)};var _t=function(e){switch(e){case".":case"..":return this.dir=e,void(this.file="")}var t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t";var e=typeof r;switch("function"==e&&(r.__name__||r.__ename__)&&(e="object"),e){case"function":return"";case"object":if(r.__enum__){var t=f[r.__enum__],i=t.__constructs__[r._hx_index],a=t[i];return a.__params__?(s+="\t",i+"("+function(){for(var e=[],t=0,i=a.__params__;t>>16},C.get_Gb=function(e){return(65280&e)>>>8},C.get_Bb=function(e){return 255&e},C.get_Ab=function(e){return e>>>24},C.set_Rb=function(e,t){return t},C.set_Gb=function(e,t){return t},C.set_Bb=function(e,t){return t},C.set_Ab=function(e,t){return t},C.get_R=function(e){return.00392156862745098*((16711680&e)>>>16)},C.get_G=function(e){return.00392156862745098*((65280&e)>>>8)},C.get_B=function(e){return.00392156862745098*(255&e)},C.get_A=function(e){return.00392156862745098*(e>>>24)},C.set_R=function(e,t){return t},C.set_G=function(e,t){return t},C.set_B=function(e,t){return t},C.set_A=function(e,t){return t};var b=function(e,t){this.num=e,this.isPrimary=t};(x["kha.Display"]=b).__name__=!0,b.__properties__={get_all:"get_all",get_primary:"get_primary"},b.init=function(){for(var e=0,t=Krom.displayCount();e=this.chars.length)return null;var r=1/this.width,s=1/this.height,a=this.chars[t];if(null==a)return null;var o=Math.round(i+a.xoff),l=Math.round(n+a.yoff);return e.x0=o,e.y0=l,e.x1=o+a.x1-a.x0,e.y1=l+a.y1-a.y0,e.s0=a.x0*r,e.t0=a.y0*s,e.s1=a.x1*r,e.t1=a.y1*s,e.xadvance=a.xadvance,e},getCharWidth:function(e){if(0==this.chars.length)return 0;var t=V.charBlocks[0];if(e=this.chars.length?this.chars[0].xadvance:this.chars[e-t].xadvance},getHeight:function(){return this.mySize},stringWidth:function(e){for(var t=0,i=0,n=e.length;i=e)n.next=n.start;else if(0=e&&G.timeTasksScratchpad.push(n)}for(var r=0,s=G.timeTasksScratchpad;rG.lastTime&&(G.startTime-=e-G.lastTime,G.current=e,G.lastTime=e,G.executeTimeTasks(e))},G.executeFrame=function(){var e=G.realTime()-G.startTime-G.lastTime,t=G.current;if(0<=e){if(null==xi.the())if(e>G.maxframetime)G.startTime+=e-G.maxframetime,t+=e=G.maxframetime;else if(G.vsync){for(var i=G.onedifhz;i=G.activeTimeTask.start+G.activeTimeTask.next)?G.insertSorted(G.timeTasks,G.activeTimeTask):G.archiveTimeTask(G.activeTimeTask,e):(G.activeTimeTask.active=!1,G.archiveTimeTask(G.activeTimeTask,e));G.activeTimeTask=null},G.archiveTimeTask=function(e,t){},G.time=function(){return G.current},G.realTime=function(){return pt.get_time()},G.resetTime=function(){var e=pt.get_time(),t=e-G.startTime;G.startTime=e;for(var i=0,n=G.timeTasks;it.next)return void e.splice(r,0,t)}e.push(t)},G.sortFrameTasks=function(){G.frame_tasks_sorted||(G.frameTasks.sort(function(e,t){return e.priority>t.priority?1:e.priority=this.getLength()},unload:function(){},__class__:q,__properties__:{set_position:"set_position",get_position:"get_position"}};var j=function(e){this.num=e,j.windows.push(this)};(x["kha.Window"]=j).__name__=!0,j.__properties__={get_all:"get_all"},j.create=function(e,t){return null},j.destroy=function(e){},j.get=function(e){return j.windows[e]},j.get_all=function(){return j.windows},j.prototype={num:null,windowTitle:null,resize:function(e,t){},move:function(e,t){},changeWindowFeatures:function(e){},changeFramebuffer:function(e){},get_x:function(){return 0},set_x:function(e){return 0},get_y:function(){return 0},set_y:function(e){return 0},get_width:function(){return Krom.windowWidth(this.num)},set_width:function(e){return 800},get_height:function(){return Krom.windowHeight(this.num)},set_height:function(e){return 600},get_mode:function(){return 0},set_mode:function(e){return 0},get_visible:function(){return!0},set_visible:function(e){return!0},get_title:function(){return this.windowTitle},set_title:function(e){return Krom.setWindowTitle(this.num,e),this.windowTitle=e,this.windowTitle},notifyOnResize:function(e){},get_vSynced:function(){return!0},__class__:j,__properties__:{get_vSynced:"get_vSynced",set_title:"set_title",get_title:"get_title",set_visible:"set_visible",get_visible:"get_visible",set_mode:"set_mode",get_mode:"get_mode",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}};var Z={};(x["kha._WindowOptions.WindowFeatures_Impl_"]=Z).__name__=!0,Z._new=function(e){return e};var ne=function(e,t,i,n,r,s,a,o,l){null==l&&(l=0),null==a&&(a=!0),null==s&&(s=-1),null==r&&(r=600),null==n&&(n=800),null==i&&(i=-1),null==t&&(t=-1),this.mode=0,this.windowFeatures=7,this.visible=!0,this.display=-1,this.height=600,this.width=800,this.y=-1,this.x=-1,this.title=null,this.title=e,this.x=t,this.y=i,this.width=n,this.height=r,this.display=s,this.visible=a,this.windowFeatures=null==o?7:o,this.mode=l};(x["kha.WindowOptions"]=ne).__name__=!0,ne.prototype={title:null,x:null,y:null,width:null,height:null,display:null,visible:null,windowFeatures:null,mode:null,__class__:ne};var re={};(x["kha.arrays._Float32Array.Float32Array_Impl_"]=re).__name__=!0,re.__properties__={get_length:"get_length",get_buffer:"get_buffer"},re._new=function(e){return new Float32Array(e)},re.get_buffer=function(e){return e.buffer},re.get_length=function(e){return e.length},re.set=function(e,t,i){return e[t]=i},re.get=function(e,t){return e[t]},re.data=function(e){return e},re.subarray=function(e,t,i){return e.subarray(t,i)};var se={};(x["kha.arrays._Int16Array.Int16Array_Impl_"]=se).__name__=!0,se.__properties__={get_length:"get_length"},se._new=function(e){return new Int16Array(e)},se.get_length=function(e){return e.length},se.set=function(e,t,i){return e[t]=i},se.get=function(e,t){return e[t]},se.data=function(e){return e},se.arrayRead=function(e,t){return e[t]},se.arrayWrite=function(e,t,i){return e[t]=i},se.subarray=function(e,t,i){return e.subarray(t,i)};var ae={};(x["kha.arrays._Int32Array.Int32Array_Impl_"]=ae).__name__=!0,ae.__properties__={get_length:"get_length"},ae._new=function(e){return new Int32Array(e)},ae.get_length=function(e){return e.length},ae.set=function(e,t,i){return e[t]=i},ae.get=function(e,t){return e[t]},ae.data=function(e){return e},ae.arrayRead=function(e,t){return e[t]},ae.arrayWrite=function(e,t,i){return e[t]=i},ae.subarray=function(e,t,i){return e.subarray(t,i)};var oe={};(x["kha.arrays._Uint32Array.Uint32Array_Impl_"]=oe).__name__=!0,oe.__properties__={get_length:"get_length"},oe._new=function(e){return new Uint32Array(e)},oe.get_length=function(e){return e.length},oe.set=function(e,t,i){return e[t]=i},oe.get=function(e,t){return e[t]},oe.data=function(e){return e},oe.arrayRead=function(e,t){return e[t]},oe.arrayWrite=function(e,t,i){return e[t]=i},oe.subarray=function(e,t,i){return e.subarray(t,i)};function le(){}(x["kha.audio1.AudioChannel"]=le).__name__=!0,le.__isInterface__=!0,le.prototype={play:null,pause:null,stop:null,length:null,get_length:null,get_position:null,set_position:null,get_volume:null,set_volume:null,finished:null,get_finished:null,__class__:le,__properties__:{get_finished:"get_finished",set_volume:"set_volume",get_volume:"get_volume",set_position:"set_position",get_position:"get_position",get_length:"get_length"}};function ue(e){this.value=e}(x["kha.internal.IntBox"]=ue).__name__=!0,ue.prototype={value:null,__class__:ue};var de=function(){};(x["kha.audio2.Audio"]=de).__name__=!0,de._init=function(){de.buffer=new ge(8192,2,44100),de.samplesPerSecond=44100},de._callCallback=function(e){if(null!=de.buffer)if(null!=de.audioCallback)de.intBox.value=e,de.audioCallback(de.intBox,de.buffer);else for(var t=0,i=e;t=de.buffer.size&&(de.buffer.writeLocation=0)}},de._readSample=function(){if(null==de.buffer)return 0;var e=de.buffer.data[de.buffer.readLocation];return de.buffer.readLocation+=1,de.buffer.readLocation>=de.buffer.size&&(de.buffer.readLocation=0),e},de.play=function(e,t){return null==t&&(t=!1),null},de.stream=function(e,t){return null==t&&(t=!1),null};var _e=function(){};(x["kha.audio2.Audio1"]=_e).__name__=!0,_e._init=function(){var e=new Array(32);_e.soundChannels=e;var t=new Array(32);_e.streamChannels=t;var i=new Array(32);_e.internalSoundChannels=i;var n=new Array(32);_e.internalStreamChannels=n;var r=new Float32Array(512);_e.sampleCache1=r;var s=new Float32Array(512);_e.sampleCache2=s,_e.lastAllocationCount=0,de.audioCallback=_e.mix},_e.max=function(e,t){return t=t.size&&(t.writeLocation=0)}return _e.lastAllocationCount=0,void(de.disableGcInteractions=!1)}var s=new Float32Array(2*i);_e.sampleCache1=s;var a=new Float32Array(2*i);_e.sampleCache2=a,_e.lastAllocationCount=0}else 100<_e.lastAllocationCount?de.disableGcInteractions=!0:_e.lastAllocationCount+=1;for(var o=0,l=i;o=t.size&&(t.writeLocation=0)}},_e.play=function(e,t){null==t&&(t=!1);var i=null;(i=de.samplesPerSecond!=e.sampleRate?new pe(t,e.sampleRate):new fe(t)).data=e.uncompressedData;for(var n=!1,r=0;r<32;){var s=r++;if(null==_e.soundChannels[s]||_e.soundChannels[s].get_finished()){_e.soundChannels[s]=i,n=!0;break}}return n?i:null},_e._playAgain=function(e){for(var t=0;t<32;){var i=t++;_e.soundChannels[i]==e&&(_e.soundChannels[i]=null)}for(var n=0;n<32;){var r=n++;if(null==_e.soundChannels[r]||_e.soundChannels[r].get_finished()||_e.soundChannels[r]==e){_e.soundChannels[r]=e;break}}},_e.stream=function(e,t){null==t&&(t=!1);var i=de.stream(e,t);if(null!=i)return i;for(var n=new me(e.compressedData,t),r=!1,s=0;s<32;){var a=s++;if(null==_e.streamChannels[a]||_e.streamChannels[a].get_finished()){_e.streamChannels[a]=n,r=!0;break}}return r?n:null};var fe=function(e){this.looping=!1,this.stopped=!1,this.paused=!1,this.myPosition=0,this.myVolume=1,this.data=null,this.looping=e};(x["kha.audio2.AudioChannel"]=fe).__name__=!0,fe.__interfaces__=[le],fe.max=function(e,t){return t=this.data.length&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s=(C%2==0?C:C+1)&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s>>24]};function we(){}(x["kha.audio2.ogg.tools.MathTools"]=we).__name__=!0,we.ilog=function(e){var t=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];return e<16384?e<16?t[e]:e<512?5+t[e>>5]:10+t[e>>10]:e<16777216?e<524288?15+t[e>>15]:20+t[e>>20]:e<536870912?25+t[e>>25]:e<-2147483648?30+t[e>>30]:0};function be(){}(x["kha.audio2.ogg.tools.Mdct"]=be).__name__=!0,be.inverseTransform=function(e,t,i,n,r,s){for(var a=t>>1,o=t>>2,l=t>>3,u=new Array(a),h=a-2,c=0,A=0,d=a;A!=d;)u[h+1]=e[A]*i[c]-e[A+2]*i[c+1],u[h]=e[A]*i[c+1]+e[A+2]*i[c],h-=2,c+=2,A+=4;for(A=a-3;0<=h;)u[h+1]=-e[A+2]*i[c]- -e[A]*i[c+1],u[h]=-e[A+2]*i[c+1]+-e[A]*i[c],h-=2,c+=2,A-=4;for(var _=e,f=u,g=a-8,p=o,m=0,v=o,w=0;0<=g;){var b=f[p+1]-f[m+1],y=f[p]-f[m];_[v+1]=f[p+1]+f[m+1],_[v]=f[p]+f[m],_[w+1]=b*i[g+4]-y*i[g+5],_[w]=y*i[g+4]+b*i[g+5],b=f[p+3]-f[m+3],y=f[p+2]-f[m+2],_[v+3]=f[p+3]+f[m+3],_[v+2]=f[p+2]+f[m+2],_[w+3]=b*i[g]-y*i[g+1],_[w+2]=y*i[g]+b*i[g+1],g-=8,v+=4,w+=4,p+=4,m+=4}for(var x=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],T=(t<16384?t<16?x[t]:t<512?5+x[t>>5]:10+x[t>>10]:t<16777216?t<524288?15+x[t>>15]:20+x[t>>20]:t<536870912?25+x[t>>25]:t<-2147483648?30+x[t>>30]:0)-1,S=a-1-0*o,E=S,B=S-(t>>3),k=0,I=1+(t>>4>>2);0<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_[Z]+_[H+-6];var J=U+-7;_[J]=_[J]+_[H+-7],_[H+-6]=z*i[W]-X*i[W+1],_[H+-7]=X*i[W]+z*i[W+1],W+=8,U-=8,H-=8}for(var $=a-1-0*l,ee=0,te=$,ie=$-(t>>4),ne=1+(t>>5>>2);0<--ne;){var re=_[te]-_[ie],se=_[te+-1]-_[ie+-1];_[te]=_[te]+_[ie];var ae=te+-1;_[ae]=_[ae]+_[ie+-1],_[ie]=re*i[ee]-se*i[ee+1],_[ie+-1]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-2]-_[ie+-2],se=_[te+-3]-_[ie+-3];var oe=te+-2;_[oe]=_[oe]+_[ie+-2];var le=te+-3;_[le]=_[le]+_[ie+-3],_[ie+-2]=re*i[ee]-se*i[ee+1],_[ie+-3]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-4]-_[ie+-4],se=_[te+-5]-_[ie+-5];var ue=te+-4;_[ue]=_[ue]+_[ie+-4];var he=te+-5;_[he]=_[he]+_[ie+-5],_[ie+-4]=re*i[ee]-se*i[ee+1],_[ie+-5]=se*i[ee]+re*i[ee+1],ee+=16,re=_[te+-6]-_[ie+-6],se=_[te+-7]-_[ie+-7];var ce=te+-6;_[ce]=_[ce]+_[ie+-6];var Ae=te+-7;_[Ae]=_[Ae]+_[ie+-7],_[ie+-6]=re*i[ee]-se*i[ee+1],_[ie+-7]=se*i[ee]+re*i[ee+1],te-=8,ie-=8,ee+=16}for(var de=a-1-l,_e=0,fe=de,ge=de-(t>>4),pe=1+(t>>5>>2);0<--pe;){var me=_[fe]-_[ge],ve=_[fe+-1]-_[ge+-1];_[fe]=_[fe]+_[ge];var we=fe+-1;_[we]=_[we]+_[ge+-1],_[ge]=me*i[_e]-ve*i[_e+1],_[ge+-1]=ve*i[_e]+me*i[_e+1],_e+=16,me=_[fe+-2]-_[ge+-2],ve=_[fe+-3]-_[ge+-3];var be=fe+-2;_[be]=_[be]+_[ge+-2];var ye=fe+-3;_[ye]=_[ye]+_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t[g+-6]=t[g+-6]+t[p+-6],t[g+-7]=t[g+-7]+t[p+-7],t[p+-6]=v*_-w*f,t[p+-7]=w*_+v*f,g-=o,p-=o}},be.iter54=function(e,t){var i=e[t],n=e[t+-4],r=i-n,s=i+n,a=(i=e[t+-2])+(n=e[t+-6]),o=i-n;e[t]=s+a,e[t+-2]=s-a;var l=e[t+-3]-e[t+-7];e[t+-4]=r+l,e[t+-6]=r-l;var u=(i=e[t+-1])-(n=e[t+-5]),h=i+n,c=e[t+-3]+e[t+-7];e[t+-1]=h+c,e[t+-3]=h-c,e[t+-5]=u-o,e[t+-7]=u+o},be.step3InnerSLoopLd654=function(e,t,i,n,r){for(var s=n[r>>3],a=i,o=i-16*e;o=this.segments.length&&(this.nextSeg=-1),this.bytesInSeg=e},startPacket:function(){for(;-1==this.nextSeg;)if(this.page.start(this),0!=(1&this.page.flag))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:193,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"startPacket"}));this.lastSeg=!1,this.validBits=0,this.bytesInSeg=0},maybeStartPacket:function(){if(-1==this.nextSeg){var t,i=!1;try{this.inputPosition+=1,t=this.input.readByte()}catch(e){var n=e instanceof ft?e.val:e;if(!(n instanceof m))throw e;i=!0,t=0}if(i)return!1;if(!!(!!(79!=t||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:218,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"maybeStartPacket"}));this.page.startWithoutCapturePattern(this)}return this.startPacket(),!0},readBits:function(e){if(this.validBits<0)return 0;if(this.validBits>>e,this.validBits-=e,t}var i=this.acc&(1<>>e,this.validBits-=e,i},readPacketRaw:function(){return 0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1},readPacket:function(){var e;return e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,e},flushPacket:function(){for(;0!=this.bytesInSeg||!this.lastSeg&&0!=this.next();)this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()},vorbisValidate:function(){var e,t,i,n,r,s,a=new he(new ArrayBuffer(6));if(e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[0]=e,t=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[1]=t,i=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[2]=i,n=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[3]=n,r=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[4]=r,s=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[5]=s,"vorbis"!=a.toString())throw new ft(new Xe(Ye.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}))},firstPageValidate:function(){if(1!=this.segments.length)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"segmentCount",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:308,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}));if(30!=this.segments[0])throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:311,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}))},startFirstDecode:function(){this.firstAudioPageOffset=this.inputPosition,this.firstDecode=!0},capturePattern:function(){if(this.inputPosition+=1,!!(!!(79!=this.input.readByte()||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new ft(new Xe(Ye.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:324,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"capturePattern"}))},skip:function(e){this.inputPosition+=e;for(var t=new Array(e),i=0,n=e;i>>n,this.validBits-=n,t=this.validBits<0?(this.validBits=0,-1):i}else t=this.decodeScalarRaw(e);return e.sparse&&(t=e.sortedValues[t]),t},decodeRaw:function(e){this.validBits<10&&this.prepHuffman();var t=e.fastHuffman[1023&this.acc];if(0<=t){var i=e.codewordLengths[t];return this.acc=this.acc>>>i,this.validBits-=i,this.validBits<0?(this.validBits=0,-1):t}return this.decodeScalarRaw(e)},isLastByte:function(){return 0==this.bytesInSeg&&this.lastSeg},finishDecodePacket:function(e,t,i){var n=i.left.start,r=!1,s=t>>1;if(this.firstDecode)this.currentLoc=-s,this.discardSamplesDeferred=t-i.right.end,r=!0,this.firstDecode=!1;else if(0!=this.discardSamplesDeferred)i.left.start+=this.discardSamplesDeferred,n=i.left.start,this.discardSamplesDeferred=0;else;if(this.lastSegWhich==this.endSegWithKnownLoc){if(r&&0!=(4&this.page.flag)){var a=this.knownLocForPacket-(t-i.right.end);if(a>>24]}var l=0;try{for(var u=0,h=n[26];u>>24],l+=c}for(var A=0,d=l;A>>24]}}catch(e){var f=e instanceof ft?e.val:e;if(f instanceof m){return Te.NotFound}throw e}if(s==r){var g=this.inputPosition;return e(this.inputPosition=i-1),Te.Found(g,0!=(4&n[5]))}}}}catch(e){var p=e instanceof ft?e.val:e;if(p instanceof m){return Te.NotFound}throw e}},analyzePage:function(e,t){var i=new Ue,n=new Array(255);i.pageStart=this.inputPosition,this.inputPosition+=27;for(var r=new Array(27),s=0;s<27;){r[s++]=this.input.readByte()}var a=r,o=a[26];this.inputPosition+=o;for(var l=new Array(o),u=0,h=o;u>=1;var y=p-1,x=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(p<=(b&=(1<<(y<16384?y<16?x[y]:y<512?5+x[y>>5]:10+x[y>>10]:y<16777216?y<524288?15+x[y>>15]:20+x[y>>20]:y<536870912?25+x[y>>25]:y<-2147483648?30+x[y>>30]:0))-1))return e(this.inputPosition=i.pageStart),null;n[f++]=t.modes[b].blockflag;var T=c[w]-1;this.inputPosition+=T;for(var S=new Array(T),E=0,B=T;E>1:N+=(t.blocksize1-t.blocksize0>>2)+(t.blocksize0>>1):N+=t.blocksize0>>1,--F;return i.firstDecodedSample=i.lastDecodedSample-N,e(this.inputPosition=i.pageStart),i},decodeScalarRaw:function(e){this.prepHuffman();var t=e.codewordLengths,i=e.codewords,n=e.sortedCodewords;if(8>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16,a=0,o=e.sortedEntries;1>1);Me.gte(s,n[l])?(a=l,o-=o>>1):o>>=1}e.sparse||(a=e.sortedValues[a]);var u=t[a];return this.validBits>=u?(this.acc=this.acc>>>u,this.validBits-=u,a):(this.validBits=0,-1)}for(var h=0,c=e.entries;h=d?(this.acc=this.acc>>>d,this.validBits-=d,A):(this.validBits=0,-1)}return this.error=new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:847,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"decodeScalarRaw"}),this.validBits=0,-1},__class__:xe};var Te=f["kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult"]={__ename__:!0,__constructs__:["Found","NotFound"],Found:((t=function(e,t){return{_hx_index:0,end:e,last:t,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}}).__params__=["end","last"],t),NotFound:{_hx_index:1,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}},Se=function(e,t){this.header=e,this.decodeState=t,this.totalSample=null,this.currentSample=0,this.previousLength=0;var i=new Array(e.channel);this.channelBuffers=i;var n=new Array(e.channel);this.previousWindow=n;var r=new Array(e.channel);this.finalY=r;for(var s=0,a=e.channel;sthis.totalSample-this.currentSample&&(c=this.totalSample-this.currentSample);for(var A=0;hthis.totalSample-this.currentSample&&(e=this.totalSample-this.currentSample);t=r.lastDecodedSample&&(i=r.lastDecodedSample-1),i>>1);h=8<=s?c:Me.gt(c,h)?h+(c-h>>>1):c+(h-c>>>1)}++s,e(this.decodeState.inputPosition=h);var A=this.decodeState.findPage(e,t);switch(A._hx_index){case 0:A.last,A.end;break;case 1:throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:249,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}))}var d=this.decodeState.analyzePage(e,this.header);if(null==d)throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:255,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}));d.afterPreviousPageStart=h,d.pageStart!=r.pageStart?i>1,n=t>>2,r=t>>3,s=this.a,a=new Array(i);s[e]=a;var o=this.b,l=new Array(i);o[e]=l;var u=this.c,h=new Array(n);u[e]=h;var c=this.window,A=new Array(i);c[e]=A;var d=this.bitReverseData,_=new Array(r);d[e]=_,Ee.computeTwiddleFactors(t,this.a[e],this.b[e],this.c[e]),Ee.computeWindow(t,this.window[e]),Ee.computeBitReverse(t,this.bitReverseData[e])},inverseMdct:function(e,t,i){for(var n=i?1:0,r=this.a[n],s=this.b[n],a=this.c[n],o=this.bitReverseData[n],l=t>>1,u=t>>2,h=t>>3,c=new Array(l),A=l-2,d=0,_=0,f=l;_!=f;)c[A+1]=e[_]*r[d]-e[_+2]*r[d+1],c[A]=e[_]*r[d+1]+e[_+2]*r[d],A-=2,d+=2,_+=4;for(_=l-3;0<=A;)c[A+1]=-e[_+2]*r[d]- -e[_]*r[d+1],c[A]=-e[_+2]*r[d+1]+-e[_]*r[d],A-=2,d+=2,_-=4;for(var g=e,p=c,m=l-8,v=u,w=0,b=u,y=0;0<=m;){var x=p[v+1]-p[w+1],T=p[v]-p[w];g[b+1]=p[v+1]+p[w+1],g[b]=p[v]+p[w],g[y+1]=x*r[m+4]-T*r[m+5],g[y]=T*r[m+4]+x*r[m+5],x=p[v+3]-p[w+3],T=p[v+2]-p[w+2],g[b+3]=p[v+3]+p[w+3],g[b+2]=p[v+2]+p[w+2],g[y+3]=x*r[m]-T*r[m+1],g[y+2]=T*r[m]+x*r[m+1],m-=8,b+=4,y+=4,v+=4,w+=4}for(var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],E=(t<16384?t<16?S[t]:t<512?5+S[t>>5]:10+S[t>>10]:t<16777216?t<524288?15+S[t>>15]:20+S[t>>20]:t<536870912?25+S[t>>25]:t<-2147483648?30+S[t>>30]:0)-1,B=l-1-0*u,k=B,I=B-(t>>3),C=0,L=1+(t>>4>>2);0<--L;){var N=g[k]-g[I],F=g[k+-1]-g[I+-1];g[k]=g[k]+g[I];var P=k+-1;g[P]=g[P]+g[I+-1],g[I]=N*r[C]-F*r[C+1],g[I+-1]=F*r[C]+N*r[C+1],C+=8,N=g[k+-2]-g[I+-2],F=g[k+-3]-g[I+-3];var M=k+-2;g[M]=g[M]+g[I+-2];var R=k+-3;g[R]=g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-1];g[ne]=g[ne]+g[re];var le=ne+-1;g[le]=g[le]+g[re+-1],g[re]=ae*r[ie]-oe*r[ie+1],g[re+-1]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-2]-g[re+-2],oe=g[ne+-3]-g[re+-3];var ue=ne+-2;g[ue]=g[ue]+g[re+-2];var he=ne+-3;g[he]=g[he]+g[re+-3],g[re+-2]=ae*r[ie]-oe*r[ie+1],g[re+-3]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-4]-g[re+-4],oe=g[ne+-5]-g[re+-5];var ce=ne+-4;g[ce]=g[ce]+g[re+-4];var Ae=ne+-5;g[Ae]=g[Ae]+g[re+-5],g[re+-4]=ae*r[ie]-oe*r[ie+1],g[re+-5]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-6]-g[re+-6],oe=g[ne+-7]-g[re+-7];var de=ne+-6;g[de]=g[de]+g[re+-6];var _e=ne+-7;g[_e]=g[_e]+g[re+-7],g[re+-6]=ae*r[ie]-oe*r[ie+1],g[re+-7]=oe*r[ie]+ae*r[ie+1],ne-=8,re-=8,ie+=16}for(var fe=l-1-h,ge=0,pe=fe,me=fe-(t>>4),ve=1+(t>>5>>2);0<--ve;){var we=g[pe]-g[me],be=g[pe+-1]-g[me+-1];g[pe]=g[pe]+g[me];var ye=pe+-1;g[ye]=g[ye]+g[me+-1],g[me]=we*r[ge]-be*r[ge+1],g[me+-1]=be*r[ge]+we*r[ge+1],ge+=16,we=g[pe+-2]-g[me+-2],be=g[pe+-3]-g[me+-3];var xe=pe+-2;g[xe]=g[xe]+g[me+-2];var Te=pe+-3;g[Te]=g[Te]+g[me+-3],g[me+-2]=we*r[ge]-be*r[ge+1],g[me+-3]=be*r[ge]+we*r[ge+1],ge+=16,we=g[pe+-4]-g[me+-4],be=g[pe+-5]-g[me+-5];var Se=pe+-4;g[Se]=g[Se]+g[me+-4];var Ee=pe+-5;g[Ee]=g[Ee]+g[me+-5],g[me+-4]=we*r[ge]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Kt*Dt+Yt*Ut,Yt=g[Gt+-6]-g[zt+-6],Kt=g[Gt+-7]-g[zt+-7],g[Gt+-6]=g[Gt+-6]+g[zt+-6],g[Gt+-7]=g[Gt+-7]+g[zt+-7],g[zt+-6]=Yt*Ht-Kt*Wt,g[zt+-7]=Kt*Ht+Yt*Wt,Gt-=kt,zt-=kt}Nt+=4*It,Ft-=8}for(var Qt=l-1,qt=r[t>>3],jt=Qt,Zt=Qt-16*(t>>5);Zt>5]:10+n[i>>10]:i<16777216?i<524288?15+n[i>>15]:20+n[i>>20]:i<536870912?25+n[i>>25]:i<-2147483648?30+n[i>>30]:0);if(-1==r||r>=this.header.modes.length)throw new ft(new Xe(Ye.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:519,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"decodeInitial"}));var s,a,o,l=this.header.modes[r];l.blockflag?(s=this.header.blocksize1,a=this.decodeState.readBits(1),o=this.decodeState.readBits(1)):(a=o=0,s=this.header.blocksize0);var u=s>>1;return{mode:r,left:l.blockflag&&0==a?{start:s-this.header.blocksize0>>2,end:s+this.header.blocksize0>>2}:{start:0,end:u},right:l.blockflag&&0==o?{start:3*s-this.header.blocksize0>>2,end:3*s+this.header.blocksize0>>2}:{start:u,end:s}}},decodePacketRest:function(e){for(var t=this.header.modes[e.mode],i=new Array(256),n=new Array(256),r=t.blockflag?this.header.blocksize1:this.header.blocksize0,s=this.header.mapping[t.mapping],a=r>>1,o=[256,128,86,64],l=this.header.codebooks,u=0,h=this.header.channel;u>5]:10+v[p>>10]:p<16777216?p<524288?15+v[p>>15]:20+v[p>>20]:p<536870912?25+v[p>>25]:p<-2147483648?30+v[p>>30]:0)-1);var w=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];f[1]=this.decodeState.readBits((p<16384?p<16?w[p]:p<512?5+w[p>>5]:10+w[p>>10]:p<16777216?p<524288?15+w[p>>15]:20+w[p>>20]:p<536870912?25+w[p>>25]:p<-2147483648?30+w[p>>30]:0)-1);for(var b=0,y=_.partitions;b>>F,C.validBits-=F,L=C.validBits<0?(C.validBits=0,-1):N}else L=C.decodeScalarRaw(I);I.sparse&&(L=I.sortedValues[L]),k=L}for(var P=_.subclassBooks[T],M=0,R=S;M>=E;var V,D=m++;if(0<=O){var U=this.decodeState,H=l[O];U.validBits<10&&U.prepHuffman();var W,G=H.fastHuffman[1023&U.acc];if(0<=G){var z=H.codewordLengths[G];U.acc=U.acc>>>z,U.validBits-=z,W=U.validBits<0?(U.validBits=0,-1):G}else W=U.decodeScalarRaw(H);H.sparse&&(W=H.sortedValues[W]),V=W}else V=0;f[D]=V}}if(-1==this.decodeState.validBits){i[c]=!0;continue}g[0]=g[1]=!0;for(var X=_.neighbors,Y=_.xlist,K=2,Q=_.values;K>1):ne+(re>>1)):(g[q]=!1,f[q]=ne)}for(var oe=0,le=_.values;oe>1;0<=--Ee;)for(var ke=this.channelBuffers[s.chan[Ee].magnitude],Ie=this.channelBuffers[s.chan[Ee].angle],Ce=0,Le=Be;Cei&&e[l]e[t]&&(n=e[s=l])}return{low:r,high:s}},Ee.floatUnpack=function(e){var t=Me.toFloat(2097151&e),i=(2145386496&e)>>>21;return(0!=(-2147483648&e)?-t:t)*Math.pow(2,i-788)},Ee.bitReverse=function(e){return(e=(-16711936&(e=(-252645136&(e=(-858993460&(e=(-1431655766&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8)>>>16|e<<16},Ee.pointCompare=function(e,t){return e.xt.x?1:0},Ee.uintAsc=function(e,t){return Me.gt(t,e)?-1:e==t?0:1},Ee.lookup1Values=function(e,t){var i=0|Math.exp(Math.log(e)/t);return(0|Math.pow(i+1,t))<=e&&++i,i},Ee.computeWindow=function(e,t){for(var i=e>>1,n=0,r=i;n>5]:10+i[e>>10]:e<16777216?e<524288?15+i[e>>15]:20+i[e>>20]:e<536870912?25+i[e>>25]:e<-2147483648?30+i[e>>30]:0)-1,r=0,s=e>>3;r>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8,t[a]=(o>>>16|o<<16)>>>32-n+3<<2}},Ee.computeTwiddleFactors=function(e,t,i,n){for(var r=e>>3,s=0,a=0,o=e>>2;a>5]:10+A[c>>10]:c<16777216?c<524288?15+A[c>>15]:20+A[c>>20]:c<536870912?25+A[c>>25]:c<-2147483648?30+A[c>>30]:0);if(u+d>t.entries)throw new ft(new Xe(Ye.INVALID_SETUP,"codebook entrys",{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"read"}));for(var _=0,f=d;_=t.entries>>2&&(t.codewordLengths=a,t.sparse=!1),t.sparse)o=l;else{for(var v=0,w=0,b=t.entries;w>>21,L=0!=(-2147483648&k)?-I:I;t.minimumValue=L*Math.pow(2,C-788);var N=e.readBits(32),F=Me.toFloat(2097151&N),P=(2145386496&N)>>>21,M=0!=(-2147483648&N)?-F:F;t.deltaValue=M*Math.pow(2,P-788),t.valueBits=e.readBits(4)+1,t.sequenceP=0!=e.readBits(1),1==t.lookupType?t.lookupValues=Ee.lookup1Values(t.entries,t.dimensions):t.lookupValues=t.entries*t.dimensions;for(var R=new Array(t.lookupValues),O=0,V=t.lookupValues;O>>1|(1431655765&h)<<1))>>>2|(858993459&h)<<2))>>>4|(252645135&h)<<4))>>>8|(16711935&h)<<8)>>>16|h<<16,A=s++;if(this.sparse?(this.codewords[A]=c,this.codewordLengths[A]=e[o],i[A]=o):this.codewords[o]=c,l!=e[o])for(var d=e[o];l>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,this.sortedCodewords[r]=s>>>16|s<<16}else for(var a=0,o=0,l=this.entries;o>>1|(1431655765&c)<<1))>>>2|(858993459&c)<<2))>>>4|(252645135&c)<<4))>>>8|(16711935&c)<<8,this.sortedCodewords[a++]=c>>>16|c<<16}}this.sortedCodewords[this.sortedEntries]=-1,this.sortedCodewords.sort(Ee.uintAsc);for(var A=0,d=this.sparse?this.sortedEntries:this.entries;A>>1|(1431655765&g)<<1))>>>2|(858993459&g)<<2))>>>4|(252645135&g)<<4))>>>8|(16711935&g)<<8)>>>16|g<<16,m=0,v=this.sortedEntries;1>1);Me.gte(p,this.sortedCodewords[w])?(m=w,v-=v>>1):v>>=1}this.sparse?(this.sortedValues[m]=t[_],this.codewordLengths[m]=f):this.sortedValues[m]=_}}},computeAcceleratedHuffman:function(){var e=new Array(1024);this.fastHuffman=e,this.fastHuffman[0]=-1;for(var t=0;t<1024;){var i=t++;this.fastHuffman[i]=-1}for(var n=0,r=this.sparse?this.sortedEntries:this.entries;n>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8)>>>16|o<<16}else a=this.codewords[s];for(;a<1024;)this.fastHuffman[a]=s,a+=1<>>a,e.validBits-=a,r=e.validBits<0?(e.validBits=0,-1):s}else r=e.decodeScalarRaw(this);this.sparse&&(r=this.sortedValues[r]);var o=r,l=this.lookupValues,u=this.sequenceP,h=this.multiplicands,c=this.minimumValue;if(o<0)return!1;if(n>this.dimensions&&(n=this.dimensions),1==this.lookupType){for(var A=1,d=0,_=0,f=n;_>>o,e.validBits-=o,s=e.validBits<0?(e.validBits=0,-1):a}else s=e.decodeScalarRaw(this);this.sparse&&(s=this.sortedValues[s]);var l=s,u=0;if(l<0)return!1;n>this.dimensions&&(n=this.dimensions);var h=this.lookupValues,c=this.sequenceP,A=this.multiplicands;if(1==this.lookupType){for(var d=1,_=0,f=n;_>>n,e.validBits-=n,t=e.validBits<0?(e.validBits=0,-1):i}else t=e.decodeScalarRaw(this);return this.sparse&&(t=this.sortedValues[t]),t},decodeDeinterleaveRepeat:function(e,t,i,n,r,s,a){var o=this.dimensions;if(0==this.lookupType)throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:488,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}));for(var l=this.multiplicands,u=this.sequenceP,h=this.lookupValues;0>>_,e.validBits-=_,A=e.validBits<0?(e.validBits=0,-1):d}else A=e.decodeScalarRaw(this);this.sparse&&(A=this.sortedValues[A]);var f=A;if(f<0){if(0==e.bytesInSeg&&e.lastSeg)return null;throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:503,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}))}if(s*iu&&(u=l.partitionClassList[d])}var _=new Array(u+1);l.classDimensions=_;var f=new Array(u+1);l.classMasterbooks=f;var g=new Array(u+1);l.classSubclasses=g;var p=new Array(u+1);l.subclassBooks=p;for(var m=0,v=u+1;m=t.length))throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:64,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}));var b=1<=t.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}))}}l.floor1Multiplier=e.readBits(2)+1,l.rangebits=e.readBits(4);var B=new Array(250);l.xlist=B,l.xlist[0]=0,l.xlist[1]=1<Y&&X[J]X[z]&&(K=X[q=J])}var $=Q,ee=q,te=l.neighbors,ie=new Array(l.values);te[z]=ie,l.neighbors[z][0]=$,l.neighbors[z][1]=ee}return i},Ie.prototype={floor0:null,floor1:null,type:null,__class__:Ie};var Ce=function(){};(x["kha.audio2.ogg.vorbis.data.Floor0"]=Ce).__name__=!0,Ce.prototype={order:null,rate:null,barkMapSize:null,amplitudeBits:null,amplitudeOffset:null,numberOfBooks:null,bookList:null,__class__:Ce};var Le=function(){};(x["kha.audio2.ogg.vorbis.data.Floor1"]=Le).__name__=!0,Le.prototype={partitions:null,partitionClassList:null,classDimensions:null,classSubclasses:null,classMasterbooks:null,subclassBooks:null,xlist:null,sortedOrder:null,neighbors:null,floor1Multiplier:null,rangebits:null,values:null,__class__:Le};var Ne=function(){};(x["kha.audio2.ogg.vorbis.data.Header"]=Ne).__name__=!0,Ne.read=function(e){var t=e.page;if(t.start(e),0==(2&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"not firstPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(4&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"lastPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(1&t.flag))throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"continuedPacket",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(e.firstPageValidate(),e.inputPosition+=1,1!=e.input.readByte())throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:57,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var i,n,r,s,a,o,l=new he(new ArrayBuffer(6));if(i=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[0]=i,n=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[1]=n,r=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[2]=r,s=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[3]=s,a=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[4]=a,o=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[5]=o,"vorbis"!=l.toString())throw new ft(new Xe(Ye.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}));e.inputPosition+=4;var u=e.input.readInt32();if(0!=u)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"vorbis version : "+u,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:66,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var h=new Ne;if(e.inputPosition+=1,h.channel=e.input.readByte(),0==h.channel)throw new ft(new Xe(Ye.INVALID_FIRST_PAGE,"no channel",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(16>4;if(h.blocksize0=1<=h.floorConfig.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:191,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(ee.submapResidue[ne]>=h.residueConfig.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:194,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}var re=e.readBits(6)+1,se=new Array(re);h.modes=se;for(var ae=0,oe=re;ae=h.mapping.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:205,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}for(;0!=e.bytesInSeg||!e.lastSeg&&0!=e.next();)e.bytesInSeg--,e.inputPosition+=1,e.input.readByte();return h},Ne.prototype={maximumBitRate:null,nominalBitRate:null,minimumBitRate:null,sampleRate:null,channel:null,blocksize0:null,blocksize1:null,codebooks:null,floorConfig:null,residueConfig:null,mapping:null,modes:null,comment:null,vendor:null,__class__:Ne};var Fe=function(){};(x["kha.audio2.ogg.vorbis.data.IntPoint"]=Fe).__name__=!0,Fe.prototype={x:null,y:null,__class__:Fe};var Pe=function(){};(x["kha.audio2.ogg.vorbis.data.Mapping"]=Pe).__name__=!0,Pe.read=function(e,t){var i=new Pe,n=e.readBits(16);if(0!=n)throw new ft(new Xe(Ye.INVALID_SETUP,"mapping type "+n,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:22,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));var r=new Array(t);i.chan=r;for(var s=0,a=t;s>5]:10+A[c>>10]:c<16777216?c<524288?15+A[c>>15]:20+A[c>>20]:c<536870912?25+A[c>>25]:c<-2147483648?30+A[c>>30]:0);var d=t-1,_=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(i.chan[h].angle=e.readBits(d<16384?d<16?_[d]:d<512?5+_[d>>5]:10+_[d>>10]:d<16777216?d<524288?15+_[d>>15]:20+_[d>>20]:d<536870912?25+_[d>>25]:d<-2147483648?30+_[d>>30]:0),i.chan[h].magnitude>=t)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].angle>=t)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].magnitude==i.chan[h].angle)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}}else i.couplingSteps=0;if(0!=e.readBits(2))throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:61,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(1=i.submaps)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}else for(var m=0,v=t;m>1,o=this.chan[t].mux,l=e[this.submapFloor[o]];if(0==l.type)throw new ft(new Xe(Ye.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:94,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"doFloor"}));for(var u=l.floor1,h=0,c=r[0]*u.floor1Multiplier,A=1,d=u.values;A=t.length)throw new ft(new Xe(Ye.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Residue.hx",lineNumber:55,className:"kha.audio2.ogg.vorbis.data.Residue",methodName:"read"}))}else i.residueBooks[d][p]=-1}}var m=t[i.classbook].entries,v=t[i.classbook].dimensions,w=new Array(m);i.classdata=w;for(var b=0,y=m;b>>k,e.validBits-=k,E=e.validBits<0?(e.validBits=0,-1):B}else E=e.decodeScalarRaw(S);S.sparse&&(E=S.sortedValues[E]);var I=E;if(-1==I)return;for(var C=l;0<=--C;)A[T*c+C+b]=I%this.classifications,I=I/this.classifications|0}}for(var L=0,N=l;L>>1;if(0==X){var j=o[this.classbook];e.validBits<10&&e.prepHuffman();var Z,J=j.fastHuffman[1023&e.acc];if(0<=J){var $=j.codewordLengths[J];e.acc=e.acc>>>$,e.validBits-=$,Z=e.validBits<0?(e.validBits=0,-1):J}else Z=e.decodeScalarRaw(j);j.sparse&&(Z=j.sortedValues[Z]);var ee=Z;if(-1==ee)return;for(var te=l;0<=--te;)A[te+Y]=ee%this.classifications,ee=ee/this.classifications|0}for(var ie=0,ne=l;ie>>1;++Y}}else if(1==n)for(;Y>>de,e.validBits-=de,ce=e.validBits<0?(e.validBits=0,-1):Ae}else ce=e.decodeScalarRaw(he);he.sparse&&(ce=he.sortedValues[ce]);var _e=ce;if(-1==_e)return;for(var fe=l;0<=--fe;)A[fe+Y]=_e%this.classifications,_e=_e/this.classifications|0}for(var ge=0,pe=l;ge>>Be,e.validBits-=Be,Se=e.validBits<0?(e.validBits=0,-1):Ee}else Se=e.decodeScalarRaw(Te);Te.sparse&&(Se=Te.sortedValues[Se]);var ke=Se;if(-1==ke)return;for(var Ie=l;0<=--Ie;)A[Ie+Y]=ke%this.classifications,ke=ke/this.classifications|0}for(var Ce=0,Le=l;Ce>1,b=n+8;null==b&&(b=0);var y=i.readU8(b),x=(i.readU8(b+1)|y<<8)>>1,T=n+10;null==T&&(T=0);var S=i.readU8(T),E=i.readU8(T+1)|S<<8,B=n+12;null==B&&(B=0);var k=i.readU8(B),I=(i.readU8(B+1)|k<<8)>>1,C=n+14,L=C;if(65535>=1);null==P&&(P=0);var M=i.readU8(P);(i.readU8(P+1)|M<<8)>1,O=C+2*R;null==O&&(O=0);var V=i.readU8(O);if((i.readU8(O+1)|V<<8)>1),re=n+16+12*ne;null==re&&(re=0);var se=re;null==se&&(se=0);var ae=i.readU8(se),oe=i.readU8(se+1),le=i.readU8(se+2),ue=i.readU8(se+3)|le<<8|oe<<16|ae<<24,he=n+16+12*ne+4;null==he&&(he=0);var ce=he;null==ce&&(ce=0);var Ae=i.readU8(ce),de=i.readU8(ce+1),_e=i.readU8(ce+2),fe=i.readU8(ce+3);if(t=e.numGlyphs)return-1;if(2<=e.indexToLocFormat)return-1;if(0==e.indexToLocFormat){var r=e.glyf,s=e.data,a=e.loca+2*t;null==a&&(a=0);var o=s.readU8(a);i=r+2*(s.readU8(a+1)|o<<8);var l=e.glyf,u=e.data,h=e.loca+2*t+2;null==h&&(h=0);var c=u.readU8(h);n=l+2*(u.readU8(h+1)|c<<8)}else{var A=e.glyf,d=e.data,_=e.loca+4*t;null==_&&(_=0);var f=_;null==f&&(f=0);var g=d.readU8(f),p=d.readU8(f+1),m=d.readU8(f+2);i=A+(d.readU8(f+3)|m<<8|p<<16|g<<24);var v=e.glyf,w=e.data,b=e.loca+4*t+4;null==b&&(b=0);var y=b;null==y&&(y=0);var x=w.readU8(y),T=w.readU8(y+1),S=w.readU8(y+2);n=v+(w.readU8(y+3)|S<<8|T<<16|x<<24)}return i==n?-1:i},It.stbtt_GetGlyphBox=function(e,t,i){var n=It.stbtt__GetGlyfOffset(e,t);if(n<0)return!1;var r=e.data,s=n+2;null==s&&(s=0);var a=r.readU8(s),o=r.readU8(s+1)|a<<8;i.x0=0!=(32768&o)?o-65536:o;var l=e.data,u=n+4;null==u&&(u=0);var h=l.readU8(u),c=l.readU8(u+1)|h<<8;i.y0=0!=(32768&c)?c-65536:c;var A=e.data,d=n+6;null==d&&(d=0);var _=A.readU8(d),f=A.readU8(d+1)|_<<8;i.x1=0!=(32768&f)?f-65536:f;var g=e.data,p=n+8;null==p&&(p=0);var m=g.readU8(p),v=g.readU8(p+1)|m<<8;return i.y1=0!=(32768&v)?v-65536:v,!0},It.stbtt_GetCodepointBox=function(e,t,i){return It.stbtt_GetGlyphBox(e,It.stbtt_FindGlyphIndex(e,t),i)},It.stbtt_IsGlyphEmpty=function(e,t){var i=It.stbtt__GetGlyfOffset(e,t);if(i<0)return!0;var n=e.data,r=i;null==r&&(r=0);var s=n.readU8(r),a=n.readU8(r+1)|s<<8;return 0==(0!=(32768&a)?a-65536:a)},It.stbtt__close_shape=function(e,t,i,n,r,s,a,o,l,u){return n?(i&&It.stbtt_setvertex(e[t++],3,l+a>>1,u+o>>1,l,u),It.stbtt_setvertex(e[t++],3,r,s,a,o)):i?It.stbtt_setvertex(e[t++],3,r,s,l,u):It.stbtt_setvertex(e[t++],2,r,s,0,0),t},It.copyVertices=function(e,t,i,n){for(var r=0,s=n;r>1,Q=O+n[h+j+1].y>>1):(q=n[h+j+1].x,Q=n[h+j+1].y,++j)):(q=C,Q=O),It.stbtt_setvertex(n[r++],1,q,Q,0,0),_=!1;var Z=g+2*A;null==Z&&(Z=0);var J=i.readU8(Z);d=1+(i.readU8(Z+1)|J<<8),++A}else _=0==(1&c)?(_&&It.stbtt_setvertex(n[r++],3,K+C>>1,Y+O>>1,K,Y),K=C,Y=O,!0):(_?It.stbtt_setvertex(n[r++],3,C,O,K,Y):It.stbtt_setvertex(n[r++],2,C,O,0,0),!1);++j}r=It.stbtt__close_shape(n,r,_,f,q,Q,X,z,K,Y)}else if(-1==u){var $=1,ee=s+10;for(r=0,n=null;0!=$;){var te,ie,ne=null,re=1,se=0,ae=0,oe=1,le=0,ue=0,he=ee;null==he&&(he=0);var ce=i.readU8(he),Ae=i.readU8(he+1)|ce<<8,de=0!=(32768&Ae)?Ae-65536:Ae,_e=ee+=2;null==_e&&(_e=0);var fe=i.readU8(_e),ge=i.readU8(_e+1)|fe<<8,pe=0!=(32768&ge)?ge-65536:ge;if(ee+=2,0==(2&de))throw new ft("Error");if(0!=(1&de)){var me=ee;null==me&&(me=0);var ve=i.readU8(me),we=i.readU8(me+1)|ve<<8;le=0!=(32768&we)?we-65536:we;var be=ee+=2;null==be&&(be=0);var ye=i.readU8(be),xe=i.readU8(be+1)|ye<<8;ue=0!=(32768&xe)?xe-65536:xe,ee+=2}else{var Te=ee;null==Te&&(Te=0);var Se=i.readU8(Te);le=128<=Se?Se-256:Se;var Ee=++ee;null==Ee&&(Ee=0);var Be=i.readU8(Ee);ue=128<=Be?Be-256:Be,++ee}if(0!=(8&de)){var ke=ee;null==ke&&(ke=0);var Ie=i.readU8(ke),Ce=i.readU8(ke+1)|Ie<<8;re=oe=(0!=(32768&Ce)?Ce-65536:Ce)/16384,ee+=2,se=ae=0}else if(0!=(64&de)){var Le=ee;null==Le&&(Le=0);var Ne=i.readU8(Le),Fe=i.readU8(Le+1)|Ne<<8;re=(0!=(32768&Fe)?Fe-65536:Fe)/16384,se=ae=0;var Pe=ee+=2;null==Pe&&(Pe=0);var Me=i.readU8(Pe),Re=i.readU8(Pe+1)|Me<<8;oe=(0!=(32768&Re)?Re-65536:Re)/16384,ee+=2}else if(0!=(128&de)){var Oe=ee;null==Oe&&(Oe=0);var Ve=i.readU8(Oe),De=i.readU8(Oe+1)|Ve<<8;re=(0!=(32768&De)?De-65536:De)/16384;var Ue=ee+=2;null==Ue&&(Ue=0);var He=i.readU8(Ue),We=i.readU8(Ue+1)|He<<8;se=(0!=(32768&We)?We-65536:We)/16384;var Ge=ee+=2;null==Ge&&(Ge=0);var ze=i.readU8(Ge),Xe=i.readU8(Ge+1)|ze<<8;ae=(0!=(32768&Xe)?Xe-65536:Xe)/16384;var Ye=ee+=2;null==Ye&&(Ye=0);var Ke=i.readU8(Ye),Qe=i.readU8(Ye+1)|Ke<<8;oe=(0!=(32768&Qe)?Qe-65536:Qe)/16384,ee+=2}var qe=Math.sqrt(re*re+se*se),je=Math.sqrt(ae*ae+oe*oe);if(0<(te=null==(ie=It.stbtt_GetGlyphShape(e,pe))?0:ie.length)){for(var Ze=0,Je=te;Ze>1);null==g&&(g=0);var p=g;null==p&&(p=0);var m=a.readU8(p),v=a.readU8(p+1),w=a.readU8(p+2);if(f<(n=a.readU8(p+3)|w<<8|v<<16|m<<24))_=r-1;else{if(!(nn.ey||on.ey&&(a+=(a-r)*(n.ey-o)/(o-s),o=n.ey),r==i){if(!(a<=i+1))throw new ft("Error")}else if(r==i+1){if(!(i<=a))throw new ft("Error")}else if(r<=i){if(!(a<=i))throw new ft("Error")}else if(i+1<=r){if(!(i+1<=a))throw new ft("Error")}else if(!(i<=a&&a<=i+1))throw new ft("Error");if(r<=i&&a<=i){var l=t+i;e[l]=e[l]+n.direction*(o-s)}else if(!(i+1<=r&&i+1<=a)){if(!(i<=r&&r<=i+1&&i<=a&&a<=i+1))throw new ft("Error");var u=t+i;e[u]=e[u]+n.direction*(o-s)*(1-(r-i+(a-i))/2)}}}},It.stbtt__fill_active_edges_new=function(e,t,i,n,r,s){for(var a=s+1;null!=r;){if(!(r.ey>=s))throw new ft("Error");if(0==r.fdx){var o=r.fx;o=s))throw new ft("Error");if(h=r.sy>s?(l=A+d*(r.sy-s),r.sy):(l=A,s),c=r.ey=d))throw new ft("Error");y.next=l,l=y}++h}null!=l&&It.stbtt__fill_active_edges_new(a,c,o+1,e.w,l,d);for(var x=0,T=0,S=e.w;T>1,s=It.STBTT__COMPARE(e[t],e[t+r]),a=It.STBTT__COMPARE(e[t+r],e[t+i-1]);if(s!=a){var o=It.STBTT__COMPARE(e[t],e[t+i-1])==a?0:i-1;n=e[t+o],e[t+o]=e[t+r],e[t+r]=n}n=e[t],e[t]=e[t+r],e[t+r]=n;for(var l=1,u=i-1;;){for(;It.STBTT__COMPARE(e[t+l],e[t]);)++l;for(;It.STBTT__COMPARE(e[t],e[t+u]);)--u;if(u<=l)break;n=e[t+l],e[t+l]=e[t+u],e[t+u]=n,++l,--u}ux[T+B].y:x[T+c].y>>16),d=.00392156862745098*((65280&h)>>>8),_=.00392156862745098*(255&h),f=.00392156862745098*(h>>>24)*u,g=9*Rt.bufferIndex*4;Rt.rectVertices[5+g]=A,Rt.rectVertices[6+g]=d,Rt.rectVertices[7+g]=_,Rt.rectVertices[8+g]=f,Rt.rectVertices[14+g]=A,Rt.rectVertices[15+g]=d,Rt.rectVertices[16+g]=_,Rt.rectVertices[17+g]=f,Rt.rectVertices[23+g]=A,Rt.rectVertices[24+g]=d,Rt.rectVertices[25+g]=_,Rt.rectVertices[26+g]=f,Rt.rectVertices[32+g]=A,Rt.rectVertices[33+g]=d,Rt.rectVertices[34+g]=_,Rt.rectVertices[35+g]=f;var p=c.get_width()/c.get_realWidth(),m=c.get_height()/c.get_realHeight(),v=9*Rt.bufferIndex*4;Rt.rectVertices[3+v]=0,Rt.rectVertices[4+v]=m,Rt.rectVertices[12+v]=0,Rt.rectVertices[13+v]=0,Rt.rectVertices[21+v]=p,Rt.rectVertices[22+v]=0,Rt.rectVertices[30+v]=p,Rt.rectVertices[31+v]=m;var w=9*Rt.bufferIndex*4;Rt.rectVertices[w]=t,Rt.rectVertices[1+w]=i,Rt.rectVertices[2+w]=-5,Rt.rectVertices[9+w]=n,Rt.rectVertices[10+w]=r,Rt.rectVertices[11+w]=-5,Rt.rectVertices[18+w]=s,Rt.rectVertices[19+w]=a,Rt.rectVertices[20+w]=-5,Rt.rectVertices[27+w]=o,Rt.rectVertices[28+w]=l,Rt.rectVertices[29+w]=-5,++Rt.bufferIndex,Rt.lastTexture=c},drawImage2:function(e,t,i,n,r,s,a,o,l,u,h,c,A,d,_){var f=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&f!=Rt.lastTexture)&&this.drawBuffer();var g=t/f.get_realWidth(),p=i/f.get_realHeight(),m=(t+n)/f.get_realWidth(),v=(i+r)/f.get_realHeight(),w=9*Rt.bufferIndex*4;Rt.rectVertices[3+w]=g,Rt.rectVertices[4+w]=v,Rt.rectVertices[12+w]=g,Rt.rectVertices[13+w]=p,Rt.rectVertices[21+w]=m,Rt.rectVertices[22+w]=p,Rt.rectVertices[30+w]=m,Rt.rectVertices[31+w]=v;var b=.00392156862745098*((16711680&_)>>>16),y=.00392156862745098*((65280&_)>>>8),x=.00392156862745098*(255&_),T=.00392156862745098*(_>>>24)*d,S=9*Rt.bufferIndex*4;Rt.rectVertices[5+S]=b,Rt.rectVertices[6+S]=y,Rt.rectVertices[7+S]=x,Rt.rectVertices[8+S]=T,Rt.rectVertices[14+S]=b,Rt.rectVertices[15+S]=y,Rt.rectVertices[16+S]=x,Rt.rectVertices[17+S]=T,Rt.rectVertices[23+S]=b,Rt.rectVertices[24+S]=y,Rt.rectVertices[25+S]=x,Rt.rectVertices[26+S]=T,Rt.rectVertices[32+S]=b,Rt.rectVertices[33+S]=y,Rt.rectVertices[34+S]=x,Rt.rectVertices[35+S]=T;var E=9*Rt.bufferIndex*4;Rt.rectVertices[E]=s,Rt.rectVertices[1+E]=a,Rt.rectVertices[2+E]=-5,Rt.rectVertices[9+E]=o,Rt.rectVertices[10+E]=l,Rt.rectVertices[11+E]=-5,Rt.rectVertices[18+E]=u,Rt.rectVertices[19+E]=h,Rt.rectVertices[20+E]=-5,Rt.rectVertices[27+E]=c,Rt.rectVertices[28+E]=A,Rt.rectVertices[29+E]=-5,++Rt.bufferIndex,Rt.lastTexture=f},drawImageScale:function(e,t,i,n,r,s,a,o,l,u,h){var c=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&c!=Rt.lastTexture)&&this.drawBuffer();var A=t/c.get_realWidth(),d=i/c.get_realHeight(),_=(t+n)/c.get_realWidth(),f=(i+r)/c.get_realHeight(),g=9*Rt.bufferIndex*4;Rt.rectVertices[3+g]=A,Rt.rectVertices[4+g]=f,Rt.rectVertices[12+g]=A,Rt.rectVertices[13+g]=d,Rt.rectVertices[21+g]=_,Rt.rectVertices[22+g]=d,Rt.rectVertices[30+g]=_,Rt.rectVertices[31+g]=f;var p=.00392156862745098*((16711680&h)>>>16),m=.00392156862745098*((65280&h)>>>8),v=.00392156862745098*(255&h),w=9*Rt.bufferIndex*4;Rt.rectVertices[5+w]=p,Rt.rectVertices[6+w]=m,Rt.rectVertices[7+w]=v,Rt.rectVertices[8+w]=u,Rt.rectVertices[14+w]=p,Rt.rectVertices[15+w]=m,Rt.rectVertices[16+w]=v,Rt.rectVertices[17+w]=u,Rt.rectVertices[23+w]=p,Rt.rectVertices[24+w]=m,Rt.rectVertices[25+w]=v,Rt.rectVertices[26+w]=u,Rt.rectVertices[32+w]=p,Rt.rectVertices[33+w]=m,Rt.rectVertices[34+w]=v,Rt.rectVertices[35+w]=u;var b=9*Rt.bufferIndex*4;Rt.rectVertices[b]=s,Rt.rectVertices[1+b]=l,Rt.rectVertices[2+b]=-5,Rt.rectVertices[9+b]=s,Rt.rectVertices[10+b]=a,Rt.rectVertices[11+b]=-5,Rt.rectVertices[18+b]=o,Rt.rectVertices[19+b]=a,Rt.rectVertices[20+b]=-5,Rt.rectVertices[27+b]=o,Rt.rectVertices[28+b]=l,Rt.rectVertices[29+b]=-5,++Rt.bufferIndex,Rt.lastTexture=c},end:function(){0>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.rectVertices[3+i]=r,Ot.rectVertices[4+i]=s,Ot.rectVertices[5+i]=a,Ot.rectVertices[6+i]=n,Ot.rectVertices[10+i]=r,Ot.rectVertices[11+i]=s,Ot.rectVertices[12+i]=a,Ot.rectVertices[13+i]=n,Ot.rectVertices[17+i]=r,Ot.rectVertices[18+i]=s,Ot.rectVertices[19+i]=a,Ot.rectVertices[20+i]=n,Ot.rectVertices[24+i]=r,Ot.rectVertices[25+i]=s,Ot.rectVertices[26+i]=a,Ot.rectVertices[27+i]=n},setTriVertices:function(e,t,i,n,r,s){var a=7*Ot.triangleBufferIndex*3;Ot.triangleVertices[a]=e,Ot.triangleVertices[1+a]=t,Ot.triangleVertices[2+a]=-5,Ot.triangleVertices[7+a]=i,Ot.triangleVertices[8+a]=n,Ot.triangleVertices[9+a]=-5,Ot.triangleVertices[14+a]=r,Ot.triangleVertices[15+a]=s,Ot.triangleVertices[16+a]=-5},setTriColors:function(e,t){var i=7*Ot.triangleBufferIndex*3,n=e*(.00392156862745098*(t>>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.triangleVertices[3+i]=r,Ot.triangleVertices[4+i]=s,Ot.triangleVertices[5+i]=a,Ot.triangleVertices[6+i]=n,Ot.triangleVertices[10+i]=r,Ot.triangleVertices[11+i]=s,Ot.triangleVertices[12+i]=a,Ot.triangleVertices[13+i]=n,Ot.triangleVertices[17+i]=r,Ot.triangleVertices[18+i]=s,Ot.triangleVertices[19+i]=a,Ot.triangleVertices[20+i]=n},drawBuffer:function(e){e||0>>24));Vt.rectVertices[5+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[6+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[7+i]=.00392156862745098*(255&t),Vt.rectVertices[8+i]=n,Vt.rectVertices[14+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[15+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[16+i]=.00392156862745098*(255&t),Vt.rectVertices[17+i]=n,Vt.rectVertices[23+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[24+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[25+i]=.00392156862745098*(255&t),Vt.rectVertices[26+i]=n,Vt.rectVertices[32+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[33+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[34+i]=.00392156862745098*(255&t),Vt.rectVertices[35+i]=n},drawBuffer:function(){Vt.rectVertexBuffer.unlock(4*Vt.bufferIndex),this.g.setVertexBuffer(Vt.rectVertexBuffer),this.g.setIndexBuffer(Vt.indexBuffer),this.g.setPipeline(this.myPipeline.pipeline),this.g.setTexture(this.myPipeline.textureLocation,Vt.lastTexture),this.g.setMatrix(this.myPipeline.projectionLocation,this.projectionMatrix),this.g.setTextureParameters(this.myPipeline.textureLocation,2,2,this.bilinear?1:0,this.bilinear?1:0,0),this.g.drawIndexedVertices(0,2*Vt.bufferIndex*3),this.g.setTexture(this.myPipeline.textureLocation,null),Vt.bufferIndex=0,Vt.rectVertices=Vt.rectVertexBuffer.lock()},setBilinearFilter:function(e){this.end(),this.bilinear=e},setFont:function(e){this.font=g.__cast(e,D)},bakedQuadCache:null,drawString:function(e,t,i,n,r,s){var a=this.font._get(this.fontSize),o=a.getTexture();null!=Vt.lastTexture&&o!=Vt.lastTexture&&this.drawBuffer(),Vt.lastTexture=o;for(var l=n,u=r,h=0,c=e.length;h>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e},Dt.createImageVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createImagePipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_image_frag,t.vertexShader=z.painter_image_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createColoredVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("vertexColor",3),e},Dt.createColoredPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_colored_frag,t.vertexShader=z.painter_colored_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createTextVertexStructure=function(){var e=new jt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createTextPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_text_frag,t.vertexShader=z.painter_text_vert,t.inputLayout=[e],t.blendSource=3,t.blendDestination=5,t.alphaBlendSource=3,t.alphaBlendDestination=5,t},Dt.__super__=Qe,Dt.prototype=r(Qe.prototype,{myColor:null,myFont:null,projectionMatrix:null,imagePainter:null,coloredPainter:null,textPainter:null,canvas:null,g:null,setProjection:function(){var e=this.canvas.get_width(),t=this.canvas.get_height();if(this.canvas instanceof F){var i=this.projectionMatrix,n=2/e,r=-e/e,s=2/(0-t),a=-t/(0-t);i._00=n,i._10=0,i._20=0,i._30=r,i._01=0,i._11=s,i._21=0,i._31=a,i._02=0,i._12=0,i._22=-.002000200020002,i._32=-1.0002000200020003,i._03=0,i._13=0,i._23=0,i._33=1}else if(R.get_nonPow2Supported()||(e=Dt.upperPowerOfTwo(e),t=Dt.upperPowerOfTwo(t)),R.renderTargetsInvertedY()){var o=this.projectionMatrix,l=2/e,u=-e/e,h=2/t,c=-t/t;o._00=l,o._10=0,o._20=0,o._30=u,o._01=0,o._11=h,o._21=0,o._31=c,o._02=0,o._12=0,o._22=-.002000200020002,o._32=-1.0002000200020003,o._03=0,o._13=0,o._23=0,o._33=1}else{var A=this.projectionMatrix,d=2/e,_=-e/e,f=2/(0-t),g=-t/(0-t);A._00=d,A._10=0,A._20=0,A._30=_,A._01=0,A._11=f,A._21=0,A._31=g,A._02=0,A._12=0,A._22=-.002000200020002,A._32=-1.0002000200020003,A._03=0,A._13=0,A._23=0,A._33=1}this.imagePainter.setProjection(this.projectionMatrix),this.coloredPainter.setProjection(this.projectionMatrix),this.textPainter.setProjection(this.projectionMatrix)},drawImage:function(e,t,i){var n=this.coloredPainter;0>>16),G=.00392156862745098*((65280&U)>>>8),z=.00392156862745098*(255&U),X=.00392156862745098*(U>>>24)*D,Y=9*Rt.bufferIndex*4;Rt.rectVertices[5+Y]=W,Rt.rectVertices[6+Y]=G,Rt.rectVertices[7+Y]=z,Rt.rectVertices[8+Y]=X,Rt.rectVertices[14+Y]=W,Rt.rectVertices[15+Y]=G,Rt.rectVertices[16+Y]=z,Rt.rectVertices[17+Y]=X,Rt.rectVertices[23+Y]=W,Rt.rectVertices[24+Y]=G,Rt.rectVertices[25+Y]=z,Rt.rectVertices[26+Y]=X,Rt.rectVertices[32+Y]=W,Rt.rectVertices[33+Y]=G,Rt.rectVertices[34+Y]=z,Rt.rectVertices[35+Y]=X;var K=H.get_width()/H.get_realWidth(),Q=H.get_height()/H.get_realHeight(),q=9*Rt.bufferIndex*4;Rt.rectVertices[3+q]=0,Rt.rectVertices[4+q]=Q,Rt.rectVertices[12+q]=0,Rt.rectVertices[13+q]=0,Rt.rectVertices[21+q]=K,Rt.rectVertices[22+q]=0,Rt.rectVertices[30+q]=K,Rt.rectVertices[31+q]=Q;var j=9*Rt.bufferIndex*4;Rt.rectVertices[j]=A,Rt.rectVertices[1+j]=d,Rt.rectVertices[2+j]=-5,Rt.rectVertices[9+j]=w,Rt.rectVertices[10+j]=b,Rt.rectVertices[11+j]=-5,Rt.rectVertices[18+j]=k,Rt.rectVertices[19+j]=I,Rt.rectVertices[20+j]=-5,Rt.rectVertices[27+j]=R,Rt.rectVertices[28+j]=O,Rt.rectVertices[29+j]=-5,++Rt.bufferIndex,Rt.lastTexture=H},drawScaledSubImage:function(e,t,i,n,r,s,a,o,l){var u=this.coloredPainter;0>>16),J=.00392156862745098*((65280&z)>>>8),$=.00392156862745098*(255&z),ee=.00392156862745098*(z>>>24)*G,te=9*Rt.bufferIndex*4;Rt.rectVertices[5+te]=Z,Rt.rectVertices[6+te]=J,Rt.rectVertices[7+te]=$,Rt.rectVertices[8+te]=ee,Rt.rectVertices[14+te]=Z,Rt.rectVertices[15+te]=J,Rt.rectVertices[16+te]=$,Rt.rectVertices[17+te]=ee,Rt.rectVertices[23+te]=Z,Rt.rectVertices[24+te]=J,Rt.rectVertices[25+te]=$,Rt.rectVertices[26+te]=ee,Rt.rectVertices[32+te]=Z,Rt.rectVertices[33+te]=J,Rt.rectVertices[34+te]=$,Rt.rectVertices[35+te]=ee;var ie=9*Rt.bufferIndex*4;Rt.rectVertices[ie]=g,Rt.rectVertices[1+ie]=p,Rt.rectVertices[2+ie]=-5,Rt.rectVertices[9+ie]=T,Rt.rectVertices[10+ie]=S,Rt.rectVertices[11+ie]=-5,Rt.rectVertices[18+ie]=N,Rt.rectVertices[19+ie]=F,Rt.rectVertices[20+ie]=-5,Rt.rectVertices[27+ie]=U,Rt.rectVertices[28+ie]=H,Rt.rectVertices[29+ie]=-5,++Rt.bufferIndex,Rt.lastTexture=X},get_color:function(){return this.myColor},set_color:function(e){return this.myColor=e},drawRect:function(e,t,i,n,r){null==r&&(r=1),this.imagePainter.end(),this.textPainter.end();var s=this.transformations[this.transformationIndex],a=e-r/2,o=t+r/2;null==o&&(o=0),null==a&&(a=0);var l=s._02*a+s._12*o+s._22,u=(s._00*a+s._10*o+s._20)/l,h=(s._01*a+s._11*o+s._21)/l;null==h&&(h=0),null==u&&(u=0);var c=u,A=h,d=this.transformations[this.transformationIndex],_=e-r/2,f=t-r/2;null==f&&(f=0),null==_&&(_=0);var g=d._02*_+d._12*f+d._22,p=(d._00*_+d._10*f+d._20)/g,m=(d._01*_+d._11*f+d._21)/g;null==m&&(m=0),null==p&&(p=0);var v=p,w=m,b=this.transformations[this.transformationIndex],y=e+i+r/2,x=t-r/2;null==x&&(x=0),null==y&&(y=0);var T=b._02*y+b._12*x+b._22,S=(b._00*y+b._10*x+b._20)/T,E=(b._01*y+b._11*x+b._21)/T;null==E&&(E=0),null==S&&(S=0);var B=S,k=E,I=this.transformations[this.transformationIndex],C=e+i+r/2,L=t+r/2;null==L&&(L=0),null==C&&(C=0);var N=I._02*C+I._12*L+I._22,F=(I._00*C+I._10*L+I._20)/N,P=(I._01*C+I._11*L+I._21)/N;null==P&&(P=0),null==F&&(F=0);var M=F,R=P;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var O=this.transformations[this.transformationIndex],V=e-r/2,D=t+n-r/2;null==D&&(D=0),null==V&&(V=0);var U=O._02*V+O._12*D+O._22,H=(O._00*V+O._10*D+O._20)/U,W=(O._01*V+O._11*D+O._21)/U;null==W&&(W=0),null==H&&(H=0),c=H,A=W;var G=this.transformations[this.transformationIndex],z=e-r/2,X=t+r/2;null==X&&(X=0),null==z&&(z=0);var Y=G._02*z+G._12*X+G._22,K=(G._00*z+G._10*X+G._20)/Y,Q=(G._01*z+G._11*X+G._21)/Y;null==Q&&(Q=0),null==K&&(K=0),v=K,w=Q;var q=this.transformations[this.transformationIndex],j=e+r/2,Z=t+r/2;null==Z&&(Z=0),null==j&&(j=0);var J=q._02*j+q._12*Z+q._22,$=(q._00*j+q._10*Z+q._20)/J,ee=(q._01*j+q._11*Z+q._21)/J;null==ee&&(ee=0),null==$&&($=0),B=$,k=ee;var te=this.transformations[this.transformationIndex],ie=e+r/2,ne=t+n-r/2;null==ne&&(ne=0),null==ie&&(ie=0);var re=te._02*ie+te._12*ne+te._22,se=(te._00*ie+te._10*ne+te._20)/re,ae=(te._01*ie+te._11*ne+te._21)/re;null==ae&&(ae=0),null==se&&(se=0),M=se,R=ae,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var oe=this.transformations[this.transformationIndex],le=e-r/2,ue=t+n+r/2;null==ue&&(ue=0),null==le&&(le=0);var he=oe._02*le+oe._12*ue+oe._22,ce=(oe._00*le+oe._10*ue+oe._20)/he,Ae=(oe._01*le+oe._11*ue+oe._21)/he;null==Ae&&(Ae=0),null==ce&&(ce=0),c=ce,A=Ae;var de=this.transformations[this.transformationIndex],_e=e-r/2,fe=t+n-r/2;null==fe&&(fe=0),null==_e&&(_e=0);var ge=de._02*_e+de._12*fe+de._22,pe=(de._00*_e+de._10*fe+de._20)/ge,me=(de._01*_e+de._11*fe+de._21)/ge;null==me&&(me=0),null==pe&&(pe=0),v=pe,w=me;var ve=this.transformations[this.transformationIndex],we=e+i+r/2,be=t+n-r/2;null==be&&(be=0),null==we&&(we=0);var ye=ve._02*we+ve._12*be+ve._22,xe=(ve._00*we+ve._10*be+ve._20)/ye,Te=(ve._01*we+ve._11*be+ve._21)/ye;null==Te&&(Te=0),null==xe&&(xe=0),B=xe,k=Te;var Se=this.transformations[this.transformationIndex],Ee=e+i+r/2,Be=t+n+r/2;null==Be&&(Be=0),null==Ee&&(Ee=0);var ke=Se._02*Ee+Se._12*Be+Se._22,Ie=(Se._00*Ee+Se._10*Be+Se._20)/ke,Ce=(Se._01*Ee+Se._11*Be+Se._21)/ke;null==Ce&&(Ce=0),null==Ie&&(Ie=0),M=Ie,R=Ce,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R);var Le=this.transformations[this.transformationIndex],Ne=e+i-r/2,Fe=t+n-r/2;null==Fe&&(Fe=0),null==Ne&&(Ne=0);var Pe=Le._02*Ne+Le._12*Fe+Le._22,Me=(Le._00*Ne+Le._10*Fe+Le._20)/Pe,Re=(Le._01*Ne+Le._11*Fe+Le._21)/Pe;null==Re&&(Re=0),null==Me&&(Me=0),c=Me,A=Re;var Oe=this.transformations[this.transformationIndex],Ve=e+i-r/2,De=t+r/2;null==De&&(De=0),null==Ve&&(Ve=0);var Ue=Oe._02*Ve+Oe._12*De+Oe._22,He=(Oe._00*Ve+Oe._10*De+Oe._20)/Ue,We=(Oe._01*Ve+Oe._11*De+Oe._21)/Ue;null==We&&(We=0),null==He&&(He=0),v=He,w=We;var Ge=this.transformations[this.transformationIndex],ze=e+i+r/2,Xe=t+r/2;null==Xe&&(Xe=0),null==ze&&(ze=0);var Ye=Ge._02*ze+Ge._12*Xe+Ge._22,Ke=(Ge._00*ze+Ge._10*Xe+Ge._20)/Ye,Qe=(Ge._01*ze+Ge._11*Xe+Ge._21)/Ye;null==Qe&&(Qe=0),null==Ke&&(Ke=0),B=Ke,k=Qe;var qe=this.transformations[this.transformationIndex],je=e+i+r/2,Ze=t+n-r/2;null==Ze&&(Ze=0),null==je&&(je=0);var Je=qe._02*je+qe._12*Ze+qe._22,$e=(qe._00*je+qe._10*Ze+qe._20)/Je,et=(qe._01*je+qe._11*Ze+qe._21)/Je;null==et&&(et=0),null==$e&&($e=0),M=$e,R=et,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,A,v,w,B,k,M,R)},fillRect:function(e,t,i,n){this.imagePainter.end(),this.textPainter.end();var r=this.transformations[this.transformationIndex],s=e,a=t+n;null==a&&(a=0),null==s&&(s=0);var o=r._02*s+r._12*a+r._22,l=(r._00*s+r._10*a+r._20)/o,u=(r._01*s+r._11*a+r._21)/o;null==u&&(u=0),null==l&&(l=0);var h=l,c=u,A=this.transformations[this.transformationIndex],d=e,_=t;null==_&&(_=0),null==d&&(d=0);var f=A._02*d+A._12*_+A._22,g=(A._00*d+A._10*_+A._20)/f,p=(A._01*d+A._11*_+A._21)/f;null==p&&(p=0),null==g&&(g=0);var m=g,v=p,w=this.transformations[this.transformationIndex],b=e+i,y=t;null==y&&(y=0),null==b&&(b=0);var x=w._02*b+w._12*y+w._22,T=(w._00*b+w._10*y+w._20)/x,S=(w._01*b+w._11*y+w._21)/x;null==S&&(S=0),null==T&&(T=0);var E=T,B=S,k=this.transformations[this.transformationIndex],I=e+i,C=t+n;null==C&&(C=0),null==I&&(I=0);var L=k._02*I+k._12*C+k._22,N=(k._00*I+k._10*C+k._20)/L,F=(k._01*I+k._11*C+k._21)/L;null==F&&(F=0),null==N&&(N=0);var P=N,M=F;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),h,c,m,v,E,B,P,M)},drawString:function(e,t,i){this.imagePainter.end();var n=this.coloredPainter;0=Zt.instances.length?null:Zt.instances[e]},Zt.notifyOnConnect=function(e,t){null!=e&&Zt.connectListeners.push(e),null!=t&&Zt.disconnectListeners.push(t)},Zt.removeConnect=function(e,t){null!=e&&it.remove(Zt.connectListeners,e),null!=t&&it.remove(Zt.disconnectListeners,t)},Zt.sendConnectEvent=function(e){Zt.instances[e].connected=!0;for(var t=0,i=Zt.connectListeners;t>23&255,n=8388607&e;switch(i){case 0:return 0;case 255:return 0!=n?NaN:0>>t&1)){return!0}return!1},si.toText=function(e,t){for(var i="",n=0,r=t;n>>16)}),"R",0,1,!0),r=e.slider(t.nest(1,{value:.00392156862745098*((65280&t.color)>>>8)}),"G",0,1,!0),s=e.slider(t.nest(2,{value:.00392156862745098*(255&t.color)}),"B",0,1,!0),a=.00392156862745098*(t.color>>>24);i&&(a=e.slider(t.nest(3,{value:a}),"A",0,1,!0));var o=C.fromFloats(n,r,s,a);return e.text("",2,o),o},Bi.initPath=function(e,t){e.text="Windows"==t?"C:\\Users":"/"},Bi.fileBrowser=function(e,t,i){null==i&&(i=!1);var n="/",r="ls ",s=pt.get_systemId();"Windows"==s&&(r="dir /b ",i&&(r+="/ad "),n="\\",t.text=ut.replace(t.text,"\\\\","\\"),t.text=ut.replace(t.text,"\r","")),""==t.text&&Bi.initPath(t,s);var a=Krom.getFilesLocation()+n+Bi.dataPath+"dir.txt";t.text!=Bi.lastPath&&Krom.sysCommand(r+'"'+t.text+'" > "'+a+'"'),Bi.lastPath=t.text;var o=he.ofData(Krom.loadBlob(a)).toString().split("\n"),l=t.text.indexOf("/"),u=t.text.indexOf("\\"),h=-1l||-1u;t.changed=!1,h&&e.button("..",0)&&(t.changed=e.changed=!0,t.text=t.text.substring(0,t.text.lastIndexOf(n)),2==t.text.length&&":"==t.text.charAt(1)&&(t.text+=n));for(var c=0;c=i.length&&(t.position=0),t.changed=e.changed=!0):t.changed=!1;var r=e.getHover();return Bi.drawInlineRadio(e,i[t.position],r,n),e.endElement(),t.position},Bi.drawInlineRadio=function(e,t,i,n){null==n&&(n=1),i?(e.g.set_color(e.t.ACCENT_HOVER_COL),e.g.fillRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)):(e.g.set_color(e.t.ACCENT_COL),e.enabled||e.fadeColor(),e.g.drawRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)),e.g.set_color(e.t.TEXT_COL),e.drawString(e.g,t,e.t.TEXT_OFFSET*e.ops.scaleFactor,0,n)},Bi.colorWheel=function(e,t,i,n,r,s){null==s&&(s=!0),null==r&&(r=!1),null==i&&(i=!1),null==n&&(n=e._w),Bi.rgbToHsv(.00392156862745098*((16711680&t.color)>>>16),.00392156862745098*((65280&t.color)>>>8),.00392156862745098*(255&t.color),Bi.ar);var a=Bi.ar[0],o=Bi.ar[1],l=Bi.ar[2],u=.00392156862745098*(t.color>>>24),h=e._x,c=e._y;null!=e.currentWindow&&e.currentWindow.scrollEnabled||(n-=e.t.SCROLL_W*e.ops.scaleFactor|0,h+=(e.t.SCROLL_W*e.ops.scaleFactor|0)/2),e.image(e.ops.color_wheel,C.fromFloats(l,l,l));var A=h+n/2,d=c+(e._y-c)/2,_=.7*n,f=_/2,g=A,p=d+o*f,m=a*(2*Math.PI),v=Math.cos(m)*(g-A)-Math.sin(m)*(p-d)+A,w=Math.sin(m)*(g-A)+Math.cos(m)*(p-d)+d;g=v,p=w,e.g.set_color(-16777216),e.g.fillRect(g-3*e.ops.scaleFactor,p-3*e.ops.scaleFactor,6*e.ops.scaleFactor,6*e.ops.scaleFactor),e.g.set_color(-1),e.g.fillRect(g-2*e.ops.scaleFactor,p-2*e.ops.scaleFactor,4*e.ops.scaleFactor,4*e.ops.scaleFactor),r&&(i?e.row([.3333333333333333,.3333333333333333,.3333333333333333]):e.row([.5,.5]));var b=t.nest(0);if(b.value=Math.round(100*l)/100,l=e.slider(b,"Value",0,1,!0),b.changed?t.changed=e.changed=!0:t.changed=!1,i){var y=t.nest(1,{value:Math.round(100*u)/100});u=e.slider(y,"Alpha",0,1,!0),y.changed&&(t.changed=e.changed=!0)}var x=A+e._windowX,T=d+e._windowY;if(e.inputStarted&&e.getInputInRect(x-f,T-f,_,_)&&(Bi.wheelSelectedHande=t),e.inputReleased&&(Bi.wheelSelectedHande=null),e.inputDown&&Bi.wheelSelectedHande==t){var S=x-e.inputX,E=T-e.inputY;o=Math.min(Math.sqrt(S*S+E*E),f)/f;var B=Math.atan2(e.inputX-x,e.inputY-T);B<0&&(B=Math.PI+(Math.PI-Math.abs(B))),a=(B=2*Math.PI-B)/(2*Math.PI),t.changed=e.changed=!0}return Bi.hsvToRgb(a,o,l,Bi.ar),t.color=C.fromFloats(Bi.ar[0],Bi.ar[1],Bi.ar[2],u),s&&e.text("",2,t.color),t.color},Bi.keycodeToString=function(e){switch(e){case-1:return"None";case 0:return"Unknown";case 1:return"Back";case 3:return"Cancel";case 6:return"Help";case 8:return"Backspace";case 9:return"Tab";case 12:return"Clear";case 13:return"Return";case 16:return"Shift";case 17:return"Ctrl";case 18:return"Alt";case 19:return"Pause";case 20:return"CapsLock";case 21:return"Kana";case 22:return"Eisu";case 23:return"Junja";case 24:return"Final";case 25:return"Hanja";case 27:return"Esc";case 28:return"Convert";case 29:return"NonConvert";case 30:return"Accept";case 31:return"ModeChange";case 32:return"Space";case 33:return"PageUp";case 34:return"PageDown";case 35:return"End";case 36:return"Home";case 37:return"Left";case 38:return"Up";case 39:return"Right";case 40:return"Down";case 41:return"Select";case 42:return"Print";case 43:return"Execute";case 44:return"PrintScreen";case 45:return"Insert";case 46:return"Delete";case 58:return"Colon";case 59:return"Semicolon";case 60:return"LessThan";case 61:return"Equals";case 62:return"GreaterThan";case 63:return"QuestionMark";case 64:return"At";case 91:return"Win";case 93:return"ContextMenu";case 95:return"Sleep";case 96:return"Numpad0";case 97:return"Numpad1";case 98:return"Numpad2";case 99:return"Numpad3";case 100:return"Numpad4";case 101:return"Numpad5";case 102:return"Numpad6";case 103:return"Numpad7";case 104:return"Numpad8";case 105:return"Numpad9";case 106:return"Multiply";case 107:return"Add";case 108:return"Separator";case 109:return"Subtract";case 110:return"Decimal";case 111:return"Divide";case 112:return"F1";case 113:return"F2";case 114:return"F3";case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 124:return"F13";case 125:return"F14";case 126:return"F15";case 127:return"F16";case 128:return"F17";case 129:return"F18";case 130:return"F19";case 131:return"F20";case 132:return"F21";case 133:return"F22";case 134:return"F23";case 135:return"F24";case 144:return"NumLock";case 145:return"ScrollLock";case 146:return"WinOemFjJisho";case 147:return"WinOemFjMasshou";case 148:return"WinOemFjTouroku";case 149:return"WinOemFjLoya";case 150:return"WinOemFjRoya";case 160:return"Circumflex";case 161:return"Exclamation";case 162:return"DoubleQuote";case 163:return"Hash";case 164:return"Dollar";case 165:return"Percent";case 166:return"Ampersand";case 167:return"Underscore";case 168:return"OpenParen";case 169:return"CloseParen";case 170:return"Asterisk";case 171:return"Plus";case 172:return"Pipe";case 173:return"HyphenMinus";case 174:return"OpenCurlyBracket";case 175:return"CloseCurlyBracket";case 176:return"Tilde";case 181:return"VolumeMute";case 182:return"VolumeDown";case 183:return"VolumeUp";case 188:return"Comma";case 190:return"Period";case 191:return"Slash";case 192:return"BackQuote";case 219:return"OpenBracket";case 220:return"BackSlash";case 221:return"CloseBracket";case 222:return"Quote";case 224:return"Meta";case 225:return"AltGr";case 227:return"WinIcoHelp";case 228:return"WinIco00";case 230:return"WinIcoClear";case 233:return"WinOemReset";case 234:return"WinOemJump";case 235:return"WinOemPA1";case 236:return"WinOemPA2";case 237:return"WinOemPA3";case 238:return"WinOemWSCTRL";case 239:return"WinOemCUSEL";case 240:return"WinOemATTN";case 241:return"WinOemFinish";case 242:return"WinOemCopy";case 243:return"WinOemAuto";case 244:return"WinOemENLW";case 245:return"WinOemBackTab";case 246:return"ATTN";case 247:return"CRSEL";case 248:return"EXSEL";case 249:return"EREOF";case 250:return"Play";case 251:return"Zoom";case 253:return"PA1";case 254:return"WinOemClear"}return String.fromCodePoint(e)},Bi.dist=function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)},Bi.fract=function(e){return e-(0|e)},Bi.mix=function(e,t,i){return e*(1-i)+t*i},Bi.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},Bi.step=function(e,t){return tIi.modalX+Ii.modalW||Ii.ui.inputYIi.modalY+Ii.modalH)&&(Ii.show=!1)},Ii.showMessage=function(e,t,i){Ii.ui=e,Ii.init(),Ii.boxTitle=t,Ii.boxText=i,Ii.boxCommands=null},Ii.showCustom=function(e,t,i,n,r,s){null==s&&(s=160),null==r&&(r=400),null==n&&(n=-1),null==i&&(i=-1),Ii.ui=e,Ii.init(i,n,r,s),Ii.boxTitle="",Ii.boxText="",Ii.boxCommands=t},Ii.init=function(e,t,i,n){null==n&&(n=160),null==i&&(i=400),null==t&&(t=-1),null==e&&(e=-1);var r=pt.windowWidth(),s=pt.windowHeight();Ii.modalX=e,Ii.modalY=t,Ii.modalW=i*Ii.ui.ops.scaleFactor|0,Ii.modalH=n*Ii.ui.ops.scaleFactor|0,-1==e&&(Ii.modalX=r/2-Ii.modalW/2|0),-1==t&&(Ii.modalY=s/2-Ii.modalH/2|0),Ii.modalX=0|Math.max(0,Math.min(Ii.modalX,r-Ii.modalW)),Ii.modalY=0|Math.max(0,Math.min(Ii.modalY,s-Ii.modalH)),Ii.hwnd.dragX=0,Ii.hwnd.dragY=0,Ii.show=!0};var Ci=function(){};(x["zui.Themes"]=Ci).__name__=!0;var Li=function(e){this.restoreY=-1,this.restoreX=-1,this.checkSelectImage=null,this.elementsBaked=!1,this.tabScroll=0,this.tabHandle=null,this.tabNames=null,this.tooltipTime=0,this.tooltipWait=!1,this.tooltipShown=!1,this.tooltipY=0,this.tooltipX=0,this.tooltipInvertY=!1,this.tooltipImgMaxWidth=null,this.tooltipImg=null,this.tooltipText="",this.comboToSubmit=0,this.submitComboHandle=null,this.comboSelectedWindow=null,this.comboSelectedHandle=null,this.tabPressedHandle=null,this.tabPressed=!1,this.textToSubmit="",this.submitTextHandle=null,this.textSelectedHandle=null,this.windowHeader=0,this.dragHandle=null,this.scrollHandle=null,this.windowEnded=!0,this._windowY=0,this._windowX=0,this.imageScrollAlign=!0,this.scrollAlign=0,this.curRatio=-1,this.highlightAnchor=0,this.cursorY=0,this.cursorX=0,this.key=null,this.isReturnDown=!1,this.isEscapeDown=!1,this.isDeleteDown=!1,this.isBackspaceDown=!1,this.isAltDown=!1,this.isCtrlDown=!1,this.isShiftDown=!1,this.isKeyDown=!1,this.isKeyPressed=!1,this.inputWheelDelta=0,this.inputEnabled=!0,this.inputRegistered=!1,this.alwaysRedraw=!1,this.scrollEnabled=!0,this.imageInvertY=!1,this.changed=!1,this.isReleased=!1,this.isHovered=!1,this.isPushed=!1,this.isStarted=!1,this.enabled=!0,this.isTyping=!1,this.isScrolling=!1,null==e.theme&&(e.theme=Ci.dark),this.t=e.theme,null==e.khaWindowId&&(e.khaWindowId=0),null==e.scaleFactor&&(e.scaleFactor=1),null==e.autoNotifyInput&&(e.autoNotifyInput=!0),this.ops=e,this.setScale(e.scaleFactor),e.autoNotifyInput&&this.registerInput(),null==Li.copyReceiver&&(Li.copyReceiver=this,pt.notifyOnCutCopyPaste(Ni(this,this.onCut),Ni(this,this.onCopy),Ni(this,this.onPaste)),pt.notifyOnFrames(function(e){(Li.isCopy||Li.isPaste)&&1<++Li.copyFrame&&(Li.isCopy=Li.isCut=Li.isPaste=!1,Li.copyFrame=0)}));var t=Dt.createTextVertexStructure();this.rtTextPipeline=Dt.createTextPipeline(t),this.rtTextPipeline.alphaBlendSource=1,this.rtTextPipeline.compile()};function Ni(e,t){return null==t?null:(null==t.__id__&&(t.__id__=n.$haxeUID++),null==e.hx__closures__?e.hx__closures__={}:i=e.hx__closures__[t.__id__],null==i&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i);var i}(x["zui.Zui"]=Li).__name__=!0,Li.prototype={isScrolling:null,isTyping:null,enabled:null,isStarted:null,isPushed:null,isHovered:null,isReleased:null,changed:null,imageInvertY:null,scrollEnabled:null,alwaysRedraw:null,inputRegistered:null,inputEnabled:null,inputX:null,inputY:null,inputStartedX:null,inputStartedY:null,inputDX:null,inputDY:null,inputWheelDelta:null,inputStarted:null,inputStartedR:null,inputReleased:null,inputReleasedR:null,inputDown:null,inputDownR:null,isKeyPressed:null,isKeyDown:null,isShiftDown:null,isCtrlDown:null,isAltDown:null,isBackspaceDown:null,isDeleteDown:null,isEscapeDown:null,isReturnDown:null,key:null,char:null,cursorX:null,cursorY:null,highlightAnchor:null,ratios:null,curRatio:null,xBeforeSplit:null,wBeforeSplit:null,g:null,t:null,ops:null,globalG:null,rtTextPipeline:null,fontSize:null,fontOffsetY:null,arrowOffsetX:null,arrowOffsetY:null,titleOffsetX:null,buttonOffsetY:null,checkOffsetX:null,checkOffsetY:null,checkSelectOffsetX:null,checkSelectOffsetY:null,radioOffsetX:null,radioOffsetY:null,radioSelectOffsetX:null,radioSelectOffsetY:null,scrollAlign:null,imageScrollAlign:null,_x:null,_y:null,_w:null,_h:null,_windowX:null,_windowY:null,_windowW:null,_windowH:null,currentWindow:null,windowEnded:null,scrollHandle:null,dragHandle:null,windowHeader:null,textSelectedHandle:null,textSelectedCurrentText:null,submitTextHandle:null,textToSubmit:null,tabPressed:null,tabPressedHandle:null,comboSelectedHandle:null,comboSelectedWindow:null,comboSelectedAlign:null,comboSelectedTexts:null,comboSelectedLabel:null,comboSelectedX:null,comboSelectedY:null,comboSelectedW:null,submitComboHandle:null,comboToSubmit:null,tooltipText:null,tooltipImg:null,tooltipImgMaxWidth:null,tooltipInvertY:null,tooltipX:null,tooltipY:null,tooltipShown:null,tooltipWait:null,tooltipTime:null,tabNames:null,tabHandle:null,tabScroll:null,elementsBaked:null,checkSelectImage:null,setScale:function(e){this.ops.scaleFactor=e,this.fontSize=this.t.FONT_SIZE*this.ops.scaleFactor|0;var t=this.ops.font.height(this.fontSize);this.fontOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-t)/2,this.arrowOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.ARROW_SIZE*this.ops.scaleFactor)/2,this.arrowOffsetX=this.arrowOffsetY,this.titleOffsetX=(2*this.arrowOffsetX+this.t.ARROW_SIZE*this.ops.scaleFactor)/this.ops.scaleFactor,this.buttonOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.BUTTON_H*this.ops.scaleFactor)/2,this.checkOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.checkOffsetX=this.checkOffsetY,this.checkSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.checkSelectOffsetX=this.checkSelectOffsetY,this.radioOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.radioOffsetX=this.radioOffsetY,this.radioSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.radioSelectOffsetX=this.radioSelectOffsetY,this.elementsBaked=!1},bakeElements:function(){null!=this.checkSelectImage&&this.checkSelectImage.unload(),this.checkSelectImage=R.createRenderTarget(this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,null,0,1,this.ops.khaWindowId);var e=this.checkSelectImage.get_g2();e.begin(!0,0),e.set_color(this.t.ACCENT_SELECT_COL),e.drawLine(0,0,this.checkSelectImage.get_width(),this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.drawLine(this.checkSelectImage.get_width(),0,0,this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.end(),this.elementsBaked=!0},remove:function(){this.ops.autoNotifyInput&&this.unregisterInput()},registerInput:function(){ti.get().notifyWindowed(this.ops.khaWindowId,Ni(this,this.onMouseDown),Ni(this,this.onMouseUp),Ni(this,this.onMouseMove),Ni(this,this.onMouseWheel)),ei.get().notify(Ni(this,this.onKeyDown),Ni(this,this.onKeyUp),Ni(this,this.onKeyPress)),this.inputRegistered=!0},unregisterInput:function(){ti.get().removeWindowed(this.ops.khaWindowId,Ni(this,this.onMouseDown),Ni(this,this.onMouseUp),Ni(this,this.onMouseMove),Ni(this,this.onMouseWheel)),ei.get().remove(Ni(this,this.onKeyDown),Ni(this,this.onKeyUp),Ni(this,this.onKeyPress)),this.endInput(),this.inputX=this.inputY=0,this.inputRegistered=!1},begin:function(e){this.elementsBaked||this.bakeElements(),this.changed=!1,this.globalG=e,this._x=0,this._y=0,this._w=0,this._h=0},end:function(e){null==e&&(e=!0),this.windowEnded||this.endWindow(),this.drawCombo(),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},beginRegion:function(e,t,i,n){this.elementsBaked||(e.end(),this.bakeElements(),e.begin(!1)),this.changed=!1,this.globalG=e,this.g=e,this.currentWindow=null,this.tooltipText="",this.tooltipImg=null,this._windowX=0,this._windowY=0,this._windowW=n,this._x=t,this._y=i,this._w=n},endRegion:function(e){null==e&&(e=!0),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},endInput:function(){this.isKeyPressed=!1,this.inputStarted=!1,this.inputStartedR=!1,this.inputReleased=!1,this.inputReleasedR=!1,this.inputDX=0,this.inputDY=0,this.inputWheelDelta=0,Li.textToPaste="",Li.keyRepeat&&this.isKeyDown&&.05t.length?t.length:this.cursorX+1),this.isShiftDown&&(37==this.key||39==this.key||16==this.key)||this.isCtrlDown||(this.highlightAnchor=this.cursorX));""!=Li.textToPaste&&(t=it.substr(t,0,this.highlightAnchor)+Li.textToPaste+it.substr(t,this.cursorX,null),this.cursorX+=Li.textToPaste.length,this.highlightAnchor=this.cursorX,Li.textToPaste=""),this.highlightAnchor==this.cursorX?Li.textToCopy=t:this.highlightAnchorn&&(e.value=n),e.changed=this.changed=!0}var d=this.getHover();this.drawSlider(e.value,i,n,r,d),(this.getReleased()||this.tabPressed)&&l&&(e.text=e.value+"",this.startTextEdit(e),e.changed=this.changed=!0);var _=0==o?2:0;return this.textSelectedHandle==e&&this.updateTextEdit(_),this.submitTextHandle==e&&(this.submitTextEdit(),e.value=parseFloat(e.text),e.changed=this.changed=!0),this.g.set_color(this.t.LABEL_COL),this.drawString(this.g,t,null,0,o),a&&(this.g.set_color(this.t.TEXT_COL),this.textSelectedHandle!=e?this.drawString(this.g,e.value+"",null,0,_):this.drawString(this.g,this.textSelectedCurrentText,null,0,_)),this.endElement(),e.value},separator:function(e,t){null==t&&(t=!0),null==e&&(e=4),this.isVisible(this.t.ELEMENT_H*this.ops.scaleFactor)&&t&&(this.g.set_color(this.t.SEPARATOR_COL),this.g.fillRect(this._x,this._y,this._w,e*this.ops.scaleFactor)),this._y+=e*this.ops.scaleFactor},tooltip:function(e){this.tooltipText=e,this.tooltipY=this._y+this._windowY},tooltipImage:function(e,t){this.tooltipImg=e,this.tooltipImgMaxWidth=t,this.tooltipInvertY=this.imageInvertY,this.tooltipY=this._y+this._windowY},drawArrow:function(e){var t=this._x+this.arrowOffsetX,i=this._y+this.arrowOffsetY;this.g.set_color(this.t.TEXT_COL),e?this.g.fillTriangle(t,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor/2,i+this.t.ARROW_SIZE*this.ops.scaleFactor):this.g.fillTriangle(t,i,t,i+this.t.ARROW_SIZE*this.ops.scaleFactor,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i+this.t.ARROW_SIZE*this.ops.scaleFactor/2)},drawTree:function(e){var t=7*this.ops.scaleFactor,i=this._x+this.arrowOffsetX+1,n=this._y+this.arrowOffsetY+1;this.g.set_color(this.t.TEXT_COL),e?this.g.fillRect(i,n+t/2-1,t,t/8):(this.g.fillRect(i,n+t/2-1,t,t/8),this.g.fillRect(i+t/2-1,n,t/8,t))},drawCheck:function(e,t){var i=this._x+this.checkOffsetX,n=this._y+this.checkOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;if(0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e){this.g.set_color(-1),this.enabled||this.fadeColor();var u=this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0;this.g.drawScaledImage(this.checkSelectImage,i+this.checkSelectOffsetX,n+this.checkSelectOffsetY,u,u)}},drawRadio:function(e,t){var i=this._x+this.radioOffsetX,n=this._y+this.radioOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e&&(this.g.set_color(this.t.ACCENT_SELECT_COL),this.enabled||this.fadeColor(),this.g.fillRect(i+this.radioSelectOffsetX,n+this.radioSelectOffsetY,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor))},drawSlider:function(e,t,i,n,r){var s=this._x+this.buttonOffsetY,a=this._y+this.buttonOffsetY,o=this._w-2*this.buttonOffsetY;this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var l=this.g,u=this.t.FILL_ACCENT_BG,h=this.t.BUTTON_H*this.ops.scaleFactor,c=0;0==c&&(c=1),this.enabled||this.fadeColor(),u?l.fillRect(s,a-1,o,1+h):l.drawRect(s,a,o,h,c),this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var A=(e-t)/(i-t),d=8*this.ops.scaleFactor,_=n?s:s+(o-d)*A,f=n?o*A:d;f=Math.max(Math.min(f,o),0);var g=this.g,p=this.t.BUTTON_H*this.ops.scaleFactor,m=0;0==m&&(m=1),this.enabled||this.fadeColor(),g.fillRect(_,a-1,f,1+p)},drawCombo:function(){if(null!=this.comboSelectedHandle){var e=this.g;this.globalG.set_color(this.t.SEPARATOR_COL);var t=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor|0,i=(this.comboSelectedTexts.length+1)*t;this.globalG.begin(!1);var n=this.comboSelectedY-i-(this.t.ELEMENT_H*this.ops.scaleFactor|0),r=pt.windowHeight()-(this.comboSelectedY+i),s=r<0&&rthis.tooltipImgMaxWidth&&(e=this.tooltipImgMaxWidth);var t=this.tooltipImg.get_height()*(e/this.tooltipImg.get_width());this.tooltipX=Math.min(this.tooltipX,pt.windowWidth()-e-20),this.tooltipY=Math.min(this.tooltipY,pt.windowHeight()-t-20),this.globalG.set_color(-16777216),this.globalG.begin(!1),this.globalG.fillRect(this.tooltipX,this.tooltipY,e,t),this.globalG.set_color(-1),this.tooltipInvertY?this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY+t,e,-t):this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY,e,t),this.globalG.end()},drawString:function(e,t,i,n,r){null==r&&(r=0),null==n&&(n=0);var s=this._w/(this.fontSize/2|0)|0;t.length>s&&(t=t.substring(0,s)+".."),null==i&&(i=this.t.TEXT_OFFSET),i*=this.ops.scaleFactor,e.set_font(this.ops.font),e.set_fontSize(this.fontSize),1==r?i=this._w/2-this.ops.font.width(this.fontSize,t)/2:2==r&&(i=this._w-this.ops.font.width(this.fontSize,t)-this.t.TEXT_OFFSET*this.ops.scaleFactor),this.enabled||this.fadeColor(),e.set_pipeline(this.rtTextPipeline),e.drawString(t,this._x+i,this._y+this.fontOffsetY+n),e.set_pipeline(null)},endElement:function(e){null==e&&(e=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor),null==this.currentWindow||0==this.currentWindow.layout?-1==this.curRatio||null!=this.ratios&&this.curRatio==this.ratios.length-1?(this._y+=e,null!=this.ratios&&this.curRatio==this.ratios.length-1&&(this.curRatio=-1,this.ratios=null,this._x=this.xBeforeSplit,this._w=this.wBeforeSplit)):(this.curRatio++,this._x+=this._w,this._w=this.wBeforeSplit*this.ratios[this.curRatio]|0):this._x+=this._w+this.t.ELEMENT_OFFSET*this.ops.scaleFactor},row:function(e){this.ratios=e,this.curRatio=0,this.xBeforeSplit=this._x,this.wBeforeSplit=this._w,this._w=this._w*e[this.curRatio]|0},indent:function(){this._x+=this.t.TAB_W*this.ops.scaleFactor|0,this._w-=this.t.TAB_W*this.ops.scaleFactor|0},unindent:function(){this._x-=this.t.TAB_W*this.ops.scaleFactor|0,this._w+=this.t.TAB_W*this.ops.scaleFactor|0},fadeColor:function(){this.g.set_color(C.fromFloats(.00392156862745098*((16711680&this.g.get_color())>>>16),.00392156862745098*((65280&this.g.get_color())>>>8),.00392156862745098*(255&this.g.get_color()),.25))},fill:function(e,t,i,n,r){this.g.set_color(r),this.enabled||this.fadeColor(),this.g.fillRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor-1,i*this.ops.scaleFactor,n*this.ops.scaleFactor),this.g.set_color(-1)},rect:function(e,t,i,n,r,s){null==s&&(s=1),this.g.set_color(r),this.enabled||this.fadeColor(),this.g.drawRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor,i*this.ops.scaleFactor,n*this.ops.scaleFactor,s),this.g.set_color(-1)},drawRect:function(e,t,i,n,r,s,a){null==a&&(a=0),0==a&&(a=1),this.enabled||this.fadeColor(),t?e.fillRect(i,n-1,r,s+1):e.drawRect(i,n,r,s,a)},isVisible:function(e){if(null==this.currentWindow)return!0;var t=null!=this.tabNames?this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor:0;return this._y+e>t&&this._y=this._windowX+this._x&&this.inputStartedX=this._windowY+this._y)&&this.inputStartedY=this._windowX+this._x&&this.inputX=this._windowY+this._y&&this.inputY=e*r&&this.inputX<(e+i)*r&&this.inputY>=t*r)&&this.inputY<(t+n)*r},onMouseDown:function(e,t,i){0==e?this.inputStarted=!0:this.inputStartedR=!0,0==e?this.inputDown=!0:this.inputDownR=!0,this.setInputPosition(t,i),this.inputStartedX=t,this.inputStartedY=i},onMouseUp:function(e,t,i){0==e?this.isScrolling?(this.isScrolling=!1,this.scrollHandle=null,t==this.inputStartedX&&i==this.inputStartedY&&(this.inputReleased=!0)):this.inputReleased=!0:1==e&&(this.inputReleasedR=!0),0==e?this.inputDown=!1:this.inputDownR=!1,this.setInputPosition(t,i),this.deselectText()},onMouseMove:function(e,t,i,n){this.setInputPosition(e,t)},onMouseWheel:function(e){this.inputWheelDelta=e},setInputPosition:function(e,t){this.inputDX+=e-this.inputX,this.inputDY+=t-this.inputY,this.inputX=e,this.inputY=t},onKeyDown:function(e){switch(this.key=e,this.isKeyPressed=!0,this.isKeyDown=!0,Li.keyRepeatTime=G.time()+.4,e){case 8:this.isBackspaceDown=!0;break;case 13:this.isReturnDown=!0;break;case 16:this.isShiftDown=!0;break;case 17:this.isCtrlDown=!0;break;case 18:this.isAltDown=!0;break;case 27:this.isEscapeDown=!0;break;case 32:this.char=" ";break;case 46:this.isDeleteDown=!0}},onKeyUp:function(e){switch(this.isKeyDown=!1,e){case 8:this.isBackspaceDown=!1;break;case 13:this.isReturnDown=!1;break;case 16:this.isShiftDown=!1;break;case 17:this.isCtrlDown=!1;break;case 18:this.isAltDown=!1;break;case 27:this.isEscapeDown=!1;break;case 46:this.isDeleteDown=!1}},onKeyPress:function(e){this.char=e,this.isKeyPressed=!0},onCut:function(){return Li.isCut=!0,this.onCopy()},onCopy:function(){return Li.isCopy=!0,Li.textToCopy},onPaste:function(e){Li.isPaste=!0,Li.textToPaste=e},ELEMENT_W:function(){return this.t.ELEMENT_W*this.ops.scaleFactor},ELEMENT_H:function(){return this.t.ELEMENT_H*this.ops.scaleFactor},ELEMENT_OFFSET:function(){return this.t.ELEMENT_OFFSET*this.ops.scaleFactor},ARROW_SIZE:function(){return this.t.ARROW_SIZE*this.ops.scaleFactor},BUTTON_H:function(){return this.t.BUTTON_H*this.ops.scaleFactor},CHECK_SIZE:function(){return this.t.CHECK_SIZE*this.ops.scaleFactor},CHECK_SELECT_SIZE:function(){return this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor},FONT_SIZE:function(){return this.t.FONT_SIZE*this.ops.scaleFactor|0},SCROLL_W:function(){return this.t.SCROLL_W*this.ops.scaleFactor|0},TEXT_OFFSET:function(){return this.t.TEXT_OFFSET*this.ops.scaleFactor},TAB_W:function(){return this.t.TAB_W*this.ops.scaleFactor|0},SCALE:function(){return this.ops.scaleFactor},FLASH_SPEED:function(){return.5},TOOLTIP_DELAY:function(){return 1},resize:function(e,t,i,n){null==n&&(n=0),e.redraws=2,null!=e.texture&&e.texture.unload(),t<1&&(t=1),i<1&&(i=1),e.texture=R.createRenderTarget(t,i,0,0,1,n),e.texture.get_g2().set_imageScaleQuality(1)},__class__:Li},n.$haxeUID|=0,x.Math=Math,null==String.fromCodePoint&&(String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55232+(e>>10))+String.fromCharCode(56320+(1023&e))}),String.prototype.__class__=x.String=String,String.__name__=!0,x.Array=Array,Array.__name__=!0,Date.prototype.__class__=x.Date=Date,Date.__name__="Date";var Fi={},Pi={},Mi=Number,Ri=Boolean,Oi={},Vi={};te.count=0;var Di={};Object.defineProperty(ft.prototype,"message",{get:function(){return String(this.val)}}),g.__toStr={}.toString,null==ArrayBuffer.prototype.slice&&(ArrayBuffer.prototype.slice=v.sliceImpl),nt.cwd="",ot.defaultWindowW=240,ot.windowW=ot.defaultWindowW,ot.coffX=160,ot.coffY=40,ot.currentOperation="",ot.assetNames=[""],ot.showFiles=!1,ot.foldersOnly=!1,ot.gridSnapBounds=!1,ot.gridSnapPos=!0,ot.gridUseRelative=!0,ot.useRotationSteps=!1,ot.gridSize=20,ot.rotationSteps=.261799386,ot.modalW=625,ot.modalH=545,ot.modalHeaderH=66,ot.modalRectW=625,ot.modalRectH=545,ot.path="/",X.isManipulating=!1,X.transformStartedMouse=!1,X.drag=!1,X.dragLeft=!1,X.dragTop=!1,X.dragRight=!1,X.dragBottom=!1,X.grab=!1,X.grabX=!1,X.grabY=!1,X.rotate=!1,At.global=new At,dt.hwin=At.global.nest(0,null),J.DEFAULT_RESOLVER=new a,J.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:",_.helper=new DataView(new ArrayBuffer(8)),gt.images=new S,gt.sounds=new E,gt.blobs=new B,gt.fonts=new k,gt.videos=new I,C.Black=-16777216,C.White=-1,C.Red=-65536,C.Blue=-16776961,C.Green=-16711936,C.Magenta=-65281,C.Yellow=-256,C.Cyan=-16711681,C.Purple=-8388480,C.Pink=-16181,C.Orange=-23296,C.Transparent=0,C.invMaxChannelValue=.00392156862745098,b.displays=[],N.Default=new N(!1,!1,!1),G.timeWarpSaveTime=10,G.DIF_COUNT=3,G.maxframetime=.5,G.startTime=0,z.painter_colored_fragData0="s580:AAAARFhCQwKRAhCE2jyY1lW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EBAAAAAAADYAAAVyABAAAAAAAEYSEAACAAAANgAABYIAEAAAAAAAAUAAAAAAgD8RAAAIEgAQAAEAAABGDhAAAAAAAEaOIAAAAAAAAgAAABEAAAgiABAAAQAAAEYOEAAAAAAARo4gAAAAAAADAAAAAAAABxIAEAABAAAAGgAQAAEAAAAKABAAAQAAADYAAAWCIBAAAgAAABoAEAABAAAAOAAAB0IgEAACAAAACgAQAAEAAAABQAAAAAAAPxEAAAgSIBAAAgAAAEYOEAAAAAAARo4gAAAAAAAAAAAAEQAACCIgEAACAAAARg4QAAAAAABGjiAAAAAAAAEAAAA%AAABU1RBVHQAAAAMAAAAAgAAAAAAAAAGAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",pt.renderListeners=[],pt.foregroundListeners=[],pt.resumeListeners=[],pt.pauseListeners=[],pt.backgroundListeners=[],pt.shutdownListeners=[],pt.dropFilesListeners=[],Q.maxGamepads=4,Q.mouseLockListeners=[],j.windows=[],Z.None=0,Z.FeatureResizable=1,Z.FeatureMinimizable=2,Z.FeatureMaximizable=4,Z.FeatureBorderless=8,Z.FeatureOnTop=16,de.disableGcInteractions=!1,de.intBox=new ue(0),_e.channelCount=32,_e.lastAllocationCount=0,ve.POLY=79764919,xe.INVALID_BITS=-1,Ee.EOP=-1,Ee.M__PI=3.141592653589793,Ee.DIVTAB_NUMER=32,Ee.DIVTAB_DENOM=64,Ee.INVERSE_DB_TABLE=[1.0649863e-7,1.1341951e-7,1.2079015e-7,1.2863978e-7,1.3699951e-7,1.4590251e-7,1.5538408e-7,1.6548181e-7,1.7623575e-7,1.8768855e-7,1.9988561e-7,2.128753e-7,2.2670913e-7,2.4144197e-7,2.5713223e-7,2.7384213e-7,2.9163793e-7,3.1059021e-7,3.3077411e-7,3.5226968e-7,3.7516214e-7,3.9954229e-7,4.255068e-7,4.5315863e-7,4.8260743e-7,5.1396998e-7,5.4737065e-7,5.8294187e-7,6.2082472e-7,6.6116941e-7,7.0413592e-7,7.4989464e-7,7.9862701e-7,8.505263e-7,9.0579828e-7,9.6466216e-7,10273513e-13,10941144e-13,11652161e-13,12409384e-13,13215816e-13,14074654e-13,14989305e-13,15963394e-13,17000785e-13,18105592e-13,19282195e-13,20535261e-13,21869758e-13,23290978e-13,24804557e-13,26416497e-13,2813319e-12,29961443e-13,31908506e-13,33982101e-13,36190449e-13,38542308e-13,41047004e-13,4371447e-12,46555282e-13,49580707e-13,5280274e-12,5623416e-12,59888572e-13,63780469e-13,67925283e-13,72339451e-13,77040476e-13,82047e-10,87378876e-13,93057248e-13,99104632e-13,10554501e-12,11240392e-12,11970856e-12,12748789e-12,13577278e-12,14459606e-12,15399272e-12,16400004e-12,17465768e-12,18600792e-12,19809576e-12,21096914e-12,22467911e-12,23928002e-12,25482978e-12,27139006e-12,28902651e-12,30780908e-12,32781225e-12,34911534e-12,37180282e-12,39596466e-12,42169667e-12,4491009e-11,47828601e-12,50936773e-12,54246931e-12,57772202e-12,61526565e-12,65524908e-12,69783085e-12,74317983e-12,79147585e-12,8429104e-11,89768747e-12,95602426e-12,.00010181521,.00010843174,.00011547824,.00012298267,.00013097477,.00013948625,.00014855085,.00015820453,.00016848555,.00017943469,.00019109536,.00020351382,.00021673929,.00023082423,.00024582449,.00026179955,.00027881276,.00029693158,.00031622787,.00033677814,.00035866388,.00038197188,.00040679456,.00043323036,.00046138411,.00049136745,.00052329927,.00055730621,.00059352311,.00063209358,.00067317058,716917e-9,.0007635063,.00081312324,.00086596457,.00092223983,.00098217216,.0010459992,.0011139742,.0011863665,.0012634633,.0013455702,.0014330129,.0015261382,.0016253153,.0017309374,.0018434235,.0019632195,.0020908006,.0022266726,.0023713743,.0025254795,.0026895994,.0028643847,.0030505286,.0032487691,.0034598925,.0036847358,.0039241906,.0041792066,.004450795,.0047400328,.0050480668,.0053761186,.0057254891,.0060975636,.0064938176,.0069158225,.0073652516,.0078438871,.0083536271,.0088964928,.009474637,.010090352,.01074608,.011444421,.012188144,.012980198,.013823725,.014722068,.015678791,.016697687,.017782797,.018938423,.020169149,.021479854,.022875735,.02436233,.025945531,.027631618,.029427276,.031339626,.033376252,.035545228,.037855157,.040315199,.042935108,.045725273,.048696758,.051861348,.055231591,.05882085,.062643361,.066714279,.071049749,.075666962,.080584227,.085821044,.091398179,.097337747,.1036633,.11039993,.11757434,.12521498,.13335215,.14201813,.15124727,.16107617,.1715438,.18269168,.19456402,.20720788,.22067342,.23501402,.25028656,.26655159,.28387361,.30232132,.32196786,.34289114,.36517414,.38890521,.41417847,.44109412,.4697589,.50028648,.53279791,.56742212,.6042964,.64356699,.68538959,.72993007,.77736504,.8278826,.88168307,.9389798,1],Be.NO_CODE=255,Be.delay=0,Ne.PACKET_ID=1,Ne.PACKET_COMMENT=3,Ne.PACKET_SETUP=5,De.CONTINUED_PACKET=1,De.FIRST_PAGE=2,De.LAST_PAGE=4,We.MAX_CHANNELS=16,We.PUSHDATA_CRC_COUNT=4,We.FAST_HUFFMAN_LENGTH=10,We.FAST_HUFFMAN_TABLE_SIZE=1024,We.FAST_HUFFMAN_TABLE_MASK=1023,Qe.fontGlyphs=function(){for(var e=[],t=32;t<256;){var i=t++;e.push(i)}return e}(),It.STBTT_vmove=1,It.STBTT_vline=2,It.STBTT_vcurve=3,It.STBTT_MACSTYLE_DONTCARE=0,It.STBTT_MACSTYLE_BOLD=1,It.STBTT_MACSTYLE_ITALIC=2,It.STBTT_MACSTYLE_UNDERSCORE=4,It.STBTT_MACSTYLE_NONE=8,It.STBTT_PLATFORM_ID_UNICODE=0,It.STBTT_PLATFORM_ID_MAC=1,It.STBTT_PLATFORM_ID_ISO=2,It.STBTT_PLATFORM_ID_MICROSOFT=3,It.STBTT_UNICODE_EID_UNICODE_1_0=0,It.STBTT_UNICODE_EID_UNICODE_1_1=1,It.STBTT_UNICODE_EID_ISO_10646=2,It.STBTT_UNICODE_EID_UNICODE_2_0_BMP=3,It.STBTT_UNICODE_EID_UNICODE_2_0_FULL=4,It.STBTT_MS_EID_SYMBOL=0,It.STBTT_MS_EID_UNICODE_BMP=1,It.STBTT_MS_EID_SHIFTJIS=2,It.STBTT_MS_EID_UNICODE_FULL=10,It.STBTT_MAC_EID_ROMAN=0,It.STBTT_MAC_EID_ARABIC=4,It.STBTT_MAC_EID_JAPANESE=1,It.STBTT_MAC_EID_HEBREW=5,It.STBTT_MAC_EID_CHINESE_TRAD=2,It.STBTT_MAC_EID_GREEK=6,It.STBTT_MAC_EID_KOREAN=3,It.STBTT_MAC_EID_RUSSIAN=7,It.STBTT_MS_LANG_ENGLISH=1033,It.STBTT_MS_LANG_ITALIAN=1040,It.STBTT_MS_LANG_CHINESE=2052,It.STBTT_MS_LANG_JAPANESE=1041,It.STBTT_MS_LANG_DUTCH=1043,It.STBTT_MS_LANG_KOREAN=1042,It.STBTT_MS_LANG_FRENCH=1036,It.STBTT_MS_LANG_RUSSIAN=1049,It.STBTT_MS_LANG_GERMAN=1031,It.STBTT_MS_LANG_SPANISH=1033,It.STBTT_MS_LANG_HEBREW=1037,It.STBTT_MS_LANG_SWEDISH=1053,It.STBTT_MAC_LANG_ENGLISH=0,It.STBTT_MAC_LANG_JAPANESE=11,It.STBTT_MAC_LANG_ARABIC=12,It.STBTT_MAC_LANG_KOREAN=23,It.STBTT_MAC_LANG_DUTCH=4,It.STBTT_MAC_LANG_RUSSIAN=32,It.STBTT_MAC_LANG_FRENCH=1,It.STBTT_MAC_LANG_SPANISH=6,It.STBTT_MAC_LANG_GERMAN=2,It.STBTT_MAC_LANG_SWEDISH=5,It.STBTT_MAC_LANG_HEBREW=10,It.STBTT_MAC_LANG_CHINESE_SIMPLIFIED=33,It.STBTT_MAC_LANG_ITALIAN=3,It.STBTT_MAC_LANG_CHINESE_TRAD=19,It.STBTT_MAX_OVERSAMPLE=8,It.STBTT_RASTERIZER_VERSION=2,Rt.bufferSize=1500,Rt.vertexSize=9,Ot.bufferSize=1e3,Ot.triangleBufferSize=1e3,Vt.bufferSize=1e3,Zt.__meta__={statics:{sendConnectEvent:{input:null},sendDisconnectEvent:{input:null}},fields:{sendAxisEvent:{input:null},sendButtonEvent:{input:null}}},Zt.instances=[],Zt.connectListeners=[],Zt.disconnectListeners=[],ei.__meta__={fields:{sendDownEvent:{input:null},sendUpEvent:{input:null},sendPressEvent:{input:null}}},ei.keyBehavior=$t.Default,ti.__meta__={fields:{sendLeaveEvent:{input:null},sendDownEvent:{input:null},sendUpEvent:{input:null},sendMoveEvent:{input:null},sendWheelEvent:{input:null}}},si.bufferSize=2e3,ai.mat=new Float32Array(16),li.width=3,li.height=3,ui.width=4,ui.height=4,di.width=3,di.height=3,_i.width=4,_i.height=4,vi.nextId=0,xi.START=0,xi.ENTITY_UPDATES=1,xi.CONTROLLER_UPDATES=2,xi.REMOTE_CALL=3,xi.PING=4,xi.SESSION_ERROR=5,xi.PLAYER_UPDATES=6,xi.RPC_SERVER=0,xi.RPC_ALL=1,Ti.nextId=0,Ti.objects=[],Ei.assetMap=new $,Ei.themes=[],Ei.events=[],Ei.screenW=-1,Ei.screenH=-1,Ei.locale="en",Ei.h=new At,Ei.elemId=-1,Ei.assetId=-1,Bi.dataPath="",Bi.lastPath="",Bi.kx=1,Bi.ky=.6666666666666666,Bi.kz=.3333333333333333,Bi.kw=3,Bi.ar=[0,0,0],Bi.Kx=0,Bi.Ky=-.3333333333333333,Bi.Kz=.6666666666666666,Bi.Kw=-1,Bi.e=1e-10,ki.i=0,Ii.show=!1,Ii.hwnd=new At,Ii.boxTitle="",Ii.boxText="",Ii.modalX=0,Ii.modalY=0,Ii.modalW=400,Ii.modalH=160,Ci.dark={NAME:"Default Dark",FONT_SIZE:13,ELEMENT_W:100,ELEMENT_H:24,ELEMENT_OFFSET:4,ARROW_SIZE:5,BUTTON_H:22,CHECK_SIZE:15,CHECK_SELECT_SIZE:8,SCROLL_W:6,TEXT_OFFSET:8,TAB_W:12,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-13421773,WINDOW_TINT_COL:-1,ACCENT_COL:-12303292,ACCENT_HOVER_COL:-11974327,ACCENT_SELECT_COL:-10461088,BUTTON_COL:-12171706,BUTTON_TEXT_COL:-1513499,BUTTON_HOVER_COL:-11974327,BUTTON_PRESSED_COL:-15000805,TEXT_COL:-1513499,LABEL_COL:-3618616,SEPARATOR_COL:-14211289,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-14540254},Ci.light={NAME:"Default Light",FONT_SIZE:26,ELEMENT_W:200,ELEMENT_H:48,ELEMENT_OFFSET:8,ARROW_SIZE:10,BUTTON_H:44,CHECK_SIZE:30,CHECK_SELECT_SIZE:16,SCROLL_W:12,TEXT_OFFSET:16,TAB_W:24,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-1052689,WINDOW_TINT_COL:-14540254,ACCENT_COL:-1118482,ACCENT_HOVER_COL:-4473925,ACCENT_SELECT_COL:-5592406,BUTTON_COL:-3355444,BUTTON_TEXT_COL:-14540254,BUTTON_HOVER_COL:-5000269,BUTTON_PRESSED_COL:-5131855,TEXT_COL:-6710887,LABEL_COL:-5592406,SEPARATOR_COL:-6710887,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-5592406},Li.alwaysRedrawWindow=!0,Li.keyRepeat=!0,Li.keyRepeatTime=0,Li.textToPaste="",Li.textToCopy="",Li.isCut=!1,Li.isCopy=!1,Li.isPaste=!1,Li.copyFrame=0,Li.comboFirst=!0,nt.main()}("undefined"!=typeof exports?exports:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this); \ No newline at end of file diff --git a/armory2d/opengl/krom.js b/armory2d/opengl/krom.js index 361def6..ac961fc 100644 --- a/armory2d/opengl/krom.js +++ b/armory2d/opengl/krom.js @@ -1 +1 @@ -!function(e,n){"use strict";e.kha=e.kha||{},e.kha.input=e.kha.input||{};function i(){return g.__string_rec(this,"")}var t,T={},p=p||{};function r(e,t){var i=Object.create(e);for(var n in t)i[n]=t[n];return t.toString!==Object.prototype.toString&&(i.toString=t.toString),i}function it(){}(T.HxOverrides=it).__name__=!0,it.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;case 10:var n=e.split("-");return new Date(n[0],n[1]-1,n[2],0,0,0);case 19:var r=e.split(" "),s=r[0].split("-"),a=r[1].split(":");return new Date(s[0],s[1]-1,s[2],a[0],a[1],a[2]);default:throw new pt("Invalid date format : "+e)}},it.cca=function(e,t){var i=e.charCodeAt(t);if(i==i)return i},it.substr=function(e,t,i){if(null==i)i=e.length;else if(i<0){if(0!=t)return"";i=e.length+i}return e.substr(t,i)},it.remove=function(e,t){var i=e.indexOf(t);return-1!=i&&(e.splice(i,1),!0)},it.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.cury.get_primary().get_width()&&(e=y.get_primary().get_width()),t>y.get_primary().get_height()-30&&(t=y.get_primary().get_height()-30)),mt.start(new Y("Armory2D",e,t,null,new M(null,null,null,null,null,2)),nt.initialized)},nt.initialized=function(e){nt.prefs={path:"",scaleFactor:1,keyMap:{selectMouseButton:"Left",grabKey:71,rotateKey:82,sizeKey:83,slowMovement:16,gridInvert:17,gridInvertRelative:18}};var t=Krom.getArgCount();if(4r&&this.ui.inputXthis.get_toolbarw()&&(this.selectedFrame=(this.ui.inputX-this.get_toolbarw())/11/this.ui.ops.scaleFactor|0)}X.update(this.ui,this.cui,this.canvas),Ei.show&&Ei.update(),this.updateFiles()}},updateCanvas:function(){if(!(ot.showFiles||this.ui.inputX>mt.windowWidth()-ot.get_uiw())){if(X.selectElement(this.canvas),!X.isManipulating&&(this.ui.inputDownR&&(ot.coffX+=0|this.ui.inputDX,ot.coffY+=0|this.ui.inputDY),0!=this.ui.inputWheelDelta)){var e=this.zoom;this.zoom+=-this.ui.inputWheelDelta/10,this.zoom<.4?this.zoom=.4:1n||this.ui.inputYs)&&(ot.showFiles=!1)}},renderFiles:function(e){var t=mt.windowWidth(),i=mt.windowHeight(),n=t/2-ot.modalW/2,r=i/2-ot.modalH/2;e.begin(!1),e.set_color(-14671840),e.fillRect(n,r,ot.modalW,ot.modalH),e.end();var s=t/2-ot.modalRectW/2|0,a=t/2+ot.modalRectW/2|0,o=i/2-ot.modalRectH/2|0,l=i/2+ot.modalRectH/2|0;if(o+=ot.modalHeaderH,this.uimodal.begin(e),this.uimodal.window(dt.global.nest(63,null),s,o,ot.modalRectW,ot.modalRectH-100)){var u=dt.global.nest(64,null);u.text=this.uimodal.textInput(u),ot.path=Ci.fileBrowser(this.uimodal,u,ot.foldersOnly)}this.uimodal.end(!1),e.begin(!1),this.uimodal.beginRegion(e,a-100,l-30,100),this.uimodal.button("OK")&&(ot.showFiles=!1,ot.filesDone(ot.path)),this.uimodal.endRegion(!1),this.uimodal.beginRegion(e,a-200,l-30,100),this.uimodal.button("Cancel")&&(ot.showFiles=!1),this.uimodal.endRegion(),e.end()},scaled:function(e){return e*this.cui.ops.scaleFactor|0},__class__:ot,__properties__:{get_toolbarw:"get_toolbarw"}};var X=function(){};(T["arm2d.ElementController"]=X).__name__=!0,X.__properties__={get_handleSize:"get_handleSize"},X.get_handleSize=function(){return 8*X.ui.ops.scaleFactor|0},X.initialize=function(e,t){X.ui=e,X.cui=t},X.selectElement=function(e){if(null!=X.ui){var t=nt.prefs.keyMap.selectMouseButton;if("Left"==t&&X.ui.inputStarted&&X.ui.inputDown||"Right"==t&&X.ui.inputStartedR&&X.ui.inputDownR){var i=ot.selectedElem;ot.selectedElem=null;var n=e.elements.slice();n.reverse();for(var r=0;rf&&u.xp&&u.yi.x+s+o-(8*X.ui.ops.scaleFactor|0)?X.dragRight=!0:u.xi.y+a+l-(8*X.ui.ops.scaleFactor|0)?X.dragBottom=!0:u.y=n.length);)if(n[r].parent==s){it.remove(n,t),n.splice(r,0,t);break}},ht.removeElem=function(e,t){if(null!=t.children)for(var i=0,n=t.children;it&&o.xi&&o.y=this.length)throw new pt("Invalid object");if(103==this.buf.charCodeAt(this.pos))break;var t=this.unserialize();if("string"!=typeof t)throw new pt("Invalid object key");var i=this.unserialize();e[t]=i}this.pos++},unserializeEnum:function(e,t){if(58!=this.buf.charCodeAt(this.pos++))throw new pt("Invalid enum format");var i=this.readDigits();if(0==i)return S.createEnum(e,t);for(var n=[];0=this.scache.length)throw new pt("Invalid string reference");return this.scache[u];case 97:this.buf;var h=[];for(this.cache.push(h);;){var c=this.buf.charCodeAt(this.pos);if(104==c){this.pos++;break}if(117==c){this.pos++;var d=this.readDigits();h[h.length+d-1]=null}else h.push(this.unserialize())}return h;case 98:var _=new ie;this.cache.push(_);for(this.buf;104!=this.buf.charCodeAt(this.pos);){var f=this.unserialize(),p=this.unserialize();null!=Di[f]?_.setReserved(f,p):_.h[f]=p}return this.pos++,_;case 99:var g=this.unserialize(),m=this.resolver.resolveClass(g);if(null==m)throw new pt("Class not found "+g);var v=Object.create(m.prototype);return this.cache.push(v),this.unserializeObject(v),v;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:var b=this.unserialize(),w=this.resolver.resolveEnum(b);if(null==w)throw new pt("Enum not found "+b);this.pos++;var y=this.readDigits(),x=w.__constructs__.slice()[y];if(null==x)throw new pt("Unknown enum index "+b+"@"+y);var T=this.unserializeEnum(w,x);return this.cache.push(T),T;case 107:return NaN;case 108:var S=new ee;this.cache.push(S);for(this.buf;104!=this.buf.charCodeAt(this.pos);)S.add(this.unserialize());return this.pos++,S;case 109:return-1/0;case 110:return null;case 111:var k={};return this.cache.push(k),this.unserializeObject(k),k;case 112:return 1/0;case 113:var I=new $;this.cache.push(I);this.buf;for(var C=this.buf.charCodeAt(this.pos++);58==C;){var B=this.readDigits(),E=this.unserialize();I.h[B]=E,C=this.buf.charCodeAt(this.pos++)}if(104!=C)throw new pt("Invalid IntMap format");return I;case 114:var N=this.readDigits();if(N<0||N>=this.cache.length)throw new pt("Invalid reference");return this.cache[N];case 115:var L=this.readDigits(),F=this.buf;if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>2)+(2<=P?P-1:0))),V=0;M>4;var H=A[F.charCodeAt(M++)];O.b[V++]=U<<4|H>>2;var W=A[F.charCodeAt(M++)];O.b[V++]=H<<6|W}if(2<=P){var G=A[F.charCodeAt(M++)],z=A[F.charCodeAt(M++)];if(O.b[V++]=G<<2|z>>4,3==P){var X=A[F.charCodeAt(M++)];O.b[V++]=z<<4|X>>2}}return this.pos+=L,this.cache.push(O),O;case 116:return!0;case 118:var K;return 48<=this.buf.charCodeAt(this.pos)&&this.buf.charCodeAt(this.pos)<=57&&48<=this.buf.charCodeAt(this.pos+1)&&this.buf.charCodeAt(this.pos+1)<=57&&48<=this.buf.charCodeAt(this.pos+2)&&this.buf.charCodeAt(this.pos+2)<=57&&48<=this.buf.charCodeAt(this.pos+3)&&this.buf.charCodeAt(this.pos+3)<=57&&45==this.buf.charCodeAt(this.pos+4)?(K=it.strDate(it.substr(this.buf,this.pos,19)),this.pos+=19):K=new Date(this.readFloat()),this.cache.push(K),K;case 119:var Y=this.unserialize(),Z=this.resolver.resolveEnum(Y);if(null==Z)throw new pt("Enum not found "+Y);var j=this.unserializeEnum(Z,this.unserialize());return this.cache.push(j),j;case 120:throw pt.wrap(this.unserialize());case 121:var q=this.readDigits();if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>8}return new he(i.buffer)}for(var o=[],l=0;l>6):(u<=65535?o.push(224|u>>12):(o.push(240|u>>18),o.push(128|u>>12&63)),o.push(128|u>>6&63)),o.push(128|63&u))}return new he(new Uint8Array(o).buffer)},he.ofData=function(e){var t=e.hxBytes;return null!=t?t:new he(e)},he.prototype={length:null,b:null,data:null,blit:function(e,t,i,n){if(e<0||i<0||n<0||e+n>this.length||i+n>t.length)throw new pt(_.OutsideBounds);0==i&&n==t.b.byteLength?this.b.set(t.b,e):this.b.set(t.b.subarray(i,i+n),e)},sub:function(e,t){if(e<0||t<0||e+t>this.length)throw new pt(_.OutsideBounds);return new he(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getDouble:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat64(e,!0)},getFloat:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat32(e,!0)},setDouble:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat64(e,t,!0)},setFloat:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat32(e,t,!0)},getUInt16:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getUint16(e,!0)},getInt32:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getInt32(e,!0)},setInt32:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setInt32(e,t,!0)},getString:function(e,t,i){if(e<0||t<0||e+t>this.length)throw new pt(_.OutsideBounds);null==i&&(i=d.UTF8);var n="",r=this.b,s=e,a=e+t;switch(i._hx_index){case 0:for(;se.length)throw new pt(_.OutsideBounds);if(this.pos+i>this.size&&this.grow(i),0!=this.size){var n=new Uint8Array(e.b.buffer,e.b.byteOffset+t,i);this.u8.set(n,this.pos),this.pos+=i}},grow:function(e){for(var t=this.pos+e,i=0==this.size?16:this.size;i>1;var n=new ArrayBuffer(i),r=new Uint8Array(n);0e.length)throw new pt(_.OutsideBounds);try{for(;0e.length)throw new pt(_.OutsideBounds);this.b=e.b,this.pos=t,this.len=i,this.totlen=i}(T["haxe.io.BytesInput"]=ce).__name__=!0,ce.__super__=h,ce.prototype=r(h.prototype,{b:null,pos:null,len:null,totlen:null,set_position:function(e){return e<0?e=0:e>this.totlen&&(e=this.totlen),this.len=this.totlen-e,this.pos=e},readByte:function(){if(0==this.len)throw new pt(new v);return this.len--,this.b[this.pos++]},readBytes:function(e,t,i){if(t<0||i<0||t+i>e.length)throw new pt(_.OutsideBounds);if(0==this.len&&0e.length)throw new pt(_.OutsideBounds);for(var n=e.b,r=i;0>>24),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)):(this.writeByte(255&e),this.writeByte(e>>8&255),this.writeByte(e>>16&255),this.writeByte(e>>>24))},__class__:c};function de(){this.b=new u}(T["haxe.io.BytesOutput"]=de).__name__=!0,de.__super__=c,de.prototype=r(c.prototype,{b:null,writeByte:function(e){this.b.addByte(e)},writeBytes:function(e,t,i){return this.b.addBytes(e,t,i),i},getBytes:function(){return this.b.getBytes()},__class__:de});var d=p["haxe.io.Encoding"]={__ename__:!0,__constructs__:["UTF8","RawNative"],UTF8:{_hx_index:0,__enum__:"haxe.io.Encoding",toString:i},RawNative:{_hx_index:1,__enum__:"haxe.io.Encoding",toString:i}},v=function(){};(T["haxe.io.Eof"]=v).__name__=!0,v.prototype={toString:function(){return"Eof"},__class__:v};var _=p["haxe.io.Error"]={__ename__:!0,__constructs__:["Blocked","Overflow","OutsideBounds","Custom"],Blocked:{_hx_index:0,__enum__:"haxe.io.Error",toString:i},Overflow:{_hx_index:1,__enum__:"haxe.io.Error",toString:i},OutsideBounds:{_hx_index:2,__enum__:"haxe.io.Error",toString:i},Custom:((t=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:i}}).__params__=["e"],t)},f=function(){};(T["haxe.io.FPHelper"]=f).__name__=!0,f.floatToI32=function(e){return f.helper.setFloat32(0,e,!0),f.helper.getInt32(0,!0)};var ft=function(e){switch(e){case".":case"..":return this.dir=e,void(this.file="")}var t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t";var e=typeof r;switch("function"==e&&(r.__name__||r.__ename__)&&(e="object"),e){case"function":return"";case"object":if(r.__enum__){var t=p[r.__enum__],i=t.__constructs__[r._hx_index],a=t[i];return a.__params__?(s+="\t",i+"("+function(){for(var e=[],t=0,i=a.__params__;t>>16},N.get_Gb=function(e){return(65280&e)>>>8},N.get_Bb=function(e){return 255&e},N.get_Ab=function(e){return e>>>24},N.set_Rb=function(e,t){return e=e>>>24<<24|t<<16|(65280&e)>>>8<<8|255&e,t},N.set_Gb=function(e,t){return e=e>>>24<<24|(16711680&e)>>>16<<16|t<<8|255&e,t},N.set_Bb=function(e,t){return e=e>>>24<<24|(16711680&e)>>>16<<16|(65280&e)>>>8<<8|t,t},N.set_Ab=function(e,t){return e=t<<24|(16711680&e)>>>16<<16|(65280&e)>>>8<<8|255&e,t},N.get_R=function(e){return.00392156862745098*((16711680&e)>>>16)},N.get_G=function(e){return.00392156862745098*((65280&e)>>>8)},N.get_B=function(e){return.00392156862745098*(255&e)},N.get_A=function(e){return.00392156862745098*(e>>>24)},N.set_R=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(255*t|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|.00392156862745098*(255&e)*255|0,t},N.set_G=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(255*t|0)<<8|.00392156862745098*(255&e)*255|0,t},N.set_B=function(e,t){return e=(.00392156862745098*(e>>>24)*255|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|255*t|0,t},N.set_A=function(e,t){return e=(255*t|0)<<24|(.00392156862745098*((16711680&e)>>>16)*255|0)<<16|(.00392156862745098*((65280&e)>>>8)*255|0)<<8|.00392156862745098*(255&e)*255|0,t};var y=function(e,t){this.num=e,this.isPrimary=t};(T["kha.Display"]=y).__name__=!0,y.__properties__={get_all:"get_all",get_primary:"get_primary"},y.init=function(){for(var e=0,t=Krom.displayCount();e=this.chars.length)return null;var r=1/this.width,s=1/this.height,a=this.chars[t];if(null==a)return null;var o=Math.round(i+a.xoff),l=Math.round(n+a.yoff);return e.x0=o,e.y0=l,e.x1=o+a.x1-a.x0,e.y1=l+a.y1-a.y0,e.s0=a.x0*r,e.t0=a.y0*s,e.s1=a.x1*r,e.t1=a.y1*s,e.xadvance=a.xadvance,e},getCharWidth:function(e){if(0==this.chars.length)return 0;var t=V.charBlocks[0];if(e=this.chars.length?this.chars[0].xadvance:this.chars[e-t].xadvance},getHeight:function(){return this.mySize},stringWidth:function(e){for(var t=0,i=0,n=e.length;i=e)n.next=n.start;else if(0=e&&G.timeTasksScratchpad.push(n)}for(var r=0,s=G.timeTasksScratchpad;rG.lastTime&&(G.startTime-=e-G.lastTime,G.current=e,G.lastTime=e,G.executeTimeTasks(e))},G.executeFrame=function(){var e=G.realTime()-G.startTime-G.lastTime,t=G.current;if(0<=e){if(null==Ti.the())if(e>G.maxframetime)G.startTime+=e-G.maxframetime,t+=e=G.maxframetime;else if(G.vsync){for(var i=G.onedifhz;i=G.activeTimeTask.start+G.activeTimeTask.next)?G.insertSorted(G.timeTasks,G.activeTimeTask):G.archiveTimeTask(G.activeTimeTask,e):(G.activeTimeTask.active=!1,G.archiveTimeTask(G.activeTimeTask,e));G.activeTimeTask=null},G.archiveTimeTask=function(e,t){},G.time=function(){return G.current},G.realTime=function(){return mt.get_time()},G.resetTime=function(){var e=mt.get_time(),t=e-G.startTime;G.startTime=e;for(var i=0,n=G.timeTasks;it.next)return void e.splice(r,0,t)}e.push(t)},G.sortFrameTasks=function(){G.frame_tasks_sorted||(G.frameTasks.sort(function(e,t){return e.priority>t.priority?1:e.priority=this.getLength()},unload:function(){},__class__:j,__properties__:{set_position:"set_position",get_position:"get_position"}};var q=function(e){this.num=e,q.windows.push(this)};(T["kha.Window"]=q).__name__=!0,q.__properties__={get_all:"get_all"},q.create=function(e,t){return null},q.destroy=function(e){},q.get=function(e){return q.windows[e]},q.get_all=function(){return q.windows},q.prototype={num:null,windowTitle:null,resize:function(e,t){},move:function(e,t){},changeWindowFeatures:function(e){},changeFramebuffer:function(e){},get_x:function(){return 0},set_x:function(e){return 0},get_y:function(){return 0},set_y:function(e){return 0},get_width:function(){return Krom.windowWidth(this.num)},set_width:function(e){return 800},get_height:function(){return Krom.windowHeight(this.num)},set_height:function(e){return 600},get_mode:function(){return 0},set_mode:function(e){return 0},get_visible:function(){return!0},set_visible:function(e){return!0},get_title:function(){return this.windowTitle},set_title:function(e){return Krom.setWindowTitle(this.num,e),this.windowTitle=e,this.windowTitle},notifyOnResize:function(e){},get_vSynced:function(){return!0},__class__:q,__properties__:{get_vSynced:"get_vSynced",set_title:"set_title",get_title:"get_title",set_visible:"set_visible",get_visible:"get_visible",set_mode:"set_mode",get_mode:"get_mode",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}};var Q={};(T["kha._WindowOptions.WindowFeatures_Impl_"]=Q).__name__=!0,Q._new=function(e){return e};var ne=function(e,t,i,n,r,s,a,o,l){null==l&&(l=0),null==a&&(a=!0),null==s&&(s=-1),null==r&&(r=600),null==n&&(n=800),null==i&&(i=-1),null==t&&(t=-1),this.mode=0,this.windowFeatures=7,this.visible=!0,this.display=-1,this.height=600,this.width=800,this.y=-1,this.x=-1,this.title=null,this.title=e,this.x=t,this.y=i,this.width=n,this.height=r,this.display=s,this.visible=a,this.windowFeatures=null==o?7:o,this.mode=l};(T["kha.WindowOptions"]=ne).__name__=!0,ne.prototype={title:null,x:null,y:null,width:null,height:null,display:null,visible:null,windowFeatures:null,mode:null,__class__:ne};var re={};(T["kha.arrays._Float32Array.Float32Array_Impl_"]=re).__name__=!0,re.__properties__={get_length:"get_length",get_buffer:"get_buffer"},re._new=function(e){return new Float32Array(e)},re.get_buffer=function(e){return e.buffer},re.get_length=function(e){return e.length},re.set=function(e,t,i){return e[t]=i},re.get=function(e,t){return e[t]},re.data=function(e){return e},re.subarray=function(e,t,i){return e.subarray(t,i)};var se={};(T["kha.arrays._Int16Array.Int16Array_Impl_"]=se).__name__=!0,se.__properties__={get_length:"get_length"},se._new=function(e){return new Int16Array(e)},se.get_length=function(e){return e.length},se.set=function(e,t,i){return e[t]=i},se.get=function(e,t){return e[t]},se.data=function(e){return e},se.arrayRead=function(e,t){return e[t]},se.arrayWrite=function(e,t,i){return e[t]=i},se.subarray=function(e,t,i){return e.subarray(t,i)};var ae={};(T["kha.arrays._Int32Array.Int32Array_Impl_"]=ae).__name__=!0,ae.__properties__={get_length:"get_length"},ae._new=function(e){return new Int32Array(e)},ae.get_length=function(e){return e.length},ae.set=function(e,t,i){return e[t]=i},ae.get=function(e,t){return e[t]},ae.data=function(e){return e},ae.arrayRead=function(e,t){return e[t]},ae.arrayWrite=function(e,t,i){return e[t]=i},ae.subarray=function(e,t,i){return e.subarray(t,i)};var oe={};(T["kha.arrays._Uint32Array.Uint32Array_Impl_"]=oe).__name__=!0,oe.__properties__={get_length:"get_length"},oe._new=function(e){return new Uint32Array(e)},oe.get_length=function(e){return e.length},oe.set=function(e,t,i){return e[t]=i},oe.get=function(e,t){return e[t]},oe.data=function(e){return e},oe.arrayRead=function(e,t){return e[t]},oe.arrayWrite=function(e,t,i){return e[t]=i},oe.subarray=function(e,t,i){return e.subarray(t,i)};function le(){}(T["kha.audio1.AudioChannel"]=le).__name__=!0,le.__isInterface__=!0,le.prototype={play:null,pause:null,stop:null,length:null,get_length:null,get_position:null,set_position:null,get_volume:null,set_volume:null,finished:null,get_finished:null,__class__:le,__properties__:{get_finished:"get_finished",set_volume:"set_volume",get_volume:"get_volume",set_position:"set_position",get_position:"get_position",get_length:"get_length"}};function ue(e){this.value=e}(T["kha.internal.IntBox"]=ue).__name__=!0,ue.prototype={value:null,__class__:ue};var _e=function(){};(T["kha.audio2.Audio"]=_e).__name__=!0,_e._init=function(){_e.buffer=new ge(8192,2,44100),_e.samplesPerSecond=44100},_e._callCallback=function(e){if(null!=_e.buffer)if(null!=_e.audioCallback)_e.intBox.value=e,_e.audioCallback(_e.intBox,_e.buffer);else for(var t=0,i=e;t=_e.buffer.size&&(_e.buffer.writeLocation=0)}},_e._readSample=function(){if(null==_e.buffer)return 0;var e=_e.buffer.data[_e.buffer.readLocation];return _e.buffer.readLocation+=1,_e.buffer.readLocation>=_e.buffer.size&&(_e.buffer.readLocation=0),e},_e.play=function(e,t){return null==t&&(t=!1),null},_e.stream=function(e,t){return null==t&&(t=!1),null};var fe=function(){};(T["kha.audio2.Audio1"]=fe).__name__=!0,fe._init=function(){var e=new Array(32);fe.soundChannels=e;var t=new Array(32);fe.streamChannels=t;var i=new Array(32);fe.internalSoundChannels=i;var n=new Array(32);fe.internalStreamChannels=n;var r=new Float32Array(512);fe.sampleCache1=r;var s=new Float32Array(512);fe.sampleCache2=s,fe.lastAllocationCount=0,_e.audioCallback=fe.mix},fe.max=function(e,t){return t=t.size&&(t.writeLocation=0)}return fe.lastAllocationCount=0,void(_e.disableGcInteractions=!1)}var s=new Float32Array(2*i);fe.sampleCache1=s;var a=new Float32Array(2*i);fe.sampleCache2=a,fe.lastAllocationCount=0}else 100=t.size&&(t.writeLocation=0)}},fe.play=function(e,t){null==t&&(t=!1);var i=null;(i=_e.samplesPerSecond!=e.sampleRate?new me(t,e.sampleRate):new pe(t)).data=e.uncompressedData;for(var n=!1,r=0;r<32;){var s=r++;if(null==fe.soundChannels[s]||fe.soundChannels[s].get_finished()){fe.soundChannels[s]=i,n=!0;break}}return n?i:null},fe._playAgain=function(e){for(var t=0;t<32;){var i=t++;fe.soundChannels[i]==e&&(fe.soundChannels[i]=null)}for(var n=0;n<32;){var r=n++;if(null==fe.soundChannels[r]||fe.soundChannels[r].get_finished()||fe.soundChannels[r]==e){fe.soundChannels[r]=e;break}}},fe.stream=function(e,t){null==t&&(t=!1);var i=_e.stream(e,t);if(null!=i)return i;for(var n=new ve(e.compressedData,t),r=!1,s=0;s<32;){var a=s++;if(null==fe.streamChannels[a]||fe.streamChannels[a].get_finished()){fe.streamChannels[a]=n,r=!0;break}}return r?n:null};var pe=function(e){this.looping=!1,this.stopped=!1,this.paused=!1,this.myPosition=0,this.myVolume=1,this.data=null,this.looping=e};(T["kha.audio2.AudioChannel"]=pe).__name__=!0,pe.__interfaces__=[le],pe.max=function(e,t){return t=this.data.length&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s=(N%2==0?N:N+1)&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s>>24]};function we(){}(T["kha.audio2.ogg.tools.MathTools"]=we).__name__=!0,we.ilog=function(e){var t=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];return e<16384?e<16?t[e]:e<512?5+t[e>>5]:10+t[e>>10]:e<16777216?e<524288?15+t[e>>15]:20+t[e>>20]:e<536870912?25+t[e>>25]:e<-2147483648?30+t[e>>30]:0};function ye(){}(T["kha.audio2.ogg.tools.Mdct"]=ye).__name__=!0,ye.inverseTransform=function(e,t,i,n,r,s){for(var a=t>>1,o=t>>2,l=t>>3,u=new Array(a),h=a-2,c=0,d=0,_=a;d!=_;)u[h+1]=e[d]*i[c]-e[d+2]*i[c+1],u[h]=e[d]*i[c+1]+e[d+2]*i[c],h-=2,c+=2,d+=4;for(d=a-3;0<=h;)u[h+1]=-e[d+2]*i[c]- -e[d]*i[c+1],u[h]=-e[d+2]*i[c+1]+-e[d]*i[c],h-=2,c+=2,d-=4;for(var f=e,p=u,g=a-8,m=o,v=0,b=o,w=0;0<=g;){var y=p[m+1]-p[v+1],x=p[m]-p[v];f[b+1]=p[m+1]+p[v+1],f[b]=p[m]+p[v],f[w+1]=y*i[g+4]-x*i[g+5],f[w]=x*i[g+4]+y*i[g+5],y=p[m+3]-p[v+3],x=p[m+2]-p[v+2],f[b+3]=p[m+3]+p[v+3],f[b+2]=p[m+2]+p[v+2],f[w+3]=y*i[g]-x*i[g+1],f[w+2]=x*i[g]+y*i[g+1],g-=8,b+=4,w+=4,m+=4,v+=4}for(var T=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],S=(t<16384?t<16?T[t]:t<512?5+T[t>>5]:10+T[t>>10]:t<16777216?t<524288?15+T[t>>15]:20+T[t>>20]:t<536870912?25+T[t>>25]:t<-2147483648?30+T[t>>30]:0)-1,k=a-1-0*o,I=k,C=k-(t>>3),B=0,E=1+(t>>4>>2);0<--E;){var N=f[I]-f[C],L=f[I+-1]-f[C+-1];f[I]=f[I]+f[C];var F=I+-1;f[F]=f[F]+f[C+-1],f[C]=N*i[B]-L*i[B+1],f[C+-1]=L*i[B]+N*i[B+1],B+=8,N=f[I+-2]-f[C+-2],L=f[I+-3]-f[C+-3];var A=I+-2;f[A]=f[A]+f[C+-2];var M=I+-3;f[M]=f[M]+f[C+-3],f[C+-2]=N*i[B]-L*i[B+1],f[C+-3]=L*i[B]+N*i[B+1],B+=8,N=f[I+-4]-f[C+-4],L=f[I+-5]-f[C+-5];var P=I+-4;f[P]=f[P]+f[C+-4];var R=I+-5;f[R]=f[R]+f[C+-5],f[C+-4]=N*i[B]-L*i[B+1],f[C+-5]=L*i[B]+N*i[B+1],B+=8,N=f[I+-6]-f[C+-6],L=f[I+-7]-f[C+-7];var O=I+-6;f[O]=f[O]+f[C+-6];var V=I+-7;f[V]=f[V]+f[C+-7],f[C+-6]=N*i[B]-L*i[B+1],f[C+-7]=L*i[B]+N*i[B+1],B+=8,I-=8,C-=8}for(var D=a-1-o,U=D,H=D-(t>>3),W=0,G=1+(t>>4>>2);0<--G;){var z=f[U]-f[H],X=f[U+-1]-f[H+-1];f[U]=f[U]+f[H];var K=U+-1;f[K]=f[K]+f[H+-1],f[H]=z*i[W]-X*i[W+1],f[H+-1]=X*i[W]+z*i[W+1],W+=8,z=f[U+-2]-f[H+-2],X=f[U+-3]-f[H+-3];var Y=U+-2;f[Y]=f[Y]+f[H+-2];var Z=U+-3;f[Z]=f[Z]+f[H+-3],f[H+-2]=z*i[W]-X*i[W+1],f[H+-3]=X*i[W]+z*i[W+1],W+=8,z=f[U+-4]-f[H+-4],X=f[U+-5]-f[H+-5];var j=U+-4;f[j]=f[j]+f[H+-4];var q=U+-5;f[q]=f[q]+f[H+-5],f[H+-4]=z*i[W]-X*i[W+1],f[H+-5]=X*i[W]+z*i[W+1],W+=8,z=f[U+-6]-f[H+-6],X=f[U+-7]-f[H+-7];var Q=U+-6;f[Q]=f[Q]+f[H+-6];var J=U+-7;f[J]=f[J]+f[H+-7],f[H+-6]=z*i[W]-X*i[W+1],f[H+-7]=X*i[W]+z*i[W+1],W+=8,U-=8,H-=8}for(var $=a-1-0*l,ee=0,te=$,ie=$-(t>>4),ne=1+(t>>5>>2);0<--ne;){var re=f[te]-f[ie],se=f[te+-1]-f[ie+-1];f[te]=f[te]+f[ie];var ae=te+-1;f[ae]=f[ae]+f[ie+-1],f[ie]=re*i[ee]-se*i[ee+1],f[ie+-1]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-2]-f[ie+-2],se=f[te+-3]-f[ie+-3];var oe=te+-2;f[oe]=f[oe]+f[ie+-2];var le=te+-3;f[le]=f[le]+f[ie+-3],f[ie+-2]=re*i[ee]-se*i[ee+1],f[ie+-3]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-4]-f[ie+-4],se=f[te+-5]-f[ie+-5];var ue=te+-4;f[ue]=f[ue]+f[ie+-4];var he=te+-5;f[he]=f[he]+f[ie+-5],f[ie+-4]=re*i[ee]-se*i[ee+1],f[ie+-5]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-6]-f[ie+-6],se=f[te+-7]-f[ie+-7];var ce=te+-6;f[ce]=f[ce]+f[ie+-6];var de=te+-7;f[de]=f[de]+f[ie+-7],f[ie+-6]=re*i[ee]-se*i[ee+1],f[ie+-7]=se*i[ee]+re*i[ee+1],te-=8,ie-=8,ee+=16}for(var _e=a-1-l,fe=0,pe=_e,ge=_e-(t>>4),me=1+(t>>5>>2);0<--me;){var ve=f[pe]-f[ge],be=f[pe+-1]-f[ge+-1];f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]=h*r[o]+u*r[o+1],o+=8,u=t[s+-6]-t[a+-6],h=t[s+-7]-t[a+-7];var g=s+-6;t[g]=t[g]+t[a+-6];var m=s+-7;t[m]=t[m]+t[a+-7],t[a+-6]=u*r[o]-h*r[o+1],t[a+-7]=h*r[o]+u*r[o+1],o+=8,s-=8,a-=8}},ye.step3InnerRLoop=function(e,t,i,n,r,s){for(var a=0,o=i,l=i+n,u=1+(e>>2);0<--u;){var h=t[o]-t[l],c=t[o+-1]-t[l+-1];t[o]=t[o]+t[l];var d=o+-1;t[d]=t[d]+t[l+-1],t[l]=h*r[a]-c*r[a+1],t[l+-1]=c*r[a]+h*r[a+1],a+=s,h=t[o+-2]-t[l+-2],c=t[o+-3]-t[l+-3];var _=o+-2;t[_]=t[_]+t[l+-2];var f=o+-3;t[f]=t[f]+t[l+-3],t[l+-2]=h*r[a]-c*r[a+1],t[l+-3]=c*r[a]+h*r[a+1],a+=s,h=t[o+-4]-t[l+-4],c=t[o+-5]-t[l+-5];var p=o+-4;t[p]=t[p]+t[l+-4];var g=o+-5;t[g]=t[g]+t[l+-5],t[l+-4]=h*r[a]-c*r[a+1],t[l+-5]=c*r[a]+h*r[a+1],a+=s,h=t[o+-6]-t[l+-6],c=t[o+-7]-t[l+-7];var m=o+-6;t[m]=t[m]+t[l+-6];var v=o+-7;t[v]=t[v]+t[l+-7],t[l+-6]=h*r[a]-c*r[a+1],t[l+-7]=c*r[a]+h*r[a+1],o-=8,l-=8,a+=s}},ye.step3InnerSLoop=function(e,t,i,n,r,s,a,o){for(var l=r[s],u=r[s+1],h=r[s+a],c=r[s+a+1],d=r[s+2*a],_=r[s+2*a+1],f=r[s+3*a],p=r[s+3*a+1],g=i,m=i+n,v=e+1;0<--v;){var b=t[g]-t[m],w=t[g+-1]-t[m+-1];t[g]=t[g]+t[m],t[g+-1]=t[g+-1]+t[m+-1],t[m]=b*l-w*u,t[m+-1]=w*l+b*u,b=t[g+-2]-t[m+-2],w=t[g+-3]-t[m+-3],t[g+-2]=t[g+-2]+t[m+-2],t[g+-3]=t[g+-3]+t[m+-3],t[m+-2]=b*h-w*c,t[m+-3]=w*h+b*c,b=t[g+-4]-t[m+-4],w=t[g+-5]-t[m+-5],t[g+-4]=t[g+-4]+t[m+-4],t[g+-5]=t[g+-5]+t[m+-5],t[m+-4]=b*d-w*_,t[m+-5]=w*d+b*_,b=t[g+-6]-t[m+-6],w=t[g+-7]-t[m+-7],t[g+-6]=t[g+-6]+t[m+-6],t[g+-7]=t[g+-7]+t[m+-7],t[m+-6]=b*f-w*p,t[m+-7]=w*f+b*p,g-=o,m-=o}},ye.iter54=function(e,t){var i=e[t],n=e[t+-4],r=i-n,s=i+n,a=(i=e[t+-2])+(n=e[t+-6]),o=i-n;e[t]=s+a,e[t+-2]=s-a;var l=e[t+-3]-e[t+-7];e[t+-4]=r+l,e[t+-6]=r-l;var u=(i=e[t+-1])-(n=e[t+-5]),h=i+n,c=e[t+-3]+e[t+-7];e[t+-1]=h+c,e[t+-3]=h-c,e[t+-5]=u-o,e[t+-7]=u+o},ye.step3InnerSLoopLd654=function(e,t,i,n,r){for(var s=n[r>>3],a=i,o=i-16*e;o=this.segments.length&&(this.nextSeg=-1),this.bytesInSeg=e},startPacket:function(){for(;-1==this.nextSeg;)if(this.page.start(this),0!=(1&this.page.flag))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:193,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"startPacket"}));this.lastSeg=!1,this.validBits=0,this.bytesInSeg=0},maybeStartPacket:function(){if(-1==this.nextSeg){var t,i=!1;try{this.inputPosition+=1,t=this.input.readByte()}catch(e){var n=e instanceof pt?e.val:e;if(!(n instanceof v))throw e;i=!0,t=0}if(i)return!1;if(!!(!!(79!=t||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:218,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"maybeStartPacket"}));this.page.startWithoutCapturePattern(this)}return this.startPacket(),!0},readBits:function(e){if(this.validBits<0)return 0;if(this.validBits>>e,this.validBits-=e,t}var i=this.acc&(1<>>e,this.validBits-=e,i},readPacketRaw:function(){return 0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1},readPacket:function(){var e;return e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,e},flushPacket:function(){for(;0!=this.bytesInSeg||!this.lastSeg&&0!=this.next();)this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()},vorbisValidate:function(){var e,t,i,n,r,s,a=new he(new ArrayBuffer(6));if(e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[0]=e,t=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[1]=t,i=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[2]=i,n=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[3]=n,r=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[4]=r,s=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[5]=s,"vorbis"!=a.toString())throw new pt(new Xe(Ke.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}))},firstPageValidate:function(){if(1!=this.segments.length)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"segmentCount",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:308,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}));if(30!=this.segments[0])throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:311,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}))},startFirstDecode:function(){this.firstAudioPageOffset=this.inputPosition,this.firstDecode=!0},capturePattern:function(){if(this.inputPosition+=1,!!(!!(79!=this.input.readByte()||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:324,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"capturePattern"}))},skip:function(e){this.inputPosition+=e;for(var t=new Array(e),i=0,n=e;i>>n,this.validBits-=n,t=this.validBits<0?(this.validBits=0,-1):i}else t=this.decodeScalarRaw(e);return e.sparse&&(t=e.sortedValues[t]),t},decodeRaw:function(e){this.validBits<10&&this.prepHuffman();var t=e.fastHuffman[1023&this.acc];if(0<=t){var i=e.codewordLengths[t];return this.acc=this.acc>>>i,this.validBits-=i,this.validBits<0?(this.validBits=0,-1):t}return this.decodeScalarRaw(e)},isLastByte:function(){return 0==this.bytesInSeg&&this.lastSeg},finishDecodePacket:function(e,t,i){var n=i.left.start,r=!1,s=t>>1;if(this.firstDecode)this.currentLoc=-s,this.discardSamplesDeferred=t-i.right.end,r=!0,this.firstDecode=!1;else if(0!=this.discardSamplesDeferred)i.left.start+=this.discardSamplesDeferred,n=i.left.start,this.discardSamplesDeferred=0;else;if(this.lastSegWhich==this.endSegWithKnownLoc){if(r&&0!=(4&this.page.flag)){var a=this.knownLocForPacket-(t-i.right.end);if(a>>24]}var l=0;try{for(var u=0,h=n[26];u>>24],l+=c}for(var d=0,_=l;d<_;){d++;this.inputPosition+=1;var f=this.input.readByte();s=s<<8^be.table[f^s>>>24]}}catch(e){var p=e instanceof pt?e.val:e;if(p instanceof v){return Se.NotFound}throw e}if(s==r){var g=this.inputPosition;return e(this.inputPosition=i-1),Se.Found(g,0!=(4&n[5]))}}}}catch(e){var m=e instanceof pt?e.val:e;if(m instanceof v){return Se.NotFound}throw e}},analyzePage:function(e,t){var i=new Ue,n=new Array(255);i.pageStart=this.inputPosition,this.inputPosition+=27;for(var r=new Array(27),s=0;s<27;){r[s++]=this.input.readByte()}var a=r,o=a[26];this.inputPosition+=o;for(var l=new Array(o),u=0,h=o;u>=1;var x=m-1,T=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(m<=(y&=(1<<(x<16384?x<16?T[x]:x<512?5+T[x>>5]:10+T[x>>10]:x<16777216?x<524288?15+T[x>>15]:20+T[x>>20]:x<536870912?25+T[x>>25]:x<-2147483648?30+T[x>>30]:0))-1))return e(this.inputPosition=i.pageStart),null;n[p++]=t.modes[y].blockflag;var S=c[w]-1;this.inputPosition+=S;for(var k=new Array(S),I=0,C=S;I>1:F+=(t.blocksize1-t.blocksize0>>2)+(t.blocksize0>>1):F+=t.blocksize0>>1,--A;return i.firstDecodedSample=i.lastDecodedSample-F,e(this.inputPosition=i.pageStart),i},decodeScalarRaw:function(e){this.prepHuffman();var t=e.codewordLengths,i=e.codewords,n=e.sortedCodewords;if(8>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16,a=0,o=e.sortedEntries;1>1);Pe.gte(s,n[l])?(a=l,o-=o>>1):o>>=1}e.sparse||(a=e.sortedValues[a]);var u=t[a];return this.validBits>=u?(this.acc=this.acc>>>u,this.validBits-=u,a):(this.validBits=0,-1)}for(var h=0,c=e.entries;h=_?(this.acc=this.acc>>>_,this.validBits-=_,d):(this.validBits=0,-1)}return this.error=new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:847,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"decodeScalarRaw"}),this.validBits=0,-1},__class__:Te};var Se=p["kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult"]={__ename__:!0,__constructs__:["Found","NotFound"],Found:((t=function(e,t){return{_hx_index:0,end:e,last:t,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}}).__params__=["end","last"],t),NotFound:{_hx_index:1,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}},ke=function(e,t){this.header=e,this.decodeState=t,this.totalSample=null,this.currentSample=0,this.previousLength=0;var i=new Array(e.channel);this.channelBuffers=i;var n=new Array(e.channel);this.previousWindow=n;var r=new Array(e.channel);this.finalY=r;for(var s=0,a=e.channel;sthis.totalSample-this.currentSample&&(c=this.totalSample-this.currentSample);for(var d=0;hthis.totalSample-this.currentSample&&(e=this.totalSample-this.currentSample);t=r.lastDecodedSample&&(i=r.lastDecodedSample-1),i>>1);h=8<=s?c:Pe.gt(c,h)?h+(c-h>>>1):c+(h-c>>>1)}++s,e(this.decodeState.inputPosition=h);var d=this.decodeState.findPage(e,t);switch(d._hx_index){case 0:d.last,d.end;break;case 1:throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:249,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}))}var _=this.decodeState.analyzePage(e,this.header);if(null==_)throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:255,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}));_.afterPreviousPageStart=h,_.pageStart!=r.pageStart?i<_.lastDecodedSample?r=_:n=_:r=_}if(!(n.lastDecodedSample<=i&&i>1,n=t>>2,r=t>>3,s=this.a,a=new Array(i);s[e]=a;var o=this.b,l=new Array(i);o[e]=l;var u=this.c,h=new Array(n);u[e]=h;var c=this.window,d=new Array(i);c[e]=d;var _=this.bitReverseData,f=new Array(r);_[e]=f,Ie.computeTwiddleFactors(t,this.a[e],this.b[e],this.c[e]),Ie.computeWindow(t,this.window[e]),Ie.computeBitReverse(t,this.bitReverseData[e])},inverseMdct:function(e,t,i){for(var n=i?1:0,r=this.a[n],s=this.b[n],a=this.c[n],o=this.bitReverseData[n],l=t>>1,u=t>>2,h=t>>3,c=new Array(l),d=l-2,_=0,f=0,p=l;f!=p;)c[d+1]=e[f]*r[_]-e[f+2]*r[_+1],c[d]=e[f]*r[_+1]+e[f+2]*r[_],d-=2,_+=2,f+=4;for(f=l-3;0<=d;)c[d+1]=-e[f+2]*r[_]- -e[f]*r[_+1],c[d]=-e[f+2]*r[_+1]+-e[f]*r[_],d-=2,_+=2,f-=4;for(var g=e,m=c,v=l-8,b=u,w=0,y=u,x=0;0<=v;){var T=m[b+1]-m[w+1],S=m[b]-m[w];g[y+1]=m[b+1]+m[w+1],g[y]=m[b]+m[w],g[x+1]=T*r[v+4]-S*r[v+5],g[x]=S*r[v+4]+T*r[v+5],T=m[b+3]-m[w+3],S=m[b+2]-m[w+2],g[y+3]=m[b+3]+m[w+3],g[y+2]=m[b+2]+m[w+2],g[x+3]=T*r[v]-S*r[v+1],g[x+2]=S*r[v]+T*r[v+1],v-=8,y+=4,x+=4,b+=4,w+=4}for(var k=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],I=(t<16384?t<16?k[t]:t<512?5+k[t>>5]:10+k[t>>10]:t<16777216?t<524288?15+k[t>>15]:20+k[t>>20]:t<536870912?25+k[t>>25]:t<-2147483648?30+k[t>>30]:0)-1,C=l-1-0*u,B=C,E=C-(t>>3),N=0,L=1+(t>>4>>2);0<--L;){var F=g[B]-g[E],A=g[B+-1]-g[E+-1];g[B]=g[B]+g[E];var M=B+-1;g[M]=g[M]+g[E+-1],g[E]=F*r[N]-A*r[N+1],g[E+-1]=A*r[N]+F*r[N+1],N+=8,F=g[B+-2]-g[E+-2],A=g[B+-3]-g[E+-3];var P=B+-2;g[P]=g[P]+g[E+-2];var R=B+-3;g[R]=g[R]+g[E+-3],g[E+-2]=F*r[N]-A*r[N+1],g[E+-3]=A*r[N]+F*r[N+1],N+=8,F=g[B+-4]-g[E+-4],A=g[B+-5]-g[E+-5];var O=B+-4;g[O]=g[O]+g[E+-4];var V=B+-5;g[V]=g[V]+g[E+-5],g[E+-4]=F*r[N]-A*r[N+1],g[E+-5]=A*r[N]+F*r[N+1],N+=8,F=g[B+-6]-g[E+-6],A=g[B+-7]-g[E+-7];var D=B+-6;g[D]=g[D]+g[E+-6];var U=B+-7;g[U]=g[U]+g[E+-7],g[E+-6]=F*r[N]-A*r[N+1],g[E+-7]=A*r[N]+F*r[N+1],N+=8,B-=8,E-=8}for(var H=l-1-u,W=H,G=H-(t>>3),z=0,X=1+(t>>4>>2);0<--X;){var K=g[W]-g[G],Y=g[W+-1]-g[G+-1];g[W]=g[W]+g[G];var Z=W+-1;g[Z]=g[Z]+g[G+-1],g[G]=K*r[z]-Y*r[z+1],g[G+-1]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-2]-g[G+-2],Y=g[W+-3]-g[G+-3];var j=W+-2;g[j]=g[j]+g[G+-2];var q=W+-3;g[q]=g[q]+g[G+-3],g[G+-2]=K*r[z]-Y*r[z+1],g[G+-3]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-4]-g[G+-4],Y=g[W+-5]-g[G+-5];var Q=W+-4;g[Q]=g[Q]+g[G+-4];var J=W+-5;g[J]=g[J]+g[G+-5],g[G+-4]=K*r[z]-Y*r[z+1],g[G+-5]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-6]-g[G+-6],Y=g[W+-7]-g[G+-7];var $=W+-6;g[$]=g[$]+g[G+-6];var ee=W+-7;g[ee]=g[ee]+g[G+-7],g[G+-6]=K*r[z]-Y*r[z+1],g[G+-7]=Y*r[z]+K*r[z+1],z+=8,W-=8,G-=8}for(var te=l-1-0*h,ie=0,ne=te,re=te-(t>>4),se=1+(t>>5>>2);0<--se;){var ae=g[ne]-g[re],oe=g[ne+-1]-g[re+-1];g[ne]=g[ne]+g[re];var le=ne+-1;g[le]=g[le]+g[re+-1],g[re]=ae*r[ie]-oe*r[ie+1],g[re+-1]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-2]-g[re+-2],oe=g[ne+-3]-g[re+-3];var ue=ne+-2;g[ue]=g[ue]+g[re+-2];var he=ne+-3;g[he]=g[he]+g[re+-3],g[re+-2]=ae*r[ie]-oe*r[ie+1],g[re+-3]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-4]-g[re+-4],oe=g[ne+-5]-g[re+-5];var ce=ne+-4;g[ce]=g[ce]+g[re+-4];var de=ne+-5;g[de]=g[de]+g[re+-5],g[re+-4]=ae*r[ie]-oe*r[ie+1],g[re+-5]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-6]-g[re+-6],oe=g[ne+-7]-g[re+-7];var _e=ne+-6;g[_e]=g[_e]+g[re+-6];var fe=ne+-7;g[fe]=g[fe]+g[re+-7],g[re+-6]=ae*r[ie]-oe*r[ie+1],g[re+-7]=oe*r[ie]+ae*r[ie+1],ne-=8,re-=8,ie+=16}for(var pe=l-1-h,ge=0,me=pe,ve=pe-(t>>4),be=1+(t>>5>>2);0<--be;){var we=g[me]-g[ve],ye=g[me+-1]-g[ve+-1];g[me]=g[me]+g[ve];var xe=me+-1;g[xe]=g[xe]+g[ve+-1],g[ve]=we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]+g[zt+-1],g[zt]=Kt*Pt-Yt*Rt,g[zt+-1]=Yt*Pt+Kt*Rt,Kt=g[Gt+-2]-g[zt+-2],Yt=g[Gt+-3]-g[zt+-3],g[Gt+-2]=g[Gt+-2]+g[zt+-2],g[Gt+-3]=g[Gt+-3]+g[zt+-3],g[zt+-2]=Kt*Ot-Yt*Vt,g[zt+-3]=Yt*Ot+Kt*Vt,Kt=g[Gt+-4]-g[zt+-4],Yt=g[Gt+-5]-g[zt+-5],g[Gt+-4]=g[Gt+-4]+g[zt+-4],g[Gt+-5]=g[Gt+-5]+g[zt+-5],g[zt+-4]=Kt*Dt-Yt*Ut,g[zt+-5]=Yt*Dt+Kt*Ut,Kt=g[Gt+-6]-g[zt+-6],Yt=g[Gt+-7]-g[zt+-7],g[Gt+-6]=g[Gt+-6]+g[zt+-6],g[Gt+-7]=g[Gt+-7]+g[zt+-7],g[zt+-6]=Kt*Ht-Yt*Wt,g[zt+-7]=Yt*Ht+Kt*Wt,Gt-=Bt,zt-=Bt}Ft+=4*Et,At-=8}for(var Zt=l-1,jt=r[t>>3],qt=Zt,Qt=Zt-16*(t>>5);Qt>5]:10+n[i>>10]:i<16777216?i<524288?15+n[i>>15]:20+n[i>>20]:i<536870912?25+n[i>>25]:i<-2147483648?30+n[i>>30]:0);if(-1==r||r>=this.header.modes.length)throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:519,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"decodeInitial"}));var s,a,o,l=this.header.modes[r];l.blockflag?(s=this.header.blocksize1,a=this.decodeState.readBits(1),o=this.decodeState.readBits(1)):(a=o=0,s=this.header.blocksize0);var u=s>>1;return{mode:r,left:l.blockflag&&0==a?{start:s-this.header.blocksize0>>2,end:s+this.header.blocksize0>>2}:{start:0,end:u},right:l.blockflag&&0==o?{start:3*s-this.header.blocksize0>>2,end:3*s+this.header.blocksize0>>2}:{start:u,end:s}}},decodePacketRest:function(e){for(var t=this.header.modes[e.mode],i=new Array(256),n=new Array(256),r=t.blockflag?this.header.blocksize1:this.header.blocksize0,s=this.header.mapping[t.mapping],a=r>>1,o=[256,128,86,64],l=this.header.codebooks,u=0,h=this.header.channel;u>5]:10+b[m>>10]:m<16777216?m<524288?15+b[m>>15]:20+b[m>>20]:m<536870912?25+b[m>>25]:m<-2147483648?30+b[m>>30]:0)-1);var w=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];p[1]=this.decodeState.readBits((m<16384?m<16?w[m]:m<512?5+w[m>>5]:10+w[m>>10]:m<16777216?m<524288?15+w[m>>15]:20+w[m>>20]:m<536870912?25+w[m>>25]:m<-2147483648?30+w[m>>30]:0)-1);for(var y=0,x=f.partitions;y>>A,N.validBits-=A,L=N.validBits<0?(N.validBits=0,-1):F}else L=N.decodeScalarRaw(E);E.sparse&&(L=E.sortedValues[L]),B=L}for(var M=f.subclassBooks[S],P=0,R=k;P>=I;var V,D=v++;if(0<=O){var U=this.decodeState,H=l[O];U.validBits<10&&U.prepHuffman();var W,G=H.fastHuffman[1023&U.acc];if(0<=G){var z=H.codewordLengths[G];U.acc=U.acc>>>z,U.validBits-=z,W=U.validBits<0?(U.validBits=0,-1):G}else W=U.decodeScalarRaw(H);H.sparse&&(W=H.sortedValues[W]),V=W}else V=0;p[D]=V}}if(-1==this.decodeState.validBits){i[c]=!0;continue}g[0]=g[1]=!0;for(var X=f.neighbors,K=f.xlist,Y=2,Z=f.values;Y>1):ne+(re>>1)):(g[j]=!1,p[j]=ne)}for(var oe=0,le=f.values;oe>1;0<=--Ie;)for(var Be=this.channelBuffers[s.chan[Ie].magnitude],Ee=this.channelBuffers[s.chan[Ie].angle],Ne=0,Le=Ce;Nei&&e[l]e[t]&&(n=e[s=l])}return{low:r,high:s}},Ie.floatUnpack=function(e){var t=Pe.toFloat(2097151&e),i=(2145386496&e)>>>21;return(0!=(-2147483648&e)?-t:t)*Math.pow(2,i-788)},Ie.bitReverse=function(e){return(e=(-16711936&(e=(-252645136&(e=(-858993460&(e=(-1431655766&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8)>>>16|e<<16},Ie.pointCompare=function(e,t){return e.xt.x?1:0},Ie.uintAsc=function(e,t){return Pe.gt(t,e)?-1:e==t?0:1},Ie.lookup1Values=function(e,t){var i=0|Math.exp(Math.log(e)/t);return(0|Math.pow(i+1,t))<=e&&++i,i},Ie.computeWindow=function(e,t){for(var i=e>>1,n=0,r=i;n>5]:10+i[e>>10]:e<16777216?e<524288?15+i[e>>15]:20+i[e>>20]:e<536870912?25+i[e>>25]:e<-2147483648?30+i[e>>30]:0)-1,r=0,s=e>>3;r>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8,t[a]=(o>>>16|o<<16)>>>32-n+3<<2}},Ie.computeTwiddleFactors=function(e,t,i,n){for(var r=e>>3,s=0,a=0,o=e>>2;a>5]:10+d[c>>10]:c<16777216?c<524288?15+d[c>>15]:20+d[c>>20]:c<536870912?25+d[c>>25]:c<-2147483648?30+d[c>>30]:0);if(u+_>t.entries)throw new pt(new Xe(Ke.INVALID_SETUP,"codebook entrys",{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"read"}));for(var f=0,p=_;f=t.entries>>2&&(t.codewordLengths=a,t.sparse=!1),t.sparse)o=l;else{for(var b=0,w=0,y=t.entries;w>>21,L=0!=(-2147483648&B)?-E:E;t.minimumValue=L*Math.pow(2,N-788);var F=e.readBits(32),A=Pe.toFloat(2097151&F),M=(2145386496&F)>>>21,P=0!=(-2147483648&F)?-A:A;t.deltaValue=P*Math.pow(2,M-788),t.valueBits=e.readBits(4)+1,t.sequenceP=0!=e.readBits(1),1==t.lookupType?t.lookupValues=Ie.lookup1Values(t.entries,t.dimensions):t.lookupValues=t.entries*t.dimensions;for(var R=new Array(t.lookupValues),O=0,V=t.lookupValues;O>>1|(1431655765&h)<<1))>>>2|(858993459&h)<<2))>>>4|(252645135&h)<<4))>>>8|(16711935&h)<<8)>>>16|h<<16,d=s++;if(this.sparse?(this.codewords[d]=c,this.codewordLengths[d]=e[o],i[d]=o):this.codewords[o]=c,l!=e[o])for(var _=e[o];l<_;)n[_]=u+(1<<32-_),--_}}return!0},computeSortedHuffman:function(e,t){if(this.sparse)for(var i=0,n=this.sortedEntries;i>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,this.sortedCodewords[r]=s>>>16|s<<16}else for(var a=0,o=0,l=this.entries;o>>1|(1431655765&c)<<1))>>>2|(858993459&c)<<2))>>>4|(252645135&c)<<4))>>>8|(16711935&c)<<8,this.sortedCodewords[a++]=c>>>16|c<<16}}this.sortedCodewords[this.sortedEntries]=-1,this.sortedCodewords.sort(Ie.uintAsc);for(var d=0,_=this.sparse?this.sortedEntries:this.entries;d<_;){var f=d++,p=this.sparse?e[t[f]]:e[f];if(this.sparse||255!=p&&10>>1|(1431655765&g)<<1))>>>2|(858993459&g)<<2))>>>4|(252645135&g)<<4))>>>8|(16711935&g)<<8)>>>16|g<<16,v=0,b=this.sortedEntries;1>1);Pe.gte(m,this.sortedCodewords[w])?(v=w,b-=b>>1):b>>=1}this.sparse?(this.sortedValues[v]=t[f],this.codewordLengths[v]=p):this.sortedValues[v]=f}}},computeAcceleratedHuffman:function(){var e=new Array(1024);this.fastHuffman=e,this.fastHuffman[0]=-1;for(var t=0;t<1024;){var i=t++;this.fastHuffman[i]=-1}for(var n=0,r=this.sparse?this.sortedEntries:this.entries;n>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8)>>>16|o<<16}else a=this.codewords[s];for(;a<1024;)this.fastHuffman[a]=s,a+=1<>>a,e.validBits-=a,r=e.validBits<0?(e.validBits=0,-1):s}else r=e.decodeScalarRaw(this);this.sparse&&(r=this.sortedValues[r]);var o=r,l=this.lookupValues,u=this.sequenceP,h=this.multiplicands,c=this.minimumValue;if(o<0)return!1;if(n>this.dimensions&&(n=this.dimensions),1==this.lookupType){for(var d=1,_=0,f=0,p=n;f>>o,e.validBits-=o,s=e.validBits<0?(e.validBits=0,-1):a}else s=e.decodeScalarRaw(this);this.sparse&&(s=this.sortedValues[s]);var l=s,u=0;if(l<0)return!1;n>this.dimensions&&(n=this.dimensions);var h=this.lookupValues,c=this.sequenceP,d=this.multiplicands;if(1==this.lookupType){for(var _=1,f=0,p=n;f>>n,e.validBits-=n,t=e.validBits<0?(e.validBits=0,-1):i}else t=e.decodeScalarRaw(this);return this.sparse&&(t=this.sortedValues[t]),t},decodeDeinterleaveRepeat:function(e,t,i,n,r,s,a){var o=this.dimensions;if(0==this.lookupType)throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:488,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}));for(var l=this.multiplicands,u=this.sequenceP,h=this.lookupValues;0>>f,e.validBits-=f,d=e.validBits<0?(e.validBits=0,-1):_}else d=e.decodeScalarRaw(this);this.sparse&&(d=this.sortedValues[d]);var p=d;if(p<0){if(0==e.bytesInSeg&&e.lastSeg)return null;throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:503,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}))}if(s*iu&&(u=l.partitionClassList[_])}var f=new Array(u+1);l.classDimensions=f;var p=new Array(u+1);l.classMasterbooks=p;var g=new Array(u+1);l.classSubclasses=g;var m=new Array(u+1);l.subclassBooks=m;for(var v=0,b=u+1;v=t.length))throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:64,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}));var y=1<=t.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}))}}l.floor1Multiplier=e.readBits(2)+1,l.rangebits=e.readBits(4);var C=new Array(250);l.xlist=C,l.xlist[0]=0,l.xlist[1]=1<K&&X[J]X[z]&&(Y=X[j=J])}var $=Z,ee=j,te=l.neighbors,ie=new Array(l.values);te[z]=ie,l.neighbors[z][0]=$,l.neighbors[z][1]=ee}return i},Ee.prototype={floor0:null,floor1:null,type:null,__class__:Ee};var Ne=function(){};(T["kha.audio2.ogg.vorbis.data.Floor0"]=Ne).__name__=!0,Ne.prototype={order:null,rate:null,barkMapSize:null,amplitudeBits:null,amplitudeOffset:null,numberOfBooks:null,bookList:null,__class__:Ne};var Le=function(){};(T["kha.audio2.ogg.vorbis.data.Floor1"]=Le).__name__=!0,Le.prototype={partitions:null,partitionClassList:null,classDimensions:null,classSubclasses:null,classMasterbooks:null,subclassBooks:null,xlist:null,sortedOrder:null,neighbors:null,floor1Multiplier:null,rangebits:null,values:null,__class__:Le};var Fe=function(){};(T["kha.audio2.ogg.vorbis.data.Header"]=Fe).__name__=!0,Fe.read=function(e){var t=e.page;if(t.start(e),0==(2&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"not firstPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(4&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"lastPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(1&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"continuedPacket",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(e.firstPageValidate(),e.inputPosition+=1,1!=e.input.readByte())throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:57,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var i,n,r,s,a,o,l=new he(new ArrayBuffer(6));if(i=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[0]=i,n=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[1]=n,r=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[2]=r,s=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[3]=s,a=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[4]=a,o=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[5]=o,"vorbis"!=l.toString())throw new pt(new Xe(Ke.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}));e.inputPosition+=4;var u=e.input.readInt32();if(0!=u)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"vorbis version : "+u,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:66,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var h=new Fe;if(e.inputPosition+=1,h.channel=e.input.readByte(),0==h.channel)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"no channel",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(16>4;if(h.blocksize0=1<=h.floorConfig.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:191,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(ee.submapResidue[ne]>=h.residueConfig.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:194,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}var re=e.readBits(6)+1,se=new Array(re);h.modes=se;for(var ae=0,oe=re;ae=h.mapping.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:205,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}for(;0!=e.bytesInSeg||!e.lastSeg&&0!=e.next();)e.bytesInSeg--,e.inputPosition+=1,e.input.readByte();return h},Fe.prototype={maximumBitRate:null,nominalBitRate:null,minimumBitRate:null,sampleRate:null,channel:null,blocksize0:null,blocksize1:null,codebooks:null,floorConfig:null,residueConfig:null,mapping:null,modes:null,comment:null,vendor:null,__class__:Fe};var Ae=function(){};(T["kha.audio2.ogg.vorbis.data.IntPoint"]=Ae).__name__=!0,Ae.prototype={x:null,y:null,__class__:Ae};var Me=function(){};(T["kha.audio2.ogg.vorbis.data.Mapping"]=Me).__name__=!0,Me.read=function(e,t){var i=new Me,n=e.readBits(16);if(0!=n)throw new pt(new Xe(Ke.INVALID_SETUP,"mapping type "+n,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:22,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));var r=new Array(t);i.chan=r;for(var s=0,a=t;s>5]:10+d[c>>10]:c<16777216?c<524288?15+d[c>>15]:20+d[c>>20]:c<536870912?25+d[c>>25]:c<-2147483648?30+d[c>>30]:0);var _=t-1,f=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(i.chan[h].angle=e.readBits(_<16384?_<16?f[_]:_<512?5+f[_>>5]:10+f[_>>10]:_<16777216?_<524288?15+f[_>>15]:20+f[_>>20]:_<536870912?25+f[_>>25]:_<-2147483648?30+f[_>>30]:0),i.chan[h].magnitude>=t)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].angle>=t)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].magnitude==i.chan[h].angle)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}}else i.couplingSteps=0;if(0!=e.readBits(2))throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:61,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(1=i.submaps)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}else for(var v=0,b=t;v>1,o=this.chan[t].mux,l=e[this.submapFloor[o]];if(0==l.type)throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:94,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"doFloor"}));for(var u=l.floor1,h=0,c=r[0]*u.floor1Multiplier,d=1,_=u.values;d<_;){var f=d++,p=u.sortedOrder[f];if(0<=r[p]){var g=r[p]*u.floor1Multiplier,m=u.xlist[p];Ie.drawLine(n,h,c,m,g,a),h=m,c=g}}if(h=t.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Residue.hx",lineNumber:55,className:"kha.audio2.ogg.vorbis.data.Residue",methodName:"read"}))}else i.residueBooks[_][m]=-1}}var v=t[i.classbook].entries,b=t[i.classbook].dimensions,w=new Array(v);i.classdata=w;for(var y=0,x=v;y>>B,e.validBits-=B,I=e.validBits<0?(e.validBits=0,-1):C}else I=e.decodeScalarRaw(k);k.sparse&&(I=k.sortedValues[I]);var E=I;if(-1==E)return;for(var N=l;0<=--N;)d[S*c+N+y]=E%this.classifications,E=E/this.classifications|0}}for(var L=0,F=l;L>>1;if(0==X){var q=o[this.classbook];e.validBits<10&&e.prepHuffman();var Q,J=q.fastHuffman[1023&e.acc];if(0<=J){var $=q.codewordLengths[J];e.acc=e.acc>>>$,e.validBits-=$,Q=e.validBits<0?(e.validBits=0,-1):J}else Q=e.decodeScalarRaw(q);q.sparse&&(Q=q.sortedValues[Q]);var ee=Q;if(-1==ee)return;for(var te=l;0<=--te;)d[te+K]=ee%this.classifications,ee=ee/this.classifications|0}for(var ie=0,ne=l;ie>>1;++K}}else if(1==n)for(;K>>_e,e.validBits-=_e,ce=e.validBits<0?(e.validBits=0,-1):de}else ce=e.decodeScalarRaw(he);he.sparse&&(ce=he.sortedValues[ce]);var fe=ce;if(-1==fe)return;for(var pe=l;0<=--pe;)d[pe+K]=fe%this.classifications,fe=fe/this.classifications|0}for(var ge=0,me=l;ge>>Ce,e.validBits-=Ce,ke=e.validBits<0?(e.validBits=0,-1):Ie}else ke=e.decodeScalarRaw(Se);Se.sparse&&(ke=Se.sortedValues[ke]);var Be=ke;if(-1==Be)return;for(var Ee=l;0<=--Ee;)d[Ee+K]=Be%this.classifications,Be=Be/this.classifications|0}for(var Ne=0,Le=l;Ne>1,y=n+8;null==y&&(y=0);var x=i.readU8(y),T=(i.readU8(y+1)|x<<8)>>1,S=n+10;null==S&&(S=0);var k=i.readU8(S),I=i.readU8(S+1)|k<<8,C=n+12;null==C&&(C=0);var B=i.readU8(C),E=(i.readU8(C+1)|B<<8)>>1,N=n+14,L=N;if(65535>=1);null==M&&(M=0);var P=i.readU8(M);(i.readU8(M+1)|P<<8)>1,O=N+2*R;null==O&&(O=0);var V=i.readU8(O);if((i.readU8(O+1)|V<<8)>1),re=n+16+12*ne;null==re&&(re=0);var se=re;null==se&&(se=0);var ae=i.readU8(se),oe=i.readU8(se+1),le=i.readU8(se+2),ue=i.readU8(se+3)|le<<8|oe<<16|ae<<24,he=n+16+12*ne+4;null==he&&(he=0);var ce=he;null==ce&&(ce=0);var de=i.readU8(ce),_e=i.readU8(ce+1),fe=i.readU8(ce+2),pe=i.readU8(ce+3);if(t=e.numGlyphs)return-1;if(2<=e.indexToLocFormat)return-1;if(0==e.indexToLocFormat){var r=e.glyf,s=e.data,a=e.loca+2*t;null==a&&(a=0);var o=s.readU8(a);i=r+2*(s.readU8(a+1)|o<<8);var l=e.glyf,u=e.data,h=e.loca+2*t+2;null==h&&(h=0);var c=u.readU8(h);n=l+2*(u.readU8(h+1)|c<<8)}else{var d=e.glyf,_=e.data,f=e.loca+4*t;null==f&&(f=0);var p=f;null==p&&(p=0);var g=_.readU8(p),m=_.readU8(p+1),v=_.readU8(p+2);i=d+(_.readU8(p+3)|v<<8|m<<16|g<<24);var b=e.glyf,w=e.data,y=e.loca+4*t+4;null==y&&(y=0);var x=y;null==x&&(x=0);var T=w.readU8(x),S=w.readU8(x+1),k=w.readU8(x+2);n=b+(w.readU8(x+3)|k<<8|S<<16|T<<24)}return i==n?-1:i},Et.stbtt_GetGlyphBox=function(e,t,i){var n=Et.stbtt__GetGlyfOffset(e,t);if(n<0)return!1;var r=e.data,s=n+2;null==s&&(s=0);var a=r.readU8(s),o=r.readU8(s+1)|a<<8;i.x0=0!=(32768&o)?o-65536:o;var l=e.data,u=n+4;null==u&&(u=0);var h=l.readU8(u),c=l.readU8(u+1)|h<<8;i.y0=0!=(32768&c)?c-65536:c;var d=e.data,_=n+6;null==_&&(_=0);var f=d.readU8(_),p=d.readU8(_+1)|f<<8;i.x1=0!=(32768&p)?p-65536:p;var g=e.data,m=n+8;null==m&&(m=0);var v=g.readU8(m),b=g.readU8(m+1)|v<<8;return i.y1=0!=(32768&b)?b-65536:b,!0},Et.stbtt_GetCodepointBox=function(e,t,i){return Et.stbtt_GetGlyphBox(e,Et.stbtt_FindGlyphIndex(e,t),i)},Et.stbtt_IsGlyphEmpty=function(e,t){var i=Et.stbtt__GetGlyfOffset(e,t);if(i<0)return!0;var n=e.data,r=i;null==r&&(r=0);var s=n.readU8(r),a=n.readU8(r+1)|s<<8;return 0==(0!=(32768&a)?a-65536:a)},Et.stbtt__close_shape=function(e,t,i,n,r,s,a,o,l,u){return n?(i&&Et.stbtt_setvertex(e[t++],3,l+a>>1,u+o>>1,l,u),Et.stbtt_setvertex(e[t++],3,r,s,a,o)):i?Et.stbtt_setvertex(e[t++],3,r,s,l,u):Et.stbtt_setvertex(e[t++],2,r,s,0,0),t},Et.copyVertices=function(e,t,i,n){for(var r=0,s=n;r>1,Z=O+n[h+q+1].y>>1):(j=n[h+q+1].x,Z=n[h+q+1].y,++q)):(j=N,Z=O),Et.stbtt_setvertex(n[r++],1,j,Z,0,0),f=!1;var Q=g+2*d;null==Q&&(Q=0);var J=i.readU8(Q);_=1+(i.readU8(Q+1)|J<<8),++d}else f=0==(1&c)?(f&&Et.stbtt_setvertex(n[r++],3,Y+N>>1,K+O>>1,Y,K),Y=N,K=O,!0):(f?Et.stbtt_setvertex(n[r++],3,N,O,Y,K):Et.stbtt_setvertex(n[r++],2,N,O,0,0),!1);++q}r=Et.stbtt__close_shape(n,r,f,p,j,Z,X,z,Y,K)}else if(-1==u){var $=1,ee=s+10;for(r=0,n=null;0!=$;){var te,ie,ne=null,re=1,se=0,ae=0,oe=1,le=0,ue=0,he=ee;null==he&&(he=0);var ce=i.readU8(he),de=i.readU8(he+1)|ce<<8,_e=0!=(32768&de)?de-65536:de,fe=ee+=2;null==fe&&(fe=0);var pe=i.readU8(fe),ge=i.readU8(fe+1)|pe<<8,me=0!=(32768&ge)?ge-65536:ge;if(ee+=2,0==(2&_e))throw new pt("Error");if(0!=(1&_e)){var ve=ee;null==ve&&(ve=0);var be=i.readU8(ve),we=i.readU8(ve+1)|be<<8;le=0!=(32768&we)?we-65536:we;var ye=ee+=2;null==ye&&(ye=0);var xe=i.readU8(ye),Te=i.readU8(ye+1)|xe<<8;ue=0!=(32768&Te)?Te-65536:Te,ee+=2}else{var Se=ee;null==Se&&(Se=0);var ke=i.readU8(Se);le=128<=ke?ke-256:ke;var Ie=++ee;null==Ie&&(Ie=0);var Ce=i.readU8(Ie);ue=128<=Ce?Ce-256:Ce,++ee}if(0!=(8&_e)){var Be=ee;null==Be&&(Be=0);var Ee=i.readU8(Be),Ne=i.readU8(Be+1)|Ee<<8;re=oe=(0!=(32768&Ne)?Ne-65536:Ne)/16384,ee+=2,se=ae=0}else if(0!=(64&_e)){var Le=ee;null==Le&&(Le=0);var Fe=i.readU8(Le),Ae=i.readU8(Le+1)|Fe<<8;re=(0!=(32768&Ae)?Ae-65536:Ae)/16384,se=ae=0;var Me=ee+=2;null==Me&&(Me=0);var Pe=i.readU8(Me),Re=i.readU8(Me+1)|Pe<<8;oe=(0!=(32768&Re)?Re-65536:Re)/16384,ee+=2}else if(0!=(128&_e)){var Oe=ee;null==Oe&&(Oe=0);var Ve=i.readU8(Oe),De=i.readU8(Oe+1)|Ve<<8;re=(0!=(32768&De)?De-65536:De)/16384;var Ue=ee+=2;null==Ue&&(Ue=0);var He=i.readU8(Ue),We=i.readU8(Ue+1)|He<<8;se=(0!=(32768&We)?We-65536:We)/16384;var Ge=ee+=2;null==Ge&&(Ge=0);var ze=i.readU8(Ge),Xe=i.readU8(Ge+1)|ze<<8;ae=(0!=(32768&Xe)?Xe-65536:Xe)/16384;var Ke=ee+=2;null==Ke&&(Ke=0);var Ye=i.readU8(Ke),Ze=i.readU8(Ke+1)|Ye<<8;oe=(0!=(32768&Ze)?Ze-65536:Ze)/16384,ee+=2}var je=Math.sqrt(re*re+se*se),qe=Math.sqrt(ae*ae+oe*oe);if(0<(te=null==(ie=Et.stbtt_GetGlyphShape(e,me))?0:ie.length)){for(var Qe=0,Je=te;Qe>1);null==g&&(g=0);var m=g;null==m&&(m=0);var v=a.readU8(m),b=a.readU8(m+1),w=a.readU8(m+2);if(p<(n=a.readU8(m+3)|w<<8|b<<16|v<<24))f=r-1;else{if(!(nn.ey||on.ey&&(a+=(a-r)*(n.ey-o)/(o-s),o=n.ey),r==i){if(!(a<=i+1))throw new pt("Error")}else if(r==i+1){if(!(i<=a))throw new pt("Error")}else if(r<=i){if(!(a<=i))throw new pt("Error")}else if(i+1<=r){if(!(i+1<=a))throw new pt("Error")}else if(!(i<=a&&a<=i+1))throw new pt("Error");if(r<=i&&a<=i){var l=t+i;e[l]=e[l]+n.direction*(o-s)}else if(!(i+1<=r&&i+1<=a)){if(!(i<=r&&r<=i+1&&i<=a&&a<=i+1))throw new pt("Error");var u=t+i;e[u]=e[u]+n.direction*(o-s)*(1-(r-i+(a-i))/2)}}}},Et.stbtt__fill_active_edges_new=function(e,t,i,n,r,s){for(var a=s+1;null!=r;){if(!(r.ey>=s))throw new pt("Error");if(0==r.fdx){var o=r.fx;o=s))throw new pt("Error");if(h=r.sy>s?(l=d+_*(r.sy-s),r.sy):(l=d,s),c=r.ey=_))throw new pt("Error");x.next=l,l=x}++h}null!=l&&Et.stbtt__fill_active_edges_new(a,c,o+1,e.w,l,_);for(var T=0,S=0,k=e.w;S>1,s=Et.STBTT__COMPARE(e[t],e[t+r]),a=Et.STBTT__COMPARE(e[t+r],e[t+i-1]);if(s!=a){var o=Et.STBTT__COMPARE(e[t],e[t+i-1])==a?0:i-1;n=e[t+o],e[t+o]=e[t+r],e[t+r]=n}n=e[t],e[t]=e[t+r],e[t+r]=n;for(var l=1,u=i-1;;){for(;Et.STBTT__COMPARE(e[t+l],e[t]);)++l;for(;Et.STBTT__COMPARE(e[t],e[t+u]);)--u;if(u<=l)break;n=e[t+l],e[t+l]=e[t+u],e[t+u]=n,++l,--u}uT[S+C].y:T[S+c].y>>16),_=.00392156862745098*((65280&h)>>>8),f=.00392156862745098*(255&h),p=.00392156862745098*(h>>>24)*u,g=9*Rt.bufferIndex*4;Rt.rectVertices[5+g]=d,Rt.rectVertices[6+g]=_,Rt.rectVertices[7+g]=f,Rt.rectVertices[8+g]=p,Rt.rectVertices[14+g]=d,Rt.rectVertices[15+g]=_,Rt.rectVertices[16+g]=f,Rt.rectVertices[17+g]=p,Rt.rectVertices[23+g]=d,Rt.rectVertices[24+g]=_,Rt.rectVertices[25+g]=f,Rt.rectVertices[26+g]=p,Rt.rectVertices[32+g]=d,Rt.rectVertices[33+g]=_,Rt.rectVertices[34+g]=f,Rt.rectVertices[35+g]=p;var m=c.get_width()/c.get_realWidth(),v=c.get_height()/c.get_realHeight(),b=9*Rt.bufferIndex*4;Rt.rectVertices[3+b]=0,Rt.rectVertices[4+b]=v,Rt.rectVertices[12+b]=0,Rt.rectVertices[13+b]=0,Rt.rectVertices[21+b]=m,Rt.rectVertices[22+b]=0,Rt.rectVertices[30+b]=m,Rt.rectVertices[31+b]=v;var w=9*Rt.bufferIndex*4;Rt.rectVertices[w]=t,Rt.rectVertices[1+w]=i,Rt.rectVertices[2+w]=-5,Rt.rectVertices[9+w]=n,Rt.rectVertices[10+w]=r,Rt.rectVertices[11+w]=-5,Rt.rectVertices[18+w]=s,Rt.rectVertices[19+w]=a,Rt.rectVertices[20+w]=-5,Rt.rectVertices[27+w]=o,Rt.rectVertices[28+w]=l,Rt.rectVertices[29+w]=-5,++Rt.bufferIndex,Rt.lastTexture=c},drawImage2:function(e,t,i,n,r,s,a,o,l,u,h,c,d,_,f){var p=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&p!=Rt.lastTexture)&&this.drawBuffer();var g=t/p.get_realWidth(),m=i/p.get_realHeight(),v=(t+n)/p.get_realWidth(),b=(i+r)/p.get_realHeight(),w=9*Rt.bufferIndex*4;Rt.rectVertices[3+w]=g,Rt.rectVertices[4+w]=b,Rt.rectVertices[12+w]=g,Rt.rectVertices[13+w]=m,Rt.rectVertices[21+w]=v,Rt.rectVertices[22+w]=m,Rt.rectVertices[30+w]=v,Rt.rectVertices[31+w]=b;var y=.00392156862745098*((16711680&f)>>>16),x=.00392156862745098*((65280&f)>>>8),T=.00392156862745098*(255&f),S=.00392156862745098*(f>>>24)*_,k=9*Rt.bufferIndex*4;Rt.rectVertices[5+k]=y,Rt.rectVertices[6+k]=x,Rt.rectVertices[7+k]=T,Rt.rectVertices[8+k]=S,Rt.rectVertices[14+k]=y,Rt.rectVertices[15+k]=x,Rt.rectVertices[16+k]=T,Rt.rectVertices[17+k]=S,Rt.rectVertices[23+k]=y,Rt.rectVertices[24+k]=x,Rt.rectVertices[25+k]=T,Rt.rectVertices[26+k]=S,Rt.rectVertices[32+k]=y,Rt.rectVertices[33+k]=x,Rt.rectVertices[34+k]=T,Rt.rectVertices[35+k]=S;var I=9*Rt.bufferIndex*4;Rt.rectVertices[I]=s,Rt.rectVertices[1+I]=a,Rt.rectVertices[2+I]=-5,Rt.rectVertices[9+I]=o,Rt.rectVertices[10+I]=l,Rt.rectVertices[11+I]=-5,Rt.rectVertices[18+I]=u,Rt.rectVertices[19+I]=h,Rt.rectVertices[20+I]=-5,Rt.rectVertices[27+I]=c,Rt.rectVertices[28+I]=d,Rt.rectVertices[29+I]=-5,++Rt.bufferIndex,Rt.lastTexture=p},drawImageScale:function(e,t,i,n,r,s,a,o,l,u,h){var c=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&c!=Rt.lastTexture)&&this.drawBuffer();var d=t/c.get_realWidth(),_=i/c.get_realHeight(),f=(t+n)/c.get_realWidth(),p=(i+r)/c.get_realHeight(),g=9*Rt.bufferIndex*4;Rt.rectVertices[3+g]=d,Rt.rectVertices[4+g]=p,Rt.rectVertices[12+g]=d,Rt.rectVertices[13+g]=_,Rt.rectVertices[21+g]=f,Rt.rectVertices[22+g]=_,Rt.rectVertices[30+g]=f,Rt.rectVertices[31+g]=p;var m=.00392156862745098*((16711680&h)>>>16),v=.00392156862745098*((65280&h)>>>8),b=.00392156862745098*(255&h),w=9*Rt.bufferIndex*4;Rt.rectVertices[5+w]=m,Rt.rectVertices[6+w]=v,Rt.rectVertices[7+w]=b,Rt.rectVertices[8+w]=u,Rt.rectVertices[14+w]=m,Rt.rectVertices[15+w]=v,Rt.rectVertices[16+w]=b,Rt.rectVertices[17+w]=u,Rt.rectVertices[23+w]=m,Rt.rectVertices[24+w]=v,Rt.rectVertices[25+w]=b,Rt.rectVertices[26+w]=u,Rt.rectVertices[32+w]=m,Rt.rectVertices[33+w]=v,Rt.rectVertices[34+w]=b,Rt.rectVertices[35+w]=u;var y=9*Rt.bufferIndex*4;Rt.rectVertices[y]=s,Rt.rectVertices[1+y]=l,Rt.rectVertices[2+y]=-5,Rt.rectVertices[9+y]=s,Rt.rectVertices[10+y]=a,Rt.rectVertices[11+y]=-5,Rt.rectVertices[18+y]=o,Rt.rectVertices[19+y]=a,Rt.rectVertices[20+y]=-5,Rt.rectVertices[27+y]=o,Rt.rectVertices[28+y]=l,Rt.rectVertices[29+y]=-5,++Rt.bufferIndex,Rt.lastTexture=c},end:function(){0>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.rectVertices[3+i]=r,Ot.rectVertices[4+i]=s,Ot.rectVertices[5+i]=a,Ot.rectVertices[6+i]=n,Ot.rectVertices[10+i]=r,Ot.rectVertices[11+i]=s,Ot.rectVertices[12+i]=a,Ot.rectVertices[13+i]=n,Ot.rectVertices[17+i]=r,Ot.rectVertices[18+i]=s,Ot.rectVertices[19+i]=a,Ot.rectVertices[20+i]=n,Ot.rectVertices[24+i]=r,Ot.rectVertices[25+i]=s,Ot.rectVertices[26+i]=a,Ot.rectVertices[27+i]=n},setTriVertices:function(e,t,i,n,r,s){var a=7*Ot.triangleBufferIndex*3;Ot.triangleVertices[a]=e,Ot.triangleVertices[1+a]=t,Ot.triangleVertices[2+a]=-5,Ot.triangleVertices[7+a]=i,Ot.triangleVertices[8+a]=n,Ot.triangleVertices[9+a]=-5,Ot.triangleVertices[14+a]=r,Ot.triangleVertices[15+a]=s,Ot.triangleVertices[16+a]=-5},setTriColors:function(e,t){var i=7*Ot.triangleBufferIndex*3,n=e*(.00392156862745098*(t>>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.triangleVertices[3+i]=r,Ot.triangleVertices[4+i]=s,Ot.triangleVertices[5+i]=a,Ot.triangleVertices[6+i]=n,Ot.triangleVertices[10+i]=r,Ot.triangleVertices[11+i]=s,Ot.triangleVertices[12+i]=a,Ot.triangleVertices[13+i]=n,Ot.triangleVertices[17+i]=r,Ot.triangleVertices[18+i]=s,Ot.triangleVertices[19+i]=a,Ot.triangleVertices[20+i]=n},drawBuffer:function(e){e||0>>24));Vt.rectVertices[5+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[6+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[7+i]=.00392156862745098*(255&t),Vt.rectVertices[8+i]=n,Vt.rectVertices[14+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[15+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[16+i]=.00392156862745098*(255&t),Vt.rectVertices[17+i]=n,Vt.rectVertices[23+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[24+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[25+i]=.00392156862745098*(255&t),Vt.rectVertices[26+i]=n,Vt.rectVertices[32+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[33+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[34+i]=.00392156862745098*(255&t),Vt.rectVertices[35+i]=n},drawBuffer:function(){Vt.rectVertexBuffer.unlock(4*Vt.bufferIndex),this.g.setVertexBuffer(Vt.rectVertexBuffer),this.g.setIndexBuffer(Vt.indexBuffer),this.g.setPipeline(this.myPipeline.pipeline),this.g.setTexture(this.myPipeline.textureLocation,Vt.lastTexture),this.g.setMatrix(this.myPipeline.projectionLocation,this.projectionMatrix),this.g.setTextureParameters(this.myPipeline.textureLocation,2,2,this.bilinear?1:0,this.bilinear?1:0,0),this.g.drawIndexedVertices(0,2*Vt.bufferIndex*3),this.g.setTexture(this.myPipeline.textureLocation,null),Vt.bufferIndex=0,Vt.rectVertices=Vt.rectVertexBuffer.lock()},setBilinearFilter:function(e){this.end(),this.bilinear=e},setFont:function(e){this.font=g.__cast(e,D)},bakedQuadCache:null,drawString:function(e,t,i,n,r,s){var a=this.font._get(this.fontSize),o=a.getTexture();null!=Vt.lastTexture&&o!=Vt.lastTexture&&this.drawBuffer(),Vt.lastTexture=o;for(var l=n,u=r,h=0,c=e.length;h>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e},Dt.createImageVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createImagePipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_image_frag,t.vertexShader=z.painter_image_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createColoredVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("vertexColor",3),e},Dt.createColoredPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_colored_frag,t.vertexShader=z.painter_colored_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createTextVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createTextPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_text_frag,t.vertexShader=z.painter_text_vert,t.inputLayout=[e],t.blendSource=3,t.blendDestination=5,t.alphaBlendSource=3,t.alphaBlendDestination=5,t},Dt.__super__=Ze,Dt.prototype=r(Ze.prototype,{myColor:null,myFont:null,projectionMatrix:null,imagePainter:null,coloredPainter:null,textPainter:null,canvas:null,g:null,setProjection:function(){var e=this.canvas.get_width(),t=this.canvas.get_height();if(this.canvas instanceof A){var i=this.projectionMatrix,n=2/e,r=-e/e,s=2/(0-t),a=-t/(0-t);i._00=n,i._10=0,i._20=0,i._30=r,i._01=0,i._11=s,i._21=0,i._31=a,i._02=0,i._12=0,i._22=-.002000200020002,i._32=-1.0002000200020003,i._03=0,i._13=0,i._23=0,i._33=1}else if(R.get_nonPow2Supported()||(e=Dt.upperPowerOfTwo(e),t=Dt.upperPowerOfTwo(t)),R.renderTargetsInvertedY()){var o=this.projectionMatrix,l=2/e,u=-e/e,h=2/t,c=-t/t;o._00=l,o._10=0,o._20=0,o._30=u,o._01=0,o._11=h,o._21=0,o._31=c,o._02=0,o._12=0,o._22=-.002000200020002,o._32=-1.0002000200020003,o._03=0,o._13=0,o._23=0,o._33=1}else{var d=this.projectionMatrix,_=2/e,f=-e/e,p=2/(0-t),g=-t/(0-t);d._00=_,d._10=0,d._20=0,d._30=f,d._01=0,d._11=p,d._21=0,d._31=g,d._02=0,d._12=0,d._22=-.002000200020002,d._32=-1.0002000200020003,d._03=0,d._13=0,d._23=0,d._33=1}this.imagePainter.setProjection(this.projectionMatrix),this.coloredPainter.setProjection(this.projectionMatrix),this.textPainter.setProjection(this.projectionMatrix)},drawImage:function(e,t,i){var n=this.coloredPainter;0>>16),G=.00392156862745098*((65280&U)>>>8),z=.00392156862745098*(255&U),X=.00392156862745098*(U>>>24)*D,K=9*Rt.bufferIndex*4;Rt.rectVertices[5+K]=W,Rt.rectVertices[6+K]=G,Rt.rectVertices[7+K]=z,Rt.rectVertices[8+K]=X,Rt.rectVertices[14+K]=W,Rt.rectVertices[15+K]=G,Rt.rectVertices[16+K]=z,Rt.rectVertices[17+K]=X,Rt.rectVertices[23+K]=W,Rt.rectVertices[24+K]=G,Rt.rectVertices[25+K]=z,Rt.rectVertices[26+K]=X,Rt.rectVertices[32+K]=W,Rt.rectVertices[33+K]=G,Rt.rectVertices[34+K]=z,Rt.rectVertices[35+K]=X;var Y=H.get_width()/H.get_realWidth(),Z=H.get_height()/H.get_realHeight(),j=9*Rt.bufferIndex*4;Rt.rectVertices[3+j]=0,Rt.rectVertices[4+j]=Z,Rt.rectVertices[12+j]=0,Rt.rectVertices[13+j]=0,Rt.rectVertices[21+j]=Y,Rt.rectVertices[22+j]=0,Rt.rectVertices[30+j]=Y,Rt.rectVertices[31+j]=Z;var q=9*Rt.bufferIndex*4;Rt.rectVertices[q]=d,Rt.rectVertices[1+q]=_,Rt.rectVertices[2+q]=-5,Rt.rectVertices[9+q]=w,Rt.rectVertices[10+q]=y,Rt.rectVertices[11+q]=-5,Rt.rectVertices[18+q]=B,Rt.rectVertices[19+q]=E,Rt.rectVertices[20+q]=-5,Rt.rectVertices[27+q]=R,Rt.rectVertices[28+q]=O,Rt.rectVertices[29+q]=-5,++Rt.bufferIndex,Rt.lastTexture=H},drawScaledSubImage:function(e,t,i,n,r,s,a,o,l){var u=this.coloredPainter;0>>16),J=.00392156862745098*((65280&z)>>>8),$=.00392156862745098*(255&z),ee=.00392156862745098*(z>>>24)*G,te=9*Rt.bufferIndex*4;Rt.rectVertices[5+te]=Q,Rt.rectVertices[6+te]=J,Rt.rectVertices[7+te]=$,Rt.rectVertices[8+te]=ee,Rt.rectVertices[14+te]=Q,Rt.rectVertices[15+te]=J,Rt.rectVertices[16+te]=$,Rt.rectVertices[17+te]=ee,Rt.rectVertices[23+te]=Q,Rt.rectVertices[24+te]=J,Rt.rectVertices[25+te]=$,Rt.rectVertices[26+te]=ee,Rt.rectVertices[32+te]=Q,Rt.rectVertices[33+te]=J,Rt.rectVertices[34+te]=$,Rt.rectVertices[35+te]=ee;var ie=9*Rt.bufferIndex*4;Rt.rectVertices[ie]=g,Rt.rectVertices[1+ie]=m,Rt.rectVertices[2+ie]=-5,Rt.rectVertices[9+ie]=S,Rt.rectVertices[10+ie]=k,Rt.rectVertices[11+ie]=-5,Rt.rectVertices[18+ie]=F,Rt.rectVertices[19+ie]=A,Rt.rectVertices[20+ie]=-5,Rt.rectVertices[27+ie]=U,Rt.rectVertices[28+ie]=H,Rt.rectVertices[29+ie]=-5,++Rt.bufferIndex,Rt.lastTexture=X},get_color:function(){return this.myColor},set_color:function(e){return this.myColor=e},drawRect:function(e,t,i,n,r){null==r&&(r=1),this.imagePainter.end(),this.textPainter.end();var s=this.transformations[this.transformationIndex],a=e-r/2,o=t+r/2;null==o&&(o=0),null==a&&(a=0);var l=s._02*a+s._12*o+s._22,u=(s._00*a+s._10*o+s._20)/l,h=(s._01*a+s._11*o+s._21)/l;null==h&&(h=0),null==u&&(u=0);var c=u,d=h,_=this.transformations[this.transformationIndex],f=e-r/2,p=t-r/2;null==p&&(p=0),null==f&&(f=0);var g=_._02*f+_._12*p+_._22,m=(_._00*f+_._10*p+_._20)/g,v=(_._01*f+_._11*p+_._21)/g;null==v&&(v=0),null==m&&(m=0);var b=m,w=v,y=this.transformations[this.transformationIndex],x=e+i+r/2,T=t-r/2;null==T&&(T=0),null==x&&(x=0);var S=y._02*x+y._12*T+y._22,k=(y._00*x+y._10*T+y._20)/S,I=(y._01*x+y._11*T+y._21)/S;null==I&&(I=0),null==k&&(k=0);var C=k,B=I,E=this.transformations[this.transformationIndex],N=e+i+r/2,L=t+r/2;null==L&&(L=0),null==N&&(N=0);var F=E._02*N+E._12*L+E._22,A=(E._00*N+E._10*L+E._20)/F,M=(E._01*N+E._11*L+E._21)/F;null==M&&(M=0),null==A&&(A=0);var P=A,R=M;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var O=this.transformations[this.transformationIndex],V=e-r/2,D=t+n-r/2;null==D&&(D=0),null==V&&(V=0);var U=O._02*V+O._12*D+O._22,H=(O._00*V+O._10*D+O._20)/U,W=(O._01*V+O._11*D+O._21)/U;null==W&&(W=0),null==H&&(H=0),c=H,d=W;var G=this.transformations[this.transformationIndex],z=e-r/2,X=t+r/2;null==X&&(X=0),null==z&&(z=0);var K=G._02*z+G._12*X+G._22,Y=(G._00*z+G._10*X+G._20)/K,Z=(G._01*z+G._11*X+G._21)/K;null==Z&&(Z=0),null==Y&&(Y=0),b=Y,w=Z;var j=this.transformations[this.transformationIndex],q=e+r/2,Q=t+r/2;null==Q&&(Q=0),null==q&&(q=0);var J=j._02*q+j._12*Q+j._22,$=(j._00*q+j._10*Q+j._20)/J,ee=(j._01*q+j._11*Q+j._21)/J;null==ee&&(ee=0),null==$&&($=0),C=$,B=ee;var te=this.transformations[this.transformationIndex],ie=e+r/2,ne=t+n-r/2;null==ne&&(ne=0),null==ie&&(ie=0);var re=te._02*ie+te._12*ne+te._22,se=(te._00*ie+te._10*ne+te._20)/re,ae=(te._01*ie+te._11*ne+te._21)/re;null==ae&&(ae=0),null==se&&(se=0),P=se,R=ae,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var oe=this.transformations[this.transformationIndex],le=e-r/2,ue=t+n+r/2;null==ue&&(ue=0),null==le&&(le=0);var he=oe._02*le+oe._12*ue+oe._22,ce=(oe._00*le+oe._10*ue+oe._20)/he,de=(oe._01*le+oe._11*ue+oe._21)/he;null==de&&(de=0),null==ce&&(ce=0),c=ce,d=de;var _e=this.transformations[this.transformationIndex],fe=e-r/2,pe=t+n-r/2;null==pe&&(pe=0),null==fe&&(fe=0);var ge=_e._02*fe+_e._12*pe+_e._22,me=(_e._00*fe+_e._10*pe+_e._20)/ge,ve=(_e._01*fe+_e._11*pe+_e._21)/ge;null==ve&&(ve=0),null==me&&(me=0),b=me,w=ve;var be=this.transformations[this.transformationIndex],we=e+i+r/2,ye=t+n-r/2;null==ye&&(ye=0),null==we&&(we=0);var xe=be._02*we+be._12*ye+be._22,Te=(be._00*we+be._10*ye+be._20)/xe,Se=(be._01*we+be._11*ye+be._21)/xe;null==Se&&(Se=0),null==Te&&(Te=0),C=Te,B=Se;var ke=this.transformations[this.transformationIndex],Ie=e+i+r/2,Ce=t+n+r/2;null==Ce&&(Ce=0),null==Ie&&(Ie=0);var Be=ke._02*Ie+ke._12*Ce+ke._22,Ee=(ke._00*Ie+ke._10*Ce+ke._20)/Be,Ne=(ke._01*Ie+ke._11*Ce+ke._21)/Be;null==Ne&&(Ne=0),null==Ee&&(Ee=0),P=Ee,R=Ne,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var Le=this.transformations[this.transformationIndex],Fe=e+i-r/2,Ae=t+n-r/2;null==Ae&&(Ae=0),null==Fe&&(Fe=0);var Me=Le._02*Fe+Le._12*Ae+Le._22,Pe=(Le._00*Fe+Le._10*Ae+Le._20)/Me,Re=(Le._01*Fe+Le._11*Ae+Le._21)/Me;null==Re&&(Re=0),null==Pe&&(Pe=0),c=Pe,d=Re;var Oe=this.transformations[this.transformationIndex],Ve=e+i-r/2,De=t+r/2;null==De&&(De=0),null==Ve&&(Ve=0);var Ue=Oe._02*Ve+Oe._12*De+Oe._22,He=(Oe._00*Ve+Oe._10*De+Oe._20)/Ue,We=(Oe._01*Ve+Oe._11*De+Oe._21)/Ue;null==We&&(We=0),null==He&&(He=0),b=He,w=We;var Ge=this.transformations[this.transformationIndex],ze=e+i+r/2,Xe=t+r/2;null==Xe&&(Xe=0),null==ze&&(ze=0);var Ke=Ge._02*ze+Ge._12*Xe+Ge._22,Ye=(Ge._00*ze+Ge._10*Xe+Ge._20)/Ke,Ze=(Ge._01*ze+Ge._11*Xe+Ge._21)/Ke;null==Ze&&(Ze=0),null==Ye&&(Ye=0),C=Ye,B=Ze;var je=this.transformations[this.transformationIndex],qe=e+i+r/2,Qe=t+n-r/2;null==Qe&&(Qe=0),null==qe&&(qe=0);var Je=je._02*qe+je._12*Qe+je._22,$e=(je._00*qe+je._10*Qe+je._20)/Je,et=(je._01*qe+je._11*Qe+je._21)/Je;null==et&&(et=0),null==$e&&($e=0),P=$e,R=et,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R)},fillRect:function(e,t,i,n){this.imagePainter.end(),this.textPainter.end();var r=this.transformations[this.transformationIndex],s=e,a=t+n;null==a&&(a=0),null==s&&(s=0);var o=r._02*s+r._12*a+r._22,l=(r._00*s+r._10*a+r._20)/o,u=(r._01*s+r._11*a+r._21)/o;null==u&&(u=0),null==l&&(l=0);var h=l,c=u,d=this.transformations[this.transformationIndex],_=e,f=t;null==f&&(f=0),null==_&&(_=0);var p=d._02*_+d._12*f+d._22,g=(d._00*_+d._10*f+d._20)/p,m=(d._01*_+d._11*f+d._21)/p;null==m&&(m=0),null==g&&(g=0);var v=g,b=m,w=this.transformations[this.transformationIndex],y=e+i,x=t;null==x&&(x=0),null==y&&(y=0);var T=w._02*y+w._12*x+w._22,S=(w._00*y+w._10*x+w._20)/T,k=(w._01*y+w._11*x+w._21)/T;null==k&&(k=0),null==S&&(S=0);var I=S,C=k,B=this.transformations[this.transformationIndex],E=e+i,N=t+n;null==N&&(N=0),null==E&&(E=0);var L=B._02*E+B._12*N+B._22,F=(B._00*E+B._10*N+B._20)/L,A=(B._01*E+B._11*N+B._21)/L;null==A&&(A=0),null==F&&(F=0);var M=F,P=A;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),h,c,v,b,I,C,M,P)},drawString:function(e,t,i){this.imagePainter.end();var n=this.coloredPainter;0=Qt.instances.length?null:Qt.instances[e]},Qt.notifyOnConnect=function(e,t){null!=e&&Qt.connectListeners.push(e),null!=t&&Qt.disconnectListeners.push(t)},Qt.removeConnect=function(e,t){null!=e&&it.remove(Qt.connectListeners,e),null!=t&&it.remove(Qt.disconnectListeners,t)},Qt.sendConnectEvent=function(e){Qt.instances[e].connected=!0;for(var t=0,i=Qt.connectListeners;t>23&255,n=8388607&e;switch(i){case 0:return 0;case 255:return 0!=n?NaN:0>>t&1)){return!0}return!1},si.toText=function(e,t){for(var i="",n=0,r=t;n>>16)}),"R",0,1,!0),r=e.slider(t.nest(1,{value:.00392156862745098*((65280&t.color)>>>8)}),"G",0,1,!0),s=e.slider(t.nest(2,{value:.00392156862745098*(255&t.color)}),"B",0,1,!0),a=.00392156862745098*(t.color>>>24);i&&(a=e.slider(t.nest(3,{value:a}),"A",0,1,!0));var o=N.fromFloats(n,r,s,a);return e.text("",2,o),o},Ci.initPath=function(e,t){e.text="Windows"==t?"C:\\Users":"/"},Ci.fileBrowser=function(e,t,i){null==i&&(i=!1);var n="/",r="ls ",s=mt.get_systemId();"Windows"==s&&(r="dir /b ",i&&(r+="/ad "),n="\\",t.text=ut.replace(t.text,"\\\\","\\"),t.text=ut.replace(t.text,"\r","")),""==t.text&&Ci.initPath(t,s);var a=Krom.getFilesLocation()+n+Ci.dataPath+"dir.txt";t.text!=Ci.lastPath&&Krom.sysCommand(r+'"'+t.text+'" > "'+a+'"'),Ci.lastPath=t.text;var o=he.ofData(Krom.loadBlob(a)).toString().split("\n"),l=t.text.indexOf("/"),u=t.text.indexOf("\\"),h=-1l||-1u;t.changed=!1,h&&e.button("..",0)&&(t.changed=e.changed=!0,t.text=t.text.substring(0,t.text.lastIndexOf(n)),2==t.text.length&&":"==t.text.charAt(1)&&(t.text+=n));for(var c=0;c=i.length&&(t.position=0),t.changed=e.changed=!0):t.changed=!1;var r=e.getHover();return Ci.drawInlineRadio(e,i[t.position],r,n),e.endElement(),t.position},Ci.drawInlineRadio=function(e,t,i,n){null==n&&(n=1),i?(e.g.set_color(e.t.ACCENT_HOVER_COL),e.g.fillRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)):(e.g.set_color(e.t.ACCENT_COL),e.enabled||e.fadeColor(),e.g.drawRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)),e.g.set_color(e.t.TEXT_COL),e.drawString(e.g,t,e.t.TEXT_OFFSET*e.ops.scaleFactor,0,n)},Ci.colorWheel=function(e,t,i,n,r,s){null==s&&(s=!0),null==r&&(r=!1),null==i&&(i=!1),null==n&&(n=e._w),Ci.rgbToHsv(.00392156862745098*((16711680&t.color)>>>16),.00392156862745098*((65280&t.color)>>>8),.00392156862745098*(255&t.color),Ci.ar);var a=Ci.ar[0],o=Ci.ar[1],l=Ci.ar[2],u=.00392156862745098*(t.color>>>24),h=e._x,c=e._y;null!=e.currentWindow&&e.currentWindow.scrollEnabled||(n-=e.t.SCROLL_W*e.ops.scaleFactor|0,h+=(e.t.SCROLL_W*e.ops.scaleFactor|0)/2),e.image(e.ops.color_wheel,N.fromFloats(l,l,l));var d=h+n/2,_=c+(e._y-c)/2,f=.7*n,p=f/2,g=d,m=_+o*p,v=a*(2*Math.PI),b=Math.cos(v)*(g-d)-Math.sin(v)*(m-_)+d,w=Math.sin(v)*(g-d)+Math.cos(v)*(m-_)+_;g=b,m=w,e.g.set_color(-16777216),e.g.fillRect(g-3*e.ops.scaleFactor,m-3*e.ops.scaleFactor,6*e.ops.scaleFactor,6*e.ops.scaleFactor),e.g.set_color(-1),e.g.fillRect(g-2*e.ops.scaleFactor,m-2*e.ops.scaleFactor,4*e.ops.scaleFactor,4*e.ops.scaleFactor),r&&(i?e.row([.3333333333333333,.3333333333333333,.3333333333333333]):e.row([.5,.5]));var y=t.nest(0);if(y.value=Math.round(100*l)/100,l=e.slider(y,"Value",0,1,!0),y.changed?t.changed=e.changed=!0:t.changed=!1,i){var x=t.nest(1,{value:Math.round(100*u)/100});u=e.slider(x,"Alpha",0,1,!0),x.changed&&(t.changed=e.changed=!0)}var T=d+e._windowX,S=_+e._windowY;if(e.inputStarted&&e.getInputInRect(T-p,S-p,f,f)&&(Ci.wheelSelectedHande=t),e.inputReleased&&(Ci.wheelSelectedHande=null),e.inputDown&&Ci.wheelSelectedHande==t){var k=T-e.inputX,I=S-e.inputY;o=Math.min(Math.sqrt(k*k+I*I),p)/p;var C=Math.atan2(e.inputX-T,e.inputY-S);C<0&&(C=Math.PI+(Math.PI-Math.abs(C))),a=(C=2*Math.PI-C)/(2*Math.PI),t.changed=e.changed=!0}return Ci.hsvToRgb(a,o,l,Ci.ar),t.color=N.fromFloats(Ci.ar[0],Ci.ar[1],Ci.ar[2],u),s&&e.text("",2,t.color),t.color},Ci.keycodeToString=function(e){switch(e){case-1:return"None";case 0:return"Unknown";case 1:return"Back";case 3:return"Cancel";case 6:return"Help";case 8:return"Backspace";case 9:return"Tab";case 12:return"Clear";case 13:return"Return";case 16:return"Shift";case 17:return"Ctrl";case 18:return"Alt";case 19:return"Pause";case 20:return"CapsLock";case 21:return"Kana";case 22:return"Eisu";case 23:return"Junja";case 24:return"Final";case 25:return"Hanja";case 27:return"Esc";case 28:return"Convert";case 29:return"NonConvert";case 30:return"Accept";case 31:return"ModeChange";case 32:return"Space";case 33:return"PageUp";case 34:return"PageDown";case 35:return"End";case 36:return"Home";case 37:return"Left";case 38:return"Up";case 39:return"Right";case 40:return"Down";case 41:return"Select";case 42:return"Print";case 43:return"Execute";case 44:return"PrintScreen";case 45:return"Insert";case 46:return"Delete";case 58:return"Colon";case 59:return"Semicolon";case 60:return"LessThan";case 61:return"Equals";case 62:return"GreaterThan";case 63:return"QuestionMark";case 64:return"At";case 91:return"Win";case 93:return"ContextMenu";case 95:return"Sleep";case 96:return"Numpad0";case 97:return"Numpad1";case 98:return"Numpad2";case 99:return"Numpad3";case 100:return"Numpad4";case 101:return"Numpad5";case 102:return"Numpad6";case 103:return"Numpad7";case 104:return"Numpad8";case 105:return"Numpad9";case 106:return"Multiply";case 107:return"Add";case 108:return"Separator";case 109:return"Subtract";case 110:return"Decimal";case 111:return"Divide";case 112:return"F1";case 113:return"F2";case 114:return"F3";case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 124:return"F13";case 125:return"F14";case 126:return"F15";case 127:return"F16";case 128:return"F17";case 129:return"F18";case 130:return"F19";case 131:return"F20";case 132:return"F21";case 133:return"F22";case 134:return"F23";case 135:return"F24";case 144:return"NumLock";case 145:return"ScrollLock";case 146:return"WinOemFjJisho";case 147:return"WinOemFjMasshou";case 148:return"WinOemFjTouroku";case 149:return"WinOemFjLoya";case 150:return"WinOemFjRoya";case 160:return"Circumflex";case 161:return"Exclamation";case 162:return"DoubleQuote";case 163:return"Hash";case 164:return"Dollar";case 165:return"Percent";case 166:return"Ampersand";case 167:return"Underscore";case 168:return"OpenParen";case 169:return"CloseParen";case 170:return"Asterisk";case 171:return"Plus";case 172:return"Pipe";case 173:return"HyphenMinus";case 174:return"OpenCurlyBracket";case 175:return"CloseCurlyBracket";case 176:return"Tilde";case 181:return"VolumeMute";case 182:return"VolumeDown";case 183:return"VolumeUp";case 188:return"Comma";case 190:return"Period";case 191:return"Slash";case 192:return"BackQuote";case 219:return"OpenBracket";case 220:return"BackSlash";case 221:return"CloseBracket";case 222:return"Quote";case 224:return"Meta";case 225:return"AltGr";case 227:return"WinIcoHelp";case 228:return"WinIco00";case 230:return"WinIcoClear";case 233:return"WinOemReset";case 234:return"WinOemJump";case 235:return"WinOemPA1";case 236:return"WinOemPA2";case 237:return"WinOemPA3";case 238:return"WinOemWSCTRL";case 239:return"WinOemCUSEL";case 240:return"WinOemATTN";case 241:return"WinOemFinish";case 242:return"WinOemCopy";case 243:return"WinOemAuto";case 244:return"WinOemENLW";case 245:return"WinOemBackTab";case 246:return"ATTN";case 247:return"CRSEL";case 248:return"EXSEL";case 249:return"EREOF";case 250:return"Play";case 251:return"Zoom";case 253:return"PA1";case 254:return"WinOemClear"}return String.fromCodePoint(e)},Ci.dist=function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)},Ci.fract=function(e){return e-(0|e)},Ci.mix=function(e,t,i){return e*(1-i)+t*i},Ci.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},Ci.step=function(e,t){return tEi.modalX+Ei.modalW||Ei.ui.inputYEi.modalY+Ei.modalH)&&(Ei.show=!1)},Ei.showMessage=function(e,t,i){Ei.ui=e,Ei.init(),Ei.boxTitle=t,Ei.boxText=i,Ei.boxCommands=null},Ei.showCustom=function(e,t,i,n,r,s){null==s&&(s=160),null==r&&(r=400),null==n&&(n=-1),null==i&&(i=-1),Ei.ui=e,Ei.init(i,n,r,s),Ei.boxTitle="",Ei.boxText="",Ei.boxCommands=t},Ei.init=function(e,t,i,n){null==n&&(n=160),null==i&&(i=400),null==t&&(t=-1),null==e&&(e=-1);var r=mt.windowWidth(),s=mt.windowHeight();Ei.modalX=e,Ei.modalY=t,Ei.modalW=i*Ei.ui.ops.scaleFactor|0,Ei.modalH=n*Ei.ui.ops.scaleFactor|0,-1==e&&(Ei.modalX=r/2-Ei.modalW/2|0),-1==t&&(Ei.modalY=s/2-Ei.modalH/2|0),Ei.modalX=0|Math.max(0,Math.min(Ei.modalX,r-Ei.modalW)),Ei.modalY=0|Math.max(0,Math.min(Ei.modalY,s-Ei.modalH)),Ei.hwnd.dragX=0,Ei.hwnd.dragY=0,Ei.show=!0};var Ni=function(){};(T["zui.Themes"]=Ni).__name__=!0;var Li=function(e){this.restoreY=-1,this.restoreX=-1,this.checkSelectImage=null,this.elementsBaked=!1,this.tabScroll=0,this.tabHandle=null,this.tabNames=null,this.tooltipTime=0,this.tooltipWait=!1,this.tooltipShown=!1,this.tooltipY=0,this.tooltipX=0,this.tooltipInvertY=!1,this.tooltipImgMaxWidth=null,this.tooltipImg=null,this.tooltipText="",this.comboToSubmit=0,this.submitComboHandle=null,this.comboSelectedWindow=null,this.comboSelectedHandle=null,this.tabPressedHandle=null,this.tabPressed=!1,this.textToSubmit="",this.submitTextHandle=null,this.textSelectedHandle=null,this.windowHeader=0,this.dragHandle=null,this.scrollHandle=null,this.windowEnded=!0,this._windowY=0,this._windowX=0,this.imageScrollAlign=!0,this.scrollAlign=0,this.curRatio=-1,this.highlightAnchor=0,this.cursorY=0,this.cursorX=0,this.key=null,this.isReturnDown=!1,this.isEscapeDown=!1,this.isDeleteDown=!1,this.isBackspaceDown=!1,this.isAltDown=!1,this.isCtrlDown=!1,this.isShiftDown=!1,this.isKeyDown=!1,this.isKeyPressed=!1,this.inputWheelDelta=0,this.inputEnabled=!0,this.inputRegistered=!1,this.alwaysRedraw=!1,this.scrollEnabled=!0,this.imageInvertY=!1,this.changed=!1,this.isReleased=!1,this.isHovered=!1,this.isPushed=!1,this.isStarted=!1,this.enabled=!0,this.isTyping=!1,this.isScrolling=!1,null==e.theme&&(e.theme=Ni.dark),this.t=e.theme,null==e.khaWindowId&&(e.khaWindowId=0),null==e.scaleFactor&&(e.scaleFactor=1),null==e.autoNotifyInput&&(e.autoNotifyInput=!0),this.ops=e,this.setScale(e.scaleFactor),e.autoNotifyInput&&this.registerInput(),null==Li.copyReceiver&&(Li.copyReceiver=this,mt.notifyOnCutCopyPaste(Fi(this,this.onCut),Fi(this,this.onCopy),Fi(this,this.onPaste)),mt.notifyOnFrames(function(e){(Li.isCopy||Li.isPaste)&&1<++Li.copyFrame&&(Li.isCopy=Li.isCut=Li.isPaste=!1,Li.copyFrame=0)}));var t=Dt.createTextVertexStructure();this.rtTextPipeline=Dt.createTextPipeline(t),this.rtTextPipeline.alphaBlendSource=1,this.rtTextPipeline.compile()};function Fi(e,t){return null==t?null:(null==t.__id__&&(t.__id__=n.$haxeUID++),null==e.hx__closures__?e.hx__closures__={}:i=e.hx__closures__[t.__id__],null==i&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i);var i}(T["zui.Zui"]=Li).__name__=!0,Li.prototype={isScrolling:null,isTyping:null,enabled:null,isStarted:null,isPushed:null,isHovered:null,isReleased:null,changed:null,imageInvertY:null,scrollEnabled:null,alwaysRedraw:null,inputRegistered:null,inputEnabled:null,inputX:null,inputY:null,inputStartedX:null,inputStartedY:null,inputDX:null,inputDY:null,inputWheelDelta:null,inputStarted:null,inputStartedR:null,inputReleased:null,inputReleasedR:null,inputDown:null,inputDownR:null,isKeyPressed:null,isKeyDown:null,isShiftDown:null,isCtrlDown:null,isAltDown:null,isBackspaceDown:null,isDeleteDown:null,isEscapeDown:null,isReturnDown:null,key:null,char:null,cursorX:null,cursorY:null,highlightAnchor:null,ratios:null,curRatio:null,xBeforeSplit:null,wBeforeSplit:null,g:null,t:null,ops:null,globalG:null,rtTextPipeline:null,fontSize:null,fontOffsetY:null,arrowOffsetX:null,arrowOffsetY:null,titleOffsetX:null,buttonOffsetY:null,checkOffsetX:null,checkOffsetY:null,checkSelectOffsetX:null,checkSelectOffsetY:null,radioOffsetX:null,radioOffsetY:null,radioSelectOffsetX:null,radioSelectOffsetY:null,scrollAlign:null,imageScrollAlign:null,_x:null,_y:null,_w:null,_h:null,_windowX:null,_windowY:null,_windowW:null,_windowH:null,currentWindow:null,windowEnded:null,scrollHandle:null,dragHandle:null,windowHeader:null,textSelectedHandle:null,textSelectedCurrentText:null,submitTextHandle:null,textToSubmit:null,tabPressed:null,tabPressedHandle:null,comboSelectedHandle:null,comboSelectedWindow:null,comboSelectedAlign:null,comboSelectedTexts:null,comboSelectedLabel:null,comboSelectedX:null,comboSelectedY:null,comboSelectedW:null,submitComboHandle:null,comboToSubmit:null,tooltipText:null,tooltipImg:null,tooltipImgMaxWidth:null,tooltipInvertY:null,tooltipX:null,tooltipY:null,tooltipShown:null,tooltipWait:null,tooltipTime:null,tabNames:null,tabHandle:null,tabScroll:null,elementsBaked:null,checkSelectImage:null,setScale:function(e){this.ops.scaleFactor=e,this.fontSize=this.t.FONT_SIZE*this.ops.scaleFactor|0;var t=this.ops.font.height(this.fontSize);this.fontOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-t)/2,this.arrowOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.ARROW_SIZE*this.ops.scaleFactor)/2,this.arrowOffsetX=this.arrowOffsetY,this.titleOffsetX=(2*this.arrowOffsetX+this.t.ARROW_SIZE*this.ops.scaleFactor)/this.ops.scaleFactor,this.buttonOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.BUTTON_H*this.ops.scaleFactor)/2,this.checkOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.checkOffsetX=this.checkOffsetY,this.checkSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.checkSelectOffsetX=this.checkSelectOffsetY,this.radioOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.radioOffsetX=this.radioOffsetY,this.radioSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.radioSelectOffsetX=this.radioSelectOffsetY,this.elementsBaked=!1},bakeElements:function(){null!=this.checkSelectImage&&this.checkSelectImage.unload(),this.checkSelectImage=R.createRenderTarget(this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,null,0,1,this.ops.khaWindowId);var e=this.checkSelectImage.get_g2();e.begin(!0,0),e.set_color(this.t.ACCENT_SELECT_COL),e.drawLine(0,0,this.checkSelectImage.get_width(),this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.drawLine(this.checkSelectImage.get_width(),0,0,this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.end(),this.elementsBaked=!0},remove:function(){this.ops.autoNotifyInput&&this.unregisterInput()},registerInput:function(){ti.get().notifyWindowed(this.ops.khaWindowId,Fi(this,this.onMouseDown),Fi(this,this.onMouseUp),Fi(this,this.onMouseMove),Fi(this,this.onMouseWheel)),ei.get().notify(Fi(this,this.onKeyDown),Fi(this,this.onKeyUp),Fi(this,this.onKeyPress)),this.inputRegistered=!0},unregisterInput:function(){ti.get().removeWindowed(this.ops.khaWindowId,Fi(this,this.onMouseDown),Fi(this,this.onMouseUp),Fi(this,this.onMouseMove),Fi(this,this.onMouseWheel)),ei.get().remove(Fi(this,this.onKeyDown),Fi(this,this.onKeyUp),Fi(this,this.onKeyPress)),this.endInput(),this.inputX=this.inputY=0,this.inputRegistered=!1},begin:function(e){this.elementsBaked||this.bakeElements(),this.changed=!1,this.globalG=e,this._x=0,this._y=0,this._w=0,this._h=0},end:function(e){null==e&&(e=!0),this.windowEnded||this.endWindow(),this.drawCombo(),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},beginRegion:function(e,t,i,n){this.elementsBaked||(e.end(),this.bakeElements(),e.begin(!1)),this.changed=!1,this.globalG=e,this.g=e,this.currentWindow=null,this.tooltipText="",this.tooltipImg=null,this._windowX=0,this._windowY=0,this._windowW=n,this._x=t,this._y=i,this._w=n},endRegion:function(e){null==e&&(e=!0),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},endInput:function(){this.isKeyPressed=!1,this.inputStarted=!1,this.inputStartedR=!1,this.inputReleased=!1,this.inputReleasedR=!1,this.inputDX=0,this.inputDY=0,this.inputWheelDelta=0,Li.textToPaste="",Li.keyRepeat&&this.isKeyDown&&.05t.length?t.length:this.cursorX+1),this.isShiftDown&&(37==this.key||39==this.key||16==this.key)||this.isCtrlDown||(this.highlightAnchor=this.cursorX));""!=Li.textToPaste&&(t=it.substr(t,0,this.highlightAnchor)+Li.textToPaste+it.substr(t,this.cursorX,null),this.cursorX+=Li.textToPaste.length,this.highlightAnchor=this.cursorX,Li.textToPaste=""),this.highlightAnchor==this.cursorX?Li.textToCopy=t:this.highlightAnchorn&&(e.value=n),e.changed=this.changed=!0}var _=this.getHover();this.drawSlider(e.value,i,n,r,_),(this.getReleased()||this.tabPressed)&&l&&(e.text=e.value+"",this.startTextEdit(e),e.changed=this.changed=!0);var f=0==o?2:0;return this.textSelectedHandle==e&&this.updateTextEdit(f),this.submitTextHandle==e&&(this.submitTextEdit(),e.value=parseFloat(e.text),e.changed=this.changed=!0),this.g.set_color(this.t.LABEL_COL),this.drawString(this.g,t,null,0,o),a&&(this.g.set_color(this.t.TEXT_COL),this.textSelectedHandle!=e?this.drawString(this.g,e.value+"",null,0,f):this.drawString(this.g,this.textSelectedCurrentText,null,0,f)),this.endElement(),e.value},separator:function(e,t){null==t&&(t=!0),null==e&&(e=4),this.isVisible(this.t.ELEMENT_H*this.ops.scaleFactor)&&t&&(this.g.set_color(this.t.SEPARATOR_COL),this.g.fillRect(this._x,this._y,this._w,e*this.ops.scaleFactor)),this._y+=e*this.ops.scaleFactor},tooltip:function(e){this.tooltipText=e,this.tooltipY=this._y+this._windowY},tooltipImage:function(e,t){this.tooltipImg=e,this.tooltipImgMaxWidth=t,this.tooltipInvertY=this.imageInvertY,this.tooltipY=this._y+this._windowY},drawArrow:function(e){var t=this._x+this.arrowOffsetX,i=this._y+this.arrowOffsetY;this.g.set_color(this.t.TEXT_COL),e?this.g.fillTriangle(t,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor/2,i+this.t.ARROW_SIZE*this.ops.scaleFactor):this.g.fillTriangle(t,i,t,i+this.t.ARROW_SIZE*this.ops.scaleFactor,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i+this.t.ARROW_SIZE*this.ops.scaleFactor/2)},drawTree:function(e){var t=7*this.ops.scaleFactor,i=this._x+this.arrowOffsetX+1,n=this._y+this.arrowOffsetY+1;this.g.set_color(this.t.TEXT_COL),e?this.g.fillRect(i,n+t/2-1,t,t/8):(this.g.fillRect(i,n+t/2-1,t,t/8),this.g.fillRect(i+t/2-1,n,t/8,t))},drawCheck:function(e,t){var i=this._x+this.checkOffsetX,n=this._y+this.checkOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;if(0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e){this.g.set_color(-1),this.enabled||this.fadeColor();var u=this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0;this.g.drawScaledImage(this.checkSelectImage,i+this.checkSelectOffsetX,n+this.checkSelectOffsetY,u,u)}},drawRadio:function(e,t){var i=this._x+this.radioOffsetX,n=this._y+this.radioOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e&&(this.g.set_color(this.t.ACCENT_SELECT_COL),this.enabled||this.fadeColor(),this.g.fillRect(i+this.radioSelectOffsetX,n+this.radioSelectOffsetY,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor))},drawSlider:function(e,t,i,n,r){var s=this._x+this.buttonOffsetY,a=this._y+this.buttonOffsetY,o=this._w-2*this.buttonOffsetY;this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var l=this.g,u=this.t.FILL_ACCENT_BG,h=this.t.BUTTON_H*this.ops.scaleFactor,c=0;0==c&&(c=1),this.enabled||this.fadeColor(),u?l.fillRect(s,a-1,o,1+h):l.drawRect(s,a,o,h,c),this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var d=(e-t)/(i-t),_=8*this.ops.scaleFactor,f=n?s:s+(o-_)*d,p=n?o*d:_;p=Math.max(Math.min(p,o),0);var g=this.g,m=this.t.BUTTON_H*this.ops.scaleFactor,v=0;0==v&&(v=1),this.enabled||this.fadeColor(),g.fillRect(f,a-1,p,1+m)},drawCombo:function(){if(null!=this.comboSelectedHandle){var e=this.g;this.globalG.set_color(this.t.SEPARATOR_COL);var t=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor|0,i=(this.comboSelectedTexts.length+1)*t;this.globalG.begin(!1);var n=this.comboSelectedY-i-(this.t.ELEMENT_H*this.ops.scaleFactor|0),r=mt.windowHeight()-(this.comboSelectedY+i),s=r<0&&rthis.tooltipImgMaxWidth&&(e=this.tooltipImgMaxWidth);var t=this.tooltipImg.get_height()*(e/this.tooltipImg.get_width());this.tooltipX=Math.min(this.tooltipX,mt.windowWidth()-e-20),this.tooltipY=Math.min(this.tooltipY,mt.windowHeight()-t-20),this.globalG.set_color(-16777216),this.globalG.begin(!1),this.globalG.fillRect(this.tooltipX,this.tooltipY,e,t),this.globalG.set_color(-1),this.tooltipInvertY?this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY+t,e,-t):this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY,e,t),this.globalG.end()},drawString:function(e,t,i,n,r){null==r&&(r=0),null==n&&(n=0);var s=this._w/(this.fontSize/2|0)|0;t.length>s&&(t=t.substring(0,s)+".."),null==i&&(i=this.t.TEXT_OFFSET),i*=this.ops.scaleFactor,e.set_font(this.ops.font),e.set_fontSize(this.fontSize),1==r?i=this._w/2-this.ops.font.width(this.fontSize,t)/2:2==r&&(i=this._w-this.ops.font.width(this.fontSize,t)-this.t.TEXT_OFFSET*this.ops.scaleFactor),this.enabled||this.fadeColor(),e.set_pipeline(this.rtTextPipeline),e.drawString(t,this._x+i,this._y+this.fontOffsetY+n),e.set_pipeline(null)},endElement:function(e){null==e&&(e=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor),null==this.currentWindow||0==this.currentWindow.layout?-1==this.curRatio||null!=this.ratios&&this.curRatio==this.ratios.length-1?(this._y+=e,null!=this.ratios&&this.curRatio==this.ratios.length-1&&(this.curRatio=-1,this.ratios=null,this._x=this.xBeforeSplit,this._w=this.wBeforeSplit)):(this.curRatio++,this._x+=this._w,this._w=this.wBeforeSplit*this.ratios[this.curRatio]|0):this._x+=this._w+this.t.ELEMENT_OFFSET*this.ops.scaleFactor},row:function(e){this.ratios=e,this.curRatio=0,this.xBeforeSplit=this._x,this.wBeforeSplit=this._w,this._w=this._w*e[this.curRatio]|0},indent:function(){this._x+=this.t.TAB_W*this.ops.scaleFactor|0,this._w-=this.t.TAB_W*this.ops.scaleFactor|0},unindent:function(){this._x-=this.t.TAB_W*this.ops.scaleFactor|0,this._w+=this.t.TAB_W*this.ops.scaleFactor|0},fadeColor:function(){this.g.set_color(N.fromFloats(.00392156862745098*((16711680&this.g.get_color())>>>16),.00392156862745098*((65280&this.g.get_color())>>>8),.00392156862745098*(255&this.g.get_color()),.25))},fill:function(e,t,i,n,r){this.g.set_color(r),this.enabled||this.fadeColor(),this.g.fillRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor-1,i*this.ops.scaleFactor,n*this.ops.scaleFactor),this.g.set_color(-1)},rect:function(e,t,i,n,r,s){null==s&&(s=1),this.g.set_color(r),this.enabled||this.fadeColor(),this.g.drawRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor,i*this.ops.scaleFactor,n*this.ops.scaleFactor,s),this.g.set_color(-1)},drawRect:function(e,t,i,n,r,s,a){null==a&&(a=0),0==a&&(a=1),this.enabled||this.fadeColor(),t?e.fillRect(i,n-1,r,s+1):e.drawRect(i,n,r,s,a)},isVisible:function(e){if(null==this.currentWindow)return!0;var t=null!=this.tabNames?this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor:0;return this._y+e>t&&this._y=this._windowX+this._x&&this.inputStartedX=this._windowY+this._y)&&this.inputStartedY=this._windowX+this._x&&this.inputX=this._windowY+this._y&&this.inputY=e*r&&this.inputX<(e+i)*r&&this.inputY>=t*r)&&this.inputY<(t+n)*r},onMouseDown:function(e,t,i){0==e?this.inputStarted=!0:this.inputStartedR=!0,0==e?this.inputDown=!0:this.inputDownR=!0,this.setInputPosition(t,i),this.inputStartedX=t,this.inputStartedY=i},onMouseUp:function(e,t,i){0==e?this.isScrolling?(this.isScrolling=!1,this.scrollHandle=null,t==this.inputStartedX&&i==this.inputStartedY&&(this.inputReleased=!0)):this.inputReleased=!0:1==e&&(this.inputReleasedR=!0),0==e?this.inputDown=!1:this.inputDownR=!1,this.setInputPosition(t,i),this.deselectText()},onMouseMove:function(e,t,i,n){this.setInputPosition(e,t)},onMouseWheel:function(e){this.inputWheelDelta=e},setInputPosition:function(e,t){this.inputDX+=e-this.inputX,this.inputDY+=t-this.inputY,this.inputX=e,this.inputY=t},onKeyDown:function(e){switch(this.key=e,this.isKeyPressed=!0,this.isKeyDown=!0,Li.keyRepeatTime=G.time()+.4,e){case 8:this.isBackspaceDown=!0;break;case 13:this.isReturnDown=!0;break;case 16:this.isShiftDown=!0;break;case 17:this.isCtrlDown=!0;break;case 18:this.isAltDown=!0;break;case 27:this.isEscapeDown=!0;break;case 32:this.char=" ";break;case 46:this.isDeleteDown=!0}},onKeyUp:function(e){switch(this.isKeyDown=!1,e){case 8:this.isBackspaceDown=!1;break;case 13:this.isReturnDown=!1;break;case 16:this.isShiftDown=!1;break;case 17:this.isCtrlDown=!1;break;case 18:this.isAltDown=!1;break;case 27:this.isEscapeDown=!1;break;case 46:this.isDeleteDown=!1}},onKeyPress:function(e){this.char=e,this.isKeyPressed=!0},onCut:function(){return Li.isCut=!0,this.onCopy()},onCopy:function(){return Li.isCopy=!0,Li.textToCopy},onPaste:function(e){Li.isPaste=!0,Li.textToPaste=e},ELEMENT_W:function(){return this.t.ELEMENT_W*this.ops.scaleFactor},ELEMENT_H:function(){return this.t.ELEMENT_H*this.ops.scaleFactor},ELEMENT_OFFSET:function(){return this.t.ELEMENT_OFFSET*this.ops.scaleFactor},ARROW_SIZE:function(){return this.t.ARROW_SIZE*this.ops.scaleFactor},BUTTON_H:function(){return this.t.BUTTON_H*this.ops.scaleFactor},CHECK_SIZE:function(){return this.t.CHECK_SIZE*this.ops.scaleFactor},CHECK_SELECT_SIZE:function(){return this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor},FONT_SIZE:function(){return this.t.FONT_SIZE*this.ops.scaleFactor|0},SCROLL_W:function(){return this.t.SCROLL_W*this.ops.scaleFactor|0},TEXT_OFFSET:function(){return this.t.TEXT_OFFSET*this.ops.scaleFactor},TAB_W:function(){return this.t.TAB_W*this.ops.scaleFactor|0},SCALE:function(){return this.ops.scaleFactor},FLASH_SPEED:function(){return.5},TOOLTIP_DELAY:function(){return 1},resize:function(e,t,i,n){null==n&&(n=0),e.redraws=2,null!=e.texture&&e.texture.unload(),t<1&&(t=1),i<1&&(i=1),e.texture=R.createRenderTarget(t,i,0,0,1,n),e.texture.get_g2().set_imageScaleQuality(1)},__class__:Li},n.$haxeUID|=0,T.Math=Math,null==String.fromCodePoint&&(String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55232+(e>>10))+String.fromCharCode(56320+(1023&e))}),String.prototype.__class__=T.String=String,String.__name__=!0,T.Array=Array,Array.__name__=!0,Date.prototype.__class__=T.Date=Date,Date.__name__="Date";var Ai={},Mi={},Pi=Number,Ri=Boolean,Oi={},Vi={};te.count=0;var Di={};Object.defineProperty(pt.prototype,"message",{get:function(){return String(this.val)}}),g.__toStr={}.toString,null==ArrayBuffer.prototype.slice&&(ArrayBuffer.prototype.slice=b.sliceImpl),nt.cwd="",ot.defaultWindowW=240,ot.windowW=ot.defaultWindowW,ot.coffX=160,ot.coffY=40,ot.currentOperation="",ot.assetNames=[""],ot.showFiles=!1,ot.foldersOnly=!1,ot.gridSnapBounds=!1,ot.gridSnapPos=!0,ot.gridUseRelative=!0,ot.useRotationSteps=!1,ot.gridSize=20,ot.rotationSteps=.261799386,ot.modalW=625,ot.modalH=545,ot.modalHeaderH=66,ot.modalRectW=625,ot.modalRectH=545,ot.path="/",X.isManipulating=!1,X.transformStartedMouse=!1,X.drag=!1,X.dragLeft=!1,X.dragTop=!1,X.dragRight=!1,X.dragBottom=!1,X.grab=!1,X.grabX=!1,X.grabY=!1,X.rotate=!1,dt.global=new dt,_t.hwin=dt.global.nest(0,null),J.DEFAULT_RESOLVER=new a,J.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:",f.helper=new DataView(new ArrayBuffer(8)),gt.images=new k,gt.sounds=new I,gt.blobs=new C,gt.fonts=new B,gt.videos=new E,N.Black=-16777216,N.White=-1,N.Red=-65536,N.Blue=-16776961,N.Green=-16711936,N.Magenta=-65281,N.Yellow=-256,N.Cyan=-16711681,N.Purple=-8388480,N.Pink=-16181,N.Orange=-23296,N.Transparent=0,N.invMaxChannelValue=.00392156862745098,y.displays=[],F.Default=new F(!1,!1,!1),G.timeWarpSaveTime=10,G.DIF_COUNT=3,G.maxframetime=.5,G.startTime=0,z.painter_colored_fragData0="s274:I3ZlcnNpb24gMzMwCiNpZmRlZiBHTF9BUkJfc2hhZGluZ19sYW5ndWFnZV80MjBwYWNrCiNleHRlbnNpb24gR0xfQVJCX3NoYWRpbmdfbGFuZ3VhZ2VfNDIwcGFjayA6IHJlcXVpcmUKI2VuZGlmCgpvdXQgdmVjNCBGcmFnQ29sb3I7CmluIHZlYzQgZnJhZ21lbnRDb2xvcjsKCnZvaWQgbWFpbigpCnsKICAgIEZyYWdDb2xvciA9IGZyYWdtZW50Q29sb3I7Cn0KCg",z.painter_colored_vertData0="s439:I3ZlcnNpb24gMzMwCiNpZmRlZiBHTF9BUkJfc2hhZGluZ19sYW5ndWFnZV80MjBwYWNrCiNleHRlbnNpb24gR0xfQVJCX3NoYWRpbmdfbGFuZ3VhZ2VfNDIwcGFjayA6IHJlcXVpcmUKI2VuZGlmCgp1bmlmb3JtIG1hdDQgcHJvamVjdGlvbk1hdHJpeDsKCmlu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ZlYzQodmVydGV4UG9zaXRpb24sIDEuMCk7CiAgICB0ZXhDb29yZCA9IHRleFBvc2l0aW9uOwogICAgY29sb3IgPSB2ZXJ0ZXhDb2xvcjsKfQoK",mt.renderListeners=[],mt.foregroundListeners=[],mt.resumeListeners=[],mt.pauseListeners=[],mt.backgroundListeners=[],mt.shutdownListeners=[],mt.dropFilesListeners=[],Z.maxGamepads=4,Z.mouseLockListeners=[],q.windows=[],Q.None=0,Q.FeatureResizable=1,Q.FeatureMinimizable=2,Q.FeatureMaximizable=4,Q.FeatureBorderless=8,Q.FeatureOnTop=16,_e.disableGcInteractions=!1,_e.intBox=new ue(0),fe.channelCount=32,fe.lastAllocationCount=0,be.POLY=79764919,Te.INVALID_BITS=-1,Ie.EOP=-1,Ie.M__PI=3.141592653589793,Ie.DIVTAB_NUMER=32,Ie.DIVTAB_DENOM=64,Ie.INVERSE_DB_TABLE=[1.0649863e-7,1.1341951e-7,1.2079015e-7,1.2863978e-7,1.3699951e-7,1.4590251e-7,1.5538408e-7,1.6548181e-7,1.7623575e-7,1.8768855e-7,1.9988561e-7,2.128753e-7,2.2670913e-7,2.4144197e-7,2.5713223e-7,2.7384213e-7,2.9163793e-7,3.1059021e-7,3.3077411e-7,3.5226968e-7,3.7516214e-7,3.9954229e-7,4.255068e-7,4.5315863e-7,4.8260743e-7,5.1396998e-7,5.4737065e-7,5.8294187e-7,6.2082472e-7,6.6116941e-7,7.0413592e-7,7.4989464e-7,7.9862701e-7,8.505263e-7,9.0579828e-7,9.6466216e-7,10273513e-13,10941144e-13,11652161e-13,12409384e-13,13215816e-13,14074654e-13,14989305e-13,15963394e-13,17000785e-13,18105592e-13,19282195e-13,20535261e-13,21869758e-13,23290978e-13,24804557e-13,26416497e-13,2813319e-12,29961443e-13,31908506e-13,33982101e-13,36190449e-13,38542308e-13,41047004e-13,4371447e-12,46555282e-13,49580707e-13,5280274e-12,5623416e-12,59888572e-13,63780469e-13,67925283e-13,72339451e-13,77040476e-13,82047e-10,87378876e-13,93057248e-13,99104632e-13,10554501e-12,11240392e-12,11970856e-12,12748789e-12,13577278e-12,14459606e-12,15399272e-12,16400004e-12,17465768e-12,18600792e-12,19809576e-12,21096914e-12,22467911e-12,23928002e-12,25482978e-12,27139006e-12,28902651e-12,30780908e-12,32781225e-12,34911534e-12,37180282e-12,39596466e-12,42169667e-12,4491009e-11,47828601e-12,50936773e-12,54246931e-12,57772202e-12,61526565e-12,65524908e-12,69783085e-12,74317983e-12,79147585e-12,8429104e-11,89768747e-12,95602426e-12,.00010181521,.00010843174,.00011547824,.00012298267,.00013097477,.00013948625,.00014855085,.00015820453,.00016848555,.00017943469,.00019109536,.00020351382,.00021673929,.00023082423,.00024582449,.00026179955,.00027881276,.00029693158,.00031622787,.00033677814,.00035866388,.00038197188,.00040679456,.00043323036,.00046138411,.00049136745,.00052329927,.00055730621,.00059352311,.00063209358,.00067317058,716917e-9,.0007635063,.00081312324,.00086596457,.00092223983,.00098217216,.0010459992,.0011139742,.0011863665,.0012634633,.0013455702,.0014330129,.0015261382,.0016253153,.0017309374,.0018434235,.0019632195,.0020908006,.0022266726,.0023713743,.0025254795,.0026895994,.0028643847,.0030505286,.0032487691,.0034598925,.0036847358,.0039241906,.0041792066,.004450795,.0047400328,.0050480668,.0053761186,.0057254891,.0060975636,.0064938176,.0069158225,.0073652516,.0078438871,.0083536271,.0088964928,.009474637,.010090352,.01074608,.011444421,.012188144,.012980198,.013823725,.014722068,.015678791,.016697687,.017782797,.018938423,.020169149,.021479854,.022875735,.02436233,.025945531,.027631618,.029427276,.031339626,.033376252,.035545228,.037855157,.040315199,.042935108,.045725273,.048696758,.051861348,.055231591,.05882085,.062643361,.066714279,.071049749,.075666962,.080584227,.085821044,.091398179,.097337747,.1036633,.11039993,.11757434,.12521498,.13335215,.14201813,.15124727,.16107617,.1715438,.18269168,.19456402,.20720788,.22067342,.23501402,.25028656,.26655159,.28387361,.30232132,.32196786,.34289114,.36517414,.38890521,.41417847,.44109412,.4697589,.50028648,.53279791,.56742212,.6042964,.64356699,.68538959,.72993007,.77736504,.8278826,.88168307,.9389798,1],Ce.NO_CODE=255,Ce.delay=0,Fe.PACKET_ID=1,Fe.PACKET_COMMENT=3,Fe.PACKET_SETUP=5,De.CONTINUED_PACKET=1,De.FIRST_PAGE=2,De.LAST_PAGE=4,We.MAX_CHANNELS=16,We.PUSHDATA_CRC_COUNT=4,We.FAST_HUFFMAN_LENGTH=10,We.FAST_HUFFMAN_TABLE_SIZE=1024,We.FAST_HUFFMAN_TABLE_MASK=1023,Ze.fontGlyphs=function(){for(var e=[],t=32;t<256;){var i=t++;e.push(i)}return e}(),Et.STBTT_vmove=1,Et.STBTT_vline=2,Et.STBTT_vcurve=3,Et.STBTT_MACSTYLE_DONTCARE=0,Et.STBTT_MACSTYLE_BOLD=1,Et.STBTT_MACSTYLE_ITALIC=2,Et.STBTT_MACSTYLE_UNDERSCORE=4,Et.STBTT_MACSTYLE_NONE=8,Et.STBTT_PLATFORM_ID_UNICODE=0,Et.STBTT_PLATFORM_ID_MAC=1,Et.STBTT_PLATFORM_ID_ISO=2,Et.STBTT_PLATFORM_ID_MICROSOFT=3,Et.STBTT_UNICODE_EID_UNICODE_1_0=0,Et.STBTT_UNICODE_EID_UNICODE_1_1=1,Et.STBTT_UNICODE_EID_ISO_10646=2,Et.STBTT_UNICODE_EID_UNICODE_2_0_BMP=3,Et.STBTT_UNICODE_EID_UNICODE_2_0_FULL=4,Et.STBTT_MS_EID_SYMBOL=0,Et.STBTT_MS_EID_UNICODE_BMP=1,Et.STBTT_MS_EID_SHIFTJIS=2,Et.STBTT_MS_EID_UNICODE_FULL=10,Et.STBTT_MAC_EID_ROMAN=0,Et.STBTT_MAC_EID_ARABIC=4,Et.STBTT_MAC_EID_JAPANESE=1,Et.STBTT_MAC_EID_HEBREW=5,Et.STBTT_MAC_EID_CHINESE_TRAD=2,Et.STBTT_MAC_EID_GREEK=6,Et.STBTT_MAC_EID_KOREAN=3,Et.STBTT_MAC_EID_RUSSIAN=7,Et.STBTT_MS_LANG_ENGLISH=1033,Et.STBTT_MS_LANG_ITALIAN=1040,Et.STBTT_MS_LANG_CHINESE=2052,Et.STBTT_MS_LANG_JAPANESE=1041,Et.STBTT_MS_LANG_DUTCH=1043,Et.STBTT_MS_LANG_KOREAN=1042,Et.STBTT_MS_LANG_FRENCH=1036,Et.STBTT_MS_LANG_RUSSIAN=1049,Et.STBTT_MS_LANG_GERMAN=1031,Et.STBTT_MS_LANG_SPANISH=1033,Et.STBTT_MS_LANG_HEBREW=1037,Et.STBTT_MS_LANG_SWEDISH=1053,Et.STBTT_MAC_LANG_ENGLISH=0,Et.STBTT_MAC_LANG_JAPANESE=11,Et.STBTT_MAC_LANG_ARABIC=12,Et.STBTT_MAC_LANG_KOREAN=23,Et.STBTT_MAC_LANG_DUTCH=4,Et.STBTT_MAC_LANG_RUSSIAN=32,Et.STBTT_MAC_LANG_FRENCH=1,Et.STBTT_MAC_LANG_SPANISH=6,Et.STBTT_MAC_LANG_GERMAN=2,Et.STBTT_MAC_LANG_SWEDISH=5,Et.STBTT_MAC_LANG_HEBREW=10,Et.STBTT_MAC_LANG_CHINESE_SIMPLIFIED=33,Et.STBTT_MAC_LANG_ITALIAN=3,Et.STBTT_MAC_LANG_CHINESE_TRAD=19,Et.STBTT_MAX_OVERSAMPLE=8,Et.STBTT_RASTERIZER_VERSION=2,Rt.bufferSize=1500,Rt.vertexSize=9,Ot.bufferSize=1e3,Ot.triangleBufferSize=1e3,Vt.bufferSize=1e3,Qt.__meta__={statics:{sendConnectEvent:{input:null},sendDisconnectEvent:{input:null}},fields:{sendAxisEvent:{input:null},sendButtonEvent:{input:null}}},Qt.instances=[],Qt.connectListeners=[],Qt.disconnectListeners=[],ei.__meta__={fields:{sendDownEvent:{input:null},sendUpEvent:{input:null},sendPressEvent:{input:null}}},ei.keyBehavior=$t.Default,ti.__meta__={fields:{sendLeaveEvent:{input:null},sendDownEvent:{input:null},sendUpEvent:{input:null},sendMoveEvent:{input:null},sendWheelEvent:{input:null}}},si.bufferSize=2e3,ai.mat=new Float32Array(16),li.width=3,li.height=3,ui.width=4,ui.height=4,_i.width=3,_i.height=3,fi.width=4,fi.height=4,bi.nextId=0,Ti.START=0,Ti.ENTITY_UPDATES=1,Ti.CONTROLLER_UPDATES=2,Ti.REMOTE_CALL=3,Ti.PING=4,Ti.SESSION_ERROR=5,Ti.PLAYER_UPDATES=6,Ti.RPC_SERVER=0,Ti.RPC_ALL=1,Si.nextId=0,Si.objects=[],Ii.assetMap=new $,Ii.themes=[],Ii.events=[],Ii.screenW=-1,Ii.screenH=-1,Ii.locale="en",Ii.h=new dt,Ii.elemId=-1,Ii.assetId=-1,Ci.dataPath="",Ci.lastPath="",Ci.kx=1,Ci.ky=.6666666666666666,Ci.kz=.3333333333333333,Ci.kw=3,Ci.ar=[0,0,0],Ci.Kx=0,Ci.Ky=-.3333333333333333,Ci.Kz=.6666666666666666,Ci.Kw=-1,Ci.e=1e-10,Bi.i=0,Ei.show=!1,Ei.hwnd=new dt,Ei.boxTitle="",Ei.boxText="",Ei.modalX=0,Ei.modalY=0,Ei.modalW=400,Ei.modalH=160,Ni.dark={NAME:"Default Dark",FONT_SIZE:13,ELEMENT_W:100,ELEMENT_H:24,ELEMENT_OFFSET:4,ARROW_SIZE:5,BUTTON_H:22,CHECK_SIZE:15,CHECK_SELECT_SIZE:8,SCROLL_W:6,TEXT_OFFSET:8,TAB_W:12,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-13421773,WINDOW_TINT_COL:-1,ACCENT_COL:-12303292,ACCENT_HOVER_COL:-11974327,ACCENT_SELECT_COL:-10461088,BUTTON_COL:-12171706,BUTTON_TEXT_COL:-1513499,BUTTON_HOVER_COL:-11974327,BUTTON_PRESSED_COL:-15000805,TEXT_COL:-1513499,LABEL_COL:-3618616,SEPARATOR_COL:-14211289,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-14540254},Ni.light={NAME:"Default Light",FONT_SIZE:26,ELEMENT_W:200,ELEMENT_H:48,ELEMENT_OFFSET:8,ARROW_SIZE:10,BUTTON_H:44,CHECK_SIZE:30,CHECK_SELECT_SIZE:16,SCROLL_W:12,TEXT_OFFSET:16,TAB_W:24,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-1052689,WINDOW_TINT_COL:-14540254,ACCENT_COL:-1118482,ACCENT_HOVER_COL:-4473925,ACCENT_SELECT_COL:-5592406,BUTTON_COL:-3355444,BUTTON_TEXT_COL:-14540254,BUTTON_HOVER_COL:-5000269,BUTTON_PRESSED_COL:-5131855,TEXT_COL:-6710887,LABEL_COL:-5592406,SEPARATOR_COL:-6710887,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-5592406},Li.alwaysRedrawWindow=!0,Li.keyRepeat=!0,Li.keyRepeatTime=0,Li.textToPaste="",Li.textToCopy="",Li.isCut=!1,Li.isCopy=!1,Li.isPaste=!1,Li.copyFrame=0,Li.comboFirst=!0,nt.main()}("undefined"!=typeof exports?exports:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this); \ No newline at end of file +!function(e,n){"use strict";e.kha=e.kha||{},e.kha.input=e.kha.input||{};function i(){return g.__string_rec(this,"")}var t,T={},p=p||{};function r(e,t){var i=Object.create(e);for(var n in t)i[n]=t[n];return t.toString!==Object.prototype.toString&&(i.toString=t.toString),i}function it(){}(T.HxOverrides=it).__name__=!0,it.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;case 10:var n=e.split("-");return new Date(n[0],n[1]-1,n[2],0,0,0);case 19:var r=e.split(" "),s=r[0].split("-"),a=r[1].split(":");return new Date(s[0],s[1]-1,s[2],a[0],a[1],a[2]);default:throw new pt("Invalid date format : "+e)}},it.cca=function(e,t){var i=e.charCodeAt(t);if(i==i)return i},it.substr=function(e,t,i){if(null==i)i=e.length;else if(i<0){if(0!=t)return"";i=e.length+i}return e.substr(t,i)},it.remove=function(e,t){var i=e.indexOf(t);return-1!=i&&(e.splice(i,1),!0)},it.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.cury.get_primary().get_width()&&(e=y.get_primary().get_width()),t>y.get_primary().get_height()-30&&(t=y.get_primary().get_height()-30)),mt.start(new Y("Armory2D",e,t,null,new M(null,null,null,null,null,2)),nt.initialized)},nt.initialized=function(e){nt.prefs={path:"",scaleFactor:1,keyMap:{selectMouseButton:"Left",grabKey:71,rotateKey:82,sizeKey:83,slowMovement:16,gridInvert:17,gridInvertRelative:18}};var t=Krom.getArgCount();if(4r&&this.ui.inputXthis.get_toolbarw()&&(this.selectedFrame=(this.ui.inputX-this.get_toolbarw())/11/this.ui.ops.scaleFactor|0)}X.update(this.ui,this.cui,this.canvas),Ei.show&&Ei.update(),this.updateFiles()}},updateCanvas:function(){if(!(ot.showFiles||this.ui.inputX>mt.windowWidth()-ot.get_uiw())){if(X.selectElement(this.canvas),!X.isManipulating&&(this.ui.inputDownR&&(ot.coffX+=0|this.ui.inputDX,ot.coffY+=0|this.ui.inputDY),0!=this.ui.inputWheelDelta)){var e=this.zoom;this.zoom+=-this.ui.inputWheelDelta/10,this.zoom<.4?this.zoom=.4:1n||this.ui.inputYs)&&(ot.showFiles=!1)}},renderFiles:function(e){var t=mt.windowWidth(),i=mt.windowHeight(),n=t/2-ot.modalW/2,r=i/2-ot.modalH/2;e.begin(!1),e.set_color(-14671840),e.fillRect(n,r,ot.modalW,ot.modalH),e.end();var s=t/2-ot.modalRectW/2|0,a=t/2+ot.modalRectW/2|0,o=i/2-ot.modalRectH/2|0,l=i/2+ot.modalRectH/2|0;if(o+=ot.modalHeaderH,this.uimodal.begin(e),this.uimodal.window(dt.global.nest(63,null),s,o,ot.modalRectW,ot.modalRectH-100)){var u=dt.global.nest(64,null);u.text=this.uimodal.textInput(u),ot.path=Ci.fileBrowser(this.uimodal,u,ot.foldersOnly)}this.uimodal.end(!1),e.begin(!1),this.uimodal.beginRegion(e,a-100,l-30,100),this.uimodal.button("OK")&&(ot.showFiles=!1,ot.filesDone(ot.path)),this.uimodal.endRegion(!1),this.uimodal.beginRegion(e,a-200,l-30,100),this.uimodal.button("Cancel")&&(ot.showFiles=!1),this.uimodal.endRegion(),e.end()},scaled:function(e){return e*this.cui.ops.scaleFactor|0},__class__:ot,__properties__:{get_toolbarw:"get_toolbarw"}};var X=function(){};(T["arm2d.ElementController"]=X).__name__=!0,X.__properties__={get_handleSize:"get_handleSize"},X.get_handleSize=function(){return 8*X.ui.ops.scaleFactor|0},X.initialize=function(e,t){X.ui=e,X.cui=t},X.selectElement=function(e){if(null!=X.ui){var t=nt.prefs.keyMap.selectMouseButton;if("Left"==t&&X.ui.inputStarted&&X.ui.inputDown||"Right"==t&&X.ui.inputStartedR&&X.ui.inputDownR){var i=ot.selectedElem;ot.selectedElem=null;var n=e.elements.slice();n.reverse();for(var r=0;rf&&u.xp&&u.yi.x+s+o-(8*X.ui.ops.scaleFactor|0)?X.dragRight=!0:u.xi.y+a+l-(8*X.ui.ops.scaleFactor|0)?X.dragBottom=!0:u.y=n.length);)if(n[r].parent==s){it.remove(n,t),n.splice(r,0,t);break}},ht.removeElem=function(e,t){if(null!=t.children)for(var i=0,n=t.children;it&&o.xi&&o.y=this.length)throw new pt("Invalid object");if(103==this.buf.charCodeAt(this.pos))break;var t=this.unserialize();if("string"!=typeof t)throw new pt("Invalid object key");var i=this.unserialize();e[t]=i}this.pos++},unserializeEnum:function(e,t){if(58!=this.buf.charCodeAt(this.pos++))throw new pt("Invalid enum format");var i=this.readDigits();if(0==i)return S.createEnum(e,t);for(var n=[];0=this.scache.length)throw new pt("Invalid string reference");return this.scache[u];case 97:this.buf;var h=[];for(this.cache.push(h);;){var c=this.buf.charCodeAt(this.pos);if(104==c){this.pos++;break}if(117==c){this.pos++;var d=this.readDigits();h[h.length+d-1]=null}else h.push(this.unserialize())}return h;case 98:var _=new ie;this.cache.push(_);for(this.buf;104!=this.buf.charCodeAt(this.pos);){var f=this.unserialize(),p=this.unserialize();null!=Di[f]?_.setReserved(f,p):_.h[f]=p}return this.pos++,_;case 99:var g=this.unserialize(),m=this.resolver.resolveClass(g);if(null==m)throw new pt("Class not found "+g);var v=Object.create(m.prototype);return this.cache.push(v),this.unserializeObject(v),v;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:var b=this.unserialize(),w=this.resolver.resolveEnum(b);if(null==w)throw new pt("Enum not found "+b);this.pos++;var y=this.readDigits(),x=w.__constructs__.slice()[y];if(null==x)throw new pt("Unknown enum index "+b+"@"+y);var T=this.unserializeEnum(w,x);return this.cache.push(T),T;case 107:return NaN;case 108:var S=new ee;this.cache.push(S);for(this.buf;104!=this.buf.charCodeAt(this.pos);)S.add(this.unserialize());return this.pos++,S;case 109:return-1/0;case 110:return null;case 111:var k={};return this.cache.push(k),this.unserializeObject(k),k;case 112:return 1/0;case 113:var I=new $;this.cache.push(I);this.buf;for(var C=this.buf.charCodeAt(this.pos++);58==C;){var B=this.readDigits(),E=this.unserialize();I.h[B]=E,C=this.buf.charCodeAt(this.pos++)}if(104!=C)throw new pt("Invalid IntMap format");return I;case 114:var N=this.readDigits();if(N<0||N>=this.cache.length)throw new pt("Invalid reference");return this.cache[N];case 115:var L=this.readDigits(),F=this.buf;if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>2)+(2<=P?P-1:0))),V=0;M>4;var H=A[F.charCodeAt(M++)];O.b[V++]=U<<4|H>>2;var W=A[F.charCodeAt(M++)];O.b[V++]=H<<6|W}if(2<=P){var G=A[F.charCodeAt(M++)],z=A[F.charCodeAt(M++)];if(O.b[V++]=G<<2|z>>4,3==P){var X=A[F.charCodeAt(M++)];O.b[V++]=z<<4|X>>2}}return this.pos+=L,this.cache.push(O),O;case 116:return!0;case 118:var K;return 48<=this.buf.charCodeAt(this.pos)&&this.buf.charCodeAt(this.pos)<=57&&48<=this.buf.charCodeAt(this.pos+1)&&this.buf.charCodeAt(this.pos+1)<=57&&48<=this.buf.charCodeAt(this.pos+2)&&this.buf.charCodeAt(this.pos+2)<=57&&48<=this.buf.charCodeAt(this.pos+3)&&this.buf.charCodeAt(this.pos+3)<=57&&45==this.buf.charCodeAt(this.pos+4)?(K=it.strDate(it.substr(this.buf,this.pos,19)),this.pos+=19):K=new Date(this.readFloat()),this.cache.push(K),K;case 119:var Y=this.unserialize(),Z=this.resolver.resolveEnum(Y);if(null==Z)throw new pt("Enum not found "+Y);var j=this.unserializeEnum(Z,this.unserialize());return this.cache.push(j),j;case 120:throw pt.wrap(this.unserialize());case 121:var q=this.readDigits();if(58!=this.buf.charCodeAt(this.pos++)||this.length-this.pos>8}return new he(i.buffer)}for(var o=[],l=0;l>6):(u<=65535?o.push(224|u>>12):(o.push(240|u>>18),o.push(128|u>>12&63)),o.push(128|u>>6&63)),o.push(128|63&u))}return new he(new Uint8Array(o).buffer)},he.ofData=function(e){var t=e.hxBytes;return null!=t?t:new he(e)},he.prototype={length:null,b:null,data:null,blit:function(e,t,i,n){if(e<0||i<0||n<0||e+n>this.length||i+n>t.length)throw new pt(_.OutsideBounds);0==i&&n==t.b.byteLength?this.b.set(t.b,e):this.b.set(t.b.subarray(i,i+n),e)},sub:function(e,t){if(e<0||t<0||e+t>this.length)throw new pt(_.OutsideBounds);return new he(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getDouble:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat64(e,!0)},getFloat:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getFloat32(e,!0)},setDouble:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat64(e,t,!0)},setFloat:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setFloat32(e,t,!0)},getUInt16:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getUint16(e,!0)},getInt32:function(e){return null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.getInt32(e,!0)},setInt32:function(e,t){null==this.data&&(this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)),this.data.setInt32(e,t,!0)},getString:function(e,t,i){if(e<0||t<0||e+t>this.length)throw new pt(_.OutsideBounds);null==i&&(i=d.UTF8);var n="",r=this.b,s=e,a=e+t;switch(i._hx_index){case 0:for(;se.length)throw new pt(_.OutsideBounds);if(this.pos+i>this.size&&this.grow(i),0!=this.size){var n=new Uint8Array(e.b.buffer,e.b.byteOffset+t,i);this.u8.set(n,this.pos),this.pos+=i}},grow:function(e){for(var t=this.pos+e,i=0==this.size?16:this.size;i>1;var n=new ArrayBuffer(i),r=new Uint8Array(n);0e.length)throw new pt(_.OutsideBounds);try{for(;0e.length)throw new pt(_.OutsideBounds);this.b=e.b,this.pos=t,this.len=i,this.totlen=i}(T["haxe.io.BytesInput"]=ce).__name__=!0,ce.__super__=h,ce.prototype=r(h.prototype,{b:null,pos:null,len:null,totlen:null,set_position:function(e){return e<0?e=0:e>this.totlen&&(e=this.totlen),this.len=this.totlen-e,this.pos=e},readByte:function(){if(0==this.len)throw new pt(new v);return this.len--,this.b[this.pos++]},readBytes:function(e,t,i){if(t<0||i<0||t+i>e.length)throw new pt(_.OutsideBounds);if(0==this.len&&0e.length)throw new pt(_.OutsideBounds);for(var n=e.b,r=i;0>>24),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)):(this.writeByte(255&e),this.writeByte(e>>8&255),this.writeByte(e>>16&255),this.writeByte(e>>>24))},__class__:c};function de(){this.b=new u}(T["haxe.io.BytesOutput"]=de).__name__=!0,de.__super__=c,de.prototype=r(c.prototype,{b:null,writeByte:function(e){this.b.addByte(e)},writeBytes:function(e,t,i){return this.b.addBytes(e,t,i),i},getBytes:function(){return this.b.getBytes()},__class__:de});var d=p["haxe.io.Encoding"]={__ename__:!0,__constructs__:["UTF8","RawNative"],UTF8:{_hx_index:0,__enum__:"haxe.io.Encoding",toString:i},RawNative:{_hx_index:1,__enum__:"haxe.io.Encoding",toString:i}},v=function(){};(T["haxe.io.Eof"]=v).__name__=!0,v.prototype={toString:function(){return"Eof"},__class__:v};var _=p["haxe.io.Error"]={__ename__:!0,__constructs__:["Blocked","Overflow","OutsideBounds","Custom"],Blocked:{_hx_index:0,__enum__:"haxe.io.Error",toString:i},Overflow:{_hx_index:1,__enum__:"haxe.io.Error",toString:i},OutsideBounds:{_hx_index:2,__enum__:"haxe.io.Error",toString:i},Custom:((t=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:i}}).__params__=["e"],t)},f=function(){};(T["haxe.io.FPHelper"]=f).__name__=!0,f.floatToI32=function(e){return f.helper.setFloat32(0,e,!0),f.helper.getInt32(0,!0)};var ft=function(e){switch(e){case".":case"..":return this.dir=e,void(this.file="")}var t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t";var e=typeof r;switch("function"==e&&(r.__name__||r.__ename__)&&(e="object"),e){case"function":return"";case"object":if(r.__enum__){var t=p[r.__enum__],i=t.__constructs__[r._hx_index],a=t[i];return a.__params__?(s+="\t",i+"("+function(){for(var e=[],t=0,i=a.__params__;t>>16},N.get_Gb=function(e){return(65280&e)>>>8},N.get_Bb=function(e){return 255&e},N.get_Ab=function(e){return e>>>24},N.set_Rb=function(e,t){return t},N.set_Gb=function(e,t){return t},N.set_Bb=function(e,t){return t},N.set_Ab=function(e,t){return t},N.get_R=function(e){return.00392156862745098*((16711680&e)>>>16)},N.get_G=function(e){return.00392156862745098*((65280&e)>>>8)},N.get_B=function(e){return.00392156862745098*(255&e)},N.get_A=function(e){return.00392156862745098*(e>>>24)},N.set_R=function(e,t){return t},N.set_G=function(e,t){return t},N.set_B=function(e,t){return t},N.set_A=function(e,t){return t};var y=function(e,t){this.num=e,this.isPrimary=t};(T["kha.Display"]=y).__name__=!0,y.__properties__={get_all:"get_all",get_primary:"get_primary"},y.init=function(){for(var e=0,t=Krom.displayCount();e=this.chars.length)return null;var r=1/this.width,s=1/this.height,a=this.chars[t];if(null==a)return null;var o=Math.round(i+a.xoff),l=Math.round(n+a.yoff);return e.x0=o,e.y0=l,e.x1=o+a.x1-a.x0,e.y1=l+a.y1-a.y0,e.s0=a.x0*r,e.t0=a.y0*s,e.s1=a.x1*r,e.t1=a.y1*s,e.xadvance=a.xadvance,e},getCharWidth:function(e){if(0==this.chars.length)return 0;var t=V.charBlocks[0];if(e=this.chars.length?this.chars[0].xadvance:this.chars[e-t].xadvance},getHeight:function(){return this.mySize},stringWidth:function(e){for(var t=0,i=0,n=e.length;i=e)n.next=n.start;else if(0=e&&G.timeTasksScratchpad.push(n)}for(var r=0,s=G.timeTasksScratchpad;rG.lastTime&&(G.startTime-=e-G.lastTime,G.current=e,G.lastTime=e,G.executeTimeTasks(e))},G.executeFrame=function(){var e=G.realTime()-G.startTime-G.lastTime,t=G.current;if(0<=e){if(null==Ti.the())if(e>G.maxframetime)G.startTime+=e-G.maxframetime,t+=e=G.maxframetime;else if(G.vsync){for(var i=G.onedifhz;i=G.activeTimeTask.start+G.activeTimeTask.next)?G.insertSorted(G.timeTasks,G.activeTimeTask):G.archiveTimeTask(G.activeTimeTask,e):(G.activeTimeTask.active=!1,G.archiveTimeTask(G.activeTimeTask,e));G.activeTimeTask=null},G.archiveTimeTask=function(e,t){},G.time=function(){return G.current},G.realTime=function(){return mt.get_time()},G.resetTime=function(){var e=mt.get_time(),t=e-G.startTime;G.startTime=e;for(var i=0,n=G.timeTasks;it.next)return void e.splice(r,0,t)}e.push(t)},G.sortFrameTasks=function(){G.frame_tasks_sorted||(G.frameTasks.sort(function(e,t){return e.priority>t.priority?1:e.priority=this.getLength()},unload:function(){},__class__:j,__properties__:{set_position:"set_position",get_position:"get_position"}};var q=function(e){this.num=e,q.windows.push(this)};(T["kha.Window"]=q).__name__=!0,q.__properties__={get_all:"get_all"},q.create=function(e,t){return null},q.destroy=function(e){},q.get=function(e){return q.windows[e]},q.get_all=function(){return q.windows},q.prototype={num:null,windowTitle:null,resize:function(e,t){},move:function(e,t){},changeWindowFeatures:function(e){},changeFramebuffer:function(e){},get_x:function(){return 0},set_x:function(e){return 0},get_y:function(){return 0},set_y:function(e){return 0},get_width:function(){return Krom.windowWidth(this.num)},set_width:function(e){return 800},get_height:function(){return Krom.windowHeight(this.num)},set_height:function(e){return 600},get_mode:function(){return 0},set_mode:function(e){return 0},get_visible:function(){return!0},set_visible:function(e){return!0},get_title:function(){return this.windowTitle},set_title:function(e){return Krom.setWindowTitle(this.num,e),this.windowTitle=e,this.windowTitle},notifyOnResize:function(e){},get_vSynced:function(){return!0},__class__:q,__properties__:{get_vSynced:"get_vSynced",set_title:"set_title",get_title:"get_title",set_visible:"set_visible",get_visible:"get_visible",set_mode:"set_mode",get_mode:"get_mode",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}};var Q={};(T["kha._WindowOptions.WindowFeatures_Impl_"]=Q).__name__=!0,Q._new=function(e){return e};var ne=function(e,t,i,n,r,s,a,o,l){null==l&&(l=0),null==a&&(a=!0),null==s&&(s=-1),null==r&&(r=600),null==n&&(n=800),null==i&&(i=-1),null==t&&(t=-1),this.mode=0,this.windowFeatures=7,this.visible=!0,this.display=-1,this.height=600,this.width=800,this.y=-1,this.x=-1,this.title=null,this.title=e,this.x=t,this.y=i,this.width=n,this.height=r,this.display=s,this.visible=a,this.windowFeatures=null==o?7:o,this.mode=l};(T["kha.WindowOptions"]=ne).__name__=!0,ne.prototype={title:null,x:null,y:null,width:null,height:null,display:null,visible:null,windowFeatures:null,mode:null,__class__:ne};var re={};(T["kha.arrays._Float32Array.Float32Array_Impl_"]=re).__name__=!0,re.__properties__={get_length:"get_length",get_buffer:"get_buffer"},re._new=function(e){return new Float32Array(e)},re.get_buffer=function(e){return e.buffer},re.get_length=function(e){return e.length},re.set=function(e,t,i){return e[t]=i},re.get=function(e,t){return e[t]},re.data=function(e){return e},re.subarray=function(e,t,i){return e.subarray(t,i)};var se={};(T["kha.arrays._Int16Array.Int16Array_Impl_"]=se).__name__=!0,se.__properties__={get_length:"get_length"},se._new=function(e){return new Int16Array(e)},se.get_length=function(e){return e.length},se.set=function(e,t,i){return e[t]=i},se.get=function(e,t){return e[t]},se.data=function(e){return e},se.arrayRead=function(e,t){return e[t]},se.arrayWrite=function(e,t,i){return e[t]=i},se.subarray=function(e,t,i){return e.subarray(t,i)};var ae={};(T["kha.arrays._Int32Array.Int32Array_Impl_"]=ae).__name__=!0,ae.__properties__={get_length:"get_length"},ae._new=function(e){return new Int32Array(e)},ae.get_length=function(e){return e.length},ae.set=function(e,t,i){return e[t]=i},ae.get=function(e,t){return e[t]},ae.data=function(e){return e},ae.arrayRead=function(e,t){return e[t]},ae.arrayWrite=function(e,t,i){return e[t]=i},ae.subarray=function(e,t,i){return e.subarray(t,i)};var oe={};(T["kha.arrays._Uint32Array.Uint32Array_Impl_"]=oe).__name__=!0,oe.__properties__={get_length:"get_length"},oe._new=function(e){return new Uint32Array(e)},oe.get_length=function(e){return e.length},oe.set=function(e,t,i){return e[t]=i},oe.get=function(e,t){return e[t]},oe.data=function(e){return e},oe.arrayRead=function(e,t){return e[t]},oe.arrayWrite=function(e,t,i){return e[t]=i},oe.subarray=function(e,t,i){return e.subarray(t,i)};function le(){}(T["kha.audio1.AudioChannel"]=le).__name__=!0,le.__isInterface__=!0,le.prototype={play:null,pause:null,stop:null,length:null,get_length:null,get_position:null,set_position:null,get_volume:null,set_volume:null,finished:null,get_finished:null,__class__:le,__properties__:{get_finished:"get_finished",set_volume:"set_volume",get_volume:"get_volume",set_position:"set_position",get_position:"get_position",get_length:"get_length"}};function ue(e){this.value=e}(T["kha.internal.IntBox"]=ue).__name__=!0,ue.prototype={value:null,__class__:ue};var _e=function(){};(T["kha.audio2.Audio"]=_e).__name__=!0,_e._init=function(){_e.buffer=new ge(8192,2,44100),_e.samplesPerSecond=44100},_e._callCallback=function(e){if(null!=_e.buffer)if(null!=_e.audioCallback)_e.intBox.value=e,_e.audioCallback(_e.intBox,_e.buffer);else for(var t=0,i=e;t=_e.buffer.size&&(_e.buffer.writeLocation=0)}},_e._readSample=function(){if(null==_e.buffer)return 0;var e=_e.buffer.data[_e.buffer.readLocation];return _e.buffer.readLocation+=1,_e.buffer.readLocation>=_e.buffer.size&&(_e.buffer.readLocation=0),e},_e.play=function(e,t){return null==t&&(t=!1),null},_e.stream=function(e,t){return null==t&&(t=!1),null};var fe=function(){};(T["kha.audio2.Audio1"]=fe).__name__=!0,fe._init=function(){var e=new Array(32);fe.soundChannels=e;var t=new Array(32);fe.streamChannels=t;var i=new Array(32);fe.internalSoundChannels=i;var n=new Array(32);fe.internalStreamChannels=n;var r=new Float32Array(512);fe.sampleCache1=r;var s=new Float32Array(512);fe.sampleCache2=s,fe.lastAllocationCount=0,_e.audioCallback=fe.mix},fe.max=function(e,t){return t=t.size&&(t.writeLocation=0)}return fe.lastAllocationCount=0,void(_e.disableGcInteractions=!1)}var s=new Float32Array(2*i);fe.sampleCache1=s;var a=new Float32Array(2*i);fe.sampleCache2=a,fe.lastAllocationCount=0}else 100=t.size&&(t.writeLocation=0)}},fe.play=function(e,t){null==t&&(t=!1);var i=null;(i=_e.samplesPerSecond!=e.sampleRate?new me(t,e.sampleRate):new pe(t)).data=e.uncompressedData;for(var n=!1,r=0;r<32;){var s=r++;if(null==fe.soundChannels[s]||fe.soundChannels[s].get_finished()){fe.soundChannels[s]=i,n=!0;break}}return n?i:null},fe._playAgain=function(e){for(var t=0;t<32;){var i=t++;fe.soundChannels[i]==e&&(fe.soundChannels[i]=null)}for(var n=0;n<32;){var r=n++;if(null==fe.soundChannels[r]||fe.soundChannels[r].get_finished()||fe.soundChannels[r]==e){fe.soundChannels[r]=e;break}}},fe.stream=function(e,t){null==t&&(t=!1);var i=_e.stream(e,t);if(null!=i)return i;for(var n=new ve(e.compressedData,t),r=!1,s=0;s<32;){var a=s++;if(null==fe.streamChannels[a]||fe.streamChannels[a].get_finished()){fe.streamChannels[a]=n,r=!0;break}}return r?n:null};var pe=function(e){this.looping=!1,this.stopped=!1,this.paused=!1,this.myPosition=0,this.myVolume=1,this.data=null,this.looping=e};(T["kha.audio2.AudioChannel"]=pe).__name__=!0,pe.__interfaces__=[le],pe.max=function(e,t){return t=this.data.length&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s=(N%2==0?N:N+1)&&(this.myPosition=0,!this.looping)){this.stopped=!0;break}}for(;s>>24]};function we(){}(T["kha.audio2.ogg.tools.MathTools"]=we).__name__=!0,we.ilog=function(e){var t=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];return e<16384?e<16?t[e]:e<512?5+t[e>>5]:10+t[e>>10]:e<16777216?e<524288?15+t[e>>15]:20+t[e>>20]:e<536870912?25+t[e>>25]:e<-2147483648?30+t[e>>30]:0};function ye(){}(T["kha.audio2.ogg.tools.Mdct"]=ye).__name__=!0,ye.inverseTransform=function(e,t,i,n,r,s){for(var a=t>>1,o=t>>2,l=t>>3,u=new Array(a),h=a-2,c=0,d=0,_=a;d!=_;)u[h+1]=e[d]*i[c]-e[d+2]*i[c+1],u[h]=e[d]*i[c+1]+e[d+2]*i[c],h-=2,c+=2,d+=4;for(d=a-3;0<=h;)u[h+1]=-e[d+2]*i[c]- -e[d]*i[c+1],u[h]=-e[d+2]*i[c+1]+-e[d]*i[c],h-=2,c+=2,d-=4;for(var f=e,p=u,g=a-8,m=o,v=0,b=o,w=0;0<=g;){var y=p[m+1]-p[v+1],x=p[m]-p[v];f[b+1]=p[m+1]+p[v+1],f[b]=p[m]+p[v],f[w+1]=y*i[g+4]-x*i[g+5],f[w]=x*i[g+4]+y*i[g+5],y=p[m+3]-p[v+3],x=p[m+2]-p[v+2],f[b+3]=p[m+3]+p[v+3],f[b+2]=p[m+2]+p[v+2],f[w+3]=y*i[g]-x*i[g+1],f[w+2]=x*i[g]+y*i[g+1],g-=8,b+=4,w+=4,m+=4,v+=4}for(var T=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],S=(t<16384?t<16?T[t]:t<512?5+T[t>>5]:10+T[t>>10]:t<16777216?t<524288?15+T[t>>15]:20+T[t>>20]:t<536870912?25+T[t>>25]:t<-2147483648?30+T[t>>30]:0)-1,k=a-1-0*o,I=k,C=k-(t>>3),B=0,E=1+(t>>4>>2);0<--E;){var N=f[I]-f[C],L=f[I+-1]-f[C+-1];f[I]=f[I]+f[C];var F=I+-1;f[F]=f[F]+f[C+-1],f[C]=N*i[B]-L*i[B+1],f[C+-1]=L*i[B]+N*i[B+1],B+=8,N=f[I+-2]-f[C+-2],L=f[I+-3]-f[C+-3];var A=I+-2;f[A]=f[A]+f[C+-2];var M=I+-3;f[M]=f[M]+f[C+-3],f[C+-2]=N*i[B]-L*i[B+1],f[C+-3]=L*i[B]+N*i[B+1],B+=8,N=f[I+-4]-f[C+-4],L=f[I+-5]-f[C+-5];var P=I+-4;f[P]=f[P]+f[C+-4];var R=I+-5;f[R]=f[R]+f[C+-5],f[C+-4]=N*i[B]-L*i[B+1],f[C+-5]=L*i[B]+N*i[B+1],B+=8,N=f[I+-6]-f[C+-6],L=f[I+-7]-f[C+-7];var O=I+-6;f[O]=f[O]+f[C+-6];var V=I+-7;f[V]=f[V]+f[C+-7],f[C+-6]=N*i[B]-L*i[B+1],f[C+-7]=L*i[B]+N*i[B+1],B+=8,I-=8,C-=8}for(var D=a-1-o,U=D,H=D-(t>>3),W=0,G=1+(t>>4>>2);0<--G;){var z=f[U]-f[H],X=f[U+-1]-f[H+-1];f[U]=f[U]+f[H];var K=U+-1;f[K]=f[K]+f[H+-1],f[H]=z*i[W]-X*i[W+1],f[H+-1]=X*i[W]+z*i[W+1],W+=8,z=f[U+-2]-f[H+-2],X=f[U+-3]-f[H+-3];var Y=U+-2;f[Y]=f[Y]+f[H+-2];var Z=U+-3;f[Z]=f[Z]+f[H+-3],f[H+-2]=z*i[W]-X*i[W+1],f[H+-3]=X*i[W]+z*i[W+1],W+=8,z=f[U+-4]-f[H+-4],X=f[U+-5]-f[H+-5];var j=U+-4;f[j]=f[j]+f[H+-4];var q=U+-5;f[q]=f[q]+f[H+-5],f[H+-4]=z*i[W]-X*i[W+1],f[H+-5]=X*i[W]+z*i[W+1],W+=8,z=f[U+-6]-f[H+-6],X=f[U+-7]-f[H+-7];var Q=U+-6;f[Q]=f[Q]+f[H+-6];var J=U+-7;f[J]=f[J]+f[H+-7],f[H+-6]=z*i[W]-X*i[W+1],f[H+-7]=X*i[W]+z*i[W+1],W+=8,U-=8,H-=8}for(var $=a-1-0*l,ee=0,te=$,ie=$-(t>>4),ne=1+(t>>5>>2);0<--ne;){var re=f[te]-f[ie],se=f[te+-1]-f[ie+-1];f[te]=f[te]+f[ie];var ae=te+-1;f[ae]=f[ae]+f[ie+-1],f[ie]=re*i[ee]-se*i[ee+1],f[ie+-1]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-2]-f[ie+-2],se=f[te+-3]-f[ie+-3];var oe=te+-2;f[oe]=f[oe]+f[ie+-2];var le=te+-3;f[le]=f[le]+f[ie+-3],f[ie+-2]=re*i[ee]-se*i[ee+1],f[ie+-3]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-4]-f[ie+-4],se=f[te+-5]-f[ie+-5];var ue=te+-4;f[ue]=f[ue]+f[ie+-4];var he=te+-5;f[he]=f[he]+f[ie+-5],f[ie+-4]=re*i[ee]-se*i[ee+1],f[ie+-5]=se*i[ee]+re*i[ee+1],ee+=16,re=f[te+-6]-f[ie+-6],se=f[te+-7]-f[ie+-7];var ce=te+-6;f[ce]=f[ce]+f[ie+-6];var de=te+-7;f[de]=f[de]+f[ie+-7],f[ie+-6]=re*i[ee]-se*i[ee+1],f[ie+-7]=se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o+1],o+=8,u=t[s+-4]-t[a+-4],h=t[s+-5]-t[a+-5];var f=s+-4;t[f]=t[f]+t[a+-4];var p=s+-5;t[p]=t[p]+t[a+-5],t[a+-4]=u*r[o]-h*r[o+1],t[a+-5]=h*r[o]+u*r[o+1],o+=8,u=t[s+-6]-t[a+-6],h=t[s+-7]-t[a+-7];var g=s+-6;t[g]=t[g]+t[a+-6];var m=s+-7;t[m]=t[m]+t[a+-7],t[a+-6]=u*r[o]-h*r[o+1],t[a+-7]=h*r[o]+u*r[o+1],o+=8,s-=8,a-=8}},ye.step3InnerRLoop=function(e,t,i,n,r,s){for(var a=0,o=i,l=i+n,u=1+(e>>2);0<--u;){var h=t[o]-t[l],c=t[o+-1]-t[l+-1];t[o]=t[o]+t[l];var d=o+-1;t[d]=t[d]+t[l+-1],t[l]=h*r[a]-c*r[a+1],t[l+-1]=c*r[a]+h*r[a+1],a+=s,h=t[o+-2]-t[l+-2],c=t[o+-3]-t[l+-3];var _=o+-2;t[_]=t[_]+t[l+-2];var f=o+-3;t[f]=t[f]+t[l+-3],t[l+-2]=h*r[a]-c*r[a+1],t[l+-3]=c*r[a]+h*r[a+1],a+=s,h=t[o+-4]-t[l+-4],c=t[o+-5]-t[l+-5];var p=o+-4;t[p]=t[p]+t[l+-4];var g=o+-5;t[g]=t[g]+t[l+-5],t[l+-4]=h*r[a]-c*r[a+1],t[l+-5]=c*r[a]+h*r[a+1],a+=s,h=t[o+-6]-t[l+-6],c=t[o+-7]-t[l+-7];var m=o+-6;t[m]=t[m]+t[l+-6];var v=o+-7;t[v]=t[v]+t[l+-7],t[l+-6]=h*r[a]-c*r[a+1],t[l+-7]=c*r[a]+h*r[a+1],o-=8,l-=8,a+=s}},ye.step3InnerSLoop=function(e,t,i,n,r,s,a,o){for(var l=r[s],u=r[s+1],h=r[s+a],c=r[s+a+1],d=r[s+2*a],_=r[s+2*a+1],f=r[s+3*a],p=r[s+3*a+1],g=i,m=i+n,v=e+1;0<--v;){var b=t[g]-t[m],w=t[g+-1]-t[m+-1];t[g]=t[g]+t[m],t[g+-1]=t[g+-1]+t[m+-1],t[m]=b*l-w*u,t[m+-1]=w*l+b*u,b=t[g+-2]-t[m+-2],w=t[g+-3]-t[m+-3],t[g+-2]=t[g+-2]+t[m+-2],t[g+-3]=t[g+-3]+t[m+-3],t[m+-2]=b*h-w*c,t[m+-3]=w*h+b*c,b=t[g+-4]-t[m+-4],w=t[g+-5]-t[m+-5],t[g+-4]=t[g+-4]+t[m+-4],t[g+-5]=t[g+-5]+t[m+-5],t[m+-4]=b*d-w*_,t[m+-5]=w*d+b*_,b=t[g+-6]-t[m+-6],w=t[g+-7]-t[m+-7],t[g+-6]=t[g+-6]+t[m+-6],t[g+-7]=t[g+-7]+t[m+-7],t[m+-6]=b*f-w*p,t[m+-7]=w*f+b*p,g-=o,m-=o}},ye.iter54=function(e,t){var i=e[t],n=e[t+-4],r=i-n,s=i+n,a=(i=e[t+-2])+(n=e[t+-6]),o=i-n;e[t]=s+a,e[t+-2]=s-a;var l=e[t+-3]-e[t+-7];e[t+-4]=r+l,e[t+-6]=r-l;var u=(i=e[t+-1])-(n=e[t+-5]),h=i+n,c=e[t+-3]+e[t+-7];e[t+-1]=h+c,e[t+-3]=h-c,e[t+-5]=u-o,e[t+-7]=u+o},ye.step3InnerSLoopLd654=function(e,t,i,n,r){for(var s=n[r>>3],a=i,o=i-16*e;o=this.segments.length&&(this.nextSeg=-1),this.bytesInSeg=e},startPacket:function(){for(;-1==this.nextSeg;)if(this.page.start(this),0!=(1&this.page.flag))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:193,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"startPacket"}));this.lastSeg=!1,this.validBits=0,this.bytesInSeg=0},maybeStartPacket:function(){if(-1==this.nextSeg){var t,i=!1;try{this.inputPosition+=1,t=this.input.readByte()}catch(e){var n=e instanceof pt?e.val:e;if(!(n instanceof v))throw e;i=!0,t=0}if(i)return!1;if(!!(!!(79!=t||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:218,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"maybeStartPacket"}));this.page.startWithoutCapturePattern(this)}return this.startPacket(),!0},readBits:function(e){if(this.validBits<0)return 0;if(this.validBits>>e,this.validBits-=e,t}var i=this.acc&(1<>>e,this.validBits-=e,i},readPacketRaw:function(){return 0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1},readPacket:function(){var e;return e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,e},flushPacket:function(){for(;0!=this.bytesInSeg||!this.lastSeg&&0!=this.next();)this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()},vorbisValidate:function(){var e,t,i,n,r,s,a=new he(new ArrayBuffer(6));if(e=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[0]=e,t=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[1]=t,i=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[2]=i,n=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[3]=n,r=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[4]=r,s=0!=this.bytesInSeg||!this.lastSeg&&0!=this.next()?(this.bytesInSeg--,this.inputPosition+=1,this.input.readByte()):-1,this.validBits=0,a.b[5]=s,"vorbis"!=a.toString())throw new pt(new Xe(Ke.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}))},firstPageValidate:function(){if(1!=this.segments.length)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"segmentCount",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:308,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}));if(30!=this.segments[0])throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:311,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"firstPageValidate"}))},startFirstDecode:function(){this.firstAudioPageOffset=this.inputPosition,this.firstDecode=!0},capturePattern:function(){if(this.inputPosition+=1,!!(!!(79!=this.input.readByte()||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,103!=this.input.readByte()))||(this.inputPosition+=1,83!=this.input.readByte()))throw new pt(new Xe(Ke.MISSING_CAPTURE_PATTERN,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:324,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"capturePattern"}))},skip:function(e){this.inputPosition+=e;for(var t=new Array(e),i=0,n=e;i>>n,this.validBits-=n,t=this.validBits<0?(this.validBits=0,-1):i}else t=this.decodeScalarRaw(e);return e.sparse&&(t=e.sortedValues[t]),t},decodeRaw:function(e){this.validBits<10&&this.prepHuffman();var t=e.fastHuffman[1023&this.acc];if(0<=t){var i=e.codewordLengths[t];return this.acc=this.acc>>>i,this.validBits-=i,this.validBits<0?(this.validBits=0,-1):t}return this.decodeScalarRaw(e)},isLastByte:function(){return 0==this.bytesInSeg&&this.lastSeg},finishDecodePacket:function(e,t,i){var n=i.left.start,r=!1,s=t>>1;if(this.firstDecode)this.currentLoc=-s,this.discardSamplesDeferred=t-i.right.end,r=!0,this.firstDecode=!1;else if(0!=this.discardSamplesDeferred)i.left.start+=this.discardSamplesDeferred,n=i.left.start,this.discardSamplesDeferred=0;else;if(this.lastSegWhich==this.endSegWithKnownLoc){if(r&&0!=(4&this.page.flag)){var a=this.knownLocForPacket-(t-i.right.end);if(a>>24]}var l=0;try{for(var u=0,h=n[26];u>>24],l+=c}for(var d=0,_=l;d<_;){d++;this.inputPosition+=1;var f=this.input.readByte();s=s<<8^be.table[f^s>>>24]}}catch(e){var p=e instanceof pt?e.val:e;if(p instanceof v){return Se.NotFound}throw e}if(s==r){var g=this.inputPosition;return e(this.inputPosition=i-1),Se.Found(g,0!=(4&n[5]))}}}}catch(e){var m=e instanceof pt?e.val:e;if(m instanceof v){return Se.NotFound}throw e}},analyzePage:function(e,t){var i=new Ue,n=new Array(255);i.pageStart=this.inputPosition,this.inputPosition+=27;for(var r=new Array(27),s=0;s<27;){r[s++]=this.input.readByte()}var a=r,o=a[26];this.inputPosition+=o;for(var l=new Array(o),u=0,h=o;u>=1;var x=m-1,T=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(m<=(y&=(1<<(x<16384?x<16?T[x]:x<512?5+T[x>>5]:10+T[x>>10]:x<16777216?x<524288?15+T[x>>15]:20+T[x>>20]:x<536870912?25+T[x>>25]:x<-2147483648?30+T[x>>30]:0))-1))return e(this.inputPosition=i.pageStart),null;n[p++]=t.modes[y].blockflag;var S=c[w]-1;this.inputPosition+=S;for(var k=new Array(S),I=0,C=S;I>1:F+=(t.blocksize1-t.blocksize0>>2)+(t.blocksize0>>1):F+=t.blocksize0>>1,--A;return i.firstDecodedSample=i.lastDecodedSample-F,e(this.inputPosition=i.pageStart),i},decodeScalarRaw:function(e){this.prepHuffman();var t=e.codewordLengths,i=e.codewords,n=e.sortedCodewords;if(8>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16,a=0,o=e.sortedEntries;1>1);Pe.gte(s,n[l])?(a=l,o-=o>>1):o>>=1}e.sparse||(a=e.sortedValues[a]);var u=t[a];return this.validBits>=u?(this.acc=this.acc>>>u,this.validBits-=u,a):(this.validBits=0,-1)}for(var h=0,c=e.entries;h=_?(this.acc=this.acc>>>_,this.validBits-=_,d):(this.validBits=0,-1)}return this.error=new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:847,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"decodeScalarRaw"}),this.validBits=0,-1},__class__:Te};var Se=p["kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult"]={__ename__:!0,__constructs__:["Found","NotFound"],Found:((t=function(e,t){return{_hx_index:0,end:e,last:t,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}}).__params__=["end","last"],t),NotFound:{_hx_index:1,__enum__:"kha.audio2.ogg.vorbis._VorbisDecodeState.FindPageResult",toString:i}},ke=function(e,t){this.header=e,this.decodeState=t,this.totalSample=null,this.currentSample=0,this.previousLength=0;var i=new Array(e.channel);this.channelBuffers=i;var n=new Array(e.channel);this.previousWindow=n;var r=new Array(e.channel);this.finalY=r;for(var s=0,a=e.channel;sthis.totalSample-this.currentSample&&(c=this.totalSample-this.currentSample);for(var d=0;hthis.totalSample-this.currentSample&&(e=this.totalSample-this.currentSample);t=r.lastDecodedSample&&(i=r.lastDecodedSample-1),i>>1);h=8<=s?c:Pe.gt(c,h)?h+(c-h>>>1):c+(h-c>>>1)}++s,e(this.decodeState.inputPosition=h);var d=this.decodeState.findPage(e,t);switch(d._hx_index){case 0:d.last,d.end;break;case 1:throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:249,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}))}var _=this.decodeState.analyzePage(e,this.header);if(null==_)throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:255,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"seek"}));_.afterPreviousPageStart=h,_.pageStart!=r.pageStart?i<_.lastDecodedSample?r=_:n=_:r=_}if(!(n.lastDecodedSample<=i&&i>1,n=t>>2,r=t>>3,s=this.a,a=new Array(i);s[e]=a;var o=this.b,l=new Array(i);o[e]=l;var u=this.c,h=new Array(n);u[e]=h;var c=this.window,d=new Array(i);c[e]=d;var _=this.bitReverseData,f=new Array(r);_[e]=f,Ie.computeTwiddleFactors(t,this.a[e],this.b[e],this.c[e]),Ie.computeWindow(t,this.window[e]),Ie.computeBitReverse(t,this.bitReverseData[e])},inverseMdct:function(e,t,i){for(var n=i?1:0,r=this.a[n],s=this.b[n],a=this.c[n],o=this.bitReverseData[n],l=t>>1,u=t>>2,h=t>>3,c=new Array(l),d=l-2,_=0,f=0,p=l;f!=p;)c[d+1]=e[f]*r[_]-e[f+2]*r[_+1],c[d]=e[f]*r[_+1]+e[f+2]*r[_],d-=2,_+=2,f+=4;for(f=l-3;0<=d;)c[d+1]=-e[f+2]*r[_]- -e[f]*r[_+1],c[d]=-e[f+2]*r[_+1]+-e[f]*r[_],d-=2,_+=2,f-=4;for(var g=e,m=c,v=l-8,b=u,w=0,y=u,x=0;0<=v;){var T=m[b+1]-m[w+1],S=m[b]-m[w];g[y+1]=m[b+1]+m[w+1],g[y]=m[b]+m[w],g[x+1]=T*r[v+4]-S*r[v+5],g[x]=S*r[v+4]+T*r[v+5],T=m[b+3]-m[w+3],S=m[b+2]-m[w+2],g[y+3]=m[b+3]+m[w+3],g[y+2]=m[b+2]+m[w+2],g[x+3]=T*r[v]-S*r[v+1],g[x+2]=S*r[v]+T*r[v+1],v-=8,y+=4,x+=4,b+=4,w+=4}for(var k=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4],I=(t<16384?t<16?k[t]:t<512?5+k[t>>5]:10+k[t>>10]:t<16777216?t<524288?15+k[t>>15]:20+k[t>>20]:t<536870912?25+k[t>>25]:t<-2147483648?30+k[t>>30]:0)-1,C=l-1-0*u,B=C,E=C-(t>>3),N=0,L=1+(t>>4>>2);0<--L;){var F=g[B]-g[E],A=g[B+-1]-g[E+-1];g[B]=g[B]+g[E];var M=B+-1;g[M]=g[M]+g[E+-1],g[E]=F*r[N]-A*r[N+1],g[E+-1]=A*r[N]+F*r[N+1],N+=8,F=g[B+-2]-g[E+-2],A=g[B+-3]-g[E+-3];var P=B+-2;g[P]=g[P]+g[E+-2];var R=B+-3;g[R]=g[R]+g[E+-3],g[E+-2]=F*r[N]-A*r[N+1],g[E+-3]=A*r[N]+F*r[N+1],N+=8,F=g[B+-4]-g[E+-4],A=g[B+-5]-g[E+-5];var O=B+-4;g[O]=g[O]+g[E+-4];var V=B+-5;g[V]=g[V]+g[E+-5],g[E+-4]=F*r[N]-A*r[N+1],g[E+-5]=A*r[N]+F*r[N+1],N+=8,F=g[B+-6]-g[E+-6],A=g[B+-7]-g[E+-7];var D=B+-6;g[D]=g[D]+g[E+-6];var U=B+-7;g[U]=g[U]+g[E+-7],g[E+-6]=F*r[N]-A*r[N+1],g[E+-7]=A*r[N]+F*r[N+1],N+=8,B-=8,E-=8}for(var H=l-1-u,W=H,G=H-(t>>3),z=0,X=1+(t>>4>>2);0<--X;){var K=g[W]-g[G],Y=g[W+-1]-g[G+-1];g[W]=g[W]+g[G];var Z=W+-1;g[Z]=g[Z]+g[G+-1],g[G]=K*r[z]-Y*r[z+1],g[G+-1]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-2]-g[G+-2],Y=g[W+-3]-g[G+-3];var j=W+-2;g[j]=g[j]+g[G+-2];var q=W+-3;g[q]=g[q]+g[G+-3],g[G+-2]=K*r[z]-Y*r[z+1],g[G+-3]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-4]-g[G+-4],Y=g[W+-5]-g[G+-5];var Q=W+-4;g[Q]=g[Q]+g[G+-4];var J=W+-5;g[J]=g[J]+g[G+-5],g[G+-4]=K*r[z]-Y*r[z+1],g[G+-5]=Y*r[z]+K*r[z+1],z+=8,K=g[W+-6]-g[G+-6],Y=g[W+-7]-g[G+-7];var $=W+-6;g[$]=g[$]+g[G+-6];var ee=W+-7;g[ee]=g[ee]+g[G+-7],g[G+-6]=K*r[z]-Y*r[z+1],g[G+-7]=Y*r[z]+K*r[z+1],z+=8,W-=8,G-=8}for(var te=l-1-0*h,ie=0,ne=te,re=te-(t>>4),se=1+(t>>5>>2);0<--se;){var ae=g[ne]-g[re],oe=g[ne+-1]-g[re+-1];g[ne]=g[ne]+g[re];var le=ne+-1;g[le]=g[le]+g[re+-1],g[re]=ae*r[ie]-oe*r[ie+1],g[re+-1]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-2]-g[re+-2],oe=g[ne+-3]-g[re+-3];var ue=ne+-2;g[ue]=g[ue]+g[re+-2];var he=ne+-3;g[he]=g[he]+g[re+-3],g[re+-2]=ae*r[ie]-oe*r[ie+1],g[re+-3]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-4]-g[re+-4],oe=g[ne+-5]-g[re+-5];var ce=ne+-4;g[ce]=g[ce]+g[re+-4];var de=ne+-5;g[de]=g[de]+g[re+-5],g[re+-4]=ae*r[ie]-oe*r[ie+1],g[re+-5]=oe*r[ie]+ae*r[ie+1],ie+=16,ae=g[ne+-6]-g[re+-6],oe=g[ne+-7]-g[re+-7];var _e=ne+-6;g[_e]=g[_e]+g[re+-6];var fe=ne+-7;g[fe]=g[fe]+g[re+-7],g[re+-6]=ae*r[ie]-oe*r[ie+1],g[re+-7]=oe*r[ie]+ae*r[ie+1],ne-=8,re-=8,ie+=16}for(var pe=l-1-h,ge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[Ft+3*Et+1],Gt=At,zt=At+-Nt,Xt=1+Lt;0<--Xt;){var Kt=g[Gt]-g[zt],Yt=g[Gt+-1]-g[zt+-1];g[Gt]=g[Gt]+g[zt],g[Gt+-1]=g[Gt+-1]+g[zt+-1],g[zt]=Kt*Pt-Yt*Rt,g[zt+-1]=Yt*Pt+Kt*Rt,Kt=g[Gt+-2]-g[zt+-2],Yt=g[Gt+-3]-g[zt+-3],g[Gt+-2]=g[Gt+-2]+g[zt+-2],g[Gt+-3]=g[Gt+-3]+g[zt+-3],g[zt+-2]=Kt*Ot-Yt*Vt,g[zt+-3]=Yt*Ot+Kt*Vt,Kt=g[Gt+-4]-g[zt+-4],Yt=g[Gt+-5]-g[zt+-5],g[Gt+-4]=g[Gt+-4]+g[zt+-4],g[Gt+-5]=g[Gt+-5]+g[zt+-5],g[zt+-4]=Kt*Dt-Yt*Ut,g[zt+-5]=Yt*Dt+Kt*Ut,Kt=g[Gt+-6]-g[zt+-6],Yt=g[Gt+-7]-g[zt+-7],g[Gt+-6]=g[Gt+-6]+g[zt+-6],g[Gt+-7]=g[Gt+-7]+g[zt+-7],g[zt+-6]=Kt*Ht-Yt*Wt,g[zt+-7]=Yt*Ht+Kt*Wt,Gt-=Bt,zt-=Bt}Ft+=4*Et,At-=8}for(var Zt=l-1,jt=r[t>>3],qt=Zt,Qt=Zt-16*(t>>5);Qt>5]:10+n[i>>10]:i<16777216?i<524288?15+n[i>>15]:20+n[i>>20]:i<536870912?25+n[i>>25]:i<-2147483648?30+n[i>>30]:0);if(-1==r||r>=this.header.modes.length)throw new pt(new Xe(Ke.SEEK_FAILED,null,{fileName:"kha/audio2/ogg/vorbis/VorbisDecoder.hx",lineNumber:519,className:"kha.audio2.ogg.vorbis.VorbisDecoder",methodName:"decodeInitial"}));var s,a,o,l=this.header.modes[r];l.blockflag?(s=this.header.blocksize1,a=this.decodeState.readBits(1),o=this.decodeState.readBits(1)):(a=o=0,s=this.header.blocksize0);var u=s>>1;return{mode:r,left:l.blockflag&&0==a?{start:s-this.header.blocksize0>>2,end:s+this.header.blocksize0>>2}:{start:0,end:u},right:l.blockflag&&0==o?{start:3*s-this.header.blocksize0>>2,end:3*s+this.header.blocksize0>>2}:{start:u,end:s}}},decodePacketRest:function(e){for(var t=this.header.modes[e.mode],i=new Array(256),n=new Array(256),r=t.blockflag?this.header.blocksize1:this.header.blocksize0,s=this.header.mapping[t.mapping],a=r>>1,o=[256,128,86,64],l=this.header.codebooks,u=0,h=this.header.channel;u>5]:10+b[m>>10]:m<16777216?m<524288?15+b[m>>15]:20+b[m>>20]:m<536870912?25+b[m>>25]:m<-2147483648?30+b[m>>30]:0)-1);var w=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];p[1]=this.decodeState.readBits((m<16384?m<16?w[m]:m<512?5+w[m>>5]:10+w[m>>10]:m<16777216?m<524288?15+w[m>>15]:20+w[m>>20]:m<536870912?25+w[m>>25]:m<-2147483648?30+w[m>>30]:0)-1);for(var y=0,x=f.partitions;y>>A,N.validBits-=A,L=N.validBits<0?(N.validBits=0,-1):F}else L=N.decodeScalarRaw(E);E.sparse&&(L=E.sortedValues[L]),B=L}for(var M=f.subclassBooks[S],P=0,R=k;P>=I;var V,D=v++;if(0<=O){var U=this.decodeState,H=l[O];U.validBits<10&&U.prepHuffman();var W,G=H.fastHuffman[1023&U.acc];if(0<=G){var z=H.codewordLengths[G];U.acc=U.acc>>>z,U.validBits-=z,W=U.validBits<0?(U.validBits=0,-1):G}else W=U.decodeScalarRaw(H);H.sparse&&(W=H.sortedValues[W]),V=W}else V=0;p[D]=V}}if(-1==this.decodeState.validBits){i[c]=!0;continue}g[0]=g[1]=!0;for(var X=f.neighbors,K=f.xlist,Y=2,Z=f.values;Y>1):ne+(re>>1)):(g[j]=!1,p[j]=ne)}for(var oe=0,le=f.values;oe>1;0<=--Ie;)for(var Be=this.channelBuffers[s.chan[Ie].magnitude],Ee=this.channelBuffers[s.chan[Ie].angle],Ne=0,Le=Ce;Nei&&e[l]e[t]&&(n=e[s=l])}return{low:r,high:s}},Ie.floatUnpack=function(e){var t=Pe.toFloat(2097151&e),i=(2145386496&e)>>>21;return(0!=(-2147483648&e)?-t:t)*Math.pow(2,i-788)},Ie.bitReverse=function(e){return(e=(-16711936&(e=(-252645136&(e=(-858993460&(e=(-1431655766&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8)>>>16|e<<16},Ie.pointCompare=function(e,t){return e.xt.x?1:0},Ie.uintAsc=function(e,t){return Pe.gt(t,e)?-1:e==t?0:1},Ie.lookup1Values=function(e,t){var i=0|Math.exp(Math.log(e)/t);return(0|Math.pow(i+1,t))<=e&&++i,i},Ie.computeWindow=function(e,t){for(var i=e>>1,n=0,r=i;n>5]:10+i[e>>10]:e<16777216?e<524288?15+i[e>>15]:20+i[e>>20]:e<536870912?25+i[e>>25]:e<-2147483648?30+i[e>>30]:0)-1,r=0,s=e>>3;r>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8,t[a]=(o>>>16|o<<16)>>>32-n+3<<2}},Ie.computeTwiddleFactors=function(e,t,i,n){for(var r=e>>3,s=0,a=0,o=e>>2;a>5]:10+d[c>>10]:c<16777216?c<524288?15+d[c>>15]:20+d[c>>20]:c<536870912?25+d[c>>25]:c<-2147483648?30+d[c>>30]:0);if(u+_>t.entries)throw new pt(new Xe(Ke.INVALID_SETUP,"codebook entrys",{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"read"}));for(var f=0,p=_;f=t.entries>>2&&(t.codewordLengths=a,t.sparse=!1),t.sparse)o=l;else{for(var b=0,w=0,y=t.entries;w>>21,L=0!=(-2147483648&B)?-E:E;t.minimumValue=L*Math.pow(2,N-788);var F=e.readBits(32),A=Pe.toFloat(2097151&F),M=(2145386496&F)>>>21,P=0!=(-2147483648&F)?-A:A;t.deltaValue=P*Math.pow(2,M-788),t.valueBits=e.readBits(4)+1,t.sequenceP=0!=e.readBits(1),1==t.lookupType?t.lookupValues=Ie.lookup1Values(t.entries,t.dimensions):t.lookupValues=t.entries*t.dimensions;for(var R=new Array(t.lookupValues),O=0,V=t.lookupValues;O>>1|(1431655765&h)<<1))>>>2|(858993459&h)<<2))>>>4|(252645135&h)<<4))>>>8|(16711935&h)<<8)>>>16|h<<16,d=s++;if(this.sparse?(this.codewords[d]=c,this.codewordLengths[d]=e[o],i[d]=o):this.codewords[o]=c,l!=e[o])for(var _=e[o];l<_;)n[_]=u+(1<<32-_),--_}}return!0},computeSortedHuffman:function(e,t){if(this.sparse)for(var i=0,n=this.sortedEntries;i>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,this.sortedCodewords[r]=s>>>16|s<<16}else for(var a=0,o=0,l=this.entries;o>>1|(1431655765&c)<<1))>>>2|(858993459&c)<<2))>>>4|(252645135&c)<<4))>>>8|(16711935&c)<<8,this.sortedCodewords[a++]=c>>>16|c<<16}}this.sortedCodewords[this.sortedEntries]=-1,this.sortedCodewords.sort(Ie.uintAsc);for(var d=0,_=this.sparse?this.sortedEntries:this.entries;d<_;){var f=d++,p=this.sparse?e[t[f]]:e[f];if(this.sparse||255!=p&&10>>1|(1431655765&g)<<1))>>>2|(858993459&g)<<2))>>>4|(252645135&g)<<4))>>>8|(16711935&g)<<8)>>>16|g<<16,v=0,b=this.sortedEntries;1>1);Pe.gte(m,this.sortedCodewords[w])?(v=w,b-=b>>1):b>>=1}this.sparse?(this.sortedValues[v]=t[f],this.codewordLengths[v]=p):this.sortedValues[v]=f}}},computeAcceleratedHuffman:function(){var e=new Array(1024);this.fastHuffman=e,this.fastHuffman[0]=-1;for(var t=0;t<1024;){var i=t++;this.fastHuffman[i]=-1}for(var n=0,r=this.sparse?this.sortedEntries:this.entries;n>>1|(1431655765&o)<<1))>>>2|(858993459&o)<<2))>>>4|(252645135&o)<<4))>>>8|(16711935&o)<<8)>>>16|o<<16}else a=this.codewords[s];for(;a<1024;)this.fastHuffman[a]=s,a+=1<>>a,e.validBits-=a,r=e.validBits<0?(e.validBits=0,-1):s}else r=e.decodeScalarRaw(this);this.sparse&&(r=this.sortedValues[r]);var o=r,l=this.lookupValues,u=this.sequenceP,h=this.multiplicands,c=this.minimumValue;if(o<0)return!1;if(n>this.dimensions&&(n=this.dimensions),1==this.lookupType){for(var d=1,_=0,f=0,p=n;f>>o,e.validBits-=o,s=e.validBits<0?(e.validBits=0,-1):a}else s=e.decodeScalarRaw(this);this.sparse&&(s=this.sortedValues[s]);var l=s,u=0;if(l<0)return!1;n>this.dimensions&&(n=this.dimensions);var h=this.lookupValues,c=this.sequenceP,d=this.multiplicands;if(1==this.lookupType){for(var _=1,f=0,p=n;f>>n,e.validBits-=n,t=e.validBits<0?(e.validBits=0,-1):i}else t=e.decodeScalarRaw(this);return this.sparse&&(t=this.sortedValues[t]),t},decodeDeinterleaveRepeat:function(e,t,i,n,r,s,a){var o=this.dimensions;if(0==this.lookupType)throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:488,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}));for(var l=this.multiplicands,u=this.sequenceP,h=this.lookupValues;0>>f,e.validBits-=f,d=e.validBits<0?(e.validBits=0,-1):_}else d=e.decodeScalarRaw(this);this.sparse&&(d=this.sortedValues[d]);var p=d;if(p<0){if(0==e.bytesInSeg&&e.lastSeg)return null;throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Codebook.hx",lineNumber:503,className:"kha.audio2.ogg.vorbis.data.Codebook",methodName:"decodeDeinterleaveRepeat"}))}if(s*iu&&(u=l.partitionClassList[_])}var f=new Array(u+1);l.classDimensions=f;var p=new Array(u+1);l.classMasterbooks=p;var g=new Array(u+1);l.classSubclasses=g;var m=new Array(u+1);l.subclassBooks=m;for(var v=0,b=u+1;v=t.length))throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:64,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}));var y=1<=t.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Floor.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Floor",methodName:"read"}))}}l.floor1Multiplier=e.readBits(2)+1,l.rangebits=e.readBits(4);var C=new Array(250);l.xlist=C,l.xlist[0]=0,l.xlist[1]=1<K&&X[J]X[z]&&(Y=X[j=J])}var $=Z,ee=j,te=l.neighbors,ie=new Array(l.values);te[z]=ie,l.neighbors[z][0]=$,l.neighbors[z][1]=ee}return i},Ee.prototype={floor0:null,floor1:null,type:null,__class__:Ee};var Ne=function(){};(T["kha.audio2.ogg.vorbis.data.Floor0"]=Ne).__name__=!0,Ne.prototype={order:null,rate:null,barkMapSize:null,amplitudeBits:null,amplitudeOffset:null,numberOfBooks:null,bookList:null,__class__:Ne};var Le=function(){};(T["kha.audio2.ogg.vorbis.data.Floor1"]=Le).__name__=!0,Le.prototype={partitions:null,partitionClassList:null,classDimensions:null,classSubclasses:null,classMasterbooks:null,subclassBooks:null,xlist:null,sortedOrder:null,neighbors:null,floor1Multiplier:null,rangebits:null,values:null,__class__:Le};var Fe=function(){};(T["kha.audio2.ogg.vorbis.data.Header"]=Fe).__name__=!0,Fe.read=function(e){var t=e.page;if(t.start(e),0==(2&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"not firstPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(4&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"lastPage",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(0!=(1&t.flag))throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"continuedPacket",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(e.firstPageValidate(),e.inputPosition+=1,1!=e.input.readByte())throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"decodeState head",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:57,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var i,n,r,s,a,o,l=new he(new ArrayBuffer(6));if(i=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[0]=i,n=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[1]=n,r=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[2]=r,s=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[3]=s,a=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[4]=a,o=0!=e.bytesInSeg||!e.lastSeg&&0!=e.next()?(e.bytesInSeg--,e.inputPosition+=1,e.input.readByte()):-1,e.validBits=0,l.b[5]=o,"vorbis"!=l.toString())throw new pt(new Xe(Ke.INVALID_SETUP,"vorbis header",{fileName:"kha/audio2/ogg/vorbis/VorbisDecodeState.hx",lineNumber:301,className:"kha.audio2.ogg.vorbis.VorbisDecodeState",methodName:"vorbisValidate"}));e.inputPosition+=4;var u=e.input.readInt32();if(0!=u)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"vorbis version : "+u,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:66,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));var h=new Fe;if(e.inputPosition+=1,h.channel=e.input.readByte(),0==h.channel)throw new pt(new Xe(Ke.INVALID_FIRST_PAGE,"no channel",{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:73,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(16>4;if(h.blocksize0=1<=h.floorConfig.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:191,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}));if(ee.submapResidue[ne]>=h.residueConfig.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:194,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}var re=e.readBits(6)+1,se=new Array(re);h.modes=se;for(var ae=0,oe=re;ae=h.mapping.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Header.hx",lineNumber:205,className:"kha.audio2.ogg.vorbis.data.Header",methodName:"read"}))}for(;0!=e.bytesInSeg||!e.lastSeg&&0!=e.next();)e.bytesInSeg--,e.inputPosition+=1,e.input.readByte();return h},Fe.prototype={maximumBitRate:null,nominalBitRate:null,minimumBitRate:null,sampleRate:null,channel:null,blocksize0:null,blocksize1:null,codebooks:null,floorConfig:null,residueConfig:null,mapping:null,modes:null,comment:null,vendor:null,__class__:Fe};var Ae=function(){};(T["kha.audio2.ogg.vorbis.data.IntPoint"]=Ae).__name__=!0,Ae.prototype={x:null,y:null,__class__:Ae};var Me=function(){};(T["kha.audio2.ogg.vorbis.data.Mapping"]=Me).__name__=!0,Me.read=function(e,t){var i=new Me,n=e.readBits(16);if(0!=n)throw new pt(new Xe(Ke.INVALID_SETUP,"mapping type "+n,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:22,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));var r=new Array(t);i.chan=r;for(var s=0,a=t;s>5]:10+d[c>>10]:c<16777216?c<524288?15+d[c>>15]:20+d[c>>20]:c<536870912?25+d[c>>25]:c<-2147483648?30+d[c>>30]:0);var _=t-1,f=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];if(i.chan[h].angle=e.readBits(_<16384?_<16?f[_]:_<512?5+f[_>>5]:10+f[_>>10]:_<16777216?_<524288?15+f[_>>15]:20+f[_>>20]:_<536870912?25+f[_>>25]:_<-2147483648?30+f[_>>30]:0),i.chan[h].magnitude>=t)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:46,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].angle>=t)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:49,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(i.chan[h].magnitude==i.chan[h].angle)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:52,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}}else i.couplingSteps=0;if(0!=e.readBits(2))throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:61,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}));if(1=i.submaps)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:67,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"read"}))}else for(var v=0,b=t;v>1,o=this.chan[t].mux,l=e[this.submapFloor[o]];if(0==l.type)throw new pt(new Xe(Ke.INVALID_STREAM,null,{fileName:"kha/audio2/ogg/vorbis/data/Mapping.hx",lineNumber:94,className:"kha.audio2.ogg.vorbis.data.Mapping",methodName:"doFloor"}));for(var u=l.floor1,h=0,c=r[0]*u.floor1Multiplier,d=1,_=u.values;d<_;){var f=d++,p=u.sortedOrder[f];if(0<=r[p]){var g=r[p]*u.floor1Multiplier,m=u.xlist[p];Ie.drawLine(n,h,c,m,g,a),h=m,c=g}}if(h=t.length)throw new pt(new Xe(Ke.INVALID_SETUP,null,{fileName:"kha/audio2/ogg/vorbis/data/Residue.hx",lineNumber:55,className:"kha.audio2.ogg.vorbis.data.Residue",methodName:"read"}))}else i.residueBooks[_][m]=-1}}var v=t[i.classbook].entries,b=t[i.classbook].dimensions,w=new Array(v);i.classdata=w;for(var y=0,x=v;y>>B,e.validBits-=B,I=e.validBits<0?(e.validBits=0,-1):C}else I=e.decodeScalarRaw(k);k.sparse&&(I=k.sortedValues[I]);var E=I;if(-1==E)return;for(var N=l;0<=--N;)d[S*c+N+y]=E%this.classifications,E=E/this.classifications|0}}for(var L=0,F=l;L>>1;if(0==X){var q=o[this.classbook];e.validBits<10&&e.prepHuffman();var Q,J=q.fastHuffman[1023&e.acc];if(0<=J){var $=q.codewordLengths[J];e.acc=e.acc>>>$,e.validBits-=$,Q=e.validBits<0?(e.validBits=0,-1):J}else Q=e.decodeScalarRaw(q);q.sparse&&(Q=q.sortedValues[Q]);var ee=Q;if(-1==ee)return;for(var te=l;0<=--te;)d[te+K]=ee%this.classifications,ee=ee/this.classifications|0}for(var ie=0,ne=l;ie>>1;++K}}else if(1==n)for(;K>>_e,e.validBits-=_e,ce=e.validBits<0?(e.validBits=0,-1):de}else ce=e.decodeScalarRaw(he);he.sparse&&(ce=he.sortedValues[ce]);var fe=ce;if(-1==fe)return;for(var pe=l;0<=--pe;)d[pe+K]=fe%this.classifications,fe=fe/this.classifications|0}for(var ge=0,me=l;ge>>Ce,e.validBits-=Ce,ke=e.validBits<0?(e.validBits=0,-1):Ie}else ke=e.decodeScalarRaw(Se);Se.sparse&&(ke=Se.sortedValues[ke]);var Be=ke;if(-1==Be)return;for(var Ee=l;0<=--Ee;)d[Ee+K]=Be%this.classifications,Be=Be/this.classifications|0}for(var Ne=0,Le=l;Ne>1,y=n+8;null==y&&(y=0);var x=i.readU8(y),T=(i.readU8(y+1)|x<<8)>>1,S=n+10;null==S&&(S=0);var k=i.readU8(S),I=i.readU8(S+1)|k<<8,C=n+12;null==C&&(C=0);var B=i.readU8(C),E=(i.readU8(C+1)|B<<8)>>1,N=n+14,L=N;if(65535>=1);null==M&&(M=0);var P=i.readU8(M);(i.readU8(M+1)|P<<8)>1,O=N+2*R;null==O&&(O=0);var V=i.readU8(O);if((i.readU8(O+1)|V<<8)>1),re=n+16+12*ne;null==re&&(re=0);var se=re;null==se&&(se=0);var ae=i.readU8(se),oe=i.readU8(se+1),le=i.readU8(se+2),ue=i.readU8(se+3)|le<<8|oe<<16|ae<<24,he=n+16+12*ne+4;null==he&&(he=0);var ce=he;null==ce&&(ce=0);var de=i.readU8(ce),_e=i.readU8(ce+1),fe=i.readU8(ce+2),pe=i.readU8(ce+3);if(t=e.numGlyphs)return-1;if(2<=e.indexToLocFormat)return-1;if(0==e.indexToLocFormat){var r=e.glyf,s=e.data,a=e.loca+2*t;null==a&&(a=0);var o=s.readU8(a);i=r+2*(s.readU8(a+1)|o<<8);var l=e.glyf,u=e.data,h=e.loca+2*t+2;null==h&&(h=0);var c=u.readU8(h);n=l+2*(u.readU8(h+1)|c<<8)}else{var d=e.glyf,_=e.data,f=e.loca+4*t;null==f&&(f=0);var p=f;null==p&&(p=0);var g=_.readU8(p),m=_.readU8(p+1),v=_.readU8(p+2);i=d+(_.readU8(p+3)|v<<8|m<<16|g<<24);var b=e.glyf,w=e.data,y=e.loca+4*t+4;null==y&&(y=0);var x=y;null==x&&(x=0);var T=w.readU8(x),S=w.readU8(x+1),k=w.readU8(x+2);n=b+(w.readU8(x+3)|k<<8|S<<16|T<<24)}return i==n?-1:i},Et.stbtt_GetGlyphBox=function(e,t,i){var n=Et.stbtt__GetGlyfOffset(e,t);if(n<0)return!1;var r=e.data,s=n+2;null==s&&(s=0);var a=r.readU8(s),o=r.readU8(s+1)|a<<8;i.x0=0!=(32768&o)?o-65536:o;var l=e.data,u=n+4;null==u&&(u=0);var h=l.readU8(u),c=l.readU8(u+1)|h<<8;i.y0=0!=(32768&c)?c-65536:c;var d=e.data,_=n+6;null==_&&(_=0);var f=d.readU8(_),p=d.readU8(_+1)|f<<8;i.x1=0!=(32768&p)?p-65536:p;var g=e.data,m=n+8;null==m&&(m=0);var v=g.readU8(m),b=g.readU8(m+1)|v<<8;return i.y1=0!=(32768&b)?b-65536:b,!0},Et.stbtt_GetCodepointBox=function(e,t,i){return Et.stbtt_GetGlyphBox(e,Et.stbtt_FindGlyphIndex(e,t),i)},Et.stbtt_IsGlyphEmpty=function(e,t){var i=Et.stbtt__GetGlyfOffset(e,t);if(i<0)return!0;var n=e.data,r=i;null==r&&(r=0);var s=n.readU8(r),a=n.readU8(r+1)|s<<8;return 0==(0!=(32768&a)?a-65536:a)},Et.stbtt__close_shape=function(e,t,i,n,r,s,a,o,l,u){return n?(i&&Et.stbtt_setvertex(e[t++],3,l+a>>1,u+o>>1,l,u),Et.stbtt_setvertex(e[t++],3,r,s,a,o)):i?Et.stbtt_setvertex(e[t++],3,r,s,l,u):Et.stbtt_setvertex(e[t++],2,r,s,0,0),t},Et.copyVertices=function(e,t,i,n){for(var r=0,s=n;r>1,Z=O+n[h+q+1].y>>1):(j=n[h+q+1].x,Z=n[h+q+1].y,++q)):(j=N,Z=O),Et.stbtt_setvertex(n[r++],1,j,Z,0,0),f=!1;var Q=g+2*d;null==Q&&(Q=0);var J=i.readU8(Q);_=1+(i.readU8(Q+1)|J<<8),++d}else f=0==(1&c)?(f&&Et.stbtt_setvertex(n[r++],3,Y+N>>1,K+O>>1,Y,K),Y=N,K=O,!0):(f?Et.stbtt_setvertex(n[r++],3,N,O,Y,K):Et.stbtt_setvertex(n[r++],2,N,O,0,0),!1);++q}r=Et.stbtt__close_shape(n,r,f,p,j,Z,X,z,Y,K)}else if(-1==u){var $=1,ee=s+10;for(r=0,n=null;0!=$;){var te,ie,ne=null,re=1,se=0,ae=0,oe=1,le=0,ue=0,he=ee;null==he&&(he=0);var ce=i.readU8(he),de=i.readU8(he+1)|ce<<8,_e=0!=(32768&de)?de-65536:de,fe=ee+=2;null==fe&&(fe=0);var pe=i.readU8(fe),ge=i.readU8(fe+1)|pe<<8,me=0!=(32768&ge)?ge-65536:ge;if(ee+=2,0==(2&_e))throw new pt("Error");if(0!=(1&_e)){var ve=ee;null==ve&&(ve=0);var be=i.readU8(ve),we=i.readU8(ve+1)|be<<8;le=0!=(32768&we)?we-65536:we;var ye=ee+=2;null==ye&&(ye=0);var xe=i.readU8(ye),Te=i.readU8(ye+1)|xe<<8;ue=0!=(32768&Te)?Te-65536:Te,ee+=2}else{var Se=ee;null==Se&&(Se=0);var ke=i.readU8(Se);le=128<=ke?ke-256:ke;var Ie=++ee;null==Ie&&(Ie=0);var Ce=i.readU8(Ie);ue=128<=Ce?Ce-256:Ce,++ee}if(0!=(8&_e)){var Be=ee;null==Be&&(Be=0);var Ee=i.readU8(Be),Ne=i.readU8(Be+1)|Ee<<8;re=oe=(0!=(32768&Ne)?Ne-65536:Ne)/16384,ee+=2,se=ae=0}else if(0!=(64&_e)){var Le=ee;null==Le&&(Le=0);var Fe=i.readU8(Le),Ae=i.readU8(Le+1)|Fe<<8;re=(0!=(32768&Ae)?Ae-65536:Ae)/16384,se=ae=0;var Me=ee+=2;null==Me&&(Me=0);var Pe=i.readU8(Me),Re=i.readU8(Me+1)|Pe<<8;oe=(0!=(32768&Re)?Re-65536:Re)/16384,ee+=2}else if(0!=(128&_e)){var Oe=ee;null==Oe&&(Oe=0);var Ve=i.readU8(Oe),De=i.readU8(Oe+1)|Ve<<8;re=(0!=(32768&De)?De-65536:De)/16384;var Ue=ee+=2;null==Ue&&(Ue=0);var He=i.readU8(Ue),We=i.readU8(Ue+1)|He<<8;se=(0!=(32768&We)?We-65536:We)/16384;var Ge=ee+=2;null==Ge&&(Ge=0);var ze=i.readU8(Ge),Xe=i.readU8(Ge+1)|ze<<8;ae=(0!=(32768&Xe)?Xe-65536:Xe)/16384;var Ke=ee+=2;null==Ke&&(Ke=0);var Ye=i.readU8(Ke),Ze=i.readU8(Ke+1)|Ye<<8;oe=(0!=(32768&Ze)?Ze-65536:Ze)/16384,ee+=2}var je=Math.sqrt(re*re+se*se),qe=Math.sqrt(ae*ae+oe*oe);if(0<(te=null==(ie=Et.stbtt_GetGlyphShape(e,me))?0:ie.length)){for(var Qe=0,Je=te;Qe>1);null==g&&(g=0);var m=g;null==m&&(m=0);var v=a.readU8(m),b=a.readU8(m+1),w=a.readU8(m+2);if(p<(n=a.readU8(m+3)|w<<8|b<<16|v<<24))f=r-1;else{if(!(nn.ey||on.ey&&(a+=(a-r)*(n.ey-o)/(o-s),o=n.ey),r==i){if(!(a<=i+1))throw new pt("Error")}else if(r==i+1){if(!(i<=a))throw new pt("Error")}else if(r<=i){if(!(a<=i))throw new pt("Error")}else if(i+1<=r){if(!(i+1<=a))throw new pt("Error")}else if(!(i<=a&&a<=i+1))throw new pt("Error");if(r<=i&&a<=i){var l=t+i;e[l]=e[l]+n.direction*(o-s)}else if(!(i+1<=r&&i+1<=a)){if(!(i<=r&&r<=i+1&&i<=a&&a<=i+1))throw new pt("Error");var u=t+i;e[u]=e[u]+n.direction*(o-s)*(1-(r-i+(a-i))/2)}}}},Et.stbtt__fill_active_edges_new=function(e,t,i,n,r,s){for(var a=s+1;null!=r;){if(!(r.ey>=s))throw new pt("Error");if(0==r.fdx){var o=r.fx;o=s))throw new pt("Error");if(h=r.sy>s?(l=d+_*(r.sy-s),r.sy):(l=d,s),c=r.ey=_))throw new pt("Error");x.next=l,l=x}++h}null!=l&&Et.stbtt__fill_active_edges_new(a,c,o+1,e.w,l,_);for(var T=0,S=0,k=e.w;S>1,s=Et.STBTT__COMPARE(e[t],e[t+r]),a=Et.STBTT__COMPARE(e[t+r],e[t+i-1]);if(s!=a){var o=Et.STBTT__COMPARE(e[t],e[t+i-1])==a?0:i-1;n=e[t+o],e[t+o]=e[t+r],e[t+r]=n}n=e[t],e[t]=e[t+r],e[t+r]=n;for(var l=1,u=i-1;;){for(;Et.STBTT__COMPARE(e[t+l],e[t]);)++l;for(;Et.STBTT__COMPARE(e[t],e[t+u]);)--u;if(u<=l)break;n=e[t+l],e[t+l]=e[t+u],e[t+u]=n,++l,--u}uT[S+C].y:T[S+c].y>>16),_=.00392156862745098*((65280&h)>>>8),f=.00392156862745098*(255&h),p=.00392156862745098*(h>>>24)*u,g=9*Rt.bufferIndex*4;Rt.rectVertices[5+g]=d,Rt.rectVertices[6+g]=_,Rt.rectVertices[7+g]=f,Rt.rectVertices[8+g]=p,Rt.rectVertices[14+g]=d,Rt.rectVertices[15+g]=_,Rt.rectVertices[16+g]=f,Rt.rectVertices[17+g]=p,Rt.rectVertices[23+g]=d,Rt.rectVertices[24+g]=_,Rt.rectVertices[25+g]=f,Rt.rectVertices[26+g]=p,Rt.rectVertices[32+g]=d,Rt.rectVertices[33+g]=_,Rt.rectVertices[34+g]=f,Rt.rectVertices[35+g]=p;var m=c.get_width()/c.get_realWidth(),v=c.get_height()/c.get_realHeight(),b=9*Rt.bufferIndex*4;Rt.rectVertices[3+b]=0,Rt.rectVertices[4+b]=v,Rt.rectVertices[12+b]=0,Rt.rectVertices[13+b]=0,Rt.rectVertices[21+b]=m,Rt.rectVertices[22+b]=0,Rt.rectVertices[30+b]=m,Rt.rectVertices[31+b]=v;var w=9*Rt.bufferIndex*4;Rt.rectVertices[w]=t,Rt.rectVertices[1+w]=i,Rt.rectVertices[2+w]=-5,Rt.rectVertices[9+w]=n,Rt.rectVertices[10+w]=r,Rt.rectVertices[11+w]=-5,Rt.rectVertices[18+w]=s,Rt.rectVertices[19+w]=a,Rt.rectVertices[20+w]=-5,Rt.rectVertices[27+w]=o,Rt.rectVertices[28+w]=l,Rt.rectVertices[29+w]=-5,++Rt.bufferIndex,Rt.lastTexture=c},drawImage2:function(e,t,i,n,r,s,a,o,l,u,h,c,d,_,f){var p=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&p!=Rt.lastTexture)&&this.drawBuffer();var g=t/p.get_realWidth(),m=i/p.get_realHeight(),v=(t+n)/p.get_realWidth(),b=(i+r)/p.get_realHeight(),w=9*Rt.bufferIndex*4;Rt.rectVertices[3+w]=g,Rt.rectVertices[4+w]=b,Rt.rectVertices[12+w]=g,Rt.rectVertices[13+w]=m,Rt.rectVertices[21+w]=v,Rt.rectVertices[22+w]=m,Rt.rectVertices[30+w]=v,Rt.rectVertices[31+w]=b;var y=.00392156862745098*((16711680&f)>>>16),x=.00392156862745098*((65280&f)>>>8),T=.00392156862745098*(255&f),S=.00392156862745098*(f>>>24)*_,k=9*Rt.bufferIndex*4;Rt.rectVertices[5+k]=y,Rt.rectVertices[6+k]=x,Rt.rectVertices[7+k]=T,Rt.rectVertices[8+k]=S,Rt.rectVertices[14+k]=y,Rt.rectVertices[15+k]=x,Rt.rectVertices[16+k]=T,Rt.rectVertices[17+k]=S,Rt.rectVertices[23+k]=y,Rt.rectVertices[24+k]=x,Rt.rectVertices[25+k]=T,Rt.rectVertices[26+k]=S,Rt.rectVertices[32+k]=y,Rt.rectVertices[33+k]=x,Rt.rectVertices[34+k]=T,Rt.rectVertices[35+k]=S;var I=9*Rt.bufferIndex*4;Rt.rectVertices[I]=s,Rt.rectVertices[1+I]=a,Rt.rectVertices[2+I]=-5,Rt.rectVertices[9+I]=o,Rt.rectVertices[10+I]=l,Rt.rectVertices[11+I]=-5,Rt.rectVertices[18+I]=u,Rt.rectVertices[19+I]=h,Rt.rectVertices[20+I]=-5,Rt.rectVertices[27+I]=c,Rt.rectVertices[28+I]=d,Rt.rectVertices[29+I]=-5,++Rt.bufferIndex,Rt.lastTexture=p},drawImageScale:function(e,t,i,n,r,s,a,o,l,u,h){var c=e;(1500<=Rt.bufferIndex+1||null!=Rt.lastTexture&&c!=Rt.lastTexture)&&this.drawBuffer();var d=t/c.get_realWidth(),_=i/c.get_realHeight(),f=(t+n)/c.get_realWidth(),p=(i+r)/c.get_realHeight(),g=9*Rt.bufferIndex*4;Rt.rectVertices[3+g]=d,Rt.rectVertices[4+g]=p,Rt.rectVertices[12+g]=d,Rt.rectVertices[13+g]=_,Rt.rectVertices[21+g]=f,Rt.rectVertices[22+g]=_,Rt.rectVertices[30+g]=f,Rt.rectVertices[31+g]=p;var m=.00392156862745098*((16711680&h)>>>16),v=.00392156862745098*((65280&h)>>>8),b=.00392156862745098*(255&h),w=9*Rt.bufferIndex*4;Rt.rectVertices[5+w]=m,Rt.rectVertices[6+w]=v,Rt.rectVertices[7+w]=b,Rt.rectVertices[8+w]=u,Rt.rectVertices[14+w]=m,Rt.rectVertices[15+w]=v,Rt.rectVertices[16+w]=b,Rt.rectVertices[17+w]=u,Rt.rectVertices[23+w]=m,Rt.rectVertices[24+w]=v,Rt.rectVertices[25+w]=b,Rt.rectVertices[26+w]=u,Rt.rectVertices[32+w]=m,Rt.rectVertices[33+w]=v,Rt.rectVertices[34+w]=b,Rt.rectVertices[35+w]=u;var y=9*Rt.bufferIndex*4;Rt.rectVertices[y]=s,Rt.rectVertices[1+y]=l,Rt.rectVertices[2+y]=-5,Rt.rectVertices[9+y]=s,Rt.rectVertices[10+y]=a,Rt.rectVertices[11+y]=-5,Rt.rectVertices[18+y]=o,Rt.rectVertices[19+y]=a,Rt.rectVertices[20+y]=-5,Rt.rectVertices[27+y]=o,Rt.rectVertices[28+y]=l,Rt.rectVertices[29+y]=-5,++Rt.bufferIndex,Rt.lastTexture=c},end:function(){0>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.rectVertices[3+i]=r,Ot.rectVertices[4+i]=s,Ot.rectVertices[5+i]=a,Ot.rectVertices[6+i]=n,Ot.rectVertices[10+i]=r,Ot.rectVertices[11+i]=s,Ot.rectVertices[12+i]=a,Ot.rectVertices[13+i]=n,Ot.rectVertices[17+i]=r,Ot.rectVertices[18+i]=s,Ot.rectVertices[19+i]=a,Ot.rectVertices[20+i]=n,Ot.rectVertices[24+i]=r,Ot.rectVertices[25+i]=s,Ot.rectVertices[26+i]=a,Ot.rectVertices[27+i]=n},setTriVertices:function(e,t,i,n,r,s){var a=7*Ot.triangleBufferIndex*3;Ot.triangleVertices[a]=e,Ot.triangleVertices[1+a]=t,Ot.triangleVertices[2+a]=-5,Ot.triangleVertices[7+a]=i,Ot.triangleVertices[8+a]=n,Ot.triangleVertices[9+a]=-5,Ot.triangleVertices[14+a]=r,Ot.triangleVertices[15+a]=s,Ot.triangleVertices[16+a]=-5},setTriColors:function(e,t){var i=7*Ot.triangleBufferIndex*3,n=e*(.00392156862745098*(t>>>24)),r=.00392156862745098*((16711680&t)>>>16)*n,s=.00392156862745098*((65280&t)>>>8)*n,a=.00392156862745098*(255&t)*n;Ot.triangleVertices[3+i]=r,Ot.triangleVertices[4+i]=s,Ot.triangleVertices[5+i]=a,Ot.triangleVertices[6+i]=n,Ot.triangleVertices[10+i]=r,Ot.triangleVertices[11+i]=s,Ot.triangleVertices[12+i]=a,Ot.triangleVertices[13+i]=n,Ot.triangleVertices[17+i]=r,Ot.triangleVertices[18+i]=s,Ot.triangleVertices[19+i]=a,Ot.triangleVertices[20+i]=n},drawBuffer:function(e){e||0>>24));Vt.rectVertices[5+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[6+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[7+i]=.00392156862745098*(255&t),Vt.rectVertices[8+i]=n,Vt.rectVertices[14+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[15+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[16+i]=.00392156862745098*(255&t),Vt.rectVertices[17+i]=n,Vt.rectVertices[23+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[24+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[25+i]=.00392156862745098*(255&t),Vt.rectVertices[26+i]=n,Vt.rectVertices[32+i]=.00392156862745098*((16711680&t)>>>16),Vt.rectVertices[33+i]=.00392156862745098*((65280&t)>>>8),Vt.rectVertices[34+i]=.00392156862745098*(255&t),Vt.rectVertices[35+i]=n},drawBuffer:function(){Vt.rectVertexBuffer.unlock(4*Vt.bufferIndex),this.g.setVertexBuffer(Vt.rectVertexBuffer),this.g.setIndexBuffer(Vt.indexBuffer),this.g.setPipeline(this.myPipeline.pipeline),this.g.setTexture(this.myPipeline.textureLocation,Vt.lastTexture),this.g.setMatrix(this.myPipeline.projectionLocation,this.projectionMatrix),this.g.setTextureParameters(this.myPipeline.textureLocation,2,2,this.bilinear?1:0,this.bilinear?1:0,0),this.g.drawIndexedVertices(0,2*Vt.bufferIndex*3),this.g.setTexture(this.myPipeline.textureLocation,null),Vt.bufferIndex=0,Vt.rectVertices=Vt.rectVertexBuffer.lock()},setBilinearFilter:function(e){this.end(),this.bilinear=e},setFont:function(e){this.font=g.__cast(e,D)},bakedQuadCache:null,drawString:function(e,t,i,n,r,s){var a=this.font._get(this.fontSize),o=a.getTexture();null!=Vt.lastTexture&&o!=Vt.lastTexture&&this.drawBuffer(),Vt.lastTexture=o;for(var l=n,u=r,h=0,c=e.length;h>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e},Dt.createImageVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createImagePipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_image_frag,t.vertexShader=z.painter_image_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createColoredVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("vertexColor",3),e},Dt.createColoredPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_colored_frag,t.vertexShader=z.painter_colored_vert,t.inputLayout=[e],t.blendSource=1,t.blendDestination=5,t.alphaBlendSource=1,t.alphaBlendDestination=5,t},Dt.createTextVertexStructure=function(){var e=new qt;return e.add("vertexPosition",2),e.add("texPosition",1),e.add("vertexColor",3),e},Dt.createTextPipeline=function(e){var t=new Wt;return t.fragmentShader=z.painter_text_frag,t.vertexShader=z.painter_text_vert,t.inputLayout=[e],t.blendSource=3,t.blendDestination=5,t.alphaBlendSource=3,t.alphaBlendDestination=5,t},Dt.__super__=Ze,Dt.prototype=r(Ze.prototype,{myColor:null,myFont:null,projectionMatrix:null,imagePainter:null,coloredPainter:null,textPainter:null,canvas:null,g:null,setProjection:function(){var e=this.canvas.get_width(),t=this.canvas.get_height();if(this.canvas instanceof A){var i=this.projectionMatrix,n=2/e,r=-e/e,s=2/(0-t),a=-t/(0-t);i._00=n,i._10=0,i._20=0,i._30=r,i._01=0,i._11=s,i._21=0,i._31=a,i._02=0,i._12=0,i._22=-.002000200020002,i._32=-1.0002000200020003,i._03=0,i._13=0,i._23=0,i._33=1}else if(R.get_nonPow2Supported()||(e=Dt.upperPowerOfTwo(e),t=Dt.upperPowerOfTwo(t)),R.renderTargetsInvertedY()){var o=this.projectionMatrix,l=2/e,u=-e/e,h=2/t,c=-t/t;o._00=l,o._10=0,o._20=0,o._30=u,o._01=0,o._11=h,o._21=0,o._31=c,o._02=0,o._12=0,o._22=-.002000200020002,o._32=-1.0002000200020003,o._03=0,o._13=0,o._23=0,o._33=1}else{var d=this.projectionMatrix,_=2/e,f=-e/e,p=2/(0-t),g=-t/(0-t);d._00=_,d._10=0,d._20=0,d._30=f,d._01=0,d._11=p,d._21=0,d._31=g,d._02=0,d._12=0,d._22=-.002000200020002,d._32=-1.0002000200020003,d._03=0,d._13=0,d._23=0,d._33=1}this.imagePainter.setProjection(this.projectionMatrix),this.coloredPainter.setProjection(this.projectionMatrix),this.textPainter.setProjection(this.projectionMatrix)},drawImage:function(e,t,i){var n=this.coloredPainter;0>>16),G=.00392156862745098*((65280&U)>>>8),z=.00392156862745098*(255&U),X=.00392156862745098*(U>>>24)*D,K=9*Rt.bufferIndex*4;Rt.rectVertices[5+K]=W,Rt.rectVertices[6+K]=G,Rt.rectVertices[7+K]=z,Rt.rectVertices[8+K]=X,Rt.rectVertices[14+K]=W,Rt.rectVertices[15+K]=G,Rt.rectVertices[16+K]=z,Rt.rectVertices[17+K]=X,Rt.rectVertices[23+K]=W,Rt.rectVertices[24+K]=G,Rt.rectVertices[25+K]=z,Rt.rectVertices[26+K]=X,Rt.rectVertices[32+K]=W,Rt.rectVertices[33+K]=G,Rt.rectVertices[34+K]=z,Rt.rectVertices[35+K]=X;var Y=H.get_width()/H.get_realWidth(),Z=H.get_height()/H.get_realHeight(),j=9*Rt.bufferIndex*4;Rt.rectVertices[3+j]=0,Rt.rectVertices[4+j]=Z,Rt.rectVertices[12+j]=0,Rt.rectVertices[13+j]=0,Rt.rectVertices[21+j]=Y,Rt.rectVertices[22+j]=0,Rt.rectVertices[30+j]=Y,Rt.rectVertices[31+j]=Z;var q=9*Rt.bufferIndex*4;Rt.rectVertices[q]=d,Rt.rectVertices[1+q]=_,Rt.rectVertices[2+q]=-5,Rt.rectVertices[9+q]=w,Rt.rectVertices[10+q]=y,Rt.rectVertices[11+q]=-5,Rt.rectVertices[18+q]=B,Rt.rectVertices[19+q]=E,Rt.rectVertices[20+q]=-5,Rt.rectVertices[27+q]=R,Rt.rectVertices[28+q]=O,Rt.rectVertices[29+q]=-5,++Rt.bufferIndex,Rt.lastTexture=H},drawScaledSubImage:function(e,t,i,n,r,s,a,o,l){var u=this.coloredPainter;0>>16),J=.00392156862745098*((65280&z)>>>8),$=.00392156862745098*(255&z),ee=.00392156862745098*(z>>>24)*G,te=9*Rt.bufferIndex*4;Rt.rectVertices[5+te]=Q,Rt.rectVertices[6+te]=J,Rt.rectVertices[7+te]=$,Rt.rectVertices[8+te]=ee,Rt.rectVertices[14+te]=Q,Rt.rectVertices[15+te]=J,Rt.rectVertices[16+te]=$,Rt.rectVertices[17+te]=ee,Rt.rectVertices[23+te]=Q,Rt.rectVertices[24+te]=J,Rt.rectVertices[25+te]=$,Rt.rectVertices[26+te]=ee,Rt.rectVertices[32+te]=Q,Rt.rectVertices[33+te]=J,Rt.rectVertices[34+te]=$,Rt.rectVertices[35+te]=ee;var ie=9*Rt.bufferIndex*4;Rt.rectVertices[ie]=g,Rt.rectVertices[1+ie]=m,Rt.rectVertices[2+ie]=-5,Rt.rectVertices[9+ie]=S,Rt.rectVertices[10+ie]=k,Rt.rectVertices[11+ie]=-5,Rt.rectVertices[18+ie]=F,Rt.rectVertices[19+ie]=A,Rt.rectVertices[20+ie]=-5,Rt.rectVertices[27+ie]=U,Rt.rectVertices[28+ie]=H,Rt.rectVertices[29+ie]=-5,++Rt.bufferIndex,Rt.lastTexture=X},get_color:function(){return this.myColor},set_color:function(e){return this.myColor=e},drawRect:function(e,t,i,n,r){null==r&&(r=1),this.imagePainter.end(),this.textPainter.end();var s=this.transformations[this.transformationIndex],a=e-r/2,o=t+r/2;null==o&&(o=0),null==a&&(a=0);var l=s._02*a+s._12*o+s._22,u=(s._00*a+s._10*o+s._20)/l,h=(s._01*a+s._11*o+s._21)/l;null==h&&(h=0),null==u&&(u=0);var c=u,d=h,_=this.transformations[this.transformationIndex],f=e-r/2,p=t-r/2;null==p&&(p=0),null==f&&(f=0);var g=_._02*f+_._12*p+_._22,m=(_._00*f+_._10*p+_._20)/g,v=(_._01*f+_._11*p+_._21)/g;null==v&&(v=0),null==m&&(m=0);var b=m,w=v,y=this.transformations[this.transformationIndex],x=e+i+r/2,T=t-r/2;null==T&&(T=0),null==x&&(x=0);var S=y._02*x+y._12*T+y._22,k=(y._00*x+y._10*T+y._20)/S,I=(y._01*x+y._11*T+y._21)/S;null==I&&(I=0),null==k&&(k=0);var C=k,B=I,E=this.transformations[this.transformationIndex],N=e+i+r/2,L=t+r/2;null==L&&(L=0),null==N&&(N=0);var F=E._02*N+E._12*L+E._22,A=(E._00*N+E._10*L+E._20)/F,M=(E._01*N+E._11*L+E._21)/F;null==M&&(M=0),null==A&&(A=0);var P=A,R=M;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var O=this.transformations[this.transformationIndex],V=e-r/2,D=t+n-r/2;null==D&&(D=0),null==V&&(V=0);var U=O._02*V+O._12*D+O._22,H=(O._00*V+O._10*D+O._20)/U,W=(O._01*V+O._11*D+O._21)/U;null==W&&(W=0),null==H&&(H=0),c=H,d=W;var G=this.transformations[this.transformationIndex],z=e-r/2,X=t+r/2;null==X&&(X=0),null==z&&(z=0);var K=G._02*z+G._12*X+G._22,Y=(G._00*z+G._10*X+G._20)/K,Z=(G._01*z+G._11*X+G._21)/K;null==Z&&(Z=0),null==Y&&(Y=0),b=Y,w=Z;var j=this.transformations[this.transformationIndex],q=e+r/2,Q=t+r/2;null==Q&&(Q=0),null==q&&(q=0);var J=j._02*q+j._12*Q+j._22,$=(j._00*q+j._10*Q+j._20)/J,ee=(j._01*q+j._11*Q+j._21)/J;null==ee&&(ee=0),null==$&&($=0),C=$,B=ee;var te=this.transformations[this.transformationIndex],ie=e+r/2,ne=t+n-r/2;null==ne&&(ne=0),null==ie&&(ie=0);var re=te._02*ie+te._12*ne+te._22,se=(te._00*ie+te._10*ne+te._20)/re,ae=(te._01*ie+te._11*ne+te._21)/re;null==ae&&(ae=0),null==se&&(se=0),P=se,R=ae,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var oe=this.transformations[this.transformationIndex],le=e-r/2,ue=t+n+r/2;null==ue&&(ue=0),null==le&&(le=0);var he=oe._02*le+oe._12*ue+oe._22,ce=(oe._00*le+oe._10*ue+oe._20)/he,de=(oe._01*le+oe._11*ue+oe._21)/he;null==de&&(de=0),null==ce&&(ce=0),c=ce,d=de;var _e=this.transformations[this.transformationIndex],fe=e-r/2,pe=t+n-r/2;null==pe&&(pe=0),null==fe&&(fe=0);var ge=_e._02*fe+_e._12*pe+_e._22,me=(_e._00*fe+_e._10*pe+_e._20)/ge,ve=(_e._01*fe+_e._11*pe+_e._21)/ge;null==ve&&(ve=0),null==me&&(me=0),b=me,w=ve;var be=this.transformations[this.transformationIndex],we=e+i+r/2,ye=t+n-r/2;null==ye&&(ye=0),null==we&&(we=0);var xe=be._02*we+be._12*ye+be._22,Te=(be._00*we+be._10*ye+be._20)/xe,Se=(be._01*we+be._11*ye+be._21)/xe;null==Se&&(Se=0),null==Te&&(Te=0),C=Te,B=Se;var ke=this.transformations[this.transformationIndex],Ie=e+i+r/2,Ce=t+n+r/2;null==Ce&&(Ce=0),null==Ie&&(Ie=0);var Be=ke._02*Ie+ke._12*Ce+ke._22,Ee=(ke._00*Ie+ke._10*Ce+ke._20)/Be,Ne=(ke._01*Ie+ke._11*Ce+ke._21)/Be;null==Ne&&(Ne=0),null==Ee&&(Ee=0),P=Ee,R=Ne,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R);var Le=this.transformations[this.transformationIndex],Fe=e+i-r/2,Ae=t+n-r/2;null==Ae&&(Ae=0),null==Fe&&(Fe=0);var Me=Le._02*Fe+Le._12*Ae+Le._22,Pe=(Le._00*Fe+Le._10*Ae+Le._20)/Me,Re=(Le._01*Fe+Le._11*Ae+Le._21)/Me;null==Re&&(Re=0),null==Pe&&(Pe=0),c=Pe,d=Re;var Oe=this.transformations[this.transformationIndex],Ve=e+i-r/2,De=t+r/2;null==De&&(De=0),null==Ve&&(Ve=0);var Ue=Oe._02*Ve+Oe._12*De+Oe._22,He=(Oe._00*Ve+Oe._10*De+Oe._20)/Ue,We=(Oe._01*Ve+Oe._11*De+Oe._21)/Ue;null==We&&(We=0),null==He&&(He=0),b=He,w=We;var Ge=this.transformations[this.transformationIndex],ze=e+i+r/2,Xe=t+r/2;null==Xe&&(Xe=0),null==ze&&(ze=0);var Ke=Ge._02*ze+Ge._12*Xe+Ge._22,Ye=(Ge._00*ze+Ge._10*Xe+Ge._20)/Ke,Ze=(Ge._01*ze+Ge._11*Xe+Ge._21)/Ke;null==Ze&&(Ze=0),null==Ye&&(Ye=0),C=Ye,B=Ze;var je=this.transformations[this.transformationIndex],qe=e+i+r/2,Qe=t+n-r/2;null==Qe&&(Qe=0),null==qe&&(qe=0);var Je=je._02*qe+je._12*Qe+je._22,$e=(je._00*qe+je._10*Qe+je._20)/Je,et=(je._01*qe+je._11*Qe+je._21)/Je;null==et&&(et=0),null==$e&&($e=0),P=$e,R=et,this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),c,d,b,w,C,B,P,R)},fillRect:function(e,t,i,n){this.imagePainter.end(),this.textPainter.end();var r=this.transformations[this.transformationIndex],s=e,a=t+n;null==a&&(a=0),null==s&&(s=0);var o=r._02*s+r._12*a+r._22,l=(r._00*s+r._10*a+r._20)/o,u=(r._01*s+r._11*a+r._21)/o;null==u&&(u=0),null==l&&(l=0);var h=l,c=u,d=this.transformations[this.transformationIndex],_=e,f=t;null==f&&(f=0),null==_&&(_=0);var p=d._02*_+d._12*f+d._22,g=(d._00*_+d._10*f+d._20)/p,m=(d._01*_+d._11*f+d._21)/p;null==m&&(m=0),null==g&&(g=0);var v=g,b=m,w=this.transformations[this.transformationIndex],y=e+i,x=t;null==x&&(x=0),null==y&&(y=0);var T=w._02*y+w._12*x+w._22,S=(w._00*y+w._10*x+w._20)/T,k=(w._01*y+w._11*x+w._21)/T;null==k&&(k=0),null==S&&(S=0);var I=S,C=k,B=this.transformations[this.transformationIndex],E=e+i,N=t+n;null==N&&(N=0),null==E&&(E=0);var L=B._02*E+B._12*N+B._22,F=(B._00*E+B._10*N+B._20)/L,A=(B._01*E+B._11*N+B._21)/L;null==A&&(A=0),null==F&&(F=0);var M=F,P=A;this.coloredPainter.fillRect(this.get_opacity(),this.get_color(),h,c,v,b,I,C,M,P)},drawString:function(e,t,i){this.imagePainter.end();var n=this.coloredPainter;0=Qt.instances.length?null:Qt.instances[e]},Qt.notifyOnConnect=function(e,t){null!=e&&Qt.connectListeners.push(e),null!=t&&Qt.disconnectListeners.push(t)},Qt.removeConnect=function(e,t){null!=e&&it.remove(Qt.connectListeners,e),null!=t&&it.remove(Qt.disconnectListeners,t)},Qt.sendConnectEvent=function(e){Qt.instances[e].connected=!0;for(var t=0,i=Qt.connectListeners;t>23&255,n=8388607&e;switch(i){case 0:return 0;case 255:return 0!=n?NaN:0>>t&1)){return!0}return!1},si.toText=function(e,t){for(var i="",n=0,r=t;n>>16)}),"R",0,1,!0),r=e.slider(t.nest(1,{value:.00392156862745098*((65280&t.color)>>>8)}),"G",0,1,!0),s=e.slider(t.nest(2,{value:.00392156862745098*(255&t.color)}),"B",0,1,!0),a=.00392156862745098*(t.color>>>24);i&&(a=e.slider(t.nest(3,{value:a}),"A",0,1,!0));var o=N.fromFloats(n,r,s,a);return e.text("",2,o),o},Ci.initPath=function(e,t){e.text="Windows"==t?"C:\\Users":"/"},Ci.fileBrowser=function(e,t,i){null==i&&(i=!1);var n="/",r="ls ",s=mt.get_systemId();"Windows"==s&&(r="dir /b ",i&&(r+="/ad "),n="\\",t.text=ut.replace(t.text,"\\\\","\\"),t.text=ut.replace(t.text,"\r","")),""==t.text&&Ci.initPath(t,s);var a=Krom.getFilesLocation()+n+Ci.dataPath+"dir.txt";t.text!=Ci.lastPath&&Krom.sysCommand(r+'"'+t.text+'" > "'+a+'"'),Ci.lastPath=t.text;var o=he.ofData(Krom.loadBlob(a)).toString().split("\n"),l=t.text.indexOf("/"),u=t.text.indexOf("\\"),h=-1l||-1u;t.changed=!1,h&&e.button("..",0)&&(t.changed=e.changed=!0,t.text=t.text.substring(0,t.text.lastIndexOf(n)),2==t.text.length&&":"==t.text.charAt(1)&&(t.text+=n));for(var c=0;c=i.length&&(t.position=0),t.changed=e.changed=!0):t.changed=!1;var r=e.getHover();return Ci.drawInlineRadio(e,i[t.position],r,n),e.endElement(),t.position},Ci.drawInlineRadio=function(e,t,i,n){null==n&&(n=1),i?(e.g.set_color(e.t.ACCENT_HOVER_COL),e.g.fillRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)):(e.g.set_color(e.t.ACCENT_COL),e.enabled||e.fadeColor(),e.g.drawRect(e._x+e.buttonOffsetY,e._y+e.buttonOffsetY,e._w-2*e.buttonOffsetY,e.t.BUTTON_H*e.ops.scaleFactor)),e.g.set_color(e.t.TEXT_COL),e.drawString(e.g,t,e.t.TEXT_OFFSET*e.ops.scaleFactor,0,n)},Ci.colorWheel=function(e,t,i,n,r,s){null==s&&(s=!0),null==r&&(r=!1),null==i&&(i=!1),null==n&&(n=e._w),Ci.rgbToHsv(.00392156862745098*((16711680&t.color)>>>16),.00392156862745098*((65280&t.color)>>>8),.00392156862745098*(255&t.color),Ci.ar);var a=Ci.ar[0],o=Ci.ar[1],l=Ci.ar[2],u=.00392156862745098*(t.color>>>24),h=e._x,c=e._y;null!=e.currentWindow&&e.currentWindow.scrollEnabled||(n-=e.t.SCROLL_W*e.ops.scaleFactor|0,h+=(e.t.SCROLL_W*e.ops.scaleFactor|0)/2),e.image(e.ops.color_wheel,N.fromFloats(l,l,l));var d=h+n/2,_=c+(e._y-c)/2,f=.7*n,p=f/2,g=d,m=_+o*p,v=a*(2*Math.PI),b=Math.cos(v)*(g-d)-Math.sin(v)*(m-_)+d,w=Math.sin(v)*(g-d)+Math.cos(v)*(m-_)+_;g=b,m=w,e.g.set_color(-16777216),e.g.fillRect(g-3*e.ops.scaleFactor,m-3*e.ops.scaleFactor,6*e.ops.scaleFactor,6*e.ops.scaleFactor),e.g.set_color(-1),e.g.fillRect(g-2*e.ops.scaleFactor,m-2*e.ops.scaleFactor,4*e.ops.scaleFactor,4*e.ops.scaleFactor),r&&(i?e.row([.3333333333333333,.3333333333333333,.3333333333333333]):e.row([.5,.5]));var y=t.nest(0);if(y.value=Math.round(100*l)/100,l=e.slider(y,"Value",0,1,!0),y.changed?t.changed=e.changed=!0:t.changed=!1,i){var x=t.nest(1,{value:Math.round(100*u)/100});u=e.slider(x,"Alpha",0,1,!0),x.changed&&(t.changed=e.changed=!0)}var T=d+e._windowX,S=_+e._windowY;if(e.inputStarted&&e.getInputInRect(T-p,S-p,f,f)&&(Ci.wheelSelectedHande=t),e.inputReleased&&(Ci.wheelSelectedHande=null),e.inputDown&&Ci.wheelSelectedHande==t){var k=T-e.inputX,I=S-e.inputY;o=Math.min(Math.sqrt(k*k+I*I),p)/p;var C=Math.atan2(e.inputX-T,e.inputY-S);C<0&&(C=Math.PI+(Math.PI-Math.abs(C))),a=(C=2*Math.PI-C)/(2*Math.PI),t.changed=e.changed=!0}return Ci.hsvToRgb(a,o,l,Ci.ar),t.color=N.fromFloats(Ci.ar[0],Ci.ar[1],Ci.ar[2],u),s&&e.text("",2,t.color),t.color},Ci.keycodeToString=function(e){switch(e){case-1:return"None";case 0:return"Unknown";case 1:return"Back";case 3:return"Cancel";case 6:return"Help";case 8:return"Backspace";case 9:return"Tab";case 12:return"Clear";case 13:return"Return";case 16:return"Shift";case 17:return"Ctrl";case 18:return"Alt";case 19:return"Pause";case 20:return"CapsLock";case 21:return"Kana";case 22:return"Eisu";case 23:return"Junja";case 24:return"Final";case 25:return"Hanja";case 27:return"Esc";case 28:return"Convert";case 29:return"NonConvert";case 30:return"Accept";case 31:return"ModeChange";case 32:return"Space";case 33:return"PageUp";case 34:return"PageDown";case 35:return"End";case 36:return"Home";case 37:return"Left";case 38:return"Up";case 39:return"Right";case 40:return"Down";case 41:return"Select";case 42:return"Print";case 43:return"Execute";case 44:return"PrintScreen";case 45:return"Insert";case 46:return"Delete";case 58:return"Colon";case 59:return"Semicolon";case 60:return"LessThan";case 61:return"Equals";case 62:return"GreaterThan";case 63:return"QuestionMark";case 64:return"At";case 91:return"Win";case 93:return"ContextMenu";case 95:return"Sleep";case 96:return"Numpad0";case 97:return"Numpad1";case 98:return"Numpad2";case 99:return"Numpad3";case 100:return"Numpad4";case 101:return"Numpad5";case 102:return"Numpad6";case 103:return"Numpad7";case 104:return"Numpad8";case 105:return"Numpad9";case 106:return"Multiply";case 107:return"Add";case 108:return"Separator";case 109:return"Subtract";case 110:return"Decimal";case 111:return"Divide";case 112:return"F1";case 113:return"F2";case 114:return"F3";case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 124:return"F13";case 125:return"F14";case 126:return"F15";case 127:return"F16";case 128:return"F17";case 129:return"F18";case 130:return"F19";case 131:return"F20";case 132:return"F21";case 133:return"F22";case 134:return"F23";case 135:return"F24";case 144:return"NumLock";case 145:return"ScrollLock";case 146:return"WinOemFjJisho";case 147:return"WinOemFjMasshou";case 148:return"WinOemFjTouroku";case 149:return"WinOemFjLoya";case 150:return"WinOemFjRoya";case 160:return"Circumflex";case 161:return"Exclamation";case 162:return"DoubleQuote";case 163:return"Hash";case 164:return"Dollar";case 165:return"Percent";case 166:return"Ampersand";case 167:return"Underscore";case 168:return"OpenParen";case 169:return"CloseParen";case 170:return"Asterisk";case 171:return"Plus";case 172:return"Pipe";case 173:return"HyphenMinus";case 174:return"OpenCurlyBracket";case 175:return"CloseCurlyBracket";case 176:return"Tilde";case 181:return"VolumeMute";case 182:return"VolumeDown";case 183:return"VolumeUp";case 188:return"Comma";case 190:return"Period";case 191:return"Slash";case 192:return"BackQuote";case 219:return"OpenBracket";case 220:return"BackSlash";case 221:return"CloseBracket";case 222:return"Quote";case 224:return"Meta";case 225:return"AltGr";case 227:return"WinIcoHelp";case 228:return"WinIco00";case 230:return"WinIcoClear";case 233:return"WinOemReset";case 234:return"WinOemJump";case 235:return"WinOemPA1";case 236:return"WinOemPA2";case 237:return"WinOemPA3";case 238:return"WinOemWSCTRL";case 239:return"WinOemCUSEL";case 240:return"WinOemATTN";case 241:return"WinOemFinish";case 242:return"WinOemCopy";case 243:return"WinOemAuto";case 244:return"WinOemENLW";case 245:return"WinOemBackTab";case 246:return"ATTN";case 247:return"CRSEL";case 248:return"EXSEL";case 249:return"EREOF";case 250:return"Play";case 251:return"Zoom";case 253:return"PA1";case 254:return"WinOemClear"}return String.fromCodePoint(e)},Ci.dist=function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)},Ci.fract=function(e){return e-(0|e)},Ci.mix=function(e,t,i){return e*(1-i)+t*i},Ci.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},Ci.step=function(e,t){return tEi.modalX+Ei.modalW||Ei.ui.inputYEi.modalY+Ei.modalH)&&(Ei.show=!1)},Ei.showMessage=function(e,t,i){Ei.ui=e,Ei.init(),Ei.boxTitle=t,Ei.boxText=i,Ei.boxCommands=null},Ei.showCustom=function(e,t,i,n,r,s){null==s&&(s=160),null==r&&(r=400),null==n&&(n=-1),null==i&&(i=-1),Ei.ui=e,Ei.init(i,n,r,s),Ei.boxTitle="",Ei.boxText="",Ei.boxCommands=t},Ei.init=function(e,t,i,n){null==n&&(n=160),null==i&&(i=400),null==t&&(t=-1),null==e&&(e=-1);var r=mt.windowWidth(),s=mt.windowHeight();Ei.modalX=e,Ei.modalY=t,Ei.modalW=i*Ei.ui.ops.scaleFactor|0,Ei.modalH=n*Ei.ui.ops.scaleFactor|0,-1==e&&(Ei.modalX=r/2-Ei.modalW/2|0),-1==t&&(Ei.modalY=s/2-Ei.modalH/2|0),Ei.modalX=0|Math.max(0,Math.min(Ei.modalX,r-Ei.modalW)),Ei.modalY=0|Math.max(0,Math.min(Ei.modalY,s-Ei.modalH)),Ei.hwnd.dragX=0,Ei.hwnd.dragY=0,Ei.show=!0};var Ni=function(){};(T["zui.Themes"]=Ni).__name__=!0;var Li=function(e){this.restoreY=-1,this.restoreX=-1,this.checkSelectImage=null,this.elementsBaked=!1,this.tabScroll=0,this.tabHandle=null,this.tabNames=null,this.tooltipTime=0,this.tooltipWait=!1,this.tooltipShown=!1,this.tooltipY=0,this.tooltipX=0,this.tooltipInvertY=!1,this.tooltipImgMaxWidth=null,this.tooltipImg=null,this.tooltipText="",this.comboToSubmit=0,this.submitComboHandle=null,this.comboSelectedWindow=null,this.comboSelectedHandle=null,this.tabPressedHandle=null,this.tabPressed=!1,this.textToSubmit="",this.submitTextHandle=null,this.textSelectedHandle=null,this.windowHeader=0,this.dragHandle=null,this.scrollHandle=null,this.windowEnded=!0,this._windowY=0,this._windowX=0,this.imageScrollAlign=!0,this.scrollAlign=0,this.curRatio=-1,this.highlightAnchor=0,this.cursorY=0,this.cursorX=0,this.key=null,this.isReturnDown=!1,this.isEscapeDown=!1,this.isDeleteDown=!1,this.isBackspaceDown=!1,this.isAltDown=!1,this.isCtrlDown=!1,this.isShiftDown=!1,this.isKeyDown=!1,this.isKeyPressed=!1,this.inputWheelDelta=0,this.inputEnabled=!0,this.inputRegistered=!1,this.alwaysRedraw=!1,this.scrollEnabled=!0,this.imageInvertY=!1,this.changed=!1,this.isReleased=!1,this.isHovered=!1,this.isPushed=!1,this.isStarted=!1,this.enabled=!0,this.isTyping=!1,this.isScrolling=!1,null==e.theme&&(e.theme=Ni.dark),this.t=e.theme,null==e.khaWindowId&&(e.khaWindowId=0),null==e.scaleFactor&&(e.scaleFactor=1),null==e.autoNotifyInput&&(e.autoNotifyInput=!0),this.ops=e,this.setScale(e.scaleFactor),e.autoNotifyInput&&this.registerInput(),null==Li.copyReceiver&&(Li.copyReceiver=this,mt.notifyOnCutCopyPaste(Fi(this,this.onCut),Fi(this,this.onCopy),Fi(this,this.onPaste)),mt.notifyOnFrames(function(e){(Li.isCopy||Li.isPaste)&&1<++Li.copyFrame&&(Li.isCopy=Li.isCut=Li.isPaste=!1,Li.copyFrame=0)}));var t=Dt.createTextVertexStructure();this.rtTextPipeline=Dt.createTextPipeline(t),this.rtTextPipeline.alphaBlendSource=1,this.rtTextPipeline.compile()};function Fi(e,t){return null==t?null:(null==t.__id__&&(t.__id__=n.$haxeUID++),null==e.hx__closures__?e.hx__closures__={}:i=e.hx__closures__[t.__id__],null==i&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i);var i}(T["zui.Zui"]=Li).__name__=!0,Li.prototype={isScrolling:null,isTyping:null,enabled:null,isStarted:null,isPushed:null,isHovered:null,isReleased:null,changed:null,imageInvertY:null,scrollEnabled:null,alwaysRedraw:null,inputRegistered:null,inputEnabled:null,inputX:null,inputY:null,inputStartedX:null,inputStartedY:null,inputDX:null,inputDY:null,inputWheelDelta:null,inputStarted:null,inputStartedR:null,inputReleased:null,inputReleasedR:null,inputDown:null,inputDownR:null,isKeyPressed:null,isKeyDown:null,isShiftDown:null,isCtrlDown:null,isAltDown:null,isBackspaceDown:null,isDeleteDown:null,isEscapeDown:null,isReturnDown:null,key:null,char:null,cursorX:null,cursorY:null,highlightAnchor:null,ratios:null,curRatio:null,xBeforeSplit:null,wBeforeSplit:null,g:null,t:null,ops:null,globalG:null,rtTextPipeline:null,fontSize:null,fontOffsetY:null,arrowOffsetX:null,arrowOffsetY:null,titleOffsetX:null,buttonOffsetY:null,checkOffsetX:null,checkOffsetY:null,checkSelectOffsetX:null,checkSelectOffsetY:null,radioOffsetX:null,radioOffsetY:null,radioSelectOffsetX:null,radioSelectOffsetY:null,scrollAlign:null,imageScrollAlign:null,_x:null,_y:null,_w:null,_h:null,_windowX:null,_windowY:null,_windowW:null,_windowH:null,currentWindow:null,windowEnded:null,scrollHandle:null,dragHandle:null,windowHeader:null,textSelectedHandle:null,textSelectedCurrentText:null,submitTextHandle:null,textToSubmit:null,tabPressed:null,tabPressedHandle:null,comboSelectedHandle:null,comboSelectedWindow:null,comboSelectedAlign:null,comboSelectedTexts:null,comboSelectedLabel:null,comboSelectedX:null,comboSelectedY:null,comboSelectedW:null,submitComboHandle:null,comboToSubmit:null,tooltipText:null,tooltipImg:null,tooltipImgMaxWidth:null,tooltipInvertY:null,tooltipX:null,tooltipY:null,tooltipShown:null,tooltipWait:null,tooltipTime:null,tabNames:null,tabHandle:null,tabScroll:null,elementsBaked:null,checkSelectImage:null,setScale:function(e){this.ops.scaleFactor=e,this.fontSize=this.t.FONT_SIZE*this.ops.scaleFactor|0;var t=this.ops.font.height(this.fontSize);this.fontOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-t)/2,this.arrowOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.ARROW_SIZE*this.ops.scaleFactor)/2,this.arrowOffsetX=this.arrowOffsetY,this.titleOffsetX=(2*this.arrowOffsetX+this.t.ARROW_SIZE*this.ops.scaleFactor)/this.ops.scaleFactor,this.buttonOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.BUTTON_H*this.ops.scaleFactor)/2,this.checkOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.checkOffsetX=this.checkOffsetY,this.checkSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.checkSelectOffsetX=this.checkSelectOffsetY,this.radioOffsetY=(this.t.ELEMENT_H*this.ops.scaleFactor-this.t.CHECK_SIZE*this.ops.scaleFactor)/2,this.radioOffsetX=this.radioOffsetY,this.radioSelectOffsetY=(this.t.CHECK_SIZE*this.ops.scaleFactor-this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor)/2,this.radioSelectOffsetX=this.radioSelectOffsetY,this.elementsBaked=!1},bakeElements:function(){null!=this.checkSelectImage&&this.checkSelectImage.unload(),this.checkSelectImage=R.createRenderTarget(this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0,null,0,1,this.ops.khaWindowId);var e=this.checkSelectImage.get_g2();e.begin(!0,0),e.set_color(this.t.ACCENT_SELECT_COL),e.drawLine(0,0,this.checkSelectImage.get_width(),this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.drawLine(this.checkSelectImage.get_width(),0,0,this.checkSelectImage.get_height(),2*this.ops.scaleFactor),e.end(),this.elementsBaked=!0},remove:function(){this.ops.autoNotifyInput&&this.unregisterInput()},registerInput:function(){ti.get().notifyWindowed(this.ops.khaWindowId,Fi(this,this.onMouseDown),Fi(this,this.onMouseUp),Fi(this,this.onMouseMove),Fi(this,this.onMouseWheel)),ei.get().notify(Fi(this,this.onKeyDown),Fi(this,this.onKeyUp),Fi(this,this.onKeyPress)),this.inputRegistered=!0},unregisterInput:function(){ti.get().removeWindowed(this.ops.khaWindowId,Fi(this,this.onMouseDown),Fi(this,this.onMouseUp),Fi(this,this.onMouseMove),Fi(this,this.onMouseWheel)),ei.get().remove(Fi(this,this.onKeyDown),Fi(this,this.onKeyUp),Fi(this,this.onKeyPress)),this.endInput(),this.inputX=this.inputY=0,this.inputRegistered=!1},begin:function(e){this.elementsBaked||this.bakeElements(),this.changed=!1,this.globalG=e,this._x=0,this._y=0,this._w=0,this._h=0},end:function(e){null==e&&(e=!0),this.windowEnded||this.endWindow(),this.drawCombo(),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},beginRegion:function(e,t,i,n){this.elementsBaked||(e.end(),this.bakeElements(),e.begin(!1)),this.changed=!1,this.globalG=e,this.g=e,this.currentWindow=null,this.tooltipText="",this.tooltipImg=null,this._windowX=0,this._windowY=0,this._windowW=n,this._x=t,this._y=i,this._w=n},endRegion:function(e){null==e&&(e=!0),this.drawTooltip(),this.tabPressedHandle=null,e&&this.endInput()},endInput:function(){this.isKeyPressed=!1,this.inputStarted=!1,this.inputStartedR=!1,this.inputReleased=!1,this.inputReleasedR=!1,this.inputDX=0,this.inputDY=0,this.inputWheelDelta=0,Li.textToPaste="",Li.keyRepeat&&this.isKeyDown&&.05t.length?t.length:this.cursorX+1),this.isShiftDown&&(37==this.key||39==this.key||16==this.key)||this.isCtrlDown||(this.highlightAnchor=this.cursorX));""!=Li.textToPaste&&(t=it.substr(t,0,this.highlightAnchor)+Li.textToPaste+it.substr(t,this.cursorX,null),this.cursorX+=Li.textToPaste.length,this.highlightAnchor=this.cursorX,Li.textToPaste=""),this.highlightAnchor==this.cursorX?Li.textToCopy=t:this.highlightAnchorn&&(e.value=n),e.changed=this.changed=!0}var _=this.getHover();this.drawSlider(e.value,i,n,r,_),(this.getReleased()||this.tabPressed)&&l&&(e.text=e.value+"",this.startTextEdit(e),e.changed=this.changed=!0);var f=0==o?2:0;return this.textSelectedHandle==e&&this.updateTextEdit(f),this.submitTextHandle==e&&(this.submitTextEdit(),e.value=parseFloat(e.text),e.changed=this.changed=!0),this.g.set_color(this.t.LABEL_COL),this.drawString(this.g,t,null,0,o),a&&(this.g.set_color(this.t.TEXT_COL),this.textSelectedHandle!=e?this.drawString(this.g,e.value+"",null,0,f):this.drawString(this.g,this.textSelectedCurrentText,null,0,f)),this.endElement(),e.value},separator:function(e,t){null==t&&(t=!0),null==e&&(e=4),this.isVisible(this.t.ELEMENT_H*this.ops.scaleFactor)&&t&&(this.g.set_color(this.t.SEPARATOR_COL),this.g.fillRect(this._x,this._y,this._w,e*this.ops.scaleFactor)),this._y+=e*this.ops.scaleFactor},tooltip:function(e){this.tooltipText=e,this.tooltipY=this._y+this._windowY},tooltipImage:function(e,t){this.tooltipImg=e,this.tooltipImgMaxWidth=t,this.tooltipInvertY=this.imageInvertY,this.tooltipY=this._y+this._windowY},drawArrow:function(e){var t=this._x+this.arrowOffsetX,i=this._y+this.arrowOffsetY;this.g.set_color(this.t.TEXT_COL),e?this.g.fillTriangle(t,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i,t+this.t.ARROW_SIZE*this.ops.scaleFactor/2,i+this.t.ARROW_SIZE*this.ops.scaleFactor):this.g.fillTriangle(t,i,t,i+this.t.ARROW_SIZE*this.ops.scaleFactor,t+this.t.ARROW_SIZE*this.ops.scaleFactor,i+this.t.ARROW_SIZE*this.ops.scaleFactor/2)},drawTree:function(e){var t=7*this.ops.scaleFactor,i=this._x+this.arrowOffsetX+1,n=this._y+this.arrowOffsetY+1;this.g.set_color(this.t.TEXT_COL),e?this.g.fillRect(i,n+t/2-1,t,t/8):(this.g.fillRect(i,n+t/2-1,t,t/8),this.g.fillRect(i+t/2-1,n,t/8,t))},drawCheck:function(e,t){var i=this._x+this.checkOffsetX,n=this._y+this.checkOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;if(0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e){this.g.set_color(-1),this.enabled||this.fadeColor();var u=this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor|0;this.g.drawScaledImage(this.checkSelectImage,i+this.checkSelectOffsetX,n+this.checkSelectOffsetY,u,u)}},drawRadio:function(e,t){var i=this._x+this.radioOffsetX,n=this._y+this.radioOffsetY;this.g.set_color(t?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var r=this.g,s=this.t.FILL_ACCENT_BG,a=this.t.CHECK_SIZE*this.ops.scaleFactor,o=this.t.CHECK_SIZE*this.ops.scaleFactor,l=0;0==l&&(l=1),this.enabled||this.fadeColor(),s?r.fillRect(i,n-1,a,1+o):r.drawRect(i,n,a,o,l),e&&(this.g.set_color(this.t.ACCENT_SELECT_COL),this.enabled||this.fadeColor(),this.g.fillRect(i+this.radioSelectOffsetX,n+this.radioSelectOffsetY,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor,this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor))},drawSlider:function(e,t,i,n,r){var s=this._x+this.buttonOffsetY,a=this._y+this.buttonOffsetY,o=this._w-2*this.buttonOffsetY;this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var l=this.g,u=this.t.FILL_ACCENT_BG,h=this.t.BUTTON_H*this.ops.scaleFactor,c=0;0==c&&(c=1),this.enabled||this.fadeColor(),u?l.fillRect(s,a-1,o,1+h):l.drawRect(s,a,o,h,c),this.g.set_color(r?this.t.ACCENT_HOVER_COL:this.t.ACCENT_COL);var d=(e-t)/(i-t),_=8*this.ops.scaleFactor,f=n?s:s+(o-_)*d,p=n?o*d:_;p=Math.max(Math.min(p,o),0);var g=this.g,m=this.t.BUTTON_H*this.ops.scaleFactor,v=0;0==v&&(v=1),this.enabled||this.fadeColor(),g.fillRect(f,a-1,p,1+m)},drawCombo:function(){if(null!=this.comboSelectedHandle){var e=this.g;this.globalG.set_color(this.t.SEPARATOR_COL);var t=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor|0,i=(this.comboSelectedTexts.length+1)*t;this.globalG.begin(!1);var n=this.comboSelectedY-i-(this.t.ELEMENT_H*this.ops.scaleFactor|0),r=mt.windowHeight()-(this.comboSelectedY+i),s=r<0&&rthis.tooltipImgMaxWidth&&(e=this.tooltipImgMaxWidth);var t=this.tooltipImg.get_height()*(e/this.tooltipImg.get_width());this.tooltipX=Math.min(this.tooltipX,mt.windowWidth()-e-20),this.tooltipY=Math.min(this.tooltipY,mt.windowHeight()-t-20),this.globalG.set_color(-16777216),this.globalG.begin(!1),this.globalG.fillRect(this.tooltipX,this.tooltipY,e,t),this.globalG.set_color(-1),this.tooltipInvertY?this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY+t,e,-t):this.globalG.drawScaledImage(this.tooltipImg,this.tooltipX,this.tooltipY,e,t),this.globalG.end()},drawString:function(e,t,i,n,r){null==r&&(r=0),null==n&&(n=0);var s=this._w/(this.fontSize/2|0)|0;t.length>s&&(t=t.substring(0,s)+".."),null==i&&(i=this.t.TEXT_OFFSET),i*=this.ops.scaleFactor,e.set_font(this.ops.font),e.set_fontSize(this.fontSize),1==r?i=this._w/2-this.ops.font.width(this.fontSize,t)/2:2==r&&(i=this._w-this.ops.font.width(this.fontSize,t)-this.t.TEXT_OFFSET*this.ops.scaleFactor),this.enabled||this.fadeColor(),e.set_pipeline(this.rtTextPipeline),e.drawString(t,this._x+i,this._y+this.fontOffsetY+n),e.set_pipeline(null)},endElement:function(e){null==e&&(e=this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor),null==this.currentWindow||0==this.currentWindow.layout?-1==this.curRatio||null!=this.ratios&&this.curRatio==this.ratios.length-1?(this._y+=e,null!=this.ratios&&this.curRatio==this.ratios.length-1&&(this.curRatio=-1,this.ratios=null,this._x=this.xBeforeSplit,this._w=this.wBeforeSplit)):(this.curRatio++,this._x+=this._w,this._w=this.wBeforeSplit*this.ratios[this.curRatio]|0):this._x+=this._w+this.t.ELEMENT_OFFSET*this.ops.scaleFactor},row:function(e){this.ratios=e,this.curRatio=0,this.xBeforeSplit=this._x,this.wBeforeSplit=this._w,this._w=this._w*e[this.curRatio]|0},indent:function(){this._x+=this.t.TAB_W*this.ops.scaleFactor|0,this._w-=this.t.TAB_W*this.ops.scaleFactor|0},unindent:function(){this._x-=this.t.TAB_W*this.ops.scaleFactor|0,this._w+=this.t.TAB_W*this.ops.scaleFactor|0},fadeColor:function(){this.g.set_color(N.fromFloats(.00392156862745098*((16711680&this.g.get_color())>>>16),.00392156862745098*((65280&this.g.get_color())>>>8),.00392156862745098*(255&this.g.get_color()),.25))},fill:function(e,t,i,n,r){this.g.set_color(r),this.enabled||this.fadeColor(),this.g.fillRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor-1,i*this.ops.scaleFactor,n*this.ops.scaleFactor),this.g.set_color(-1)},rect:function(e,t,i,n,r,s){null==s&&(s=1),this.g.set_color(r),this.enabled||this.fadeColor(),this.g.drawRect(this._x+e*this.ops.scaleFactor,this._y+t*this.ops.scaleFactor,i*this.ops.scaleFactor,n*this.ops.scaleFactor,s),this.g.set_color(-1)},drawRect:function(e,t,i,n,r,s,a){null==a&&(a=0),0==a&&(a=1),this.enabled||this.fadeColor(),t?e.fillRect(i,n-1,r,s+1):e.drawRect(i,n,r,s,a)},isVisible:function(e){if(null==this.currentWindow)return!0;var t=null!=this.tabNames?this.t.ELEMENT_H*this.ops.scaleFactor+this.t.ELEMENT_OFFSET*this.ops.scaleFactor:0;return this._y+e>t&&this._y=this._windowX+this._x&&this.inputStartedX=this._windowY+this._y)&&this.inputStartedY=this._windowX+this._x&&this.inputX=this._windowY+this._y&&this.inputY=e*r&&this.inputX<(e+i)*r&&this.inputY>=t*r)&&this.inputY<(t+n)*r},onMouseDown:function(e,t,i){0==e?this.inputStarted=!0:this.inputStartedR=!0,0==e?this.inputDown=!0:this.inputDownR=!0,this.setInputPosition(t,i),this.inputStartedX=t,this.inputStartedY=i},onMouseUp:function(e,t,i){0==e?this.isScrolling?(this.isScrolling=!1,this.scrollHandle=null,t==this.inputStartedX&&i==this.inputStartedY&&(this.inputReleased=!0)):this.inputReleased=!0:1==e&&(this.inputReleasedR=!0),0==e?this.inputDown=!1:this.inputDownR=!1,this.setInputPosition(t,i),this.deselectText()},onMouseMove:function(e,t,i,n){this.setInputPosition(e,t)},onMouseWheel:function(e){this.inputWheelDelta=e},setInputPosition:function(e,t){this.inputDX+=e-this.inputX,this.inputDY+=t-this.inputY,this.inputX=e,this.inputY=t},onKeyDown:function(e){switch(this.key=e,this.isKeyPressed=!0,this.isKeyDown=!0,Li.keyRepeatTime=G.time()+.4,e){case 8:this.isBackspaceDown=!0;break;case 13:this.isReturnDown=!0;break;case 16:this.isShiftDown=!0;break;case 17:this.isCtrlDown=!0;break;case 18:this.isAltDown=!0;break;case 27:this.isEscapeDown=!0;break;case 32:this.char=" ";break;case 46:this.isDeleteDown=!0}},onKeyUp:function(e){switch(this.isKeyDown=!1,e){case 8:this.isBackspaceDown=!1;break;case 13:this.isReturnDown=!1;break;case 16:this.isShiftDown=!1;break;case 17:this.isCtrlDown=!1;break;case 18:this.isAltDown=!1;break;case 27:this.isEscapeDown=!1;break;case 46:this.isDeleteDown=!1}},onKeyPress:function(e){this.char=e,this.isKeyPressed=!0},onCut:function(){return Li.isCut=!0,this.onCopy()},onCopy:function(){return Li.isCopy=!0,Li.textToCopy},onPaste:function(e){Li.isPaste=!0,Li.textToPaste=e},ELEMENT_W:function(){return this.t.ELEMENT_W*this.ops.scaleFactor},ELEMENT_H:function(){return this.t.ELEMENT_H*this.ops.scaleFactor},ELEMENT_OFFSET:function(){return this.t.ELEMENT_OFFSET*this.ops.scaleFactor},ARROW_SIZE:function(){return this.t.ARROW_SIZE*this.ops.scaleFactor},BUTTON_H:function(){return this.t.BUTTON_H*this.ops.scaleFactor},CHECK_SIZE:function(){return this.t.CHECK_SIZE*this.ops.scaleFactor},CHECK_SELECT_SIZE:function(){return this.t.CHECK_SELECT_SIZE*this.ops.scaleFactor},FONT_SIZE:function(){return this.t.FONT_SIZE*this.ops.scaleFactor|0},SCROLL_W:function(){return this.t.SCROLL_W*this.ops.scaleFactor|0},TEXT_OFFSET:function(){return this.t.TEXT_OFFSET*this.ops.scaleFactor},TAB_W:function(){return this.t.TAB_W*this.ops.scaleFactor|0},SCALE:function(){return this.ops.scaleFactor},FLASH_SPEED:function(){return.5},TOOLTIP_DELAY:function(){return 1},resize:function(e,t,i,n){null==n&&(n=0),e.redraws=2,null!=e.texture&&e.texture.unload(),t<1&&(t=1),i<1&&(i=1),e.texture=R.createRenderTarget(t,i,0,0,1,n),e.texture.get_g2().set_imageScaleQuality(1)},__class__:Li},n.$haxeUID|=0,T.Math=Math,null==String.fromCodePoint&&(String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55232+(e>>10))+String.fromCharCode(56320+(1023&e))}),String.prototype.__class__=T.String=String,String.__name__=!0,T.Array=Array,Array.__name__=!0,Date.prototype.__class__=T.Date=Date,Date.__name__="Date";var Ai={},Mi={},Pi=Number,Ri=Boolean,Oi={},Vi={};te.count=0;var Di={};Object.defineProperty(pt.prototype,"message",{get:function(){return String(this.val)}}),g.__toStr={}.toString,null==ArrayBuffer.prototype.slice&&(ArrayBuffer.prototype.slice=b.sliceImpl),nt.cwd="",ot.defaultWindowW=240,ot.windowW=ot.defaultWindowW,ot.coffX=160,ot.coffY=40,ot.currentOperation="",ot.assetNames=[""],ot.showFiles=!1,ot.foldersOnly=!1,ot.gridSnapBounds=!1,ot.gridSnapPos=!0,ot.gridUseRelative=!0,ot.useRotationSteps=!1,ot.gridSize=20,ot.rotationSteps=.261799386,ot.modalW=625,ot.modalH=545,ot.modalHeaderH=66,ot.modalRectW=625,ot.modalRectH=545,ot.path="/",X.isManipulating=!1,X.transformStartedMouse=!1,X.drag=!1,X.dragLeft=!1,X.dragTop=!1,X.dragRight=!1,X.dragBottom=!1,X.grab=!1,X.grabX=!1,X.grabY=!1,X.rotate=!1,dt.global=new dt,_t.hwin=dt.global.nest(0,null),J.DEFAULT_RESOLVER=new a,J.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:",f.helper=new DataView(new ArrayBuffer(8)),gt.images=new k,gt.sounds=new I,gt.blobs=new C,gt.fonts=new B,gt.videos=new E,N.Black=-16777216,N.White=-1,N.Red=-65536,N.Blue=-16776961,N.Green=-16711936,N.Magenta=-65281,N.Yellow=-256,N.Cyan=-16711681,N.Purple=-8388480,N.Pink=-16181,N.Orange=-23296,N.Transparent=0,N.invMaxChannelValue=.00392156862745098,y.displays=[],F.Default=new F(!1,!1,!1),G.timeWarpSaveTime=10,G.DIF_COUNT=3,G.maxframetime=.5,G.startTime=0,z.painter_colored_fragData0="s274:I3ZlcnNpb24gMzMwCiNpZmRlZiBHTF9BUkJfc2hhZGluZ19sYW5ndWFnZV80MjBwYWNrCiNleHRlbnNpb24gR0xfQVJCX3NoYWRpbmdfbGFuZ3VhZ2VfNDIwcGFjayA6IHJlcXVpcmUKI2VuZGlmCgpvdXQgdmVjNCBGcmFnQ29sb3I7CmluIHZlYzQgZnJhZ21lbnRDb2xvcjsKCnZvaWQgbWFpbigpCnsKICAgIEZyYWdDb2xvciA9IGZyYWdtZW50Q29sb3I7Cn0KCg",z.painter_colored_vertData0="s439:I3ZlcnNpb24gMzMwCiNpZmRlZiBHTF9BUkJfc2hhZGluZ19sYW5ndWFnZV80MjBwYWNrCiN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OwpvdXQgdmVjNCBjb2xvcjsKaW4gdmVjNCB2ZXJ0ZXhDb2xvcjsKCnZvaWQgbWFpbigpCnsKICAgIGdsX1Bvc2l0aW9uID0gcHJvamVjdGlvbk1hdHJpeCAqIHZlYzQodmVydGV4UG9zaXRpb24sIDEuMCk7CiAgICB0ZXhDb29yZCA9IHRleFBvc2l0aW9uOwogICAgY29sb3IgPSB2ZXJ0ZXhDb2xvcjsKfQoK",mt.renderListeners=[],mt.foregroundListeners=[],mt.resumeListeners=[],mt.pauseListeners=[],mt.backgroundListeners=[],mt.shutdownListeners=[],mt.dropFilesListeners=[],Z.maxGamepads=4,Z.mouseLockListeners=[],q.windows=[],Q.None=0,Q.FeatureResizable=1,Q.FeatureMinimizable=2,Q.FeatureMaximizable=4,Q.FeatureBorderless=8,Q.FeatureOnTop=16,_e.disableGcInteractions=!1,_e.intBox=new ue(0),fe.channelCount=32,fe.lastAllocationCount=0,be.POLY=79764919,Te.INVALID_BITS=-1,Ie.EOP=-1,Ie.M__PI=3.141592653589793,Ie.DIVTAB_NUMER=32,Ie.DIVTAB_DENOM=64,Ie.INVERSE_DB_TABLE=[1.0649863e-7,1.1341951e-7,1.2079015e-7,1.2863978e-7,1.3699951e-7,1.4590251e-7,1.5538408e-7,1.6548181e-7,1.7623575e-7,1.8768855e-7,1.9988561e-7,2.128753e-7,2.2670913e-7,2.4144197e-7,2.5713223e-7,2.7384213e-7,2.9163793e-7,3.1059021e-7,3.3077411e-7,3.5226968e-7,3.7516214e-7,3.9954229e-7,4.255068e-7,4.5315863e-7,4.8260743e-7,5.1396998e-7,5.4737065e-7,5.8294187e-7,6.2082472e-7,6.6116941e-7,7.0413592e-7,7.4989464e-7,7.9862701e-7,8.505263e-7,9.0579828e-7,9.6466216e-7,10273513e-13,10941144e-13,11652161e-13,12409384e-13,13215816e-13,14074654e-13,14989305e-13,15963394e-13,17000785e-13,18105592e-13,19282195e-13,20535261e-13,21869758e-13,23290978e-13,24804557e-13,26416497e-13,2813319e-12,29961443e-13,31908506e-13,33982101e-13,36190449e-13,38542308e-13,41047004e-13,4371447e-12,46555282e-13,49580707e-13,5280274e-12,5623416e-12,59888572e-13,63780469e-13,67925283e-13,72339451e-13,77040476e-13,82047e-10,87378876e-13,93057248e-13,99104632e-13,10554501e-12,11240392e-12,11970856e-12,12748789e-12,13577278e-12,14459606e-12,15399272e-12,16400004e-12,17465768e-12,18600792e-12,19809576e-12,21096914e-12,22467911e-12,23928002e-12,25482978e-12,27139006e-12,28902651e-12,30780908e-12,32781225e-12,34911534e-12,37180282e-12,39596466e-12,42169667e-12,4491009e-11,47828601e-12,50936773e-12,54246931e-12,57772202e-12,61526565e-12,65524908e-12,69783085e-12,74317983e-12,79147585e-12,8429104e-11,89768747e-12,95602426e-12,.00010181521,.00010843174,.00011547824,.00012298267,.00013097477,.00013948625,.00014855085,.00015820453,.00016848555,.00017943469,.00019109536,.00020351382,.00021673929,.00023082423,.00024582449,.00026179955,.00027881276,.00029693158,.00031622787,.00033677814,.00035866388,.00038197188,.00040679456,.00043323036,.00046138411,.00049136745,.00052329927,.00055730621,.00059352311,.00063209358,.00067317058,716917e-9,.0007635063,.00081312324,.00086596457,.00092223983,.00098217216,.0010459992,.0011139742,.0011863665,.0012634633,.0013455702,.0014330129,.0015261382,.0016253153,.0017309374,.0018434235,.0019632195,.0020908006,.0022266726,.0023713743,.0025254795,.0026895994,.0028643847,.0030505286,.0032487691,.0034598925,.0036847358,.0039241906,.0041792066,.004450795,.0047400328,.0050480668,.0053761186,.0057254891,.0060975636,.0064938176,.0069158225,.0073652516,.0078438871,.0083536271,.0088964928,.009474637,.010090352,.01074608,.011444421,.012188144,.012980198,.013823725,.014722068,.015678791,.016697687,.017782797,.018938423,.020169149,.021479854,.022875735,.02436233,.025945531,.027631618,.029427276,.031339626,.033376252,.035545228,.037855157,.040315199,.042935108,.045725273,.048696758,.051861348,.055231591,.05882085,.062643361,.066714279,.071049749,.075666962,.080584227,.085821044,.091398179,.097337747,.1036633,.11039993,.11757434,.12521498,.13335215,.14201813,.15124727,.16107617,.1715438,.18269168,.19456402,.20720788,.22067342,.23501402,.25028656,.26655159,.28387361,.30232132,.32196786,.34289114,.36517414,.38890521,.41417847,.44109412,.4697589,.50028648,.53279791,.56742212,.6042964,.64356699,.68538959,.72993007,.77736504,.8278826,.88168307,.9389798,1],Ce.NO_CODE=255,Ce.delay=0,Fe.PACKET_ID=1,Fe.PACKET_COMMENT=3,Fe.PACKET_SETUP=5,De.CONTINUED_PACKET=1,De.FIRST_PAGE=2,De.LAST_PAGE=4,We.MAX_CHANNELS=16,We.PUSHDATA_CRC_COUNT=4,We.FAST_HUFFMAN_LENGTH=10,We.FAST_HUFFMAN_TABLE_SIZE=1024,We.FAST_HUFFMAN_TABLE_MASK=1023,Ze.fontGlyphs=function(){for(var e=[],t=32;t<256;){var i=t++;e.push(i)}return e}(),Et.STBTT_vmove=1,Et.STBTT_vline=2,Et.STBTT_vcurve=3,Et.STBTT_MACSTYLE_DONTCARE=0,Et.STBTT_MACSTYLE_BOLD=1,Et.STBTT_MACSTYLE_ITALIC=2,Et.STBTT_MACSTYLE_UNDERSCORE=4,Et.STBTT_MACSTYLE_NONE=8,Et.STBTT_PLATFORM_ID_UNICODE=0,Et.STBTT_PLATFORM_ID_MAC=1,Et.STBTT_PLATFORM_ID_ISO=2,Et.STBTT_PLATFORM_ID_MICROSOFT=3,Et.STBTT_UNICODE_EID_UNICODE_1_0=0,Et.STBTT_UNICODE_EID_UNICODE_1_1=1,Et.STBTT_UNICODE_EID_ISO_10646=2,Et.STBTT_UNICODE_EID_UNICODE_2_0_BMP=3,Et.STBTT_UNICODE_EID_UNICODE_2_0_FULL=4,Et.STBTT_MS_EID_SYMBOL=0,Et.STBTT_MS_EID_UNICODE_BMP=1,Et.STBTT_MS_EID_SHIFTJIS=2,Et.STBTT_MS_EID_UNICODE_FULL=10,Et.STBTT_MAC_EID_ROMAN=0,Et.STBTT_MAC_EID_ARABIC=4,Et.STBTT_MAC_EID_JAPANESE=1,Et.STBTT_MAC_EID_HEBREW=5,Et.STBTT_MAC_EID_CHINESE_TRAD=2,Et.STBTT_MAC_EID_GREEK=6,Et.STBTT_MAC_EID_KOREAN=3,Et.STBTT_MAC_EID_RUSSIAN=7,Et.STBTT_MS_LANG_ENGLISH=1033,Et.STBTT_MS_LANG_ITALIAN=1040,Et.STBTT_MS_LANG_CHINESE=2052,Et.STBTT_MS_LANG_JAPANESE=1041,Et.STBTT_MS_LANG_DUTCH=1043,Et.STBTT_MS_LANG_KOREAN=1042,Et.STBTT_MS_LANG_FRENCH=1036,Et.STBTT_MS_LANG_RUSSIAN=1049,Et.STBTT_MS_LANG_GERMAN=1031,Et.STBTT_MS_LANG_SPANISH=1033,Et.STBTT_MS_LANG_HEBREW=1037,Et.STBTT_MS_LANG_SWEDISH=1053,Et.STBTT_MAC_LANG_ENGLISH=0,Et.STBTT_MAC_LANG_JAPANESE=11,Et.STBTT_MAC_LANG_ARABIC=12,Et.STBTT_MAC_LANG_KOREAN=23,Et.STBTT_MAC_LANG_DUTCH=4,Et.STBTT_MAC_LANG_RUSSIAN=32,Et.STBTT_MAC_LANG_FRENCH=1,Et.STBTT_MAC_LANG_SPANISH=6,Et.STBTT_MAC_LANG_GERMAN=2,Et.STBTT_MAC_LANG_SWEDISH=5,Et.STBTT_MAC_LANG_HEBREW=10,Et.STBTT_MAC_LANG_CHINESE_SIMPLIFIED=33,Et.STBTT_MAC_LANG_ITALIAN=3,Et.STBTT_MAC_LANG_CHINESE_TRAD=19,Et.STBTT_MAX_OVERSAMPLE=8,Et.STBTT_RASTERIZER_VERSION=2,Rt.bufferSize=1500,Rt.vertexSize=9,Ot.bufferSize=1e3,Ot.triangleBufferSize=1e3,Vt.bufferSize=1e3,Qt.__meta__={statics:{sendConnectEvent:{input:null},sendDisconnectEvent:{input:null}},fields:{sendAxisEvent:{input:null},sendButtonEvent:{input:null}}},Qt.instances=[],Qt.connectListeners=[],Qt.disconnectListeners=[],ei.__meta__={fields:{sendDownEvent:{input:null},sendUpEvent:{input:null},sendPressEvent:{input:null}}},ei.keyBehavior=$t.Default,ti.__meta__={fields:{sendLeaveEvent:{input:null},sendDownEvent:{input:null},sendUpEvent:{input:null},sendMoveEvent:{input:null},sendWheelEvent:{input:null}}},si.bufferSize=2e3,ai.mat=new Float32Array(16),li.width=3,li.height=3,ui.width=4,ui.height=4,_i.width=3,_i.height=3,fi.width=4,fi.height=4,bi.nextId=0,Ti.START=0,Ti.ENTITY_UPDATES=1,Ti.CONTROLLER_UPDATES=2,Ti.REMOTE_CALL=3,Ti.PING=4,Ti.SESSION_ERROR=5,Ti.PLAYER_UPDATES=6,Ti.RPC_SERVER=0,Ti.RPC_ALL=1,Si.nextId=0,Si.objects=[],Ii.assetMap=new $,Ii.themes=[],Ii.events=[],Ii.screenW=-1,Ii.screenH=-1,Ii.locale="en",Ii.h=new dt,Ii.elemId=-1,Ii.assetId=-1,Ci.dataPath="",Ci.lastPath="",Ci.kx=1,Ci.ky=.6666666666666666,Ci.kz=.3333333333333333,Ci.kw=3,Ci.ar=[0,0,0],Ci.Kx=0,Ci.Ky=-.3333333333333333,Ci.Kz=.6666666666666666,Ci.Kw=-1,Ci.e=1e-10,Bi.i=0,Ei.show=!1,Ei.hwnd=new dt,Ei.boxTitle="",Ei.boxText="",Ei.modalX=0,Ei.modalY=0,Ei.modalW=400,Ei.modalH=160,Ni.dark={NAME:"Default Dark",FONT_SIZE:13,ELEMENT_W:100,ELEMENT_H:24,ELEMENT_OFFSET:4,ARROW_SIZE:5,BUTTON_H:22,CHECK_SIZE:15,CHECK_SELECT_SIZE:8,SCROLL_W:6,TEXT_OFFSET:8,TAB_W:12,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-13421773,WINDOW_TINT_COL:-1,ACCENT_COL:-12303292,ACCENT_HOVER_COL:-11974327,ACCENT_SELECT_COL:-10461088,BUTTON_COL:-12171706,BUTTON_TEXT_COL:-1513499,BUTTON_HOVER_COL:-11974327,BUTTON_PRESSED_COL:-15000805,TEXT_COL:-1513499,LABEL_COL:-3618616,SEPARATOR_COL:-14211289,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-14540254},Ni.light={NAME:"Default Light",FONT_SIZE:26,ELEMENT_W:200,ELEMENT_H:48,ELEMENT_OFFSET:8,ARROW_SIZE:10,BUTTON_H:44,CHECK_SIZE:30,CHECK_SELECT_SIZE:16,SCROLL_W:12,TEXT_OFFSET:16,TAB_W:24,FILL_WINDOW_BG:!1,FILL_BUTTON_BG:!0,FILL_ACCENT_BG:!1,WINDOW_BG_COL:-1052689,WINDOW_TINT_COL:-14540254,ACCENT_COL:-1118482,ACCENT_HOVER_COL:-4473925,ACCENT_SELECT_COL:-5592406,BUTTON_COL:-3355444,BUTTON_TEXT_COL:-14540254,BUTTON_HOVER_COL:-5000269,BUTTON_PRESSED_COL:-5131855,TEXT_COL:-6710887,LABEL_COL:-5592406,SEPARATOR_COL:-6710887,HIGHLIGHT_COL:-14656100,CONTEXT_COL:-5592406},Li.alwaysRedrawWindow=!0,Li.keyRepeat=!0,Li.keyRepeatTime=0,Li.textToPaste="",Li.textToCopy="",Li.isCut=!1,Li.isCopy=!1,Li.isPaste=!1,Li.copyFrame=0,Li.comboFirst=!0,nt.main()}("undefined"!=typeof exports?exports:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this); \ No newline at end of file