-
Notifications
You must be signed in to change notification settings - Fork 0
/
as3vm-0.3.4.min.js
109 lines (109 loc) · 51.9 KB
/
as3vm-0.3.4.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* as3vm is (C) 2012 uxebu Inc.
*
* No permission or right to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software is granted.
* All rights reserved to the copyright holders.
*/
(function(){function pa(a,b,c,d){return c instanceof b?c:null===c||void 0===c?null:"function"===typeof b.__is__&&b.__is__(c)||b===a&&c.__isClass__?c:d}function qa(a,b,c,d){switch(b){case void 0:if(void 0===c)return;break;case a.String:case a.Object:return null===c||void 0===c?null:b(c);case a.Boolean:case a.Number:case a.int:case a.uint:return b(c);default:if(c=pa(a.Class,b,c,ra),c!==ra)return c}throw new TypeError("Error #1034: unable to convert value to "+(d||"target type"));}function Na(a,b,c){if(b.hasOptionalParameters)return c.option.map(function(b){return a.getConstant(b.kind,
b.value)})}function Oa(a,b){return b.map(function(b){return 0===b?"*":a.multinames[b]})}function Pa(a,b,c){if(b.hasParameterNames)return c.map(function(b){return a.strings[b]})}function $(a){this.name=a}function aa(a){this.name=a}function ba(a){this.name=a}function ca(a){this.name=a}function da(a){this.name=a}function ea(a){this.name=a}function fa(a){this.name=a}function h(a,b){this.namespace=a;this.name=b}function t(a){this.name=a}function u(){}function i(a,b){this.namespaceSet=a;this.name=b}function v(a){this.namespaceSet=
a}function l(a,b){this.type=a;this.parameter=b}function sa(a,b,c){if(!c.hasOwnProperty("__interfaces__")){var d=c.__proto__;c.__interfaces__=d&&d.__interfaces__?d.__interfaces__.slice():[]}c.__interfaces__.push(b);b.__interfaces__&&b.__interfaces__.forEach(function(b){sa(a,b,c)});var e=b.prototype;Object.getOwnPropertyNames(e).forEach(function(a){var b=Object.getOwnPropertyDescriptor(e,a);if((b=b&&(b.value||b.get||b.set))&&b.__isMethod__)b=ta.parse(a),a=b.name,b=b.toProperty(),a=Qa(a),Object.defineProperty(c,
b,a)})}function Ra(a,b,c,d){var e=function(){};b.createObjectFromTraits(d.traits,e.prototype,c.scope);e.__interfaces__=d.interfaces.map(function(d){return ga(a,b,c,d)});e.__is__=function(a){return a&&a.__interfaces__&&-1!==a.__interfaces__.indexOf(e)};return e}function Sa(a,b){var c;a.abcs.some(function(a){return a.instances.some(function(a){if(b.match(a.name))return c=a,!0})});return c}function ga(a,b,c,d){if(ha.__has__(d))return ha.__get__(d);var e=a.getType(d);if(e)a=ta.parse(e.__name__);else{var f=
Sa(a,d);if(!f)throw new TypeError("Cannot find interface "+d);e=Ra(a,b,c,f);a=f.name}ha.__set__(a,e);return e}function Qa(a){return{get:function(){return this[a]},set:function(b){this[a]=b}}}function ia(a){this.namespaces=a}function T(){}function m(a){return a|0}function Ta(a){return a>>>0}function ja(a){return+a}function Ua(a,b){for(var c={},d,e,f,g;a&&a.__traits__;){if(a.hasOwnProperty("__traits__")){d=0;for(g=a.__traits__;e=g[d];d+=1)e.isSlot&&(f=e.name.toProperty(),e=b.coerceTraitValue(e),c[f]=
null===e?Va:void 0===e?Wa:0===e?Xa:e!==e?Ya:{value:e,writable:!0})}a=Object.getPrototypeOf(a)}return c}function ua(a){for(var b=a,a=!1;!a;)a=Object.getOwnPropertyNames(b).some(function(a){a=b[a];return!a||!a.__method__?void 0:a.__method__===this.vm.currentMethod},this),b=b.__proto__;return b}function Za(a){Object.defineProperties(a,{__deleteProperty__:{enumerable:!1,value:function(a){return a.deleteFrom(this)},writable:!1},__get__:{enumerable:!1,value:function(a){return a.getFrom(this)},writable:!1},
__getUnbound__:{enumerable:!1,value:function(a){return a.getUnboundFrom(this)},writable:!1},__has__:{enumerable:!1,value:function(a){return a.inObject(this)},writable:!1},__set__:{enumerable:!1,value:function(a,c){a.setIn(this,c)},writable:!1}})}function $a(a){var b=ab.exports.tools.expando;Object.defineProperties(a,{__deleteProperty__:{enumerable:!1,value:function(a){if(isNaN(Number(a.name)))return Object.prototype.__deleteProperty__.call(this,a);delete this[b].data[a.name]},writable:!1},__get__:{enumerable:!1,
value:function(a){if(isNaN(Number(a.name)))return Object.prototype.__get__.call(this,a);if(!this.__has__(a))throw RangeError("Error #1125: The index is ouf of range");return this[b].data[a.name]},writable:!1},__has__:{enumerable:!1,value:function(a){return isNaN(Number(a.name))?Object.prototype.__get__.call(this,a):this[b].data.hasOwnProperty(a.name)},writable:!1},__set__:{enumerable:!1,value:function(a,b){if(isNaN(Number(a.name)))return Object.prototype.__set__.call(this,a,b);this.__setIndex__.call(this,
a.name,b)},writable:!1}})}function va(a,b,c){c=c||[];Object.keys(a).forEach(function(d){var e=a[d];e&&"undefined"!==typeof e.__isNamespace__?va(e,b,c.concat(d)):(e&&e.__isBuiltIn__&&e.prototype&&bb(e),d=ka.fromStrings(c.join("."),d),e&&e.__isClass__&&Object.defineProperties(e,{__name__:{value:d.name},__qualifiedName__:{value:d.toString()}}),b.__set__(d,e))})}function cb(a){return Object.getOwnPropertyNames(a.prototype).filter(db).filter(function(b){return"function"===typeof a.prototype[b]})}function db(a){return"constructor"!==
a&&0!==a.indexOf("__")}function bb(a){cb(a).forEach(function(b){var c=a.prototype[b],b=ka.fromStrings("http://adobe.com/AS3/2006/builtin",b);Object.defineProperty(a.prototype,b.toProperty(),{enumerable:!1,value:c})})}function wa(a){this.global=a.global;this.scopes=a.scopes.slice(0)}function z(a){this.global=a;this.localOffset=0;this.scopes=[]}function xa(a,b){this.global=eb(b);this.hooks={};this.abcs=a.map(function(a){return a(this)},this);var c=this;Object.defineProperty(this.global,"__has__",{value:function(a){c.abcs.some(function(b){return b.hasType(a)});
if(a.isTypename){if(c.getType(a.type)!==this.Vector)throw new TypeError("Error #1010: Unable to create non-Vector<T> types");var b=this.VectorFactory(c.getType(a.parameter)),f=a.toString();Object.defineProperties(b,{__name__:{value:f},__qualifiedName__:{value:f}});this.__set__(a,b)}return Object.prototype.__has__.call(this,a)}})}function U(a){return"string"===typeof a?fb.QName.fromSymbolClass(a):a}function ya(){var a=function(a,c,d,e){this.name=a;this.slotId=c;this.typeName=d;this.value=e};a.create=
function(b,c,d,e){var d=e.slot_id,f=e.type_name,g=e.vkind,e=e.vindex,p,h;0!==f&&(p=b.multinames[f]);g&&(h=b.getConstant(g,e));return new a(c,d,p,h)};return a}function V(a,b,c){this.name=a;this.slotId=b;this.klass=c}function W(a,b,c){this.name=a;this.slotId=b;this.method=c}function A(a,b,c,d){this.name=a;this.dispatchId=b;this.value=this.method=c;d&&(this.isFinal=d.isFinal,this.isOverride=d.isOverride)}function B(a,b,c,d){this.name=a;this.dispatchId=b;this.value=this.method=c;d&&(this.isFinal=d.isFinal,
this.isOverride=d.isOverride)}function C(a,b,c,d){this.name=a;this.dispatchId=b;this.value=this.method=c;d&&(this.isFinal=d.isFinal,this.isOverride=d.isOverride)}function gb(a,b){return b.map(function(b){return hb.create(a,b)})}function ib(a,b){return b["interface"].map(function(b){return a.multinames[b]})}function jb(a,b){return b.map(function(b){return kb.create(a,b)})}function lb(a,b){return b.map(function(b){return mb.create(a,b)})}function nb(a,b){return b.map(function(b){return ob.create(a,
b)})}function za(a,b,c,d){this.abcFile=b;this.currentMethod=(this.body=c)?c.code:{};this.signature=d;this.toplevel=a}function pb(a,b,c,d){var e=c.parameters.length;c.optionalParameters&&la.setDefaults(b,c.optionalParameters,e);c.needsRestArguments&&(b=la.convertRest(b,e));b=b.map(function(a,b){return Aa(d,c.parameters[b],a)});c.needsArguments&&(b=b.slice(0,c.parameters.length).concat([b.slice(0)]));return la.toRegisters(a,b)}function X(a,b,c){this.abcFile=a;this.executed=!1;this.method=b;this.traits=
c;this.scope=new qb(this.abcFile.toplevel.global)}function rb(a,b){return b.map(function(b){return sb.create(a,b)})}function w(a,b,c){this.toplevel=a;this.version={major:b.major_version,minor:b.minor_version};this.strings=b.constant_pool.string;this.integers=b.constant_pool.integer.map(Number);this.uintegers=b.constant_pool.uinteger.map(Number);this.doubles=b.constant_pool["double"].map(Number);this.namespaces=tb(this,b.constant_pool.namespace);this.namespaceSets=ub(this,b.constant_pool.ns_set);this.multinames=
vb(this,b.constant_pool.multiname);wb(this);this.methodSignatures=xb(this,b.method_info);this.methodBodies=yb(this,b.method_body_info);this.methods=zb(this,c);this.classes=Ab(this,b.class_info);this.instances=Bb(this,b.instance_info);this.scripts=Cb(this,b.script_info)}function tb(a,b){return[null].concat(b.slice(1).map(function(b){return Db.create(a,b)}))}function ub(a,b){return[null].concat(b.slice(1).map(function(b){return Eb.create(a,b)}))}function vb(a,b){return[null].concat(b.slice(1).map(function(b){return Fb.create(a,
b)}))}function wb(a){a.multinames.slice(1).filter(function(a){return a.isTypename}).forEach(function(b){b.resolveType(a)})}function xb(a,b){return b.map(function(b){return Gb.create(a,b)})}function yb(a,b){return b.map(function(b){return Hb.create(a,b)})}function zb(a,b){b&&a.methodBodies.forEach(function(a,d){a.code=b[d];b[d].methodBody=a});return a.methodSignatures.map(function(b){var d=a.getMethodBodyBySignature(b);return new Ib(a.toplevel,a,d,b)})}function Ab(a,b){return b.map(function(b){return Jb.create(a,
b)})}function Bb(a,b){return b.map(function(b){return Kb.create(a,b)})}function Cb(a,b){return b.map(function(b){return Lb.create(a,b)})}function s(a){return this.namespaces[a]}var x={},ra={};x.module$exports={coerce:qa,coerceClass:pa,coerceToName:function(a,b,c){if(!b||"*"===b)return c;var d="void"===b.toString()?void 0:a.getType(b);return qa(a.global,d,c,b)}};x.module$exports&&(x=x.module$exports);var q={};q.module$exports=Function("return this")();q.module$exports&&(q=q.module$exports);var D={},
Mb=q;D.module$exports={create:function(a,b){var c=Mb.exports.tools.hitch,d=c(a,b);Object.defineProperties(d,{__isMethodClosure__:{value:!0},apply:{value:c(d,d.apply)},call:{value:c(d,d.call)}});return d},shouldCreate:function(a){return a&&a.__isMethod__}};D.module$exports&&(D=D.module$exports);var E={},Ba={create:function(a,b){var c=Oa(a,b.param_type),d=a.multinames[b.return_type],e;e=b.name;e=0!==e?a.strings[e]:void 0;var f={needsArguments:!!(b.flags&1),needsActivation:!!(b.flags&2),needsRestArguments:!!(b.flags&
4),hasOptionalParameters:!!(b.flags&8),usesDxns:!!(b.flags&64),hasParameterNames:!!(b.flags&128)},g=Na(a,f,b.options),p=Pa(a,f,b.param_names);return new Nb(c,d,e,f,g,p)}},Nb=Ba.MethodSignature=function(a,b,c,d,e,f){this.parameters=a;this.returnType=b;this.name=c;this.needsArguments=d.needsArguments;this.needsActivation=d.needsActivation;this.needsRestArguments=d.needsRestArguments;this.usesDxns=d.usesDxns;this.optionalParameters=e;this.parameterNames=f};E.module$exports=Ba;E.module$exports&&(E=E.module$exports);
var y={};$.prototype={isPublicNamespace:function(){return""===this.name},match:function(a){return this.name===a.name},toString:function(){return this.name}};aa.prototype={isPublicNamespace:function(){return""===this.name},match:function(a){return this.name===a.name},toString:function(){return this.name}};ba.prototype={isPublicNamespace:function(){return!1},match:function(a){return this.name===a.name},toString:function(){return this.name}};ca.prototype={isPublicNamespace:function(){return!1},match:function(a){return this.name===
a.name},toString:function(){return this.name}};da.prototype={isPublicNamespace:function(){return!1},match:function(a){return this.name===a.name},toString:function(){return this.name}};ea.prototype={isPublicNamespace:function(){return!1},match:function(a){return this.name===a.name},toString:function(){return this.name}};fa.prototype={isPublicNamespace:function(){return!1},match:function(a){return this.name===a.name},toString:function(){return this.name}};var Ob={8:$,22:aa,23:ba,24:ca,25:da,26:ea,5:fa};
y.module$exports={create:function(a,b){var c=b.name;return new Ob[b.kind](0!==c?a.strings[c]:"")},Namespace:$,PackageNamespace:aa,PackageInternalNamespace:ba,ProtectedNamespace:ca,ExplicitNamespace:da,StaticProtectedNamespace:ea,PrivateNamespace:fa};y.module$exports&&(y=y.module$exports);var k={},Ca=D,Da=y;h.create=function(a,b){return new h(a.namespaces[b.ns],a.strings[b.name])};h.fromStrings=function(a,b){var c=""===a?new Da.PackageNamespace(""):new Da.Namespace(a);return new h(c,b)};h.fromSymbolClass=
function(a){var b=a.split("."),a=b.pop(),b=b.join(".");return h.fromStrings(b,a)};h.parse=function(a){var b=a.split("\u03bb"),a=b.pop(),b=b.join("\u03bb");return h.fromStrings(b,a)};h.prototype.deleteFrom=function(a){var b=this.toProperty(),c=Object.getOwnPropertyDescriptor(a,b);return c&&c.configurable?delete a[b]:!1};h.prototype.getFrom=function(a){var b=this.getUnboundFrom(a);Ca.shouldCreate(b)&&(b=Ca.create(a,b),this.setIn(a,b,{}));return b};h.prototype.getUnboundFrom=function(a){var b=this.toProperty();
return a[b]};h.prototype.inObject=function(a){return this.toProperty()in Object(a)};h.prototype.isPublic=function(){return this.namespace.isPublicNamespace()};h.prototype.match=function(a){return this.name===a.name&&this.namespace.match(a.namespace)};h.prototype.resolve=function(){return this};h.prototype.setIn=function(a,b,c){c?(c.value=b,Object.defineProperty(a,this.toProperty(),c)):a[this.toProperty()]=b};h.prototype.toProperty=function(){return this.isPublic()?this.name:this.namespace.name+"\u03bb"+
this.name};h.prototype.toString=function(){return this.isPublic()?this.name:this.namespace+"."+this.name};t.create=function(a,b){return new t(a.strings[b.name])};t.prototype.resolve=function(a){a=a.pop();return new h(a,this.name)};u.create=function(){return new u};u.prototype.resolve=function(a){var b=a.pop(),a=a.pop();return new h(a,b)};i.create=function(a,b){return new i(a.namespaceSets[b.ns_set],a.strings[b.name])};i.prototype.deleteFrom=function(a){var b=!0;this.qnames().some(function(c){if(c.inObject(a))return b=
c.deleteFrom(a),!0});return b};i.prototype.getFrom=function(a){var b;this.qnames().some(function(c){if(c.inObject(a))return b=c.getFrom(a),!0},this);return b};i.prototype.getUnboundFrom=function(a){var b;this.qnames().some(function(c){if(c.inObject(a))return b=c.getUnboundFrom(a),!0},this);return b};i.prototype.inObject=function(a){return this.qnames().some(function(b){return b.inObject(a)})};i.prototype.match=function(a){return this.name===a.name&&this.namespaceSet.match(a.namespace)};i.prototype.resolve=
function(){return this};i.prototype.setIn=function(a,b,c){if(!this.qnames().some(function(d){if(d.inObject(a)||d.isPublic())return d.setIn(a,b,c),!0}))throw new TypeError("Cannot find property '"+this+"' in object");};i.prototype.toString=function(){return this.namespaceSet+"."+this.name};i.prototype.qnames=function(){return this.namespaceSet.namespaces.map(function(a){return new h(a,this.name)},this)};v.create=function(a,b){return new v(a.namespaceSets[b.ns_set])};v.prototype.resolve=function(a){a=
a.pop();return new i(this.namespaceSet,a)};l.create=function(a,b){var c=new l;c.typeIndex=b.type;c.parameterIndex=b.param;return c};l.prototype=Object.create(h.prototype);l.prototype.isPublic=function(){return!0};l.prototype.isTypename=!0;l.prototype.resolveType=function(a){this.type=a.multinames[this.typeIndex];this.parameter=a.multinames[this.parameterIndex]};l.prototype.toProperty=function(){return this.type.toProperty()+"$"+this.parameter.toProperty()};l.prototype.toString=function(){return this.type+
"$"+this.parameter};var Pb={7:h,13:h,15:t,16:t,17:u,18:u,9:i,14:i,27:v,28:v,29:l};k.module$exports={Multiname:i,MultinameL:v,QName:h,RTQName:t,RTQNameL:u,Typename:l,create:function(a,b){var c=b.kind,d=Pb[c];if(!d)throw Error("Encountered unknown kind... ["+c+"]");return d.create(a,b.data)}};k.module$exports&&(k=k.module$exports);var F={},ta=k.QName,ha={};F.module$exports={applyInterfaces:function(a,b,c,d,e){d.forEach(function(d){d=ga(a,b,c,d);sa(a,d,e)})},getInterface:ga};F.module$exports&&(F=F.module$exports);
var G={};ia.prototype={match:function(a){return this.namespaces.some(function(b){return b.name===a.name})},toString:function(){return"{"+this.namespaces.map(function(a){return a.toString()}).join(", ")+"}"}};G.module$exports={create:function(a,b){var c=b.ns.map(function(b){return a.namespaces[b]});return new ia(c)},NamespaceSet:ia};G.module$exports&&(G=G.module$exports);var H={},Ea=F,Qb=q,ma=k,na=x,j=ma.QName,Rb=ma.Typename,Sb=Ea.applyInterfaces,Tb=Ea.getInterface,Va={value:null,writable:!0},Wa={value:void 0,
writable:!0},Xa={value:0,writable:!0},Ya={value:0/0,writable:!0},Ub={}.hasOwnProperty,Fa=function(a){this.vm=a;this.abcFile=a.abcFile;this.toplevel=a.toplevel};Fa.prototype={bkpt:function(){throw Error("Not implemented");},nop:function(){},"throw":function(){throw this.vm.stack.pop();},setsuper:function(a){var b=this.vm.stack.pop(),a=this.vm.getMultinameByIndex(a),c=this.vm.stack.pop();Object.getOwnPropertyDescriptor(c.constructor.__super__,a.toProperty()).set.call(c,b)},getsuper:function(a){var b=
this.vm.getMultinameByIndex(a),a=this.vm.stack.pop();if(null===a)throw new TypeError("Error #1009: Unable to generate super from null");if(void 0===a)throw new TypeError("Error #1010: Unable to generate super from undefined");var c=a,b=b.toProperty();do c=c.constructor.__super__;while(!Ub.call(c,b));this.vm.stack.push(Object.getOwnPropertyDescriptor(c,b).get.call(a))},dxns:function(){throw Error("Not implemented");},dxnslate:function(){throw Error("Not implemented");},kill:function(a){this.vm.localRegisters[a]=
void 0},label:T,lf32x4:function(){throw Error("Not implemented");},sf32x4:function(){throw Error("Not implemented");},ifnlt:function(a){this.lessthan();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifnle:function(a){this.lessequals();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifngt:function(a){this.greaterthan();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifnge:function(a){this.greaterequals();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);
return b},jump:function(a){this.vm.nextLabel=a},iftrue:function(a){var b=!!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},iffalse:function(a){var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifeq:function(a){this.equals();var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifne:function(a){this.equals();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},iflt:function(a){this.lessthan();var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifle:function(a){this.lessequals();
var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifgt:function(a){this.greaterthan();var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifge:function(a){this.greaterequals();var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifstricteq:function(a){this.strictequals();var b=this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},ifstrictne:function(a){this.strictequals();var b=!this.vm.stack.pop();b&&(this.vm.nextLabel=a);return b},x1b:function(){throw Error("Not implemented");
},pushwith:function(){var a=this.vm.stack.pop();if(null===a)throw new TypeError("Error #1009: with can not use null");if(void 0===a)throw new TypeError("Error #1010: with can not use undefined");this.vm.scope.push(a)},popscope:function(){this.vm.scope.pop()},nextname:function(){var a=this.vm.stack.pop()-1;this.vm.stack.push(this.vm.stack.pop().__nextName__(a))},hasnext:function(){throw Error("Not implemented");},pushnull:function(){this.vm.stack.push(null)},pushundefined:function(){this.vm.stack.push(void 0)},
nextvalue:function(){var a=this.vm.toplevel.getType(j.fromStrings("","XML")),b=this.vm.toplevel.getType(j.fromStrings("","XMLList")),c=this.vm.stack.pop()-1,d=this.vm.stack.pop();if("[object Array]"===Object.prototype.toString.call(d)||d instanceof a||d instanceof b)d=d[c]||"";else if(d&&"[object Object]"===Object.prototype.toString.call(d))a=Object.keys(d)[c],d=d[a]||"";else throw Error("nextvalue is not implemented for non-object/non-array types");this.vm.stack.push(d)},pushbyte:function(a){this.vm.stack.push(a<<
24>>24)},pushshort:function(a){this.vm.stack.push(a&65535)},pushtrue:function(){this.vm.stack.push(!0)},pushfalse:function(){this.vm.stack.push(!1)},pushnan:function(){this.vm.stack.push(NaN)},pop:function(){this.vm.stack.pop()},dup:function(){var a=this.vm.stack;a.push(a[a.length-1])},swap:function(){var a=this.vm.stack,b=a.pop(),c=a.pop();a.push(b,c)},pushstring:function(a){this.vm.stack.push(this.abcFile.strings[a])},pushint:function(a){this.vm.stack.push(this.abcFile.integers[a])},pushuint:function(a){this.vm.stack.push(this.abcFile.uintegers[a])},
pushdouble:function(a){this.vm.stack.push(this.abcFile.doubles[a])},pushscope:function(){var a=this.vm.stack.pop();if(null===a)throw new TypeError("Error #1009: scope can not be null");if(void 0===a)throw new TypeError("Error #1010: scope can not be undefined");this.vm.scope.push(a)},pushnamespace:function(a){this.vm.stack.push(this.abcFile.namespaces[a])},hasnext2:function(a,b){var c=this.vm.localRegisters[b],d=this.vm.localRegisters[a];if(d){var e=d.__nextIndex__(c),c=d.__nextObject__(c);this.vm.localRegisters[b]=
e;this.vm.localRegisters[a]=c;this.vm.stack.push(0!==e)}else this.vm.stack.push(!1)},li8:function(){throw Error("Not implemented");},li16:function(){throw Error("Not implemented");},li32:function(){throw Error("Not implemented");},lf32:function(){throw Error("Not implemented");},lf64:function(){throw Error("Not implemented");},si8:function(){throw Error("Not implemented");},si16:function(){throw Error("Not implemented");},si32:function(){throw Error("Not implemented");},sf32:function(){throw Error("Not implemented");
},sf64:function(){throw Error("Not implemented");},newfunction:function(a){this.vm.stack.push(this.abcFile.methods[a].toFunction(this.vm.scope))},_call:function(a,b,c){var d=this.vm;if(b.__isVmClass__){if(1!=c.length)throw new TypeError("Error #1112: Argument count mismatch on class coercion. Expected 1, got "+c.length);d.stack.push(na.coerce(d.toplevel.global,b,c[0]))}else this.nativeFunctionCallValidation(a,b,c),d.stack.push(b.apply(a,c))},nativeFunctionCallValidation:function(a,b,c){var d=this.vm.toplevel.global,
e=d.Number;if(b==e.prototype.valueOf&&!(a instanceof Number))throw new TypeError("Error #1004: Method was Number.prototype.valueOf invoked on an incompatible object");if(b==e.prototype.toString&&0<c.length){if(isNaN(c[0]))throw new RangeError("Error #1003: The radix argument for Number#toString must be between 2 and 36, was NaN");if(2>c[0]||36<c[0])throw new RangeError("Error #1003: The radix argument for Number#toString must be between 2 and 36, was ["+c[0]+"]");if(0!=c[0]%1)throw new RangeError("Error #1003: The radix argument for Number#toString must be an integer, was ["+
c[0]+"]");}if(b==e.prototype.toPrecision&&0<c.length){if(isNaN(c[0]))throw new RangeError("Error #1002: The precision argument for Number#toPrecision must be between 0 and 20, was NaN");if(2>c[0]||36<c[0])throw new RangeError("Error #1002: The precision argument for Number#toPrecision must be between 0 and 20, was ["+c[0]+"]");if(0!=c[0]%1)throw new RangeError("Error #1002: The precision argument for Number#toPrecision must be an integer between 0 and 20, was ["+c[0]+"]");}if(b==d.Function.prototype.apply&&
1<c.length&&!(c[1]instanceof Array))throw new TypeError("Error #1116: second argument to Function.prototype.apply must be an array");if(b==d.Math)throw new TypeError("Error #1075: Math is not a function");},call:function(a){var a=this.vm.getArgsFromStack(a),b=this.vm.stack.pop(),c=this.vm.stack.pop();if("function"!=typeof c)throw new TypeError("Error #1006: cannot call a non-function");this._call(b,c,a)},construct:function(a){var a=this.vm.getArgsFromStack(a),b=this.vm.stack.pop();if(null===b)throw new TypeError("Error #1007: Constructor instantiation attempted on null");
if(void 0===b)throw new TypeError("Error #1007: Constructor instantiation attempted on undefined");if("object"!=typeof b&&"function"!=typeof b)throw new TypeError("Error #1041: Constructor instantiation attempted on a primitive");if(!(b instanceof Function))throw new TypeError("Error #1007: Constructor instantiation attempted on a non-constructor");this.vm.stack.push(this.vm.construct(b,a))},callmethod:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();
n.assertProperObject(e,d);var f=e.__getUnbound__(d);n.assertProperMethod(f,d);this.vm.stack.push(this.vm.wrap(f).apply(e,c))},callstatic:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.stack.pop();if(null===d)throw new TypeError("Error #1009: Cannot call static null");if(void 0===d)throw new TypeError("Error #1010: Cannot call static undefined");var e=this.abcFile.methods[a].toFunction(this.vm.scope);n.assertProperMethod(e,ma);this.vm.stack.push(this.vm.wrap(e).apply(d,c))},callsuper:function(a,
b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();if(null===e)throw new TypeError("Error #1009: Cannot call super null");if(void 0===e)throw new TypeError("Error #1010: Cannot call super undefined");d=ua.call(this,e).__getUnbound__(d);if(null===d)throw new ReferenceError("Error #1070: Cannot call missing super method");if(void 0===d)throw new ReferenceError("Error #1070: Cannot call missing super method");this.vm.stack.push(d.apply(e,c))},callproperty:function(a,
b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();n.assertProperObject(e,d);var f=e.__getUnbound__(d);n.assertProperMethod(f,d);this._call(e,f,c)},returnvoid:function(){this.vm.returnValue=void 0},returnvalue:function(){this.vm.returnValue=this.vm.stack.pop()},constructsuper:function(a){var a=this.vm.getArgsFromStack(a),b=this.vm.stack.pop();if(null===b)throw new TypeError("Error #1009: Cannot constructsuper on null");if(void 0===b)throw new TypeError("Error #1010: Cannot constructsuper on undefined");
var c=this.vm.toplevel.getType(this.vm.currentMethod.instance.superName);this.vm.validateConstruct(c,a);c.apply(b,a)},constructprop:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();if(null===e)throw new TypeError("Error #1009: Null object can not have constructor properties");if(void 0===e)throw new TypeError("Error #1010: Undefined object can not have constructor properties");d=e.__get__(d);if(d==this.vm.toplevel.global.Array&&1==c.length&&"number"==
typeof c[0]){e=c[0];if(e%1)throw new RangeError("Error #1005: new Array does not accept a single fraction number for initialization");if(0>e)throw new RangeError("Error #1005: new Array does not accept a single negative number for initialization");if(isNaN(e))throw new RangeError("Error #1005: new Array does not accept a NaN for initialization");}this.vm.stack.push(this.vm.construct(d,c))},callproplex:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();
n.assertProperObject(e,d);e=e.__getUnbound__(d);n.assertProperMethod(e,d);this.vm.stack.push(e.apply(null,c))},callsupervoid:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();if(null===e)throw new TypeError("Error #1009: Cannot call supervoid null");if(void 0===e)throw new TypeError("Error #1010: Cannot call supervoid undefined");d=ua.call(this,e).__getUnbound__(d);if(null===d)throw new ReferenceError("Error #1070: Cannot call missing super method");
if(void 0===d)throw new ReferenceError("Error #1070: Cannot call missing super method");d.apply(e,c)},callpropvoid:function(a,b){var c=this.vm.getArgsFromStack(b),d=this.vm.getMultinameByIndex(a),e=this.vm.stack.pop();n.assertProperObject(e,d);var f=e.__getUnbound__(d);n.assertProperMethod(f,d);f.apply(e,c)},sxi1:function(){throw Error("Not implemented");},sxi8:function(){throw Error("Not implemented");},sxi16:function(){throw Error("Not implemented");},applytype:function(a){if(0>=a)throw Error("VerifyError: Vectors require at least one type argument");
if(1<a)throw new TypeError("Error #1128: Incorrect number of type parameters");a=this.vm.stack.pop();if(void 0===a)throw new TypeError("Error #1010: Unable to create Vector of undefined");if(null!==a&&!a.__isClass__)throw Error("VerifyError: Expecting a class...");if(this.vm.stack.pop()!==this.toplevel.global.Vector)throw new TypeError("Error #1010: Unable to create non-Vector<T> types");this.vm.stack.push(this.vm.toplevel.getType(new Rb(j.fromStrings("__AS3__.vec","Vector"),j.fromSymbolClass(a?a.__qualifiedName__:
"Object"))))},newobject:function(a){for(var b={};a--;){var c=this.vm.stack.pop(),d=this.vm.stack.pop();b[d]=c}this.vm.stack.push(b)},newarray:function(a){this.vm.stack.push(this.vm.stack.splice(-a,a))},newactivation:function(){this.vm.stack.push(this.vm.abcFile.createObjectFromTraits(this.vm.body.traits))},newclass:function(a){var b=this.vm,c=b.abcFile,d=b.toplevel,e=b.stack.pop(),f=this.abcFile.instances[a],a=this.abcFile.classes[a],g;f.isInterface?g=Tb(d,c,b,f.name):(g=f.initializer.toFunction(b.scope),
g.__capturedScope__.push(g),g.__super__=e.prototype,e=g.prototype=Object.create(e.prototype),c.createObjectFromTraits(a.traits,g,b.scope),c.createObjectFromTraits(f.traits,e,b.scope,g,{skipSlots:!0}),Sb(d,c,b,f.interfaces,g.prototype),f.initializer.currentMethod.instance=f,a.initializer.toFunction(b.scope).apply(g),Object.defineProperties(e,{constructor:{value:g},__slotDescriptors__:{value:Ua(e,c)}}));Object.defineProperties(g,{__isClass__:{value:!0},__isVmClass__:{value:!0},__name__:{value:f.name.name},
__qualifiedName__:{value:f.name.toString()},displayName:{value:f.name.name}});b.stack.push(g)},getdescendants:function(a){var b=this.vm.toplevel.getType(j.fromStrings("","XML")),c=this.vm.toplevel.getType(j.fromStrings("","XMLList")),a=this.vm.getMultinameByIndex(a),d=this.vm.stack.pop();if(!(d instanceof b)||!(d instanceof c))throw new TypeError("Error #1016: Object is not of type XML or XMLList");this.vm.stack.push(d.descendants(a.name))},newcatch:function(a){this.vm.stack.push(this.vm.getExceptionHandlerByIndex(a).createCatchScope())},
findpropstrict:function(a){this.vm.stack.push(this.vm.scope.strictFind(this.vm.getMultinameByIndex(a)))},findproperty:function(a){this.vm.stack.push(this.vm.scope.find(this.vm.getMultinameByIndex(a),!0))},finddef:function(){throw Error("Not implemented");},getlex:function(a){this.vm.op.findpropstrict(a);this.vm.op.getproperty(a)},setproperty:function(a){var b=this.vm,c=b.stack.pop(),a=b.getMultinameByIndex(a),b=b.stack.pop();if(null===b)throw new TypeError("Error #1009: Unable to set property on null");
if(void 0===b)throw new TypeError("Error #1010: Unable to set property on undefined");b.__set__(a,c)},getlocal:function(a){this.vm.stack.push(this.vm.localRegisters[a])},setlocal:function(a){this.vm.localRegisters[a]=this.vm.stack.pop()},getglobalscope:function(){this.vm.stack.push(this.toplevel.global)},getscopeobject:function(a){this.vm.stack.push(this.vm.scope.get(a))},getproperty:function(a){var b=this.vm,a=b.getMultinameByIndex(a),c=b.stack.pop();if(null===c)throw new TypeError("Error #1009: Unable to get property from null");
if(void 0===c)throw new TypeError("Error #1010: Unable to get property from undefined");a=c.__get__(a);b.stack.push(a)},getouterscope:function(){throw Error("Not implemented");},initproperty:function(a){var b=this.vm.stack.pop(),a=this.vm.getMultinameByIndex(a),c=this.vm.stack.pop();if(null===c)throw new TypeError("Error #1009: Unable to init null");if(void 0===c)throw new TypeError("Error #1010: Unable to init undefined");c.__set__(a,b)},deleteproperty:function(a){var a=this.vm.getMultinameByIndex(a),
b=this.vm.stack.pop();if(null===b)throw new ReferenceError("Error #1009: Cannot delete from null object");if(void 0===b)throw new ReferenceError("Error #1010: Cannot delete from undefined object");this.vm.stack.push(b.__deleteProperty__(a))},getslot:function(a){var b=this.vm.stack.pop();if(null===b)throw new TypeError("Error #1009: Unable to get slot on null");if(void 0===b)throw new TypeError("Error #1010: Unable to get slot on undefined");this.vm.stack.push(b.__get__(b.__slots__[a].name))},setslot:function(a){var b=
this.vm.stack.pop(),c=this.vm.stack.pop();if(null===c)throw new TypeError("Error #1009: Unable to set slot on null");if(void 0===c)throw new TypeError("Error #1010: Unable to set slot on undefined");c.__set__(c.__slots__[a].name,b)},getglobalslot:function(){throw Error("Not implemented");},setglobalslot:function(){throw Error("Not implemented");},convert_s:function(){var a=this.vm.stack.pop();null!=a&&(a=""+a);this.vm.stack.push(a)},esc_xelem:function(){this.vm.stack.push(this.vm.stack.pop().toXmlString())},
esc_xattr:function(){throw Error("Not implemented");},convert_i:function(){this.vm.stack.push(m(this.vm.stack.pop()))},convert_u:function(){this.vm.stack.push(Ta(this.vm.stack.pop()))},convert_d:function(){this.vm.stack.push(+this.vm.stack.pop())},convert_b:function(){var a=this.vm.stack.pop();this.vm.stack.push(Boolean(a))},convert_o:function(){var a=this.vm.stack.pop();if(null===a)throw new TypeError("Error #1009: Unable to convert null to an object");if(void 0===a)throw new TypeError("Error #1010: Unable to convert undefined to an object");
var b=typeof a;if("object"!=b&&"function"!=b)throw new TypeError("Error #1034: Convert_o only passes objects, this wasnt one");this.vm.stack.push(a)},checkfilter:function(){var a=this.vm.toplevel.getType(j.fromStrings("","XML")),b=this.vm.toplevel.getType(j.fromStrings("","XMLList")),c=this.vm.stack.pop();if(!(c instanceof a)&&!(c instanceof b))throw new TypeError("Error #1123: Object is not of type XML or XMLList");this.vm.stack.push(c)},coerce:function(a){var b=this.vm,a=b.getMultinameByIndex(a),
c=b.stack.pop(),a=na.coerceToName(b.toplevel,a,c);b.stack.push(a)},coerce_b:function(){throw Error("Not implemented");},coerce_a:function(){},coerce_i:function(){throw Error("Not implemented");},coerce_d:function(){throw Error("Not implemented");},coerce_s:function(){var a=this.vm.stack.pop();null==a?this.vm.stack.push(null):this.vm.stack.push(""+a)},astype:function(){throw Error("Not implemented");},astypelate:function(){var a=this.vm,b=a.stack.pop(),c=a.stack.pop(),d,e=null;if(!b||!b.__isClass__)throw new TypeError("Error #1040: Expecting a class in as check");
if(null!==c&&void 0!==c)switch(d=a.toplevel.global,b){case d.String:if(c instanceof b||"string"===typeof c)e=c;break;case d.Object:e=c;break;case d.Number:e=c!==c||c instanceof b||b(c)===c?c:null;break;case d.Boolean:case d.int:case d.uint:e=c instanceof b||b(c)===c?c:null;break;default:e=na.coerceClass(d.Class,b,c,null)}a.stack.push(e)},coerce_u:function(){throw Error("Not implemented");},coerce_o:function(){var a=this.vm.stack[this.vm.stack.length-1];if(null===a)throw new TypeError("Error #1009: Unable to coerce null to an object");
if(void 0===a)throw new TypeError("Error #1010: Unable to coerce undefined to an object");},negate:function(){this.vm.stack.push(-ja(this.vm.stack.pop()))},increment:function(){this.vm.stack.push(ja(this.vm.stack.pop())+1)},inclocal:function(){throw Error("Not implemented");},decrement:function(){this.vm.stack.push(ja(this.vm.stack.pop())-1)},declocal:function(){throw Error("Not implemented");},"typeof":function(){var a=this.vm.toplevel.getType(j.fromStrings("","int")),b=this.vm.toplevel.getType(j.fromStrings("",
"uint")),c=this.vm.toplevel.getType(j.fromStrings("","XML")),d=this.vm.toplevel.getType(j.fromStrings("","XMLList")),e=this.vm.stack,f=e.pop();void 0===f?e.push("undefined"):null===f?e.push("object"):"boolean"==typeof f||f instanceof Boolean?e.push("boolean"):"number"==typeof f||f instanceof Number?e.push("number"):f instanceof a?e.push("number"):f instanceof b?e.push("number"):"string"==typeof f||f instanceof String?e.push("string"):"function"==typeof f?e.push("function"):f instanceof c||f instanceof
d?e.push("xml"):e.push("object")},not:function(){this.vm.stack.push(!this.vm.stack.pop())},bitnot:function(){this.vm.stack.push(~this.vm.stack.pop())},lookupswitch:function(a,b,c){var d=this.vm.stack.pop();this.vm.nextLabel=isNaN(d)||0>d||d>a?b:arguments[d+2]},add:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()+b)},subtract:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()-b)},multiply:function(){var a=this.vm.stack;a.push(a.pop()*a.pop())},divide:function(){var a=this.vm.stack,b=a.pop();
a.push(a.pop()/b)},modulo:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()%b)},lshift:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()<<b)},rshift:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()>>b)},urshift:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()>>>b)},bitand:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()&b)},bitor:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()|b)},bitxor:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()^b)},equals:function(){var a=
this.vm.stack;a.push(a.pop()==a.pop())},strictequals:function(){var a=this.vm.stack,b=a.pop(),c=a.pop();c===b?a.push(!0):a.push(("number"===typeof c||c instanceof Number)&&("number"===typeof b||b instanceof Number)||("boolean"===typeof c||c instanceof Boolean)&&("boolean"===typeof b||b instanceof Boolean)||("string"===typeof c||c instanceof String)&&("string"===typeof b||b instanceof String)?c==b||c.valueOf()==b:!1)},lessthan:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()<b)},lessequals:function(){var a=
this.vm.stack,b=a.pop();a.push(a.pop()<=b)},greaterthan:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()>b)},greaterequals:function(){var a=this.vm.stack,b=a.pop();a.push(a.pop()>=b)},"instanceof":function(){var a=this.vm.stack.pop(),b=this.vm.stack.pop();if(!a||"object"!=typeof a&&"function"!=typeof a)throw new TypeError("Error #1040: Expecting an object in instanceof check, but got "+a);a===this.vm.toplevel.global.Class&&b.__isClass__?this.vm.stack.push(!0):this.vm.stack.push(b instanceof
a)},istype:function(){throw Error("Not implemented");},istypelate:function(){var a=this.vm.stack.pop(),b=this.vm.stack.pop();if(a.__is__)this.vm.stack.push(!!a.__is__(b));else{switch(typeof a){case "string":case "number":case "boolean":throw new TypeError("Error #1009: Invalid type on rhs, does not have required properties");}if("function"!=typeof a)throw new TypeError("Error #1041: Expecting a class in istypelate check, but got "+b);var c=null,d=this.toplevel.global;if("string"==typeof b&&(a==d.String||
a==d.Object))c=!0;else if("boolean"==typeof b&&(a==d.Boolean||a==d.Object))c=!0;else if("number"==typeof b)if(a==d.Number||a==d.Object)c=!0;else if(0==b%1){var e=d["int"];a==e?c=b>=e.MIN_VALUE&&b<=e.MAX_VALUE:(d=d.uint,a==d&&(c=b>=d.MIN_VALUE&&b<=d.MAX_VALUE))}null===c&&(c=b instanceof a);this.vm.stack.push(c)}},"in":function(){var a=this.vm.stack.pop(),b=this.vm.stack.pop(),c=Qb.exports.tools.expando;a[c]&&a[c].has?this.vm.stack.push(a.__has__(j.fromStrings("",b))):this.vm.stack.push(b in Object(a))},
increment_i:function(){this.vm.stack.push(m(this.vm.stack.pop())+1)},decrement_i:function(){this.vm.stack.push(m(this.vm.stack.pop())-1)},inclocal_i:function(a){var b=this.vm.localRegisters;b[a]=(b[a]|0)+1},declocal_i:function(a){var b=this.vm.localRegisters;b[a]=(b[a]|0)-1},negate_i:function(){throw Error("Not implemented");},add_i:function(){var a=this.vm.stack;a.push(m(m(a.pop())+m(a.pop())))},subtract_i:function(){var a=this.vm.stack,b=a.pop();a.push(m(a.pop())-(b|0))},multiply_i:function(){var a=
this.vm.stack;a.push(m(m(a.pop())*m(a.pop())))},getlocal0:function(){this.vm.stack.push(this.vm.localRegisters[0])},getlocal1:function(){this.vm.stack.push(this.vm.localRegisters[1])},getlocal2:function(){this.vm.stack.push(this.vm.localRegisters[2])},getlocal3:function(){this.vm.stack.push(this.vm.localRegisters[3])},setlocal0:function(){this.vm.localRegisters[0]=this.vm.stack.pop()},setlocal1:function(){this.vm.localRegisters[1]=this.vm.stack.pop()},setlocal2:function(){this.vm.localRegisters[2]=
this.vm.stack.pop()},setlocal3:function(){this.vm.localRegisters[3]=this.vm.stack.pop()},debug:T,debugline:T,debugfile:T,bkptline:function(){throw Error("Not implemented");},timestamp:function(){throw Error("Not implemented");}};var n={assertProperObject:function(a,b){if(null===a)throw new TypeError("Error #1009: Cannot call method '"+b+"' of null");if("undefined"===typeof a)throw new TypeError("Error #1010: Cannot call method '"+b+"' of undefined");},assertProperMethod:function(a,b){if(null===a)throw new TypeError("Error #1009: Cannot call null property '"+
b+"'");if("undefined"===typeof a)throw new TypeError("Error #1010: Cannot call undefined property '"+b+"'");if(!1===a)throw new TypeError("(AS3) Cannot call false property '"+b+"'");}};H.module$exports=Fa;H.module$exports&&(H=H.module$exports);var Y={module$exports:{convertRest:function(a,b){var c=a.slice(0,b),d=a.slice(b);c.push(d);return c},setDefaults:function(a,b,c){var d=c-b.length;b.forEach(function(b,c){var g=d+c;g in a||(a[g]=b)})},toRegisters:function(a,b){return[a].concat(b)}}};Y.module$exports&&
(Y=Y.module$exports);var I={},ab=q;I.module$exports={addToBuiltins:function(a){a.Object.prototype.__get__||(Za(a.Object.prototype),a.Vector&&$a(a.Vector.prototype))}};I.module$exports&&(I=I.module$exports);var J={},Vb=I,ka=k.QName;J.module$exports=function(a,b){var b=b||{},c=b.map||{};Vb.addToBuiltins(a);va(a,c);c.__set__(ka.fromStrings("__AS3__.vec","Vector"),c.Vector);return c};J.module$exports&&(J=J.module$exports);var K={};wa.prototype={push:function(a){this.scopes.push(a);this.localOffset++},
toScope:function(){return z.fromCapturedScope(this)}};z.fromCapturedScope=function(a){var b=new z(a.global);b.scopes=a.scopes.slice(0);b.localOffset=a.scopes.length;return b};z.prototype={global:null,localOffset:null,scopes:null,capture:function(){return new wa(this)},clear:function(){this.localOffset=0;this.scopes=[]},find:function(a){(a=this._find(a))||(a=this.global);return a},_find:function(a){var b;this.scopes.slice().reverse().some(function(c){if(c.__has__(a))return b=c,!0});return!b&&this.global.__has__(a)?
this.global:b},get:function(a){var b=this.localOffset+a;if(!(b in this.scopes))throw Error("Cannot get scope object at index "+a);return this.scopes[b]},pop:function(){if(this.scopes.length===this.localOffset)throw Error("Cannot pop empty scope stack");return this.scopes.pop()},push:function(a){this.scopes.push(a)},strictFind:function(a){var b=this._find(a);if(!b)throw new ReferenceError("Error #1065: Variable/property not defined: "+a);return b}};K.module$exports=z;K.module$exports&&(K=K.module$exports);
var L={},eb=J,fb=k;xa.prototype={getPreConstructorHook:function(a){a=U(a);return this.hooks.__get__(a)},getType:function(a){a=U(a);if(!this.global.__has__(a))throw new TypeError("Cannot find type "+a);return this.global.__get__(a)},hasPreConstructorHook:function(a){a=U(a);return this.hooks.__has__(a)},runAbc:function(a){return this.abcs[a].run()},setPreConstructorHook:function(a,b){a=U(a);this.hooks.__set__(a,b)}};L.module$exports=xa;L.module$exports&&(L=L.module$exports);var o={},Ga=ya(),oa=ya();
oa.prototype.isSlot=!0;V.create=function(a,b,c,d){return new V(b,d.slot_id,a.classes[d.classi])};W.create=function(a,b,c,d){return new W(b,d.slot_id,a.methods[d["function"]])};A.create=function(a,b,c,d){return new A(b,d.disp_id,a.methods[d.method],{isFinal:!!(c&1),isOverride:!!(c&2)})};A.prototype={isMethod:!0,toInterfaceDescriptor:function(a){return{get:function(){return this[a]}}}};B.create=function(a,b,c,d){return new B(b,d.disp_id,a.methods[d.method],{isFinal:!!(c&1),isOverride:!!(c&2)})};B.prototype=
{isGetter:!0,toInterfaceDescriptor:function(a){return{configurable:!0,get:function(){var b=Object.getOwnPropertyDescriptor(this.constructor.prototype,a).get;return b()}}}};C.create=function(a,b,c,d){return new C(b,d.disp_id,a.methods[d.method],{isFinal:!!(c&1),isOverride:!!(c&2)})};C.prototype={isSetter:!0,toInterfaceDescriptor:function(a){return{configurable:!0,set:function(b){var c=Object.getOwnPropertyDescriptor(this.constructor.prototype,a).set;c(b)}}}};var Wb={"0":oa,1:A,2:B,3:C,4:V,5:W,6:Ga};
o.module$exports={ConstTrait:Ga,ClassTrait:V,FunctionTrait:W,GetterTrait:B,MethodTrait:A,SetterTrait:C,SlotTrait:oa,create:function(a,b){return Wb[b.kind&15].create(a,a.multinames[b.name],b.kind>>>4,b.data)}};o.module$exports&&(o=o.module$exports);var M={},hb=o,Ha={create:function(a,b){var c=a.methods[b.cinit],d=gb(a,b.trait);return new Xb(c,d)}},Xb=Ha.Class=function(a,b){this.initializer=a;this.traits=b};M.module$exports=Ha;M.module$exports&&(M=M.module$exports);var N={},Yb=k,Zb=o,Ia={create:function(a,
b){return new r(a,b.from,b.to,b.target,0===b.exc_type?r.ANY_TYPENAME:a.multinames[b.exc_type],a.multinames[b.var_name])}},r=Ia.Exception=function(a,b,c,d,e,f){this.abcFile=a;this.from=b;this.to=c;this.target=d;this.typeName=e;this.varName=f};r.ANY_TYPENAME=Yb.QName.fromStrings("","Object");r.prototype.createCatchScope=function(){return!this.varName?{}:this.abcFile.createObjectFromTraits([new Zb.SlotTrait(this.varName,1,this.typeName)])};r.prototype.handles=function(a,b){if(this.handlesAny())return!0;
var c=a.__get__(this.typeName);return c instanceof Function&&b instanceof c};r.prototype.handlesAny=function(){return this.typeName===r.ANY_TYPENAME};r.prototype.isRelatedTo=function(a){return this.from===a.from&&this.to===a.to};N.module$exports=Ia;N.module$exports&&(N=N.module$exports);var O={},kb=o,Ja={create:function(a,b){var c=a.multinames[b.name],d;d=0!==b.super_name?a.multinames[b.super_name]:void 0;var e={isSealed:!!(b.flags&1),isFinal:!!(b.flags&2),isInterface:!!(b.flags&4),hasProtectedNamespace:!!(b.flags&
8)},f;f=e.hasProtectedNamespace?a.namespaces[b.protectedNs]:void 0;var g=ib(a,b),p=a.methods[b.iinit],h=jb(a,b.trait);return new $b(c,d,e,f,g,p,h)}},$b=Ja.Instance=function(a,b,c,d,e,f,g){this.name=a;this.superName=b;this.isSealed=c.isSealed;this.isFinal=c.isFinal;this.isInterface=c.isInterface;this.protectedNamespace=d;this.interfaces=e;this.initializer=f;this.traits=g};O.module$exports=Ja;O.module$exports&&(O=O.module$exports);var P={},mb=N,ob=o,Ka={create:function(a,b){var c=a.methodSignatures[b.method],
d=b.max_stack,e=b.local_count,f=b.init_scope_depth,g=b.max_scope_depth,p=b.code,h=lb(a,b.exception),i=nb(a,b.trait);return new ac(c,d,e,f,g,p,h,i)}},ac=Ka.MethodBody=function(a,b,c,d,e,f,g,h){this.signature=a;this.maxStack=b;this.localCount=c;this.initScopeDepth=d;this.maxScopeDepth=e;this.code=f;this.exceptions=g;this.traits=h};P.module$exports=Ka;P.module$exports&&(P=P.module$exports);var Q={},bc=H,cc=k,la=Y,dc=Array.prototype.slice,Aa=x.coerceToName;za.prototype={toFunction:function(a){var b=a.capture(),
c=this,a=function(){var a=Object.create(c);a.localRegisters=pb(this,dc.call(arguments),a.getSignature(),a.toplevel);a.nextLabel="start";a.op=new bc(a);a.registeredExceptions=[];a.scope=b.toScope();a.stack=[];(function f(){try{a.currentMethod(a)}catch(b){a.tryHandlingException(b,f)}})();return a.coerceReturnValue(a.returnValue)};a.__capturedScope__=b;a.__method__=this.currentMethod;return a},coerceReturnValue:function(a){var b=this.getReturnTypeName();return Aa(this.toplevel,b,a)},construct:function(a,
b){this.validateConstruct(a,b);return this._construct(a,b)},_construct:function(a,b){var b=b||[],c=b.length,d,e,f=a.prototype||Object.prototype,g=f.__slotDescriptors__||void 0,h=a.__qualifiedName__;h&&(e=this.toplevel.hasPreConstructorHook(h)&&this.toplevel.getPreConstructorHook(h));if(g||e||7<c)d=Object.create(f,g),e&&e(d),c=a.apply(d,b),Object(c)===c&&(d=c);else switch(c){case 0:d=new a;break;case 1:d=new a(b[0]);break;case 2:d=new a(b[0],b[1]);break;case 3:d=new a(b[0],b[1],b[2]);break;case 4:d=
new a(b[0],b[1],b[2],b[3]);break;case 5:d=new a(b[0],b[1],b[2],b[3],b[4]);break;case 6:d=new a(b[0],b[1],b[2],b[3],b[4],b[5]);break;case 7:d=new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6])}Object.defineProperty(d,"constructor",{value:a});return d},validateConstruct:function(a,b){if(!a||!(a instanceof Function)){if(a&&a.__isClass__)throw Error("Oh dear, we need to handle the non-function __isClass__ cases explicitly, `new` wont work");throw new TypeError("Error 1041: (vm.validateConstruct) Expected function to be a constructor");
}if(a.__isMethodClosure__)throw new TypeError("Error #1064: Cannot call method closure as constructor");if(a==this.toplevel.global.Array&&1==b.length&&"number"==typeof b[0]){if(0>b[0]||0!=b[0]%1)throw new RangeError("Error #1005: Given initial array length is not a positive integer");if(isNaN(b[0]))throw new RangeError("Error #1005: Given initial array length index is NaN");}if(a==this.toplevel.global.Math)throw new TypeError("Error #1076: Math is not a constructor");if(a==this.toplevel.global.Function&&
b.length)throw new EvalError("Error #1066: The form function('function body') is not supported");},deregisterException:function(a){a=this.registeredExceptions.indexOf(this.currentMethod.methodBody.exceptions[a]);-1!==a&&this.registeredExceptions.splice(a,1)},findExceptionHandler:function(a){var b;this.registeredExceptions.slice().reverse().some(function(c){if(c.handles(this.toplevel.global,a))return this.removeRelatedExceptionHandlers(c),b=c,!0},this);return b},getArgsFromStack:function(a){var b=
this.stack.splice(-a,a);if(b.length!==a)throw new (this.toplevel.getType(cc.QName.fromStrings("","ArgumentError")))("Error #2001: Insufficient arguments on stack");return b},getMethodTraits:function(){return this.body.traits},getMultinameByIndex:function(a){return this.abcFile.multinames[a].resolve(this.stack)},getSignature:function(){return this.signature},getReturnTypeName:function(){return this.signature.returnType},getExceptionHandlerByIndex:function(a){return this.currentMethod.methodBody.exceptions[a]},
"goto":function(){if(1E5<++this.loopProtection)throw Error("Runaway loop protection (vm.js:goto)");return this.nextLabel},handleException:function(a,b,c){this.nextLabel=b.targetLabel;this.scope.clear();this.stack=[a];c()},removeRelatedExceptionHandlers:function(a){this.registeredExceptions=this.registeredExceptions.filter(function(b){return!a.isRelatedTo(b)})},registerException:function(a,b){var c=this.currentMethod.methodBody.exceptions[a];c.targetLabel=b;this.registeredExceptions.push(c)},tryHandlingException:function(a,
b){var c=this.findExceptionHandler(a);if(c)this.handleException(a,c,b);else throw a;}};Q.module$exports=za;Q.module$exports&&(Q=Q.module$exports);var R={},qb=K,sb=o;X.create=function(a,b){var c=a.methods[b.init],d=rb(a,b.trait);return new X(a,c,d)};X.prototype={run:function(){if(!this.executed)return this.executed=!0,this.global=this.abcFile.createObjectFromTraits(this.traits,this.abcFile.toplevel.global,this.scope),this.method.toFunction(this.scope).call(this.global)}};R.module$exports=X;R.module$exports&&
(R=R.module$exports);var S={},Ib=Q,Jb=M,Kb=O,Hb=P,Gb=E,Fb=k,Db=y,Eb=G,Lb=R;w.constantKindGetters={1:function(a){return this.strings[a]},3:function(a){return this.integers[a]},4:function(a){return this.uintegers[a]},6:function(a){return this.doubles[a]},10:function(){return!1},11:function(){return!0},12:function(){return null},"0":function(){},8:s,22:s,23:s,24:s,25:s,26:s,5:s};w.prototype={coerceTraitValue:function(a){if(!a.typeName)return a.value;switch(a.typeName.name){case "Object":case "String":if(!a.value)return null;
case "Boolean":case "Number":case "int":case "uint":return(0,this.toplevel.global[a.typeName.name])(a.value)}},createObjectFromTraits:function(a,b,c,d,e){var b=b||{},f=b.__traits__;f?b.__traits__=f.concat(a):Object.defineProperties(b,{__traits__:{value:a,writable:!0},__slots__:{value:[]}});var g=!(!e||!e.skipSlots);a.forEach(function(a){var e=this.coerceTraitValue(a),f=0;"slotId"in a&&(b.__slots__[a.slotId||++f]=a);if("dispatchId"in a){e=e.toFunction(c);d&&e.__capturedScope__.push(d);Object.defineProperty(e,
"__isMethod__",{enumerable:!1,value:!0,writable:!1});var f={configurable:!0},h=a.isGetter?"get":a.isSetter?"set":"value";f[h]=e;"value"===h&&(f.writable=!0);Object.defineProperty(b,a.name.toProperty(),f)}else(!g||!a.isSlot)&&Object.defineProperty(b,a.name.toProperty(),{value:e,writable:!0})},this);return b},getConstant:function(a,b){if(!(a in w.constantKindGetters))throw Error("Cannot get unknown constant kind from abcFile: "+a);return w.constantKindGetters[a].call(this,b)},getMethodBodyBySignature:function(a){var b;
this.methodBodies.some(function(c){if(c.signature===a)return b=c,!0});return b},hasType:function(a){var b;this.scripts.some(function(c){c.traits.some(function(d){if(d.name.name===a.name)return b=c,!0})});return b&&!b.executed?(b.run(),!0):!1},run:function(){this.scripts.slice(-1)[0].run()}};w.getMethodNameByIndex=function(a,b){for(var c,d=a.methods[b],e=0;e<a.classes.length;++e){var f=a.classes[e],g=a.instances[e];f.initializer===d&&(c=g.name.name+"_$StaticInitializer$");g.initializer===d&&(c=g.name.name+
"_$Constructor$");f.traits.some(function(a){if(a.method===d)return c=g.name.name+"_"+a.name.name+"_$StaticMethod$",!0});g.traits.some(function(a){if(a.method===d)return c=g.name.name+"_"+a.name.name,!0});if(c)break}return c};S.module$exports=w;S.module$exports&&(S=S.module$exports);var Z={},La=q,Ma={AbcFile:S,TopLevel:L,multiname:k};"undefined"!==typeof La.exports&&(La.exports.as3vm=Ma);Z.module$exports=Ma;Z.module$exports&&(Z=Z.module$exports)})();